CMS 3D CMS Logo

CaloTrkProcessing.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_CaloTrkProcessing_H
2 #define SimG4CMS_CaloTrkProcessing_H
3 
7 
9 
10 #include "G4VTouchable.hh"
11 
12 #include <map>
13 #include <vector>
14 #include <string>
15 #include <iostream>
16 
17 class SimTrackManager;
18 class BeginOfEvent;
19 class G4LogicalVolume;
20 class G4Step;
21 class SimTrackManager;
22 
24  public Observer<const BeginOfEvent*>,
25  public Observer<const G4Step*> {
26 public:
27  CaloTrkProcessing(const std::string& aSDname,
28  const DDCompactView& cpv,
29  const SensitiveDetectorCatalog& clg,
30  edm::ParameterSet const& p,
31  const SimTrackManager*);
32  ~CaloTrkProcessing() override;
33  void Initialize(G4HCofThisEvent*) override {}
34  void clearHits() override {}
35  bool ProcessHits(G4Step*, G4TouchableHistory*) override { return true; }
36  uint32_t setDetUnitId(const G4Step* step) override { return 0; }
37  void EndOfEvent(G4HCofThisEvent*) override {}
38  void fillHits(edm::PCaloHitContainer&, const std::string&) override {}
39 
40 private:
41  void update(const BeginOfEvent* evt) override;
42  void update(const G4Step*) override;
43  std::vector<std::string> getNames(G4String, const DDsvalues_type&);
44  std::vector<double> getNumbers(G4String, const DDsvalues_type&);
45  int isItCalo(const G4VTouchable*);
46  int isItInside(const G4VTouchable*, int, int);
47 
48  struct Detector {
49  Detector() {}
51  G4LogicalVolume* lv;
52  int level;
53  std::vector<std::string> fromDets;
54  std::vector<G4LogicalVolume*> fromDetL;
55  std::vector<int> fromLevels;
56  };
57 
58  // Utilities to get detector levels during a step
59  int detLevels(const G4VTouchable*) const;
60  G4LogicalVolume* detLV(const G4VTouchable*, int) const;
61  void detectorLevel(const G4VTouchable*, int&, int*, G4String*) const;
62 
64  double eMin;
66  std::vector<Detector> detectors;
68 };
69 
70 #endif
void update(const BeginOfEvent *evt) override
This routine will be called when the appropriate signal arrives.
void EndOfEvent(G4HCofThisEvent *) override
G4LogicalVolume * detLV(const G4VTouchable *, int) const
std::vector< PCaloHit > PCaloHitContainer
CaloTrkProcessing(const std::string &aSDname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *)
int detLevels(const G4VTouchable *) const
int isItCalo(const G4VTouchable *)
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
void detectorLevel(const G4VTouchable *, int &, int *, G4String *) const
int isItInside(const G4VTouchable *, int, int)
bool ProcessHits(G4Step *, G4TouchableHistory *) override
const std::vector< std::string > & getNames() const
std::vector< int > fromLevels
std::vector< Detector > detectors
std::vector< double > getNumbers(G4String, const DDsvalues_type &)
std::vector< G4LogicalVolume * > fromDetL
void fillHits(edm::PCaloHitContainer &, const std::string &) override
std::vector< std::string > fromDets
uint32_t setDetUnitId(const G4Step *step) override
~CaloTrkProcessing() override
void Initialize(G4HCofThisEvent *) override
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
void clearHits() override
const SimTrackManager * m_trackManager
step
Definition: StallMonitor.cc:94