Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_EMCalLikelihood.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_EMCalLikelihood.C
1 // $Id: $
2 
11 #include <cassert>
12 
13 void
15 //Fun4All_EMCalLikelihood(const int nEvents = 100000000, // original
16  TString base_dir =
17  "../..//sPHENIX_work/production_analysis_cemc2x2/emcstudies/pidstudies/spacal2d/fieldmap/",
18  TString pid = "e-", TString kine_config = "eta0_8GeV", TString ll_config =
19  "Edep_Distribution_ll_sample")
20 {
21  const TString inputFile = base_dir + "/G4Hits_sPHENIX_" + pid + "_"
22  + kine_config + "-ALL.root_Ana.root.lst";
23  // "/phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_e-_eta0_2GeV-ALL.root_Ana.root.lst")
24 
25  TString s_outputFile = inputFile;
26  s_outputFile += "_EMCalLikelihood.root";
27  const char * outputFile = s_outputFile.Data();
28 
29  gSystem->Load("libfun4all.so");
30  gSystem->Load("libg4vertex.so");
31  gSystem->Load("libemcal_ana.so");
32 
34  se->Verbosity(1);
35 // se->Verbosity(10);
36  // just if we set some flags somewhere in this macro
38  rc->set_IntFlag("",0);
39 
40  double center_cemc_iphi = 1000;
41  double center_cemc_ieta = 1000;
42  double center_hcalin_iphi = 1000;
43  double center_hcalin_ieta = 1000;
44 
45  double width = 0;
46  double width_emcal_eta = 0;
47 
48  int charge = 0;
49 
50  if (pid == "e+" || pid == "pi+" || pid == "kaon+" || pid == "proton")
51  charge = +1;
52  else if (pid == "e-" || pid == "pi-" || pid == "kaon-"
53  || pid == "anti_proton")
54  charge = -1;
55  if (charge == 0)
56  {
57  cout
58  << "Fun4All_EMCalLikelihood - Fatal Error - invalid input particle type: "
59  << pid << endl;
60  assert(charge != 0);
61  }
62 
63  if (base_dir.Contains("spacal") && kine_config.Contains("eta0_"))
64  {
66  // Projection center based on /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_e-_eta0_4GeV-ALL.root_Ana.root
68  center_cemc_iphi = 0.0952638; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_e-_eta0_4GeV-ALL.root_Ana.root
69  center_cemc_ieta = 0.00397331; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_e-_eta0_4GeV-ALL.root_Ana.root
70  center_hcalin_iphi = 0.354109; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_pi-_eta0_4GeV-ALL.root_Ana.root
71  center_hcalin_ieta = -0.000273002; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_pi-_eta0_4GeV-ALL.root_Ana.root
72 
73 // width = 1.4;
74 // width_emcal_eta = 1.4;
75  width = 1.6;
76  width_emcal_eta = 1.6;
77  }
78  else if (base_dir.Contains("spacal2d") && charge <0
79  && kine_config.Contains("eta0.90_2GeV"))
80  {
81 
82  center_cemc_iphi = 0.249273; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal2d/fieldmap/G4Hits_sPHENIX_e-_eta0.90_2GeV-ALL.root_Ana.root
83  center_cemc_ieta = 0.0146006; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal2d/fieldmap/G4Hits_sPHENIX_e-_eta0.90_2GeV-ALL.root_Ana.root
84 
85  center_hcalin_iphi = 0.447927; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal2d/fieldmap/G4Hits_sPHENIX_pi-_eta0.90_2GeV-ALL.root_Ana.root
86  center_hcalin_ieta = -0.101503; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal2d/fieldmap/G4Hits_sPHENIX_pi-_eta0.90_2GeV-ALL.root_Ana.root
87 
88  width = 1.6;
89  width_emcal_eta = 1.6;
90  }
91  else if (base_dir.Contains("spacal2d") && charge <0
92  && kine_config.Contains("eta0.90_4GeV"))
93  {
94  center_cemc_iphi = 0.129035; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal2d/fieldmap/G4Hits_sPHENIX_e-_eta0.90_4GeV-ALL.root_Ana.root
95  center_cemc_ieta = 0.0222246; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal2d/fieldmap/G4Hits_sPHENIX_e-_eta0.90_4GeV-ALL.root_Ana.root
96 
97  center_hcalin_iphi = 0.385379; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal2d/fieldmap/G4Hits_sPHENIX_pi-_eta0.90_4GeV-ALL.root_Ana.root
98  center_hcalin_ieta = -0.0596968; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal2d/fieldmap/G4Hits_sPHENIX_pi-_eta0.90_4GeV-ALL.root_Ana.root
99 
100  width = 1.6;
101  width_emcal_eta = 1.6;
102  }
103  else if (base_dir.Contains("spacal2d") && charge <0
104  && kine_config.Contains("eta0.90_8GeV"))
105  {
106  center_cemc_iphi = 0.0829824; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal2d/fieldmap/G4Hits_sPHENIX_e-_eta0.90_8GeV-ALL.root_Ana.root
107  center_cemc_ieta = 0.0275653; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal2d/fieldmap/G4Hits_sPHENIX_e-_eta0.90_8GeV-ALL.root_Ana.root
108 
109  center_hcalin_iphi = 0.348779; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal2d/fieldmap/G4Hits_sPHENIX_pi-_eta0.90_8GeV-ALL.root_Ana.root
110  center_hcalin_ieta = -0.0348952; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal2d/fieldmap/G4Hits_sPHENIX_pi-_eta0.90_8GeV-ALL.root_Ana.root
111 
112  width = 1.6;
113  width_emcal_eta = 1.6;
114  }
115  else if (base_dir.Contains("spacal1d") && charge <0
116  && kine_config.Contains("eta0.90_2GeV"))
117  {
118  center_cemc_iphi = 0.53236; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal1d/fieldmap/G4Hits_sPHENIX_e-_eta0.90_2GeV-ALL.root_Ana.root
119  center_cemc_ieta = 1.15917; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal1d/fieldmap/G4Hits_sPHENIX_e-_eta0.90_2GeV-ALL.root_Ana.root
120  center_hcalin_iphi = 0.445272; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal1d/fieldmap/G4Hits_sPHENIX_pi-_eta0.90_2GeV-ALL.root_Ana.root
121  center_hcalin_ieta = -0.180098; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal1d/fieldmap/G4Hits_sPHENIX_pi-_eta0.90_2GeV-ALL.root_Ana.root
122 
123  width = 1.8;
124  width_emcal_eta = 2.6;
125  }
126  else if (base_dir.Contains("spacal1d") && charge <0
127  && kine_config.Contains("eta0.90_4GeV"))
128  {
129  center_cemc_iphi = 0.251162; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal1d/fieldmap/G4Hits_sPHENIX_e-_eta0.90_4GeV-ALL.root_Ana.root
130  center_cemc_ieta = 1.35067; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal1d/fieldmap/G4Hits_sPHENIX_e-_eta0.90_4GeV-ALL.root_Ana.root
131  center_hcalin_iphi = 0.393433; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal1d/fieldmap/G4Hits_sPHENIX_pi-_eta0.90_4GeV-ALL.root_Ana.root
132  center_hcalin_ieta = -0.116632; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal1d/fieldmap/G4Hits_sPHENIX_pi-_eta0.90_4GeV-ALL.root_Ana.root
133 
134  width = 1.8;
135  width_emcal_eta = 2.6;
136  }
137  else if (base_dir.Contains("spacal1d") && charge <0
138  && kine_config.Contains("eta0.90_8GeV"))
139  {
140  center_cemc_iphi = 0.122055; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal1d/fieldmap/G4Hits_sPHENIX_e-_eta0.90_8GeV-ALL.root_Ana.root
141  center_cemc_ieta = 1.52588; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal1d/fieldmap/G4Hits_sPHENIX_e-_eta0.90_8GeV-ALL.root_Ana.root
142  center_hcalin_iphi = 0.644177; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal1d/fieldmap/G4Hits_sPHENIX_e-_eta0.90_8GeV-ALL.root_Ana.root
143  center_hcalin_ieta = -0.799621; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/single_particle/spacal1d/fieldmap/G4Hits_sPHENIX_e-_eta0.90_8GeV-ALL.root_Ana.root
144 
145  width = 1.8;
146  width_emcal_eta = 2.6;
147  }
148  else if (base_dir.Contains("spacal2d") && charge >0
149  && kine_config.Contains("eta0.90_2GeV"))
150  {
151  center_cemc_iphi = -0.16237; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_e+_eta0.90_2GeV-ALL.root_Ana.root
152  center_cemc_ieta = 0.00993428; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_e+_eta0.90_2GeV-ALL.root_Ana.root
153  center_hcalin_iphi = 0.338006; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_pi+_eta0.90_2GeV-ALL.root_Ana.root
154  center_hcalin_ieta = -0.0939571; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_pi+_eta0.90_2GeV-ALL.root_Ana.root
155 
156  width = 1.6;
157  width_emcal_eta = 1.6;
158  }
159  else if (base_dir.Contains("spacal2d") && charge >0
160  && kine_config.Contains("eta0.90_4GeV"))
161  {
162  center_cemc_iphi = -0.0455698; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_e+_eta0.90_4GeV-ALL.root_Ana.root
163  center_cemc_ieta = 0.0181539; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_e+_eta0.90_4GeV-ALL.root_Ana.root
164  center_hcalin_iphi = 0.340425; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_pi+_eta0.90_4GeV-ALL.root_Ana.root
165  center_hcalin_ieta = -0.0670486; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_pi+_eta0.90_4GeV-ALL.root_Ana.root
166 
167 
168  width = 1.6;
169  width_emcal_eta = 1.6;
170  }
171  else if (base_dir.Contains("spacal2d") && charge >0
172  && kine_config.Contains("eta0.90_8GeV"))
173  {
174  center_cemc_iphi = 0.00278605; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_e+_eta0.90_8GeV-ALL.root_Ana.root
175  center_cemc_ieta = 0.0237387; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_e+_eta0.90_8GeV-ALL.root_Ana.root
176  center_hcalin_iphi = 0.336144; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_pi+_eta0.90_8GeV-ALL.root_Ana.root
177  center_hcalin_ieta = -0.0484305; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal2d/fieldmap/G4Hits_sPHENIX_pi+_eta0.90_8GeV-ALL.root_Ana.root
178 
179 
180  width = 1.6;
181  width_emcal_eta = 1.6;
182  }
183  else if (base_dir.Contains("spacal1d") && charge >0
184  && kine_config.Contains("eta0.90_2GeV"))
185  {
186  center_cemc_iphi = -0.530751; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal1d/fieldmap/G4Hits_sPHENIX_e+_eta0.90_2GeV-ALL.root_Ana.root
187  center_cemc_ieta = 1.15259; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal1d/fieldmap/G4Hits_sPHENIX_e+_eta0.90_2GeV-ALL.root_Ana.root
188 
189  center_hcalin_iphi = 0.317738; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal1d/fieldmap/G4Hits_sPHENIX_pi+_eta0.90_2GeV-ALL.root_Ana.root
190  center_hcalin_ieta = -0.119789; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal1d/fieldmap/G4Hits_sPHENIX_pi+_eta0.90_2GeV-ALL.root_Ana.root
191 
192  width = 1.8;
193  width_emcal_eta = 2.6;
194  }
195  else if (base_dir.Contains("spacal1d") && charge >0
196  && kine_config.Contains("eta0.90_4GeV"))
197  {
198  center_cemc_iphi = -0.252243; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal1d/fieldmap/G4Hits_sPHENIX_e+_eta0.90_4GeV-ALL.root_Ana.root
199  center_cemc_ieta = 1.34503; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal1d/fieldmap/G4Hits_sPHENIX_e+_eta0.90_4GeV-ALL.root_Ana.root
200 
201  center_hcalin_iphi = 0.334954; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal1d/fieldmap/G4Hits_sPHENIX_pi+_eta0.90_4GeV-ALL.root_Ana.root
202  center_hcalin_ieta = -0.0992204; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal1d/fieldmap/G4Hits_sPHENIX_pi+_eta0.90_4GeV-ALL.root_Ana.root
203 
204  width = 1.8;
205  width_emcal_eta = 2.6;
206  }
207  else if (base_dir.Contains("spacal1d") && charge >0
208  && kine_config.Contains("eta0.90_8GeV"))
209  {
210  center_cemc_iphi = -0.122248; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal1d/fieldmap/G4Hits_sPHENIX_e+_eta0.90_8GeV-ALL.root_Ana.root
211  center_cemc_ieta = 1.52555; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal1d/fieldmap/G4Hits_sPHENIX_e+_eta0.90_8GeV-ALL.root_Ana.root
212 
213  center_hcalin_iphi = 0.33193; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal1d/fieldmap/G4Hits_sPHENIX_pi+_eta0.90_8GeV-ALL.root_Ana.root
214  center_hcalin_ieta = -0.0749197; // /phenix/sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/pidstudies/spacal1d/fieldmap/G4Hits_sPHENIX_pi+_eta0.90_8GeV-ALL.root_Ana.root
215 
216  width = 1.8;
217  width_emcal_eta = 2.6;
218  }
219  else
220  {
221  cout << "Error !!!!!! Unknown configuraiton";
222 
223  return;
224  }
225 
226  TH2F * h2_Edep_Distribution_e = NULL;
227  TH2F * h2_Edep_Distribution_pi = NULL;
228 
229  // load edep ll input distribution
230  if (charge <0)
231  {
232  TFile * f =
233  new TFile(
234  base_dir + "/G4Hits_sPHENIX_e-_" + kine_config
235  + "-ALL.root_Ana.root.lst_EMCalLikelihood.root_DrawEcal_Likelihood_"
236  + ll_config + ".root");
237 
238  if (f->IsOpen())
239  {
240  f->ls();
241  h2_Edep_Distribution_e = (TH2F *) f->GetObjectChecked(
242  "h2_Edep_Distribution", "TH2F");
243  }
244 
245 // TFile * f =
246 // new TFile(
247 // base_dir + "/G4Hits_sPHENIX_pi-_" + kine_config
248 // + "-ALL.root_Ana.root.lst_EMCalLikelihood.root_DrawEcal_Likelihood_"
249 // + ll_config + ".root");
250  TFile * f =
251  new TFile(
252  base_dir + "/G4Hits_sPHENIX_anti_proton_" + kine_config
253  + "-ALL.root_Ana.root.lst_EMCalLikelihood.root_DrawEcal_Likelihood_"
254  + ll_config + ".root");
255 
256  if (f->IsOpen())
257  {
258  f->ls();
259  h2_Edep_Distribution_pi = (TH2F *) f->GetObjectChecked(
260  "h2_Edep_Distribution", "TH2F");
261  }
262 // assert(h2_Edep_Distribution_e);
263 // assert(h2_Edep_Distribution_pi);
264  }
265 
266  else if (charge > 0)
267  {
268  TFile * f =
269  new TFile(
270  base_dir + "/G4Hits_sPHENIX_e+_" + kine_config
271  + "-ALL.root_Ana.root.lst_EMCalLikelihood.root_DrawEcal_Likelihood_"
272  + ll_config + ".root");
273 
274  if (f->IsOpen())
275  {
276  f->ls();
277  h2_Edep_Distribution_e = (TH2F *) f->GetObjectChecked(
278  "h2_Edep_Distribution", "TH2F");
279  }
280 
281 // TFile * f =
282 // new TFile(
283 // base_dir + "/G4Hits_sPHENIX_pi-_" + kine_config
284 // + "-ALL.root_Ana.root.lst_EMCalLikelihood.root_DrawEcal_Likelihood_"
285 // + ll_config + ".root");
286  TFile * f =
287  new TFile(
288  base_dir + "/G4Hits_sPHENIX_pi+_" + kine_config
289  + "-ALL.root_Ana.root.lst_EMCalLikelihood.root_DrawEcal_Likelihood_"
290  + ll_config + ".root");
291 
292  if (f->IsOpen())
293  {
294  f->ls();
295  h2_Edep_Distribution_pi = (TH2F *) f->GetObjectChecked(
296  "h2_Edep_Distribution", "TH2F");
297  }
298 // assert(h2_Edep_Distribution_e);
299 // assert(h2_Edep_Distribution_pi);
300  }
301 
302  EMCalLikelihood * emcal_ana = new EMCalLikelihood(
303  string(inputFile.Data()) + string("_hist.root"));
304  emcal_ana->Verbosity(5);
305 
306  emcal_ana->set_center_cemc_ieta(center_cemc_ieta);
307  emcal_ana->set_center_cemc_iphi(center_cemc_iphi);
308  emcal_ana->set_center_hcalin_ieta(center_hcalin_ieta);
309  emcal_ana->set_center_hcalin_iphi(center_hcalin_iphi);
310 
311  // -------------------------------------------------------------------
312  // No CEMC ganging readout
313  // -------------------------------------------------------------------
314 // emcal_ana->set_width_cemc_ieta(width_emcal_eta);
315 // emcal_ana->set_width_cemc_iphi(width);
316 // emcal_ana->set_width_hcalin_ieta(width);
317 // emcal_ana->set_width_hcalin_iphi(width);
318 
319  // -------------------------------------------------------------------
320  // 2x2 CEMC ganging readout, cluster size x (2x2)
321  // -------------------------------------------------------------------
322 // emcal_ana->do_ganging(2,2);
323 // emcal_ana->set_width_cemc_ieta(width_emcal_eta*2);
324 // emcal_ana->set_width_cemc_iphi(width*2);
325 // emcal_ana->set_width_hcalin_ieta(width*2);
326 // emcal_ana->set_width_hcalin_iphi(width*2);
327 
328  // -------------------------------------------------------------------
329  // 2x2 CEMC ganging readout, cluster size x (1.4x1.4)
330  // -------------------------------------------------------------------
331 // emcal_ana->do_ganging(2,2);
332 // emcal_ana->set_width_cemc_ieta(width_emcal_eta*1.4);
333 // emcal_ana->set_width_cemc_iphi(width*1.4);
334 // emcal_ana->set_width_hcalin_ieta(width*1.4);
335 // emcal_ana->set_width_hcalin_iphi(width*1.4);
336 
337  // -------------------------------------------------------------------
338  // 2x2 CEMC ganging readout, cluster size x (1.2x1.2)
339  // -------------------------------------------------------------------
340  emcal_ana->do_ganging(2,2);
341  emcal_ana->set_width_cemc_ieta(width_emcal_eta*1.2);
342  emcal_ana->set_width_cemc_iphi(width*1.2);
343  emcal_ana->set_width_hcalin_ieta(width);
344  emcal_ana->set_width_hcalin_iphi(width);
345 
346  if (h2_Edep_Distribution_e)
347  emcal_ana->set_h2_Edep_Distribution_e(h2_Edep_Distribution_e);
348  if (h2_Edep_Distribution_pi)
349  emcal_ana->set_h2_Edep_Distribution_pi(h2_Edep_Distribution_pi);
350 
351 
352  se->registerSubsystem(emcal_ana);
353 
354  //--------------
355  // IO management
356  //--------------
357 
358  // Hits file
359  Fun4AllInputManager *hitsin = new Fun4AllDstInputManager("DSTin");
360 // hitsin->fileopen(inputFile);
361  hitsin->AddListFile(inputFile.Data());
362  se->registerInputManager(hitsin);
363 
365  outputFile);
366  out->AddNode("Sync");
367  out->AddNode("UpsilonPair");
368  out->AddNode("EMCalTrk");
369  out->AddNode("GlobalVertexMap");
370  se->registerOutputManager(out);
371 
372  gSystem->ListLibraries();
373 
374 // return;
375 
376  se->run(nEvents);
377 // se->dumpHistos(string(inputFile) + string("_hist.root"), "recreate");
378 
379  //-----
380  // Exit
381  //-----
382  gSystem->Exec("ps -o sid,ppid,pid,user,comm,vsize,rssize,time");
383 
384  se->End();
385 
386  std::cout << "All done" << std::endl;
387  delete se;
388  gSystem->Exit(0);
389 }
390