FairRoot/PandaRoot
PndDisc.h
Go to the documentation of this file.
1 //-------------------------------------------------------------------------
2 // Author: Oliver Merle (Oliver.Merle@exp2.physik.uni-giessen.de)
3 // Changes: Mustafa Schmidt (Mustafa.A.Schmidt@physik.uni-giessen.de)
4 // Date: 30.11.2015
5 // Description: Disc DIRC Implementation for PandaRoot (Giessen)
6 //-------------------------------------------------------------------------
7 
8 
9 #ifndef PNDDISC_HH
10 #define PNDDISC_HH
11 
12 
13 // Subdetector specific
14 #include <PndDiscSensorMCPoint.h>
15 #include <PndDiscParticleMCPoint.h>
16 
17 // ROOT
18 #include <Rtypes.h>
19 #include <TLorentzVector.h>
20 
21 // FairRoot / PROOT
22 #include <FairDetector.h>
23 
24 // cpp
25 #include <set>
26 #include <string>
27 #include <map>
28 
29 
30 
31 class FairMCEventHeader;
32 
33 
34 
35 class PndDisc : public FairDetector
36 {
37 public:
38  // ctor / dtor
39  PndDisc();
40  PndDisc(const char * name, Bool_t active, Int_t det_id=0);
41  ~PndDisc();
42 
43  // interface - initialization
44  virtual void Initialize(); //* detector initialization
45 
46  // interface - geo (FairModule)
47  virtual void ConstructGeometry();
48  virtual void ConstructOpGeometry();
49 
50  // interface - transport (FairDetector)
51  virtual Bool_t ProcessHits(FairVolume* v=0); //* called for each step during simulation (see FairMCApplication::Stepping())
52  //virtual void BeginPrimary(); // define actions at the beginning of the primary track (-> TVirtualMCApplication)
53  //virtual void FinishPrimary(); // define actions at the end of the primary track (-> TVirtualMCApplication)
54  virtual void BeginEvent(); // define actions at the beginning of the event (-> TVirtualMCApplication)
55  //virtual void FinishEvent(); // define actions at the end of the event (-> TVirtualMCApplication)
56  virtual void EndOfEvent(); //* called after FinishEvent() and after fRootManager->Fill() in FairMCApplication::FinishEvent (time to free the data in mem?)
57  virtual void PreTrack(); // define actions at the beginning of each track (-> TVirtualMCApplication)
58  virtual void PostTrack(); // define actions at the end of each track (-> TVirtualMCApplication)
59  //virtual void FinishRun(); // called after sim all events (gMC->ProcessRun(int)) (-> FairMCApplication::FinishRun)
60  //virtual void SetSpecialPhysicsCuts(); //
61 
62  virtual bool CheckIfSensitive(std::string name); // Fairroot uses this function to query sensitive volumes
63 
64  // interface - collections
65  virtual void Register(); //* register the produced collections in FAIRRootManager
66  virtual TClonesArray* GetCollection(Int_t iColl) const; //* return pointer to the produced collections **/
67  virtual void Reset(); //* reset containers (abstract in FairDetector)
68  //virtual void CopyClones( TClonesArray* cl1, TClonesArray* cl2 , Int_t offset);
69 
70  // --------------------------------
71  // Detector specific functionality:
72  // --------------------------------
73  void StorePhotonTracks(Bool_t bval);
74  void SetFilterInterval(Double_t const & wl_min_nm_, Double_t const & wl_max_nm_);
75 
76 private:
79  TLorentzVector old_momentum; // cache the photon momentum.
80 
81  TClonesArray* clarr_sensor_hits;
82  TClonesArray* clarr_photon_tracks;
83  TClonesArray* clarr_particle_tracks;
84 
85  // keep track of the number of entries. Looking in Roots GetEntriesFast
86  // makes you pulling your hair out.
90 
91  FairMCEventHeader * ev_header;
92  std::map<int, std::pair<int, double> > last_track_occurence;
93  std::set<std::string> names_of_sensitive_volumes;
94  std::map<int, double> internal_reflection_angle_of_photons;
95  std::map<int, std::pair<TLorentzVector,TLorentzVector> > photons_entering_optics;
96 
97  int design_id;
100 
101  ClassDef(PndDisc, 1)
102 };
103 
104 
105 
106 #endif // PNDDISC_HH
FairMCEventHeader * ev_header
Definition: PndDisc.h:91
TClonesArray * clarr_photon_tracks
hit on a photodetector surface
Definition: PndDisc.h:82
virtual void Initialize()
Initialize will be called after the Geometry is created.
Definition: PndDisc.cxx:86
std::map< int, double > internal_reflection_angle_of_photons
Definition: PndDisc.h:94
TClonesArray * clarr_sensor_hits
Definition: PndDisc.h:81
virtual void BeginEvent()
Definition: PndDisc.cxx:539
int design_id
photon track ids that have been
Definition: PndDisc.h:97
Double_t wl_max_nm
Definition: PndDisc.h:99
PndDisc()
Definition: PndDisc.cxx:49
TClonesArray * clarr_particle_tracks
optical photon tracks
Definition: PndDisc.h:83
virtual void Reset()
Interface implementation - reset the &#39;containers&#39;.
Definition: PndDisc.cxx:596
virtual bool CheckIfSensitive(std::string name)
Interface implementation - Check if a given volume name belongs to a sensitive volume.
Definition: PndDisc.cxx:613
__m128 v
Definition: P4_F32vec4.h:4
virtual void ConstructGeometry()
Definition: PndDisc.cxx:102
std::set< std::string > names_of_sensitive_volumes
Definition: PndDisc.h:93
virtual void Register()
Interface implementation - Register the data collections in FairRootManager.
Definition: PndDisc.cxx:564
std::map< int, std::pair< int, double > > last_track_occurence
Definition: PndDisc.h:92
TLorentzVector old_momentum
Definition: PndDisc.h:79
virtual void PostTrack()
Definition: PndDisc.cxx:258
Double_t
std::map< int, std::pair< TLorentzVector, TLorentzVector > > photons_entering_optics
Definition: PndDisc.h:95
virtual Bool_t ProcessHits(FairVolume *v=0)
Definition: PndDisc.cxx:268
virtual TClonesArray * GetCollection(Int_t iColl) const
Interface implementation - Get a data collection by index.
Definition: PndDisc.cxx:578
int nextid_clarr_particle_tracks
Definition: PndDisc.h:89
Double_t wl_min_nm
Definition: PndDisc.h:98
int nextid_clarr_sensor_hits
tracks of other particles
Definition: PndDisc.h:87
Bool_t track_is_photon
Definition: PndDisc.h:78
TString name
Bool_t store_photon_tracks
Definition: PndDisc.h:77
void StorePhotonTracks(Bool_t bval)
Enable/Disable the storage of photon track information.
Definition: PndDisc.cxx:626
virtual void PreTrack()
Definition: PndDisc.cxx:248
virtual void EndOfEvent()
Interface implementation - EndofEvent.
Definition: PndDisc.cxx:551
~PndDisc()
Definition: PndDisc.cxx:67
int nextid_clarr_photon_tracks
Definition: PndDisc.h:88
virtual void ConstructOpGeometry()
Definition: PndDisc.cxx:135
void SetFilterInterval(Double_t const &wl_min_nm_, Double_t const &wl_max_nm_)
Set the wavelength range of the bandpass filters.
Definition: PndDisc.cxx:634