Changeset 3700
- Timestamp:
- 04/09/04 18:27:14 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3698 r3700 36 36 * mcalib/MCalibrationCam.[h,cc] 37 37 - 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 38 42 39 43 -
trunk/MagicSoft/Mars/manalysis/MGeomApply.cc
r3667 r3700 135 135 MPedestalCam *ped = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam")); 136 136 if (ped) 137 ped->Init Size(cam->GetNumPixels());137 ped->Init(*cam); 138 138 139 139 MCalibrationCam *cal = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationChargeCam")); -
trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc
r3231 r3700 49 49 // -------------------------------------------------------------------------- 50 50 // 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). 52 64 // 53 65 MPedestalCam::MPedestalCam(const char *name, const char *title) 54 66 : fTotalEntries(0) 55 67 { 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 // 66 83 MPedestalCam::~MPedestalCam() 67 84 { 68 delete fArray; 85 delete fArray; 86 delete fAverageAreas; 87 delete fAverageSectors; 69 88 } 70 89 … … 76 95 { 77 96 fArray->ExpandCreate(i); 97 } 98 99 // ------------------------------------------------------------------- 100 // 101 // Calls TClonesArray::ExpandCreate() for: 102 // - fAverageAreas 103 // 104 void MPedestalCam::InitAverageAreas(const UInt_t i) 105 { 106 fAverageAreas->ExpandCreate(i); 107 } 108 109 // ------------------------------------------------------------------- 110 // 111 // Calls TClonesArray::ExpandCreate() for: 112 // - fAverageSectors 113 // 114 void MPedestalCam::InitAverageSectors(const UInt_t i) 115 { 116 fAverageSectors->ExpandCreate(i); 117 } 118 119 // ------------------------------------------------------------------- 120 // 121 // Calls: 122 // - InitSize() 123 // - InitAverageAreas() 124 // - InitAverageSectors() 125 // 126 void MPedestalCam::Init(const MGeomCam &geom) 127 { 128 InitSize (geom.GetNumPixels() ); 129 InitAverageAreas (geom.GetNumAreas() ); 130 InitAverageSectors(geom.GetNumSectors()); 78 131 } 79 132 … … 92 145 // -------------------------------------------------------------------------- 93 146 // 147 // Returns the current size of the TClonesArray fAverageAreas 148 // independently if the MPedestalPix is filled with values or not. 149 // 150 const 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 // 160 const Int_t MPedestalCam::GetAverageSectors() const 161 { 162 return fAverageSectors->GetEntriesFast(); 163 } 164 165 // -------------------------------------------------------------------------- 166 // 94 167 // Get i-th pixel (pixel number) 95 168 // … … 108 181 } 109 182 110 // ------------------------------------------------------------------------- 111 // 183 // -------------------------------------------------------------------------- 184 // 185 // Get i-th average pixel (area number) 186 // 187 MPedestalPix &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 // 196 const 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 // 205 MPedestalPix &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 // 214 const 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 // 112 229 void MPedestalCam::Clear(Option_t *o) 113 230 { 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; 117 247 } 118 248 -
trunk/MagicSoft/Mars/manalysis/MPedestalCam.h
r3231 r3700 17 17 { 18 18 private: 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) 21 25 22 26 public: 23 MPedestalCam(const char *name=NULL, const char *title=NULL);24 ~MPedestalCam();25 27 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; 27 47 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 ); 29 52 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; } 32 57 33 // Setters34 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; 35 60 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 49 62 }; 50 63 -
trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc
r3698 r3700 203 203 } 204 204 205 // ------------------------------------------------------------------- 206 // 207 // Calls: 208 // - InitSize() 209 // - InitAverageAreas() 210 // - InitAverageSectors() 211 // 205 212 void MCalibrationCam::Init(const MGeomCam &geom) 206 213 { 207 208 209 214 InitSize (geom.GetNumPixels() ); 215 InitAverageAreas (geom.GetNumAreas() ); 216 InitAverageSectors(geom.GetNumSectors()); 210 217 } 211 218 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r3699 r3700 382 382 // - MCalibrationQEPix 383 383 // 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 385 386 // 386 387 Bool_t MCalibrationChargeCalc::ReInit(MParList *pList ) … … 496 497 // ---------------------------------------------------------------------------------- 497 498 // 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 506 504 // 507 505 void MCalibrationChargeCalc::FinalizePedestals(const MPedestalPix &ped, MCalibrationChargePix &cal,
Note:
See TracChangeset
for help on using the changeset viewer.