Ignore:
Timestamp:
08/19/13 12:07:14 (11 years ago)
Author:
ftemme
Message:
added the writing of several Header Keys to the fitsoutput of Ceres in MJSimulation.cc, the values of the HeaderKeys are mainly hardcoded; changed the name of the columns in the fitsoutput for MMcEvt.fEvtNumber, MRawEvtData.fStartCells to the corresponding name in real data files; removed the vetoing of several columns in the fitsout in MJSimulation.cc; implemented the substraction of the accoupling in MSimCamera.cc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Mars_MC/msimcamera/MSimCamera.cc

    r10167 r17011  
    135135        return kFALSE;
    136136
     137    fAccidentalPhotons = (MPedestalCam*)pList->FindObject("AccidentalPhotonRates","MPedestalCam");
     138    if(!fAccidentalPhotons)
     139    {
     140        *fLog << err << "AccidentalPhotonRates [MPedestalCam] not found... aborting." << endl;
     141        return kFALSE;
     142    }
     143
    137144    MParSpline *pulse = (MParSpline*)pList->FindObject("PulseShape", "MParSpline");
    138145    if (!pulse)
     
    238245        const Double_t rms = pix.GetPedestalRms();
    239246
     247        // FTemme: Implementation of AC-coupling:
     248        // to calculate the value of the accoupling per slice I use the
     249        // following equation:
     250        // accouplingPerSlice = accidentalPhotonRate * (1 + crossTalkProb)
     251        //       * areaOfOnePulse / samplingRate;
     252        // Therefore I need the following variables
     253        Double_t accidentalPhotonRate   = 0; // [MHz]
     254        Float_t crossTalkProb           = 0; // [1]
     255        Double_t areaOfOnePulse         = 0; // [ADC-Counts * s]
     256        Double_t samplingRate           = 0; // [slices * MHz]
     257
     258        // The accidental photon rate is stored in GHz, so we have to multiply
     259        // with 1E3 to get MHz:
     260        MPedestalPix &accPhoPix         = (*fAccidentalPhotons)[i];
     261        accidentalPhotonRate            = accPhoPix.GetPedestal() * 1E3;
     262
     263        // I don't know how to get the variable fCrosstalkProb from
     264        // the class APD (see MAvalanchePhotoDiode.h), because there is no
     265        // getter for the APD array(fAPDs) in MSimAPD.
     266        // So I set the crossTalkProb hardcoded to the value 0.15, which is
     267        // equal to the value of the apd of type 4
     268        crossTalkProb                   = 0.15;
     269
     270        // To get the area of one Pulse, I only need to calculate the Integral
     271        // of the Pulse Shape, which is stored in fSpline. Because the spline is
     272        // normalized to a maximal amplitude of 1.0, I had to multiply it with
     273        // the Default gain:
     274        areaOfOnePulse                  = fSpline->Integral() * fDefaultGain;
     275
     276        // The sampling rate I get from the RunHeader:
     277        samplingRate                    = fRunHeader->GetFreqSampling();
     278
     279        Double_t accouplingPerSlice = accidentalPhotonRate  * (1 + crossTalkProb)
     280                * areaOfOnePulse / samplingRate;
     281
     282        // The accoupling is substracted from the timeline by decreasing the
     283        // mean of the gaussian noise which is added
     284
    240285        if (!fBaselineGain)
    241286        {
    242             (*fCamera)[i].AddGaussianNoise(rms, val);
     287            (*fCamera)[i].AddGaussianNoise(rms, val - accouplingPerSlice);
    243288            continue;
    244289        }
     
    250295        // FIXME: How stable is the offset?
    251296        // FIXME: Should we write a container AppliedGain for MSImTrigger?
    252         (*fCamera)[i].AddGaussianNoise(rms*gain, val*gain);
     297
     298        (*fCamera)[i].AddGaussianNoise(rms*gain, (val - accouplingPerSlice)*gain);
    253299    }
    254300
Note: See TracChangeset for help on using the changeset viewer.