- Timestamp:
- 08/17/04 23:31:30 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeBlindCam.cc
r4401 r4669 27 27 // MCalibrationChargeBlindCam 28 28 // 29 // Base class for Blind Pixels Calibration results. 29 // Base class for Blind Pixels Calibration results. Derived classes intialize 30 // the actual values of the MCalibrationBlindPix's. 30 31 // 31 32 // Contains TClonesArrays for the following objects: … … 36 37 // - InitSize() 37 38 // 39 // See also: MCalibrationChargeBlindCamOneOldStyle 40 // 38 41 ///////////////////////////////////////////////////////////////////////////// 39 42 #include "MCalibrationChargeBlindCam.h" … … 41 44 42 45 #include "MCalibrationCam.h" 43 #include "MCalibrationPix.h" 44 45 #include "MLog.h" 46 #include "MLogManip.h" 47 48 #include <TClonesArray.h> 46 #include "MParContainer.h" 49 47 50 48 ClassImp(MCalibrationChargeBlindCam); … … 54 52 // 55 53 // Default constructor. 56 //57 // Set the following pointer to NULL:58 // - fBlindPixels59 54 // 60 55 // Initializes: … … 68 63 // has to be performed in order to get the dimension correctly. 69 64 // 70 MCalibrationChargeBlindCam::MCalibrationChargeBlindCam( const char *name, const char *title)71 : f PulserColor(MCalibrationCam::kNONE),72 f BlindPixels(NULL),73 f Valid(kFALSE)65 MCalibrationChargeBlindCam::MCalibrationChargeBlindCam(UInt_t nblind,const char *name, const char *title) 66 : fNumBlindPixels(nblind), 67 fPulserColor(MCalibrationCam::kNONE), 68 fBlindPixels(nblind) 74 69 { 70 75 71 fName = name ? name : "MCalibrationChargeBlindCam"; 76 fTitle = title ? title : "C ontainer for the Calibration Information of the blind pixels in thecamera";72 fTitle = title ? title : "Calibration Information of blinded pixels in camera"; 77 73 78 fBlindPixels = new TClonesArray("MCalibrationChargeBlindPix",1); 74 // 75 // make sure that the destructor delete all contained objects 76 // 77 fBlindPixels.SetOwner(); 78 79 for (UInt_t i=0; i<nblind; i++) 80 fBlindPixels[i] = new MCalibrationChargeBlindPix; 81 79 82 } 80 83 81 // --------------------------------------------------------------------------82 //83 // Deletes the following TClonesArray's of MCalibrationPix containers (if exist):84 // - fBlindPixels85 //86 MCalibrationChargeBlindCam::~MCalibrationChargeBlindCam()87 {88 89 //90 // delete fBlindPixels should delete all Objects stored inside91 //92 delete fBlindPixels;93 94 }95 84 96 85 // -------------------------------------- … … 100 89 void MCalibrationChargeBlindCam::Clear(Option_t *o) 101 90 { 102 103 fBlindPixels->ForEach(TObject, Clear)(); 104 105 return; 91 fBlindPixels.ForEach(TObject, Clear)(); 106 92 } 107 93 108 94 // ----------------------------------------------------- 109 95 // 110 // own copy function to do the initialization correctly96 // copy 'constructor' 111 97 // 112 98 void MCalibrationChargeBlindCam::Copy(TObject& object) const 113 99 { 114 100 101 MParContainer::Copy(object); 102 115 103 MCalibrationChargeBlindCam &calib = (MCalibrationChargeBlindCam&)object; 116 117 MParContainer::Copy(calib); 118 119 calib.fPulserColor = fPulserColor; 120 121 const Int_t n3 = GetSize(); 122 if (n3 != 0) 104 calib.fPulserColor = fPulserColor; 105 calib.fNumBlindPixels = fNumBlindPixels; 106 107 for (UInt_t i=0; i<fNumBlindPixels; i++) 123 108 { 124 calib.InitSize(n3); 125 for (int i=0; i<n3; i++) 126 (*this)[i].Copy(calib[i]); 109 calib.fBlindPixels[i] = new MCalibrationChargeBlindPix; 110 (*this)[i].Copy(calib[i]); 127 111 } 128 129 112 } 130 131 // -------------------------------------------------------------------132 //133 // Calls TClonesArray::ExpandCreate() for fBlindPixels134 //135 void MCalibrationChargeBlindCam::InitSize(const UInt_t i)136 {137 fBlindPixels->ExpandCreate(i);138 }139 140 113 141 114 // -------------------------------------------------------------------------- … … 145 118 MCalibrationChargeBlindPix &MCalibrationChargeBlindCam::operator[](UInt_t i) 146 119 { 147 return *static_cast<MCalibrationChargeBlindPix*>(fBlindPixels ->UncheckedAt(i));120 return *static_cast<MCalibrationChargeBlindPix*>(fBlindPixels.UncheckedAt(i)); 148 121 } 149 122 … … 154 127 const MCalibrationChargeBlindPix &MCalibrationChargeBlindCam::operator[](UInt_t i) const 155 128 { 156 return *static_cast<MCalibrationChargeBlindPix*>(fBlindPixels ->UncheckedAt(i));129 return *static_cast<MCalibrationChargeBlindPix*>(fBlindPixels.UncheckedAt(i)); 157 130 } 131 158 132 159 133 // -------------------------------------------------------------------------- 160 134 // 161 // Returns the current size of the TClonesArray fBlindPixels 162 // independently if the MCalibrationChargeBlindPix is filled with values or not. 163 // 164 const Int_t MCalibrationChargeBlindCam::GetSize() const 165 { 166 return fBlindPixels->GetEntriesFast(); 167 } 168 169 // -------------------------------------------------------------------------- 170 // 171 // Print first the results of the pixels 172 // and then the ones which are not FitValid 135 // Print the results of the blind pixels 173 136 // 174 137 void MCalibrationChargeBlindCam::Print(Option_t *o) const 175 138 { 176 139 177 *fLog << all << GetDescriptor() << ":" << endl; 178 int id = 0; 179 180 *fLog << all << "Calibrated Blind pixels:" << endl; 181 *fLog << all << endl; 182 183 TIter Next(fBlindPixels); 184 MCalibrationChargeBlindPix *pix; 185 while ((pix=(MCalibrationChargeBlindPix*)Next())) 186 { 187 188 if (pix->IsSinglePheFitOK()) 189 { 190 191 *fLog << all 192 << Form("%s%3i","BlindPixel: ",pix->GetPixId()) 193 << Form("%s%4.2f%s%4.2f"," Lambda: ",pix->GetLambda(),"+-",pix->GetLambdaErr()) 194 << Form("%s%4.2f%s%4.2f"," Mu0: ",pix->GetMu0(),"+-",pix->GetMu0Err()) 195 << Form("%s%4.2f%s%4.2f"," Mu1: ",pix->GetMu1(),"+-",pix->GetMu1Err()) 196 << Form("%s%4.2f%s%4.2f"," Sigma0: ",pix->GetSigma0(),"+-",pix->GetSigma0Err()) 197 << Form("%s%4.2f%s%4.2f"," Sigma1: ",pix->GetSigma1(),"+-",pix->GetSigma1Err()) 198 << endl; 199 *fLog << all 200 << " Pedestal Fit OK? :" << pix->IsPedestalFitOK() 201 << Form("%s%4.2f%s%4.2f"," Lambda (Check): " ,pix->GetLambdaCheck(),"+-",pix->GetLambdaCheckErr()) << endl; 202 *fLog << all 203 << " Flux available? :" << pix->IsFluxInsidePlexiglassAvailable() 204 << Form("%s%4.2f%s%4.2f"," Flux: " ,pix->GetFluxInsidePlexiglass(),"+-",pix->GetFluxInsidePlexiglassErr()) 205 << endl; 206 id++; 207 } 208 } 209 *fLog << all << id << " blind pixels OK" << endl; 210 id = 0; 211 212 TIter Next2(fBlindPixels); 213 while ((pix=(MCalibrationChargeBlindPix*)Next2())) 214 { 215 216 if (!pix->IsSinglePheFitOK()) 217 { 218 219 *fLog << all 220 << Form("%s%3i","BlindPixel: ",pix->GetPixId()) 221 << Form("%s%4.2f%s%4.2f"," Lambda: ",pix->GetLambda(),"+-",pix->GetLambdaErr()) 222 << Form("%s%4.2f%s%4.2f"," Mu0: ",pix->GetMu0(),"+-",pix->GetMu0Err()) 223 << Form("%s%4.2f%s%4.2f"," Mu1: ",pix->GetMu1(),"+-",pix->GetMu1Err()) 224 << Form("%s%4.2f%s%4.2f"," Sigma0: ",pix->GetSigma0(),"+-",pix->GetSigma0Err()) 225 << Form("%s%4.2f%s%4.2f"," Sigma1: ",pix->GetSigma1(),"+-",pix->GetSigma1Err()) 226 << endl; 227 *fLog << all 228 << " Pedestal Fit OK? :" << pix->IsPedestalFitOK() 229 << Form("%s%4.2f%s%4.2f"," Lambda (Check): " ,pix->GetLambdaCheck(),"+-",pix->GetLambdaCheckErr()) << endl; 230 *fLog << all 231 << " Flux available? :" << pix->IsFluxInsidePlexiglassAvailable() 232 << Form("%s%4.2f%s%4.2f"," Flux: " ,pix->GetFluxInsidePlexiglass(),"+-",pix->GetFluxInsidePlexiglassErr()) 233 << endl; 234 id++; 235 } 236 } 237 *fLog << all << id << " blind pixels NOT OK" << endl; 238 140 fBlindPixels.Print(); 239 141 }
Note:
See TracChangeset
for help on using the changeset viewer.