Ignore:
Timestamp:
07/25/02 17:14:55 (22 years ago)
Author:
bigongia
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r1425 r1443  
    7373    AddToBranchList("MRawEvtData.fHiGainFadcSamples");
    7474    AddToBranchList("MRawEvtData.fLoGainFadcSamples");
     75
     76    SetDefaultWeights();
    7577}
    7678
     
    115117    // Calculate quadratic sum of weights:
    116118    fSumQuadWeights = 0.;
    117     for (Int_t i = 0; i < 15; i++)
     119    for (Int_t i = 0; i < fWeight.GetSize(); i++)
    118120      fSumQuadWeights += fWeight[i]*fWeight[i];
    119121
     
    138140    }
    139141
    140     if (fRunHeader->GetNumSamplesHiGain() != 15)
    141     {
    142         *fLog << dbginf << "Number of FADC slices (" << fRunHeader->GetNumSamplesHiGain() <<") is different from expected (15)... aborting." << endl;
     142    if (fRunHeader->GetNumSamplesHiGain() != fWeight.GetSize())
     143    {
     144        *fLog << dbginf << "Number of FADC slices (" << fRunHeader->GetNumSamplesHiGain() <<") is different from assumed one (" << fWeight.GetSize() << ")... aborting." << endl;
    143145        return kFALSE;
    144146    }
     
    171173    MRawEvtPixelIter pixel(fRawEvt);
    172174
    173     Float_t BinSignal[15];
     175    TArrayF BinSignal(fWeight.GetSize());
    174176
    175177    while (pixel.Next())
     
    194196        Float_t nphot = 0.;
    195197
    196         for(Int_t i = 0; i<15; i++)
     198        for(Int_t i = 0; i<fWeight.GetSize(); i++)
    197199          {
    198200            BinSignal[i] =  (Float_t) ptr[i] - mean;
     
    212214}
    213215
    214 // Default weights:
    215 Float_t MCerPhotCalc2::fWeight[] = {0, 0.0809835, 0.289593, 0.366926, 0.211665, 0.0508328, 0., 0., 0., 0., 0., 0., 0., 0., 0.};
     216//
     217// Set default values for the number of slices and weights:
     218//
     219
     220void MCerPhotCalc2::SetDefaultWeights()
     221{
     222  const Float_t dummy[15] = {0, 0.0809835, 0.289593, 0.366926, 0.211665, 0.0508328, 0., 0., 0., 0., 0., 0., 0., 0., 0.};
     223
     224  fWeight.Set(15,dummy);
     225  return;
     226}
     227
     228
     229
     230
Note: See TracChangeset for help on using the changeset viewer.