ATLAS Offline Software
TileSimEvent/TileSimEvent/TileHit.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //********************************************************************
6 // Filename : TileHit.h
7 // Author : Zhifang
8 // Created : April, 2002
9 //
10 // DESCRIPTION:
11 // A TileHit represents the total energy deposited in scintillator
12 // which is visible by one PMT
13 //
14 // HISTORY:
15 //
16 // BUGS:
17 //
18 // *******************************************************************
19 
20 #ifndef TILESIMEVENT_TILEHIT_H
21 #define TILESIMEVENT_TILEHIT_H
22 
24 
25 #include <string>
26 #include <vector>
27 class TileSimHit;
28 
29 class TileHit
30 {
31 public:
32 
34  TileHit() { }
35 
37  TileHit( const TileSimHit * hitInp );
38 
40  TileHit(const Identifier & id, float energy=0.0, float time=0.0);
41 
43  TileHit(const Identifier & id, float energy, float time, float deltaT);
44 
46  ~TileHit() { }
47 
49  int add (float energy, float time);
51  int add (float energy, float time, float deltaT);
53  int add (const TileHit *hitInp, float deltaT);
54 
56  void scale(float coeff);
57 
58  /* Inline set methods */
59 
61  inline void addEnergy (float e) { m_energy[0] += e; }
63  inline void setEnergy (float e, int ind=0) { m_energy[ind] = e; }
65  inline void setTime (float t, int ind=0) { m_time[ind] = t; }
67  inline void resize (int len) { m_energy.resize(len); m_time.resize(len); }
69  inline void reserve (int len) { m_energy.reserve(len); m_time.reserve(len); }
71  inline void setZero () { m_energy.resize(1); m_time.resize(1);
72  m_energy[0] = 0.0; m_time[0] = 0.0;}
73  /* Inline access methods */
74 
76  inline Identifier identify(void) const { return m_pmt_id; }
78  inline Identifier pmt_ID (void) const { return m_pmt_id; }
79 
81  HWIdentifier pmt_HWID(void) const;
83  Identifier tt_ID (void) const;
85  Identifier mt_ID (void) const;
87  int frag_ID (void) const;
88 
90  inline float energy (int ind=0) const { return m_energy[ind]; }
92  inline float time (int ind=0) const { return m_time[ind]; }
94  inline int size (void) const { return m_energy.size(); }
95 
97  std::string whoami (void) const { return "TileHit"; }
99  void print (void) const;
102  operator std::string() const;
103 
105  static void print_to_stream ( const std::vector<float>& val,
106  const std::string & label,
107  std::ostringstream & text);
108 
109 private:
110 
114  std::vector<float> m_energy; //
116  std::vector<float> m_time;
117 };
118 
119 #endif //TILESIMEVENT_TILEHIT_H
120 
TileHit::scale
void scale(float coeff)
Scale energy of all sub-hits in a hit
Definition: TileHit.cxx:117
TileHit::identify
Identifier identify(void) const
Return logical ID of the pmt.
Definition: TileSimEvent/TileSimEvent/TileHit.h:76
TileHit::frag_ID
int frag_ID(void) const
Return frag ID (like in BS file)
Definition: TileHit.cxx:137
TileHit::mt_ID
Identifier mt_ID(void) const
Return muon trigger ID
Definition: TileHit.cxx:133
TileHit::~TileHit
~TileHit()
Default destructor.
Definition: TileSimEvent/TileSimEvent/TileHit.h:46
TileHit::TileHit
TileHit()
Default constructor needed for POOL.
Definition: TileSimEvent/TileSimEvent/TileHit.h:34
TileHit::print_to_stream
static void print_to_stream(const std::vector< float > &val, const std::string &label, std::ostringstream &text)
Print contents of one vector to output stream.
Definition: TileHit.cxx:157
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
TileSimHit
Definition: TileSimHit.h:31
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
HWIdentifier
Definition: HWIdentifier.h:13
TileHit::size
int size(void) const
Return length of energy/time vectors
Definition: TileSimEvent/TileSimEvent/TileHit.h:94
TileHit::reserve
void reserve(int len)
Reserve length of energy and time vectors in a hit
Definition: TileSimEvent/TileSimEvent/TileHit.h:69
TileHit::resize
void resize(int len)
Resize energy and time vectors in a hit
Definition: TileSimEvent/TileSimEvent/TileHit.h:67
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
TileHit::add
int add(float energy, float time)
Add sub-hit to a given hit.
Definition: TileHit.cxx:74
TileHit::setEnergy
void setEnergy(float e, int ind=0)
Set energy of ind-th sub-hit in a hit
Definition: TileSimEvent/TileSimEvent/TileHit.h:63
TileHit::print
void print(void) const
Dump contents of the hit to std::out
Definition: TileHit.cxx:141
TileHit::addEnergy
void addEnergy(float e)
Add energy to the first sub-hit in a hit
Definition: TileSimEvent/TileSimEvent/TileHit.h:61
HWIdentifier.h
TileHit
Definition: TileSimEvent/TileSimEvent/TileHit.h:30
TileHit::whoami
std::string whoami(void) const
Return name of this object
Definition: TileSimEvent/TileSimEvent/TileHit.h:97
TileHit::tt_ID
Identifier tt_ID(void) const
Return trigger tower ID
Definition: TileHit.cxx:129
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
TileHit::m_pmt_id
Identifier m_pmt_id
Logical ID of the pmt
Definition: TileSimEvent/TileSimEvent/TileHit.h:112
TileHit::pmt_HWID
HWIdentifier pmt_HWID(void) const
Return pmt hardware ID (== channel ID)
Definition: TileHit.cxx:125
TileHit::energy
float energy(int ind=0) const
Return energy of ind-th sub-hit
Definition: TileSimEvent/TileSimEvent/TileHit.h:90
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
TileHit::setTime
void setTime(float t, int ind=0)
Set time of ind-th sub-hit in a hit
Definition: TileSimEvent/TileSimEvent/TileHit.h:65
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
TileHit::time
float time(int ind=0) const
Return time of ind-th sub-hit
Definition: TileSimEvent/TileSimEvent/TileHit.h:92
TileHit::m_time
std::vector< float > m_time
Time of the energy deposition relative to BC
Definition: TileSimEvent/TileSimEvent/TileHit.h:116
TileHit::setZero
void setZero()
Resize energy/time vectors in a hit to one and set energy/time to zero
Definition: TileSimEvent/TileSimEvent/TileHit.h:71
checkFileSG.ind
list ind
Definition: checkFileSG.py:118
TileHit::pmt_ID
Identifier pmt_ID(void) const
Return logical ID of the pmt.
Definition: TileSimEvent/TileSimEvent/TileHit.h:78
TileHit::m_energy
std::vector< float > m_energy
Energy deposited in scint, as seen by pmt in sepatate time bins
Definition: TileSimEvent/TileSimEvent/TileHit.h:114