Changeset 1715 for trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
- Timestamp:
- 01/19/03 14:52:29 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
r1574 r1715 158 158 return -5.; 159 159 160 const UInt_t n = geom->GetNumPixels(); 161 160 162 Float_t minval = (*this)[0].GetNumPhotons(); 161 163 … … 164 166 const MCerPhotPix &pix = (*this)[i]; 165 167 168 const UInt_t id = pix.GetPixId(); 169 if (id>=n) 170 continue; 171 166 172 Float_t testval = pix.GetNumPhotons(); 167 173 168 174 if (geom) 169 testval *= geom->GetPixRatio( pix.GetPixId());175 testval *= geom->GetPixRatio(id); 170 176 171 177 if (testval < minval) … … 187 193 return 50.; 188 194 195 const UInt_t n = geom->GetNumPixels(); 196 189 197 Float_t maxval = (*this)[0].GetNumPhotons(); 190 198 … … 193 201 const MCerPhotPix &pix = (*this)[i]; 194 202 203 const UInt_t id = pix.GetPixId(); 204 if (id>=n) 205 continue; 206 195 207 Float_t testval = pix.GetNumPhotons(); 196 197 208 if (geom) 198 testval *= geom->GetPixRatio( pix.GetPixId());209 testval *= geom->GetPixRatio(id); 199 210 200 211 if (testval > maxval) … … 322 333 return NULL; 323 334 } 335 336 /* 337 // -------------------------------------------------------------------------- 338 // 339 // Use this function to sum photons in events together. 340 // 341 Bool_t MCerPhotEvt::AddEvent(const MCerPhotEvt &evt) 342 { 343 if (evt.fNumPixels<=0) 344 { 345 *fLog << "Warning - Event to be added has no pixels." << endl; 346 return kFALSE; 347 } 348 if (fNumPixels<=0) 349 { 350 *fLog << "Warning - Event to add pixels to has no pixels." << endl; 351 return kFALSE; 352 } 353 354 for (UInt_t i=0; i<evt.fNumPixels; i++) 355 { 356 const UInt_t id = evt[i].GetPixId(); 357 358 MCerPhotPix *pix2 = GetPixById(id); 359 if (!pix2) 360 { 361 *fLog << "Error - Pixel#" << dec << id << " does not exist in this event!" << endl; 362 return kFALSE; 363 } 364 365 pix2->AddNumPhotons(evt[i].GetNumPhotons()); 366 } 367 return kTRUE; 368 } 369 */
Note:
See TracChangeset
for help on using the changeset viewer.