Changeset 4399


Ignore:
Timestamp:
07/16/04 14:06:40 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r4398 r4399  
    2525  * msignal/MExtractFixedWindowSpline.cc
    2626    - replace the delete's by delete [].
     27
     28  * mcalib/MHCalibrationChargeCam.cc
     29    - remove some obsolete commented code
     30
     31  * mcalib/MHCalibrationChargeBlindPix.[h,cc]
     32    - derive only from MHGausEvents and not additionally from
     33      MHCalibrationChargePix
     34    - Additional setter for MCalibrationChargeBlindPix, used by
     35      MHCalibrationChargeBlindCam
     36    - Getter for fSinglePheCut
    2737
    2838
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeBlindPix.cc

    r4383 r4399  
    102102const Axis_t   MHCalibrationChargeBlindPix::fgChargeFirst        = -0.5;
    103103const Axis_t   MHCalibrationChargeBlindPix::fgChargeLast         = 255.5;
    104 const Float_t  MHCalibrationChargeBlindPix::fgSinglePheCut       =  60.;
     104const Float_t  MHCalibrationChargeBlindPix::fgSinglePheCut       =  30.;
    105105const Float_t  MHCalibrationChargeBlindPix::fgNumSinglePheLimit  =  50.;
    106106// --------------------------------------------------------------------------
     
    236236  if (fFitLegend)
    237237  {
    238       delete fFitLegend;
    239       fFitLegend = NULL;
     238    delete fFitLegend;
     239    fFitLegend = NULL;
    240240  }
    241241
     
    259259
    260260
    261   MHCalibrationChargePix::Clear();
     261  MHGausEvents::Clear();
    262262  return;
     263}
     264
     265// --------------------------------------------------------------------------
     266//
     267// Empty function to overload MHGausEvents::Reset()
     268//
     269void MHCalibrationChargeBlindPix::Reset()
     270{
    263271}
    264272
     
    329337// - MExtractedSignalBlindPixel
    330338//
     339Bool_t MHCalibrationChargeBlindPix::SetupFill(const MParList *pList)
     340{
     341
     342  fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData");
     343  if (!fRawEvt)
     344    {
     345      *fLog << err << "MRawEvtData not found... aborting." << endl;
     346      return kFALSE;
     347    }
     348 
     349  fSignal  = (MExtractedSignalBlindPixel*)pList->FindObject("MExtractedSignalBlindPixel");
     350  if (!fSignal)
     351    {
     352      *fLog << err << "MExtractedSignalBlindPixel not found... aborting " << endl;
     353      return kFALSE;
     354    }
     355 
     356  return kTRUE;
     357}
     358
     359// --------------------------------------------------------------------------
     360//
     361// Gets or creates the pointers to:
     362// - MCalibrationChargeBlindPix
     363//
    331364// Calls:
    332365// - MHGausHist::InitBins()
    333 //
    334 Bool_t MHCalibrationChargeBlindPix::SetupFill(const MParList *pList)
    335 {
    336 
    337   fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData");
    338   if (!fRawEvt)
    339     {
    340       *fLog << err << "MRawEvtData not found... aborting." << endl;
    341       return kFALSE;
    342     }
    343  
    344   fSignal  = (MExtractedSignalBlindPixel*)pList->FindObject("MExtractedSignalBlindPixel");
    345   if (!fSignal)
    346     {
    347       *fLog << err << "MExtractedSignalBlindPixel not found... aborting " << endl;
    348       return kFALSE;
    349     }
    350  
    351   return kTRUE;
    352 }
    353 
    354 // --------------------------------------------------------------------------
    355 //
    356 // Gets or creates the pointers to:
    357 // - MCalibrationChargeBlindPix
    358366//
    359367Bool_t MHCalibrationChargeBlindPix::ReInit(MParList *pList)
     
    364372      return kFALSE;
    365373
    366   /*
    367   fExtractor  = (MExtractBlindPixel*)pList->FindObject("MExtractBlindPixel");
    368   if (!fExtractor)
    369     {
    370       *fLog << err << "MExtractBlindPixel not found... aborting " << endl;
    371       return kFALSE;
    372     }
    373  
    374374  const Int_t samples = fSignal->GetNumFADCSamples();
    375   const Int_t integ   = fExtractor->IsExtractionType( MExtractBlindPixel::kIntegral );
     375  const Int_t integ   = fSignal->IsExtractionType( MExtractBlindPixel::kIntegral );
    376376
    377377  //
     
    380380  if ( fLast < samples*integ*fgChargeLast )
    381381    {
    382       SetLast        ( samples * 256. - 0.5    );
     382      SetLast        ( samples * (fgChargeLast+0.5) - 0.5 );
    383383      SetSinglePheCut( samples * fgSinglePheCut );
    384384    }
    385   */
    386   SetLast        ( 20.     * 256. - 0.5     );
     385
    387386  MHGausEvents::InitBins();
    388387 
     
    411410{
    412411
    413   const Int_t samples = (Int_t)fRawEvt->GetNumHiGainSamples()+(Int_t)fRawEvt->GetNumLoGainSamples();
     412  const Int_t samples = (Int_t)fRawEvt->GetNumHiGainSamples()
     413                      +(Int_t)fRawEvt->GetNumLoGainSamples();
    414414
    415415  if (!fASinglePheFADCSlices.IsValid())
     
    429429  if (slices == 0.)
    430430    {
    431       *fLog << err << "Number of used signal slices in MExtractedSignalBlindPix is zero  ... abort."
     431      *fLog << err
     432            << "Number of used signal slices in MExtractedSignalBlindPix "
     433            << "is zero  ... abort."
    432434            << endl;
    433435      return kFALSE;
     
    438440  //
    439441  const Float_t signal = fSignal->GetExtractedSignal(fPixId);
     442
    440443  if (signal > -0.5)
    441     FillHistAndArray(signal);
     444    FillHist(signal);
    442445  else
    443446    return kTRUE;
     
    475478  if (IsEmpty())
    476479  {
    477       *fLog << err << GetDescriptor() << ": My histogram has not been filled !! " << endl;
     480    *fLog << err << GetDescriptor() << " ID: " << fPixId
     481          << " My histogram has not been filled !! " << endl;
    478482      return kFALSE;
    479483  }
    480 
    481   CreateFourierSpectrum();
    482   fBlindPix->SetOscillating  ( !IsFourierSpectrumOK() );
    483484
    484485  fBlindPix->SetValid(kTRUE);
     
    10241025// The following options can be chosen:
    10251026//
    1026 // "": displays the fHGausHist, the legend and fASinglePheFADCSlices and fAPedestalFADCSlices
     1027// "": displays the fHGausHist, the fits, the legend and fASinglePheFADCSlices and fAPedestalFADCSlices
    10271028// "all": executes additionally MHGausEvents::Draw(), with option "fourierevents"
     1029// "datacheck" display the fHGausHist, the fits and the legend
    10281030//
    10291031void MHCalibrationChargeBlindPix::Draw(Option_t *opt)
     
    10381040  TVirtualPad *pad    = NULL;
    10391041
    1040   oldpad->SetBorderMode(0);
    1041    
    10421042  if (option.Contains("all"))
    10431043  {
     
    10511051      pad->cd(1);
    10521052  }
     1053  else if (option.Contains("datacheck"))
     1054    {
     1055      pad = oldpad;
     1056      pad->Divide(2,1);
     1057      pad->cd(1);
     1058    }
    10531059  else
    10541060  {
     
    10801086  }
    10811087
    1082 
    10831088  pad->cd(2);
    10841089  DrawLegend();
     1090
     1091  if (option.Contains("datacheck"))
     1092    return;
    10851093
    10861094  pad->cd(3);
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeBlindPix.h

    r4379 r4399  
    2424class MExtractBlindPixel;
    2525class MExtractedSignalBlindPixel;
    26 class MHCalibrationChargeBlindPix : public MHCalibrationChargePix
     26class MHCalibrationChargeBlindPix : public MHGausEvents
    2727{
    2828private:
     
    4343  MCalibrationChargeBlindPix *fBlindPix;     //! Storage container results 
    4444  MExtractedSignalBlindPixel *fSignal;       //! Storage container extracted signal
    45   MExtractBlindPixel         *fExtractor;    //! Extractor blind pixel
    4645  MRawEvtData                *fRawEvt;       //! Storage container raw data
    4746 
     
    7574                                     
    7675  Byte_t    fFlags;                          // Bit-field for the flags
    77   enum { kSinglePheFitOK, kPedestalFitOK };    // Possible bits to be set
     76  enum { kSinglePheFitOK, kPedestalFitOK };  // Possible bits to be set
    7877
    7978  TPaveText *fFitLegend;                     //! Some legend to display the fit results
     
    9594
    9695  void Clear(Option_t *o=""); 
     96  void Reset();
    9797 
    9898//  TObject *Clone(const char *) const;
     
    110110  const Double_t GetSigma0        ()  const { return fSigma0;         }
    111111  const Double_t GetSigma1        ()  const { return fSigma1;         }
    112                                                          
    113112  const Double_t GetLambdaErr     ()  const { return fLambdaErr;      }
    114113  const Double_t GetLambdaCheckErr()  const { return fLambdaCheckErr; }
     
    117116  const Double_t GetSigma0Err     ()  const { return fSigma0Err;      }
    118117  const Double_t GetSigma1Err     ()  const { return fSigma1Err;      }
    119 
     118  const Float_t  GetSinglePheCut  ()  const { return fSinglePheCut;   }
     119 
    120120  TVector &GetASinglePheFADCSlices()             { return fASinglePheFADCSlices;  }
    121121  const TVector &GetASinglePheFADCSlices() const { return fASinglePheFADCSlices;  }
     
    128128 
    129129  // Setters
    130   void SetSinglePheCut      ( const Float_t cut =fgSinglePheCut      )    { fSinglePheCut      = cut;      }
    131   void SetNumSinglePheLimit ( const Float_t lim =fgNumSinglePheLimit )    { fNumSinglePheLimit = lim;      }
     130  void SetCalibrationChargeBlindPix ( MCalibrationChargeBlindPix *pix)    { fBlindPix          = pix;  }
     131  void SetSinglePheCut      ( const Float_t cut =fgSinglePheCut      )    { fSinglePheCut      = cut;  }
     132  void SetNumSinglePheLimit ( const Float_t lim =fgNumSinglePheLimit )    { fNumSinglePheLimit = lim;  }
    132133
    133134  void SetMeanPedestal      ( const Float_t f )   { fMeanPedestal     = f;  }
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc

    r4389 r4399  
    865865    }
    866866
     867  //
     868  // From here on , the datacheck - Draw
     869  //
    867870  TVirtualPad *pad = gPad ? gPad : MH::MakeDefCanvas(this); 
    868871  pad->SetBorderMode(0);
     
    924927
    925928  for (int i=0; i<navhi; i++)
    926     {
    927       //      delete (*cam->fAverageHiGainAreas)[i];
    928       (*cam->fAverageHiGainAreas)[i] = (*fAverageHiGainAreas)[i]->Clone();
    929     }
     929    (*cam->fAverageHiGainAreas)[i] = (*fAverageHiGainAreas)[i]->Clone();
    930930  for (int i=0; i<navlo; i++)
    931     {
    932       //      delete (*cam->fAverageLoGainAreas)[i];
    933       (*cam->fAverageLoGainAreas)[i] = (*fAverageLoGainAreas)[i]->Clone();
    934     }
     931    (*cam->fAverageLoGainAreas)[i] = (*fAverageLoGainAreas)[i]->Clone();
    935932  for (int i=0; i<nsehi; i++)
    936     {
    937       //      delete (*cam->fAverageHiGainSectors)[i];
    938       (*cam->fAverageHiGainSectors)[i] = (*fAverageHiGainSectors)[i]->Clone();
    939     }
     933    (*cam->fAverageHiGainSectors)[i] = (*fAverageHiGainSectors)[i]->Clone();
    940934  for (int i=0; i<nselo; i++)
    941     {
    942       //      delete (*cam->fAverageLoGainSectors)[i];
    943       (*cam->fAverageLoGainSectors)[i] = (*fAverageLoGainSectors)[i]->Clone();
    944     }
     935    (*cam->fAverageLoGainSectors)[i] = (*fAverageLoGainSectors)[i]->Clone();
    945936
    946937  cam->fAverageAreaNum         = fAverageAreaNum;
  • trunk/MagicSoft/Mars/mcalib/MHGausEvents.cc

    r4382 r4399  
    529529    }
    530530 
    531   pad->SetTicks();
    532531  pad->SetBorderMode(0);
    533532  pad->Divide(1,win);
     
    536535  if (!IsEmpty())
    537536    gPad->SetLogy();
     537
     538  gPad->SetTicks();
    538539
    539540  fHGausHist.Draw(opt);
  • trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.cc

    r4388 r4399  
    7979const Byte_t  MExtractBlindPixel::fgLast             =   7;
    8080const Byte_t  MExtractBlindPixel::fgHiGainFirst      =  10;
    81 const Byte_t  MExtractBlindPixel::fgHiGainLast       =  29;
     81const Byte_t  MExtractBlindPixel::fgHiGainLast       =  19;
    8282const Byte_t  MExtractBlindPixel::fgLoGainFirst      =   0;
    8383const Byte_t  MExtractBlindPixel::fgLoGainLast       =   7;
     
    649649        }
    650650    }
     651
    651652}
    652653
Note: See TracChangeset for help on using the changeset viewer.