PandaRoot
PndDisc.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 //-------------------------------------------------------------------------
14 // Author: Oliver Merle (Oliver.Merle@exp2.physik.uni-giessen.de)
15 // Changes: Mustafa Schmidt (Mustafa.A.Schmidt@physik.uni-giessen.de)
16 // Date: 30.11.2015
17 // Description: Disc DIRC Implementation for PandaRoot (Giessen)
18 //-------------------------------------------------------------------------
19 
20 #ifndef PNDDISC_HH
21 #define PNDDISC_HH
22 
23 // Subdetector specific
24 #include <PndDiscSensorMCPoint.h>
25 #include <PndDiscParticleMCPoint.h>
26 
27 // ROOT
28 #include <Rtypes.h>
29 #include <TLorentzVector.h>
30 
31 // FairRoot / PROOT
32 #include <FairDetector.h>
33 
34 // cpp
35 #include <set>
36 #include <string>
37 #include <map>
38 
39 class FairMCEventHeader;
40 
41 class PndDisc : public FairDetector {
42  public:
43  // ctor / dtor
44  PndDisc();
45  PndDisc(const char *name, Bool_t active, Int_t det_id = 0);
46  ~PndDisc();
47 
48  // interface - initialization
49  virtual void Initialize(); //* detector initialization
50 
51  // interface - geo (FairModule)
52  virtual void ConstructGeometry();
53  virtual void ConstructOpGeometry();
54 
55  // interface - transport (FairDetector)
56  virtual Bool_t ProcessHits(FairVolume *v = 0); //* called for each step during simulation (see FairMCApplication::Stepping())
57  // virtual void BeginPrimary(); // define actions at the beginning of the primary track (-> TVirtualMCApplication)
58  // virtual void FinishPrimary(); // define actions at the end of the primary track (-> TVirtualMCApplication)
59  virtual void BeginEvent(); // define actions at the beginning of the event (-> TVirtualMCApplication)
60  // virtual void FinishEvent(); // define actions at the end of the event (-> TVirtualMCApplication)
61  virtual void EndOfEvent(); //* called after FinishEvent() and after fRootManager->Fill() in FairMCApplication::FinishEvent (time to free the data in mem?)
62  virtual void PreTrack(); // define actions at the beginning of each track (-> TVirtualMCApplication)
63  virtual void PostTrack(); // define actions at the end of each track (-> TVirtualMCApplication)
64  // virtual void FinishRun(); // called after sim all events (gMC->ProcessRun(int)) (-> FairMCApplication::FinishRun)
65  // virtual void SetSpecialPhysicsCuts(); //
66 
67  virtual bool CheckIfSensitive(std::string name); // Fairroot uses this function to query sensitive volumes
68 
69  // interface - collections
70  virtual void Register(); //* register the produced collections in FAIRRootManager
71  virtual TClonesArray *GetCollection(Int_t iColl) const; //* return pointer to the produced collections **/
72  virtual void Reset(); //* reset containers (abstract in FairDetector)
73  // virtual void CopyClones( TClonesArray* cl1, TClonesArray* cl2 , Int_t offset);
74 
75  // --------------------------------
76  // Detector specific functionality:
77  // --------------------------------
78  void StorePhotonTracks(Bool_t bval);
79  void SetFilterInterval(Double_t const &wl_min_nm_, Double_t const &wl_max_nm_);
80 
81  private:
82  Bool_t store_photon_tracks;
83  Bool_t track_is_photon;
84  TLorentzVector old_momentum; // cache the photon momentum.
85 
86  TClonesArray *clarr_sensor_hits;
87  TClonesArray *clarr_photon_tracks;
88  TClonesArray *clarr_particle_tracks;
89 
90  // keep track of the number of entries. Looking in Roots GetEntriesFast
91  // makes you pulling your hair out.
92  int nextid_clarr_sensor_hits;
93  int nextid_clarr_photon_tracks;
94  int nextid_clarr_particle_tracks;
95 
96  FairMCEventHeader *ev_header;
97  std::map<int, std::pair<int, double>> last_track_occurence;
98  std::set<std::string> names_of_sensitive_volumes;
99  std::map<int, double> internal_reflection_angle_of_photons;
100  std::map<int, std::pair<TLorentzVector, TLorentzVector>> photons_entering_optics;
101 
102  int design_id;
103  Double_t wl_min_nm;
104  Double_t wl_max_nm;
105 
106  ClassDef(PndDisc, 1)
107 };
108 
109 #endif // PNDDISC_HH
virtual Bool_t ProcessHits(FairVolume *v=0)
virtual void Reset()
virtual void ConstructGeometry()
virtual TClonesArray * GetCollection(Int_t iColl) const
__m128 v
Definition: P4_F32vec4.h:15
virtual void ConstructOpGeometry()
virtual bool CheckIfSensitive(std::string name)
void StorePhotonTracks(Bool_t bval)
virtual void Initialize()
virtual void EndOfEvent()
virtual void PostTrack()
void SetFilterInterval(Double_t const &wl_min_nm_, Double_t const &wl_max_nm_)
virtual void Register()
virtual void BeginEvent()
virtual void PreTrack()