Changeset 17663 for trunk/Mars/msimcamera/MSimCamera.cc
- Timestamp:
- 04/07/14 15:05:14 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/msimcamera/MSimCamera.cc
r17643 r17663 47 47 #include "MLogManip.h" 48 48 49 #include "MTruePhotonsPerPixelCont.h" 50 49 51 #include "MSpline3.h" 50 52 #include "MParSpline.h" … … 149 151 { 150 152 *fLog << err << "CrosstalkCoeffParam [MParameterD] not found... aborting." << endl; 153 return kFALSE; 154 } 155 156 fTruePhotons = (MTruePhotonsPerPixelCont*)pList->FindCreateObj("MTruePhotonsPerPixelCont"); 157 if (!fTruePhotons) 158 { 159 *fLog << err << "MTruePhotonsPerPixelCont not found... aborting." << endl; 151 160 return kFALSE; 152 161 } … … 344 353 345 354 if (ph.GetPrimary()!=MMcEvt::kNightSky && ph.GetPrimary()!=MMcEvt::kArtificial) 355 { 346 356 tot += ph.GetWeight(); 357 (*fTruePhotons->cherenkov_photons_weight)[idx] += ph.GetWeight(); 358 (*fTruePhotons->cherenkov_photons_number)[idx] += 1; 359 360 (*fTruePhotons->cherenkov_arrival_time_mean)[idx] += t; 361 (*fTruePhotons->cherenkov_arrival_time_variance)[idx] += t*t; 362 363 if (ph.GetPrimary()==MMcEvt::kMUON) 364 { 365 (*fTruePhotons->muon_cherenkov_photons_weight)[idx] += ph.GetWeight(); 366 (*fTruePhotons->muon_cherenkov_photons_number)[idx] += 1; 367 } 368 369 // find min 370 if (t < (*fTruePhotons->cherenkov_arrival_time_min)[idx] ) 371 { 372 (*fTruePhotons->cherenkov_arrival_time_min)[idx] = t; 373 } 374 // find max 375 if (t > (*fTruePhotons->cherenkov_arrival_time_max)[idx] ) 376 { 377 (*fTruePhotons->cherenkov_arrival_time_max)[idx] = t; 378 } 379 } 380 else 381 { 382 (*fTruePhotons->noise_photons_weight)[idx] += ph.GetWeight(); 383 } 347 384 348 385 // Sorry, the name "pedestal" is misleading here … … 352 389 // === FIXME === FIXME === FIXME === Frequency!!!! 353 390 (*fCamera)[idx].AddPulse(*fSpline, t, ph.GetWeight()*gain); 391 } 392 393 for (unsigned int i=0 ; i < 1440 ; i++) 394 { 395 float number = (*fTruePhotons->cherenkov_photons_number)[i]; 396 (*fTruePhotons->cherenkov_arrival_time_mean)[i] /= number; 397 float mean = (*fTruePhotons->cherenkov_arrival_time_mean)[i]; 398 float sum_tt = (*fTruePhotons->cherenkov_arrival_time_variance)[i]; 399 (*fTruePhotons->cherenkov_arrival_time_variance)[i] = (sum_tt / number - mean*mean) /(number - 1); 354 400 } 355 401
Note:
See TracChangeset
for help on using the changeset viewer.