21#include "Ex03CalorHit.h"
25#include <TLorentzVector.h>
26#include <TMCManager.h>
27#include <TMCRootManager.h>
29#include <TVirtualMC.h>
67 fAbsorberVolId(origin.fAbsorberVolId),
68 fGapVolId(origin.fGapVolId),
69 fVerboseLevel(origin.fVerboseLevel)
136 if (TMCRootManager::Instance())
Register();
141 if (TMCManager::Instance()) {
142 TMCManager::Instance()->ConnectEnginePointer(
fMC);
158 Int_t
id =
fMC->CurrentVolID(copyNo);
162 fMC->CurrentVolOffID(2, copyNo);
165 Double_t edep =
fMC->Edep();
168 if (
fMC->TrackCharge() != 0.) step =
fMC->TrackStep();
171 std::cerr <<
"No hit found for layer with copyNo = " << copyNo << endl;
202 TMCRootManager::Instance()->Register(
"hits",
"TClonesArray", &
fCalCollection);
212 cout <<
"\n-------->Hits Collection: in this event: " << endl;
214 for (Int_t i = 0; i < nofHits; i++) (*
fCalCollection)[i]->Print();
222 Double_t totEAbs = 0.;
223 Double_t totLAbs = 0.;
224 Double_t totEGap = 0.;
225 Double_t totLGap = 0.;
228 for (Int_t i = 0; i < nofHits; i++) {
235 cout <<
" Absorber: total energy (MeV): " << setw(7) << totEAbs * 1.0e03
236 <<
" total track length (cm): " << setw(7) << totLAbs << endl
237 <<
" Gap: total energy (MeV): " << setw(7) << totEGap * 1.0e03
238 <<
" total track length (cm): " << setw(7) << totLGap << endl;
Definition of the Ex03cCalorimeterSD class.
Definition of the Ex03cDetectorConstruction class.
void AddAbs(Double_t de, Double_t dl)
void AddGap(Double_t de, Double_t dl)
The calorimeter sensitive detector.
virtual ~Ex03cCalorimeterSD()
Int_t fAbsorberVolId
The absorber volume Id.
Int_t fVerboseLevel
Verbosity level.
Int_t fGapVolId
The gap volume Id.
Ex03CalorHit * GetHit(Int_t i) const
TVirtualMC * fMC
The VMC implementation.
virtual void Print(Option_t *option="") const
Ex03cDetectorConstruction * fDetector
Detector construction.
TClonesArray * fCalCollection
Hits collection.
The detector construction (via TGeo )
Int_t GetNbOfLayers() const