Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_EMCalBadTowerID.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_EMCalBadTowerID.C
1 #pragma once
2 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
3 #include <fun4all/SubsysReco.h>
7 
10 #include <fun4all/Fun4AllServer.h>
11 #include <fun4all/Fun4AllUtils.h>
12 
13 #include <phool/PHRandomSeed.h>
14 #include <phool/recoConsts.h>
15 #include <cdbobjects/CDBTTree.h>
16 
17 
18 #include <towerid/towerid.h>
19 
20 R__LOAD_LIBRARY(libcdbobjects.so)
21 R__LOAD_LIBRARY(libfun4all.so)
22 R__LOAD_LIBRARY(libtowerid.so)
23 R__LOAD_LIBRARY(libmbd_io.so)
24 #endif
25 
26 void Fun4All_EMCalBadTowerID(const int nEvents = 5000, const char *inFile = "DST_CALO_run1auau_ana391_2023p006-00021813-1388.root", const char *inName = "commissioning3.root", const std::string cdbname = "test.root", float adccut_sg = 150, float adccut_k = 150,float sigmas_lo = 4, float sigmas_hi = 4, float SG_f = 0.05, float Kur_f = 0.05, float region_f = 1.0, int pass = 0)
27 {
28 
29 
30  pair<int, int> runseg = Fun4AllUtils::GetRunSegment(inFile);
31  int runnumber = runseg.first;
32  int segment = runseg.second;
33 
34  towerid *calo = new towerid(inName,cdbname,adccut_sg,adccut_k,sigmas_lo,sigmas_hi,SG_f,Kur_f,region_f);
37 
38 
39  if(pass == 0)
40  {
41  se->registerSubsystem(calo);
43  in->AddFile(inFile);
44  se->registerInputManager(in);
45  se->run(nEvents);
46  calo -> FillHistograms(runnumber,segment);
47  se->End();
48  se->PrintTimer();
49  }
50  else if(pass == 1)
51  {
52  calo -> Init(NULL);
53  calo -> CalculateCutOffs(runnumber);
54  calo -> WriteCDBTree(runnumber);
55  }
56 
57 
58 
59  std::cout << "All done!" << std::endl;
60  gSystem->Exit(0);
61 }
62