Changeset 3700 for trunk


Ignore:
Timestamp:
04/09/04 18:27:14 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3698 r3700  
    3636   * mcalib/MCalibrationCam.[h,cc]     
    3737     - put a default pulser color kNONE
     38
     39   * manalysis/MPedestalCam.[h,cc]
     40   * manalysis/MGeomApply.cc
     41     - added average pixels in the way like it is done in MCalibrationCam
    3842
    3943
  • trunk/MagicSoft/Mars/manalysis/MGeomApply.cc

    r3667 r3700  
    135135    MPedestalCam *ped = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam"));
    136136    if (ped)
    137         ped->InitSize(cam->GetNumPixels());
     137        ped->Init(*cam);
    138138
    139139    MCalibrationCam *cal = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationChargeCam"));
  • trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc

    r3231 r3700  
    4949// --------------------------------------------------------------------------
    5050//
    51 // Default constructor. Creates a MPedestalPix object for each pixel
     51// Default constructor.
     52//
     53// Creates a TClonesArray of MPedestalPix containers, initialized to 1 entry, destinated
     54// to hold one container per pixel. Later, a call to MPedestalCam::InitSize()
     55// has to be performed (in MGeomApply).
     56//
     57// Creates a TClonesArray of MPedestalPix containers, initialized to 1 entry, destinated
     58// to hold one container per pixel AREA. Later, a call to MPedestalCam::InitAreas()
     59// has to be performed (in MGeomApply).
     60//
     61// Creates a TClonesArray of MPedestalPix containers, initialized to 1 entry, destinated
     62// to hold one container per camera SECTOR. Later, a call to MPedestalCam::InitSectors()
     63// has to be performed (in MGeomApply).
    5264//
    5365MPedestalCam::MPedestalCam(const char *name, const char *title)
    5466    : fTotalEntries(0)
    5567{
    56     fName  = name  ? name  : "MPedestalCam";
    57     fTitle = title ? title : "Storage container for all Pedestal Information in the camera";
    58 
    59     fArray = new TClonesArray("MPedestalPix", 1);
    60 }
    61 
    62 // --------------------------------------------------------------------------
    63 //
    64 // Delete the array conatining the pixel pedest information
    65 //
     68  fName  = name  ? name  : "MPedestalCam";
     69  fTitle = title ? title : "Storage container for all Pedestal Information in the camera";
     70 
     71  fArray            = new TClonesArray("MPedestalPix", 1);
     72  fAverageAreas     = new TClonesArray("MPedestalPix", 1);
     73  fAverageSectors   = new TClonesArray("MPedestalPix", 1);
     74}
     75
     76// --------------------------------------------------------------------------
     77//
     78// Deletes the following TClonesArray's of MPedestalPix containers (if exist):
     79// - fArray
     80// - fAverageAreas
     81// - fAverageSectors
     82// 
    6683MPedestalCam::~MPedestalCam()
    6784{
    68     delete fArray;
     85  delete fArray;
     86  delete fAverageAreas;
     87  delete fAverageSectors;
    6988}
    7089
     
    7695{
    7796    fArray->ExpandCreate(i);
     97}
     98
     99// -------------------------------------------------------------------
     100//
     101// Calls TClonesArray::ExpandCreate() for:
     102// - fAverageAreas
     103//
     104void MPedestalCam::InitAverageAreas(const UInt_t i)
     105{
     106  fAverageAreas->ExpandCreate(i);
     107}
     108
     109// -------------------------------------------------------------------
     110//
     111// Calls TClonesArray::ExpandCreate() for:
     112// - fAverageSectors
     113//
     114void MPedestalCam::InitAverageSectors(const UInt_t i)
     115{
     116  fAverageSectors->ExpandCreate(i);
     117}
     118
     119// -------------------------------------------------------------------
     120//
     121// Calls:
     122// - InitSize()
     123// - InitAverageAreas()
     124// - InitAverageSectors()
     125//
     126void MPedestalCam::Init(const MGeomCam &geom)
     127{
     128  InitSize          (geom.GetNumPixels() );
     129  InitAverageAreas  (geom.GetNumAreas()  );
     130  InitAverageSectors(geom.GetNumSectors());
    78131}
    79132
     
    92145// --------------------------------------------------------------------------
    93146//
     147// Returns the current size of the TClonesArray fAverageAreas
     148// independently if the MPedestalPix is filled with values or not.
     149//
     150const Int_t MPedestalCam::GetAverageAreas() const
     151{
     152  return fAverageAreas->GetEntriesFast();
     153}
     154
     155// --------------------------------------------------------------------------
     156//
     157// Returns the current size of the TClonesArray fAverageSectors
     158// independently if the MPedestalPix is filled with values or not.
     159//
     160const Int_t MPedestalCam::GetAverageSectors() const
     161{
     162  return fAverageSectors->GetEntriesFast();
     163}
     164
     165// --------------------------------------------------------------------------
     166//
    94167// Get i-th pixel (pixel number)
    95168//
     
    108181}
    109182
    110 // -------------------------------------------------------------------------
    111 //
     183// --------------------------------------------------------------------------
     184//
     185// Get i-th average pixel (area number)
     186//
     187MPedestalPix &MPedestalCam::GetAverageArea(UInt_t i)
     188{
     189  return *static_cast<MPedestalPix*>(fAverageAreas->UncheckedAt(i));
     190}
     191
     192// --------------------------------------------------------------------------
     193//
     194// Get i-th average pixel (area number)
     195//
     196const MPedestalPix &MPedestalCam::GetAverageArea(UInt_t i) const
     197{
     198  return *static_cast<MPedestalPix*>(fAverageAreas->UncheckedAt(i));
     199}
     200
     201// --------------------------------------------------------------------------
     202//
     203// Get i-th average pixel (sector number)
     204//
     205MPedestalPix &MPedestalCam::GetAverageSector(UInt_t i)
     206{
     207  return *static_cast<MPedestalPix*>(fAverageSectors->UncheckedAt(i));
     208}
     209
     210// --------------------------------------------------------------------------
     211//
     212// Get i-th average pixel (sector number)
     213//
     214const MPedestalPix &MPedestalCam::GetAverageSector(UInt_t i) const
     215{
     216  return *static_cast<MPedestalPix*>(fAverageSectors->UncheckedAt(i));
     217}
     218
     219// --------------------------------------
     220//
     221// Calls the ForEach macro for the TClonesArray fArray with the argument Clear()
     222//
     223// Loops over the fAverageAreas, calling the function Clear() for
     224// every entry in fAverageAreas
     225//
     226// Loops over the fAverageSectors, calling the function Clear() for
     227// every entry in fAverageSectors
     228//
    112229void MPedestalCam::Clear(Option_t *o)
    113230{
    114     fArray->ForEach(TObject, Clear)();
    115 
    116     fTotalEntries = 0;
     231  fArray->ForEach(TObject, Clear)();
     232 
     233  //
     234  // another ForEach does not compile, thus have to do the loop ourselves:
     235  //
     236  for (Int_t i=0;i<GetAverageAreas();i++)
     237    fAverageAreas[i].Clear();
     238
     239
     240  //
     241  // another ForEach does not compile, thus have to do the loop ourselves:
     242  //
     243  for (Int_t i=0;i<GetAverageSectors();i++)
     244    fAverageSectors[i].Clear();
     245 
     246  fTotalEntries = 0;
    117247}
    118248
  • trunk/MagicSoft/Mars/manalysis/MPedestalCam.h

    r3231 r3700  
    1717{
    1818private:
    19     TClonesArray *fArray;  //-> FIXME: Change TClonesArray away from a pointer?
    20     UInt_t fTotalEntries;  // Total number of times, the Process was executed (to estimate the error of pedestal)
     19
     20  TClonesArray *fArray;           //-> FIXME: Change TClonesArray away from a pointer?
     21  TClonesArray *fAverageAreas;    //-> Array of MPedestalPix, one per pixel area
     22  TClonesArray *fAverageSectors;  //-> Array of MPedestalPix, one per camera sector
     23
     24  UInt_t fTotalEntries;  // Total number of times, the Process was executed (to estimate the error of pedestal)
    2125
    2226public:
    23     MPedestalCam(const char *name=NULL, const char *title=NULL);
    24     ~MPedestalCam();
    2527
    26     void Clear(Option_t *o="");
     28  MPedestalCam(const char *name=NULL, const char *title=NULL);
     29  ~MPedestalCam();
     30 
     31  void Clear(Option_t *o="");
     32 
     33  // Getters
     34        MPedestalPix &GetAverageArea   ( UInt_t i );
     35  const MPedestalPix &GetAverageArea   ( UInt_t i )            const;
     36  const Int_t         GetAverageAreas  ()                      const;
     37        MPedestalPix &GetAverageSector ( UInt_t i );
     38  const MPedestalPix &GetAverageSector ( UInt_t i )            const;
     39  const Int_t         GetAverageSectors()                      const;
     40  Float_t             GetPedestalMin   ( const MGeomCam *cam ) const;
     41  Float_t             GetPedestalMax   ( const MGeomCam *cam ) const;
     42  Int_t               GetSize          ()                      const;
     43  ULong_t             GetTotalEntries  ()                      const { return fTotalEntries; }
     44 
     45        MPedestalPix &operator[]       ( Int_t i             );
     46  const MPedestalPix &operator[]       ( Int_t i             ) const;
    2747
    28     void InitSize(const UInt_t i);
     48  void  Init                           ( const MGeomCam &geom);
     49  void  InitSize                       ( const UInt_t i      );
     50  void  InitAverageAreas               ( const UInt_t i      );
     51  void  InitAverageSectors             ( const UInt_t i      );
    2952
    30     MPedestalPix &operator[](Int_t i);
    31     const MPedestalPix &operator[](Int_t i) const;
     53  void Print(Option_t *o="") const;
     54 
     55  // Setters
     56  void SetTotalEntries(const ULong_t n) { fTotalEntries = n; }
    3257
    33     // Setters
    34     void SetTotalEntries(const ULong_t n) { fTotalEntries = n; }
     58  Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
     59  void DrawPixelContent(Int_t idx) const;
    3560
    36     // Getters
    37     Int_t  GetSize()         const;
    38     ULong_t GetTotalEntries() const { return fTotalEntries; }
    39 
    40     Float_t GetPedestalMin(const MGeomCam *cam) const;
    41     Float_t GetPedestalMax(const MGeomCam *cam) const;
    42 
    43     void Print(Option_t *o="") const;
    44 
    45     Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
    46     void DrawPixelContent(Int_t idx) const;
    47 
    48     ClassDef(MPedestalCam, 1)   // Storage Container for all pedestal information of the camera
     61  ClassDef(MPedestalCam, 1)     // Storage Container for all pedestal information of the camera
    4962};
    5063
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc

    r3698 r3700  
    203203}
    204204
     205// -------------------------------------------------------------------
     206//
     207// Calls:
     208// - InitSize()
     209// - InitAverageAreas()
     210// - InitAverageSectors()
     211//
    205212void MCalibrationCam::Init(const MGeomCam &geom)
    206213{
    207     InitSize          (geom.GetNumPixels() );
    208     InitAverageAreas  (geom.GetNumAreas()  );
    209     InitAverageSectors(geom.GetNumSectors());
     214  InitSize          (geom.GetNumPixels() );
     215  InitAverageAreas  (geom.GetNumAreas()  );
     216  InitAverageSectors(geom.GetNumSectors());
    210217}
    211218
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r3699 r3700  
    382382// - MCalibrationQEPix
    383383//
    384 // It tests the pulser colour one more time...
     384// It initializes the pulser color in MCalibrationChargeCam, MCalibrationChargeBlindPix
     385// and MCalibrationChargePINDiode and tests, if it has not changed w.r.t. fPulserColor
    385386//
    386387Bool_t MCalibrationChargeCalc::ReInit(MParList *pList )
     
    496497// ----------------------------------------------------------------------------------
    497498// 
    498 // Finalize pedestals:
    499 //
    500 // - Retrieve pedestal and pedestal RMS from MPedestalPix
    501 // - Retrieve total entries from MPedestalCam
    502 // - Sum up pedestal and pedestalRMS for the average pixel
    503 // - Set pedestal*number of used samples in MCalibrationChargePix
    504 // - Set pedestal RMS * sqrt of number of used samples in MCalibrationChargePix
    505 //
     499// Retrieves pedestal and pedestal RMS from MPedestalPix
     500// Retrieves total entries from MPedestalCam
     501// Sums up pedestal and pedestalRMS for the average pixel
     502// Sets pedestal*fNumHiGainSamples and pedestal*fNumLoGainSamples in MCalibrationChargePix
     503// Sets pedRMS *fSqrtHiGainSamples and pedRMS *fSqrtLoGainSamples in MCalibrationChargePix
    506504//
    507505void MCalibrationChargeCalc::FinalizePedestals(const MPedestalPix &ped, MCalibrationChargePix &cal,
Note: See TracChangeset for help on using the changeset viewer.