Changeset 3645
- Timestamp:
- 04/04/04 19:52:13 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3644 r3645 21 21 2004/04/02: Markus Gaug 22 22 23 * mcalib/MCalibrationPix.[h,cc] 24 * mcalib/MCalibrationCam.[h,cc] 23 25 * mcalib/MCalibrationQEPix.[h,cc] 24 26 * mcalib/MCalibrationQECam.[h,cc] -
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 -
trunk/MagicSoft/Mars/mcalib/MCalibrationCam.h
r3638 r3645 64 64 virtual Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 65 65 66 ClassDef(MCalibrationCam, 1) // Base class Container for camera calibration66 ClassDef(MCalibrationCam, 1) // Base class Container for Calibration Results Camera 67 67 }; 68 68 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.h
r3638 r3645 40 40 Float_t fMeanFluxPhesOuterPixelVar; // The variance of the number of photo-electrons INNER PIXEL 41 41 42 Float_t fMeanFluxPhotonsInnerPixel; // The mean number of photo-electrons in an INNER PIXEL 43 Float_t fMeanFluxPhotonsInnerPixelVar; // The variance of the number of photo-electrons INNER PIXEL 44 Float_t fMeanFluxPhotonsOuterPixel; // The mean number of photo-electrons in an INNER PIXEL 45 Float_t fMeanFluxPhotonsOuterPixelVar; // The variance of the number of photo-electrons INNER PIXEL 42 Float_t fMeanFluxPhotonsInnerPixel; // The mean number of photo-electrons in an INNER PIXEL 43 Float_t fMeanFluxPhotonsInnerPixelVar; // The variance of the number of photo-electrons INNER PIXEL 44 Float_t fMeanFluxPhotonsOuterPixel; // The mean number of photo-electrons in an INNER PIXEL 45 Float_t fMeanFluxPhotonsOuterPixelVar; // The variance of the number of photo-electrons INNER PIXEL 46 47 Byte_t fFlags; // Byte to hold the flags 46 48 47 49 public: -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc
r3637 r3645 102 102 const Float_t MCalibrationChargePix::gkFFactorErr = 0.02; 103 103 104 const Float_t MCalibrationChargePix::gkConversionHiLo = 10.; 105 const Float_t MCalibrationChargePix::gkConversionHiLoErr = 2.5; 106 104 const Float_t MCalibrationChargePix::fgConversionHiLo = 10.; 105 const Float_t MCalibrationChargePix::fgConversionHiLoErr = 2.5; 107 106 const Float_t MCalibrationChargePix::fgPheFFactorMethodLimit = 5.; 108 107 // -------------------------------------------------------------------------- … … 538 537 { 539 538 540 fElectronicPedRms= gkElectronicPedRms * TMath::Sqrt(logainsamples);541 fElectronicPedRmsVar= gkElectronicPedRmsErr * gkElectronicPedRmsErr * logainsamples;539 const Float_t elecPedRms = gkElectronicPedRms * TMath::Sqrt(logainsamples); 540 const Float_t elecPedRmsVar = gkElectronicPedRmsErr * gkElectronicPedRmsErr * logainsamples; 542 541 543 542 Float_t pedRmsSquare = fPedRms * fPedRms; … … 550 549 // We extract the pure NSB contribution: 551 550 // 552 const Float_t elecRmsSquare = fElectronicPedRms * fElectronicPedRms;553 const Float_t elecRmsSquareVar = 4.* fElectronicPedRmsVar * elecRmsSquare;551 const Float_t elecRmsSquare = elecPedRms * elecPedRms; 552 const Float_t elecRmsSquareVar = 4.*elecPedRmsVar * elecRmsSquare; 554 553 555 554 Float_t nsbSquare = pedRmsSquare - elecRmsSquare; -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.h
r3638 r3645 6 6 #endif 7 7 8 class MBadPixelsPix;9 8 class MCalibrationChargePix : public MCalibrationPix 10 9 { 11 10 private: 12 11 13 static const Float_t gkConversionHiLo; // The default conversion factor HI gain - Lo Gain 14 static const Float_t gkConversionHiLoErr; // The error of the default conversion factor 12 static const Float_t gkElectronicPedRms; //! Electronic component of ped. RMS (now set to: 1.5) 13 static const Float_t gkElectronicPedRmsErr; //! Error Electronic component of ped. RMS (now set to: 0.3) 14 static const Float_t gkFFactor; //! Laboratory F-factor PMTs (now set to: 1.15) 15 static const Float_t gkFFactorErr; //! Laboratory F-factor Error PMTs (now set to: 0.02) 16 17 static const Float_t fgConversionHiLo; //! Default for fConversionHiLo (now set to: 10.) 18 static const Float_t fgConversionHiLoErr; //! Default for fConversionHiLoVar (now set to: 2.5) 19 static const Float_t fgPheFFactorMethodLimit; //! Default for fPheFFactorMethodLimit (now set to: 5.) 15 20 16 static const Float_t gkElectronicPedRms; // The pure electronic component of the RMS17 static const Float_t gkElectronicPedRmsErr; // The error of the pure electronic component of the RMS18 static const Float_t gkFFactor; // The laboratory F-factor of the PMTs19 static const Float_t gkFFactorErr; // The laboratory F-factor Error of the PMTs20 21 22 static const Float_t fgPheFFactorMethodLimit; // The default minimum number of Photo-electrons for a pixel to be accepted.23 24 Float_t fElectronicPedRms; // The pure electronic component of the RMS25 Float_t fElectronicPedRmsVar; // The error of the pure electronic component of the RMS26 27 21 Float_t fPheFFactorMethodLimit; // The minimum number of Photo-electrons for a pixel to be accepted. 28 22 … … 89 83 void SetPedestal(const Float_t ped, const Float_t pedrms, const Float_t pederr); 90 84 91 void SetConversionHiLo( const Float_t c = gkConversionHiLo) { fConversionHiLo = c; }92 void SetConversionHiLoErr( const Float_t e = gkConversionHiLoErr) { fConversionHiLoVar = e*e; }85 void SetConversionHiLo( const Float_t c = fgConversionHiLo) { fConversionHiLo = c; } 86 void SetConversionHiLoErr( const Float_t e = fgConversionHiLoErr) { fConversionHiLoVar = e*e; } 93 87 94 88 void SetPheFFactorMethodLimit ( const Float_t f=fgPheFFactorMethodLimit ) { fPheFFactorMethodLimit = f; } … … 179 173 Bool_t CalcFFactorMethod(); 180 174 181 ClassDef(MCalibrationChargePix, 1) // Container for C alibration of one pixel175 ClassDef(MCalibrationChargePix, 1) // Container for Charge Calibration Results Pixel 182 176 }; 183 177 -
trunk/MagicSoft/Mars/mcalib/MCalibrationPix.cc
r3644 r3645 25 25 // MCalibrationPix // 26 26 // // 27 // Base Storage container to for a calibration pixel // 28 // // 27 // Base Storage container for a calibration pixel. Holds mean and sigmas, 28 // their errors, the fit probability and the number of pickup events for 29 // the high-gain and the low-gain derived values. 30 // 31 // Errors are stored internally as variances, but are returned and filled 32 // as square root of the variances. 33 // 34 // Calls to GetMean(), GetMeanErr(), GetSigma(), GetSigmaErr(), GetProb() or 35 // GetNumPickup() test first the bit kHiGainSaturation before returning 36 // the high-gain or low-gain value, analogue for the corr. Setters. 37 // 38 // The three flags: kValid, kExcluded and kHiGainSaturation may be set. 39 // 29 40 ///////////////////////////////////////////////////////////////////////////// 30 41 #include "MCalibrationPix.h" … … 37 48 // 38 49 // Default Constructor: 50 // 51 // Sets: 52 // - fPixId to -1 53 // - fFlags to 0 54 // 55 // Calls: 56 // - Clear() 39 57 // 40 58 MCalibrationPix::MCalibrationPix(const char *name, const char *title) … … 52 70 // ------------------------------------------------------------------------ 53 71 // 54 // Invalidate values 72 // Sets: 73 // - all variables to -1 74 // - all flags to kFALSE 55 75 // 56 76 void MCalibrationPix::Clear(Option_t *o) -
trunk/MagicSoft/Mars/mcalib/MCalibrationPix.h
r3644 r3645 6 6 #endif 7 7 8 class MBadPixelsPix;9 8 class MCalibrationPix : public MParContainer 10 9 { … … 15 14 UInt_t fFlags; // Flag for the set bits 16 15 17 Float_t fHiGainMean; // The mean reduced charge after the fit18 Float_t fHiGainMeanVar; // The error of reduced mean charge after the fit19 Float_t fHiGainSigma; // The sigma of the mean charge after the fit20 Float_t fHiGainSigmaVar; // The error of the sigma of the mean charge after the fit21 Float_t fHiGainProb; // The probability of the fit function22 Float_t fHiGainNumPickup; // The number of pickup events in thehigh-gain16 Float_t fHiGainMean; // Mean from fit to high gain values 17 Float_t fHiGainMeanVar; // Error of mean from fit to high gain values 18 Float_t fHiGainSigma; // Sigma from fit to high gain values 19 Float_t fHiGainSigmaVar; // Error of sigma from fit to high gain values 20 Float_t fHiGainProb; // Probability of fit to high gain values 21 Float_t fHiGainNumPickup; // Number of pickup events in high-gain 23 22 24 Float_t fLoGainMean; // The mean reduced charge after the fit25 Float_t fLoGainMeanVar; // The error of reduced mean charge after the fit26 Float_t fLoGainSigma; // The sigma of the mean charge after the fit27 Float_t fLoGainSigmaVar; // The error of the sigma of the mean charge after the fit28 Float_t fLoGainProb; // The probability of the fit function29 Float_t fLoGainNumPickup; // The number of pickup events in thelow-gain23 Float_t fLoGainMean; // Mean from fit to high gain values 24 Float_t fLoGainMeanVar; // Error of mean from fit to low gain values 25 Float_t fLoGainSigma; // Sigma of from fit to low gain values 26 Float_t fLoGainSigmaVar; // Error of sigma from fit to low gain values 27 Float_t fLoGainProb; // Probability of fit to low gain values 28 Float_t fLoGainNumPickup; // Number of pickup events in low-gain 30 29 31 30 enum { kHiGainSaturation, kExcluded, kValid }; … … 94 93 Bool_t IsValid () const; 95 94 96 ClassDef(MCalibrationPix, 1) // Container for Calibration of one pixel95 ClassDef(MCalibrationPix, 1) // Base class container for Calibration Results Pixel 97 96 }; 98 97
Note:
See TracChangeset
for help on using the changeset viewer.