Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_pythiaEMCalAna.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_pythiaEMCalAna.C
1 #pragma once
2 
6 
7 #include <GlobalVariables.C>
8 #include <G4_Global.C>
9 #include <G4_Mbd.C>
10 
11 #include <pythiaemcalana/pythiaEMCalAna.h>
12 
13 R__LOAD_LIBRARY(libfun4all.so)
14 R__LOAD_LIBRARY(libpythiaEMCalAna.so)
15 
17  int nEvents = 1,
18  const char *filelist1 = "dst_calo_cluster.list",
19  const char *filelist2 = "dst_truth.list",
20  const string outname = "pythiaEMCalTrees.root",
21  bool isMC = true,
22  bool hasPythia = true)
23 {
24  // this convenience library knows all our i/o objects so you don't
25  // have to figure out what is in each dst type
26  gSystem->Load("libg4dst.so");
27 
29  se->Verbosity(0); // set it to 1 if you want event printouts
30 
31  Fun4AllInputManager *inCluster = new Fun4AllDstInputManager("DSTCaloCluster");
32  std::cout << "Adding file list " << filelist1 << std::endl;
33  inCluster->AddListFile(filelist1,1);
34  se->registerInputManager(inCluster);
35 
36  Fun4AllInputManager *inTruth = new Fun4AllDstInputManager("DSTTruth");
37  if (isMC) {
38  std::cout << "Adding file list " << filelist2 << std::endl;
39  inTruth -> AddListFile(filelist2,1);
40  se -> registerInputManager(inTruth);
41  }
42 
43  pythiaEMCalAna *eval = new pythiaEMCalAna("pythiaEMCalAna", outname.c_str(), isMC, hasPythia);
44  eval -> setGenEvent(1);
45  se -> registerSubsystem(eval);
46 
47  se->run(nEvents);
48  se->End();
49 
50  delete se;
51  cout << "Analysis Completed" << endl;
52 
53  gSystem->Exit(0);
54 }
55 
56 /*{ */
57 
58 
59 /* std::cout << "Starting...\n"; */
60 
61 /* Fun4AllServer *se = Fun4AllServer::instance(); */
62 /* int verbosity = 0; */
63 
64 /* se->Verbosity(verbosity); */
65 /* recoConsts *rc = recoConsts::instance(); */
66 /* //rc->set_IntFlag("RUNNUMBER",62); */
67 
68 
69 /* RetowerCEMC *rcemc = new RetowerCEMC(); */
70 /* //rcemc->SetEnergyDistribution(1); */
71 /* se->registerSubsystem(rcemc); */
72 
73 /* std::cout << "jet stuff...\n"; */
74 /* //seeds */
75 /* JetReco *towerjetreco = new JetReco(); */
76 /* towerjetreco->add_input(new TowerJetInput(Jet::CEMC_TOWER_RETOWER)); */
77 /* towerjetreco->add_input(new TowerJetInput(Jet::HCALIN_TOWER)); */
78 /* towerjetreco->add_input(new TowerJetInput(Jet::HCALOUT_TOWER)); */
79 /* towerjetreco->add_algo(new FastJetAlgo(Jet::ANTIKT, 0.2), "AntiKt_Tower_HIRecoSeedsRaw_r02"); */
80 /* towerjetreco->set_algo_node("ANTIKT"); */
81 /* towerjetreco->set_input_node("TOWER"); */
82 
83 /* se->registerSubsystem(towerjetreco); */
84 
85 
86 
87 /* std::cout << "UE subtraction stuff...\n"; */
88 /* //first UE subtraction pass */
89 /* DetermineTowerBackground *dtb = new DetermineTowerBackground(); */
90 /* dtb->SetBackgroundOutputName("TowerBackground_Sub1"); */
91 /* dtb->SetFlow(G4HIJETS::do_flow); */
92 /* dtb->SetSeedType(0); */
93 /* dtb->SetSeedJetD(3); */
94 
95 /* se->registerSubsystem(dtb); */
96 
97 /* CopyAndSubtractJets *casj = new CopyAndSubtractJets(); */
98 /* casj->SetFlowModulation(G4HIJETS::do_flow); */
99 /* casj->Verbosity(verbosity); */
100 /* se->registerSubsystem(casj); */
101 
102 
103 
104 /* DetermineTowerBackground *dtb2 = new DetermineTowerBackground(); */
105 /* dtb2->SetBackgroundOutputName("TowerBackground_Sub2"); */
106 /* dtb2->SetFlow(G4HIJETS::do_flow); */
107 /* dtb2->SetSeedType(1); */
108 /* dtb2->SetSeedJetPt(7); */
109 /* dtb2->Verbosity(verbosity); */
110 /* se->registerSubsystem(dtb2); */
111 
112 /* //subtract UE from towers */
113 /* SubtractTowers *st = new SubtractTowers(); */
114 /* st->SetFlowModulation(G4HIJETS::do_flow); */
115 /* st->Verbosity(verbosity); */
116 /* se->registerSubsystem(st); */
117 
118 /* std::cout << "ClusterIso stuff...\n"; */
119 /* //I think this goes here? */
120 /* ClusterIso *makeClusterEt = new ClusterIso("pythiaEMCalAna",0,3,1,0); */
121 /* /1* makeClusterEt -> Verbosity(0); *1/ */
122 /* /1* se->registerSubsystem(makeClusterEt); *1/ */
123 /* ///??? */
124 /* //substract UE from jets */
125 /* /1*CopyAndSubtractJets *casj = new CopyAndSubtractJets(); */
126 /* casj->SetFlowModulation(G4HIJETS::do_flow); */
127 
128 /* se->registerSubsystem(casj); */
129 
130 /* //second pass of UE subtraction */
131 /* DetermineTowerBackground *dtb2 = new DetermineTowerBackground(); */
132 /* dtb2->SetBackgroundOutputName("TowerBackground_Sub2"); */
133 /* dtb2->SetFlow(G4HIJETS::do_flow); */
134 /* dtb2->SetSeedType(1); */
135 /* dtb2->SetSeedJetPt(7); */
136 
137 /* se->registerSubsystem(dtb2); */
138 
139 /* //now we build our regular jets. Not used for eT analysis right now */
140 /* //but could add in function easily. */
141 /* /1*towerjetreco = new JetReco(); */
142 /* towerjetreco->add_input(new TowerJetInput(Jet::CEMC_TOWER_SUB1)); */
143 /* towerjetreco->add_input(new TowerJetInput(Jet::HCALIN_TOWER_SUB1)); */
144 /* towerjetreco->add_input(new TowerJetInput(Jet::HCALOUT_TOWER_SUB1)); */
145 /* towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.2, 1), "AntiKt_Tower_r02_Sub1"); */
146 /* towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.3, 1), "AntiKt_Tower_r03_Sub1"); */
147 /* towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.4, 1), "AntiKt_Tower_r04_Sub1"); */
148 /* towerjetreco->add_algo(new FastJetAlgoSub(Jet::ANTIKT, 0.5, 1), "AntiKt_Tower_r05_Sub1"); */
149 /* towerjetreco->set_algo_node("ANTIKT"); */
150 /* towerjetreco->set_input_node("TOWER"); */
151 /* towerjetreco->Verbosity(verbosity); */
152 /* se->registerSubsystem(towerjetreco); */
153 
154 
155 /* std::cout << "more stuff...\n"; */
156 
157 /* Fun4AllInputManager *in = new Fun4AllDstInputManager("DSTcalo"); */
158 /* in->AddListFile(filelist1,1); */
159 /* se->registerInputManager(in); */
160 
161 /* Fun4AllInputManager *in2 = new Fun4AllDstInputManager("DSTTruth"); */
162 /* in2 -> AddListFile(filelist2,1); */
163 /* se -> registerInputManager(in2); */
164 
165 /* std::cout << "pythiaEMCalAna stuff...\n"; */
166 
167 /* pythiaEMCalAna *eval = new pythiaEMCalAna(outname.c_str()); */
168 /* eval -> setGenEvent(1); */
169 /* se -> registerSubsystem(eval); */
170 
171 /* std::cout << "running events...\n"; */
172 
173 /* se -> run(nEvents); */
174 /* std::cout << "ending...\n"; */
175 /* se -> End(); */
176 
177 /* std::cout << "finished!\n"; */
178 
179 /*} */