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 
9 #include "G4VTouchable.hh"
10 
11 #include <map>
12 #include <vector>
13 #include <string>
14 #include <iostream>
15 
16 class SimTrackManager;
17 class BeginOfEvent;
18 class G4LogicalVolume;
19 class G4Step;
20 class SimTrackManager;
21 
23  public Observer<const BeginOfEvent*>,
24  public Observer<const G4Step*> {
25 public:
26  CaloTrkProcessing(const std::string& aSDname,
27  const edm::EventSetup& es,
28  const SensitiveDetectorCatalog& clg,
29  edm::ParameterSet const& p,
30  const SimTrackManager*);
31  ~CaloTrkProcessing() override;
32  void Initialize(G4HCofThisEvent*) override {}
33  void clearHits() override {}
34  bool ProcessHits(G4Step*, G4TouchableHistory*) override { return true; }
35  uint32_t setDetUnitId(const G4Step* step) override { return 0; }
36  void EndOfEvent(G4HCofThisEvent*) override {}
37  void fillHits(edm::PCaloHitContainer&, const std::string&) override {}
38 
39 private:
40  struct Detector {
41  Detector() {}
43  G4LogicalVolume* lv;
44  int level;
45  std::vector<std::string> fromDets;
46  std::vector<G4LogicalVolume*> fromDetL;
47  std::vector<int> fromLevels;
48  };
49 
50  void update(const BeginOfEvent* evt) override;
51  void update(const G4Step*) override;
52  int isItCalo(const G4VTouchable*, const std::vector<Detector>&);
53  int isItInside(const G4VTouchable*, int, int);
54 
55  // Utilities to get detector levels during a step
56  int detLevels(const G4VTouchable*) const;
57  G4LogicalVolume* detLV(const G4VTouchable*, int) const;
58  void detectorLevel(const G4VTouchable*, int&, int*, G4String*) const;
59 
63  std::vector<Detector> detectors_, fineDetectors_;
64 };
65 
66 #endif
CaloTrkProcessing::eMin_
double eMin_
Definition: CaloTrkProcessing.h:61
SimTrackManager
Definition: SimTrackManager.h:35
CaloTrkProcessing::Detector::Detector
Detector()
Definition: CaloTrkProcessing.h:41
Observer
Definition: Observer.h:23
MessageLogger.h
SensitiveCaloDetector.h
step
step
Definition: StallMonitor.cc:94
CaloTrkProcessing::Detector::fromLevels
std::vector< int > fromLevels
Definition: CaloTrkProcessing.h:47
CaloTrkProcessing::detectorLevel
void detectorLevel(const G4VTouchable *, int &, int *, G4String *) const
Definition: CaloTrkProcessing.cc:375
CaloTrkProcessing::Detector::fromDets
std::vector< std::string > fromDets
Definition: CaloTrkProcessing.h:45
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CaloTrkProcessing::Detector::level
int level
Definition: CaloTrkProcessing.h:44
CaloTrkProcessing::putHistory_
bool putHistory_
Definition: CaloTrkProcessing.h:60
CaloTrkProcessing::eMinFinePhoton_
double eMinFinePhoton_
Definition: CaloTrkProcessing.h:61
CaloTrkProcessing::lastTrackID_
int lastTrackID_
Definition: CaloTrkProcessing.h:62
Observer.h
CaloTrkProcessing::doFineCalo_
bool doFineCalo_
Definition: CaloTrkProcessing.h:60
CaloTrkProcessing::isItInside
int isItInside(const G4VTouchable *, int, int)
Definition: CaloTrkProcessing.cc:293
SensitiveCaloDetector
Definition: SensitiveCaloDetector.h:10
CaloTrkProcessing::detLevels
int detLevels(const G4VTouchable *) const
Definition: CaloTrkProcessing.cc:354
CaloTrkProcessing::detLV
G4LogicalVolume * detLV(const G4VTouchable *, int) const
Definition: CaloTrkProcessing.cc:362
CaloTrkProcessing::Detector::lv
G4LogicalVolume * lv
Definition: CaloTrkProcessing.h:43
CaloTrkProcessing::update
void update(const BeginOfEvent *evt) override
This routine will be called when the appropriate signal arrives.
Definition: CaloTrkProcessing.cc:174
CaloTrkProcessing::Detector::fromDetL
std::vector< G4LogicalVolume * > fromDetL
Definition: CaloTrkProcessing.h:46
SensitiveDetectorCatalog
Definition: SensitiveDetectorCatalog.h:10
CaloTrkProcessing::fineDetectors_
std::vector< Detector > fineDetectors_
Definition: CaloTrkProcessing.h:63
CaloTrkProcessing::fillHits
void fillHits(edm::PCaloHitContainer &, const std::string &) override
Definition: CaloTrkProcessing.h:37
CaloTrkProcessing
Definition: CaloTrkProcessing.h:22
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
CaloTrkProcessing::EndOfEvent
void EndOfEvent(G4HCofThisEvent *) override
Definition: CaloTrkProcessing.h:36
CaloTrkProcessing::setDetUnitId
uint32_t setDetUnitId(const G4Step *step) override
Definition: CaloTrkProcessing.h:35
BeginOfEvent
Definition: BeginOfEvent.h:6
edm::EventSetup
Definition: EventSetup.h:57
CaloTrkProcessing::eMinFine_
double eMinFine_
Definition: CaloTrkProcessing.h:61
CaloTrkProcessing::Detector::name
std::string name
Definition: CaloTrkProcessing.h:42
CaloTrkProcessing::Detector
Definition: CaloTrkProcessing.h:40
CaloTrkProcessing::ProcessHits
bool ProcessHits(G4Step *, G4TouchableHistory *) override
Definition: CaloTrkProcessing.h:34
CaloTrkProcessing::Initialize
void Initialize(G4HCofThisEvent *) override
Definition: CaloTrkProcessing.h:32
CaloTrkProcessing::clearHits
void clearHits() override
Definition: CaloTrkProcessing.h:33
edm::PCaloHitContainer
std::vector< PCaloHit > PCaloHitContainer
Definition: PCaloHitContainer.h:8
CaloTrkProcessing::isItCalo
int isItCalo(const G4VTouchable *, const std::vector< Detector > &)
Definition: CaloTrkProcessing.cc:264
CaloTrkProcessing::detectors_
std::vector< Detector > detectors_
Definition: CaloTrkProcessing.h:63
CaloTrkProcessing::~CaloTrkProcessing
~CaloTrkProcessing() override
Definition: CaloTrkProcessing.cc:172
CaloTrkProcessing::testBeam_
bool testBeam_
Definition: CaloTrkProcessing.h:60
CaloTrkProcessing::CaloTrkProcessing
CaloTrkProcessing(const std::string &aSDname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *)
Definition: CaloTrkProcessing.cc:25