CMS 3D CMS Logo

MuonSensitiveDetector.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_Muon_MuonSensitiveDetector_h
2 #define SimG4CMS_Muon_MuonSensitiveDetector_h
3 
25 
26 #include <string>
27 
28 class MuonSlaveSD;
30 class MuonFrameRotation;
31 class UpdatablePSimHit;
32 class MuonSubDetector;
33 class MuonG4Numbering;
34 class SimHitPrinter;
35 class G4Step;
37 class SimTrackManager;
38 
39 class MuonSensitiveDetector : public SensitiveTkDetector, public Observer<const BeginOfEvent*> {
40 public:
41  explicit MuonSensitiveDetector(const std::string&,
42  const MuonOffsetMap*,
43  const MuonGeometryConstants&,
45  edm::ParameterSet const& p,
46  const SimTrackManager*);
47  ~MuonSensitiveDetector() override;
48  G4bool ProcessHits(G4Step*, G4TouchableHistory*) override;
49  uint32_t setDetUnitId(const G4Step*) override;
50  void EndOfEvent(G4HCofThisEvent*) override;
51 
52  void fillHits(edm::PSimHitContainer&, const std::string&) override;
53  void clearHits() override;
54 
55  const MuonSlaveSD* GetSlaveMuon() const { return slaveMuon; }
56 
57 protected:
58  void update(const BeginOfEvent*) override;
59 
60 private:
61  inline Local3DPoint cmsUnits(const Local3DPoint& v) { return Local3DPoint(v.x() * 0.1, v.y() * 0.1, v.z() * 0.1); }
62  bool acceptHit(uint32_t id);
63 
69 
70  bool newHit(const G4Step*);
71  void createHit(const G4Step*);
72  void updateHit(const G4Step*);
73  void saveHit();
74 
80  Local3DPoint InitialStepPositionVsParent(const G4Step* currentStep, G4int levelsUp);
81  Local3DPoint FinalStepPositionVsParent(const G4Step* currentStep, G4int levelsUp);
82 
83  const G4VPhysicalVolume* thePV;
85  uint32_t theDetUnitId;
86  uint32_t newDetUnitId;
88 
89  bool printHits_;
91 
92  //--- SimTracks cuts
95 
96  // For choice of demo chambers
97  bool haveDemo_;
98  bool demoGEM_;
99  bool demoRPC_;
100 
102 
104 };
105 
106 #endif // MuonSensitiveDetector_h
const G4VPhysicalVolume * thePV
Local3DPoint FinalStepPositionVsParent(const G4Step *currentStep, G4int levelsUp)
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override
void updateHit(const G4Step *)
MuonSubDetector * detector
void fillHits(edm::PSimHitContainer &, const std::string &) override
Local3DPoint cmsUnits(const Local3DPoint &v)
void createHit(const G4Step *)
G4ProcessTypeEnumerator * theG4ProcessTypeEnumerator
bool newHit(const G4Step *)
const MuonFrameRotation * theRotation
MuonSensitiveDetector(const std::string &, const MuonOffsetMap *, const MuonGeometryConstants &, const SensitiveDetectorCatalog &, edm::ParameterSet const &p, const SimTrackManager *)
const SimTrackManager * theManager
uint32_t setDetUnitId(const G4Step *) override
void EndOfEvent(G4HCofThisEvent *) override
MuonSimHitNumberingScheme * numbering
void update(const BeginOfEvent *) override
This routine will be called when the appropriate signal arrives.
std::vector< PSimHit > PSimHitContainer
Local3DPoint InitialStepPositionVsParent(const G4Step *currentStep, G4int levelsUp)
UpdatablePSimHit * theHit
const MuonSlaveSD * GetSlaveMuon() const
MuonG4Numbering * g4numbering
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9