CMS 3D CMS Logo

CaloTrkProcessing.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_CaloTrkProcessing_H
2 #define SimG4CMS_CaloTrkProcessing_H
3 
6 
8 
12 
13 #include "G4VTouchable.hh"
14 #include "G4Track.hh"
16 
17 #include <map>
18 #include <vector>
19 #include <string>
20 #include <iostream>
21 
22 class BeginOfEvent;
23 class G4LogicalVolume;
24 class G4Step;
25 class SimTrackManager;
26 
28  public Observer<const BeginOfEvent*>,
29  public Observer<const G4Step*> {
30 public:
31  CaloTrkProcessing(const std::string& aSDname,
32  const CaloSimulationParameters& csps,
33  const SensitiveDetectorCatalog& clg,
34  bool testBeam,
35  double eMin,
36  bool putHistory,
37  bool doFineCalo,
38  double eMinFine,
39  int addlevel,
40  const std::vector<std::string>& fineNames,
41  const std::vector<int>& fineLevels,
42  const std::vector<int>& useFines,
43  const SimTrackManager*);
44  ~CaloTrkProcessing() override;
45  void Initialize(G4HCofThisEvent*) override {}
46  void clearHits() override {}
47  bool ProcessHits(G4Step*, G4TouchableHistory*) override { return true; }
48  uint32_t setDetUnitId(const G4Step* step) override { return 0; }
49  void EndOfEvent(G4HCofThisEvent*) override {}
50  void fillHits(edm::PCaloHitContainer&, const std::string&) override {}
51 
52 private:
53  struct Detector {
54  Detector() {}
56  G4LogicalVolume* lv;
57  int level;
58  std::vector<std::string> fromDets;
59  std::vector<G4LogicalVolume*> fromDetL;
60  std::vector<int> fromLevels;
61  };
62 
63  void update(const BeginOfEvent* evt) override;
64  void update(const G4Step*) override;
65  int isItCalo(const G4VTouchable*, const std::vector<Detector>&);
66  int isItInside(const G4VTouchable*, int, int);
67 
68  // Utilities to get detector levels during a step
69  int detLevels(const G4VTouchable*) const;
70  G4LogicalVolume* detLV(const G4VTouchable*, int) const;
71  void detectorLevel(const G4VTouchable*, int&, int*, G4String*) const;
72 
73  const bool testBeam_;
74  const double eMin_;
75  const bool putHistory_;
77  const double eMinFine_;
78  const int addlevel_;
80  std::vector<Detector> detectors_, fineDetectors_;
81 };
82 
83 #endif
void update(const BeginOfEvent *evt) override
This routine will be called when the appropriate signal arrives.
void EndOfEvent(G4HCofThisEvent *) override
std::vector< PCaloHit > PCaloHitContainer
const double eMinFine_
G4LogicalVolume * detLV(const G4VTouchable *, int) const
void detectorLevel(const G4VTouchable *, int &, int *, G4String *) const
int isItInside(const G4VTouchable *, int, int)
bool ProcessHits(G4Step *, G4TouchableHistory *) override
std::vector< int > fromLevels
std::vector< Detector > fineDetectors_
std::vector< G4LogicalVolume * > fromDetL
void fillHits(edm::PCaloHitContainer &, const std::string &) override
std::vector< std::string > fromDets
int detLevels(const G4VTouchable *) const
uint32_t setDetUnitId(const G4Step *step) override
CaloTrkProcessing(const std::string &aSDname, const CaloSimulationParameters &csps, const SensitiveDetectorCatalog &clg, bool testBeam, double eMin, bool putHistory, bool doFineCalo, double eMinFine, int addlevel, const std::vector< std::string > &fineNames, const std::vector< int > &fineLevels, const std::vector< int > &useFines, const SimTrackManager *)
int isItCalo(const G4VTouchable *, const std::vector< Detector > &)
~CaloTrkProcessing() override
void Initialize(G4HCofThisEvent *) override
void clearHits() override
step
Definition: StallMonitor.cc:83
std::vector< Detector > detectors_