EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4_Bbc.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4_Bbc.C
1 #ifndef MACRO_G4BBC_C
2 #define MACRO_G4BBC_C
3 
4 #include <GlobalVariables.C>
5 
7 
9 #include <g4main/PHG4Reco.h>
10 
11 #include <fun4all/Fun4AllServer.h>
12 
13 
14 R__LOAD_LIBRARY(libg4bbc.so)
15 R__LOAD_LIBRARY(libg4detectors.so)
16 
17 namespace Enable
18 {
19  bool BBC = false; // Actual BBC detector
20  bool BBC_SUPPORT = false; // BBC Supports
21  bool BBCFAKE = false; // Just generate fake bbc vtx, t0
22  int BBC_VERBOSITY = 0;
23 } // namespace Enable
24 
25 namespace G4BBC
26 {
27  double z_smearing = 0.; // should be 6 mm, temporarily perfect for TPC initial vertexing
28  double t_smearing = 0.02; // 20ps timing resolution
29 } // namespace G4BBC
30 
31 void BbcInit()
32 {
34  {
35  cout << "Enable::BBC and Enable::BBCFAKE cannot be true at the same time" << endl;
36  gSystem->Exit(1);
37  }
38  // Set boundary of tracked particles to include BBC (values in cm)
39  if (Enable::BBC)
40  {
44  }
45 }
46 
47 void Bbc(PHG4Reco* g4Reco)
48 {
49  bool SupportActive = Enable::SUPPORT || Enable::BBC_SUPPORT;
50  if (Enable::BBC)
51  {
52  PHG4BbcSubsystem* bbc = new PHG4BbcSubsystem("BBC");
53  bbc->SuperDetector("BBC");
55  bbc->SetActive();
56  if (SupportActive)
57  {
58  bbc->SetSupportActive(SupportActive);
59  }
60  g4Reco->registerSubsystem(bbc);
61  }
62  return;
63 }
64 
65 void Bbc_Reco()
66 {
68 
69  //---------------
70  // Fun4All server
71  //---------------
72 
74 
75  if (Enable::BBCFAKE)
76  {
77  if (verbosity > 0)
78  {
79  cout << "BBCFAKE: Using smeared vtx and t0 resolutions of "
80  << G4BBC::z_smearing << " cm and " << G4BBC::t_smearing * 1000 << " ps" << endl;
81  }
82  BbcVertexFastSimReco* bbcvertex = new BbcVertexFastSimReco();
85  se->registerSubsystem(bbcvertex);
86  }
87 
88  return;
89 }
90 #endif