Changeset 1092 for trunk


Ignore:
Timestamp:
11/28/01 10:15:33 (23 years ago)
Author:
blanch
Message:
Change in the methode to substract the pedestal. The new
methode is valid either for MC data and real data but only for
the current integration (GetSumHiGainSamples()).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc

    r1081 r1092  
    4545#include "MLogManip.h"
    4646
     47#include "MRawRunHeader.h"
    4748#include "MRawEvtData.h"       // MRawEvtData::GetNumPixels
    4849#include "MCerPhotEvt.h"
     
    6667    AddToBranchList("fHiGainFadcSamples");
    6768    AddToBranchList("fLoGainFadcSamples");
     69
    6870}
    6971
     
    7173//
    7274// The PreProcess searches for the following input containers:
     75//  - MRawRunHeader
    7376//  - MRawEvtData
    7477//  - MPedestalCam
     
    8083Bool_t MCerPhotCalc::PreProcess(MParList *pList)
    8184{
     85    MRawRunHeader *RunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     86    if (!RunHeader)
     87    {
     88        *fLog << dbginf << "MRawRunHeader not found... aborting." << endl;
     89        return kFALSE;
     90    }
     91    fNumLoGainFadcSlices= RunHeader->GetNumSamplesLoGain();
     92    fNumHiGainFadcSlices= RunHeader->GetNumSamplesHiGain();
     93
    8294    fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData");
    8395    if (!fRawEvt)
     
    103115// --------------------------------------------------------------------------
    104116//
    105 // Calculate the integral of the FADC time slaices and store them as a new
     117// Calculate the integral of the FADC time slices and store them as a new
    106118// pixel in the MCerPhotEvt container.
    107119//
     
    111123
    112124    MRawEvtPixelIter pixel(fRawEvt);
     125
    113126    while (pixel.Next())
    114127    {
     128
    115129        const UInt_t pixid = pixel.GetPixelId();
    116130
    117131        const MPedestalPix &ped = (*fPedestals)[pixid];
    118132
    119         const Float_t nphot = (Float_t)pixel.GetSumHiGainSamples() - ped.GetMean();
     133        Float_t nphot = (Float_t)pixel.GetSumHiGainSamples();
    120134
    121         fCerPhotEvt->AddPixel(pixid, nphot, ped.GetMeanRms());
     135        if(nphot>0) nphot -= fNumHiGainFadcSlices*ped.GetMean();
     136
     137        fCerPhotEvt->AddPixel(pixid, nphot, sqrt(fNumHiGainFadcSlices)*ped.GetMeanRms());
    122138
    123139        // FIXME! Handling of Lo Gains is missing!
     
    128144    return kTRUE;
    129145}
    130 
Note: See TracChangeset for help on using the changeset viewer.