Changeset 18479 for trunk/Mars/manalysis
- Timestamp:
- 04/30/16 18:38:36 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/manalysis/MSoftwareTrigger.cc
r18478 r18479 106 106 MArrayF buf(160*num); 107 107 108 double avg = 0; 109 108 110 for (int hw=0; hw<1440; hw++) 109 111 { … … 121 123 continue; 122 124 123 const UInt_t sw = idx[hw]; 124 125 const Float_t *raw = fSignal->GetSamples(sw); 125 const Float_t *raw = fSignal->GetSamples(idx[hw]); 126 126 127 127 Float_t *sum = buf.GetArray()+(hw/9)*num; … … 154 154 */ 155 155 156 Float_t max = 0; 157 double avg = 0; 156 Float_t max = -50000; 158 157 159 158 const UInt_t nsum = buf.GetSize(); … … 163 162 Float_t v[4] = { 0, 0, 0, 0 }; 164 163 165 for (Float_t *ptr=sum+ 20; ptr<sum+num; ptr++)164 for (Float_t *ptr=sum+15; ptr<sum+num; ptr++) 166 165 { 167 *ptr -= 0.6 * ptr[-20]; 168 avg += *ptr; 169 v[idx++%4] = *ptr; 166 ptr[0] -= 0.5*ptr[-15]; 167 168 avg += ptr[0]; 169 v[idx++%4] = ptr[0]; 170 170 171 171 const Float_t min = *std::min_element(v, v+4); … … 175 175 } 176 176 177 avg /= num*(1440-9); // excluding the 0's from the broken DRS board 177 // Question: Should we also keep position and patch id? 178 179 avg /= (num-15)*(1440-24); 178 180 179 181 fTriggerSignal->SetVal(max);
Note:
See TracChangeset
for help on using the changeset viewer.