ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4_dRICH.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4_dRICH.C
1 
8 #ifndef MACRO_G4dRICH_C
9 #define MACRO_G4dRICH_C
10 
11 #include <GlobalVariables.C>
12 
13 #include <eccefastpidreco/ECCEFastPIDReco.h>
14 #include <eccefastpidreco/ECCEdRICHFastPIDMap.h>
17 
18 #include <g4main/PHG4Reco.h>
19 
20 R__LOAD_LIBRARY(libg4detectors.so)
21 R__LOAD_LIBRARY(libEICG4dRICH.so)
22 
23 R__LOAD_LIBRARY(libECCEFastPIDReco.so)
24 
25 namespace Enable
26 {
27  bool RICH = false;
28  bool RICH_RECO = false;
29  bool RICH_OVERLAPCHECK = false;
30  int RICH_VERBOSITY = 0;
31 } // namespace Enable
32 
33 void RICHInit()
34 {
37 }
38 
40 //Grzegorz Kalicy <gkalicy@jlab.org>
41 //- it starts 180 cm from IP
42 //- radius of aerogel part starts at 110 cm at rises up to 120cm over 20 cm of length.
43 //- at 175 cm from IP it rapidly grows radially to radius 210cm at stays constant like a cylinder until end at 280cm from the IP
44 void RICHSetup(PHG4Reco *g4Reco)
45 {
46  bool OverlapCheck = Enable::OVERLAPCHECK || Enable::RICH_OVERLAPCHECK;
48 
49  double z = 185; //Start of dRICH
50  double dz = 100; //Length of dRICH
51 
52  EICG4dRICHSubsystem *drichSubsys = new EICG4dRICHSubsystem("dRICh");
53  drichSubsys->SetGeometryFile(string(getenv("CALIBRATIONROOT")) + "/dRICH/mapping/drich-g4model_v5.txt");
54  drichSubsys->set_double_param("place_z", z + dz * 0.5); // relative position to mother vol.
55  drichSubsys->OverlapCheck(OverlapCheck);
56  drichSubsys->Verbosity(verbosity);
57  drichSubsys->SetActive();
58 
59  g4Reco->registerSubsystem(drichSubsys);
60 
62  {
63  // project to an reference plane at z=170 cm
65  TRACKING::ProjectionNames.insert("RICH");
66  }
67 }
68 
69 void RICHReco()
70 {
71  const int verbosity = std::max(Enable::VERBOSITY, Enable::RICH_VERBOSITY);
73 
75  pidmap->Verbosity(verbosity);
76  pidmap->dualRICH_aerogel();
77 
78  ECCEFastPIDReco *reco = new ECCEFastPIDReco(pidmap, EICPIDDefs::dRICH_AeroGel, "ECCEFastPIDReco-dRICH_AeroGel");
79  reco->Verbosity(verbosity);
80 
81  se->registerSubsystem(reco);
82 
83  pidmap = new ECCEdRICHFastPIDMap();
84  pidmap->Verbosity(verbosity);
85  pidmap->dualRICH_C2F6();
86 
87  reco = new ECCEFastPIDReco(pidmap, EICPIDDefs::dRICH_Gas, "ECCEFastPIDReco-dRICH_Gas");
88  reco->Verbosity(verbosity);
89 
90  se->registerSubsystem(reco);
91 }
92 
93 #endif