Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:10:55

0001 void Fun4All_Ana(int nEvents = 1000,
0002     char *input_file = "/gpfs02/phenix/prod/sPHENIX/sunyrefnewinnerhcal/fieldmap/G4Hits_sPHENIX_mu-_eta0.30_40GeV.root",
0003     //char *input_file ="/sphenix/sim/sim01/cd1_review/single_particle/fieldmap/G4Hits_sPHENIX_e-_eta0.30_16GeV-0003.root",
0004         const char *outFile = "outfile.root")
0005 {
0006   gSystem->Load("libfun4all");
0007   gSystem->Load("libphg4hit.so");
0008   gSystem->Load("libg4detectors.so");
0009   gSystem->Load("libg4picoDst.so"); //??
0010   gSystem->Load("libg4decayer.so");
0011   gSystem->Load("libg4eval.so");   
0012   gSystem->Load("libg4hough.so"); 
0013   gSystem->Load("libPHAna.so");//??
0014 
0015   ///////////////////////////////////////////
0016   //
0017   //- recoConsts setup
0018   //
0019   ///////////////////////////////////////////
0020   recoConsts *rc = recoConsts::instance();
0021 
0022   ///////////////////////////////////////////
0023   //
0024   //- Make the Server
0025   //
0026   //////////////////////////////////////////
0027   Fun4AllServer *se = Fun4AllServer::instance();
0028   se->Verbosity(0);
0029   recoConsts *rc = recoConsts::instance();
0030 
0031   PHAna *ana = new PHAna();
0032   //ana->set_flag( PHAna::TRUTH, true);
0033   //ana->set_flag( PHAna::HIST, true);
0034   //ana->set_flag( PHAna::SF, true);
0035   ana->set_flag( PHAna::ALL, true);
0036   ana->set_filename( outFile );
0037   se->registerSubsystem( ana );
0038 
0039   ///////////////////////////////////////////
0040   //
0041   //- Analyze the Data.
0042   //
0043   //////////////////////////////////////////
0044 
0045   Fun4AllInputManager *hcal_dst = new Fun4AllDstInputManager( "HCAL", "DST", "TOP");
0046   se->registerInputManager( hcal_dst );
0047   se->fileopen( hcal_dst->Name(), input_file );
0048   //you can put a list of files as well 
0049   //hcal_dst->AddListFile( input_file );   
0050 
0051   se->run(nEvents);
0052   se->End();
0053   delete se;
0054 }