35int main (
int argc,
char* argv[])
37 using namespace asg::msgUserCode;
44 ANA_MSG_ERROR(
" Usage: %s [xAOD file name] %d Num of events to process %d (0 photons , 1 electrons)");
49 const TString fileName = argv[1];
51 std::unique_ptr<TFile> inputFile(TFile::Open(fileName,
"READ"));
66 const Long64_t userInputEntries = atoll(argv[2]);
75 ANA_CHECK(fudgeTool.setProperty(
"ConfigFile",
"EGammaVariableCorrection/ElectronPhotonVariableCorrectionBase_ExampleIsoCorrectionConf.conf"));
81 ANA_CHECK(isoCorrToolFull.setProperty(
"Apply_etaEDPar_mc_correction",
true));
82 ANA_CHECK(isoCorrToolFull.setProperty(
"Apply_etaEDParPU_correction",
true));
86 ANA_CHECK(isoCorrToolStep.setProperty(
"Apply_etaEDPar_mc_correction",
false));
87 ANA_CHECK(isoCorrToolStep.setProperty(
"Apply_etaEDParPU_correction",
true));
94 for (Long64_t entry = 0; entry <
entries; entry++)
108 for (
unsigned int idx = 0; idx < photons->
size(); idx++)
115 ANA_MSG_INFO(
"topoetcone40 fudge before applyCorrection: " << topoEtCone40OriginalAcc(*photons_fudge.first->at(idx)));
116 ANA_MSG_INFO(
"topoetcone40 fudge after applyCorrection : " << topoEtCone40Acc(*photons_fudge.first->at(idx)));
117 ANA_MSG_INFO(
"topoetcone40 with IsolationCorrectionTool : " << topoEtCone40Acc(*photons_isocorr.first->at(idx)));
size_type size() const noexcept
Returns the number of elements in the collection.
Class to correct electron and photon MC variables.
const CP::CorrectionCode applyCorrection(xAOD::Photon &photon) const
Apply the correction given in the conf file to the passed photon.
virtual StatusCode initialize() override
Initialize the class instance.
Helper class to provide constant type-safe access to aux data.
StatusCode retrieve(const T *&obj, const std::string &key)
Retrieve either an input or an output object from the event.
Tool for accessing xAOD files outside of Athena.
@ kClassAccess
Access auxiliary data using the aux containers.
::Long64_t getEntries() const
Get how many entries are available from the current input file(s)
StatusCode readFrom(::TFile *file, bool useTreeCache=true, std::string_view treeName=EVENT_TREE_NAME)
Connect the object to a new input file.
::Int_t getEntry(::Long64_t entry, ::Int_t getall=0)
Function loading a given entry of the input TTree.
A relatively simple transient store for objects created in analysis.
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container 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.