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

#include <LucidHitsTestTool.h>

Inheritance diagram for LucidHitsTestTool:
Collaboration diagram for LucidHitsTestTool:

Public Member Functions

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

Protected Attributes

TH2 * m_x_v_y_edep
 
TH2 * m_x_v_y_hits
 
TH2 * m_R_v_z_edep
 
TH2 * m_R_v_z_hits
 
TH2 * m_x_v_y_post
 
TH2 * m_R_v_z_post
 
TH2 * m_time_edep
 
TH1 * m_pdgid
 
TH1 * m_tubeid
 
TH1 * m_gen_volume
 
TH1 * m_wavelength
 
TH1 * m_hit_edep
 
TH1 * m_total_e
 
std::string m_path {"/truth/"}
 
ServiceHandle< ITHistSvc > m_histSvc {"THistSvc", "SimTestHisto"}
 

structors and AlgTool implementation

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

Detailed Description

Definition at line 10 of file LucidHitsTestTool.h.

Constructor & Destructor Documentation

◆ LucidHitsTestTool()

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

Definition at line 15 of file LucidHitsTestTool.cxx.

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 LucidHitsTestTool::initialize ( )
virtual

Reimplemented from SimTestToolBase.

Definition at line 22 of file LucidHitsTestTool.cxx.

23 {
24  m_path+="Lucid/";
25  // ----------------------------------------
26  _TH2D_WEIGHTED(m_x_v_y_edep,"x_v_y_edep",100,-500.,500.,100,-500.,500.);
27  _SET_TITLE(m_x_v_y_edep, "Energy distribution [MeV]","x [mm]","y [mm]");
28  _TH2D(m_x_v_y_hits,"x_v_y_hits",100,-500.,500.,100,-500.,500.);
29  _SET_TITLE(m_x_v_y_hits, "Hit distribution","x [mm]","y [mm]");
30 
31  _TH2D_WEIGHTED(m_R_v_z_edep,"R_v_z_edep",100,0.,500.,100,5500.,8500.);
32  _SET_TITLE(m_R_v_z_edep, "Energy distribution [MeV]","R [mm]","z [mm]");
33  _TH2D(m_R_v_z_hits,"R_v_z_hits",100,0.,500.,100,5500.,8500.);
34  _SET_TITLE(m_R_v_z_hits, "Hit distribution","R [mm]","z [mm]");
35 
36  _TH2D(m_x_v_y_post,"x_v_y_post",100,-500.,500.,100,-500.,500.);
37  _SET_TITLE(m_x_v_y_post, "Post hit distribution","x [mm]","y [mm]");
38  _TH2D(m_R_v_z_post,"R_v_z_post",100,0.,500.,100,5500.,8500.);
39  _SET_TITLE(m_R_v_z_post, "Post hit distribution","R [mm]","z [mm]");
40 
41  _TH1D(m_pdgid,"pdg_id",1000,-3000,3000.);
42  _SET_TITLE(m_pdgid, "PDG ID","PDG ID","Hits");
43 
44  _TH2D_WEIGHTED(m_time_edep,"Time_edep",100,-10.,50.,100,-10.,50.);
45  _SET_TITLE(m_time_edep, "Energy distribution [MeV]","Time 1 [ns]","Time 2 [ns]");
46 
47  _TH1D(m_tubeid,"tube_id",1000,0,10000.);
48  _SET_TITLE(m_tubeid, "Tube ID","Tube ID","Hits");
49 
50  _TH1D(m_gen_volume,"gen_volume",1000,0,100000.);
51  _SET_TITLE(m_gen_volume, "Volume","Volume","Hits");
52 
53  _TH1D(m_wavelength,"wavelength",1000,0,3000.);
54  _SET_TITLE(m_wavelength, "Wavelength","Wavelength","Hits");
55 
56  _TH1D(m_hit_edep,"hit_edep",100,0,10000.);
57  _SET_TITLE(m_hit_edep, "Energy deposited per hit","Energy [MeV]","Hits");
58 
59  _TH1D(m_total_e,"total_e",1000,0,100000.);
60  _SET_TITLE(m_total_e, "Total energy deposited","Energy [MeV]","Events");
61 
62  return StatusCode::SUCCESS;
63 }

◆ processEvent()

StatusCode LucidHitsTestTool::processEvent ( )

Definition at line 65 of file LucidHitsTestTool.cxx.

65  {
66 
67  double etot = 0;
68  const LUCID_SimHitCollection* iter = nullptr;
69  CHECK(evtStore()->retrieve(iter));
70  for (const LUCID_SimHit& hit : *iter) {
71  m_x_v_y_edep->Fill( hit.GetX() , hit.GetY() , hit.GetEnergy() );
72  m_x_v_y_hits->Fill( hit.GetX() , hit.GetY() );
73  m_R_v_z_edep->Fill( std::sqrt( hit.GetX()*hit.GetX() + hit.GetY()*hit.GetY() ) , std::abs( hit.GetZ() ) , hit.GetEnergy() );
74  m_R_v_z_hits->Fill( std::sqrt( hit.GetX()*hit.GetX() + hit.GetY()*hit.GetY() ) , std::abs( hit.GetZ() ) );
75  m_x_v_y_post->Fill( hit.GetEPX() , hit.GetEPY() );
76  m_R_v_z_post->Fill( std::sqrt( hit.GetEPX()*hit.GetEPX() + hit.GetEPY()*hit.GetEPY() ) , std::abs( hit.GetEPZ() ) );
77 
78  m_pdgid->Fill( hit.GetPdgCode() );
79  m_time_edep->Fill( hit.GetPreStepTime() , hit.GetPostStepTime() , hit.GetEnergy() );
80  m_tubeid->Fill( hit.GetTubeID() );
81  m_gen_volume->Fill( hit.GetGenVolume() );
82  m_wavelength->Fill( hit.GetWavelength() );
83  m_hit_edep->Fill( hit.GetEnergy() );
84 
85  etot+=hit.GetEnergy();
86  }
87  m_total_e->Fill( etot );
88 
89  return StatusCode::SUCCESS;
90 }

