1 #ifndef SimG4CMS_CaloSD_h 2 #define SimG4CMS_CaloSD_h 25 #include "G4VPhysicalVolume.hh" 27 #include "G4VGFlashSensitiveDetector.hh" 31 #include <unordered_map> 35 class G4HCofThisEvent;
41 public G4VGFlashSensitiveDetector,
43 public Observer<const BeginOfEvent*>,
44 public Observer<const BeginOfTrack*>,
53 bool ignoreTkID =
false,
59 bool ProcessHits(G4GFlashSpot* aSpot, G4TouchableHistory*)
override;
63 void Initialize(G4HCofThisEvent* HCE)
override;
64 void EndOfEvent(G4HCofThisEvent* eventHC)
override;
65 void clear()
override;
71 void reset()
override;
80 G4ThreeVector
setToLocal(
const G4ThreeVector&,
const G4VTouchable*)
const;
81 G4ThreeVector
setToGlobal(
const G4ThreeVector&,
const G4VTouchable*)
const;
88 double getAttenuation(
const G4Step* aStep,
double birk1,
double birk2,
double birk3)
const;
99 void update(const ::EndOfEvent*)
override;
107 virtual uint16_t
getDepth(
const G4Step*);
171 std::unique_ptr<CaloSlaveSD>
slave[2];
195 std::map<CaloHitID, CaloG4Hit*>
hitMap[2];
196 std::map<int, TrackWithHistory*>
tkMap;
198 std::vector<std::unique_ptr<CaloG4Hit>>
reusehit[2];
203 #endif // SimG4CMS_CaloSD_h CaloG4Hit * currentHit[2]
virtual void processSecondHit(const G4Step *, const G4Track *)
int getNumberOfHits(int k=0)
virtual bool getFromLibrary(const G4Step *step)
std::vector< PCaloHit > PCaloHitContainer
std::map< CaloHitID, CaloG4Hit * > hitMap[2]
virtual uint16_t getDepth(const G4Step *)
virtual double getEnergyDeposit(const G4Step *step)
virtual double EnergyCorrected(const G4Step &step, const G4Track *)
unsigned int findBoundaryCrossingParent(const G4Track *track, bool markParentAsSaveable=true)
void setNumberCheckedHits(int val, int k=0)
uint32_t setDetUnitId(const G4Step *step) override=0
void newCollection(const std::string &name, edm::ParameterSet const &p)
G4ThreeVector setToLocal(const G4ThreeVector &, const G4VTouchable *) const
virtual int getTrackID(const G4Track *)
CaloG4HitCollection * theHC[2]
void Initialize(G4HCofThisEvent *HCE) override
std::vector< int > useResMap_
void processHit(const G4Step *step)
void fillHits(edm::PCaloHitContainer &, const std::string &) override
std::vector< Detector > fineDetectors_
bool saveHit(CaloG4Hit *, int k=0)
virtual void initEvent(const BeginOfEvent *)
std::unordered_map< unsigned int, unsigned int > boundaryCrossingParentMap_
void cleanHitCollection()
bool isItFineCalo(const G4VTouchable *touch)
double getResponseWt(const G4Track *, int k=0)
void updateHit(CaloG4Hit *, int k)
CaloG4Hit * createNewHit(const G4Step *, const G4Track *, int k)
static std::string printableDecayChain(const std::vector< unsigned int > &decayChain)
void resetForNewPrimary(const G4Step *)
G4bool ProcessHits(G4Step *step, G4TouchableHistory *) override
std::vector< std::string > hcn_
std::vector< std::unique_ptr< CaloG4Hit > > reusehit[2]
G4ThreeVector setToGlobal(const G4ThreeVector &, const G4VTouchable *) const
virtual bool filterHit(CaloG4Hit *, double)
CaloSD(const std::string &aSDname, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false, const std::string &newcolname="")
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
void EndOfEvent(G4HCofThisEvent *eventHC) override
void storeHit(CaloG4Hit *, int k=0)
bool hitExists(const G4Step *, int k)
void printDetectorLevels(const G4VTouchable *) const
virtual int setTrackID(const G4Step *)
G4THitsCollection< CaloG4Hit > CaloG4HitCollection
std::map< int, TrackWithHistory * > tkMap
std::unique_ptr< CaloMeanResponse > meanResponse[2]
const SimTrackManager * m_trackManager
std::string shortreprID(const CaloHitID &ID)
void clearHits() override
std::unique_ptr< CaloSlaveSD > slave[2]
G4ThreeVector entrancePoint
G4ThreeVector entranceLocal
void update(const BeginOfRun *) override
This routine will be called when the appropriate signal arrives.
void setParameterized(bool val)