~durga/maus/rel709

« back to all changes in this revision

Viewing changes to src/reduce/ReduceCppTofCalib/ReduceCppTofCalib.cc

  • Committer: Durga Rajaram
  • Date: 2013-08-27 04:36:50 UTC
  • mfrom: (659.1.73 rc)
  • Revision ID: durga@fnal.gov-20130827043650-me0hgsbzlzikdoik
Tags: MAUS-v0.7.0
MAUS-v0.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
  if (loadSpill(document)) {
56
56
    if (_spill.GetDaqEventType() == "physics_event") {
57
57
      int n_part_events = _spill.GetReconEventSize();
58
 
      // std::cout << n_part_events << " " << std::flush;
59
58
      for (int PartEvent = 0; PartEvent < n_part_events; PartEvent++) {
60
59
        // Get this particle event in TOF0, TOF1 and TOF2.
61
60
        ReconEvent revt = _spill.GetAReconEvent(PartEvent);
65
64
        int ntof0_sh = slbhits.GetTOF0SlabHitArraySize();
66
65
        int ntof1_sh = slbhits.GetTOF1SlabHitArraySize();
67
66
        int ntof2_sh = slbhits.GetTOF2SlabHitArraySize();
68
 
 
69
 
        if (!(ntof0_sh == 2 && ntof1_sh == 2 && ntof2_sh == 2))
 
67
        if (!(ntof0_sh == 2 && (ntof1_sh == 2 || ntof2_sh == 2)))
70
68
            continue;
71
69
 
72
70
        // Make sure that all times and charges are set to zero and
111
109
                t2 = rt0;
112
110
                t3 = rt1;
113
111
            }
114
 
            TOFSlabHit tof1_sh = slbhits.GetTOF1SlabHitArrayElement(h);
115
 
            tpln = tof1_sh.GetPlane();
116
 
            tslb = tof1_sh.GetSlab();
117
 
            pm0 = tof1_sh.GetPmt0();
118
 
            pm1 = tof1_sh.GetPmt1();
119
 
            rt0 = pm0.GetRawTime();
120
 
            ch0 = pm0.GetCharge();
121
 
            rt1 = pm1.GetRawTime();
122
 
            ch1 = pm1.GetCharge();
123
 
            if (tpln == 0) {
124
 
                slabC = tslb;
125
 
                adc4 = ch0;
126
 
                adc5 = ch1;
127
 
                t4 = rt0;
128
 
                t5 = rt1;
129
 
            } else if (tpln == 1) {
130
 
                slabD = tslb;
131
 
                adc6 = ch0;
132
 
                adc7 = ch1;
133
 
                t6 = rt0;
134
 
                t7 = rt1;
 
112
            if (ntof1_sh == 2) {
 
113
                TOFSlabHit tof1_sh = slbhits.GetTOF1SlabHitArrayElement(h);
 
114
                tpln = tof1_sh.GetPlane();
 
115
                tslb = tof1_sh.GetSlab();
 
116
                pm0 = tof1_sh.GetPmt0();
 
117
                pm1 = tof1_sh.GetPmt1();
 
118
                rt0 = pm0.GetRawTime();
 
119
                ch0 = pm0.GetCharge();
 
120
                rt1 = pm1.GetRawTime();
 
121
                ch1 = pm1.GetCharge();
 
122
                if (tpln == 0) {
 
123
                    slabC = tslb;
 
124
                    adc4 = ch0;
 
125
                    adc5 = ch1;
 
126
                    t4 = rt0;
 
127
                    t5 = rt1;
 
128
                } else if (tpln == 1) {
 
129
                    slabD = tslb;
 
130
                    adc6 = ch0;
 
131
                    adc7 = ch1;
 
132
                    t6 = rt0;
 
133
                    t7 = rt1;
 
134
                }
135
135
            }
136
 
            TOFSlabHit tof2_sh = slbhits.GetTOF2SlabHitArrayElement(h);
137
 
            tpln = tof2_sh.GetPlane();
138
 
            tslb = tof2_sh.GetSlab();
139
 
            pm0 = tof2_sh.GetPmt0();
140
 
            pm1 = tof2_sh.GetPmt1();
141
 
            rt0 = pm0.GetRawTime();
142
 
            ch0 = pm0.GetCharge();
143
 
            rt1 = pm1.GetRawTime();
144
 
            ch1 = pm1.GetCharge();
145
 
            if (tpln == 0) {
146
 
                slabE = tslb;
147
 
                adc8 = ch0;
148
 
                adc9 = ch1;
149
 
                t8 = rt0;
150
 
                t9 = rt1;
151
 
            } else if (tpln == 1) {
152
 
                slabF = tslb;
153
 
                adc10 = ch0;
154
 
                adc11 = ch1;
155
 
                t10 = rt0;
156
 
                t11 = rt1;
 
136
            if (ntof2_sh == 2) {
 
137
                TOFSlabHit tof2_sh = slbhits.GetTOF2SlabHitArrayElement(h);
 
138
                tpln = tof2_sh.GetPlane();
 
139
                tslb = tof2_sh.GetSlab();
 
140
                pm0 = tof2_sh.GetPmt0();
 
141
                pm1 = tof2_sh.GetPmt1();
 
142
                rt0 = pm0.GetRawTime();
 
143
                ch0 = pm0.GetCharge();
 
144
                rt1 = pm1.GetRawTime();
 
145
                ch1 = pm1.GetCharge();
 
146
                if (tpln == 0) {
 
147
                    slabE = tslb;
 
148
                    adc8 = ch0;
 
149
                    adc9 = ch1;
 
150
                    t8 = rt0;
 
151
                    t9 = rt1;
 
152
                } else if (tpln == 1) {
 
153
                    slabF = tslb;
 
154
                    adc10 = ch0;
 
155
                    adc11 = ch1;
 
156
                    t10 = rt0;
 
157
                    t11 = rt1;
 
158
                }
157
159
            }
158
160
        }
159
161
        dataTree.Fill();