Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4_FEMC_EIC.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4_FEMC_EIC.C
1 using namespace std;
2 
3 void
5 {
6 }
7 
8 void FEMC_Cells(int verbosity = 0) {
9 
10  gSystem->Load("libfun4all.so");
11  gSystem->Load("libg4detectors.so");
13 
14  PHG4ForwardCalCellReco *hc = new PHG4ForwardCalCellReco("FEMCCellReco");
15  hc->Detector("FEMC");
16  se->registerSubsystem(hc);
17 
18  return;
19 }
20 
21 void
22 FEMCSetup(PHG4Reco* g4Reco, const int absorberactive = 0)
23 {
24 
25  gSystem->Load("libg4detectors.so");
26 
28 
30  PHG4ForwardEcalSubsystem *femc = new PHG4ForwardEcalSubsystem("FEMC");
31 
32  ostringstream mapping_femc;
33 
34  // EIC ECAL
35  femc->SetEICDetector();
36  mapping_femc << getenv("CALIBRATIONROOT") << "/ForwardEcal/mapping/towerMap_FEMC_v005.txt";
37 
38  cout << mapping_femc.str() << endl;
39 
40  femc->SetTowerMappingFile( mapping_femc.str() );
41  femc->OverlapCheck(overlapcheck);
42 
43  if (absorberactive) femc->SetAbsorberActive();
44 
45  g4Reco->registerSubsystem( femc );
46 
47 }
48 
49 void FEMC_Towers(int verbosity = 0) {
50 
51  gSystem->Load("libfun4all.so");
52  gSystem->Load("libg4detectors.so");
54 
55  ostringstream mapping_femc;
56  // EIC ECAL
57  mapping_femc << getenv("CALIBRATIONROOT") << "/ForwardEcal/mapping/towerMap_FEMC_v005.txt";
58 
59  RawTowerBuilderByHitIndex* tower_FEMC = new RawTowerBuilderByHitIndex("TowerBuilder_FEMC");
60  tower_FEMC->Detector("FEMC");
61  tower_FEMC->set_sim_tower_node_prefix("SIM");
62  tower_FEMC->GeometryTableFile( mapping_femc.str() );
63 
64  se->registerSubsystem(tower_FEMC);
65 
66  // PbSc towers
67  RawTowerDigitizer *TowerDigitizer2 = new RawTowerDigitizer("FEMCRawTowerDigitizer2");
68  TowerDigitizer2->Detector("FEMC");
69  TowerDigitizer2->TowerType(2);
70  TowerDigitizer2->Verbosity(verbosity);
72  se->registerSubsystem( TowerDigitizer2 );
73 
74  // PbSc towers
75  RawTowerCalibration *TowerCalibration2 = new RawTowerCalibration("FEMCRawTowerCalibration2");
76  TowerCalibration2->Detector("FEMC");
77  TowerCalibration2->TowerType(2);
78  TowerCalibration2->Verbosity(verbosity);
80  TowerCalibration2->set_calib_const_GeV_ADC(1.0/0.249); // sampling fraction = 0.249 for e-
81  TowerCalibration2->set_pedstal_ADC(0);
82  se->registerSubsystem( TowerCalibration2 );
83 
84 }
85 
86 void FEMC_Clusters(int verbosity = 0) {
87 
88  gSystem->Load("libfun4all.so");
89  gSystem->Load("libg4detectors.so");
91 
92  RawClusterBuilderFwd* ClusterBuilder = new RawClusterBuilderFwd("FEMCRawClusterBuilderFwd");
93  ClusterBuilder->Detector("FEMC");
94  ClusterBuilder->Verbosity(verbosity);
95  se->registerSubsystem( ClusterBuilder );
96 
97  return;
98 }
99 
100 void FEMC_Eval(std::string outputfile, int verbosity = 0)
101 {
102  gSystem->Load("libfun4all.so");
103  gSystem->Load("libg4eval.so");
105 
106  CaloEvaluator *eval = new CaloEvaluator("FEMCEVALUATOR", "FEMC", outputfile.c_str());
107  eval->Verbosity(verbosity);
108  se->registerSubsystem(eval);
109 
110  return;
111 }