The hadron calorimeter sensitive detector.
More...
#include <A01HadCalorimeterSD.h>
The hadron calorimeter sensitive detector.
- Author
- I. Hrivnacova; IPN, Orsay
Definition at line 30 of file A01HadCalorimeterSD.h.
◆ A01HadCalorimeterSD() [1/3]
A01HadCalorimeterSD::A01HadCalorimeterSD |
( |
const char * | name | ) |
|
Standard constructor. Create hits collection and an empty hit for each layer.
- Parameters
-
name | The calorimeter hits collection name |
Definition at line 39 of file A01HadCalorimeterSD.cxx.
45{
46
47
48
49
52 Int_t counter = 0;
54 for (Int_t iRow = 0; iRow <
fgkNofRows; ++iRow) {
56 }
57 }
58}
The hadron calorimeter hit.
static const Int_t fgkNofRows
Int_t fVerboseLevel
Verbosity level.
Int_t fVolId
The calorimeter volume Id.
static const Int_t fgkNofColumns
Bool_t fWriteHits
Option to write hits.
TClonesArray * fCalCollection
Hits collection.
◆ A01HadCalorimeterSD() [2/3]
Copy constructor (for clonig on worker thread in MT mode). Create hits collection and an empty hit for each layer.
- Parameters
-
origin | The source object (on master). |
Definition at line 61 of file A01HadCalorimeterSD.cxx.
67{
68
69
70
71
74 Int_t counter = 0;
76 for (Int_t iRow = 0; iRow <
fgkNofRows; ++iRow) {
78 }
79 }
80}
◆ A01HadCalorimeterSD() [3/3]
A01HadCalorimeterSD::A01HadCalorimeterSD |
( |
| ) |
|
◆ ~A01HadCalorimeterSD()
A01HadCalorimeterSD::~A01HadCalorimeterSD |
( |
| ) |
|
|
virtual |
◆ Initialize()
void A01HadCalorimeterSD::Initialize |
( |
| ) |
|
Register hits collection in the Root manager; set sensitive volumes.
Definition at line 125 of file A01HadCalorimeterSD.cxx.
126{
127
128
129
130 if (TMCRootManager::Instance())
Register();
131
132 fVolId = gMC->VolId(
"HadCalScintiLogical");
133}
◆ ProcessHits()
Bool_t A01HadCalorimeterSD::ProcessHits |
( |
| ) |
|
Account energy deposit for each layer in its hit.
Definition at line 136 of file A01HadCalorimeterSD.cxx.
137{
138
139
140 Int_t copyNo;
141 Int_t id = gMC->CurrentVolID(copyNo);
142 if (
id !=
fVolId)
return false;
143
144 Double_t edep = gMC->Edep();
145 if (edep == 0.) return false;
146
147 Int_t rowNo;
148 gMC->CurrentVolOffID(2, rowNo);
149 Int_t columnNo;
150 gMC->CurrentVolOffID(3, columnNo);
151
152 rowNo--;
153 columnNo--;
155
157 if (!hit) {
158 std::cerr << "No hit found for layer with "
159 << "rowNo = " << rowNo << " columnNo = " << columnNo << endl;
160 return false;
161 }
162
163
165
166
167
168
169
170
171
172
175
176
177
178 }
179
180
182
183 return true;
184}
Int_t GetColumnID() const
void SetRowID(Int_t volId)
void SetColumnID(Int_t z)
void AddEdep(Double_t de)
A01HadCalorHit * GetHit(Int_t i) const
◆ EndOfEvent()
void A01HadCalorimeterSD::EndOfEvent |
( |
| ) |
|
Print hits collection (if verbose) and reset hits afterwards.
Definition at line 187 of file A01HadCalorimeterSD.cxx.
188{
189
190
192
193
195}
◆ Register()
void A01HadCalorimeterSD::Register |
( |
| ) |
|
Register the hits collection in Root manager.
Definition at line 198 of file A01HadCalorimeterSD.cxx.
199{
200
201
203 TMCRootManager::Instance()->Register(
205 }
206}
◆ Print()
void A01HadCalorimeterSD::Print |
( |
Option_t * | option = "" | ) |
const |
|
virtual |
Print the hits collection.
Definition at line 209 of file A01HadCalorimeterSD.cxx.
210{
211
212
214
215 cout << "\n-------->Hits Collection: in this event: " << endl;
216
218 for (Int_t i = 0; i < nofHits; i++) (*
fCalCollection)[i]->Print();
219 }
220}
◆ PrintTotal()
void A01HadCalorimeterSD::PrintTotal |
( |
| ) |
const |
Print the total values for all layers.
Definition at line 223 of file A01HadCalorimeterSD.cxx.
224{
225
226
227 Int_t nofHits = 0;
228 Double_t totalEdep = 0.;
231 if (edep > 0.) {
232 nofHits++;
233 totalEdep += edep;
234 }
235 }
236 cout << GetName() << " has " << nofHits << " hits. Total Edep is "
237 << totalEdep * 1e03 << " (MeV)" << endl;
238}
◆ SetWriteHits()
void A01HadCalorimeterSD::SetWriteHits |
( |
Bool_t | writeHits | ) |
|
|
inline |
(In)Activate writing hits on file
- Parameters
-
writeHits | The new value of the option |
Definition at line 72 of file A01HadCalorimeterSD.h.
◆ SetVerboseLevel()
void A01HadCalorimeterSD::SetVerboseLevel |
( |
Int_t | level | ) |
|
|
inline |
◆ GetHit()
◆ ResetHits()
void A01HadCalorimeterSD::ResetHits |
( |
| ) |
|
|
private |
◆ fgkNofColumns
const Int_t A01HadCalorimeterSD::fgkNofColumns = 10 |
|
staticprivate |
◆ fgkNofRows
const Int_t A01HadCalorimeterSD::fgkNofRows = 2 |
|
staticprivate |
◆ fCalCollection
TClonesArray* A01HadCalorimeterSD::fCalCollection |
|
private |
◆ fVolId
Int_t A01HadCalorimeterSD::fVolId |
|
private |
◆ fWriteHits
Bool_t A01HadCalorimeterSD::fWriteHits |
|
private |
◆ fVerboseLevel
Int_t A01HadCalorimeterSD::fVerboseLevel |
|
private |
The documentation for this class was generated from the following files: