Changeset 3644 for trunk/MagicSoft/Mars
- Timestamp:
- 04/04/04 19:06:45 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3643 r3644 20 20 21 21 2004/04/02: Markus Gaug 22 23 * mcalib/MCalibrationQEPix.[h,cc] 24 * mcalib/MCalibrationQECam.[h,cc] 25 * mcalib/MCalibrationRelTimeCam.[h,cc] 26 * mcalib/MCalibrationRelTimePix.[h,cc] 27 - updated and enlarged documentation 28 29 22 30 * mcalib/MHGausEvents.[h,cc] 23 31 * mcalib/MHPedestalPix.[h,cc] … … 159 167 * mcalib/MHCalibrationChargeBlindPix.[h,cc] 160 168 * mcalib/MHCalibrationChargePINDiode.[h,cc] 169 * mcalib/MHCalibrationRelTimeCam.[h,cc] 161 170 * mcalib/MHCalibrationRelTimePix.[h,cc] 162 171 * mcalib/MHPedestalPix.[h,cc] -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r3638 r3644 378 378 { 379 379 380 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam) [i];381 MCalibrationQEPix &pqe = ( *fQECam)[i];380 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam) [i]; 381 MCalibrationQEPix &pqe = (MCalibrationQEPix&) (*fQECam)[i]; 382 382 MBadPixelsPix &bad = (*fBadPixels)[i]; 383 383 -
trunk/MagicSoft/Mars/mcalib/MCalibrationPix.cc
r3635 r3644 73 73 SetHiGainSaturation ( kFALSE ); 74 74 SetExcluded ( kFALSE ); 75 SetValid ( kFALSE ); 75 76 76 77 } … … 93 94 { 94 95 b ? SETBIT(fFlags, kExcluded) : CLRBIT(fFlags, kExcluded); 96 } 97 98 // -------------------------------------------------------------------------- 99 // 100 // Set the Valid Bit from outside 101 // 102 void MCalibrationPix::SetValid(Bool_t b ) 103 { 104 b ? SETBIT(fFlags, kValid) : CLRBIT(fFlags, kValid); 95 105 } 96 106 … … 119 129 120 130 131 Bool_t MCalibrationPix::IsHiGainSaturation() const 132 { 133 return TESTBIT(fFlags,kHiGainSaturation); 134 } 135 121 136 Bool_t MCalibrationPix::IsExcluded() const 122 137 { … … 124 139 } 125 140 126 Bool_t MCalibrationPix::Is HiGainSaturation()const141 Bool_t MCalibrationPix::IsValid() const 127 142 { 128 return TESTBIT(fFlags,k HiGainSaturation);143 return TESTBIT(fFlags,kValid); 129 144 } 130 145 -
trunk/MagicSoft/Mars/mcalib/MCalibrationPix.h
r3635 r3644 29 29 Float_t fLoGainNumPickup; // The number of pickup events in the low-gain 30 30 31 enum { kHiGainSaturation, kExcluded };31 enum { kHiGainSaturation, kExcluded, kValid }; 32 32 33 33 public: … … 62 62 void SetNumPickup ( const Float_t f ) { IsHiGainSaturation() ? fLoGainNumPickup = f : fHiGainNumPickup = f ; } 63 63 64 void SetExcluded ( const Bool_t b = kTRUE ); 64 65 void SetHiGainSaturation( const Bool_t b = kTRUE ); 65 void Set Excluded( const Bool_t b = kTRUE );66 void SetValid ( const Bool_t b = kTRUE ); 66 67 67 68 // Getters … … 89 90 Int_t GetPixId () const { return fPixId ; } 90 91 92 Bool_t IsHiGainSaturation() const; 91 93 Bool_t IsExcluded() const; 92 Bool_t Is HiGainSaturation()const;94 Bool_t IsValid () const; 93 95 94 96 ClassDef(MCalibrationPix, 1) // Container for Calibration of one pixel -
trunk/MagicSoft/Mars/mcalib/MCalibrationQECam.cc
r3321 r3644 28 28 // MCalibrationQECam 29 29 // 30 // Hold the calibrated QE information of the camera: 31 // 32 // 1) MCalibrationQECam initializes a TClonesArray whose elements are 33 // pointers to MCalibrationQEPix Containers 30 // Storage container for the calibrated Quantum Efficiency of the whole camera. 31 // 32 // Individual pixels have to be cast when retrieved e.g.: 33 // MCalibrationQEPix &avpix = (MCalibrationQEPix&)(*fQECam)[i] 34 // 35 // The following "calibration" constants can be retrieved from each pixel: 36 // - GetQE ( const PulserColor_t color ): The mean quantum 37 // efficiency obtained with the calibration pulser color (e.g. kGREEN, kBLUE, kUV) 38 // - GetQEErr( const PulserColor_t color ): The uncertainty 39 // of the mean quantum efficiency. 40 // 41 // Averaged values over one whole area index (e.g. inner or outer pixels for 42 // the MAGIC camera), can be retrieved via: 43 // MCalibrationRelTimePix &avpix = (MCalibrationRelTimePix&)fRelCam->GetAverageArea(i) 44 // 45 // Averaged values over one whole camera sector can be retrieved via: 46 // MCalibrationRelTimePix &avpix = (MCalibrationRelTimePix&)fRelCam->GetAverageSector(i) 47 // 48 // Note the averageing has been done at the end of the calculation and NOT on an 49 // event-by-event basis (like in other classes deriving from MCalibrationCam). 50 // 51 // See also: MHCalibrationChargePix, MHCalibrationChargeCam, MCalibrationChargeCalc 52 // 53 // The calculated values (types of GetPixelContent) are: 54 // 55 // 0: Mean Quantum Efficiency of the color: kCT1 56 // 1: Error of the Mean Quantum Efficiency of the color: kCT1 57 // 2: Mean Quantum Efficiency of the color: kGREEN 58 // 3: Error of the Mean Quantum Efficiency of the color: kGreen 59 // 4: Mean Quantum Efficiency of the color: kBLUE 60 // 5: Error of the Mean Quantum Efficiency of the color: kBlue 61 // 6: Mean Quantum Efficiency of the color: kUV 62 // 7: Error of the Mean Quantum Efficiency of the color: kUV 34 63 // 35 64 ///////////////////////////////////////////////////////////////////////////// … … 51 80 // Default constructor. 52 81 // 53 // Creates a TClonesArray of MCalibrationPix containers, initialized to 1 entry 54 // Later, a call to MCalibrationQECam::InitSize(Int_t size) has to be performed 55 // 56 // Creates an MCalibrationBlindPix container 82 // Creates a TClonesArray of MCalibrationQEPix containers, initialized to 1 entry, destinated 83 // to hold one container per pixel. Later, a call to MCalibrationQECam::InitSize() 84 // has to be performed (in MGeomApply). 57 85 // 58 86 MCalibrationQECam::MCalibrationQECam(const char *name, const char *title) … … 61 89 fTitle = title ? title : "Storage container for the calibrated Quantrum Efficiency of the camera"; 62 90 63 fPixels = new TClonesArray("MCalibrationQEPix",1); 64 65 Clear(); 66 } 67 68 // -------------------------------------------------------------------------- 69 // 70 MCalibrationQECam::~MCalibrationQECam() 71 { 72 73 // 74 // delete fPixels should delete all Objects stored inside 75 // 76 delete fPixels; 77 78 } 79 80 // ------------------------------------------------------------------- 81 // 82 void MCalibrationQECam::InitSize(const UInt_t i) 83 { 84 fPixels->ExpandCreate(i); 85 } 86 87 // -------------------------------------------------------------------------- 88 // 89 // This function returns the current size of the TClonesArray 90 // independently if the MCalibrationPix is filled with values or not. 91 // 92 // It is the size of the array fPixels. 93 // 94 Int_t MCalibrationQECam::GetSize() const 95 { 96 return fPixels->GetEntriesFast(); 97 } 98 99 100 // -------------------------------------------------------------------------- 101 // 102 // Get i-th pixel (pixel number) 103 // 104 MCalibrationQEPix &MCalibrationQECam::operator[](UInt_t i) 105 { 106 return *static_cast<MCalibrationQEPix*>(fPixels->UncheckedAt(i)); 107 } 108 109 // -------------------------------------------------------------------------- 110 // 111 // Get i-th pixel (pixel number) 112 // 113 const MCalibrationQEPix &MCalibrationQECam::operator[](UInt_t i) const 114 { 115 return *static_cast<MCalibrationQEPix*>(fPixels->UncheckedAt(i)); 116 } 117 118 119 // -------------------------------------- 120 // 121 void MCalibrationQECam::Clear(Option_t *o) 122 { 123 124 fPixels->ForEach(TObject, Clear)(); 125 126 return; 91 fPixels = new TClonesArray("MCalibrationQEPix",1); 92 fAverageAreas = new TClonesArray("MCalibrationQEPix",1); 93 fAverageSectors = new TClonesArray("MCalibrationQEPix",1); 94 127 95 } 128 96 … … 144 112 { 145 113 146 if (!pix->IsExcluded() && pix->Is QEValid())114 if (!pix->IsExcluded() && pix->IsValid()) 147 115 { 148 116 *fLog << all << "Pix " << pix->GetPixId() … … 164 132 { 165 133 166 if (!pix->IsExcluded() && !pix->Is QEValid())134 if (!pix->IsExcluded() && !pix->IsValid()) 167 135 { 168 136 *fLog << all << "Pix " << pix->GetPixId() … … 193 161 } 194 162 163 // -------------------------------------------------------------------- 164 // 165 // The calculated values (types) are: 166 // 167 // 0: Mean Quantum Efficiency of the color: kCT1 168 // 1: Error of the Mean Quantum Efficiency of the color: kCT1 169 // 2: Mean Quantum Efficiency of the color: kGREEN 170 // 3: Error of the Mean Quantum Efficiency of the color: kGreen 171 // 4: Mean Quantum Efficiency of the color: kBLUE 172 // 5: Error of the Mean Quantum Efficiency of the color: kBlue 173 // 6: Mean Quantum Efficiency of the color: kUV 174 // 7: Error of the Mean Quantum Efficiency of the color: kUV 195 175 // 196 176 Bool_t MCalibrationQECam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const … … 198 178 199 179 if (idx > GetSize()) 180 return kFALSE; 181 182 MCalibrationQEPix &pix = (MCalibrationQEPix&)(*this)[idx]; 183 184 if (pix.IsExcluded()) 200 185 return kFALSE; 201 186 … … 203 188 { 204 189 case 0: 205 if ((*this)[idx].IsExcluded()) 206 return kFALSE; 207 val = (*this)[idx].GetQE(kCT1); 190 val = pix.GetQE(kCT1); 208 191 break; 209 192 case 1: 210 if ((*this)[idx].IsExcluded()) 211 return kFALSE; 212 val = (*this)[idx].GetQEErr(kCT1); 193 val = pix.GetQEErr(kCT1); 194 break; 195 case 2: 196 val = pix.GetQE(kGREEN); 197 break; 198 case 3: 199 val = pix.GetQEErr(kGREEN); 200 break; 201 case 4: 202 val = pix.GetQE(kBLUE); 203 break; 204 case 5: 205 val = pix.GetQEErr(kBLUE); 206 break; 207 case 6: 208 val = pix.GetQE(kUV); 209 break; 210 case 7: 211 val = pix.GetQEErr(kUV); 213 212 break; 214 213 default: … … 220 219 // -------------------------------------------------------------------------- 221 220 // 222 // What MHCamera needs in order to draw an individual pixel in the camera221 // Not yet implemented 223 222 // 224 223 void MCalibrationQECam::DrawPixelContent(Int_t idx) const 225 224 { 226 227 } 228 229 230 231 232 233 234 235 236 225 return; 226 } 227 228 229 230 231 232 233 234 235 -
trunk/MagicSoft/Mars/mcalib/MCalibrationQECam.h
r3321 r3644 2 2 #define MARS_MCalibrationQECam 3 3 4 #ifndef MARS_MParContainer 5 #include "MParContainer.h" 6 #endif 7 #ifndef MARS_MCamEvent 8 #include "MCamEvent.h" 4 #ifndef MARS_MCalibrationCam 5 #include "MCalibrationCam.h" 9 6 #endif 10 7 11 class TClonesArray; 12 13 class MCalibrationQEPix; 14 class MCalibrationQECam : public MParContainer, public MCamEvent 8 class MCalibrationQECam : public MCalibrationCam 15 9 { 16 10 private: 17 18 Int_t fNumPixels;19 TClonesArray *fPixels; //-> Array of MCalibrationPix with fit results20 11 21 12 public: 22 13 23 14 MCalibrationQECam(const char *name=NULL, const char *title=NULL); 24 ~MCalibrationQECam(); 25 26 void Clear( Option_t *o="" ); 27 void InitSize( const UInt_t i ); 28 29 // Getters 30 Int_t GetSize() const; 31 UInt_t GetNumPixels() const { return fNumPixels; } 32 33 // Others 34 MCalibrationQEPix &operator[](UInt_t i); 35 const MCalibrationQEPix &operator[](UInt_t i) const; 15 ~MCalibrationQECam() {} 36 16 37 17 // Prints … … 42 22 void DrawPixelContent(Int_t num) const; 43 23 44 ClassDef(MCalibrationQECam, 1) // Container for calibration information of the camera24 ClassDef(MCalibrationQECam, 1) // Container for Quantum Efficieny Calibration Results Camera 45 25 }; 46 26 -
trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.cc
r3321 r3644 25 25 ///////////////////////////////////////////////////////////////////////////// 26 26 // // 27 // MCalibration ChargePix//27 // MCalibrationQEPix // 28 28 // // 29 29 // Storage container of the calibrated Quantrum Efficiency of one pixel … … 89 89 // 90 90 MCalibrationQEPix::MCalibrationQEPix(const char *name, const char *title) 91 : fPixId(-1)92 91 { 93 92 … … 105 104 void MCalibrationQEPix::Clear(Option_t *o) 106 105 { 107 108 SetExcluded ( kFALSE );109 SetQEValid ( kFALSE );110 106 111 107 fQEGreen = -1.; … … 119 115 fQECT1Err = -1.; 120 116 117 MCalibrationPix::Clear(); 118 121 119 } 122 120 … … 169 167 170 168 171 172 // --------------------------------------------------------------------------173 //174 // Set the Excluded Bit from outside175 //176 void MCalibrationQEPix::SetExcluded(Bool_t b )177 {178 b ? SETBIT(fFlags, kExcluded) : CLRBIT(fFlags, kExcluded);179 }180 181 // --------------------------------------------------------------------------182 //183 // Set the Excluded Bit from outside184 //185 void MCalibrationQEPix::SetQEValid(Bool_t b )186 {187 b ? SETBIT(fFlags, kQEValid) : CLRBIT(fFlags, kQEValid);188 }189 190 191 Int_t MCalibrationQEPix::GetPixId() const192 {193 return fPixId;194 }195 196 169 Float_t MCalibrationQEPix::GetQE(const PulserColor_t col ) const 197 170 { … … 240 213 } 241 214 242 243 Bool_t MCalibrationQEPix::IsExcluded() const 244 { 245 return TESTBIT(fFlags,kExcluded); 246 } 247 248 249 Bool_t MCalibrationQEPix::IsQEValid() const 250 { 251 return TESTBIT(fFlags, kQEValid); 252 } 253 254 215 // -------------------------------------------------------------- 255 216 // 256 217 // The check return kTRUE if: 257 218 // 258 // 1) Pixel has a fitted charge greater than fQELimit*PedRMS 259 // 2) Pixel has a fit error greater than fQEErrLimit 260 // 3) Pixel has a fitted charge greater its fQERelErrLimit times its charge error 261 // 4) Pixel has a charge sigma bigger than its Pedestal RMS 262 // 219 // Not yet implemented! 220 // 263 221 Bool_t MCalibrationQEPix::CheckQEValidity() 264 222 { 265 223 266 Set QEValid();224 SetValid(); 267 225 return kTRUE; 268 226 } -
trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.h
r3554 r3644 2 2 #define MARS_MCalibrationQEPix 3 3 4 #ifndef MARS_M ParContainer5 #include "M ParContainer.h"4 #ifndef MARS_MCalibrationPix 5 #include "MCalibrationPix.h" 6 6 #endif 7 7 8 class MCalibrationQEPix : public M ParContainer8 class MCalibrationQEPix : public MCalibrationPix 9 9 { 10 10 private: 11 11 12 Int_t fPixId; 13 14 Float_t fQEGreen; 15 Float_t fQEBlue; 16 Float_t fQEUV; 17 Float_t fQECT1; 12 Float_t fQEGreen; // The calibrated quantum efficiency at 520 nm 13 Float_t fQEBlue; // The calibrated quantum efficiency at 460 nm 14 Float_t fQEUV; // The calibrated quantum efficiency at 370 nm 15 Float_t fQECT1; // The calibrated quantum efficiency at 370 nm 18 16 19 Float_t fQEGreenErr; 20 Float_t fQEBlueErr; 21 Float_t fQEUVErr; 22 Float_t fQECT1Err; 17 Float_t fQEGreenErr; // The uncertainty about the calibrated QE at 520 nm 18 Float_t fQEBlueErr; // The uncertainty about the calibrated QE at 460 nm 19 Float_t fQEUVErr; // The uncertainty about the calibrated QE at 370 nm 20 Float_t fQECT1Err; // The uncertainty about the calibrated QE at 370 nm 23 21 24 Byte_t fFlags;25 26 enum { kExcluded, kQEValid };27 28 22 public: 29 23 … … 37 31 void SetQEErr( const Float_t qeerr, const PulserColor_t col ); 38 32 39 void SetExcluded ( const Bool_t b = kTRUE );40 void SetQEValid ( const Bool_t b = kTRUE );41 42 33 // Getters 43 34 Float_t GetQE ( const PulserColor_t col ) const; 44 35 Float_t GetQEErr( const PulserColor_t col ) const; 45 Int_t GetPixId() const;46 47 Bool_t IsExcluded() const;48 Bool_t IsQEValid() const;49 50 void SetPixId(const Int_t i) { fPixId = i; }51 36 52 37 // Miscellaneous 53 38 Bool_t CheckQEValidity(); 54 39 55 ClassDef(MCalibrationQEPix, 1) // Container for calibrated Quantrum Efficieny of one pixel40 ClassDef(MCalibrationQEPix, 1) // Container for Quantum Efficieny Calibration Results Pixel 56 41 }; 57 42 -
trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCam.cc
r3635 r3644 27 27 // MCalibrationRelTimeCam 28 28 // 29 // Hold the whole Calibration results of the camera: 30 // 31 // 1) MCalibrationRelTimeCam initializes a TClonesArray whose elements are 32 // pointers to MCalibrationRelTimePix Containers 33 // 29 // Storage container for relative arrival time calibration results 30 // of the whole camera. 31 // 32 // Individual pixels have to be cast when retrieved e.g.: 33 // MCalibrationRelTimePix &avpix = (MCalibrationRelTimePix&)(*fRelCam)[i] 34 // 35 // The following "calibration" constants can be retrieved from each pixel: 36 // - GetTimeOffset(): The mean offset in relative times, 37 // has to be added to any calculated relative time in the camera. 38 // - GetTimePrecision(): The Gauss sigma of histogrammed relative arrival 39 // times for the calibration run. Gives an estimate about the timing 40 // resolution. 41 // 42 // ALL RELATIVE TIMES HAVE TO BE CALCULATED W.R.T. PIXEL IDX 1 43 // (HARDWARE NUMBER: 2) !! 44 // 45 // Averaged values over one whole area index (e.g. inner or outer pixels for 46 // the MAGIC camera), can be retrieved via: 47 // MCalibrationRelTimePix &avpix = (MCalibrationRelTimePix&)fRelCam->GetAverageArea(i) 48 // 49 // Averaged values over one whole camera sector can be retrieved via: 50 // MCalibrationRelTimePix &avpix = (MCalibrationRelTimePix&)fRelCam->GetAverageSector(i) 51 // 52 // Note the averageing has been done on an event-by-event basis. Resulting 53 // Sigma's of the Gauss fit have been multiplied with the square root of the number 54 // of involved pixels in order to make a direct comparison possible with the mean of 55 // sigmas. 56 // 57 // See also: MHCalibrationRelTimePix, MHCalibrationRelTimeCam 58 // 34 59 // The calculated values (types of GetPixelContent) are: 35 60 // … … 37 62 // ============== 38 63 // 39 // 0: Fitted RelTime40 // 1: Error of fitted RelTime41 // 2: Sigma of fitted RelTime42 // 3: Error of Sigma of fitted RelTime64 // 0: Mean Time Offset 65 // 1: Error of Mean Time Offset 66 // 2: Sigma of Time Offset == Time Resolution 67 // 3: Error of Sigma of Time Offset 43 68 // 44 69 // Useful variables derived from the fit results: 45 70 // ============================================= 46 71 // 47 // 4: Returned probability of Gauss fit to Rel Time distribution72 // 4: Returned probability of Gauss fit to Rel. Arrival Time distribution 48 73 // 49 74 ///////////////////////////////////////////////////////////////////////////// … … 69 94 // Default constructor. 70 95 // 71 // Creates a TClonesArray of MCalibrationPix containers, initialized to 1 entry 72 // Later, a call to MCalibrationRelTimeCam::InitSize(Int_t size) has to be performed 73 // 74 // Creates an MCalibrationBlindPix container 96 // Creates a TClonesArray of MCalibrationPix containers, initialized to 1 entry, destinated 97 // to hold one container per pixel. Later, a call to MCalibrationRelTimeCam::InitSize() 98 // has to be performed (in MGeomApply). 99 // 100 // Creates a TClonesArray of MCalibrationPix containers, initialized to 1 entry, destinated 101 // to hold one container per pixel AREA. Later, a call to MCalibrationRelTimeCam::InitAreas() 102 // has to be performed (in MGeomApply). 103 // 104 // Creates a TClonesArray of MCalibrationPix containers, initialized to 1 entry, destinated 105 // to hold one container per camera SECTOR. Later, a call to MCalibrationRelTimeCam::InitSectors() 106 // has to be performed (in MGeomApply). 75 107 // 76 108 MCalibrationRelTimeCam::MCalibrationRelTimeCam(const char *name, const char *title) … … 83 115 fAverageSectors = new TClonesArray("MCalibrationRelTimePix",1); 84 116 85 Clear();86 87 }88 89 90 91 // --------------------------------------92 //93 void MCalibrationRelTimeCam::Clear(Option_t *o)94 {95 96 MCalibrationCam::Clear();97 98 CLRBIT(fFlags,kValid);99 100 return;101 }102 103 void MCalibrationRelTimeCam::SetValid(const Bool_t b)104 {105 b ? SETBIT(fFlags, kValid) : CLRBIT(fFlags, kValid);106 }107 108 109 Bool_t MCalibrationRelTimeCam::IsValid() const110 {111 return TESTBIT(fFlags,kValid);112 117 } 113 118 … … 115 120 // 116 121 // Print first the well fitted pixels 117 // and then the ones which are not FitValid122 // and then the ones which are not Valid 118 123 // 119 124 void MCalibrationRelTimeCam::Print(Option_t *o) const … … 254 259 // -------------------------------------------------------------------------- 255 260 // 256 // What MHCamera needs in order to draw an individual pixel in the camera261 // Calls MCalibrationPix::DrawClone() 257 262 // 258 263 void MCalibrationRelTimeCam::DrawPixelContent(Int_t idx) const … … 261 266 } 262 267 263 264 265 Bool_t MCalibrationRelTimeCam::GetConversion(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma)266 {267 268 MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*this)[ipx];269 270 mean = pix.GetMeanConversion();271 err = pix.GetConversionErr();272 sigma = pix.GetSigmaConversion();273 274 return kTRUE;275 }276 277 -
trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCam.h
r3635 r3644 6 6 #endif 7 7 8 class MCalibrationRelTimePix;9 class MBadPixelsPix;10 class MBadPixelsCam;11 8 class MCalibrationRelTimeCam : public MCalibrationCam 12 9 { 13 10 private: 14 11 15 enum { kValid };16 17 12 public: 18 13 19 14 MCalibrationRelTimeCam(const char *name=NULL, const char *title=NULL); 20 15 ~MCalibrationRelTimeCam() {} 21 22 23 void Clear( Option_t *o="" );24 25 // Setters26 void SetValid( const Bool_t b = kTRUE );27 28 Bool_t GetConversion( Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma );29 30 Bool_t IsValid() const;31 16 32 17 // Prints 33 18 void Print(Option_t *o="") const; 34 19 35 // Draws 20 // Others 21 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 36 22 void DrawPixelContent(Int_t num) const; 37 23 38 // Others 39 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 40 41 ClassDef(MCalibrationRelTimeCam, 1) // Container for calibration of the camera 24 ClassDef(MCalibrationRelTimeCam, 1) // Container Rel. Arrival Time Calibration Results Camera 42 25 }; 43 26 -
trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimePix.cc
r3638 r3644 25 25 // MCalibrationRelTimePix // 26 26 // // 27 // Storage container to hold informations about the calibrated arrival time// 28 // value of one Pixel (PMT). // 27 // Storage container for relative arrival time calibration results // 28 // of one Pixel (PMT). // 29 // The following "calibration" constants can be retrieved: // 30 // - GetTimeOffset(): The mean offset in relative times, 31 // has to be added to any calculated relative time in the camera. 32 // - GetTimePrecision(): The Gauss sigma of histogrammed relative arrival 33 // times for the calibration run. Gives an estimate about the timing 34 // resolution. 35 // 36 // ALL RELATIVE TIMES HAVE TO BE CALCULATED W.R.T. PIXEL IDX 1 37 // (HARDWARE NUMBER: 2) !! 38 // 39 // See also: MHCalibrationRelTimePix, MHCalibrationRelTimeCam // 29 40 // // 30 41 ///////////////////////////////////////////////////////////////////////////// … … 36 47 // -------------------------------------------------------------------------- 37 48 // 38 // Default Constructor :49 // Default Constructor 39 50 // 40 51 MCalibrationRelTimePix::MCalibrationRelTimePix(const char *name, const char *title) 41 : fRelTimeFlags(0)42 52 { 43 53 44 54 fName = name ? name : "MCalibrationRelTimePix"; 45 fTitle = title ? title : "Container of the fit results of MHCalibrationRelTimePixs "; 46 47 Clear(); 55 fTitle = title ? title : "Results of MHCalibrationRelTimePix "; 48 56 49 57 } 50 58 51 // ------------------------------------------------------------------------52 //53 // Invalidate values54 //55 void MCalibrationRelTimePix::Clear(Option_t *o)56 {57 58 SetValid ( kFALSE );59 60 fMeanConversion = -1.;61 fConversionVar = -1.;62 fSigmaConversion = -1.;63 64 MCalibrationPix::Clear();65 }66 67 68 // --------------------------------------------------------------------------69 //70 // Set the conversion factors from outside (only for MC)71 //72 void MCalibrationRelTimePix::SetConversion(Float_t c, Float_t err, Float_t sig)73 {74 fMeanConversion = c;75 fConversionVar = err*err;76 fSigmaConversion = sig;77 }78 79 80 // --------------------------------------------------------------------------81 //82 // Set the Excluded Bit from outside83 //84 void MCalibrationRelTimePix::SetValid(const Bool_t b )85 {86 b ? SETBIT(fRelTimeFlags, kValid) : CLRBIT(fRelTimeFlags, kValid);87 }88 89 90 Float_t MCalibrationRelTimePix::GetConversionErr() const91 {92 if (fConversionVar < 0.)93 return -1.;94 return TMath::Sqrt(fConversionVar);95 }96 97 98 Bool_t MCalibrationRelTimePix::IsValid() const99 {100 return TESTBIT(fRelTimeFlags, kValid);101 } -
trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimePix.h
r3638 r3644 10 10 private: 11 11 12 Float_t fMeanConversion; // The conversion factor to Phe's (F-factor method)13 Float_t fConversionVar; // The error of the conversion factor to Phe's (F-factor method)14 Float_t fSigmaConversion; // The sigma of conversion factor to Phe's (F-factor method)15 16 Byte_t fRelTimeFlags; // The bit-field for the class-own bits17 18 enum { kValid }; // The possible bits to be set19 20 12 public: 21 13 … … 23 15 ~MCalibrationRelTimePix() {} 24 16 25 void Clear(Option_t *o="");26 27 // Conversion Factors28 void SetConversion ( Float_t c, Float_t err, Float_t sig );29 30 // Setters31 void SetValid( const Bool_t b = kTRUE );32 33 Float_t GetMeanConversion() const { return fMeanConversion; }34 Float_t GetConversionErr() const;35 Float_t GetSigmaConversion() const { return fSigmaConversion; }36 37 17 Float_t GetTimeOffset() const { return GetMean(); } 38 18 Float_t GetTimeOffsetErr() const { return GetMeanErr(); } … … 40 20 Float_t GetTimePrecisionErr() const { return GetSigmaErr(); } 41 21 42 Bool_t IsValid() const; 43 44 ClassDef(MCalibrationRelTimePix, 1) // Container for Calibration of one pixel 22 ClassDef(MCalibrationRelTimePix, 1) // Container Rel. Arrival Time Calibration Results Pixel 45 23 }; 46 24
Note:
See TracChangeset
for help on using the changeset viewer.