19#include <TLorentzVector.h>
20#include <TMCRootManager.h>
22#include <TVirtualMC.h>
58 fVolId(origin.fVolId),
59 fWriteHits(origin.fWriteHits),
60 fVerboseLevel(origin.fVerboseLevel)
74 :
TNamed(), fCalCollection(0), fVolId(0), fWriteHits(true), fVerboseLevel(1)
111 if (TMCRootManager::Instance())
Register();
113 fVolId = gMC->VolId(
"cellLogical");
122 Int_t
id = gMC->CurrentVolID(copyNo);
123 if (
id !=
fVolId)
return false;
125 Double_t edep = gMC->Edep();
126 if (edep == 0.)
return false;
128 Int_t rowNo = copyNo;
130 gMC->CurrentVolOffID(1, columnNo);
138 std::cerr <<
"No hit found for layer with copyNo = " << copyNo << endl;
183 TMCRootManager::Instance()->Register(
195 cout <<
"\n-------->Hits Collection: in this event: " << endl;
198 for (Int_t i = 0; i < nofHits; i++) (*
fCalCollection)[i]->Print();
208 Double_t totalEdep = 0.;
216 cout << GetName() <<
" has " << nofHits <<
" hits. Total Edep is "
217 << totalEdep * 1e03 <<
" (MeV)" << endl;
Definition of the A01EmCalorHit class.
Definition of the A01EmCalorimeterSD class.
void AddEdep(Double_t de)
void SetVolId(Int_t volId)
The EM calorimeter sensitive detector.
Int_t fVolId
The calorimeter volume Id.
A01EmCalorHit * GetHit(Int_t i) const
static const Int_t fgkNofRows
virtual ~A01EmCalorimeterSD()
virtual void Print(Option_t *option="") const
Bool_t fWriteHits
Option to write hits.
Int_t fVerboseLevel
Verbosity level.
TClonesArray * fCalCollection
Hits collection.
static const Int_t fgkNofColumns