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