CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
23  public Observer<const BeginOfEvent *>,
24  public Observer<const G4Step *> {
25 
26 public:
27 
28  CaloTrkProcessing(G4String aSDname, const DDCompactView & cpv,
30  edm::ParameterSet const & p, const SimTrackManager*);
31  virtual ~CaloTrkProcessing();
32  virtual void Initialize(G4HCofThisEvent * ) {}
33  virtual void clearHits() {}
34  virtual bool ProcessHits(G4Step * , G4TouchableHistory * ) {
35  return true;
36  }
37  virtual uint32_t setDetUnitId(G4Step * step) {return 0;}
38  virtual void EndOfEvent(G4HCofThisEvent * ) {}
39  void fillHits(edm::PCaloHitContainer&, std::string ) {}
40 
41 private:
42 
43  void update(const BeginOfEvent * evt);
44  void update(const G4Step *);
45  std::vector<std::string> getNames(G4String, const DDsvalues_type&);
46  std::vector<double> getNumbers(G4String, const DDsvalues_type&);
47  int isItCalo(const G4VTouchable*);
48  int isItInside(const G4VTouchable*, int, int);
49 
50 
51  struct Detector {
52  Detector() {}
53  std::string name;
54  G4LogicalVolume* lv;
55  int level;
56  std::vector<std::string> fromDets;
57  std::vector<G4LogicalVolume*> fromDetL;
58  std::vector<int> fromLevels;
59  };
60 
61  // Utilities to get detector levels during a step
62  int detLevels(const G4VTouchable*) const;
63  G4LogicalVolume* detLV(const G4VTouchable*, int) const;
64  void detectorLevel(const G4VTouchable*, int&, int*,
65  G4String*) const;
66 
68  double eMin;
70  std::vector<Detector> detectors;
72 };
73 
74 #endif
75 
76 
77 
78 
79 
80 
81 
82 
G4LogicalVolume * detLV(const G4VTouchable *, int) const
std::vector< PCaloHit > PCaloHitContainer
int detLevels(const G4VTouchable *) const
list step
Definition: launcher.py:15
virtual void clearHits()
int isItCalo(const G4VTouchable *)
type of data representation of DDCompactView
Definition: DDCompactView.h:77
void detectorLevel(const G4VTouchable *, int &, int *, G4String *) const
int isItInside(const G4VTouchable *, int, int)
std::vector< int > fromLevels
std::vector< Detector > detectors
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
Definition: DDsvalues.h:19
std::vector< double > getNumbers(G4String, const DDsvalues_type &)
std::vector< G4LogicalVolume * > fromDetL
virtual std::vector< std::string > getNames()
std::vector< std::string > fromDets
CaloTrkProcessing(G4String aSDname, const DDCompactView &cpv, SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *)
void update(const BeginOfEvent *evt)
This routine will be called when the appropriate signal arrives.
virtual void EndOfEvent(G4HCofThisEvent *)
virtual void Initialize(G4HCofThisEvent *)
virtual bool ProcessHits(G4Step *, G4TouchableHistory *)
const SimTrackManager * m_trackManager
void fillHits(edm::PCaloHitContainer &, std::string)
virtual uint32_t setDetUnitId(G4Step *step)