ATLAS Offline Software
Loading...
Searching...
No Matches
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.
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}
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition DataVector.h:838
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.
std::string m_key
The MC truth key.
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...
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ 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}
#define _TH2D_WEIGHTED(var, name, nbinx, xmin, xmax, nbiny, ymin, ymax)
#define _TH2D(var, name, nbinx, xmin, xmax, nbiny, ymin, ymax)
#define _TH1D(var, name, nbin, xmin, xmax)
#define _SET_TITLE(var, title, xaxis, yaxis)
std::string m_path

◆ 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}
#define CHECK(...)
Evaluate an expression and check for errors.
AtlasHitsVector< LUCID_SimHit > LUCID_SimHitCollection

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.

35{"THistSvc", "SimTestHisto"};

◆ 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.

34{"/truth/"};

◆ 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: