The EM calorimeter sensitive detector.
More...
#include <A01EmCalorimeterSD.h>
The EM calorimeter sensitive detector.
- Author
- I. Hrivnacova; IPN, Orsay
Definition at line 30 of file A01EmCalorimeterSD.h.
◆ A01EmCalorimeterSD() [1/3]
A01EmCalorimeterSD::A01EmCalorimeterSD |
( |
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 37 of file A01EmCalorimeterSD.cxx.
43{
44
45
46
47
52}
Int_t fVolId
The calorimeter volume Id.
static const Int_t fgkNofRows
Bool_t fWriteHits
Option to write hits.
Int_t fVerboseLevel
Verbosity level.
TClonesArray * fCalCollection
Hits collection.
static const Int_t fgkNofColumns
◆ A01EmCalorimeterSD() [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 55 of file A01EmCalorimeterSD.cxx.
◆ A01EmCalorimeterSD() [3/3]
A01EmCalorimeterSD::A01EmCalorimeterSD |
( |
| ) |
|
◆ ~A01EmCalorimeterSD()
A01EmCalorimeterSD::~A01EmCalorimeterSD |
( |
| ) |
|
|
virtual |
◆ Initialize()
void A01EmCalorimeterSD::Initialize |
( |
| ) |
|
Register hits collection in the Root manager; set sensitive volumes.
Definition at line 106 of file A01EmCalorimeterSD.cxx.
107{
108
109
110
111 if (TMCRootManager::Instance())
Register();
112
113 fVolId = gMC->VolId(
"cellLogical");
114}
◆ ProcessHits()
Bool_t A01EmCalorimeterSD::ProcessHits |
( |
| ) |
|
Account energy deposit for each layer in its hit.
Definition at line 117 of file A01EmCalorimeterSD.cxx.
118{
119
120
121 Int_t copyNo;
122 Int_t id = gMC->CurrentVolID(copyNo);
123 if (
id !=
fVolId)
return false;
124
125 Double_t edep = gMC->Edep();
126 if (edep == 0.) return false;
127
128 Int_t rowNo = copyNo;
129 Int_t columnNo;
130 gMC->CurrentVolOffID(1, columnNo);
131
132 rowNo--;
133 columnNo--;
135
137 if (!hit) {
138 std::cerr << "No hit found for layer with copyNo = " << copyNo << endl;
139 return false;
140 }
141
142
144
145
146
147
148
149
150
151
153
154
155 }
156
157
158
159
160
162
163 return true;
164}
void AddEdep(Double_t de)
void SetVolId(Int_t volId)
A01EmCalorHit * GetHit(Int_t i) const
◆ EndOfEvent()
void A01EmCalorimeterSD::EndOfEvent |
( |
| ) |
|
Print hits collection (if verbose) and reset hits afterwards.
Definition at line 167 of file A01EmCalorimeterSD.cxx.
168{
169
170
172
173
175}
◆ Register()
void A01EmCalorimeterSD::Register |
( |
| ) |
|
Register the hits collection in Root manager.
Definition at line 178 of file A01EmCalorimeterSD.cxx.
179{
180
181
183 TMCRootManager::Instance()->Register(
185 }
186}
◆ Print()
void A01EmCalorimeterSD::Print |
( |
Option_t * | option = "" | ) |
const |
|
virtual |
Print the hits collection.
Definition at line 189 of file A01EmCalorimeterSD.cxx.
190{
191
192
194
195 cout << "\n-------->Hits Collection: in this event: " << endl;
196
198 for (Int_t i = 0; i < nofHits; i++) (*
fCalCollection)[i]->Print();
199 }
200}
◆ PrintTotal()
void A01EmCalorimeterSD::PrintTotal |
( |
| ) |
const |
Print the total values for all layers.
Definition at line 203 of file A01EmCalorimeterSD.cxx.
204{
205
206
207 Int_t nofHits = 0;
208 Double_t totalEdep = 0.;
211 if (edep > 0.) {
212 nofHits++;
213 totalEdep += edep;
214 }
215 }
216 cout << GetName() << " has " << nofHits << " hits. Total Edep is "
217 << totalEdep * 1e03 << " (MeV)" << endl;
218}
◆ SetWriteHits()
void A01EmCalorimeterSD::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 A01EmCalorimeterSD.h.
◆ SetVerboseLevel()
void A01EmCalorimeterSD::SetVerboseLevel |
( |
Int_t | level | ) |
|
|
inline |
Set verbose level
- Parameters
-
level | The new verbose level value |
Definition at line 79 of file A01EmCalorimeterSD.h.
◆ GetHit()
◆ ResetHits()
void A01EmCalorimeterSD::ResetHits |
( |
| ) |
|
|
private |
◆ fgkNofColumns
const Int_t A01EmCalorimeterSD::fgkNofColumns = 20 |
|
staticprivate |
◆ fgkNofRows
const Int_t A01EmCalorimeterSD::fgkNofRows = 4 |
|
staticprivate |
◆ fCalCollection
TClonesArray* A01EmCalorimeterSD::fCalCollection |
|
private |
◆ fVolId
Int_t A01EmCalorimeterSD::fVolId |
|
private |
◆ fWriteHits
Bool_t A01EmCalorimeterSD::fWriteHits |
|
private |
◆ fVerboseLevel
Int_t A01EmCalorimeterSD::fVerboseLevel |
|
private |
The documentation for this class was generated from the following files: