21#include "Ex03CalorHit.h"
22#include "Ex03DetectorConstruction.h"
25#include <TLorentzVector.h>
26#include <TMCRootManager.h>
28#include <TVirtualMC.h>
66 fAbsorberVolId(origin.fAbsorberVolId),
67 fGapVolId(origin.fGapVolId),
68 fVerboseLevel(origin.fVerboseLevel)
135 if (TMCRootManager::Instance())
Register();
152 Int_t
id =
fMC->CurrentVolID(copyNo);
156 fMC->CurrentVolOffID(2, copyNo);
159 Double_t edep =
fMC->Edep();
162 if (
fMC->TrackCharge() != 0.) step =
fMC->TrackStep();
165 std::cerr <<
"No hit found for layer with copyNo = " << copyNo << endl;
196 TMCRootManager::Instance()->Register(
"hits",
"TClonesArray", &
fCalCollection);
206 cout <<
"\n-------->Hits Collection: in this event: " << endl;
208 for (Int_t i = 0; i < nofHits; i++) (*
fCalCollection)[i]->Print();
216 Double_t totEAbs = 0.;
217 Double_t totLAbs = 0.;
218 Double_t totEGap = 0.;
219 Double_t totLGap = 0.;
222 for (Int_t i = 0; i < nofHits; i++) {
229 cout <<
" Absorber: total energy (MeV): " << setw(7) << totEAbs * 1.0e03
230 <<
" total track length (cm): " << setw(7) << totLAbs << endl
231 <<
" Gap: total energy (MeV): " << setw(7) << totEGap * 1.0e03
232 <<
" total track length (cm): " << setw(7) << totLGap << endl;
Definition of the Ex03CalorimeterSD class.
void AddAbs(Double_t de, Double_t dl)
void AddGap(Double_t de, Double_t dl)
The calorimeter sensitive detector.
Ex03DetectorConstruction * fDetector
Detector construction.
TClonesArray * fCalCollection
Hits collection.
Int_t fVerboseLevel
Verbosity level.
virtual ~Ex03CalorimeterSD()
Int_t fGapVolId
The gap volume Id.
Int_t fAbsorberVolId
The absorber volume Id.
Ex03CalorHit * GetHit(Int_t i) const
TVirtualMC * fMC
The VMC implementation.
virtual void Print(Option_t *option="") const
The detector construction (via TGeo )
Int_t GetNbOfLayers() const