8#include "GaudiKernel/IToolSvc.h"
15#include "GaudiKernel/NTuple.h"
16#include "GaudiKernel/INTupleSvc.h"
17#include "GaudiKernel/SmartDataPtr.h"
30 msg(MSG::INFO) <<
"Initializing " << name() <<
endmsg;
33 msg(MSG::INFO) <<
"creating n tuple" <<
endmsg;
34 NTupleFilePtr file1(
ntupleSvc(),
"/NTUPLES/FILE");
37 NTuplePtr nt(
ntupleSvc(),
"/NTUPLES/FILE/AOD");
40 nt =
ntupleSvc()->book (
"/NTUPLES/FILE/AOD", CLID_ColumnWiseTuple,
"Readed info from aod container");
43 msg(MSG::INFO) <<
"booked ntuple " <<
endmsg;
45 StatusCode
sc = StatusCode::SUCCESS;
47 sc = nt->addItem(
"eta" , this->
m_eta);
48 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for eta" <<
endmsg;
50 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for erec" <<
endmsg;
51 sc = nt->addItem(
"pt" , this->
m_pt);
52 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for pt" <<
endmsg;
53 sc = nt->addItem(
"e237" , this->
m_e237);
54 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for e237" <<
endmsg;
55 sc = nt->addItem(
"e277" , this->
m_e277);
56 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for e277" <<
endmsg;
57 sc = nt->addItem(
"weta1" , this->
m_weta1);
58 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for weta1" <<
endmsg;
59 sc = nt->addItem(
"weta2" , this->
m_weta2);
60 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for weta2" <<
endmsg;
62 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for e2tsts1" <<
endmsg;
64 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for emins1" <<
endmsg;
66 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for fracs1" <<
endmsg;
68 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for wtots1" <<
endmsg;
69 sc = nt->addItem(
"f1" , this->
m_f1);
70 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for f1" <<
endmsg;
72 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for f1core" <<
endmsg;
74 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for ethad1" <<
endmsg;
75 sc = nt->addItem(
"et" , this->
m_et);
76 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for et" <<
endmsg;
79 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for egen" <<
endmsg;
81 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for tr_px" <<
endmsg;
83 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for tr_py" <<
endmsg;
85 if(
sc.isFailure() )
msg(MSG::ERROR) <<
"Can not create ntuple entry for tr_pz" <<
endmsg;
89 msg(MSG::ERROR) <<
"didn't manage to book ntuple" <<
endmsg;
90 return StatusCode::FAILURE;
96 return StatusCode::SUCCESS;
101 msg(MSG::INFO) <<
"Finalised " << name() <<
endmsg;
102 return StatusCode::SUCCESS;
107 StatusCode
sc = StatusCode::SUCCESS;
111 sc=
evtStore()->retrieve( elecTES,
"ElectronAODCollection");
112 if(
sc.isFailure() || !elecTES ) {
113 msg(MSG::WARNING) <<
"No AOD electron container found in TDS" <<
endmsg;
116 msg(MSG::INFO) <<
"ElectronContainer successfully retrieved" <<
endmsg;
120 if (( mcEvtColl =
evtStore()->retrieve<const McEventCollection>() )) {
121 msg(MSG::INFO) <<
"TruthParticleContainer successfully retrieved" <<
endmsg;
123 msg(MSG::WARNING) <<
"Could not retrieve TruthParticleContainer" <<
endmsg;
132 if (mcTrPart != mcEvtColl->
end()) {
133 trPart = (*mcTrPart)->particles_size()?*
HepMC::begin(**mcTrPart):
nullptr;
135 msg(MSG::WARNING) <<
"Not a single particle event. Truth information won't be available" <<
endmsg;
138 msg(MSG::WARNING) <<
"Empty TruthParticleContainer. Truth information won't be available" <<
endmsg;
147 for (; elecItr != elecItrE; ++elecItr) {
148 if (((*elecItr)->author() & (8 + 1)) > 0) {
149 primElec = (*elecItr);
199 msg(MSG::VERBOSE) <<
"n tuple entry writed" <<
endmsg;
203 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
NTuple::Item< float > m_truth_pz
NTuple::Item< float > m_e237
NTuple::Item< float > m_et
NTuple::Item< float > m_eta
NTuple::Item< float > m_weta1
NTuple::Item< float > m_f1
NTuple::Item< float > m_truth_px
NTuple::Item< float > m_truth_energy
NTuple::Item< float > m_e277
NTuple::Item< float > m_wtots1
NTuple::Item< float > m_truth_py
NTuple::Item< float > m_weta2
NTuple::Item< float > m_emins1
NTuple::Item< float > m_f1core
AODReader(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute()
NTuple::Item< float > m_energy
NTuple::Item< float > m_fracs1
NTuple::Item< float > m_ethad1
virtual StatusCode finalize()
NTuple::Item< float > m_pt
NTuple::Item< float > m_e2tsts1
virtual StatusCode initialize()
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
ServiceHandle< StoreGateSvc > & evtStore()
DataModel_detail::const_iterator< DataVector > const_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.
EM shower property class data class.
double f1core() const
E1(3x1)/E = fraction of the energy reconstructed in the first longitudinal compartment of the electro...
double weta1() const
shower width using +/-3 strips around the one with the maximal energy deposit: w3 strips = sqrt{sum(E...
double ethad1() const
transverse energy in the first sampling of the hadronic calorimeters behind the cluster calculated fr...
double e237() const
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 3x7
double e277() const
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 7x7
double fracs1() const
shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in +- n stri...
double weta2() const
the lateral width is calculated with a window of 3x5 cells using the energy weighted sum over all cel...
double e2tsts1() const
energy of the cell corresponding to second energy maximum in the first sampling
double emins1() const
energy reconstructed in the strip with the minimal value between the first and second maximum
double wtots1() const
shower width is determined in a window detaxdphi = 0,0625 x~0,2, corresponding typically to 20 strips...
double f1() const
E1/E = fraction of energy reconstructed in the first sampling, where E1 is energy in all strips belon...
Class to define the ElectronContainer.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
virtual double et() const
transverse energy defined to be e*sin(theta)
virtual double e() const
energy
virtual double pt() const
transverse momentum
virtual double eta() const
pseudo rapidity
const T * detail(const std::string &name="", unsigned int index=0) const
retrieve eg-detail objects:
const CaloCluster * cluster() const
pointer to CaloCluster
GenEvent::particle_iterator begin(HepMC::GenEvent &e)
const GenParticle * ConstGenParticlePtr