Changeset 2274 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 07/12/03 22:01:34 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc
r2206 r2274 29 29 // 30 30 // This is the specific image cleaning for a list of pixels. This task 31 // sets the pixels listed in fPixelsI Dto unused so they should not be31 // sets the pixels listed in fPixelsIdx to unused so they should not be 32 32 // used for analysis (eg calculation of hillas parameters). 33 33 // … … 130 130 return kTRUE; 131 131 132 const UShort_t size = fPixelsI D.GetSize();132 const UShort_t size = fPixelsIdx.GetSize(); 133 133 134 134 if (size == 0) … … 145 145 // through the macros 146 146 147 UShort_t numids = fPixelsI D.GetSize();147 UShort_t numids = fPixelsIdx.GetSize(); 148 148 149 149 for(Int_t i = 0; i<numids; i++) 150 fPixels->SetPixelBlind(fPixelsI D[i]);150 fPixels->SetPixelBlind(fPixelsIdx[i]); 151 151 152 152 return kTRUE; … … 167 167 168 168 // 169 // remove the pixels in fPixelsI Dif they are set to be used,169 // remove the pixels in fPixelsIdx if they are set to be used, 170 170 // (set them to 'unused' state) 171 171 // … … 174 174 MCerPhotPix &pix = (*fEvt)[i]; 175 175 176 const Int_t id = pix.GetPixId();177 178 if (!fPixels->IsBlind(id ))176 const Int_t idx = pix.GetPixId(); 177 178 if (!fPixels->IsBlind(idx)) 179 179 continue; 180 180 181 const MGeomPix &gpix = (*fGeomCam)[id]; 182 183 const Int_t n = gpix.GetNumNeighbors(); 181 const MGeomPix &gpix = (*fGeomCam)[idx]; 184 182 185 183 Int_t num = TESTBIT(fFlags, kUseCentralPixel) ? 1 : 0; … … 188 186 perr[i] = TESTBIT(fFlags, kUseCentralPixel) ? pix.GetErrorPhot() : 0; 189 187 190 nphot[i] *= fGeomCam->GetPixRatio(id );188 nphot[i] *= fGeomCam->GetPixRatio(idx); 191 189 // FIXME: perr[i] ??? 192 190 191 const Int_t n = gpix.GetNumNeighbors(); 193 192 for (int j=0; j<n; j++) 194 193 { 195 const UShort_t nid = gpix.GetNeighbor(j);196 197 if (fPixels->IsBlind(nid ))194 const UShort_t nidx = gpix.GetNeighbor(j); 195 196 if (fPixels->IsBlind(nidx)) 198 197 continue; 199 198 200 const MCerPhotPix *evtpix = fEvt->GetPixById(nid );199 const MCerPhotPix *evtpix = fEvt->GetPixById(nidx); 201 200 if (evtpix) 202 201 { 203 nphot[i] += evtpix->GetNumPhotons()*fGeomCam->GetPixRatio(nid );202 nphot[i] += evtpix->GetNumPhotons()*fGeomCam->GetPixRatio(nidx); 204 203 perr[i] += evtpix->GetErrorPhot(); 205 204 // FIXME: perr[i] ??? … … 208 207 } 209 208 210 nphot[i] /= num*fGeomCam->GetPixRatio(id );209 nphot[i] /= num*fGeomCam->GetPixRatio(idx); 211 210 perr[i] /= num/*FIXME:???*/; 212 211 } … … 235 234 236 235 // 237 // remove the pixels in fPixelsI Dif they are set to be used,236 // remove the pixels in fPixelsIdx if they are set to be used, 238 237 // (set them to 'unused' state) 239 238 // … … 244 243 if (fPixels->IsBlind(pix.GetPixId())) 245 244 pix.SetPixelUnused(); 246 247 245 } 248 246 } … … 264 262 // -------------------------------------------------------------------------- 265 263 // 266 // Set pixels to no be used.267 // This member function (public) should be called from the macro (or268 // analysis program) setting the desired blind pixels.269 // In the future, the blind pixels may be extracted from information which270 // is already in the root file.271 //272 void MBlindPixelCalc::SetPixels(Int_t num, Short_t *ids)273 {274 fPixelsID.Adopt(num, ids);275 }276 277 // --------------------------------------------------------------------------278 //279 264 // - Check whether pixels to disable are available. If pixels are 280 265 // given by the user nothing more is done. … … 290 275 // If pixels are given by the user, we are already done 291 276 // 292 if (fPixelsI D.GetSize() > 0)277 if (fPixelsIdx.GetSize() > 0) 293 278 return kTRUE; 294 279 … … 355 340 out << " " << GetUniqueName() << ".SetUseCentralPixel();" << endl; 356 341 357 if (fPixelsI D.GetSize()==0)342 if (fPixelsIdx.GetSize()==0) 358 343 return; 359 344 360 345 out << " {" << endl; 361 346 out << " TArrayS dummy;" << endl; 362 for (int i=0; i<fPixelsI D.GetSize(); i++)363 out << " dummy[" << i << "]=" << ((TArrayS)fPixelsI D)[i] << ";" << endl;347 for (int i=0; i<fPixelsIdx.GetSize(); i++) 348 out << " dummy[" << i << "]=" << ((TArrayS)fPixelsIdx)[i] << ";" << endl; 364 349 out << " " << GetUniqueName() << ".SetPixels(dummy);" << endl; 365 350 out << " }" << endl; -
trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.h
r2206 r2274 21 21 MGeomCam *fGeomCam; //! 22 22 23 TArrayS fPixelsI D; // Pixel IDs for blind pixels, which are entered by the user.23 TArrayS fPixelsIdx; // Pixel Indices for blind pixels, which are entered by the user. 24 24 25 25 Byte_t fFlags; // flag for the method which is used … … 55 55 } 56 56 57 void SetPixels(Int_t num, Short_t *ids); 58 void SetPixels(const TArrayS pix) { SetPixels((Int_t)pix.GetSize(), (Short_t*)pix.GetArray()); } 57 void SetPixelIndices(const TArrayS &pix) { fPixelsIdx = pix; } 59 58 virtual Bool_t ReInit(MParList *pList); 60 59
Note:
See TracChangeset
for help on using the changeset viewer.