Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_TrkrHitSet_Unpacker.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_TrkrHitSet_Unpacker.C
1 /*
2  * This macro is run in our daily CI and is intended as a minimum working
3  * example showing how to unpack the raw hits into the offline tracker hit
4  * format. No other reconstruction or analysis is performed
5  */
6 #include <GlobalVariables.C>
7 
13 #include <fun4all/Fun4AllServer.h>
14 
16 
17 #include <phool/recoConsts.h>
18 
23 
24 #include <stdio.h>
25 
26 R__LOAD_LIBRARY(libfun4all.so)
27 R__LOAD_LIBRARY(libffamodules.so)
28 R__LOAD_LIBRARY(libmvtx.so)
29 R__LOAD_LIBRARY(libintt.so)
30 R__LOAD_LIBRARY(libtpc.so)
31 R__LOAD_LIBRARY(libmicromegas.so)
33  const int nEvents = 2,
34  const int runnumber = 26048,
35  const std::string outfilename = "cosmics",
36  const std::string dir = "/sphenix/lustre01/sphnxpro/commissioning/aligned_streaming_all_3/",
37  const std::string file = "cosmics-")
38 {
39  gSystem->Load("libg4dst.so");
40  std::string inputRawHitFile = dir + file;
41  char filename[500];
42  sprintf(filename, "%s%08d-0000.root", inputRawHitFile.c_str(), runnumber);
43 
44  auto se = Fun4AllServer::instance();
45  se->Verbosity(1);
46  auto rc = recoConsts::instance();
47  rc->set_IntFlag("RUNNUMBER", runnumber);
48 
49  Enable::CDB = true;
50  rc->set_StringFlag("CDB_GLOBALTAG", "ProdA_2023");
51  rc->set_uint64Flag("TIMESTAMP", 6);
52 
53  std::string geofile = CDBInterface::instance()->getUrl("Tracking_Geometry");
55  ingeo->AddFile(geofile);
56  se->registerInputManager(ingeo);
57 
58  auto hitsin = new Fun4AllDstInputManager("InputManager");
59  hitsin->fileopen(filename);
60  se->registerInputManager(hitsin);
61 
62  auto mvtxunpacker = new MvtxCombinedRawDataDecoder;
63  mvtxunpacker->Verbosity(1);
64  se->registerSubsystem(mvtxunpacker);
65 
66  auto inttunpacker = new InttCombinedRawDataDecoder;
67  inttunpacker->LoadHotChannelMapRemote("INTT_HotMap");
68  se->registerSubsystem(inttunpacker);
69 
70  auto tpcunpacker = new TpcCombinedRawDataUnpacker;
71  se->registerSubsystem(tpcunpacker);
72 
73  auto tpotunpacker = new MicromegasCombinedDataDecoder;
74 
75  std::string calibrationFile = CDBInterface::instance()->getUrl("TPOT_Pedestal");
76  tpotunpacker->set_calibration_file(calibrationFile);
77  se->registerSubsystem(tpotunpacker);
78 
79  Fun4AllOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", outfilename);
80  out->StripNode("MVTXRAWHIT");
81  out->StripNode("INTTRAWHIT");
82  out->StripNode("MICROMEGASRAWHIT");
83  out->StripNode("TPCRAWHIT");
84  out->StripNode("GL1RAWHIT");
85 
86  se->registerOutputManager(out);
87 
88  se->run(nEvents);
89  se->End();
90  se->PrintTimer();
91 
92  delete se;
93  std::cout << "Finished" << std::endl;
94  gSystem->Exit(0);
95 }