Changeset 1466 for trunk/MagicSoft
- Timestamp:
- 08/01/02 10:27:39 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1465 r1466 25 25 - some changes to the layout 26 26 - added support for the sign in MHHillasExt 27 28 * manalysis/MBlindPixelCalc.[h,cc]: 29 - added the possibility to use the interpolation of the 30 surrounding pixels 31 - clean the array with the blind pixel IDs at any ReInit 32 33 * manalysis/MBlindPixels.h: 34 - IsBlind now checks also for the validity of the array 35 36 * manalysis/MCerPhotPix.h: 37 - added Set-function 38 39 * manalysis/MHillas.cc: 40 - Don't ouput a warning if fSize==0 or fNumUsedPixels<0 41 (happens too often) 42 43 * manalysis/MCameraSmooth.[h,cc]: 44 - added 45 46 * manalysis/Makefile, manalysis/AnalysisLinkDef.h: 47 - added MCameraSmooth 27 48 28 49 -
trunk/MagicSoft/Mars/NEWS
r1460 r1466 59 59 MHillasExt are now scaled with the pixel size, so that one get 60 60 a four times smaller value for the bigger pixels in the outer ring. 61 62 - added new task to smooth the camera (MCameraSmooth) 63 64 - added possibility to use interpolated pixel values for blind pixels 65 instead of removing it completely from the analysis 61 66 62 67 -
trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
r1426 r1466 7 7 #pragma link C++ class MCerPhotPix+; 8 8 #pragma link C++ class MCerPhotEvt+; 9 #pragma link C++ class MCerPhotAnal+; 9 10 #pragma link C++ class MCerPhotCalc+; 10 #pragma link C++ class MCerPhotAnal+;11 11 #pragma link C++ class MCerPhotCalc2+; 12 12 13 13 #pragma link C++ class MImgCleanStd+; 14 #pragma link C++ class MCameraSmooth+; 14 15 15 16 #pragma link C++ class MBlindPixels+; -
trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc
r1179 r1466 51 51 52 52 #include "MParList.h" 53 54 #include "MGeomPix.h" 55 #include "MGeomCam.h" 53 56 #include "MCerPhotPix.h" 54 57 #include "MCerPhotEvt.h" 55 58 #include "MBlindPixels.h" 59 56 60 #include "MMcRunHeader.hxx" 57 61 … … 63 67 // 64 68 MBlindPixelCalc::MBlindPixelCalc(const char *name, const char *title) 65 69 : fUseInterpolation(kFALSE), fUseCentralPixel(kFALSE) 66 70 { 67 71 fName = name ? name : "MBlindPixelCalc"; … … 85 89 if (!fEvt) 86 90 { 87 *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl;91 *fLog << err << dbginf << "MCerPhotEvt not found... aborting." << endl; 88 92 return kFALSE; 89 93 } 94 95 fGeomCam = (MGeomCam*)pList->FindObject("MGeomCam"); 96 if (!fGeomCam) 97 *fLog << warn << dbginf << "No camera geometry available... can't ude interpolation." << endl; 90 98 91 99 const UShort_t size = fPixelsID.GetSize(); … … 112 120 } 113 121 114 115 // -------------------------------------------------------------------------- 116 // 117 // Remove the pixels. 118 // 119 Bool_t MBlindPixelCalc::Process() 122 void MBlindPixelCalc::Interpolate() const 120 123 { 121 124 const UShort_t entries = fEvt->GetNumPixels(); 125 126 Double_t *nphot = new Double_t[entries]; 127 Double_t *perr = new Double_t[entries]; 122 128 123 129 // … … 129 135 MCerPhotPix &pix = (*fEvt)[i]; 130 136 131 if (fPixels->IsBlind(pix.GetPixId())) 137 const Int_t id = pix.GetPixId(); 138 139 if (!fPixels->IsBlind(id)) 140 continue; 141 142 const MGeomPix &gpix = (*fGeomCam)[id]; 143 144 const Int_t n = gpix.GetNumNeighbors(); 145 146 nphot[i] = fUseCentralPixel ? (*fEvt)[id].GetNumPhotons() : 0; 147 perr[i] = fUseCentralPixel ? (*fEvt)[id].GetErrorPhot() : 0; 148 for (int j=0; j<n; j++) 149 { 150 const UShort_t nid = gpix.GetNeighbor(j); 151 152 nphot[i] += (*fEvt)[nid].GetNumPhotons(); 153 perr[i] += (*fEvt)[nid].GetErrorPhot(); 154 } 155 156 nphot[i] /= fUseCentralPixel ? n+1 : n; 157 perr[i] /= fUseCentralPixel ? n+1 : n; 158 } 159 160 if (fUseInterpolation && fGeomCam) 161 for (UShort_t i=0; i<entries; i++) 162 { 163 MCerPhotPix &pix = (*fEvt)[i]; 164 165 if (fPixels->IsBlind(pix.GetPixId())) 166 pix.Set(nphot[i], perr[i]); 167 } 168 169 delete nphot; 170 delete perr; 171 } 172 173 void MBlindPixelCalc::Unmap() const 174 { 175 const UShort_t entries = fEvt->GetNumPixels(); 176 177 // 178 // remove the pixels in fPixelsID if they are set to be used, 179 // (set them to 'unused' state) 180 // 181 for (UShort_t i=0; i<entries; i++) 182 { 183 MCerPhotPix &pix = (*fEvt)[i]; 184 185 if (fPixels->IsBlind(pix.GetPixId())) 132 186 pix.SetPixelUnused(); 133 } 187 188 } 189 } 190 191 // -------------------------------------------------------------------------- 192 // 193 // Remove the pixels. 194 // 195 Bool_t MBlindPixelCalc::Process() 196 { 197 if (fUseInterpolation && fGeomCam) 198 Interpolate(); 199 else 200 Unmap(); 134 201 135 202 return kTRUE; … … 165 232 166 233 // 234 // Delete the old array holding the blind pixels for the last file 235 // 236 fPixels->Clear(); 237 238 // 167 239 // Set as blind some particular pixels because of a particular 168 240 // Star Field of View. … … 180 252 { 181 253 *fLog << warn << "Warning - Detected Starfield unknown..." << endl; 182 return k SKIP;254 return kTRUE; 183 255 } 184 256 … … 186 258 // Case for Crab Nebula FOV 187 259 // 188 fPixels->Clear();189 260 fPixels->SetPixelBlind(400); 190 261 fPixels->SetPixelBlind(401); -
trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.h
r1179 r1466 10 10 #endif 11 11 12 class MGeomCam; 12 13 class MCerPhotEvt; 13 14 class MBlindPixels; … … 18 19 MCerPhotEvt *fEvt; //! 19 20 MBlindPixels *fPixels; //! 21 MGeomCam *fGeomCam; //! 20 22 21 23 TArrayS fPixelsID; // Pixel IDs for blind pixels, which are entered by the user. 22 24 25 Bool_t fUseInterpolation; 26 Bool_t fUseCentralPixel; 27 28 void Interpolate() const; 29 void Unmap() const; 30 23 31 public: 24 32 MBlindPixelCalc(const char *name=NULL, const char *title=NULL); 33 34 void SetUseInterpolation(Bool_t b=kTRUE) { fUseInterpolation=kTRUE; } 35 void SetUseCetralPixel(Bool_t b=kTRUE) { fUseCentralPixel=kTRUE; } 25 36 26 37 Bool_t PreProcess(MParList *pList); -
trunk/MagicSoft/Mars/manalysis/MBlindPixels.h
r1180 r1466 23 23 void Clear(Option_t *o="") { fPixels.Reset(); } 24 24 25 Bool_t IsBlind(UShort_t id) { return (Bool_t)fPixels[id]; }25 Bool_t IsBlind(UShort_t id) { return fPixels.GetSize() && fPixels[id]; } 26 26 27 27 ClassDef(MBlindPixels, 1) // container to store blind pixels -
trunk/MagicSoft/Mars/manalysis/MCerPhotPix.h
r1394 r1466 37 37 Bool_t IsPixelCore() const { return fIsCore; } 38 38 39 void SetNumPhotons(Float_t f) { fPhot = f; } 40 void SetErrorPhot(Float_t f) { fErrPhot = f; } 39 void SetNumPhotons(Float_t f) { fPhot = f; } 40 void SetErrorPhot(Float_t f) { fErrPhot = f; } 41 void Set(Float_t np, Float_t ep) { fPhot = np; fErrPhot = ep; } 41 42 42 43 void Print(Option_t *opt = NULL) const; -
trunk/MagicSoft/Mars/manalysis/MHillas.cc
r1465 r1466 279 279 if (fSize==0) 280 280 { 281 *fLog << warn<< GetDescriptor() << ": Event has zero cerenkov photons... skipped." << endl;281 //*fLog << inf << GetDescriptor() << ": Event has zero cerenkov photons... skipped." << endl; 282 282 return kFALSE; 283 283 } … … 285 285 if (fNumUsedPixels<3) 286 286 { 287 *fLog << warn<< GetDescriptor() << ": Event has less than 3 used pixels... skipped." << endl;287 //*fLog << inf << GetDescriptor() << ": Event has less than 3 used pixels... skipped." << endl; 288 288 return kFALSE; 289 289 } … … 327 327 // If corrxy=0 (which should never happen, because fSize>0) we 328 328 // cannot calculate Length and Width. The calculation failed 329 // and returnes kFALSE 329 // and returns kFALSE 330 // In reallity it is almost impossible to have a distribution 331 // of cerenkov photons in the used pixels which is exactly symmetric 332 // along one of the axis. 330 333 // 331 334 if (corrxy==0) 332 335 { 333 *fLog << warn<< GetDescriptor() << ": Event has CorrXY==0... skipped." << endl;336 *fLog << inf << GetDescriptor() << ": Event has CorrXY==0... skipped." << endl; 334 337 return kFALSE; 335 338 } -
trunk/MagicSoft/Mars/manalysis/Makefile
r1439 r1466 37 37 MEnergyEstimate.cc \ 38 38 MSrcPosCam.cc \ 39 MCameraSmooth.cc \ 39 40 MHadroness.cc \ 40 41 MCompProbCalc.cc \
Note:
See TracChangeset
for help on using the changeset viewer.