Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
readDigitalCurrents.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file readDigitalCurrents.cc
1 
2 #include "readDigitalCurrents.h"
3 
6 #include <fun4all/SubsysReco.h> // for SubsysReco
7 
8 
9 #include "trackbase/TpcDefs.h"
10 #include "trackbase/ActsGeometry.h"
11 
12 #include <phool/PHCompositeNode.h>
13 
16 
19 
20 
22 #include <trackbase/TrkrHitSet.h>
23 #include <trackbase/TrkrHit.h>
24 #include <trackbase/TrkrDefs.h>
25 
26 #include <phool/getClass.h>
27 
28 #include <TFile.h>
29 #include <TH1.h>
30 #include <TH2.h>
31 #include <TH3.h>
32 
33 #include <iostream>
34 #include <fstream>
35 #include <string>
36 #include <sstream>
37 #include <set>
38 
39 
40 using namespace std;
41 
42 bool IsOverFrame(double r, double phi);
43 
44 bool IsOverFrame(double r, double phi){
45  //these parameters are taken from Feb 12 drawings of frames.
46  double tpc_frame_side_gap=0.8;//mm //space between radial line and start of frame
47  double tpc_frame_side_width=2.6;//mm //thickness of frame
48  double tpc_margin=0.0;//mm // extra gap between edge of frame and start of GEM holes
49 
50  double tpc_frame_r3_outer=758.4;//mm inner edge of larger-r frame of r3
51  double tpc_frame_r3_inner=583.5;//mm outer edge of smaller-r frame of r3
52 
53  double tpc_frame_r2_outer=574.9;//mm inner edge of larger-r frame of r2
54  double tpc_frame_r2_inner=411.4;//mm outer edge of smaller-r frame of r2
55 
56  double tpc_frame_r1_outer=402.6;//mm inner edge of larger-r frame of r1
57  double tpc_frame_r1_inner=221.0;//mm outer edge of smaller-r frame of r1
58 
59  //double tpc_sec0_phi=0.0;//get_double_param("tpc_sec0_phi");
60 
61  //if the coordinate is in the radial spaces of the frames, return true:
62  if (r<tpc_frame_r1_inner+tpc_margin)
63  return true;
64  if (r>tpc_frame_r1_outer-tpc_margin && r<tpc_frame_r2_inner+tpc_margin)
65  return true;
66  if (r>tpc_frame_r2_outer-tpc_margin && r<tpc_frame_r3_inner+tpc_margin)
67  return true;
68  if (r>tpc_frame_r3_outer-tpc_margin)
69  return true;
70 
71  //if the coordinate is within gap+width of a sector boundary, return true:
72  //note that this is not a line of constant radius, but a linear distance from a radius.
73 
74  //find the two spokes we're between:
75 
76  float sectorangle=(M_PI/6);
77  float nsectors=phi/sectorangle;
78  int nsec=floor(nsectors);
79  float reduced_phi=phi-nsec*sectorangle; //between zero and sixty degrees.
80  float dist_to_previous=r*sin(reduced_phi);
81  float dist_to_next=r*sin(sectorangle-reduced_phi);
82  if (dist_to_previous<tpc_frame_side_gap+tpc_frame_side_width+tpc_margin)
83  return true;
84  if (dist_to_next<tpc_frame_side_gap+tpc_frame_side_width+tpc_margin)
85  return true;
86 
87  return false;
88 }
89 
90 //____________________________________________________________________________..
92  SubsysReco(name)
93  , hm(nullptr)
94  , _filename(filename)
95  ,_ampIBFfrac(0.02)
96  ,_collSyst(0)
97 // , outfile(nullptr)
98  {
99  std::cout << "readDigitalCurrents::readDigitalCurrents(const std::string &name) Calling ctor" << std::endl;
100 }
101 
102 //____________________________________________________________________________..
104 {
105  std::cout << "readDigitalCurrents::~readDigitalCurrents() Calling dtor" << std::endl;
106  delete hm;
107 
108 }
109 
110 //____________________________________________________________________________..
112 {
113  std::cout << "readDigitalCurrents::Init(PHCompositeNode *topNode) Initializing" << std::endl;
114 
115  int nz=72;
116  double z_rdo=108*cm;
117 
118  int nr=159;
119  //const int nphi=128*3;
120  //const int nz=62*2;
121  //double z_rdo=105.5*cm;
122  //double rmin=20*cm;
123  double rmax=78*cm;
124 
125  hm = new Fun4AllHistoManager("HITHIST");
126  const int r_bins_N = 66; //51;
127  double r_bins[r_bins_N + 1] = {217.83,
128  223.83, 229.83, 235.83, 241.83, 247.83, 253.83, 259.83, 265.83, 271.83, 277.83, 283.83, 289.83, 295.83, 301.83, 306.83,
129  311.05, 317.92, 323.31, 329.27, 334.63, 340.59, 345.95, 351.91, 357.27, 363.23, 368.59, 374.55, 379.91, 385.87, 391.23, 397.19, 402.49,
130  411.53, 421.70, 431.90, 442.11, 452.32, 462.52, 472.73, 482.94, 493.14, 503.35, 513.56, 523.76, 533.97, 544.18, 554.39, 564.59, 574.76,
131  583.67, 594.59, 605.57, 616.54, 627.51, 638.48, 649.45, 660.42, 671.39, 682.36, 693.33, 704.30, 715.27, 726.24, 737.21, 748.18, 759.11};
132  const int nphi = 205;
133  double phi_bins[nphi + 1] = { 0., 6.3083-2 * M_PI, 6.3401-2 * M_PI, 6.372-2 * M_PI, 6.4039-2 * M_PI, 6.4358-2 * M_PI, 6.4676-2 * M_PI, 6.4995-2 * M_PI, 6.5314-2 * M_PI,
134  0.2618, 0.2937, 0.3256, 0.3574, 0.3893, 0.4212, 0.453, 0.4849, 0.5168, 0.5487, 0.5805, 0.6124, 0.6443, 0.6762, 0.7081,
135  0.7399, 0.7718, 0.7854, 0.8173, 0.8491, 0.881, 0.9129, 0.9448, 0.9767, 1.0085, 1.0404, 1.0723, 1.1041, 1.136, 1.1679,
136  1.1998, 1.2317, 1.2635, 1.2954, 1.309, 1.3409, 1.3727, 1.4046, 1.4365, 1.4684, 1.5002, 1.5321, 1.564, 1.5959, 1.6277,
137  1.6596, 1.6915, 1.7234, 1.7552, 1.7871, 1.819, 1.8326, 1.8645, 1.8963, 1.9282, 1.9601, 1.992, 2.0238, 2.0557, 2.0876,
138  2.1195, 2.1513, 2.1832, 2.2151, 2.247, 2.2788, 2.3107, 2.3426, 2.3562, 2.3881, 2.42, 2.4518, 2.4837, 2.5156, 2.5474,
139  2.5793, 2.6112, 2.6431, 2.6749, 2.7068, 2.7387, 2.7706, 2.8024, 2.8343, 2.8662, 2.8798, 2.9117, 2.9436, 2.9754, 3.0073,
140  3.0392, 3.0711, 3.1029, 3.1348, 3.1667, 3.1986, 3.2304, 3.2623, 3.2942, 3.326, 3.3579, 3.3898, 3.4034, 3.4353, 3.4671,
141  3.499, 3.5309, 3.5628, 3.5946, 3.6265, 3.6584, 3.6903, 3.7221, 3.754, 3.7859, 3.8178, 3.8496, 3.8815, 3.9134, 3.927,
142  3.9589, 3.9907, 4.0226, 4.0545, 4.0864, 4.1182, 4.1501, 4.182, 4.2139, 4.2457, 4.2776, 4.3095, 4.3414, 4.3732, 4.4051,
143  4.437, 4.4506, 4.4825, 4.5143, 4.5462, 4.5781, 4.61, 4.6418, 4.6737, 4.7056, 4.7375, 4.7693, 4.8012, 4.8331, 4.865,
144  4.8968, 4.9287, 4.9606, 4.9742, 5.0061, 5.0379, 5.0698, 5.1017, 5.1336, 5.1654, 5.1973, 5.2292, 5.2611, 5.2929, 5.3248,
145  5.3567, 5.3886, 5.4204, 5.4523, 5.4842, 5.4978, 5.5297, 5.5615, 5.5934, 5.6253, 5.6572, 5.689, 5.7209, 5.7528, 5.7847,
146  5.8165, 5.8484, 5.8803, 5.9122, 5.944, 5.9759, 6.0078, 6.0214, 6.0533, 6.0851, 6.117, 6.1489, 6.1808, 6.2127, 6.2445,
147  6.2764, 2 * M_PI};
148 
149 
150 
151 
152  //R0 sector 0: 2.36679 < phi < 2.86919
153  //R0 sector 1: 1.8432 < phi < 2.3456
154  //R0 sector 2: 1.3196 < phi < 1.822
155  //R0 sector 3: 0.795998 < phi < 1.2984
156  //R0 sector 4: 0.272399 < phi < 0.774799
157  //R0 sector 5: -0.2512 < phi < 0.2512
158  //R0 sector 6: -0.774799 < phi < -0.272399
159  //R0 sector 7: -1.2984 < phi < -0.795998
160  //R0 sector 8: -1.822 < phi < -1.3196
161  //R0 sector 9: -2.3456 < phi < -1.8432
162  //R0 sector 10: -2.86919 < phi < -2.36679
163  //R0 sector 11: -3.39279 < phi < -2.89039
164 
165 
166 
167 
168 
169  double z_bins[2*nz+1];
170  for (int z=0;z<=2*nz;z++){
171  z_bins[z]=-z_rdo+z_rdo/nz*z;
172  }
173 
174  _h_R = new TH1F("_h_R" ,"_h_R;R, [m]" ,r_bins_N ,r_bins);
175  _h_hits = new TH1F("_h_hits" ,"_h_hits;N, [hit]" ,1e5,0-0.5,1e5-0.5);
176  _h_hit_XY = new TH2F("_h_hit_XY" ,"_h_hit_XY;X, [m];Y, [m]" ,4*nr,-1*rmax,rmax,4*nr,-1*rmax,rmax);
177 
178  //_h_SC_ibf = new TH3F("_h_SC_ibf" ,"_h_SC_ibf;#phi, [rad];R, [mm];Z, [mm]" ,nphi,phi_bins,r_bins_N ,r_bins,2*nz,z_bins);
179  _h_DC_SC = new TH3F("_h_DC_SC" ,"_h_DC_SC;#phi, [rad];R, [mm];Z, [mm]" ,nphi,phi_bins,r_bins_N ,r_bins,2*nz,z_bins);
180  _h_DC_SC_XY = new TH2F("_h_DC_SC_XY" ,"_h_DC_SC_XY;X, [mm];Y, [mm];ADC;" ,4*nr,-1*rmax,rmax,4*nr,-1*rmax,rmax);
181  _h_DC_E = new TH2F("_h_DC_E" ,"_h_DC_E;ADC;E" ,200,-100,2e3-100,500,-100,5e3-100);
182 
183  char name[100];
184  char name_ax[100];
185  for (int iz = 0; iz < nFrames; iz++)
186  {
187  sprintf(name, "_h_SC_ibf_%d", iz);
188  sprintf(name_ax, "_h_SC_ibf_%d;#phi, [rad];R, [mm];Z, [mm]", iz);
189  _h_SC_ibf[iz] = new TH3F(name, name_ax, nphi, phi_bins, r_bins_N, r_bins, 2 * nz, z_bins);
190 
191  hm->registerHisto(_h_SC_ibf[iz]);
192  }
193 
194  hm->registerHisto(_h_R );
200 
201  _event_timestamp = 0;
202 
203  if(_fillCSVFile){
204  myCSVFile.open ("./Files/example_1ms_120evts_AA.csv");
205  myCSVFile << "Event,"
206  << "T,"
207  << "Pad,"
208  << "Radius,"
209  << "ADC"
210  <<"\n";
211  }
212 
214 }
215 
216 //____________________________________________________________________________..
218 {
219  std::cout << "readDigitalCurrents::InitRun(PHCompositeNode *topNode) Initializing for Run XXX" << std::endl;
221  //AA collisions timestamps
222  //std::string txt_file = "/sphenix/user/shulga/Work/IBF/DistortionMap/timestamps_50kHz.txt";
223  std::string txt_file = "/sphenix/user/shulga/Work/TpcPadPlane_phi_coresoftware/coresoftware/calibrations/tpc/fillSpaceChargeMaps/data/timestamps_50kHz_1M.txt";
224  int start_line = 3;
225  if(_collSyst==1){
226  //pp collisions timestamps
227  txt_file = "/phenix/u/hpereira/sphenix/work/g4simulations/timestamps_3MHz.txt";
228  //txt_file = "/sphenix/user/shulga/Work/IBF/DistortionMap/timestamps_50kHz.txt";
229  start_line = 2;
230  }
231  ifstream InputFile (txt_file);
232  if (InputFile.is_open()){
233  int n_line=0;
234  while ( getline (InputFile,line) )
235  {
236  n_line++;
237  if(n_line>start_line){
238  std::istringstream is( line );
239  double n[2] = {0,0};
240  int i = 0;
241  while( is >> n[i] ) {
242  i++;
243  }
244  _timestamps[n[0]]=n[1];
245  if(n_line<10){
246  cout<<n[1]<<endl;
247  }
248  _keys.push_back(int(n[0]));
249  }
250  }
251  InputFile.close();
252  }
253 
254  else cout << "Unable to open file:"<<txt_file<<endl;
255 
256  TFile *MapsFile;
257  //if(_fUseIBFMap){
258  MapsFile = new TFile("/sphenix/user/shulga/Work/IBF/DistortionMap/IBF_Map.root","READ");
259  if ( MapsFile->IsOpen() ) printf("Gain/IBF Maps File opened successfully\n");
260  //_h_modules_anode = (TH2F*)MapsFile ->Get("h_modules_anode") ->Clone("_h_modules_anode");
261  _h_modules_measuredibf = (TH2F*)MapsFile ->Get("h_modules_measuredibf")->Clone("_h_modules_measuredibf");
262  //}
264 }
265 
266 //____________________________________________________________________________..
268 {
269  //double bX = _beamxing;
270  //float bX = 1508071;
271  //double z_bias_avg = 0;
272  //if (_fAvg==1){
273  // z_bias_avg=1.05*(float) rand()/RAND_MAX;
274  //}
275  int bemxingsInFile = _keys.size();
276  if (_evtstart>= bemxingsInFile) _evtstart=_evtstart-bemxingsInFile;
277  int key = _keys.at(_evtstart);
278  _event_timestamp = (float)_timestamps[key]*ns;//units in seconds
279  _event_bunchXing = key;
280  if(_evtstart%100==0) cout<<"_evtstart = "<<_evtstart<<endl;
281  _evtstart++;
282 
283  //std::cout << "readDigitalCurrents::process_event(PHCompositeNode *topNode) Processing Event" << std::endl;
284  ostringstream nodename;
285  set<std::string>::const_iterator iter;
286  // //nodename << "G4HIT_TPC";
287  nodename << "TRKR_HITSET";
288 
289  // // SvtxEvaluator
290  // SvtxEvaluator *hits = findNode::getClass<SvtxEvaluator>(topNode, nodename.str().c_str());
291  // //int n_hits = 0;
292  // if (hits){
293  // PHG4HitContainer::ConstRange hit_range = hits->getHits();
294  // }
295  //===================================
296  // get node containing the digitized hits
297  TrkrHitSetContainer* _hitmap = findNode::getClass<TrkrHitSetContainer>(topNode, nodename.str().c_str());
298  if (!_hitmap)
299  {
300  std::cout << PHWHERE << "ERROR: Can't find node TRKR_HITSET" << std::endl;
302  }
303  ostringstream geo_nodename;
304  geo_nodename << "CYLINDERCELLGEOM_SVTX";
305 
306  PHG4TpcCylinderGeomContainer* _geom_container_ccgc = nullptr;
307  PHG4CylinderCellGeomContainer* _geom_container_cgc = nullptr;
308  if(_f_ccgc==1){
309  _geom_container_ccgc = findNode::getClass<PHG4TpcCylinderGeomContainer>(topNode, geo_nodename.str().c_str());
310  if (!_geom_container_ccgc)
311  {
312  std::cout << PHWHERE << "ERROR: Can't find node CYLINDERCELLGEOM_SVTX" << std::endl;
314  }
315  }else{
316  _geom_container_cgc = findNode::getClass<PHG4CylinderCellGeomContainer>(topNode, geo_nodename.str().c_str());
317 
318  if (!_geom_container_cgc)
319  {
320  std::cout << PHWHERE << "ERROR: Can't find node CYLINDERCELLGEOM_SVTX" << std::endl;
322  }
323  }
324 
325 
326  // loop over all the hits
327  // hits are stored in hitsets, so have to get the hitset first
328  int n_hits = 0;
329  //float _event_bunchXing = 1508071;
330  TrkrHitSetContainer::ConstRange all_hitsets = _hitmap->getHitSets();
331  for (TrkrHitSetContainer::ConstIterator iter = all_hitsets.first;iter != all_hitsets.second; ++iter){
332  //checking that the object is inside TPC
333  if(TrkrDefs::getTrkrId(iter->first) == TrkrDefs::tpcId){
334  TrkrDefs::hitsetkey hitsetkey = iter->first;
335  const unsigned int zside = TpcDefs::getSide(hitsetkey);
336  TrkrHitSet::ConstRange range = iter->second->getHits();
337  unsigned int layer = TrkrDefs::getLayer(iter->first);
338  //if(layer>6){
339  PHG4TpcCylinderGeom *layergeom_ccgc = nullptr;
340  PHG4CylinderCellGeom *layergeom_cgc = nullptr;
341  double radius = 0;
342  if(_f_ccgc==1){
343  layergeom_ccgc = _geom_container_ccgc->GetLayerCellGeom(layer);
344  radius = layergeom_ccgc->get_radius()*cm;
345  }else{
346  layergeom_cgc = _geom_container_cgc->GetLayerCellGeom(layer);
347  radius = layergeom_cgc->get_radius()*cm;
348  }
349  //PHG4TpcCylinderGeom *layergeom = _geom_container->GetLayerCellGeom(layer);
350  //double radius = layergeom->get_radius()*cm; // returns center of the layer
351  int min_phiBin=1e5;
352  int max_phiBin=-1;
353  for(TrkrHitSet::ConstIterator hit_iter = range.first; hit_iter != range.second; ++hit_iter){
354  //int f_fill_ibf=0;
355  int f_fill_ibf[30] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
356 
357 
358  unsigned short phibin = TpcDefs::getPad(hit_iter->first);
359  unsigned short zbin = TpcDefs::getTBin(hit_iter->first);
360  double _drift_velocity = 8.0e-3;//ActsGeometry::get_drift_velocity();
361  double phi_center = 0;
362  if(_f_ccgc==1){
363  phi_center = layergeom_ccgc->get_phicenter(phibin);
364  }else{
365  phi_center = layergeom_cgc->get_phicenter(phibin);
366  }
367  if (phi_center<0) phi_center+=2*M_PI;
368  if(phi_center<M_PI/2+M_PI/12 && phi_center>M_PI/2-M_PI/12){
369  if(min_phiBin>phibin)min_phiBin=phibin;
370  if(max_phiBin<phibin)max_phiBin=phibin;
371  }
372  float x = radius*cos(phi_center);
373  float y = radius*sin(phi_center);
374 
375  double z = 0;// layergeom->get_zcenter(zbin)*cm;
376  if(_f_ccgc==1){
377  z = layergeom_ccgc->get_zcenter(zbin)*_drift_velocity*cm;//*cm/ns;
378  if(zside==0){
379  z = -z;
380  }
381  }else{
382  z = layergeom_cgc->get_zcenter(zbin)*cm;
383  }
384  TrkrHit *hit = hit_iter->second;
385  unsigned short adc = hit->getAdc()-adc_pedestal;
386  float E = hit->getEnergy();
387  //double z = 0;
388  //double z_prim = -1*1e10;
389  //double z_ibf = -1*1e10;
390  double z_ibf[30] = {-1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10,
391  -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10,
392  -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10, -1 * 1e10};
393 
394  int RBin=_h_R->GetXaxis()->FindBin(radius);
395  if((RBin>33 && RBin<50) && z>0){
396  int nRBins = layergeom_ccgc->get_phibins();
397  if(phibin<nRBins/12 ) {
398  if (_fillCSVFile){
399  myCSVFile << _evtstart<<","
400  << layergeom_ccgc->get_zcenter(zbin) << ","
401  << phibin<<","
402  << RBin-34<< ","
403  << adc <<"\n";
404  }
405  _h_hit_XY->Fill( x, y);
406  }
407 
408  }
409  //if(!IsOverFrame(radius/mm,phi_center)){
410  for (int iz = 0; iz < nFrames; iz++)
411  {
412  double bX = _beamxing[iz];
413  if (_event_bunchXing <= bX)
414  {
415  if(z>=0 && z<1.055*m){
416  z_ibf[iz] = 1.055 * m - (bX - _event_bunchXing) * 106 * vIon * ns;
417  if( z_ibf[iz]>0 && z_ibf[iz]<1.055*m){
418  f_fill_ibf[iz]=1;
419  }
420  }
421  if(z<0 && z>-1.055*m){
422  z_ibf[iz] = -1.055*m+(bX-_event_bunchXing)*106*vIon*ns;
423  if( z_ibf[iz]<0 && z_ibf[iz]>-1.055*m){
424  f_fill_ibf[iz]=1;
425  }
426  }
427  }
428 
429  }
430  if(z>=0 && z<1.055*m){
431  if(adc>=0)n_hits++;
432  if(adc>=0)_h_DC_E->Fill(adc,E);
433 
434  }
435  if(z<0 && z>-1.055*m){
436  if(adc>=0)n_hits++;
437  if(adc>=0)_h_DC_E->Fill(adc,E);
438 
439  }
440 
441  //Reading IBF and Gain weights according to X-Y position
442  float w_ibf = 1.;
443  //float w_gain = 1.;
444  //if(_fUseIBFMap){
445  int bin_x = _h_modules_measuredibf ->GetXaxis()->FindBin(x/mm);
446  int bin_y = _h_modules_measuredibf ->GetYaxis()->FindBin(y/mm);
447  w_ibf = _h_modules_measuredibf->GetBinContent(bin_x,bin_y);
448  //w_gain = _h_modules_anode->GetBinContent(bin_x,bin_y);
449  w_ibf = 1.;
450  //}
451  float w_adc = adc*w_ibf;
452  _h_DC_SC->Fill(phi_center,radius,z,w_adc);
453  _h_DC_SC_XY->Fill(x,y,w_adc);
454  if(f_fill_ibf[0]==1){
455 
456  _h_R->Fill(radius);
457  }
458  for (int iz = 0; iz < nFrames; iz++)
459  {
460  if (f_fill_ibf[iz] == 1)_h_SC_ibf[iz] ->Fill(phi_center,radius,z_ibf[iz],w_adc);
461  }
462  //}
463  //if(n_hits%100==0) std::cout<<radius<<"|"<<phi_center<<"|"<<z<<std::endl;
464  }
465  //cout<<" min_phiBin"<< min_phiBin <<" max_phiBin"<< max_phiBin<< endl;
466  }
467  }
468 
469  //TrkrHitSetContainer, TrkrHitSet, TrkrHit, and TrkrDefs objects used above in offline/packages/trackbase.
470  _h_hits->Fill(n_hits);
471 
473 }
474 
475 //____________________________________________________________________________..
477 {
478  //std::cout << "readDigitalCurrents::ResetEvent(PHCompositeNode *topNode) Resetting internal structures, prepare for next event" << std::endl;
480 }
481 
482 //____________________________________________________________________________..
484 {
485  std::cout << "readDigitalCurrents::EndRun(const int runnumber) Ending Run for Run " << runnumber << std::endl;
487 }
488 
489 //____________________________________________________________________________..
491 {
492  std::cout << "readDigitalCurrents::End(PHCompositeNode *topNode) This is the End..." << std::endl;
493  _h_R ->Sumw2( false );
494  _h_hits ->Sumw2( false );
495  _h_DC_E ->Sumw2( false );
496  _h_DC_SC ->Sumw2( false );
497  _h_hit_XY ->Sumw2( false );
498  _h_DC_SC_XY ->Sumw2( false );
499  for (int iz = 0; iz < nFrames; iz++)
500  {
501  _h_SC_ibf[iz]->Sumw2(false);
502  }
503  hm->dumpHistos(_filename, "RECREATE");
504  if(_fillCSVFile)myCSVFile.close();
506 }
507 
508 //____________________________________________________________________________..
510 {
511  std::cout << "readDigitalCurrents::Reset(PHCompositeNode *topNode) being Reset" << std::endl;
513 }
514 
515 //____________________________________________________________________________..
517 {
518  std::cout << "readDigitalCurrents::Print(const std::string &what) const Printing info for " << what << std::endl;
519 }
520 
521 void readDigitalCurrents::SetEvtStart(int newEvtStart){
522  _evtstart = newEvtStart;
523  cout<<"Start event is set to: "<<newEvtStart<<endl;
524 
525 }
526 void readDigitalCurrents::FillCSV(int fillCSVFile){
527  _fillCSVFile = fillCSVFile;
528  cout<<"Fill CSV file is set to: "<<fillCSVFile<<endl;
529 }
530 
531 
532 void readDigitalCurrents::SetBeamXing(const std::vector<int> &beamXs)
533 {
534  _beamxing = beamXs;
535  std::cout << "Initial BeamXing is set to: " << _beamxing[0] << std::endl;
536 }
538  _collSyst = coll_syst;
539  std::string s_syst[2] = {"AA","pp"};
540  cout<<"Collision system is set to: "<<s_syst[_collSyst]<<endl;
541 
542 }
543 
544 void readDigitalCurrents::SetIBF(float ampIBFfrac){
545  _ampIBFfrac = ampIBFfrac;
546  cout<<"IBF is set to: "<<_ampIBFfrac<<endl;
547 }
548 
549 void readDigitalCurrents::SetCCGC(float f_ccgc){
550  _f_ccgc = f_ccgc;
551  cout<<"IBF is set to: "<<_f_ccgc<<endl;
552 }
553 
554