Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_RunEMCReco.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_RunEMCReco.C
1 // these include guards are not really needed, but if we ever include this
2 // file somewhere they would be missed and we will have to refurbish all macros
3 #ifndef MACRO_FUN4ALLRUNEMCRECO_C
4 #define MACRO_FUN4ALLRUNEMCRECO_C
5 
9 
10 #include <../src/cemcReco.h>
11 
12 R__LOAD_LIBRARY(libfun4all.so)
13 R__LOAD_LIBRARY(libcemcReco.so)
14 
16  const int nEvents = 1,
17  const string caloRecoIn = "dst_calo_cluster_run40_JS30GeV_noPileup.list",
18  const string caloTruthIn = "dst_truth_run40_JS30GeV_noPileup.list",
19  const string tracksIn = "",
20  const string &outputFile = "cemcReco_Out.root"
21  )
22 {
23  // this convenience library knows all our i/o objects so you don't
24  // have to figure out what is in each dst type
25  gSystem->Load("libg4dst.so");
26 
28  se->Verbosity(0); // set it to 1 if you want event printouts
29 
30  Fun4AllInputManager *inCluster = new Fun4AllDstInputManager("DSTClusters");
31  std::cout << "Adding file list " << caloRecoIn << std::endl;
32  inCluster -> AddListFile(caloRecoIn,1);
33  se->registerInputManager(inCluster);
34 
35  if(strcmp(tracksIn.c_str(),""))
36  {
37  Fun4AllInputManager *inTracks = new Fun4AllDstInputManager("DSTTracks");
38  std::cout << "Adding file list " << tracksIn << std::endl;
39  inTracks -> AddListFile(tracksIn,1);
40  se->registerInputManager(inTracks);
41  }
42 
43  Fun4AllInputManager *truthCalo = new Fun4AllDstInputManager("DSTCaloTruth");
44  std::cout << "Adding file list " << caloTruthIn << std::endl;
45  truthCalo -> AddListFile(caloTruthIn,1);
46  se -> registerInputManager(truthCalo);
47 
48  cemcReco *eval = new cemcReco("cemcRecoAna", outputFile);
49  se->registerSubsystem(eval);
50 
51  se->run(nEvents);
52  se->End();
53 
54  delete se;
55  cout << "Analysis Completed" << endl;
56 
57  gSystem->Exit(0);
58 }
59 
60 #endif //MACRO_FUN4ALLRUNEMCRECO_C