EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OpDet.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file OpDet.h
1 
2 #ifndef OpDet_h
3 #define OpDet_h
4 
5 // detector for optical photons
6 
7 #include <CLHEP/Random/Random.h>
8 #include <Geant4/globals.hh>
9 #include <Rtypes.h>
10 
11 class Detector;
12 class G4LogicalVolume;
13 class G4Step;
14 class G4TouchableHistory;
15 class TTree;
16 class G4VPhysicalVolume;
17 
18 class OpDet {
19 
20  public:
21 
22  OpDet(const G4String& name, G4double xysiz, G4double zpos, G4double xmid, G4double ymid, G4LogicalVolume *top);
23  virtual ~OpDet();
24 
25  //G4VSensitiveDetector
26  virtual G4bool ProcessHits(const G4Step *step, G4TouchableHistory*);
27 
28  //Detector
29 // virtual void Add(std::vector<Detector*> *vec) {vec->push_back(this);}
30  virtual const G4String& GetName() const {return fNam;}
31  virtual void CreateOutput(TTree *tree);
32  virtual void ClearEvent();
33  virtual void FinishEvent();
34 
35  G4VPhysicalVolume *GetPhysicalVolume() const {return fPhys;}
36 
37  private:
38 
39  void AddBranch(const std::string& nam, Double_t *val, TTree *tree);
40  void AddBranch(const std::string& nam, ULong64_t *val, TTree *tree);
41 
42  Double_t fEdep; // total energy deposited in optical photon detector
43  Double_t fEopt; // energy deposited by optical photons
44  ULong64_t fNphot; // number of photons in event
45  ULong64_t fNscin; // scintillation photons
46  ULong64_t fNcerenkov; // Cerenkov photons
47 
48  Double_t fTmin; // time of first detected photon
49  Double_t fTmax; // time of last detected photon
50  Double_t fTavg; // average time of all detected photons
51 
52  G4VPhysicalVolume *fPhys; // optical detector physical volume
53  G4String fNam; // detector name
54 
55  G4double fQE; // quantum efficiency
56  CLHEP::HepRandom *fRand; // random generator for quantum efficiency
57 
58  G4int fScinType; // scintillation process type
59  G4int fScinSubType; // scintillation process subtype
60  G4int fCerenkovType; // Cerenkov process type
61  G4int fCerenkovSubType; // Cerenkov process subtype
62 
63  friend class CompCal;
64 
65 };
66 
67 #endif
68