24 #ifdef XAOD_STANDALONE
50 std::cout <<
"Running options:" << std::endl;
51 std::cout <<
" --help : To get the help you're reading" << std::endl;
52 std::cout <<
" --jetCalibConfig= : Specify the JetCalibTools config" << std::endl;
53 std::cout <<
" --jetColl= : Specify the jet collection" << std::endl;
54 std::cout <<
" --calibSeq= : Specify the calibration sequence for JetCalibTools" << std::endl;
55 std::cout <<
" --calibArea : Specify the calibration area for JetCalibTools" << std::endl;
56 std::cout <<
" --isData=TRUE : Specify isData true for JetCalibTools" << std::endl;
57 std::cout <<
" --isData=FALSE : Specify isData false for JetCalibTools" << std::endl;
58 std::cout <<
" --sample= : Specify input xAOD" << std::endl;
59 std::cout <<
" --devMode : Set dev mode for calibration sequence" << std::endl;
60 std::cout <<
" Example: Example --jetCalibConfig=JES_2015dataset_recommendation_Feb2016.config --jetColl=AntiKt4EMTopo --calibSeq=JetArea_Residual_Origin_EtaJES_GSC --isData=FALSE --sample=xAOD.root" << std::endl;
69 using namespace asg::msgUserCode;
75 std::string isData =
"";
77 std::string jetColl =
"";
78 std::string jetCalibConfig =
"";
79 std::string calibSeq =
"";
80 std::string calibArea =
"";
82 bool isCollision =
false;
89 std::string
opt(
argv[
i]); std::vector< std::string >
v;
91 std::istringstream iss(
opt);
96 while (std::getline(iss,
item, delim)){
100 if (
opt.find(
"--help") != std::string::npos ) {
104 if (
opt.find(
"--sample=") != std::string::npos )
sample =
v[1];
106 if (
opt.find(
"--jetColl=") != std::string::npos ) jetColl =
v[1];
108 if (
opt.find(
"--jetCalibConfig=") != std::string::npos ) jetCalibConfig =
v[1];
110 if (
opt.find(
"--calibSeq=") != std::string::npos ) calibSeq =
v[1];
112 if (
opt.find(
"--calibArea=") != std::string::npos ) calibArea =
v[1];
114 if (
opt.find(
"--isData=") != std::string::npos ) isData =
v[1];
116 if (
opt.find(
"--devMode") != std::string::npos ) devMode =
true;
121 std::cout <<
"No input xAOD file specified, exiting" << std::endl;
125 std::cout <<
"No jet collection specified, exiting" << std::endl;
128 if(jetCalibConfig.empty()){
129 std::cout <<
"No JetCalibTools config specified, exiting" << std::endl;
132 if(calibSeq.empty()){
133 std::cout <<
"No calibration sequence specified, exiting" << std::endl;
137 std::cout <<
"isData not specified, exiting" << std::endl;
140 else if(isData==
"TRUE") isCollision =
true;
145 std::unique_ptr< TFile >
ifile( TFile::Open(
sample.c_str(),
"READ" ) );
148 #ifdef XAOD_STANDALONE
155 std::shared_ptr<AthOnnx::IOnnxRuntimeSvc> service;
157 #else // Athena "Store" is the same StoreGate used by the TEvent
165 const std::string name_JetCalibTools =
"JetCalib_Example";
169 ANA_CHECK( jetCalibrationTool.setProperty(
"JetCollection",jetColl.c_str()) );
171 ANA_CHECK( jetCalibrationTool.setProperty(
"CalibSequence",calibSeq.c_str()) );
173 ANA_CHECK( jetCalibrationTool.setProperty(
"ConfigFile",jetCalibConfig.c_str()) );
175 ANA_CHECK( jetCalibrationTool.setProperty(
"IsData",isCollision) );
177 if(!calibArea.empty()){
178 ANA_CHECK( jetCalibrationTool.setProperty(
"CalibArea",calibArea.c_str()) );
181 ANA_CHECK( jetCalibrationTool.setProperty(
"DEVmode", devMode ) );
184 if(!(jetCalibrationTool.
initialize().isSuccess())){
185 std::cout <<
"Initialization of JetCalibTools failed, exiting" << std::endl;
193 const Long64_t
nevents =
event.getEntries();
194 for(Long64_t ievent = 0; ievent <
nevents; ++ievent){
198 std::cerr <<
"Failed to load entry " << ievent << std::endl;
203 if(ievent % 100==0) std::cout <<
"Event " << ievent <<
" of " <<
nevents << std::endl;
215 delete jets_shallowCopy.first;
216 delete jets_shallowCopy.second;