Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_LEDTowerBuilder.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_LEDTowerBuilder.C
1 // c++ includes --
2 #include <string>
3 #include <iostream>
4 
5 // Fun4All includes --
6 #include <fun4all/SubsysReco.h>
12 
13 // my includes --
14 #include "ledtowerbuilder/LEDTowerBuilder.h"
15 
16 R__LOAD_LIBRARY(libfun4all.so)
17 R__LOAD_LIBRARY(libfun4allraw.so)
18 R__LOAD_LIBRARY(libcalo_reco.so)
19 R__LOAD_LIBRARY(libg4dst.so)
20 R__LOAD_LIBRARY(libledtowerbuilder.so)
21 
22 using std::cout;
23 using std::endl;
24 using std::string;
25 
26 void Fun4All_LEDTowerBuilder(const int events, const string &input, const string &outDir, const string &outName) {
27  // gSystem->Load("libg4dst");
29  se->Verbosity(0);
30 
31  LEDTowerBuilder *ca = new LEDTowerBuilder((outDir + "/" + outName + "-CEMC.root").c_str());
33  se->registerSubsystem(ca);
34 
35  LEDTowerBuilder *ca_hcal_in = new LEDTowerBuilder((outDir + "/" + outName + "-HCALIN.root").c_str());
37  se->registerSubsystem(ca_hcal_in);
38 
39  LEDTowerBuilder *ca_hcal_out = new LEDTowerBuilder((outDir + "/" + outName + "-HCALOUT.root").c_str());
41  se->registerSubsystem(ca_hcal_out);
42 
43  //CaloAna *caloana = new CaloAna("CALOANA",outfile);
44  //caloana->Detector("HCALOUT");
45  //se->registerSubsystem(caloana);
46 
48  in->AddListFile(input.c_str());
49  se->registerInputManager(in);
50 
51  se->run(events);
52  se->End();
53  se->PrintTimer();
54  std::cout << "All done!" << std::endl;
55 }
56 
57 # ifndef __CINT__
58 int main(int argc, char* argv[]) {
59  if(argc < 1 || argc > 5){
60  cout << "usage: ./bin/Fun4All_LEDTowerBuilder events input outDir outName" << endl;
61  cout << "events: Number of events to analyze." << endl;
62  cout << "inputFile: Location of fileList containing prdfs." << endl;
63  cout << "outputFile: output root file." << endl;
64  return 1;
65  }
66 
67  UInt_t events;
68  string input;
69  string outDir;
70  string outName;
71 
72  if(argc >= 2) {
73  events = atoi(argv[1]);
74  }
75  if(argc >= 3) {
76  input = argv[2];
77  }
78  if(argc >= 4) {
79  outDir = argv[3];
80  }
81  if(argc >= 5) {
82  outName = argv[4];
83  }
84 
85  Fun4All_LEDTowerBuilder(events, input, outDir, outName);
86 
87  cout << "done" << endl;
88  return 0;
89 }
90 # endif