19#include <TLorentzVector.h>
20#include <TMCRootManager.h>
22#include <TVirtualMC.h>
58 fVolName(origin.fVolName),
59 fVolId(origin.fVolId),
60 fWriteHits(origin.fWriteHits),
61 fVerboseLevel(origin.fVerboseLevel)
115 if (TMCRootManager::Instance())
Register();
127 Int_t
id = gMC->CurrentVolID(copyNo);
128 if (
id !=
fVolId)
return false;
130 Double_t edep = gMC->Edep();
131 if (edep == 0.)
return false;
133 Double_t hitTime = gMC->TrackTime();
138 for (Int_t i = 0; i < nofHits; i++) {
140 if (hit->
GetID() == copyNo) {
149 if (hit->
GetTime() > hitTime) {
188 TMCRootManager::Instance()->Register(
199 cout << GetName() <<
" has " << nofHits <<
" hits." << endl;
217 Int_t nofHits = fHitsCollection->GetEntriesFast();
218 for (Int_t i=0; i<nofHits; i++) {
219 totEAbs += GetHit(i)->GetEdepAbs();
220 totLAbs += GetHit(i)->GetTrakAbs();
221 totEGap += GetHit(i)->GetEdepGap();
222 totLGap += GetHit(i)->GetTrakGap();
225 cout << " Absorber: total energy (MeV): "
226 << setw(7) << totEAbs * 1.0e03
227 << " total track length (cm): "
228 << setw(7) << totLAbs
230 << " Gap: total energy (MeV): "
231 << setw(7) << totEGap * 1.0e03
232 << " total track length (cm): "
233 << setw(7) << totLGap
Definition of the A01HodoscopeHit class.
Definition of the A01HodoscopeSD class.
void SetVolId(Int_t volId)
The calorimeter sensitive detector.
TString fVolName
The sensitive volume Name.
Bool_t fWriteHits
Option to write hits.
virtual void Print(Option_t *option="") const
Int_t fVolId
The calorimeter volume Id.
A01HodoscopeHit * GetHit(Int_t i) const
virtual ~A01HodoscopeSD()
TClonesArray * fHitsCollection
Hits collection.
Int_t fVerboseLevel
Verbosity level.