ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Attributes | List of all members
EMECHitsTestTool Class Reference

#include <EMECHitsTestTool.h>

Inheritance diagram for EMECHitsTestTool:
Collaboration diagram for EMECHitsTestTool:

Public Member Functions

 EMECHitsTestTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~EMECHitsTestTool ()
 
StatusCode initialize ()
 
virtual StatusCode processEvent () override
 

Protected Attributes

std::string m_detname
 
double m_edep_cut
 
TH1 * m_lar_eta
 
TH1 * m_lar_phi
 
TH2 * m_lar_zr
 
TH2 * m_lar_etaphi
 
TH2 * m_lar_edep_zr
 
TH1 * m_eta
 
TH1 * m_phi
 
TH2 * m_zr
 
TH2 * m_etaphi
 
TH1 * m_time
 
TH1 * m_edep
 
TH1 * m_log_edep
 
TH2 * m_edep_zr
 
TH1 * m_eta_cut1
 
TH1 * m_phi_cut1
 
TH2 * m_zr_cut1
 
TH2 * m_etaphi_cut1
 
TH1 * m_time_cut1
 
TH1 * m_edep_cut1
 
TH2 * m_edep_zr_cut1
 
TH1 * m_etot
 
TH1 * m_edep_eta
 
TH1 * m_edep_phi
 
TH1 * m_edep_z
 
TH1 * m_edep_r
 
TH1 * m_etot_eta
 
TH1 * m_etot_phi
 
std::string m_path {"/truth/"}
 
ServiceHandle< ITHistSvc > m_histSvc {"THistSvc", "SimTestHisto"}
 

Private Attributes

SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey
 

structors and AlgTool implementation

std::string m_key
 The MC truth key. More...
 
HepMC::ConstGenParticlePtr getPrimary ()
 

Detailed Description

Definition at line 10 of file EMECHitsTestTool.h.

Constructor & Destructor Documentation

◆ EMECHitsTestTool()

EMECHitsTestTool::EMECHitsTestTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 11 of file EMECHitsTestTool.cxx.

13 {
14 }

◆ ~EMECHitsTestTool()

virtual EMECHitsTestTool::~EMECHitsTestTool ( )
inlinevirtual

Definition at line 14 of file EMECHitsTestTool.h.

14 {}

Member Function Documentation

◆ getPrimary()

HepMC::ConstGenParticlePtr SimTestToolBase::getPrimary ( )
protectedinherited

Definition at line 20 of file SimTestToolBase.cxx.

21 {
22  const McEventCollection* mcCollection;
23  if (evtStore()->retrieve(mcCollection,m_key).isSuccess()) {
25  for (e=mcCollection->begin();e!=mcCollection->end(); ++e) {
26  for (auto p : (**e)) {
28  return p;
29  }
30  }
31  }
32  }
33  return 0;
34 }

◆ initialize()

StatusCode EMECHitsTestTool::initialize ( )
virtual

Reimplemented from LArHitsTestTool.

Definition at line 16 of file EMECHitsTestTool.cxx.

17 {
18  std::string origpath=m_path;
19 
20  m_path += "LAr/EMEC/";
21 
22  // variables specific to sub detector (root histo names have to be unique!)
23  _TH1D(m_eta,"EMEC_eta",25,-3.5,3.5);
24  _TH1D_WEIGHTED(m_time,"EMEC_time",100,0,2.);
25  _TH1D(m_etot,"EMEC_etot",100,0.,150.);
26  _TH1D_WEIGHTED(m_edep_eta,"EMEC_edep_eta",25,-3.5,3.5);
27  _TH1D_WEIGHTED(m_edep_z,"EMEC_edep_z",100,-4500.,4500.);
28  _TH1D_WEIGHTED(m_edep_r,"EMEC_edep_r",100,300.,2200.);
29  _TPROFILE(m_etot_eta,"EMEC_etot_eta",25,-3.,3.);
30 
31  m_path = origpath;
32 
34 }

◆ processEvent()

StatusCode LArHitsTestTool::processEvent ( )
overridevirtualinherited

Definition at line 116 of file LArHitsTestTool.cxx.

116  {
118  ATH_CHECK(caloMgrHandle.isValid());
119  const CaloDetDescrManager* caloMgr = *caloMgrHandle;
120 
121  std::string lArkey = "LArHit"+m_detname;
122 
123  double etot=0;
124  const LArHitContainer* hitContainer = evtStore()->tryConstRetrieve<LArHitContainer>(lArkey);
125  if(hitContainer) {
126  for(const LArHit* larHit : *hitContainer) {
127  const CaloDetDescrElement* ddElement = caloMgr->get_element(larHit->cellID());
128 
129  double eta = ddElement->eta();
130  double phi = ddElement->phi();
131  double radius = ddElement->r();
132  double z = ddElement->z();
133 
134  double energy = larHit->energy();
135 
136  m_lar_eta->Fill(eta);
137  m_lar_phi->Fill(phi);
138  m_lar_zr->Fill(z,radius);
139  m_lar_etaphi->Fill(eta,phi);
140  m_lar_edep_zr->Fill(z,radius,energy);
141 
142 
143  m_eta->Fill(eta);
144  m_phi->Fill(phi);
145  m_time->Fill( larHit->time(),energy);
146  m_edep->Fill( energy);
147  m_log_edep->Fill( energy > 0 ? log(energy) : -1 );
148 
149  m_zr->Fill(z,radius);
150  m_etaphi->Fill(eta,phi);
151  m_edep_zr->Fill(z,radius,energy);
152 
153  m_edep_eta->Fill(eta,energy);
154  m_edep_phi->Fill(phi,energy);
155 
156  m_edep_z->Fill(z,energy);
157  m_edep_r->Fill(radius,energy);
158 
159  etot+=energy;
160 
161  if (larHit->energy()>m_edep_cut) {
162  m_eta_cut1->Fill(eta);
163  m_phi_cut1->Fill(phi);
164  m_time_cut1->Fill( larHit->time(), larHit->energy());
165  m_edep_cut1->Fill( larHit->energy());
166 
167  m_zr_cut1->Fill(z,radius);
168  m_etaphi_cut1->Fill(eta,phi);
169  m_edep_zr_cut1->Fill(z,radius,larHit->energy());
170  }
171  }
172  }
173 
174  //For FastCaloSim Container with _Fast postfix, just try to retrieve, if exist, collect information from this container, it not just skip it.
175 
177  const std::string lArkey_fast="LArHit"+m_detname+"_Fast";
178 
179  const LArHitContainer* iter_fast;
180  if( evtStore()->contains<LArHitContainer>(lArkey_fast) &&
181  (evtStore()->retrieve(iter_fast,lArkey_fast)).isSuccess())
182  {
183  ATH_MSG_DEBUG ( "Read hit info from FastCaloSim Container" );
184  for(hi_fast=(*iter_fast).begin();hi_fast!=(*iter_fast).end();++hi_fast)
185  {
186  const LArHit* larHit = *hi_fast;
187  const CaloDetDescrElement* ddElement = caloMgr->get_element(larHit->cellID());
188  double eta=ddElement->eta();
189  double phi=ddElement->phi();
190  double radius=ddElement->r();
191  double z=ddElement->z();
192  double energy=larHit->energy();
193 
194  m_lar_eta->Fill(eta);
195  m_lar_phi->Fill(phi);
196  m_lar_zr->Fill(z,radius);
197  m_lar_etaphi->Fill(eta,phi);
198  m_lar_edep_zr->Fill(z,radius,energy);
199 
200  m_eta->Fill(eta);
201  m_phi->Fill(phi);
202  m_time->Fill((*hi_fast)->time(),energy);
203  m_edep->Fill(energy);
204  m_log_edep->Fill( log(energy));
205 
206  m_zr->Fill(z,radius);
207  m_etaphi->Fill(eta,phi);
208  m_edep_zr->Fill(z,radius,energy);
209 
210  m_edep_eta->Fill(eta,energy);
211  m_edep_phi->Fill(phi,energy);
212 
213  m_edep_z->Fill(z,energy);
214  m_edep_r->Fill(radius,energy);
215 
216  etot+=energy;
217 
218  if((*hi_fast)->energy() > m_edep_cut)
219  {
220  m_eta_cut1->Fill(eta);
221  m_phi_cut1->Fill(phi);
222  m_time_cut1->Fill((*hi_fast)->time(),(*hi_fast)->energy());
223  m_edep_cut1->Fill((*hi_fast)->energy());
224 
225  m_zr_cut1->Fill(z,radius);
226  m_etaphi_cut1->Fill(eta,phi);
227  m_edep_zr_cut1->Fill(z,radius,(*hi_fast)->energy());
228  }
229  }
230  }
231  auto primary = getPrimary();
232  if (primary) {
233  m_etot_eta->Fill(primary->momentum().eta(),etot);
234  m_etot_phi->Fill(primary->momentum().phi(),etot);
235  }
236  m_etot->Fill(etot);
237 
238  return StatusCode::SUCCESS;
239 }

Member Data Documentation

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> LArHitsTestTool::m_caloMgrKey
privateinherited
Initial value:
{ this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" }

Definition at line 48 of file LArHitsTestTool.h.

◆ m_detname

std::string LArHitsTestTool::m_detname
protectedinherited

Definition at line 24 of file LArHitsTestTool.h.

◆ m_edep

TH1 * LArHitsTestTool::m_edep
protectedinherited

Definition at line 35 of file LArHitsTestTool.h.

◆ m_edep_cut

double LArHitsTestTool::m_edep_cut
protectedinherited

Definition at line 25 of file LArHitsTestTool.h.

◆ m_edep_cut1

TH1 * LArHitsTestTool::m_edep_cut1
protectedinherited

Definition at line 39 of file LArHitsTestTool.h.

◆ m_edep_eta

TH1* LArHitsTestTool::m_edep_eta
protectedinherited

Definition at line 43 of file LArHitsTestTool.h.

◆ m_edep_phi

TH1 * LArHitsTestTool::m_edep_phi
protectedinherited

Definition at line 43 of file LArHitsTestTool.h.

◆ m_edep_r

TH1 * LArHitsTestTool::m_edep_r
protectedinherited

Definition at line 44 of file LArHitsTestTool.h.

◆ m_edep_z

TH1* LArHitsTestTool::m_edep_z
protectedinherited

Definition at line 44 of file LArHitsTestTool.h.

◆ m_edep_zr

TH2* LArHitsTestTool::m_edep_zr
protectedinherited

Definition at line 36 of file LArHitsTestTool.h.

◆ m_edep_zr_cut1

TH2* LArHitsTestTool::m_edep_zr_cut1
protectedinherited

Definition at line 40 of file LArHitsTestTool.h.

◆ m_eta

TH1* LArHitsTestTool::m_eta
protectedinherited

Definition at line 33 of file LArHitsTestTool.h.

◆ m_eta_cut1

TH1* LArHitsTestTool::m_eta_cut1
protectedinherited

Definition at line 37 of file LArHitsTestTool.h.

◆ m_etaphi

TH2 * LArHitsTestTool::m_etaphi
protectedinherited

Definition at line 34 of file LArHitsTestTool.h.

◆ m_etaphi_cut1

TH2 * LArHitsTestTool::m_etaphi_cut1
protectedinherited

Definition at line 38 of file LArHitsTestTool.h.

◆ m_etot

TH1* LArHitsTestTool::m_etot
protectedinherited

Definition at line 42 of file LArHitsTestTool.h.

◆ m_etot_eta

TH1* LArHitsTestTool::m_etot_eta
protectedinherited

Definition at line 45 of file LArHitsTestTool.h.

◆ m_etot_phi

TH1 * LArHitsTestTool::m_etot_phi
protectedinherited

Definition at line 45 of file LArHitsTestTool.h.

◆ m_histSvc

ServiceHandle<ITHistSvc> SimTestHisto::m_histSvc {"THistSvc", "SimTestHisto"}
protectedinherited

Definition at line 35 of file SimTestHisto.h.

◆ m_key

std::string SimTestToolBase::m_key
protectedinherited

The MC truth key.

Definition at line 34 of file SimTestToolBase.h.

◆ m_lar_edep_zr

TH2* LArHitsTestTool::m_lar_edep_zr
protectedinherited

Definition at line 30 of file LArHitsTestTool.h.

◆ m_lar_eta

TH1* LArHitsTestTool::m_lar_eta
protectedinherited

Definition at line 28 of file LArHitsTestTool.h.

◆ m_lar_etaphi

TH2 * LArHitsTestTool::m_lar_etaphi
protectedinherited

Definition at line 29 of file LArHitsTestTool.h.

◆ m_lar_phi

TH1 * LArHitsTestTool::m_lar_phi
protectedinherited

Definition at line 28 of file LArHitsTestTool.h.

◆ m_lar_zr

TH2* LArHitsTestTool::m_lar_zr
protectedinherited

Definition at line 29 of file LArHitsTestTool.h.

◆ m_log_edep

TH1 * LArHitsTestTool::m_log_edep
protectedinherited

Definition at line 35 of file LArHitsTestTool.h.

◆ m_path

std::string SimTestHisto::m_path {"/truth/"}
protectedinherited

Definition at line 34 of file SimTestHisto.h.

◆ m_phi

TH1 * LArHitsTestTool::m_phi
protectedinherited

Definition at line 33 of file LArHitsTestTool.h.

◆ m_phi_cut1

TH1 * LArHitsTestTool::m_phi_cut1
protectedinherited

Definition at line 37 of file LArHitsTestTool.h.

◆ m_time

TH1* LArHitsTestTool::m_time
protectedinherited

Definition at line 35 of file LArHitsTestTool.h.

◆ m_time_cut1

TH1* LArHitsTestTool::m_time_cut1
protectedinherited

Definition at line 39 of file LArHitsTestTool.h.

◆ m_zr

TH2* LArHitsTestTool::m_zr
protectedinherited

Definition at line 34 of file LArHitsTestTool.h.

◆ m_zr_cut1

TH2* LArHitsTestTool::m_zr_cut1
protectedinherited

Definition at line 38 of file LArHitsTestTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
LArHitsTestTool::m_edep_z
TH1 * m_edep_z
Definition: LArHitsTestTool.h:44
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
LArHitsTestTool::m_edep_cut1
TH1 * m_edep_cut1
Definition: LArHitsTestTool.h:39
LArHitsTestTool::m_log_edep
TH1 * m_log_edep
Definition: LArHitsTestTool.h:35
_TPROFILE
#define _TPROFILE(var, name, nbin, xmin, xmax)
Definition: SimTestHisto.h:39
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
LArHitsTestTool::m_edep
TH1 * m_edep
Definition: LArHitsTestTool.h:35
LArHitsTestTool::m_edep_r
TH1 * m_edep_r
Definition: LArHitsTestTool.h:44
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
LArHitsTestTool::m_etaphi_cut1
TH2 * m_etaphi_cut1
Definition: LArHitsTestTool.h:38
LArHitsTestTool::m_zr
TH2 * m_zr
Definition: LArHitsTestTool.h:34
LArHitsTestTool::m_etot_phi
TH1 * m_etot_phi
Definition: LArHitsTestTool.h:45
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition: CaloDetDescrManager.cxx:159
LArHitsTestTool::m_edep_zr
TH2 * m_edep_zr
Definition: LArHitsTestTool.h:36
LArHit::energy
double energy() const
Definition: LArHit.h:113
LArHitContainer
Hit collection.
Definition: LArHitContainer.h:26
LArHitsTestTool::m_etot_eta
TH1 * m_etot_eta
Definition: LArHitsTestTool.h:45
_TH1D
#define _TH1D(var, name, nbin, xmin, xmax)
Definition: SimTestHisto.h:47
AthenaHitsVector< LArHit >::const_iterator
boost::transform_iterator< make_const, typename CONT::const_iterator > const_iterator
Definition: AthenaHitsVector.h:58
LArHitsTestTool::m_edep_eta
TH1 * m_edep_eta
Definition: LArHitsTestTool.h:43
LArHitsTestTool::m_edep_zr_cut1
TH2 * m_edep_zr_cut1
Definition: LArHitsTestTool.h:40
LArHitsTestTool::m_lar_phi
TH1 * m_lar_phi
Definition: LArHitsTestTool.h:28
LArHitsTestTool::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: LArHitsTestTool.h:48
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
StateLessPT_NewConfig.primary
primary
Definition: StateLessPT_NewConfig.py:228
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
HepMC::is_simulation_particle
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
Definition: MagicNumbers.h:355
z
#define z
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LArHitsTestTool::m_eta_cut1
TH1 * m_eta_cut1
Definition: LArHitsTestTool.h:37
LArHitsTestTool::m_zr_cut1
TH2 * m_zr_cut1
Definition: LArHitsTestTool.h:38
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
LArHitsTestTool::m_eta
TH1 * m_eta
Definition: LArHitsTestTool.h:33
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
LArHitsTestTool::m_etaphi
TH2 * m_etaphi
Definition: LArHitsTestTool.h:34
LArHit::cellID
Identifier cellID() const
Definition: LArHit.h:108
_TH1D_WEIGHTED
#define _TH1D_WEIGHTED(var, name, nbin, xmin, xmax)
Definition: SimTestHisto.h:67
LArHitsTestTool::m_phi_cut1
TH1 * m_phi_cut1
Definition: LArHitsTestTool.h:37
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
LArHitsTestTool::m_phi
TH1 * m_phi
Definition: LArHitsTestTool.h:33
SimTestToolBase::getPrimary
HepMC::ConstGenParticlePtr getPrimary()
Definition: SimTestToolBase.cxx:20
LArHitsTestTool::LArHitsTestTool
LArHitsTestTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: LArHitsTestTool.cxx:17
LArHit
Class to store hit energy and time in LAr cell from G4 simulation.
Definition: LArHit.h:25
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
LArHitsTestTool::m_edep_phi
TH1 * m_edep_phi
Definition: LArHitsTestTool.h:43
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
LArHitsTestTool::m_lar_etaphi
TH2 * m_lar_etaphi
Definition: LArHitsTestTool.h:29
CaloDetDescrElement::z
float z() const
cell z
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:367
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LArHitsTestTool::m_time_cut1
TH1 * m_time_cut1
Definition: LArHitsTestTool.h:39
LArHitsTestTool::m_edep_cut
double m_edep_cut
Definition: LArHitsTestTool.h:25
LArHitsTestTool::m_lar_edep_zr
TH2 * m_lar_edep_zr
Definition: LArHitsTestTool.h:30
LArHitsTestTool::initialize
virtual StatusCode initialize() override
Definition: LArHitsTestTool.cxx:40
LArHitsTestTool::m_lar_eta
TH1 * m_lar_eta
Definition: LArHitsTestTool.h:28
CaloDetDescrElement::eta
float eta() const
cell eta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:344
CaloDetDescrElement::phi
float phi() const
cell phi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
CaloDetDescrElement::r
float r() const
cell r
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:348
SimTestHisto::m_path
std::string m_path
Definition: SimTestHisto.h:34
LArHitsTestTool::m_detname
std::string m_detname
Definition: LArHitsTestTool.h:24
SimTestToolBase::m_key
std::string m_key
The MC truth key.
Definition: SimTestToolBase.h:34
LArHitsTestTool::m_time
TH1 * m_time
Definition: LArHitsTestTool.h:35
LArHitsTestTool::m_etot
TH1 * m_etot
Definition: LArHitsTestTool.h:42
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
LArHitsTestTool::m_lar_zr
TH2 * m_lar_zr
Definition: LArHitsTestTool.h:29