Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:13:07

0001 // these include guards are not really needed, but if we ever include this
0002 // file somewhere they would be missed and we will have to refurbish all macros
0003 #ifndef MACRO_FUN4ALLISOLATEDTRACKS_C
0004 #define MACRO_FUN4ALLISOLATEDTRACKS_C
0005 
0006 #include <G4Setup_sPHENIX.C>
0007 
0008 #include <G4_Tracking.C>
0009 
0010 #include <trackreco/PHActsTrackProjection.h>
0011 #include <trackreco/PHActsTrackProjection.h>
0012 
0013 #include <fun4all/Fun4AllDstInputManager.h>
0014 #include <fun4all/Fun4AllInputManager.h>
0015 #include <fun4all/Fun4AllServer.h>
0016 
0017 #include <isolatedtrackanalysis/IsolatedTrackAnalysis.h>
0018 
0019 R__LOAD_LIBRARY(libfun4all.so)
0020 R__LOAD_LIBRARY(libIsolatedTrackAnalysis.so)
0021 
0022 void Fun4All_IsolatedTrackAnalysis(
0023       const int nEvents = 10,
0024       const string &g4HitsFile = "g4hits.list",
0025       const string &trkrClusterFile = "dst_trkr_cluster.list",
0026       const string &trackFile = "dst_tracks.list",
0027       const string &clusterFile = "dst_calo_cluster.list",
0028       const string &truthFile = "dst_truth.list",
0029       const string &outputFile = "isotrack_output.root"
0030       )
0031 {
0032   // this convenience library knows all our i/o objects so you don't
0033   // have to figure out what is in each dst type
0034   gSystem->Load("libg4dst.so");
0035 
0036   Fun4AllServer *se = Fun4AllServer::instance();
0037   se->Verbosity(0);  // set it to 1 if you want event printouts
0038 
0039   //Fun4AllInputManager *inTrack = new Fun4AllDstInputManager("DSTTracks");
0040   //std::cout << "Adding file list " << trackFile << std::endl;
0041   //inTrack->AddListFile(trackFile,1);
0042   //se->registerInputManager(inTrack);
0043 
0044   Fun4AllInputManager *inCluster = new Fun4AllDstInputManager("DSTClusters");
0045   std::cout << "Adding file list " << clusterFile << std::endl;
0046   inCluster->AddListFile(clusterFile,1);
0047   se->registerInputManager(inCluster);  
0048 
0049   Fun4AllInputManager *truthTracks = new Fun4AllDstInputManager("DSTTruth");
0050   std::cout << "Adding file list " << truthFile  << std::endl;
0051   truthTracks->AddListFile(truthFile,1);
0052   se->registerInputManager(truthTracks);
0053 
0054   IsolatedTrackAnalysis *analysisModule = new IsolatedTrackAnalysis("IsolatedTrackAnalysis", outputFile);
0055   analysisModule->analyzeTracks(false);
0056   analysisModule->analyzeClusters(true);
0057   analysisModule->analyzeTowers(false);
0058   analysisModule->analyzeSimTowers(false);
0059   analysisModule->analyzeHepMCTruth(false);
0060   analysisModule->analyzeG4Truth(false);
0061   analysisModule->setMinClusterEnergy(0.1);
0062   analysisModule->setMinTowerEnergy(0.04);
0063   analysisModule->setMinSimTowerEnergy(0.04);
0064  
0065   se->registerSubsystem(analysisModule);
0066   
0067   se->run(nEvents);
0068   se->End();
0069   
0070   delete se;
0071   cout << "Analysis Completed" << endl;
0072   
0073   gSystem->Exit(0);
0074 }
0075 
0076 #endif  //MACRO_FUN4ALLG4SLOPECAL_C