forked from ECCE-EIC/macros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
G4_dRICH.C
93 lines (73 loc) · 2.76 KB
/
G4_dRICH.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*!
* \file G4_RICH.C
* \brief Setup the gas RICH detector as designed in ePHENIX LOI
* \author Jin Huang <[email protected]>
* \version $Revision: 1.2 $
* \date $Date: 2013/10/09 01:08:17 $
*/
#ifndef MACRO_G4dRICH_C
#define MACRO_G4dRICH_C
#include <GlobalVariables.C>
#include <eccefastpidreco/ECCEFastPIDReco.h>
#include <eccefastpidreco/ECCEdRICHFastPIDMap.h>
#include <g4drich/EICG4dRICHSubsystem.h>
#include <g4trackfastsim/PHG4TrackFastSim.h>
#include <g4main/PHG4Reco.h>
R__LOAD_LIBRARY(libg4detectors.so)
R__LOAD_LIBRARY(libEICG4dRICH.so)
R__LOAD_LIBRARY(libECCEFastPIDReco.so)
namespace Enable
{
bool RICH = false;
bool RICH_RECO = false;
bool RICH_OVERLAPCHECK = false;
int RICH_VERBOSITY = 0;
} // namespace Enable
void RICHInit()
{
BlackHoleGeometry::max_radius = std::max(BlackHoleGeometry::max_radius, 210.);
BlackHoleGeometry::max_z = std::max(BlackHoleGeometry::max_z, 280.);
}
//! Fast geometry model for dRICH
//Grzegorz Kalicy <[email protected]>
//- it starts 180 cm from IP
//- radius of aerogel part starts at 110 cm at rises up to 120cm over 20 cm of length.
//- 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
void RICHSetup(PHG4Reco *g4Reco)
{
bool OverlapCheck = Enable::OVERLAPCHECK || Enable::RICH_OVERLAPCHECK;
int verbosity = std::max(Enable::VERBOSITY, Enable::RICH_VERBOSITY);
double z = 185; //Start of dRICH
double dz = 100; //Length of dRICH
EICG4dRICHSubsystem *drichSubsys = new EICG4dRICHSubsystem("dRICh");
drichSubsys->SetGeometryFile(string(getenv("CALIBRATIONROOT")) + "/dRICH/mapping/drich-g4model_v3.txt");
drichSubsys->set_double_param("place_z", z + dz * 0.5); // relative position to mother vol.
drichSubsys->OverlapCheck(OverlapCheck);
drichSubsys->Verbosity(verbosity);
drichSubsys->SetActive();
g4Reco->registerSubsystem(drichSubsys);
if (TRACKING::FastKalmanFilter)
{
// project to an reference plane at z=170 cm
TRACKING::FastKalmanFilter->add_zplane_state("RICH", 185);
TRACKING::ProjectionNames.insert("RICH");
}
}
void RICHReco()
{
const int verbosity = std::max(Enable::VERBOSITY, Enable::RICH_VERBOSITY);
Fun4AllServer *se = Fun4AllServer::instance();
ECCEdRICHFastPIDMap *pidmap = new ECCEdRICHFastPIDMap();
pidmap->Verbosity(verbosity);
pidmap->dualRICH_aerogel();
ECCEFastPIDReco *reco = new ECCEFastPIDReco(pidmap, EICPIDDefs::dRICH_AeroGel, "ECCEFastPIDReco-dRICH_AeroGel");
reco->Verbosity(verbosity);
se->registerSubsystem(reco);
pidmap = new ECCEdRICHFastPIDMap();
pidmap->Verbosity(verbosity);
pidmap->dualRICH_C2F6();
reco = new ECCEFastPIDReco(pidmap, EICPIDDefs::dRICH_Gas, "ECCEFastPIDReco-dRICH_Gas");
reco->Verbosity(verbosity);
se->registerSubsystem(reco);
}
#endif