Changeset 3182 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
02/16/04 11:12:04 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
2 edited

Legend:

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

    r3171 r3182  
    4949using namespace std;
    5050
    51 const UInt_t MExtractPINDiode::fgPINDiodeId      = 254;
     51const UInt_t MExtractPINDiode::fgPINDiodeIdx     = 999;
    5252const Byte_t MExtractPINDiode::fgSaturationLimit = 254;
    5353const Byte_t MExtractPINDiode::fgFirst =  1;
     
    6161    : fSaturationLimit(fgSaturationLimit)
    6262{
    63 
    64     fName  = name  ? name  : "MExtractPINDiode";
    65     fTitle = title ? title : "Task to extract the signal from the FADC slices";
    66 
    67     AddToBranchList("MRawEvtData.*");
    68 
    69     SetRange();
     63 
     64  fName  = name  ? name  : "MExtractPINDiode";
     65  fTitle = title ? title : "Task to extract the signal from the FADC slices";
     66 
     67  AddToBranchList("MRawEvtData.*");
     68 
     69  SetRange();
     70  SetPINDiodeIdx();
    7071}
    7172
     
    147148    fPINDiode->Clear();
    148149
    149     pixel.Jump(fgPINDiodeId);
     150    pixel.Jump(fPINDiodeIdx);
    150151 
    151152    UInt_t sum  = 0;
     
    161162               sum, sum2, sat, max);
    162163   
    163     const MPedestalPix &ped   = (*fPedestals)[fgPINDiodeId];
    164    
    165     const Float_t pedes  = ped.GetPedestal();
    166     const Float_t pedrms = ped.GetPedestalRms();
     164    const MPedestalPix &ped   = (*fPedestals)[fPINDiodeIdx];
     165
     166    Float_t pedes  = -999.;
     167    Float_t pedrms = -999.;
     168
     169    if (&ped)
     170      {
     171        pedes  = ped.GetPedestal();
     172        pedrms = ped.GetPedestalRms();
     173      }
     174    else
     175      {
     176        *fLog << warn << " Cannot find MPedestalPix of the PIN Diode (idx="
     177              << fPINDiodeIdx << ")" << endl;
     178
     179      }
    167180
    168181    const Float_t var = ((Float_t)sum2 - (Float_t)sum*sum/fNumSamples)/(fNumSamples-1);
  • trunk/MagicSoft/Mars/mcalib/MExtractPINDiode.h

    r3171 r3182  
    2424private:
    2525
    26   static const UInt_t fgPINDiodeId
     26  static const UInt_t fgPINDiodeIdx
    2727  static const Byte_t fgSaturationLimit;
    2828  static const Byte_t fgFirst;
     
    3838  Byte_t  fLast;
    3939  Byte_t  fNumSamples;
    40 
    4140  Float_t fSqrtSamples;
    42 
    4341  Byte_t  fSaturationLimit;
    44 
     42  UInt_t  fPINDiodeIdx;
     43 
    4544  void   FindSignal(Byte_t *ptr, Int_t size, UInt_t &sum, UInt_t &sum2, UInt_t &sat, UInt_t &max) const;
    4645 
     
    5251
    5352  MExtractPINDiode(const char *name=NULL, const char *title=NULL);
    54  
    55   void SetRange(Byte_t hifirst=fgFirst, Byte_t hilast=fgLast);
    56   void SetSaturationLimit(Byte_t lim) { fSaturationLimit = lim; }
     53
     54  // Setters
     55  void SetRange(const Byte_t hifirst=fgFirst, const Byte_t hilast=fgLast);
     56  void SetSaturationLimit(const Byte_t lim) { fSaturationLimit = lim; }
     57  void SetPINDiodeIdx(const UInt_t idx=fgPINDiodeIdx) { fPINDiodeIdx = idx; } 
    5758
    5859  ClassDef(MExtractPINDiode, 0) // Task to fill the Extracted PINDiode Containers from raw data
Note: See TracChangeset for help on using the changeset viewer.