Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_IsolatedTrackAnalysis.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_IsolatedTrackAnalysis.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_FUN4ALLISOLATEDTRACKS_C
4 #define MACRO_FUN4ALLISOLATEDTRACKS_C
5 
6 #include <G4Setup_sPHENIX.C>
7 
8 #include <G4_Tracking.C>
9 
12 
15 #include <fun4all/Fun4AllServer.h>
16 
17 #include <isolatedtrackanalysis/IsolatedTrackAnalysis.h>
18 
19 R__LOAD_LIBRARY(libfun4all.so)
20 R__LOAD_LIBRARY(libIsolatedTrackAnalysis.so)
21 
23  const int nEvents = 10,
24  const string &g4HitsFile = "g4hits.list",
25  const string &trkrClusterFile = "dst_trkr_cluster.list",
26  const string &trackFile = "dst_tracks.list",
27  const string &clusterFile = "dst_calo_cluster.list",
28  const string &truthFile = "dst_truth.list",
29  const string &outputFile = "isotrack_output.root"
30  )
31 {
32  // this convenience library knows all our i/o objects so you don't
33  // have to figure out what is in each dst type
34  gSystem->Load("libg4dst.so");
35 
37  se->Verbosity(0); // set it to 1 if you want event printouts
38 
39  //Fun4AllInputManager *inTrack = new Fun4AllDstInputManager("DSTTracks");
40  //std::cout << "Adding file list " << trackFile << std::endl;
41  //inTrack->AddListFile(trackFile,1);
42  //se->registerInputManager(inTrack);
43 
44  Fun4AllInputManager *inCluster = new Fun4AllDstInputManager("DSTClusters");
45  std::cout << "Adding file list " << clusterFile << std::endl;
46  inCluster->AddListFile(clusterFile,1);
47  se->registerInputManager(inCluster);
48 
49  Fun4AllInputManager *truthTracks = new Fun4AllDstInputManager("DSTTruth");
50  std::cout << "Adding file list " << truthFile << std::endl;
51  truthTracks->AddListFile(truthFile,1);
52  se->registerInputManager(truthTracks);
53 
54  IsolatedTrackAnalysis *analysisModule = new IsolatedTrackAnalysis("IsolatedTrackAnalysis", outputFile);
55  analysisModule->analyzeTracks(false);
56  analysisModule->analyzeClusters(true);
57  analysisModule->analyzeTowers(false);
58  analysisModule->analyzeSimTowers(false);
59  analysisModule->analyzeHepMCTruth(false);
60  analysisModule->analyzeG4Truth(false);
61  analysisModule->setMinClusterEnergy(0.1);
62  analysisModule->setMinTowerEnergy(0.04);
63  analysisModule->setMinSimTowerEnergy(0.04);
64 
65  se->registerSubsystem(analysisModule);
66 
67  se->run(nEvents);
68  se->End();
69 
70  delete se;
71  cout << "Analysis Completed" << endl;
72 
73  gSystem->Exit(0);
74 }
75 
76 #endif //MACRO_FUN4ALLG4SLOPECAL_C