Member Data Documentation

◆ m_gen_volume

TH1 * LucidHitsTestTool::m_gen_volume
protected

Definition at line 21 of file LucidHitsTestTool.h.

◆ m_histSvc

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

Definition at line 35 of file SimTestHisto.h.

◆ m_hit_edep

TH1 * LucidHitsTestTool::m_hit_edep
protected

Definition at line 21 of file LucidHitsTestTool.h.

◆ m_key

std::string SimTestToolBase::m_key
protectedinherited

The MC truth key.

Definition at line 34 of file SimTestToolBase.h.

◆ m_path

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

Definition at line 34 of file SimTestHisto.h.

◆ m_pdgid

TH1* LucidHitsTestTool::m_pdgid
protected

Definition at line 21 of file LucidHitsTestTool.h.

◆ m_R_v_z_edep

TH2 * LucidHitsTestTool::m_R_v_z_edep
protected

Definition at line 19 of file LucidHitsTestTool.h.

◆ m_R_v_z_hits

TH2 * LucidHitsTestTool::m_R_v_z_hits
protected

Definition at line 19 of file LucidHitsTestTool.h.

◆ m_R_v_z_post

TH2 * LucidHitsTestTool::m_R_v_z_post
protected

Definition at line 20 of file LucidHitsTestTool.h.

◆ m_time_edep

TH2 * LucidHitsTestTool::m_time_edep
protected

Definition at line 20 of file LucidHitsTestTool.h.

◆ m_total_e

TH1 * LucidHitsTestTool::m_total_e
protected

Definition at line 21 of file LucidHitsTestTool.h.

◆ m_tubeid

TH1 * LucidHitsTestTool::m_tubeid
protected

Definition at line 21 of file LucidHitsTestTool.h.

◆ m_wavelength

TH1 * LucidHitsTestTool::m_wavelength
protected

Definition at line 21 of file LucidHitsTestTool.h.

◆ m_x_v_y_edep

TH2* LucidHitsTestTool::m_x_v_y_edep
protected

Definition at line 19 of file LucidHitsTestTool.h.

◆ m_x_v_y_hits

TH2 * LucidHitsTestTool::m_x_v_y_hits
protected

Definition at line 19 of file LucidHitsTestTool.h.

◆ m_x_v_y_post

TH2* LucidHitsTestTool::m_x_v_y_post
protected

Definition at line 20 of file LucidHitsTestTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
LucidHitsTestTool::m_gen_volume
TH1 * m_gen_volume
Definition: LucidHitsTestTool.h:21
LucidHitsTestTool::m_hit_edep
TH1 * m_hit_edep
Definition: LucidHitsTestTool.h:21
LucidHitsTestTool::m_x_v_y_edep
TH2 * m_x_v_y_edep
Definition: LucidHitsTestTool.h:19
AtlasHitsVector
Definition: AtlasHitsVector.h:33
LucidHitsTestTool::m_tubeid
TH1 * m_tubeid
Definition: LucidHitsTestTool.h:21
LucidHitsTestTool::m_total_e
TH1 * m_total_e
Definition: LucidHitsTestTool.h:21
_SET_TITLE
#define _SET_TITLE(var, title, xaxis, yaxis)
Definition: SimTestHisto.h:93
SimTestToolBase::SimTestToolBase
SimTestToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition: SimTestToolBase.cxx:11
_TH1D
#define _TH1D(var, name, nbin, xmin, xmax)
Definition: SimTestHisto.h:47
LucidHitsTestTool::m_x_v_y_hits
TH2 * m_x_v_y_hits
Definition: LucidHitsTestTool.h:19
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
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:342
LucidHitsTestTool::m_R_v_z_post
TH2 * m_R_v_z_post
Definition: LucidHitsTestTool.h:20
LucidHitsTestTool::m_R_v_z_hits
TH2 * m_R_v_z_hits
Definition: LucidHitsTestTool.h:19
LUCID_SimHit
Definition: LUCID_SimHit.h:17
test_pyathena.parent
parent
Definition: test_pyathena.py:15
_TH2D
#define _TH2D(var, name, nbinx, xmin, xmax, nbiny, ymin, ymax)
Definition: SimTestHisto.h:81
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
_TH2D_WEIGHTED
#define _TH2D_WEIGHTED(var, name, nbinx, xmin, xmax, nbiny, ymin, ymax)
Definition: SimTestHisto.h:89
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
LucidHitsTestTool::m_R_v_z_edep
TH2 * m_R_v_z_edep
Definition: LucidHitsTestTool.h:19
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LucidHitsTestTool::m_wavelength
TH1 * m_wavelength
Definition: LucidHitsTestTool.h:21
SimTestHisto::m_path
std::string m_path
Definition: SimTestHisto.h:34
LucidHitsTestTool::m_pdgid
TH1 * m_pdgid
Definition: LucidHitsTestTool.h:21
SimTestToolBase::m_key
std::string m_key
The MC truth key.
Definition: SimTestToolBase.h:34
LucidHitsTestTool::m_x_v_y_post
TH2 * m_x_v_y_post
Definition: LucidHitsTestTool.h:20
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
LucidHitsTestTool::m_time_edep
TH2 * m_time_edep
Definition: LucidHitsTestTool.h:20