Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #pragma once
0002 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
0003 #include <fun4all/SubsysReco.h>
0004 #include <fun4all/Fun4AllServer.h>
0005 #include <fun4all/Fun4AllInputManager.h>
0006 #include <fun4all/Fun4AllDstInputManager.h>
0007 
0008 #include <fun4all/Fun4AllDstOutputManager.h>
0009 #include <fun4all/Fun4AllOutputManager.h>
0010 #include <fun4all/Fun4AllServer.h>
0011 
0012 #include <phool/PHRandomSeed.h>
0013 #include <phool/recoConsts.h>
0014 
0015 #include <g4jets/FastJetAlgo.h>
0016 #include <g4jets/JetReco.h>
0017 #include <g4jets/TowerJetInput.h>
0018 #include <g4jets/TruthJetInput.h>
0019 
0020 #include <jetbackground/CopyAndSubtractJets.h>
0021 #include <jetbackground/DetermineTowerBackground.h>
0022 #include <jetbackground/FastJetAlgoSub.h>
0023 #include <jetbackground/RetowerCEMC.h>
0024 #include <jetbackground/SubtractTowers.h>
0025 #include <jetbackground/SubtractTowersCS.h>
0026 
0027 #include <ClusterIso.h>
0028 
0029 #include <isocluster/isoCluster.h>
0030 
0031 R__LOAD_LIBRARY(libfun4all.so)
0032 R__LOAD_LIBRARY(libisoCluster.so)
0033 R__LOAD_LIBRARY(libg4jets.so)
0034 R__LOAD_LIBRARY(libjetbackground.so)
0035 R__LOAD_LIBRARY(libclusteriso.so)
0036 
0037 namespace Enable
0038 {
0039   bool HIJETS = false;
0040   int HIJETS_VERBOSITY = 1;
0041 }  // namespace Enable
0042 
0043 namespace G4HIJETS
0044 {
0045   bool do_flow = true;
0046   bool do_CS = false;
0047 }  // namespace G4HIJETS
0048 #endif
0049 
0050 
0051 void Fun4All_testEtIso_Hijing(
0052                      int nEvents = 1,
0053                      const char *filelist1 = "dst_calo_cluster_run62_10GeVpythia.list",
0054                      const char *filelist2 = "dst_truth_run62_10GeVpythia.list",
0055              const string outname = "test.root")
0056 {
0057 
0058   
0059   
0060   Fun4AllServer *se = Fun4AllServer::instance();
0061   int verbosity = 0;
0062 
0063   se->Verbosity(verbosity);
0064   recoConsts *rc = recoConsts::instance();
0065   //rc->set_IntFlag("RUNNUMBER",62);
0066 
0067 
0068   RetowerCEMC *rcemc = new RetowerCEMC();  
0069   //rcemc->SetEnergyDistribution(1);
0070   se->registerSubsystem(rcemc);
0071 
0072   //seeds
0073   JetReco *towerjetreco = new JetReco();
0074   towerjetreco->add_input(new TowerJetInput(Jet::CEMC_TOWER_RETOWER));
0075   towerjetreco->add_input(new TowerJetInput(Jet::HCALIN_TOWER));
0076   towerjetreco->add_input(new TowerJetInput(Jet::HCALOUT_TOWER));
0077   towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.2), "AntiKt_Tower_HIRecoSeedsRaw_r02");
0078   towerjetreco->set_algo_node("ANTIKT");
0079   towerjetreco->set_input_node("TOWER");
0080   
0081   se->registerSubsystem(towerjetreco);
0082   
0083   //first UE subtraction pass
0084   DetermineTowerBackground *dtb = new DetermineTowerBackground();
0085   dtb->SetBackgroundOutputName("TowerBackground_Sub1");
0086   dtb->SetFlow(G4HIJETS::do_flow);
0087   dtb->SetSeedType(0);
0088   dtb->SetSeedJetD(3);
0089   
0090   se->registerSubsystem(dtb);
0091 
0092   CopyAndSubtractJets *casj = new CopyAndSubtractJets();
0093   casj->SetFlowModulation(G4HIJETS::do_flow);
0094   casj->Verbosity(verbosity); 
0095   se->registerSubsystem(casj);
0096   
0097   DetermineTowerBackground *dtb2 = new DetermineTowerBackground();
0098   dtb2->SetBackgroundOutputName("TowerBackground_Sub2");
0099   dtb2->SetFlow(G4HIJETS::do_flow);
0100   dtb2->SetSeedType(1);
0101   dtb2->SetSeedJetPt(7);
0102   dtb2->Verbosity(verbosity); 
0103   se->registerSubsystem(dtb2);
0104 
0105   //subtract UE from towers
0106   SubtractTowers *st = new SubtractTowers();
0107   st->SetFlowModulation(G4HIJETS::do_flow);
0108   st->Verbosity(verbosity);
0109   se->registerSubsystem(st);
0110 
0111   //I think this goes here?
0112   ClusterIso *makeClusterEt = new ClusterIso("isoCluster",0,3,1,1);
0113   ///???
0114 
0115   //substract UE from jets
0116   /*CopyAndSubtractJets *casj = new CopyAndSubtractJets();
0117   casj->SetFlowModulation(G4HIJETS::do_flow);
0118   
0119   se->registerSubsystem(casj);
0120 
0121   //second pass of UE subtraction
0122   DetermineTowerBackground *dtb2 = new DetermineTowerBackground();
0123   dtb2->SetBackgroundOutputName("TowerBackground_Sub2");
0124   dtb2->SetFlow(G4HIJETS::do_flow);
0125   dtb2->SetSeedType(1);
0126   dtb2->SetSeedJetPt(7);
0127   
0128   se->registerSubsystem(dtb2);*/
0129   
0130   //now we build our regular jets. Not used for eT analysis right now
0131   //but could add in function easily. 
0132   /*towerjetreco = new JetReco();
0133   towerjetreco->add_input(new TowerJetInput(Jet::CEMC_TOWER_SUB1));
0134   towerjetreco->add_input(new TowerJetInput(Jet::HCALIN_TOWER_SUB1));
0135   towerjetreco->add_input(new TowerJetInput(Jet::HCALOUT_TOWER_SUB1));
0136   towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.2, 1), "AntiKt_Tower_r02_Sub1");
0137   towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.3, 1), "AntiKt_Tower_r03_Sub1");
0138   towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.4, 1), "AntiKt_Tower_r04_Sub1");
0139   towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.5, 1), "AntiKt_Tower_r05_Sub1");
0140   towerjetreco->set_algo_node("ANTIKT");
0141   towerjetreco->set_input_node("TOWER");
0142   towerjetreco->Verbosity(verbosity);
0143   se->registerSubsystem(towerjetreco);*/
0144   
0145  
0146   
0147   Fun4AllInputManager *in = new Fun4AllDstInputManager("DSTcalo");
0148   in->AddListFile(filelist1,1);
0149   se->registerInputManager(in);
0150 
0151   Fun4AllInputManager *in2 = new Fun4AllDstInputManager("DSTTruth");
0152   in2 -> AddListFile(filelist2,1);
0153   se -> registerInputManager(in2);
0154   
0155   isoCluster *eval = new isoCluster(outname.c_str());
0156   eval -> setGenEvent(0);
0157   se -> registerSubsystem(eval);
0158 
0159   se -> run(nEvents);
0160   se -> End();
0161     
0162     
0163   
0164   
0165 
0166  
0167 }