本文整理汇总了C++中TChain::MakeClass方法的典型用法代码示例。如果您正苦于以下问题:C++ TChain::MakeClass方法的具体用法?C++ TChain::MakeClass怎么用?C++ TChain::MakeClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TChain
的用法示例。
在下文中一共展示了TChain::MakeClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
/// Main function that runs the analysis algorithm on the
/// specified input files
int main(int argc, char* argv[]) {
/// Gets the list of input files and chains
/// them into a single TChain
char inputFileName[150];
char settingFileName[150];
char outFileName[150];
if ( argc < 3 ){
cout << "Error at Input: please specify an input file including the list of input ROOT files" << endl;
cout << " and an input file including the initialization values of the analysis parameters" << endl;
cout << "Example: ./AlpgenValidation list.txt settings.txt output.root" << endl;
return 1;
}
strcpy(inputFileName,argv[1]);
strcpy(settingFileName,argv[2]);
strcpy(outFileName,argv[3]);
TChain *theChain = new TChain("ntp1");
char Buffer[500];
char MyRootFile[2000];
std::cout << "input: " << inputFileName << std::endl;
ifstream *inputFile = new ifstream(inputFileName);
while( !(inputFile->eof()) ){
inputFile->getline(Buffer,500);
if (!strstr(Buffer,"#") && !(strspn(Buffer," ") == strlen(Buffer)))
{
sscanf(Buffer,"%s",MyRootFile);
theChain->Add(MyRootFile);
std::cout << "chaining " << MyRootFile << std::endl;
}
}
inputFile->close();
delete inputFile;
theChain->MakeClass("thisiswhyitcrashed");
ThiagoAnalysis vecbos(theChain);
vecbos.ReadParameters(settingFileName);
vecbos.Loop(outFileName);
system("\\rm thisiswhyitcrashed.h");
system("\\rm thisiswhyitcrashed.C");
return 0;
}