Changeset 19623 for trunk/Mars
- Timestamp:
- 09/04/19 16:40:31 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/msimcamera/MSimCamera.cc
r19622 r19623 410 410 Double_t tot = 0; 411 411 412 for (int i=0 ; i<1440 ; i++) 413 { 414 (*fTruePhotons->cherenkov_photons_weight)[i] = 0; 415 (*fTruePhotons->cherenkov_photons_number)[i] = 0; 416 (*fTruePhotons->cherenkov_arrival_time_mean)[i] = 0; 417 (*fTruePhotons->cherenkov_arrival_time_variance)[i] = 0; 418 (*fTruePhotons->muon_cherenkov_photons_weight)[i] = 0; 419 (*fTruePhotons->muon_cherenkov_photons_number)[i] = 0; 420 (*fTruePhotons->cherenkov_arrival_time_min)[i] = 10000; 421 (*fTruePhotons->cherenkov_arrival_time_max)[i] = 0; 422 (*fTruePhotons->noise_photons_weight)[i] = 0; 412 // Sanity check for bad programming style 413 if (npix==1440) 414 { 415 for (int i=0 ; i<1440 ; i++) 416 { 417 (*fTruePhotons->cherenkov_photons_weight)[i] = 0; 418 (*fTruePhotons->cherenkov_photons_number)[i] = 0; 419 (*fTruePhotons->cherenkov_arrival_time_mean)[i] = 0; 420 (*fTruePhotons->cherenkov_arrival_time_variance)[i] = 0; 421 (*fTruePhotons->muon_cherenkov_photons_weight)[i] = 0; 422 (*fTruePhotons->muon_cherenkov_photons_number)[i] = 0; 423 (*fTruePhotons->cherenkov_arrival_time_min)[i] = 10000; 424 (*fTruePhotons->cherenkov_arrival_time_max)[i] = 0; 425 (*fTruePhotons->noise_photons_weight)[i] = 0; 426 } 423 427 } 424 428 … … 441 445 // fFixTimeOffsetsBetweenPixelsInNs -> fM matrix. We identify the first 442 446 // column to hold the offsets in ns. 443 t = t +freq*fFixTimeOffsetsBetweenPixelsInNs->fM[idx][0];447 t += freq*fFixTimeOffsetsBetweenPixelsInNs->fM[idx][0]; 444 448 445 449 // Jens Buss on residual time spread: 446 450 // add random time offset to the arrivaltimes 447 t = t +timeoffset[idx];451 t += timeoffset[idx]; 448 452 449 453 // FIXME: Time jitter? … … 451 455 // add also a time offset to arrival times of single photons 452 456 // TODO: change to ns, use: fRunHeader->GetFreqSampling() 453 Double_t timeJitter = gRandom->Gaus(0.0, gapdTimeJitter); 454 t = t + timeJitter; 457 t += gRandom->Gaus(0.0, gapdTimeJitter); 455 458 456 459 // FIXME: Add additional routing here? … … 460 463 { 461 464 tot += ph.GetWeight(); 462 (*fTruePhotons->cherenkov_photons_weight)[idx] += ph.GetWeight(); 463 (*fTruePhotons->cherenkov_photons_number)[idx] += 1; 464 465 (*fTruePhotons->cherenkov_arrival_time_mean)[idx] += t; 466 (*fTruePhotons->cherenkov_arrival_time_variance)[idx] += t*t; 467 468 if (ph.GetPrimary()==MMcEvt::kMUON) 465 466 // Sanity check for bad programming style 467 if (npix==1440) 469 468 { 470 (*fTruePhotons->muon_cherenkov_photons_weight)[idx] += ph.GetWeight(); 471 (*fTruePhotons->muon_cherenkov_photons_number)[idx] += 1; 472 } 473 474 // find min 475 if (t < (*fTruePhotons->cherenkov_arrival_time_min)[idx] ) 476 { 477 (*fTruePhotons->cherenkov_arrival_time_min)[idx] = t; 478 } 479 // find max 480 if (t > (*fTruePhotons->cherenkov_arrival_time_max)[idx] ) 481 { 482 (*fTruePhotons->cherenkov_arrival_time_max)[idx] = t; 469 (*fTruePhotons->cherenkov_photons_weight)[idx] += ph.GetWeight(); 470 (*fTruePhotons->cherenkov_photons_number)[idx] += 1; 471 472 (*fTruePhotons->cherenkov_arrival_time_mean)[idx] += t; 473 (*fTruePhotons->cherenkov_arrival_time_variance)[idx] += t*t; 474 475 if (ph.GetPrimary()==MMcEvt::kMUON) 476 { 477 (*fTruePhotons->muon_cherenkov_photons_weight)[idx] += ph.GetWeight(); 478 (*fTruePhotons->muon_cherenkov_photons_number)[idx] += 1; 479 } 480 481 // find min 482 if (t < (*fTruePhotons->cherenkov_arrival_time_min)[idx] ) 483 { 484 (*fTruePhotons->cherenkov_arrival_time_min)[idx] = t; 485 } 486 // find max 487 if (t > (*fTruePhotons->cherenkov_arrival_time_max)[idx] ) 488 { 489 (*fTruePhotons->cherenkov_arrival_time_max)[idx] = t; 490 } 483 491 } 484 492 } 485 493 else 486 494 { 487 (*fTruePhotons->noise_photons_weight)[idx] += ph.GetWeight(); 495 // Sanity check for bad programming style 496 if (npix==1440) 497 { 498 (*fTruePhotons->noise_photons_weight)[idx] += ph.GetWeight(); 499 } 488 500 } 489 501 … … 496 508 } 497 509 498 for (unsigned int i=0 ; i < 1440 ; i++) 499 { 500 float number = (*fTruePhotons->cherenkov_photons_number)[i]; 501 (*fTruePhotons->cherenkov_arrival_time_mean)[i] /= number; 502 float mean = (*fTruePhotons->cherenkov_arrival_time_mean)[i]; 503 float sum_tt = (*fTruePhotons->cherenkov_arrival_time_variance)[i]; 504 (*fTruePhotons->cherenkov_arrival_time_variance)[i] = (sum_tt / number - mean*mean) /(number - 1); 510 // Sanity check for bad programming style 511 if (npix==1440) 512 { 513 for (unsigned int i=0 ; i < 1440 ; i++) 514 { 515 float number = (*fTruePhotons->cherenkov_photons_number)[i]; 516 (*fTruePhotons->cherenkov_arrival_time_mean)[i] /= number; 517 float mean = (*fTruePhotons->cherenkov_arrival_time_mean)[i]; 518 float sum_tt = (*fTruePhotons->cherenkov_arrival_time_variance)[i]; 519 (*fTruePhotons->cherenkov_arrival_time_variance)[i] = (sum_tt / number - mean*mean) /(number - 1); 520 } 505 521 } 506 522
Note:
See TracChangeset
for help on using the changeset viewer.