32 #include "G4HCofThisEvent.hh"
45 fHitsCollection(nullptr),
72 for (
G4int i=0; i<fNofCells+1; i++ ) {
91 if ( edep==0. && stepLength == 0. )
return false;
96 auto layerNumber = touchable->GetReplicaNumber(1);
99 auto hit = (*fHitsCollection)[layerNumber];
102 msg <<
"Cannot access hit " << layerNumber;
109 = (*fHitsCollection)[fHitsCollection->
entries()-1];
112 hit->Add(edep, stepLength);
113 hitTotal->Add(edep, stepLength);
123 auto nofHits = fHitsCollection->
entries();
126 <<
"-------->Hits Collection: in this event they are " << nofHits
127 <<
" hits in the tracker chambers: " <<
G4endl;
128 for (
G4int i=0; i<nofHits; i++ ) (*fHitsCollection)[i]->Print();
G4String SensitiveDetectorName
G4ParticleDefinition * GetDefinition() const
G4int GetCollectionID(G4String colName)
std::ostringstream G4ExceptionDescription
G4double GetStepLength() const
G4THitsCollection< B4cCalorHit > B4cCalorHitsCollection
const G4VTouchable * GetTouchable() const
G4StepPoint * GetPreStepPoint() const
Definition of the B4cCalorimeterSD class.
B4cCalorimeterSD(const G4String &name, const G4String &hitsCollectionName, G4int nofCells)
G4GLOB_DLL std::ostream G4cout
void insert(G4String str)
virtual G4bool ProcessHits(G4Step *step, G4TouchableHistory *history)
G4double GetTotalEnergyDeposit() const
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4SDManager * GetSDMpointer()
virtual ~B4cCalorimeterSD()
G4CollectionNameVector collectionName
G4Track * GetTrack() const
G4double GetPDGCharge() const
virtual void Initialize(G4HCofThisEvent *hitCollection)
virtual void EndOfEvent(G4HCofThisEvent *hitCollection)