44 std::cout <<
"Running options:" << std::endl;
45 std::cout <<
" --help : To get the help you're reading" << std::endl;
46 std::cout <<
" --jetColl= : Specify the jet collection" << std::endl;
47 std::cout <<
" --sample= : Specify input xAOD" << std::endl;
48 std::cout <<
" Example: Example --jetColl=AntiKt4EMTopo --sample=xAOD.root" << std::endl;
61 std::string jetColl =
"";
68 std::string
opt(
argv[
i]); std::vector< std::string >
v;
70 std::istringstream iss(
opt);
75 while (std::getline(iss,
item, delim)){
79 if (
opt.find(
"--help") != std::string::npos ) {
83 if (
opt.find(
"--sample=") != std::string::npos )
sample =
v[1];
85 if (
opt.find(
"--jetColl=") != std::string::npos ) jetColl =
v[1];
90 std::cout <<
"No input xAOD file specified, exiting" << std::endl;
94 std::cout <<
"No jet collection specified, exiting" << std::endl;
99 static const char*
APP_NAME =
"JetJvtTools_Example";
105 std::unique_ptr< TFile >
ifile( TFile::Open(
sample.c_str(),
"READ" ) );
117 const std::string name_JetJvtTool =
"JetJvt_Example";
118 const std::string name_JetfJvtTool =
"JetfJvt_Example";
124 jvtTool.setProperty(
"JVTFileName",
125 "JetMomentTools/JVTlikelihood_20140805.root"));
128 if(!(jvtTool.initialize().isSuccess())){
129 std::cout <<
"Initialization of JetJvtTools failed, exiting" << std::endl;
132 if(!(fjvtTool.initialize().isSuccess())){
133 std::cout <<
"Initialization of JetJvtTools failed, exiting" << std::endl;
141 const Long64_t
nevents =
event.getEntries();
142 for(Long64_t ievent = 0; ievent <
nevents; ++ievent){
145 if(
event.getEntry( ievent ) < 0 ) {
146 std::cerr <<
"Failed to load entry " << ievent << std::endl;
151 if(ievent % 100==0) std::cout <<
"Event " << ievent <<
" of " <<
nevents << std::endl;
162 jvtTool.updateJvt( *
jet );
166 delete jets_shallowCopy.first;
167 delete jets_shallowCopy.second;