Changeset 5679


Ignore:
Timestamp:
12/22/04 20:13:41 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r5678 r5679  
    2727      - added some new Getter-functions for the calibration conf.
    2828        pattern
     29    * mcalib/MCalibrationChargeCalc.[h,cc]
     30    * mcalib/MCalibrationRelTimeCalc.[h,cc]
     31    * mcalib/MCalibrationColorSteer.cc
     32      - use the new functions
     33
    2934
    3035 2004/12/22 Eva Domingo
  • trunk/MagicSoft/Mars/mcalib/MCalibColorSteer.cc

    r5481 r5679  
    5151
    5252#include "MHCalibrationCam.h"
     53#include "MCalibrationCam.h"
     54#include "MCalibrationBlindCam.h"
    5355
    5456#include "MCalibrationIntensityChargeCam.h"
     
    7880    : fHeader(NULL), fGeom(NULL), fParList(NULL),
    7981      fIntensCharge(NULL), fIntensRelTime(NULL), fIntensBad(NULL),
    80       fChargeCalc(NULL), fRelTimeCalc(NULL),
    81       fPattern(0)
     82      fBad(NULL), fChargeCalc(NULL), fRelTimeCalc(NULL), fPattern(0)
    8283{
    8384
     
    135136  //
    136137  fIntensBad = (MBadPixelsIntensityCam*)pList->FindCreateObj("MBadPixelsIntensityCam");
    137 
    138   *fLog << inf << "Found MBadPixelsIntensityCam ... " << flush;
     138  if (fIntensBad)
     139    *fLog << inf << "Found MBadPixelsIntensityCam ... " << flush;
     140  else
     141    return kFALSE;
     142 
     143  //
     144  // Look for the MBadPixels Intensity Cam
     145  //
     146  fBad = (MBadPixelsCam*)pList->FindObject("MBadPixelsCam");
     147  if (fBad)
     148    {
     149      *fLog << inf << "Found also MBadPixelsCam ... " << flush;
     150      fIntensBad->GetCam()->Merge(*fBad);
     151    }
     152  else
     153    return kFALSE;
     154 
    139155  //
    140156  // Look for the MCalibrationIntensityBlindCam
     
    142158  fIntensBlind = (MCalibrationIntensityBlindCam*)pList->FindCreateObj("MCalibrationIntensityBlindCam");
    143159
    144   *fLog << inf << "Found MCalibrationIntensityBlindCam ... " << flush;
    145 
     160  if (fIntensBlind)
     161    *fLog << inf << "Found MCalibrationIntensityBlindCam ... " << flush;
     162  else
     163    return kFALSE;
     164 
    146165  //
    147166  // Look for the MFillH name "FillChargeCam". In case yes, initialize the
     
    208227//
    209228// Reads the pattern from MRawEvtHeader and initializes new containers in the
    210 // Intensity Cams, if the pattern has changed. Executes CallPostProcess of the
     229// Intensity Cams, if the pattern has changed. Executes Finalize of the
    211230// MCalibration*Calc classes in that case.
    212231//
     
    214233{
    215234
    216   const UInt_t pattern = fHeader->GetCalibrationPattern();
    217 
    218   if (pattern == fPattern)
    219     return kTRUE;
     235  const UInt_t pattern = fHeader->GetPulserSlotPattern();
    220236
    221237  if (fPattern == 0)
     
    225241    }
    226242
     243  if (pattern == 0 || pattern == fPattern)
     244    return kTRUE;
     245
     246  *fLog << inf << GetDescriptor() << " : old pattern: " << fPattern << flush;
     247
    227248  fPattern = pattern;
    228249 
     250  *fLog << " : new pattern: " << pattern << flush;
     251
    229252  //
    230253  // Finalize Possible calibration histogram classes...
     
    243266  *fLog << inf << GetDescriptor() << " : Finalize calibration calculations..." << flush;
    244267  if (fChargeCalc)
    245     fChargeCalc->CallPostProcess();
     268    fChargeCalc->Finalize();
    246269  if (fRelTimeCalc)
    247     fRelTimeCalc->CallPostProcess();
     270    fRelTimeCalc->Finalize();
    248271
    249272  ReInitialize();
     
    267290      hist->Finalize();
    268291      hist->ResetHists();
     292      hist->SetColor( fHeader->GetPulserColor());
    269293      return kTRUE;
    270294    }
     
    284308
    285309  *fLog << endl;
    286  
     310
     311  TString namep = GetNamePattern();
     312
    287313  if (fIntensBad)
    288314    {
    289       fIntensBad->AddToList(Form("MBadPixelsCam%s",GetNamePattern()),*fGeom);
    290       *fLog << inf << "New MBadPixelsCam with " << GetNamePattern() << endl;
     315      fIntensBad->AddToList(Form("MBadPixelsCam%s",namep.Data()),*fGeom);
     316      *fLog << inf << "New MBadPixelsCam with " << namep << endl;
     317      fIntensBad->GetCam()->Merge(*fBad);
     318      *fLog << inf << "Merged new MBadPixelsCam with first of list" << endl;
    291319    }
    292320  if (fIntensCharge)
    293321    {
    294       fIntensCharge->AddToList(Form("MCalibrationChargeCam%s",GetNamePattern()),*fGeom);
    295       *fLog << inf << "New MCalibrationChargeCam with " << GetNamePattern() << endl;
     322      fIntensCharge->AddToList(Form("MCalibrationChargeCam%s",namep.Data()),*fGeom);
     323      MCalibrationCam *cam = fIntensCharge->GetCam();
     324      cam->SetPulserColor(fHeader->GetPulserColor());
     325      *fLog << inf << "New MCalibrationChargeCam with name: " << cam->GetName() << endl;
    296326    }
    297327  if (fIntensQE)
    298328    {
    299       fIntensQE->AddToList(Form("MCalibrationQECam%s",GetNamePattern()),*fGeom);
    300       *fLog << inf << "New MCalibrationQECam with " << GetNamePattern() << endl;
    301     }
     329      fIntensQE->AddToList(Form("MCalibrationQECam%s",namep.Data()),*fGeom);
     330      *fLog << inf << "New MCalibrationQECam with: " << namep << endl;
     331    }
     332
    302333  if (fIntensBlind)
    303334    {
    304       fIntensBlind->AddToList(Form("MCalibrationBlindCam%s",GetNamePattern()),*fGeom);
    305       *fLog << inf << "New MCalibrationBlindCam with " << GetNamePattern() << endl;
     335      fIntensBlind->AddToList(Form("MCalibrationBlindCam%s",namep.Data()),*fGeom);
     336      MCalibrationCam *cam = fIntensBlind->GetCam();
     337      cam->SetPulserColor(fHeader->GetPulserColor());
     338      *fLog << inf << "New MCalibrationBlindCam with name: " << cam->GetName() << endl;
     339    }
     340
     341  if (fIntensRelTime)
     342    {
     343      fIntensRelTime->AddToList(Form("MCalibrationRelTimeCam%s",namep.Data()),*fGeom);
     344      MCalibrationCam *cam = fIntensRelTime->GetCam();
     345      cam->SetPulserColor(fHeader->GetPulserColor());
     346      *fLog << inf << "New MCalibrationRelTimeCam with name: " << cam->GetName() << endl;
    306347    }
    307348
     
    310351}
    311352
    312 const char* MCalibColorSteer::GetNamePattern()
    313 {
    314 
    315   Float_t number[MCalibrationCam::gkNumPulserColors];
    316   memset(number,0,MCalibrationCam::gkNumPulserColors*sizeof(Float_t));
    317 
    318   enum ColorCode_t
    319     {
    320       k5LedGreen   = BIT(0 ),
    321       k2LedGreen   = BIT(1 ),
    322       k5LedBlue2   = BIT(2 ),     
    323       k1LedUV      = BIT(3 ),
    324       k2LedUV      = BIT(4 ),
    325       k5LedBlue3   = BIT(5 ),
    326       k5LedBlue4   = BIT(6 ),
    327       k2LedBlue    = BIT(7 ),
    328       k01LedBlue   = BIT(8 ),
    329       k1LedBlue    = BIT(10),
    330       k5LedUV1     = BIT(11),
    331       k5LedUV2     = BIT(12),
    332       k5LedBlue1   = BIT(13),
    333       k1LedGreen   = BIT(14),
    334       k01LedGreen  = BIT(15),
    335       kCT1Pulser   = BIT(16)
    336     };
    337 
    338   if (fPattern & k5LedGreen)
    339     number[MCalibrationCam::kGREEN] += 5;
    340   if (fPattern & k2LedGreen)
    341     number[MCalibrationCam::kGREEN] += 2;
    342   if (fPattern & k5LedBlue2)
    343     number[MCalibrationCam::kBLUE]  += 2;
    344   if (fPattern & k1LedUV)           
    345     number[MCalibrationCam::kUV]    += 1;
    346   if (fPattern & k2LedUV)           
    347     number[MCalibrationCam::kUV]    += 2;
    348   if (fPattern & k5LedBlue3)       
    349     number[MCalibrationCam::kBLUE]  += 5;
    350   if (fPattern & k5LedBlue4)       
    351     number[MCalibrationCam::kBLUE]  += 5;
    352   if (fPattern & k2LedBlue)         
    353     number[MCalibrationCam::kBLUE]  += 2;
    354   if (fPattern & k01LedBlue)       
    355     number[MCalibrationCam::kBLUE]  += 0.5;
    356   if (fPattern & k1LedBlue)         
    357     number[MCalibrationCam::kBLUE]  += 1;
    358   if (fPattern & k5LedUV1)         
    359     number[MCalibrationCam::kUV]    += 5;
    360   if (fPattern & k5LedUV2)       
    361     number[MCalibrationCam::kUV]    += 5;
    362   if (fPattern & k5LedBlue1)       
    363     number[MCalibrationCam::kBLUE]  += 5;
    364   if (fPattern & k1LedGreen)
    365     number[MCalibrationCam::kGREEN] += 1;
    366   if (fPattern & k01LedGreen)
    367     number[MCalibrationCam::kGREEN] += 0.5;
    368   if (fPattern & kCT1Pulser)
    369     number[MCalibrationCam::kCT1]   += 1;
    370 
    371   TString result;
    372  
    373   for (Int_t i=0; i<MCalibrationCam::gkNumPulserColors; i++)
    374     {
    375       switch (i)
    376         {
    377         case MCalibrationCam::kGREEN:
    378           if (number[i] > 0.1)
    379             result = Form("%2.1f%s",number[i],"GREEN");
    380           break;
    381         case MCalibrationCam::kBLUE:
    382           if (number[i] > 0.1)
    383             result = Form("%2.1f%s",number[i],"BLUE");
    384           break;
    385         case MCalibrationCam::kUV:
    386           if (number[i] > 0.1)
    387             result = Form("%2.1f%s",number[i],"UV");
    388           break;
    389         case MCalibrationCam::kCT1:
    390           if (number[i] > 0.1)
    391             result = Form("%2.1f%s",number[i],"CT1");
    392           break;
    393         }
    394     }
    395   return result.Data();
    396 }
     353TString MCalibColorSteer::GetNamePattern()
     354{
     355
     356  const Float_t strength = fHeader->GetPulserStrength();
     357  const MCalibrationCam::PulserColor_t col = fHeader->GetPulserColor();
     358
     359  TString result = Form("%2.1f",strength);
     360 
     361  switch (col)
     362    {
     363    case MCalibrationCam::kCT1:
     364      result += "CT1";
     365      break;
     366    case MCalibrationCam::kGREEN:
     367      result += "GREEN";
     368      break;
     369    case MCalibrationCam::kBLUE:
     370      result += "BLUE";
     371      break;
     372    case MCalibrationCam::kUV:
     373      result += "UV";
     374      break;
     375    default:
     376      break;
     377    }
     378  return result;
     379}
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r5563 r5679  
    239239const Float_t MCalibrationChargeCalc::fgFFactorErrLimit        = 4.5;
    240240const TString MCalibrationChargeCalc::fgNamePedestalCam = "MPedestalCam";
    241 
    242241// --------------------------------------------------------------------------
    243242//
     
    324323    fNumInnerFFactorMethodUsed = 0;
    325324
     325    fNumProcessed              = 0;
     326
    326327    fIntensBad   = NULL;
    327328    fBadPixels   = NULL;
     
    337338    fPedestals   = NULL;
    338339
    339     fPulserPattern = 0;
    340340    SetPulserColor ( MCalibrationCam::kNONE );
    341341   
     
    355355Int_t MCalibrationChargeCalc::PreProcess(MParList *pList)
    356356{
    357     fHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader");
    358     if (!fHeader)
    359     {
    360         *fLog << err << "MRawEvtHeader not found... abort." << endl;
    361         return kFALSE;
    362     }
    363 
    364     fSignal = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam");
    365     if (!fSignal)
    366     {
    367         *fLog << err << "MExtractedSignalCam not found... aborting" << endl;
    368         return kFALSE;
    369     }
    370 
    371     if (fPedestals)
    372         return kTRUE;
    373 
    374     fPedestals = (MPedestalCam*)pList->FindObject(AddSerialNumber(fNamePedestalCam), "MPedestalCam");
    375     if (!fPedestals)
    376     {
    377         *fLog << err << fNamePedestalCam << " not found... aborting" << endl;
    378         return kFALSE;
    379     }
    380 
     357 
     358  fHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader");
     359  if (!fHeader)
     360    {
     361      *fLog << err << "MRawEvtHeader not found... abort." << endl;
     362      return kFALSE;
     363    }
     364
     365  //
     366  // Containers that have to be there.
     367  //
     368  fSignal = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam");
     369  if (!fSignal)
     370    {
     371      *fLog << err << "MExtractedSignalCam not found... aborting" << endl;
     372      return kFALSE;
     373    }
     374
     375  if (fPedestals)
    381376    return kTRUE;
     377
     378  fPedestals = (MPedestalCam*)pList->FindObject(AddSerialNumber(fNamePedestalCam), "MPedestalCam");
     379  if (!fPedestals)
     380    {
     381      *fLog << err << GetDescriptor() << fNamePedestalCam << " not found... aborting" << endl;
     382      return kFALSE;
     383    }
     384
     385  return kTRUE;
    382386}
    383387
     
    509513    }
    510514 
    511   fNumHiGainSamples  =  fSignal->GetNumUsedHiGainFADCSlices();
    512   fNumLoGainSamples  =  fSignal->GetNumUsedLoGainFADCSlices();
    513 
    514   fSqrtHiGainSamples =  TMath::Sqrt(fNumHiGainSamples);
    515   fSqrtLoGainSamples =  TMath::Sqrt(fNumLoGainSamples);
    516  
    517 
    518515  MCalibrationQECam     *qecam     = fIntensQE     
    519516    ? (MCalibrationQECam*)    fIntensQE->GetCam()   : fQECam;
     
    532529      MBadPixelsPix         &bad = (*badcam)   [i];
    533530     
    534       pix.SetPixId(i);
    535       pqe.SetPixId(i);
    536      
    537531      if (bad.IsBad())
    538532        {
     
    556550{
    557551
    558   const UInt_t pattern = fHeader->GetCalibrationPattern();
    559 
    560   if (pattern == fPulserPattern)
     552  const MCalibrationCam::PulserColor_t col = fHeader->GetPulserColor();
     553
     554  if (col == fPulserColor)
     555    {
     556      fNumProcessed++;
     557      return kTRUE;
     558    }
     559 
     560  if (col == MCalibrationCam::kNONE)
    561561    return kTRUE;
    562 
    563   enum ColorCode_t
    564     {
    565       kSlot1Green     = BIT(0),
    566       kSlot2Green     = BIT(1),
    567       kSlot3Blue      = BIT(2),
    568       kSlot4UV        = BIT(3),
    569       kSlot5UV        = BIT(4),
    570       kSlot6Blue      = BIT(5),
    571       kSlot7Blue      = BIT(6),
    572       kSlot8Blue      = BIT(7),
    573       kSlot9AttBlue   = BIT(8),
    574       kSlot10Blue     = BIT(9),
    575       kSlot11Blue     = BIT(10),
    576       kSlot12UV       = BIT(11),
    577       kSlot13UV       = BIT(12),
    578       kSlot14Blue     = BIT(13),
    579       kSlot15Green    = BIT(14),
    580       kSlot16AttGreen = BIT(15),
    581       kCT1Pulser      = BIT(16),
    582       kAnyGreen       = kSlot1Green  | kSlot2Green | kSlot15Green | kSlot16AttGreen,
    583       kAnyUV          = kSlot4UV     | kSlot5UV    | kSlot12UV    | kSlot13UV,
    584       kAnyBlue        = kSlot3Blue   | kSlot6Blue  | kSlot7Blue   | kSlot8Blue
    585                       | kSlot9AttBlue| kSlot10Blue | kSlot11Blue  | kSlot14Blue
    586     };
    587 
    588   //
    589   // The pattern has changed, we have to initialize everything new!!!
    590   //
    591   *fLog << inf << GetDescriptor() << "- New pulser pattern: " ;
    592   for (Int_t i=16; i>= 0; i--)
    593     *fLog << (pattern >> i & 1);
    594   *fLog  << endl;
     562 
    595563  //
    596564  // Now retrieve the colour and check if not various colours have been used
    597565  //
    598   if ((pattern & kAnyBlue   ||
    599        pattern & kAnyUV    ||
    600        pattern & kAnyGreen ||
    601        pattern & kCT1Pulser) && fPulserColor != MCalibrationCam::kNONE)
    602   {
    603       *fLog << err << "Multiple colours used simultaneously in calibration file. Will reset histograms "
    604             << " and merge the MCalibrationQECam!" << endl;
    605       fHCam->Finalize();
    606       fHBlindCam->Finalize();
    607       fHCam->ResetHists();
    608       fHBlindCam->ResetHists();
    609       CallPostProcess();
    610   }
    611 
    612   fPulserColor   = MCalibrationCam::kNONE;
    613   fPulserPattern = pattern;
    614  
    615   if (fPulserPattern & kAnyGreen)
    616     fPulserColor = MCalibrationCam::kGREEN;
    617   if (fPulserPattern & kAnyBlue)
    618     fPulserColor = MCalibrationCam::kBLUE;
    619   if (fPulserPattern & kAnyUV)
    620     fPulserColor = MCalibrationCam::kUV;
    621   if (fPulserPattern & kCT1Pulser)
    622           fPulserColor = MCalibrationCam::kCT1;
     566  if (!fIntensCam)
     567    {
     568      if (fPulserColor != MCalibrationCam::kNONE)
     569        {
     570          *fLog << err << "Multiple colours used simultaneously in calibration file. Will reset histograms "
     571                << " and merge the MCalibrationQECam!" << endl;
     572          fHCam->Finalize();
     573          fHBlindCam->Finalize();
     574          fHCam->ResetHists();
     575          fHBlindCam->ResetHists();
     576          Finalize();
     577        }
     578    }
     579 
     580  fPulserColor = col;
    623581
    624582  *fLog << inf << "Found new colour ... " << flush;
    625583 
    626   switch (fPulserColor)
    627     {
    628     case MCalibrationCam::kGREEN: *fLog << "Green.";  break;
    629     case MCalibrationCam::kBLUE:  *fLog << "Blue.";   break;
    630     case MCalibrationCam::kUV:    *fLog << "UV.";     break;
    631     case MCalibrationCam::kCT1:   *fLog << "CT1.";    break;
     584  switch (col)
     585    {
     586    case MCalibrationCam::kGREEN: *fLog << "Green";  break;
     587    case MCalibrationCam::kBLUE:  *fLog << "Blue";   break;
     588    case MCalibrationCam::kUV:    *fLog << "UV";     break;
     589    case MCalibrationCam::kCT1:   *fLog << "CT1";    break;
    632590    default: break;
    633591    }
    634   *fLog << endl;
    635  
    636   MCalibrationBlindCam     *blindcam  = fIntensBlind     
    637     ? (MCalibrationBlindCam*) fIntensBlind->GetCam()   : fBlindCam;
    638   MCalibrationChargeCam *chargecam = fIntensCam
    639     ? (MCalibrationChargeCam*)fIntensCam->GetCam()  : fCam;
    640 
    641   //
    642   // Initialize the pulser colours
    643   //
    644   chargecam ->SetPulserColor( fPulserColor );
    645   blindcam  ->SetPulserColor( fPulserColor );
    646   fHCam     ->SetColor      ( fPulserColor );
    647   fHBlindCam->SetColor      ( fPulserColor );
    648 
     592
     593  *fLog << inf << " with strength: " << fHeader->GetPulserStrength() << endl;
     594 
    649595  if (fPINDiode)
    650596    fPINDiode->SetColor( fPulserColor );
    651 
     597 
     598  fNumProcessed = 0;
     599 
    652600  return kTRUE;
    653601}
     
    655603// -----------------------------------------------------------------------
    656604//
    657 // Analogue to the MTask::CallPostProcess, but without the manipulation
    658 // of the bit fIsPreProcessed. Needed in order to call PostProcess multiple
    659 // times in the intensity calibration.
    660 //
    661 Int_t MCalibrationChargeCalc::CallPostProcess()
     605// Return if number of executions is null.
     606//
     607Int_t MCalibrationChargeCalc::PostProcess()
    662608{
    663609
    664   //  if (!fIsPreprocessed)
    665   //    return kTRUE;
    666 
    667   *fLog << all << fName << "... " << flush;
    668   if (fDisplay)
    669     fDisplay->SetStatusLine2(*this);
    670  
    671   return PostProcess();
     610  if (GetNumExecutions()==0)
     611    return kFALSE;
     612
     613  if (fPulserColor == MCalibrationCam::kNONE)
     614    return kTRUE;
     615 
     616  if (fNumProcessed == 0)
     617    return kTRUE;
     618
     619  *fLog << endl;
     620
     621  return Finalize();
    672622}
    673623
    674624// -----------------------------------------------------------------------
    675625//
    676 // Return if number of executions is null.
    677 //
    678 // First loop over pixels, average areas and sectors, call: 
     626// Return kTRUE if fPulserColor is kNONE
     627//
     628// First loop over pixels, average areas and sectors, call:
    679629//  - FinalizePedestals()
    680630//  - FinalizeCharges()
     
    700650// Print out some statistics
    701651//
    702 Int_t MCalibrationChargeCalc::PostProcess()
     652Int_t MCalibrationChargeCalc::Finalize()
    703653{
    704   if (GetNumExecutions()==0)
    705     return kFALSE;
    706 
     654 
     655  fNumHiGainSamples  =  fSignal->GetNumUsedHiGainFADCSlices();
     656  fNumLoGainSamples  =  fSignal->GetNumUsedLoGainFADCSlices();
     657
     658  fSqrtHiGainSamples =  TMath::Sqrt(fNumHiGainSamples);
     659  fSqrtLoGainSamples =  TMath::Sqrt(fNumLoGainSamples);
     660 
    707661  if (fPINDiode)
    708662    if (!fPINDiode->IsValid())
    709663      {
    710         *fLog << warn << "MCalibrationChargePINDiode is declared not valid... no PIN Diode method! " << endl;
     664        *fLog << warn << GetDescriptor()
     665              << ": MCalibrationChargePINDiode is declared not valid... no PIN Diode method! " << endl;
    711666        fPINDiode = NULL;
    712667      }
     
    753708  if (nvalid == 0)
    754709  {
    755       *fLog << err << "All pixels have non-valid calibration. "
     710      *fLog << err << GetDescriptor() << ": All pixels have non-valid calibration. "
    756711            << "Did you forget to fill the histograms "
    757712            << "(filling MHCalibrationChargeCam from MExtractedSignalCam using MFillH) ? " << endl;
    758       *fLog << err << "Or, maybe, you have used a pedestal run "
     713      *fLog << err << GetDescriptor() << ": Or, maybe, you have used a pedestal run "
    759714            << "instead of a calibration run " << endl;
    760715      return kFALSE;
     
    770725      FinalizeCharges(pix,
    771726                      fIntensCam ? fIntensCam->GetAverageBadArea(aidx) : fCam->GetAverageBadArea(aidx),
    772                       "area idx");
     727                      "area id");
    773728    }
    774729 
     
    922877                      prms    * fSqrtLoGainSamples,
    923878                      prmserr * fSqrtLoGainSamples);
    924       cal.CalcLoGainPedestal((Float_t)fNumLoGainSamples);
     879      cal.CalcLoGainPedestal(fNumLoGainSamples);
    925880    }
    926881  else
     
    1006961    }
    1007962
     963  if (cal.GetPheFFactorMethod() < 0.)
     964    {
     965      bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes);
     966      bad.SetUnsuitable(MBadPixelsPix::kUnsuitableRun);
     967      cal.SetFFactorMethodValid(kFALSE);
     968      return kFALSE;
     969    }
     970
    1008971  if (!cal.CalcConvFFactor())
    1009972    {
     
    12461209        }
    12471210     
     1211      if (mean < 0.)
     1212        {
     1213          *fLog << inf << GetDescriptor() << ": Fitted mean number of photo-electrons "
     1214                << "with area idx " << i << ": " << mean << " is smaller than 0. " << endl;
     1215          *fLog << warn << GetDescriptor() << ": Will use the simple mean and rms " << endl;         
     1216          delete hist;
     1217          continue;
     1218        }
     1219     
    12481220      *fLog << inf << GetDescriptor() << ": Mean number of photo-electrons "
    12491221            << "with area idx " << i << ": "
     
    13501322      *fLog << inf << GetDescriptor()
    13511323            << ": Average total number phes in area idx " << aidx << ": "
    1352             << Form("%7.2f%s%6.2f",areaphes[aidx]," +- ",TMath::Sqrt(areaweights[aidx])) << endl;
     1324            << Form("%7.2f +- 6.2f",areaphes[aidx],TMath::Sqrt(areaweights[aidx])) << endl;
    13531325                   
    13541326      apix.SetPheFFactorMethod   ( areaphes[aidx] );
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h

    r5552 r5679  
    7474
    7575  MCalibrationCam::PulserColor_t fPulserColor; // Calibration LEDs colour
    76   UInt_t  fPulserPattern;                      // Calibration LEDs Pulser Pattern
    7776
    7877  Int_t   fNumInnerFFactorMethodUsed;          // Number of inner pixels used for F-Factor Method calibration
     
    8685  TString fOutputFile;                         // Name of the output file 
    8786  TString fNamePedestalCam;                    // Name of the 'MPedestalCam' container
     87
     88  Int_t   fNumProcessed;                       // Number of processed events (for Intensity calibration)
    8889 
    8990  // Pointers
     
    169170  MCalibrationChargeCalc(const char *name=NULL, const char *title=NULL);
    170171
    171   Int_t CallPostProcess();
    172 
    173172  void Clear(const Option_t *o="");
     173
     174  Int_t Finalize();
    174175
    175176  Bool_t IsDebug() const   {  return TESTBIT(fFlags,kDebug); }
     
    195196    b ? SETBIT(fCheckFlags,kCheckOscillations)
    196197      : CLRBIT(fCheckFlags,kCheckOscillations); }
    197 
    198   void SetDebug             ( const Bool_t  b=kTRUE                    ) { b ? SETBIT(fFlags, kDebug) : CLRBIT(fFlags, kDebug); }
     198  void SetDebug            ( const Bool_t b=kTRUE ) {
     199    b ? SETBIT(fFlags, kDebug)
     200      : CLRBIT(fFlags, kDebug); }
    199201
    200202  void SetPedestals(MPedestalCam *cam) { fPedestals=cam; }
  • trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.cc

    r5413 r5679  
    187187      MBadPixelsPix          &bad =                          (*badcam)[i];
    188188     
    189       pix.SetPixId(i);
    190      
    191189      if (bad.IsBad())
    192190        {
     
    204202// -----------------------------------------------------------------------
    205203//
    206 // Analogue to the MTask::CallPostProcess, but without the manipulation
    207 // of the bit fIsPreProcessed. Needed in order to call PostProcess multiple
    208 // times in the intensity calibration.
    209 //
    210 Int_t MCalibrationRelTimeCalc::CallPostProcess()
    211 {
    212 
    213   //  if (!fIsPreprocessed)
    214   //    return kTRUE;
    215 
    216   *fLog << all << fName << "... " << flush;
    217   if (fDisplay)
    218     fDisplay->SetStatusLine2(*this);
    219  
    220   return PostProcess();
    221 }
    222 
     204// Return if number of executions is null.
     205//
     206Int_t MCalibrationRelTimeCalc::PostProcess()
     207{
     208
     209  if (GetNumExecutions()==0)
     210    return kFALSE;
     211
     212  return Finalize();
     213}
    223214
    224215// -----------------------------------------------------------------------
    225 //
    226 // Return if number of executions is null.
    227216//
    228217// First loop over pixels, average areas and sectors, call:
     
    237226// Print out some statistics
    238227//
    239 Int_t MCalibrationRelTimeCalc::PostProcess()
    240 {
    241 
    242   if (GetNumExecutions()==0)
    243     return kFALSE;
    244 
     228Int_t MCalibrationRelTimeCalc::Finalize()
     229{
     230 
    245231  //
    246232  // First loop over pixels, call FinalizePedestals and FinalizeRelTimes
  • trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.h

    r5133 r5679  
    6464  MCalibrationRelTimeCalc(const char *name=NULL, const char *title=NULL);
    6565
    66   Int_t CallPostProcess();
     66  void Clear(const Option_t *o="");
    6767 
    68   void Clear(const Option_t *o="");
     68  Int_t Finalize();
    6969 
    7070  Bool_t IsDebug() const  {  return TESTBIT(fFlags,kDebug); }
Note: See TracChangeset for help on using the changeset viewer.