Changeset 17083 for branches/Mars_MC/msimcamera/MSimCamera.cc
- Timestamp:
- 09/06/13 15:20:01 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Mars_MC/msimcamera/MSimCamera.cc
r17044 r17083 43 43 #include <TF1.h> 44 44 #include <TRandom.h> 45 #include <TRandom3.h> 45 46 46 47 #include "MLog.h" … … 63 64 #include "MMcEvt.hxx" // To be replaced by a CheObs class 64 65 #include "MRawRunHeader.h" 66 67 #include "math.h" 65 68 66 69 ClassImp(MSimCamera); … … 75 78 : fEvt(0), fStat(0), fRunHeader(0), fElectronicNoise(0), fGain(0), 76 79 fCamera(0), fMcEvt(0), fSpline(0), fBaselineGain(kFALSE), 77 fDefaultOffset(-1), fDefaultNoise(-1), fDefaultGain(-1) 80 fDefaultOffset(-1), fDefaultNoise(-1), fDefaultGain(-1), fACFudgeFactor(0), 81 fACTimeConstant(0) 78 82 79 83 { … … 260 264 MPedestalPix &accPhoPix = (*fAccidentalPhotons)[i]; 261 265 accidentalPhotonRate = accPhoPix.GetPedestal() * 1E3; 266 Double_t currentAccidentalPhotonRate = accidentalPhotonRate; 267 268 if(fACTimeConstant!=0) 269 { 270 Double_t accidentalPhotons = fACTimeConstant * accidentalPhotonRate; 271 Double_t sigmaAccidentalPhotons = sqrt(accidentalPhotons); 272 273 TRandom3 *random = new TRandom3(0); 274 Double_t gaus = random->Gaus(accidentalPhotons,sigmaAccidentalPhotons); 275 currentAccidentalPhotonRate = gaus / timeconst; 276 } 262 277 263 278 // I don't know how to get the variable fCrosstalkProb from … … 277 292 samplingRate = fRunHeader->GetFreqSampling(); 278 293 279 Double_t accouplingPerSlice = accidentalPhotonRate * (1 + crossTalkProb) 294 Double_t accouplingPerSlice = currentAccidentalPhotonRate 295 * (1 + crossTalkProb + fACFudgeFactor) 280 296 * areaOfOnePulse / samplingRate; 281 297 … … 369 385 fDefaultGain = GetEnvValue(env, prefix, "DefaultGain", fDefaultGain); 370 386 } 387 if (IsEnvDefined(env, prefix, "fACFudgeFactor", print)) 388 { 389 rc = kTRUE; 390 fACFudgeFactor = GetEnvValue(env, prefix, "fACFudgeFactor", fACFudgeFactor); 391 } 392 if (IsEnvDefined(env, prefix, "fACTimeConstant", print)) 393 { 394 rc = kTRUE; 395 fACTimeConstant = GetEnvValue(env, prefix, "fACTimeConstant", fACTimeConstant); 396 } 371 397 372 398 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.