|
ATLAS Offline Software
|
Go to the documentation of this file.
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 <<
" Example: Example --jetCalibConfig=JES_2015dataset_recommendation_Feb2016.config --jetColl=AntiKt4EMTopo --calibSeq=JetArea_Residual_Origin_EtaJES_GSC --isData=FALSE --sample=xAOD.root" << std::endl;
68 using namespace asg::msgUserCode;
76 std::string jetColl =
"";
77 std::string jetCalibConfig =
"";
78 std::string calibSeq =
"";
79 std::string calibArea =
"";
80 bool isCollision =
false;
87 std::string
opt(
argv[
i]); std::vector< std::string >
v;
89 std::istringstream iss(
opt);
94 while (std::getline(iss,
item, delim)){
98 if (
opt.find(
"--help") != std::string::npos ) {
102 if (
opt.find(
"--sample=") != std::string::npos )
sample =
v[1];
104 if (
opt.find(
"--jetColl=") != std::string::npos ) jetColl =
v[1];
106 if (
opt.find(
"--jetCalibConfig=") != std::string::npos ) jetCalibConfig =
v[1];
108 if (
opt.find(
"--calibSeq=") != std::string::npos ) calibSeq =
v[1];
110 if (
opt.find(
"--calibArea=") != std::string::npos ) calibArea =
v[1];
112 if (
opt.find(
"--isData=") != std::string::npos )
isData =
v[1];
117 std::cout <<
"No input xAOD file specified, exiting" << std::endl;
121 std::cout <<
"No jet collection specified, exiting" << std::endl;
124 if(jetCalibConfig.empty()){
125 std::cout <<
"No JetCalibTools config specified, exiting" << std::endl;
128 if(calibSeq.empty()){
129 std::cout <<
"No calibration sequence specified, exiting" << std::endl;
133 std::cout <<
"isData not specified, exiting" << std::endl;
136 else if(
isData==
"TRUE") isCollision =
true;
141 std::unique_ptr< TFile >
ifile( TFile::Open(
sample.c_str(),
"READ" ) );
144 #ifdef XAOD_STANDALONE
151 std::shared_ptr<AthOnnx::IOnnxRuntimeSvc> service;
153 #else // Athena "Store" is the same StoreGate used by the TEvent
161 const std::string name_JetCalibTools =
"JetCalib_Example";
165 ANA_CHECK( jetCalibrationTool.setProperty(
"JetCollection",jetColl.c_str()) );
167 ANA_CHECK( jetCalibrationTool.setProperty(
"CalibSequence",calibSeq.c_str()) );
169 ANA_CHECK( jetCalibrationTool.setProperty(
"ConfigFile",jetCalibConfig.c_str()) );
171 ANA_CHECK( jetCalibrationTool.setProperty(
"IsData",isCollision) );
173 if(!calibArea.empty()){
174 ANA_CHECK( jetCalibrationTool.setProperty(
"CalibArea",calibArea.c_str()) );
178 if(!(jetCalibrationTool.
initialize().isSuccess())){
179 std::cout <<
"Initialization of JetCalibTools failed, exiting" << std::endl;
187 const Long64_t
nevents =
event.getEntries();
188 for(Long64_t ievent = 0; ievent <
nevents; ++ievent){
192 std::cerr <<
"Failed to load entry " << ievent << std::endl;
197 if(ievent % 100==0) std::cout <<
"Event " << ievent <<
" of " <<
nevents << std::endl;
209 delete jets_shallowCopy.first;
210 delete jets_shallowCopy.second;
ReadStats & stats()
Access the object belonging to the current thread.
@ kClassAccess
Access auxiliary data using the aux containers.
StatusCode readFrom(TFile *file)
POOL::TEvent event(POOL::TEvent::kClassAccess)
static IOStats & instance()
Singleton object accessor.
void printSmartSlimmingBranchList(bool autoIncludeLinks=false) const
Print the accessed variables, formatted for smart slimming.
an object that can create a AsgService
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, [[maybe_unused]] const EventContext &ctx)
Function making a shallow copy of a constant container.
StatusCode retrieve(const T *&obj)
std::vector< std::string > config
Tool for accessing xAOD files outside of Athena.
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.