Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:14:13

0001 #ifndef MACRO_FUN4ALLJETANA_C
0002 #define MACRO_FUN4ALLJETANA_C
0003 
0004 #include <fun4all/Fun4AllDstInputManager.h>
0005 #include <fun4all/Fun4AllInputManager.h>
0006 #include <fun4all/Fun4AllServer.h>
0007 #include <fun4all/SubsysReco.h>
0008 #include <g4centrality/PHG4CentralityReco.h>
0009 #include <jetbase/FastJetAlgo.h>
0010 #include <jetbase/JetReco.h>
0011 #include <jetbase/TowerJetInput.h>
0012 #include <g4jets/TruthJetInput.h>
0013 /* #include <g4vertex/GlobalVertexReco.h> */
0014 #include <jetbackground/FastJetAlgoSub.h>
0015 #include <fun4all/PHTFileServer.h>
0016 #include <jetbackground/RetowerCEMC.h>
0017 #include <HIJetReco.C>
0018 
0019 // here you need your package name (set in configure.ac)
0020 #include <fastjetmedianbkg/RhoFluct.h>
0021 #include <fastjetmedianbkg/PrintTowers.h>
0022 R__LOAD_LIBRARY(libfun4all.so)
0023 R__LOAD_LIBRARY(libg4centrality.so)
0024 R__LOAD_LIBRARY(libg4jets.so)
0025 R__LOAD_LIBRARY(libjetbase.so)
0026 R__LOAD_LIBRARY(libjetbackground.so)
0027 R__LOAD_LIBRARY(libjetrhomedian.so)
0028 R__LOAD_LIBRARY(libjetbackground.so)
0029 /* R__LOAD_LIBRARY(libg4vertex.so) */
0030 
0031 void Fun4All_RhoFluct(
0032     const int     nevnt = 10
0033   , const float   jet_R = 0.4
0034   , const string& out_name = "test.root"
0035   /* , const float   min_lead_truth_pt = 30 */
0036   , const string& list_calo_cluster=""
0037   /* , const string& list_truth_jet="" */
0038   , const string& list_bbc=""
0039   , const string& list_global=""
0040   /* , const string& list_truth_g4hit="" */
0041   , const int     verbosity=0
0042   )
0043 {
0044   gSystem->Load("libjetrhomedian");
0045   gSystem->Load("libg4dst");
0046 
0047   /* Enable::BBC = true; */
0048 
0049   Fun4AllServer *se = Fun4AllServer::instance();
0050 
0051   if (list_bbc!="") {
0052     PHG4CentralityReco *cent = new PHG4CentralityReco();
0053     cent->Verbosity(0);
0054     cent->GetCalibrationParameters().ReadFromFile("centrality", "xml", 0, 0, string(getenv("CALIBRATIONROOT")) + string("/Centrality/"));
0055     se->registerSubsystem( cent );
0056 
0057     Fun4AllInputManager *inp_bbc = new Fun4AllDstInputManager("BBC_info");
0058     inp_bbc->AddListFile(list_bbc);
0059     se->registerInputManager(inp_bbc);
0060   } else {
0061     cout << " Fatal: missing bbc input file. Exiting." << endl;
0062     gSystem->Exit(0);
0063   }
0064 
0065   if (list_global!="") {
0066     Fun4AllInputManager *inp_global = new Fun4AllDstInputManager("DSTglobal");
0067     inp_global->AddListFile(list_global,1); // adding the option "1" confirms to use, even if file is large
0068     se->registerInputManager(inp_global);
0069   } else {
0070     cout << " Fatal: missing global dst list file. Exiting." << endl;
0071     gSystem->Exit(0);
0072   }
0073 
0074   // add the CEMC retowering
0075   RetowerCEMC *rcemc = new RetowerCEMC(); 
0076   /* rcemc->Verbosity(verbosity); */ 
0077   /* rcemc->set_towerinfo(true); */
0078   se->registerSubsystem(rcemc);
0079   //
0080   // do the background subtraction
0081   Enable::HIJETS_TRUTH=false;
0082   HIJetReco();
0083 
0084   RhoFluct *rhofluct = new RhoFluct(out_name, jet_R);
0085   rhofluct->add_input_rhoA(new TowerJetInput(Jet::CEMC_TOWER_RETOWER));
0086   rhofluct->add_input_rhoA(new TowerJetInput(Jet::HCALIN_TOWER));
0087   rhofluct->add_input_rhoA(new TowerJetInput(Jet::HCALOUT_TOWER));
0088   rhofluct->add_input_Sub1(new TowerJetInput(Jet::CEMC_TOWERINFO_SUB1));
0089   rhofluct->add_input_Sub1(new TowerJetInput(Jet::HCALIN_TOWERINFO_SUB1));
0090   rhofluct->add_input_Sub1(new TowerJetInput(Jet::HCALOUT_TOWERINFO_SUB1));
0091   rhofluct->Verbosity(0);
0092   se->registerSubsystem(rhofluct);
0093 
0094 
0095   if (list_calo_cluster!="") {
0096     Fun4AllInputManager *inp_calo_cluster = new Fun4AllDstInputManager("DSTcalocluster");
0097     inp_calo_cluster->AddListFile(list_calo_cluster,1);
0098     se->registerInputManager(inp_calo_cluster);
0099   } else {
0100     cout << " Fatal: missing calo cluster list file. Exiting." << endl;
0101     gSystem->Exit(0);
0102   }
0103 
0104   se->run(nevnt);
0105   se->End();
0106   delete se;
0107   cout << " Done in Fun4All_RhoFluct.C " << endl;
0108   gSystem->Exit(0);
0109 
0110 }
0111 
0112 #endif