11 #include <calobase/RawCluster.h>
12 #include <calobase/RawClusterContainer.h>
13 #include <calobase/RawClusterUtility.h>
14 #include <calobase/RawTower.h>
15 #include <calobase/RawTowerContainer.h>
16 #include <calobase/RawTowerGeom.h>
17 #include <calobase/RawTowerGeomContainer.h>
49 , g4hitntuple(nullptr)
50 , g4b0hitntuple(nullptr)
51 , g4rphitntuple(nullptr)
53 , h2_ZDC_XY_double(nullptr)
67 , _truth_trace_embed_flags()
74 , _do_gpoint_eval(
true)
75 , _do_gshower_eval(
true)
76 , _do_tower_eval(
true)
77 , _do_cluster_eval(
true)
78 , _ntp_gpoint(nullptr)
79 , _ntp_gshower(nullptr)
81 , _tower_debug(nullptr)
82 , _ntp_cluster(nullptr)
87 , h1_E_dep_smeared(nullptr)
89 , h1_B0_E_dep(nullptr)
91 , h1_B0_E_abs(nullptr)
92 , h1_RP_E_dep(nullptr)
93 , h1_RP_E_abs(nullptr)
108 "event:gparticleID:gflavor:gnhits:"
109 "geta:gphi:ge:gpt:gvx:gvy:gvz:gembed:gedep:"
110 "clusterID:ntowers:eta:x:y:z:phi:e:efromtruth");
115 _ntp_tower =
new TNtuple(
"ntp_tower",
"tower => max truth primary",
116 "event:towerID:ieta:iphi:eta:phi:e:x:y:z:"
117 "gparticleID:gflavor:gnhits:"
118 "geta:gphi:ge:gpt:gvx:gvy:gvz:"
123 _tower_debug =
new TTree(
"tower_debug",
"tower => max truth primary");
138 "event:clusterID:ntowers:eta:x:y:z:phi:e:"
139 "gparticleID:gflavor:gnhits:"
140 "geta:gphi:ge:gpt:gvx:gvy:gvz:"
146 g4hitntuple =
new TNtuple(
"hitntup",
"G4Hits",
"x0:y0:z0:x1:y1:z1:edep");
147 g4b0hitntuple =
new TNtuple(
"b0hit",
"B0 Hits",
"layer:type:x0:y0:z0:x1:y1:z1:t0:t1:edep");
148 g4rphitntuple =
new TNtuple(
"rphit",
"RP Hits",
"layer:type:x0:y0:z0:x1:y1:z1:t0:t1:edep");
150 std::cout <<
"diff_tagg_ana::Init(PHCompositeNode *topNode) Initializing" << std::endl;
157 gDirectory->mkdir(
"ZDC");
158 gDirectory->cd(
"ZDC");
160 h2_ZDC_XY =
new TH2F(
"ZDC_XY",
"ZDC XY", 200, -50, 50, 200, -50, 50);
162 h2_ZDC_XY_double =
new TH2F(
"ZDC_XY_double",
"ZDC XY Double gamma", 200, -50, 50, 200, -50, 50);
164 h1_E_dep =
new TH1F(
"E_dep",
"E Dependence", 120, 0.0, 60.0);
166 h1_E_dep_smeared =
new TH1F(
"E_dep_smeared",
"E Dependence Smeared", 120, 0.0, 60.0);
173 gDirectory->mkdir(
"B0");
174 gDirectory->cd(
"B0");
176 h2_B0_XY =
new TH2F(
"B0_XY",
"B0 XY", 400, -200, 200, 200, -50, 50);
178 h1_B0_E_dep =
new TH1F(
"B0_E_dep",
"E Dependence", 120, 0.0, 60.0);
179 h1_B0_E_abs =
new TH1F(
"B0_E_abs",
"E Absorbed", 120, 0.0, 60.0);
180 h1_B0_E =
new TH1F(
"B0_E",
"E layer", 10, 0.0, 10.0);
187 gDirectory->mkdir(
"RP");
188 gDirectory->cd(
"RP");
190 h2_RP_XY =
new TH2F(
"RP_XY",
"RP XY;X (cm);Y (cm)", 400, -200, 200, 200, -50, 50);
191 h1_RP_E_dep =
new TH1F(
"RP_E_dep",
"E Dependence", 120, 0.0, 60.0);
192 h1_RP_E_abs =
new TH1F(
"RP_E_abs",
"E Absorbed", 120, 0.0, 60.0);
194 std::string paramFile = std::string(getenv(
"CALIBRATIONROOT")) +
"/RomanPots/RP_parameters_IP6.dat";
197 paramFile = std::string(getenv(
"CALIBRATIONROOT")) +
"/RomanPots/RP_parameters_IP8.dat";
200 int Nlayers = GetParameterFromFile <int> (paramFile,
"Number_layers");
203 h2_RP_layers_XY.push_back(
new TH2F(Form(
"RP_XY_layer%i",
layer),
"RP XY;X (cm);Y (cm)", 400, -200, 200, 200, -50, 50) );
204 h2_RP_virtlayers_XY.push_back(
new TH2F(Form(
"RP_XY_virtlayer%i",
layer),
"RP XY;X (cm);Y (cm)", 4000, -200, 200, 200, -10, 10) );
219 std::cout <<
"Event Processing Counter: " <<
event_itt << std::endl;
234 std::ostringstream nodename;
254 hit_iter->second->get_y(0),
255 hit_iter->second->get_z(0),
256 hit_iter->second->get_x(1),
257 hit_iter->second->get_y(1),
258 hit_iter->second->get_z(1),
259 hit_iter->second->get_edep());
272 h2_ZDC_XY->Fill(hit_iter->second->get_x(0) + x_offset, hit_iter->second->get_y(0));
276 smeared_E = hit_iter->second->get_edep();
282 h2_ZDC_XY_double->Fill(hit_iter->second->get_x(0) + x_offset, hit_iter->second->get_y(0));
285 h1_E_dep->Fill(hit_iter->second->get_edep());
300 std::string nodename =
"G4HIT_rpTruth";
303 std::string nodenameVirt = nodename +
"_VirtSheet";
304 PHG4HitContainer* hits_virt = findNode::getClass<PHG4HitContainer>(topNode, nodenameVirt);
313 h2_RP_XY->Fill(hit_iter->second->get_x(0), hit_iter->second->get_y(0));
316 h2_RP_layers_XY[ hit_iter->second->get_layer() ]->Fill(hit_iter->second->get_x(0), hit_iter->second->get_y(0));
320 hit_iter->second->get_hit_type(),
321 hit_iter->second->get_x(0),
322 hit_iter->second->get_y(0),
323 hit_iter->second->get_z(0),
324 hit_iter->second->get_x(1),
325 hit_iter->second->get_y(1),
326 hit_iter->second->get_z(1),
327 hit_iter->second->get_t(0),
328 hit_iter->second->get_t(1),
329 hit_iter->second->get_edep());
330 if (hit_iter->second->get_hit_type())
345 h2_RP_virtlayers_XY[ hit_iter->second->get_layer() ]->Fill(hit_iter->second->get_x(0), hit_iter->second->get_y(0));
361 std::ostringstream nodename;
379 h2_B0_XY->Fill(hit_iter->second->get_x(0), hit_iter->second->get_y(0));
381 hit_iter->second->get_hit_type(),
382 hit_iter->second->get_x(0),
383 hit_iter->second->get_y(0),
384 hit_iter->second->get_z(0),
385 hit_iter->second->get_x(1),
386 hit_iter->second->get_y(1),
387 hit_iter->second->get_z(1),
388 hit_iter->second->get_t(0),
389 hit_iter->second->get_t(1),
390 hit_iter->second->get_edep());
391 if (hit_iter->second->get_hit_type())
395 h1_B0_E->Fill(hit_iter->second->get_layer(), hit_iter->second->get_edep());
422 std::ifstream infile;
425 infile.open( filename );
427 if( ! infile.is_open() )
429 std::cout <<
"ERROR in FarForwardEvaluator: Failed to open parameter file " << filename << std::endl;
433 while( std::getline(infile, line) ) {
438 std::istringstream iss( line );
441 if( line.find(
"#") != std::string::npos ) {
continue; }
443 if( !(iss >> name >> value) ) {
444 std::cout <<
"Could not decode " << line << std::endl;
448 if( name.compare(param) == 0 ) {