36 const bool result = ARG; \
38 ::Error( APP_NAME, "Failed to execute: \"%s\"", \
45int main(
int argc,
char* argv[] ) {
52 Error(
APP_NAME,
"No file name received!" );
61 const TString fileName = argv[ 1 ];
62 Info(
APP_NAME,
"Opening file: %s", fileName.Data() );
63 std::unique_ptr< TFile > ifile( TFile::Open( fileName,
"READ" ) );
69 CHECK( event.readFrom( ifile.get() ) );
70 Info(
APP_NAME,
"Number of events in the file: %i",
71 static_cast< int >( event.getEntries() ) );
75 Long64_t
entries =
event.getEntries();
77 const Long64_t e = atoll( argv[ 2 ] );
86 CHECK( m_isoCorrTool.setProperty(
"IsMC",
true) );
89 CHECK(m_isoCorrTool.setProperty(
"CorrFile",file_unc));
92 std::cout <<
"Failed to initialize the tool, check for errors"<<std::endl;
98 std::cout <<
"loop on " <<
entries <<
" entries"<<std::endl;
99 for(
int entry = 0; entry <
entries; ++entry ) {
102 event.getEntry( entry );
106 CHECK( event.retrieve( ei,
"EventInfo" ) );
111 CHECK( event.retrieve( photons,
"Photons" ) );
122 for( ; ph_itr != ph_end; ++ph_itr, ++i ) {
126 if(ph->
pt()<10000.0)
continue;
127 if( fabs(ph->
eta())>2.47)
continue;
128 Info (
APP_NAME,
"Event #%d, Photon #%d", entry, i);
129 Info (
APP_NAME,
"xAOD/raw pt = %f, eta = %f ", ph->
pt(), ph->
eta() );
133 Info (
APP_NAME,
"after the Iso correction ");
139 CHECK(m_isoCorrTool.finalize());
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
DataModel_detail::iterator< DataVector > iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Tool for accessing xAOD files outside of Athena.
@ kClassAccess
Access auxiliary data using the aux containers.
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
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.
Photon_v1 Photon
Definition of the current "egamma version".