Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
plain_dataSummer23_simple_preNov23.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file plain_dataSummer23_simple_preNov23.C
1 #pragma once
2 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
3 #include <fun4all/SubsysReco.h>
9 //#include <rawwaveformtowerbuilder/RawWaveformTowerBuilder.h>
11 
12 //#include <litecaloeval/LiteCaloEval.h>
13 #include <caloreco/CaloTowerCalib.h>
14 #include <caloreco/RawClusterBuilderTemplate.h>
15 #include <calib_emc_pi0/CaloCalibEmc_Pi0.h>
16 
17 #include <phool/recoConsts.h>
18 
19 
20 R__LOAD_LIBRARY(libfun4all.so)
21 R__LOAD_LIBRARY(libfun4allraw.so)
22 R__LOAD_LIBRARY(libcalo_reco.so)
23 //R__LOAD_LIBRARY(libLiteCaloEvalTowSlope.so)
24 R__LOAD_LIBRARY(libcalibCaloEmc_pi0.so)
25 
26 
27 
28 #endif
29 
30 // to get files from my local area
31 void dst_simple_towerslope_runmacro(int nevents = 1e5, const char *fname = "/sphenix/user/sregmi/FINAL_VERSION/tower_slope_old_tower_method/3_RawWaveformTowerBuilder/macro/testoutput_400.root", const char * outfile = "defout.root", const int runNumber = 0)
32 
33 {
34  gSystem->Load("libg4dst");
35 
37 
38  // CaloWaveFormSim *ca = new CaloWaveFormSim("CALOWAVEFORMSIM",outfile);
39  // ca->Detector("CEMC");
40  // se->registerSubsystem(ca);
41 
42  // Fun4AllInputManager *in = new Fun4AllPrdfInputManager("in");
43  // in->fileopen(fname);
44 
46 
47  TString infiletstr(fname);
48  if (infiletstr.Contains(".list"))
49  in->AddListFile(fname);
50  else
51  in->fileopen(fname);
52 
53 
54  se->registerInputManager(in);
55 
56  Fun4AllInputManager *intrue2 = new Fun4AllRunNodeInputManager("DST_GEO");
57  intrue2->AddFile("updated_geo.root");
58  se->registerInputManager(intrue2);
59 
60 
61  //CaloTowerBuilder *ca = new CaloTowerBuilder();
62 
64  rc->set_StringFlag("CDB_GLOBALTAG","ProdA_2023"); // this points to the global tag in the CDB
65  // The calibrations have a validity range set by the beam clock which is not read out of the prdfs as of now
66  // rc->set_uint64Flag("TIMESTAMP",0);
67  rc->set_uint64Flag("TIMESTAMP",runNumber);
68 
69 
70  CaloTowerCalib *calib = new CaloTowerCalib("CEMCCALIB");
71  // calib->setCalibName("cemc_abscalib_cosmic");// these two lines are needed to choose your own calibration
72  // calib->setFieldName("cemc_abscalib_cosmic");
74  se->registerSubsystem(calib);
75 
76 
77  RawClusterBuilderTemplate *ClusterBuilder = new RawClusterBuilderTemplate("EmcRawClusterBuilderTemplate2");
78  ClusterBuilder->Detector("CEMC");
79  ClusterBuilder->Verbosity(10);
80  ClusterBuilder->set_threshold_energy(0.032); // This threshold should be the same as in CEMCprof_Thresh**.root file below
81  std::string emc_prof = getenv("CALIBRATIONROOT");
82  emc_prof += "/EmcProfile/CEMCprof_Thresh30MeV.root";
83  ClusterBuilder->LoadProfile(emc_prof);
84  ClusterBuilder->set_UseTowerInfo(1); // to use towerinfo objects rather than old RawTower
85  se->registerSubsystem(ClusterBuilder);
86 
87 
88  CaloCalibEmc_Pi0 *eval_pi2 = new CaloCalibEmc_Pi0("dummy", outfile);
89  // this call is needed for embedding
90  // eval_pi2->set_centrality_nclusters_cut(350); // which uses more central events
91  // than we will for data to enhance Bkg
92  // to match the enhanced signal from embed
93  eval_pi2->set_UseTowerInfo(1); // to use towerinfo objects rather than old RawTower
94  se->registerSubsystem(eval_pi2);
95  cout << "successful registration of pi0 " << endl;
96 
97 
98 
99  /*
100  LiteCaloEval *eval7e = new LiteCaloEval("CEMCEVALUATOR2", "CEMC",outfile);
101  // LiteCaloEval *eval = new LiteCaloEval("HOCEMCEVALUATOR2", "HCALOUT", outputfile.c_str());
102  // eval->Verbosity(verbosity);
103  eval7e->CaloType(LiteCaloEval::CEMC);
104  //eval->CaloType(LiteCaloEval::HCALOUT);
105  se->registerSubsystem(eval7e);
106 
107  */
108 
109 
110  // in->AddListFile("g4hits.list");
111 
112 // Fun4All
113 // se->registerInputManager(in);
114 
115  //Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", "testoutput_400.root");
116 
117  //out->StripNode("WAVEFORMS_CEMC");
118  //se->registerOutputManager(out);
119 
120  se->run(nevents);
121 
122  se->End();
123  se->PrintTimer();
124  gSystem->Exit(0);
125 }