Changeset 3645 for trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc
- Timestamp:
- 04/04/04 19:52:13 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc
r3635 r3645 27 27 // MCalibrationCam 28 28 // 29 // Base class for camera Calibration results: 30 // 29 // Base class for Camera Calibration results. 30 // 31 // Contains TClonesArrays for the following objects: 32 // - fPixels: Array of classes derived from MCalibrationPix, one entry 33 // per pixel. Has to be created 34 // - fAverageAreas: Array of classes derived from MCalibrationPix, one entry 35 // per pixel AREA. Has to be created 36 // - fAverageSectors: Array of classes derived from MCalibrationPix, one entry 37 // per camera SECTOR. Has to be created 38 // 39 // - fAverageBadAreas: Array of classes derived from MBadPixelsPix, one entry 40 // per pixel AREA. Is created automatically. 41 // - fAverageBadSectors: Array of classes derived from MBadPixelsPix, one entry 42 // per camera SECTOR. Is created automatically. 43 // 44 // All TClonesArrays have to enlarged by the corresponding calls to (e.g. in MGeomApply): 45 // - InitSize() 46 // - InitAverageAreas() 47 // - InitAverageSectors() 48 // 31 49 ///////////////////////////////////////////////////////////////////////////// 32 50 #include "MCalibrationCam.h" 33 51 34 #include <TH2.h>35 #include <TCanvas.h>36 52 #include <TClonesArray.h> 37 38 #include "MLog.h"39 #include "MLogManip.h"40 53 41 54 #include "MGeomCam.h" … … 55 68 // Default constructor. 56 69 // 57 // Creates a TClonesArray of MCalibrationPix containers, initialized to 1 entry 58 // Later, a call to MCalibrationCam::InitSize(Int_t size) has to be performed 59 // 60 // Creates an MCalibrationBlindPix container 70 // Set the following pointer to NULL: 71 // - fPixels 72 // - fAverageAreas 73 // - fAverageSectors 74 // 75 // Creates a TClonesArray of MBadPixelsPix containers for the TClonesArray's: 76 // - fAverageBadAreas 77 // - fAverageBadSectors 78 // all initialized to 1 entry 79 // 80 // Later, a call to InitAverageAreas() and InitAverageSectors() has to be performed in order 81 // to get the dimension correctly. 61 82 // 62 83 MCalibrationCam::MCalibrationCam(const char *name, const char *title) … … 73 94 // -------------------------------------------------------------------------- 74 95 // 75 // Delete the TClonesArray of MCalibrationPix containers 76 // Delete the MCalibrationPINDiode and the MCalibrationBlindPix 77 // 78 // Delete the histograms if they exist 96 // Deletes the following TClonesArray's of MCalibrationPix containers (if exist): 97 // - fPixels 98 // - fAverageAreas 99 // - fAverageSectors 100 // 101 // Deletes the following TClonesArray's of MBadPixelsPix containers (if exist): 102 // - fAverageBadAreas 103 // - fAverageBadSectors 79 104 // 80 105 MCalibrationCam::~MCalibrationCam() … … 98 123 } 99 124 100 // -------------------------------------------------------------------101 //102 //103 void MCalibrationCam::InitSize(const UInt_t i)104 {105 fPixels->ExpandCreate(i);106 }107 108 void MCalibrationCam::InitAverageAreas(const UInt_t i)109 {110 fAverageAreas->ExpandCreate(i);111 fAverageBadAreas->ExpandCreate(i);112 }113 114 void MCalibrationCam::InitAverageSectors(const UInt_t i)115 {116 fAverageSectors->ExpandCreate(i);117 fAverageBadSectors->ExpandCreate(i);118 }119 120 // --------------------------------------------------------------------------121 //122 // This function returns the current size of the TClonesArray123 // independently if the MCalibrationPix is filled with values or not.124 //125 // It is the size of the array fPixels.126 //127 Int_t MCalibrationCam::GetSize() const128 {129 return fPixels->GetEntriesFast();130 }131 132 Int_t MCalibrationCam::GetAverageAreas() const133 {134 return fAverageAreas->GetEntriesFast();135 }136 137 Int_t MCalibrationCam::GetAverageSectors() const138 {139 return fAverageSectors->GetEntriesFast();140 }141 142 143 // --------------------------------------------------------------------------144 //145 // Get i-th pixel (pixel number)146 //147 MCalibrationPix &MCalibrationCam::operator[](UInt_t i)148 {149 return *static_cast<MCalibrationPix*>(fPixels->UncheckedAt(i));150 }151 152 // --------------------------------------------------------------------------153 //154 // Get i-th pixel (pixel number)155 //156 const MCalibrationPix &MCalibrationCam::operator[](UInt_t i) const157 {158 return *static_cast<MCalibrationPix*>(fPixels->UncheckedAt(i));159 }160 161 // --------------------------------------------------------------------------162 //163 // Get i-th average pixel (area number)164 //165 MCalibrationPix &MCalibrationCam::GetAverageArea(UInt_t i)166 {167 return *static_cast<MCalibrationPix*>(fAverageAreas->UncheckedAt(i));168 }169 170 // --------------------------------------------------------------------------171 //172 // Get i-th average pixel (area number)173 //174 const MCalibrationPix &MCalibrationCam::GetAverageArea(UInt_t i) const175 {176 return *static_cast<MCalibrationPix*>(fAverageAreas->UncheckedAt(i));177 }178 179 // --------------------------------------------------------------------------180 //181 // Get i-th average pixel (sector number)182 //183 MCalibrationPix &MCalibrationCam::GetAverageSector(UInt_t i)184 {185 return *static_cast<MCalibrationPix*>(fAverageSectors->UncheckedAt(i));186 }187 188 // --------------------------------------------------------------------------189 //190 // Get i-th average pixel (sector number)191 //192 const MCalibrationPix &MCalibrationCam::GetAverageSector(UInt_t i) const193 {194 return *static_cast<MCalibrationPix*>(fAverageSectors->UncheckedAt(i));195 }196 197 // --------------------------------------------------------------------------198 //199 // Get i-th average pixel (area number)200 //201 MBadPixelsPix &MCalibrationCam::GetAverageBadArea(UInt_t i)202 {203 return *static_cast<MBadPixelsPix*>(fAverageBadAreas->UncheckedAt(i));204 }205 206 // --------------------------------------------------------------------------207 //208 // Get i-th average pixel (area number)209 //210 const MBadPixelsPix &MCalibrationCam::GetAverageBadArea(UInt_t i) const211 {212 return *static_cast<MBadPixelsPix*>(fAverageBadAreas->UncheckedAt(i));213 }214 215 // --------------------------------------------------------------------------216 //217 // Get i-th average pixel (sector number)218 //219 MBadPixelsPix &MCalibrationCam::GetAverageBadSector(UInt_t i)220 {221 return *static_cast<MBadPixelsPix*>(fAverageBadSectors->UncheckedAt(i));222 }223 224 // --------------------------------------------------------------------------225 //226 // Get i-th average pixel (sector number)227 //228 const MBadPixelsPix &MCalibrationCam::GetAverageBadSector(UInt_t i) const229 {230 return *static_cast<MBadPixelsPix*>(fAverageBadSectors->UncheckedAt(i));231 }232 233 234 125 // -------------------------------------- 235 126 // 127 // Calls the ForEach macro for the TClonesArray fPixels with the argument Clear() 128 // 129 // Loops over the fAverageAreas, calling the function Clear() for 130 // every entry in: 131 // - fAverageAreas 132 // - fAverageBadAreas 133 // 134 // Loops over the fAverageSectors, calling the function Clear() for 135 // every entry in: 136 // - fAverageSectors 137 // - fAverageBadSectors 138 // 236 139 void MCalibrationCam::Clear(Option_t *o) 237 140 { … … 260 163 } 261 164 165 // ------------------------------------------------------------------- 166 // 167 // Calls TClonesArray::ExpandCreate() for fPixels 168 // 169 void MCalibrationCam::InitSize(const UInt_t i) 170 { 171 fPixels->ExpandCreate(i); 172 } 173 174 // ------------------------------------------------------------------- 175 // 176 // Calls TClonesArray::ExpandCreate() for: 177 // - fAverageAreas 178 // - fAverageBadAreas 179 // 180 void MCalibrationCam::InitAverageAreas(const UInt_t i) 181 { 182 fAverageAreas->ExpandCreate(i); 183 fAverageBadAreas->ExpandCreate(i); 184 } 185 186 // ------------------------------------------------------------------- 187 // 188 // Calls TClonesArray::ExpandCreate() for: 189 // - fAverageSectors 190 // - fAverageBadSectors 191 // 192 void MCalibrationCam::InitAverageSectors(const UInt_t i) 193 { 194 fAverageSectors->ExpandCreate(i); 195 fAverageBadSectors->ExpandCreate(i); 196 } 197 198 // -------------------------------------------------------------------------- 199 // 200 // Returns the current size of the TClonesArray fPixels 201 // independently if the MCalibrationPix is filled with values or not. 202 // 203 Int_t MCalibrationCam::GetSize() const 204 { 205 return fPixels->GetEntriesFast(); 206 } 207 208 // -------------------------------------------------------------------------- 209 // 210 // Returns the current size of the TClonesArray fAverageAreas 211 // independently if the MCalibrationPix is filled with values or not. 212 // 213 Int_t MCalibrationCam::GetAverageAreas() const 214 { 215 return fAverageAreas->GetEntriesFast(); 216 } 217 218 // -------------------------------------------------------------------------- 219 // 220 // Returns the current size of the TClonesArray fAverageSectors 221 // independently if the MCalibrationPix is filled with values or not. 222 // 223 Int_t MCalibrationCam::GetAverageSectors() const 224 { 225 return fAverageSectors->GetEntriesFast(); 226 } 227 228 229 // -------------------------------------------------------------------------- 230 // 231 // Get i-th pixel (pixel number) 232 // 233 MCalibrationPix &MCalibrationCam::operator[](UInt_t i) 234 { 235 return *static_cast<MCalibrationPix*>(fPixels->UncheckedAt(i)); 236 } 237 238 // -------------------------------------------------------------------------- 239 // 240 // Get i-th pixel (pixel number) 241 // 242 const MCalibrationPix &MCalibrationCam::operator[](UInt_t i) const 243 { 244 return *static_cast<MCalibrationPix*>(fPixels->UncheckedAt(i)); 245 } 246 247 // -------------------------------------------------------------------------- 248 // 249 // Get i-th average pixel (area number) 250 // 251 MCalibrationPix &MCalibrationCam::GetAverageArea(UInt_t i) 252 { 253 return *static_cast<MCalibrationPix*>(fAverageAreas->UncheckedAt(i)); 254 } 255 256 // -------------------------------------------------------------------------- 257 // 258 // Get i-th average pixel (area number) 259 // 260 const MCalibrationPix &MCalibrationCam::GetAverageArea(UInt_t i) const 261 { 262 return *static_cast<MCalibrationPix*>(fAverageAreas->UncheckedAt(i)); 263 } 264 265 // -------------------------------------------------------------------------- 266 // 267 // Get i-th average pixel (sector number) 268 // 269 MCalibrationPix &MCalibrationCam::GetAverageSector(UInt_t i) 270 { 271 return *static_cast<MCalibrationPix*>(fAverageSectors->UncheckedAt(i)); 272 } 273 274 // -------------------------------------------------------------------------- 275 // 276 // Get i-th average pixel (sector number) 277 // 278 const MCalibrationPix &MCalibrationCam::GetAverageSector(UInt_t i) const 279 { 280 return *static_cast<MCalibrationPix*>(fAverageSectors->UncheckedAt(i)); 281 } 282 283 // -------------------------------------------------------------------------- 284 // 285 // Get i-th average pixel (area number) 286 // 287 MBadPixelsPix &MCalibrationCam::GetAverageBadArea(UInt_t i) 288 { 289 return *static_cast<MBadPixelsPix*>(fAverageBadAreas->UncheckedAt(i)); 290 } 291 292 // -------------------------------------------------------------------------- 293 // 294 // Get i-th average pixel (area number) 295 // 296 const MBadPixelsPix &MCalibrationCam::GetAverageBadArea(UInt_t i) const 297 { 298 return *static_cast<MBadPixelsPix*>(fAverageBadAreas->UncheckedAt(i)); 299 } 300 301 // -------------------------------------------------------------------------- 302 // 303 // Get i-th average pixel (sector number) 304 // 305 MBadPixelsPix &MCalibrationCam::GetAverageBadSector(UInt_t i) 306 { 307 return *static_cast<MBadPixelsPix*>(fAverageBadSectors->UncheckedAt(i)); 308 } 309 310 // -------------------------------------------------------------------------- 311 // 312 // Get i-th average pixel (sector number) 313 // 314 const MBadPixelsPix &MCalibrationCam::GetAverageBadSector(UInt_t i) const 315 { 316 return *static_cast<MBadPixelsPix*>(fAverageBadSectors->UncheckedAt(i)); 317 } 318 319 320 262 321 // -------------------------------------------------------------------------- 263 322 // … … 273 332 // -------------------------------------------------------------------------- 274 333 // 275 // What MHCamera needs in order to draw an individual pixel in the camera334 // Calls MCalibrationPix::DrawClone() 276 335 // 277 336 void MCalibrationCam::DrawPixelContent(Int_t idx) const
Note:
See TracChangeset
for help on using the changeset viewer.