EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
reconstruction.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file reconstruction.C
1 
2 #include <simulation.C>
3 
4 void reconstruction(unsigned seed = 0x12345678)
5 {
6  // Load basic libraries;
7  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
8 
9  // Create generic analysis run manager; configure it for track reconstruction;
10  EicRunAna *fRun = new EicRunAna();
11  fRun->SetInputFile ("simulation.root");
12  fRun->AddFriend ("digitization.root");
13  fRun->SetOutputFile("reconstruction.root");
14  fRun->SetSeed(seed);
15 
16  EicIdealTrackingCode* idealTracker = new EicIdealTrackingCode();
17  idealTracker->AddDetectorGroup("FST");
18  idealTracker->AddDetectorGroup("BST");
19  idealTracker->AddDetectorGroup("VST");
20  idealTracker->AddDetectorGroup("TPC");
21  idealTracker->AddDetectorGroup("FGT");
22  idealTracker->AddDetectorGroup("BGT");
23  idealTracker->SetRelativeMomentumSmearing(0.1);
24  idealTracker->SetVertexSmearing(0.01, 0.01, 0.01);
25  idealTracker->SetTrackOutBranchName("EicIdealTrack");
26  fRun->AddTask(idealTracker);
27 
28  // Invoke and configure PandaRoot Kalman filter code wrapper;
29  fRun->AddTask(new EicRecoKalmanTask(idealTracker));
30 
31  // This call here just performs track backward propagation to the beam line;
32  fRun->AddTask(new PndPidCorrelator());
33 
34  // Well, need to tune this stuff and add HCal sections;
35 #ifdef _WITH_CALORIMETERS_
36  {
38  new EicCalorimeterReconstruction("BEMC", mcInFile, digiInFile);
39  // 1-st: cluster seed threshold (cells below that can not initiate clustering);
40  // 2-d : neighbour search threshold (cells below that can not initiate neighbour
41  // attachment for the cluster they are associated with);
42  // 3-d : cell cutoff threshold (cells below that are ignored);
43  //@@@bemc->SetClusterAlgorithmThresholds(0.3, 0.03, 0.005);
44  bemc->SetClusterAlgorithmThresholds(0.100, 0.010, 0.005);
45  // Well, sampling fraction is ~100% here, except for the losses in alveoles,
46  // leaks and unattached hits; those contribute ~20% however -> need to apply
47  // not exactly the primary light yield used in digitization.C in order to match
48  // 1 GeV energy;
49  //@@@bemc->SetPhotonToEnergyConversionFactor(1/18400.);
50  bemc->SetPhotonToEnergyConversionFactor(1/8500.);
51  // 1E5 photons scale;
52  bemc->RequestLightYieldPlot(100000);
53  fRun->AddTask(bemc);
54  }
55  {
56  // Declare custom calorimeter reconstruction; detector choice is done by
57  // name encoded in calorimeter.root file;
59  new EicCalorimeterReconstruction("FEMC", mcInFile, digiInFile);
60  // 1-st: cluster seed threshold (cells below that can not initiate clustering);
61  // 2-d : neighbour search threshold (cells below that can not initiate neighbour
62  // attachment for the cluster they are associated with);
63  // 3-d : cell cutoff threshold (cells below that are ignored);
64  femc->SetClusterAlgorithmThresholds(0.100, 0.005, 0.005);
66  femc->RequestLightYieldPlot(1000);
67  fRun->AddTask(femc);
68  }
69  {
70  // Declare custom calorimeter reconstruction; detector choice is done by
71  // name encoded in calorimeter.root file;
73  new EicCalorimeterReconstruction("CEMC", mcInFile, digiInFile);
74  // 1-st: cluster seed threshold (cells below that can not initiate clustering);
75  // 2-d : neighbour search threshold (cells below that can not initiate neighbour
76  // attachment for the cluster they are associated with);
77  // 3-d : cell cutoff threshold (cells below that are ignored);
78  cemc->SetClusterAlgorithmThresholds(0.100, 0.005, 0.005);
80  cemc->RequestLightYieldPlot(1000);
81  fRun->AddTask(cemc);
82  }
83 #endif
84 
86 #ifdef _WITH_CALORIMETERS_
87  // NB: e/m calorimeters are expected to be ordered in rapidity range,
88  // otherwise sanity check in th ecode may fail;
89  eea->AddEmCal("FEMC");
90  eea->AddEmCal("CEMC");
91  eea->AddEmCal("FEMC");
92  eea->AddEmCal("BEMC");
93 
94  eea->AddHCal ("FHAC");
95  eea->AddHCal ("BHAC");
96 #endif
97  fRun->AddTask(eea);
98 
99  // Initialize and run the reconstruction; exit at the end;
100  fRun->Run();
101 } // reconstruction()