47 const bool result = ARG; \
49 ::Error(APP_NAME, "Failed to execute: \"%s\"", \
59static SG::AuxElement::Accessor<unsigned int>
acc_tileok(
"TileStatus");
60static SG::AuxElement::Accessor<float>
acc_ptraw(
"Ptraw");
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") );
136 if (
jet->pt() < 20000. || fabs(
jet->eta()) > 2.8)
continue;
142 Warning(
"JetTileCorrectionTester",
"No valid pt/eta range. No correction applied.");
145 Error(
"JetTileCorrectionTester",
"Failed to apply JetTileCorrection!");
151 std::string str_status=
"";
153 str_status =
"NotAffected";
155 str_status =
"EdgeAffected";
157 str_status =
"CoreAffected";
159 str_status =
"Unknown";
161 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);
194 Info(
APP_NAME,
"Application finished successfully");
static const SG::Accessor< unsigned int > acc_tileok("TileStatus")
static const SG::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.
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.
ShallowCopyResult_t< T > shallowCopy(const T &cont, const EventContext &ctx)
Create a shallow copy of an existing container.
JetContainer_v1 JetContainer
Definition of the current "jet container version".