47 const bool result = ARG; \
49 ::Error(APP_NAME, "Failed to execute: \"%s\"", \
65int main(
int argc,
char* argv[] )
73 Error(
APP_NAME,
"No file name received!" );
80 StatusCode::enableFailure();
83 const TString fileName = argv[ 1 ];
84 Info(
APP_NAME,
"Opening file: %s", fileName.Data());
85 std::unique_ptr<TFile> ifile(TFile::Open(fileName,
"READ"));
91 CHECK( event.readFrom(ifile.get()) );
92 Info(
APP_NAME,
"Number of events in the file: %i",
93 static_cast<int>(event.getEntries()));
96 Long64_t
entries =
event.getEntries();
98 const Long64_t e = atoll(argv[2]);
104 tool_jtc.
setTypeAndName(
"CP::JetTileCorrectionTool/JetTileCorrectionTool");
107 CHECK( tool_jtc.
setProperty(
"CorrectionFileName",
"JetTileCorrection/JetTile_pFile_010216.root") );
115 std::cout <<
"Starting loop" << std::endl;
116 for(Long64_t entry = 0; entry <
entries; ++entry){
118 event.getEntry(entry);
122 CHECK( event.retrieve(evtInfo,
"EventInfo") );
124 Info(
APP_NAME,
"===>>> Processing entry %lli, run %u, event %lu <<<===",
130 CHECK( event.retrieve(jets,
"AntiKt4EMTopoJets") );
132 std::pair<xAOD::JetContainer*, xAOD::ShallowAuxContainer*> shallowcopy =
134 std::unique_ptr< xAOD::JetContainer > jets_sc( shallowcopy.first );
135 std::unique_ptr< xAOD::ShallowAuxContainer >
136 jets_scaux( shallowcopy.second );
140 if (
jet->pt() < 20000. || fabs(
jet->eta()) > 2.8)
continue;
146 Warning(
"JetTileCorrectionTester",
"No valid pt/eta range. No correction applied.");
149 Error(
"JetTileCorrectionTester",
"Failed to apply JetTileCorrection!");
155 std::string str_status=
"";
157 str_status =
"NotAffected";
159 str_status =
"EdgeAffected";
161 str_status =
"CoreAffected";
163 str_status =
"Unknown";
165 Info(
APP_NAME,
"Jet status : %s, Pt raw = %.3f GeV, Pt corrected %.3f GeV", str_status.c_str(),
acc_ptraw(*
jet)*0.001,
jet->pt()*0.001);
198 Info(
APP_NAME,
"Application finished successfully");
static const SG::Accessor< float > acc_ptraw("Ptraw")
static SG::AuxElement::Accessor< unsigned int > acc_tileok("TileStatus")
static SG::AuxElement::Accessor< float > acc_ptraw("Ptraw")
Return value from object correction CP tools.
@ OutOfValidityRange
Input object is out of validity range.
@ Ok
The correction was done successfully.
SG::Accessor< T, ALLOC > Accessor
uint32_t runNumber() const
The current event's run number.
uint64_t eventNumber() const
The current event's event number.
Tool for accessing xAOD files outside of Athena.
@ kAthenaAccess
Access containers/objects like Athena does.
A relatively simple transient store for objects created in analysis.
Jet_v1 Jet
Definition of the current "jet version".
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
EventInfo_v1 EventInfo
Definition of the latest event info version.
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, const EventContext &ctx)
Function making a shallow copy of a constant container.
JetContainer_v1 JetContainer
Definition of the current "jet container version".