Changeset 6321


Ignore:
Timestamp:
02/09/05 21:30:26 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6320 r6321  
    5353   * mcalib/MCalibrationQECamMagic.cc
    5454     - updated five pixels
     55
     56   * mpedestal/MExtractPedestal.[h,cc]
     57     - included possibility for intermediate pedestal cam (not yet used)
    5558
    5659
  • trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc

    r5832 r6321  
    189189//
    190190MExtractPedestal::MExtractPedestal(const char *name, const char *title)
    191     : fRandomCalculation(kTRUE), fGeom(NULL), fPedestalsIn(NULL), fPedestalsOut(NULL),
     191    : fGeom(NULL), fPedestalsIn(NULL), fPedestalsInter(NULL), fPedestalsOut(NULL),
    192192      fExtractor(NULL), fExtractWinFirst(0), fExtractWinSize(0)
    193193{
     
    199199    AddToBranchList("fHiGainFadcSamples");
    200200    AddToBranchList("fLoGainFadcSamples");
    201 
    202     SetPedestalUpdate(kTRUE);
     201 
     202    SetIntermediateStorage( kFALSE );
     203    SetPedestalUpdate     ( kTRUE  );
     204    SetRandomCalculation  ( kTRUE  );
    203205
    204206    SetNamePedestalCamIn();
     
    239241// - fRunHeader to NULL
    240242// - fEvtHeader to NULL
    241 // - fPedestalsIn to NULL
    242 // - fPedestalsOut to NULL
    243243//
    244244void MExtractPedestal::Clear(const Option_t *o)
     
    347347          return kFALSE;
    348348      }
     349  }
     350
     351  if (!fPedestalsInter && fIntermediateStorage)
     352  {
     353      fPedestalsInter = (MPedestalCam*)pList->FindCreateObj("MPedestalCam", AddSerialNumber(fNamePedestalCamInter));
     354      if (!fPedestalsInter)
     355          return kFALSE;
    349356  }
    350357
     
    447454Int_t MExtractPedestal::PostProcess()
    448455{
    449     fPedestalsIn = NULL;
    450     return kTRUE;
     456  fPedestalsIn = NULL;
     457  return kTRUE;
    451458}
    452459
     
    493500    }
    494501
     502    if (IsEnvDefined(env, prefix, "IntermediateStorage", print))
     503    {
     504        SetIntermediateStorage(GetEnvValue(env, prefix, "IntermediateStorage", fIntermediateStorage));
     505        rc = kTRUE;
     506    }
     507
    495508    // find resource for random calculation
    496509    if (IsEnvDefined(env, prefix, "RandomCalculation", print))
     
    523536    }
    524537
     538    if (IsEnvDefined(env, prefix, "NamePedestalCamInter", print))
     539    {
     540        SetNamePedestalCamInter(GetEnvValue(env, prefix, "NamePedestalCamInter", fNamePedestalCamInter));
     541        rc = kTRUE;
     542    }
     543
    525544    if (IsEnvDefined(env, prefix, "NamePedestalCamOut", print))
    526545    {
     
    651670    *fLog << GetDescriptor() << ":" << endl;
    652671    *fLog << "Name of input  MPedestalCam:  " << (fPedestalsIn?fPedestalsIn->GetName():fNamePedestalCamIn.Data()) << " (" << fPedestalsIn << ")" << endl;
     672    *fLog << "Name of interm. MPedestalCam: " << (fPedestalsInter?fPedestalsInter->GetName():fNamePedestalCamInter.Data()) << " (" << fPedestalsInter << ")" << endl;
    653673    *fLog << "Name of output MPedestalCam:  " << (fPedestalsOut?fPedestalsOut->GetName():fNamePedestalCamOut.Data()) << " (" << fPedestalsOut << ")" << endl;
     674    *fLog << "Intermediate Storage is       " << (fIntermediateStorage?"on":"off") << endl;
    654675    *fLog << "Pedestal Update is            " << (fPedestalUpdate?"on":"off") << endl;
    655676    if (fPedestalUpdate)
  • trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.h

    r5715 r6321  
    2626  static const TString  fgNamePedestalCam;  //! "MPedestalCam"
    2727
    28   TString fNamePedestalCamIn;   // name of the incoming 'MPedestalCam' container
    29   TString fNamePedestalCamOut;  // name of the outgoing 'MPedestalCam' container 
     28  TString fNamePedestalCamIn;        // Name of the incoming 'MPedestalCam' container
     29  TString fNamePedestalCamOut;       // Name of the outgoing 'MPedestalCam' container
     30  TString fNamePedestalCamInter;     // Name of the intermediate 'MPedestalCam' container 
    3031
    31   Bool_t  fRandomCalculation;  // Is pedestalextraction by extractor random?
    32 
     32  Bool_t  fRandomCalculation;        // Is pedestalextraction by extractor random?
     33 
    3334protected:
    3435 
    35   MGeomCam      *fGeom;         //! Camera geometry
    36   MPedestalCam  *fPedestalsIn;  //! Pedestals of all pixels in the camera
    37   MPedestalCam  *fPedestalsOut; //! Pedestals of all pixels in the camera
    38   MRawEvtData   *fRawEvt;       //! Raw event data (time slices)
    39   MRawRunHeader *fRunHeader;    //! RunHeader information
    40   MRawEvtHeader *fEvtHeader;    //! EvtHeader information
    41   MExtractTimeAndCharge *fExtractor; // Possible Extractor used
     36  Bool_t  fIntermediateStorage;      // Is pedestal stored every event?
     37
     38  MGeomCam      *fGeom;              //! Camera geometry
     39  MPedestalCam  *fPedestalsIn;       //! Pedestals of all pixels in the camera (incoming)
     40  MPedestalCam  *fPedestalsInter;    //! Pedestals of all pixels in the camera (intermediate)
     41  MPedestalCam  *fPedestalsOut;      //! Pedestals of all pixels in the camera (outgoing)
     42  MRawEvtData   *fRawEvt;            //! Raw event data (time slices)
     43  MRawRunHeader *fRunHeader;         //! RunHeader information
     44  MRawEvtHeader *fEvtHeader;         //! EvtHeader information
     45  MExtractTimeAndCharge *fExtractor; //  Possible Extractor
    4246 
    43   UShort_t fExtractWinFirst;    // First FADC slice to extract pedestal from
    44   UShort_t fExtractWinSize;     // Number of slices to calculate the pedestal from
    45   UShort_t fExtractWinLast;     // Last FADC slice to extract pedestal from
     47  UShort_t fExtractWinFirst;         // First FADC slice to extract pedestal from
     48  UShort_t fExtractWinSize;          // Number of slices to calculate the pedestal from
     49  UShort_t fExtractWinLast;          // Last FADC slice to extract pedestal from
     50                                     
     51  UInt_t  fNumEventsDump;            // Number of event after which MPedestalCam gets updated
     52  UInt_t  fNumAreasDump;             // Number of events after which averaged areas gets updated
     53  UInt_t  fNumSectorsDump;           // Number of events after which averaged sectors gets updated
     54 
     55  Bool_t  fPedestalUpdate;           // Flag if the pedestal shall be updated after every fNumEventsDump
    4656
    47   UInt_t  fNumEventsDump;       // Number of event after which MPedestalCam gets updated
    48   UInt_t  fNumAreasDump;        // Number of events after which averaged areas gets updated
    49   UInt_t  fNumSectorsDump;      // Number of events after which averaged sectors gets updated
    50 
    51   Bool_t  fPedestalUpdate;     // Flag if the pedestal shall be updated after every fNumEventsDump
    52 
    53   MArrayD fSumx;               // sum of values
    54   MArrayD fSumx2;              // sum of squared values
    55   MArrayD fSumAB0;             // sum of ABFlag=0 slices
    56   MArrayD fSumAB1;             // sum of ABFlag=1 slices
    57   MArrayD fAreaSumx;           // averaged sum of values per area idx
    58   MArrayD fAreaSumx2;          // averaged sum of squared values per area idx
    59   MArrayD fAreaSumAB0;         // averaged sum of ABFlag=0 slices per area idx
    60   MArrayD fAreaSumAB1;         // averaged sum of ABFlag=1 slices per area idx
    61   MArrayI fAreaFilled;         // number of valid entries with area idx
    62   MArrayI fAreaValid;          // number of valid pixels  within area idx
    63   MArrayD fSectorSumx;         // averaged sum of values per sector
    64   MArrayD fSectorSumx2;        // averaged sum of squared values per sector
    65   MArrayD fSectorSumAB0;       // averaged sum of ABFlag=0 slices per sector
    66   MArrayD fSectorSumAB1;       // averaged sum of ABFlag=1 slices per sector
    67   MArrayI fSectorFilled;       // number of valid entries with sector idx
    68   MArrayI fSectorValid;        // number of valid pixels within sector idx
     57  MArrayD fSumx;                     // sum of values
     58  MArrayD fSumx2;                    // sum of squared values
     59  MArrayD fSumAB0;                   // sum of ABFlag=0 slices
     60  MArrayD fSumAB1;                   // sum of ABFlag=1 slices
     61  MArrayD fAreaSumx;                 // averaged sum of values per area idx
     62  MArrayD fAreaSumx2;                // averaged sum of squared values per area idx
     63  MArrayD fAreaSumAB0;               // averaged sum of ABFlag=0 slices per area idx
     64  MArrayD fAreaSumAB1;               // averaged sum of ABFlag=1 slices per area idx
     65  MArrayI fAreaFilled;               // number of valid entries with area idx
     66  MArrayI fAreaValid;                // number of valid pixels  within area idx
     67  MArrayD fSectorSumx;               // averaged sum of values per sector
     68  MArrayD fSectorSumx2;              // averaged sum of squared values per sector
     69  MArrayD fSectorSumAB0;             // averaged sum of ABFlag=0 slices per sector
     70  MArrayD fSectorSumAB1;             // averaged sum of ABFlag=1 slices per sector
     71  MArrayI fSectorFilled;             // number of valid entries with sector idx
     72  MArrayI fSectorValid;              // number of valid pixels within sector idx
    6973
    7074  // MTask virtual functions
     
    9296  Bool_t SetExtractWindow(UShort_t first, UShort_t size);
    9397
    94   void SetNumEventsDump(UInt_t dumpevents=500)  { fNumEventsDump  = dumpevents; }
    95   void SetNumAreasDump(UInt_t dumpevents=500)  { fNumAreasDump   = dumpevents; }
     98  void SetNumEventsDump (UInt_t dumpevents=500)  { fNumEventsDump  = dumpevents; }
     99  void SetNumAreasDump  (UInt_t dumpevents=500)  { fNumAreasDump   = dumpevents; }
    96100  void SetNumSectorsDump(UInt_t dumpevents=500)  { fNumSectorsDump = dumpevents; }
    97   void SetNumDump(UInt_t n=500) { fNumEventsDump=n; fNumAreasDump=n; fNumSectorsDump=n; }
    98   void SetPedestalUpdate (Bool_t pedupdate=kTRUE) { fPedestalUpdate = pedupdate;  }
     101  void SetNumDump       (UInt_t n=500) { fNumEventsDump=n; fNumAreasDump=n; fNumSectorsDump=n; }
    99102
    100   void SetNamePedestalCamIn(const char *name=fgNamePedestalCam.Data())  { fNamePedestalCamIn = name; }
    101   void SetNamePedestalCamOut(const char *name=fgNamePedestalCam.Data()) { fNamePedestalCamOut = name; }
     103  // names
     104  void SetNamePedestalCamIn   (const char *name=fgNamePedestalCam.Data()) { fNamePedestalCamIn    = name; }
     105  void SetNamePedestalCamInter(const char *name=fgNamePedestalCam.Data()) { fNamePedestalCamInter = name; } 
     106  void SetNamePedestalCamOut  (const char *name=fgNamePedestalCam.Data()) { fNamePedestalCamOut   = name; }
    102107
    103   void SetPedestalsIn(MPedestalCam *pedcam) { fPedestalsIn = pedcam; }
    104   void SetPedestalsOut(MPedestalCam *pedcam) { fPedestalsOut = pedcam; }
     108  // pointers
     109  void SetExtractor     ( MExtractTimeAndCharge *e) { fExtractor      = e; }
     110  void SetPedestalsIn   ( MPedestalCam *pedcam    ) { fPedestalsIn    = pedcam; }
     111  void SetPedestalsInter( MPedestalCam *pedcam    ) { fPedestalsInter = pedcam; }
     112  void SetPedestalsOut  ( MPedestalCam *pedcam    ) { fPedestalsOut   = pedcam; }
    105113
    106   void SetExtractor(MExtractTimeAndCharge *e) { fExtractor = e; }
    107   void SetRandomCalculation(Bool_t b=kTRUE) { fRandomCalculation = b; }
     114  // flags
     115  void SetIntermediateStorage (Bool_t b=kTRUE) { fIntermediateStorage = b; }
     116  void SetPedestalUpdate      (Bool_t b=kTRUE) { fPedestalUpdate      = b; }
     117  void SetRandomCalculation   (Bool_t b=kTRUE) { fRandomCalculation   = b; }
    108118
    109119  ClassDef(MExtractPedestal, 0)   // Base class for pedestal extractors
Note: See TracChangeset for help on using the changeset viewer.