4 #include "G4VPhysicalVolume.hh"
5 #include "G4PVPlacement.hh"
6 #include "G4HCofThisEvent.hh"
7 #include "G4TouchableHistory.hh"
10 #include "G4VSolid.hh"
11 #include "G4DynamicParticle.hh"
12 #include "G4ParticleDefinition.hh"
13 #include "G4SDManager.hh"
20 m_trackManager(manager), hcID(-1), theHC(0), currentHit(0) {
23 LogDebug(
"FiberSim") <<
"***************************************************"
27 <<
"* Constructing a HFWedgeSD with name " << GetName()
31 <<
"***************************************************";
35 std::vector<std::string> lvNames = clg.
logicalNames(name);
37 for (std::vector<std::string>::iterator it=lvNames.begin();
38 it !=lvNames.end(); it++){
40 LogDebug(
"FiberSim") <<
"HFWedgeSD : Assigns SD to LV " << (*it);
50 LogDebug(
"FiberSim") <<
"HFWedgeSD : Initialize called for " << GetName();
61 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
62 const G4VTouchable* touch = preStepPoint->GetTouchable();
64 trackID = aStep->GetTrack()->GetTrackID();
65 edep = aStep->GetTotalEnergyDeposit();
66 time = (preStepPoint->GetGlobalTime())/ns;
70 const G4DynamicParticle* particle = aStep->GetTrack()->GetDynamicParticle();
71 momDir = particle->GetMomentumDirection();
81 LogDebug(
"FiberSim") <<
"HFWedgeSD: Sees" <<
theHC->entries() <<
" hits";
99 std::map<int,HFShowerG4Hit*>::const_iterator it =
hitMap.find(
currentID);
112 <<
" MeV; Time: " <<
time <<
" ns; Position (local) "
114 <<
" direction " <<
momDir;
135 <<
" edep " <<
edep/MeV <<
" MeV";
146 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
147 return (touch->GetReplicaNumber(0));
std::vector< PCaloHit > PCaloHitContainer
std::vector< std::string > logicalNames(std::string &readoutName)
void updateHit(HFShowerG4Hit *)
virtual uint32_t setDetUnitId(G4Step *)
void setPrimMomDir(G4ThreeVector xyz)
type of data representation of DDCompactView
virtual void EndOfEvent(G4HCofThisEvent *eventHC)
std::string const collectionName[nCollections]
void setTrackId(G4int trackId)
void setHitId(G4int hitId)
HFShowerG4HitsCollection * theHC
HFShowerG4Hit * currentHit
virtual void AssignSD(std::string &vname)
void setGlobalPos(G4ThreeVector xyz)
void updateEnergy(G4double edep)
void setLocalPos(G4ThreeVector xyz)
HFShowerG4Hit * createNewHit()
virtual bool ProcessHits(G4Step *step, G4TouchableHistory *tHistory)
std::map< int, HFShowerG4Hit * > hitMap
virtual void fillHits(edm::PCaloHitContainer &, std::string)
virtual void Initialize(G4HCofThisEvent *HCE)
G4THitsCollection< HFShowerG4Hit > HFShowerG4HitsCollection
HFWedgeSD(std::string name, const DDCompactView &cpv, SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *)