Changeset 7033 for trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc
- Timestamp:
- 05/13/05 19:26:28 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc
r6985 r7033 172 172 const UInt_t cnt = n1<n2 ? n : n1-n2; 173 173 174 if (cnt<n/10)175 return kTRUE;176 177 178 // Calculate the rate179 const Double_t rate = (Double_t)cnt/(fTimes[n1%n]-fTimes[n2%n]);180 181 174 // Store the time difference between two consecutive events 182 175 fTimeDiff->SetVal(exec==0 ? -1 : fTimes[n1%n] - fTimes[(n1+n-1)%n]); … … 185 178 // Make sure, that the beginning of data-takeing (open 186 179 // a new file) doesn't effect the rate too much 187 if (exec<fNumFirstEvent+n) 188 { 189 fRate->SetRate(-1, 0); 180 if (cnt<n/10) 190 181 return kTRUE; 191 } 182 183 // Calculate the rate 184 const Double_t rate = (Double_t)cnt/(fTimes[n1%n]-fTimes[n2%n]); 192 185 193 186 // Store the rate … … 195 188 fRate->SetReadyToSave(); 196 189 197 Double_t diff = fTimes[n1%n]- fTimes[n2%n]; 198 Double_t time = fTimes[n2%n]+ (cnt-n/10.)/(n-n/10.)*diff/2; 190 // Calculate and store the corresponding time 191 const Double_t diff = fTimes[n1%n] - fTimes[n2%n]; 192 const Double_t time = fTimes[n2%n] + (cnt-n/10.)/(n-n/10.)*diff/2; 199 193 200 194 fTimeRate->SetMean(time, time); 201 202 //if (cnt>1000) 203 //*fLog << all << *fTimeRate << " " << *fTime << " " << diff << " " << cnt << " " << n << " " << (float)(cnt-n/2)/n << endl; 204 195 fTimeRate->SetReadyToSave(); 196 197 /* 205 198 // Store the corresponding time 206 199 if (exec==fNumFirstEvent+n) … … 208 201 else 209 202 fTimeRate->SetMean(fTimes[n1%n], fTimes[n2%n]); 203 */ 210 204 211 205 return kTRUE;
Note:
See TracChangeset
for help on using the changeset viewer.