~chris-rogers/mice-emr/trunk

« back to all changes in this revision

Viewing changes to Software/mc/digitization/src/MapCppEMRPlaneHitsMCdigi.cc

  • Committer: Chris Rogers
  • Date: 2014-05-20 09:30:14 UTC
  • Revision ID: chris.rogers@stfc.ac.uk-20140520093014-he43dmwsewve273q
Fix uninitialised values

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
string MapCppEMRPlaneHitsMCdigi::process(string document) {}
44
44
 
45
45
void MapCppEMRPlaneHitsMCdigi::process(Spill *spill) {
46
 
 
47
46
  reset_data_tmp(3);
48
47
  processMCdata();
49
48
  fill(spill);
60
59
  int nPlHits = evt->GetEMRPlaneHitArray().size();
61
60
  int nBarsTotal = 0;
62
61
  for (int ipl=0; ipl<nPlHits; ipl++) {
63
 
    std::cerr << "IPL " << ipl << std::endl;
64
62
    EMRPlaneHit *plHit = evt->GetEMRPlaneHitArray().at(ipl);
65
63
    nBarsTotal += plHit->GetEMRBarArray().size();
66
64
  }
67
65
    
68
66
  for (int ipl=0; ipl<nPlHits; ipl++) {
69
 
    std::cerr << "IPL " << ipl << std::endl;
70
 
 
71
67
    EMRPlaneHit *plHit = evt->GetEMRPlaneHitArray().at(ipl);
72
68
    int xPlane = plHit->GetPlane();
73
69
 
77
73
    double epsilon_SA = 0.0;
78
74
    char line[100];
79
75
    while (fgets(line,100,_calibfile)) {
80
 
      std::cerr << "CALIB " << ipl << std::endl;
81
76
      char pmt[10],fom[10];
82
77
      int pl(-1),ch(-1);
83
78
      float corr(-1.0);
98
93
    int naph_SAPMT = 0;
99
94
 
100
95
    for (int ibar=0; ibar<nBars; ibar++) {
101
 
      std::cerr << "IBAR " << ibar << std::endl;
102
 
 
103
96
      EMRBar *bar = plHit->GetEMRBarArray().at(ibar);
104
97
      int xBar = bar->GetBar();
105
98
      int nBarHits = bar->GetEMRBarHitArray().size();
106
99
 
107
100
      for (int ibh=0; ibh<nBarHits; ibh++) {
108
 
          std::cerr << "IBH " << ibh << std::endl;
109
 
 
110
101
        EMRBarHit barHit = bar->GetEMRBarHitArray().at(ibh);
111
102
        double x  = barHit.GetX();/*mm*/
112
103
        double y  = barHit.GetY();/*mm*/
370
361
}
371
362
 
372
363
void MapCppEMRPlaneHitsMCdigi::reset_data_tmp(int nPartEvts) {
373
 
  _emr_dbb_events_tmp.resize(0);
374
 
  _emr_dbb_events_tmp.resize(nPartEvts);
 
364
  _emr_dbb_events_tmp = EMRDBBEventVector(nPartEvts);
375
365
  for (int ipe=0; ipe<nPartEvts ;ipe++) {
376
 
    _emr_dbb_events_tmp[ipe].resize(48);  // number of planes
 
366
    _emr_dbb_events_tmp[ipe] = EMRPlaneVector(48);  // number of planes
377
367
    for (int iplane=0; iplane<48; iplane++) {
378
 
      _emr_dbb_events_tmp[ipe][iplane].resize(61); // number of bars in a plane
 
368
      _emr_dbb_events_tmp[ipe][iplane] = EMRBarVector(61); // number of bars in a plane
379
369
    }
380
370
  }
381
 
  _emr_fadc_events_tmp.resize(0);
382
 
  _emr_fadc_events_tmp.resize(nPartEvts);
 
371
  _emr_fadc_events_tmp = EMRfADCEventVector(nPartEvts);
383
372
  for (int ipe=0; ipe<nPartEvts ;ipe++) {
384
 
    _emr_fadc_events_tmp[ipe].resize(48);
 
373
    _emr_fadc_events_tmp[ipe] = EMRfADCPlaneHitsVector(48);
385
374
    for (int iplane=0; iplane<48; iplane++) {
386
375
      fADCdata data;
387
376
      data._orientation = iplane%2;