Ignore:
Timestamp:
07/15/04 13:57:55 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r4360 r4390  
    236236// Default constructor.
    237237//
    238 // Sets all pointers to NULL
     238// Sets the pointer to fQECam and fGeom to NULL
    239239//
    240240// Calls AddToBranchList for:
     
    255255// - fOutputPath        to "."
    256256// - fOutputFile        to "ChargeCalibStat.txt"
    257 //
     257// - flag debug         to kFALSE
     258//
    258259// Calls:
    259260// - Clear()
    260261//
    261262MCalibrationChargeCalc::MCalibrationChargeCalc(const char *name, const char *title)
    262     : fBadPixels(NULL), fCam(NULL), fBlindPixel(NULL), fPINDiode(NULL),
    263       fQECam(NULL), fGeom(NULL), fPedestals(NULL), fEvtTime(NULL)
     263    : fQECam(NULL), fGeom(NULL)
    264264{
    265265       
     
    279279  SetLambdaErrLimit    ();
    280280  SetPheErrLimit       ();
    281   SetPulserColor       ( MCalibrationCam::kNONE );
    282281  SetOutputPath        ();
    283282  SetOutputFile        ();
    284   SetDebug             ( kFALSE );
     283  SetDebug       ( kFALSE );
    285284
    286285  Clear();
     
    293292// - all variables to 0.,
    294293// - all flags to kFALSE
     294// - all pointers to NULL
     295// - the pulser colour to kNONE
     296// - fBlindPixelFlags to 0
     297// - fPINDiodeFlags   to 0
    295298//
    296299void MCalibrationChargeCalc::Clear(const Option_t *o)
     
    302305    fSqrtLoGainSamples         = 0.;
    303306    fNumInnerFFactorMethodUsed = 0;
    304     SkipHiLoGainCalibration( kFALSE );   
     307
     308    fBadPixels  = NULL;
     309    fCam        = NULL;
     310    fBlindPixel = NULL;
     311    fPINDiode   = NULL;
     312    fPedestals  = NULL;
     313
     314    SetPulserColor ( MCalibrationCam::kNONE );
     315   
     316    fBlindPixelFlags.Set(0);
     317    fPINDiodeFlags  .Set(0);
     318    fResultFlags    .Set(0);
    305319}
    306320
     
    316330//  - MBadPixelsCam
    317331//
    318 // The following output containers are only searched,  but not created. If they
    319 // cannot be found, the corresponding calibration part is only skipped.
    320 //
    321 //  - MTime
    322 //
    323332Int_t MCalibrationChargeCalc::PreProcess(MParList *pList)
    324333{
     
    352361
    353362 
    354   fEvtTime = (MTime*)pList->FindObject("MTime");
    355 
    356363  //
    357364  // Check the pulser colour --> FIXME: this solution is only valid until the arrival of the DM's
     
    953960     
    954961      const Float_t nphe  = pix.GetPheFFactorMethod();
    955       const Float_t nvar  = pix.GetPheFFactorMethod()*pix.GetPheFFactorMethod();
    956962      const Int_t   aidx  = (*fGeom)[i].GetAidx();
    957963
     
    960966
    961967      areaphes    [aidx] += nphe;
    962       areavars    [aidx] += nvar;
     968      areavars    [aidx] += nphe*nphe;
    963969      numareavalid[aidx] ++;
    964970    }
     
    973979        }
    974980
     981      areavars[i] = (areavars[i] - areaphes[i]*areaphes[i]/numareavalid[i]) / (numareavalid[i]-1.);
    975982      areaphes[i] = areaphes[i] / numareavalid[i];
    976       areavars[i] = (areavars[i] - areaphes[i]*areaphes[i]/numareavalid[i]) / (numareavalid[i]-1.);
    977 
    978       if (areavars[i] > 0.)
    979         areavars[i] = TMath::Sqrt(areavars[i]);
    980       else
     983
     984      if (areavars[i] < 0.)
    981985        {
    982986          *fLog << warn << GetDescriptor() << ": No pixels with valid variance of photo-electrons found "
     
    13841388
    13851389      avffactorphotons[aidx] += ffactor;
    1386       avffactorphotvar[aidx] += pix.GetMeanFFactorFADC2PhotVar();
     1390      avffactorphotvar[aidx] += ffactor*ffactor;
    13871391      numffactor[aidx]++;
    13881392    }
     
    13901394  for (UInt_t i=0; i<nareas; i++)
    13911395    {
    1392       avffactorphotons[i] /= numffactor[i];
    1393       avffactorphotvar[i] /= numffactor[i];
     1396
     1397      if (numffactor[i] == 0)
     1398        {
     1399          *fLog << warn << GetDescriptor() << ": No pixels with valid total F-Factor found "
     1400                << "in area index: " << i << endl;
     1401          continue;
     1402        }
     1403
     1404      avffactorphotvar[i] = (avffactorphotvar[i] - avffactorphotons[i]*avffactorphotons[i]/numffactor[i]) / (numffactor[i]-1.);
     1405      avffactorphotons[i] = avffactorphotons[i] / numffactor[i];
     1406
     1407      if (avffactorphotvar[i] < 0.)
     1408        {
     1409          *fLog << warn << GetDescriptor() << ": No pixels with valid variance of total F-Factor found "
     1410                << "in area index: " << i << endl;
     1411          continue;
     1412        }
    13941413
    13951414      lowlim  [i] = 1.1;   // Lowest known F-Factor of a PMT
Note: See TracChangeset for help on using the changeset viewer.