Changeset 1487 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 08/07/02 14:32:26 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc
r1469 r1487 53 53 #include "MBlindPixelCalc.h" 54 54 55 #include <fstream.h> 56 55 57 #include "MLog.h" 56 58 #include "MLogManip.h" … … 68 70 ClassImp(MBlindPixelCalc); 69 71 72 static const TString gsDefName = "MBlindPixelCalc"; 73 static const TString gsDefTitle = "Task to deal with hot spots (star, broken pixels, etc)"; 74 70 75 // -------------------------------------------------------------------------- 71 76 // … … 73 78 // 74 79 MBlindPixelCalc::MBlindPixelCalc(const char *name, const char *title) 75 : f UseInterpolation(kFALSE), fUseCentralPixel(kFALSE)76 { 77 fName = name ? name : "MBlindPixelCalc";78 fTitle = title ? title : "Task which removes a list of pixel from analysis";80 : fFlags(0) 81 { 82 fName = name ? name : gsDefName.Data(); 83 fTitle = title ? title : gsDefTitle.Data(); 79 84 } 80 85 … … 129 134 // 130 135 // Replaces each pixel by the average of its surrounding pixels. 131 // If fUseCentralPixelis set the central pixel is also included.136 // If TESTBIT(fFlags, kUseCentralPixel) is set the central pixel is also included. 132 137 // 133 138 void MBlindPixelCalc::Interpolate() const … … 155 160 const Int_t n = gpix.GetNumNeighbors(); 156 161 157 nphot[i] = fUseCentralPixel? (*fEvt)[id].GetNumPhotons() : 0;158 perr[i] = fUseCentralPixel? (*fEvt)[id].GetErrorPhot() : 0;162 nphot[i] = TESTBIT(fFlags, kUseCentralPixel) ? (*fEvt)[id].GetNumPhotons() : 0; 163 perr[i] = TESTBIT(fFlags, kUseCentralPixel) ? (*fEvt)[id].GetErrorPhot() : 0; 159 164 for (int j=0; j<n; j++) 160 165 { … … 165 170 } 166 171 167 nphot[i] /= fUseCentralPixel? n+1 : n;168 perr[i] /= fUseCentralPixel? n+1 : n;169 } 170 171 if ( fUseInterpolation&& fGeomCam)172 nphot[i] /= TESTBIT(fFlags, kUseCentralPixel) ? n+1 : n; 173 perr[i] /= TESTBIT(fFlags, kUseCentralPixel) ? n+1 : n; 174 } 175 176 if (TESTBIT(fFlags, kUseInterpolation) && fGeomCam) 172 177 for (UShort_t i=0; i<entries; i++) 173 178 { … … 211 216 Bool_t MBlindPixelCalc::Process() 212 217 { 213 if ( fUseInterpolation&& fGeomCam)218 if (TESTBIT(fFlags, kUseInterpolation) && fGeomCam) 214 219 Interpolate(); 215 220 else … … 289 294 } 290 295 291 296 void MBlindPixelCalc::StreamPrimitive(ofstream &out) const 297 { 298 out << " MBlindPixelCalc " << GetUniqueName(); 299 if (fName!=gsDefName || fTitle!=gsDefTitle) 300 { 301 out << "(\"" << fName << "\""; 302 if (fTitle!=gsDefTitle) 303 out << ", \"" << fTitle << "\""; 304 out <<")"; 305 } 306 out << ";" << endl; 307 308 if (TESTBIT(fFlags, kUseInterpolation)) 309 out << " " << GetUniqueName() << ".SetUseInterpolation();" << endl; 310 if (TESTBIT(fFlags, kUseCentralPixel)) 311 out << " " << GetUniqueName() << ".SetUseCentralPixel();" << endl; 312 313 if (fPixelsID.GetSize()==0) 314 return; 315 316 out << " {" << endl; 317 out << " TArrayS dummy;" << endl; 318 for (int i=0; i<fPixelsID.GetSize(); i++) 319 out << " dummy[" << i << "]=" << ((TArrayS)fPixelsID)[i] << ";" << endl; 320 out << " " << GetUniqueName() << ".SetPixels(dummy);" << endl; 321 out << " }" << endl; 322 } -
trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.h
r1466 r1487 23 23 TArrayS fPixelsID; // Pixel IDs for blind pixels, which are entered by the user. 24 24 25 Bool_t fUseInterpolation; 26 Bool_t fUseCentralPixel; 25 Byte_t fFlags; // flag for the method which is used 26 27 enum 28 { 29 kUseInterpolation = 1, 30 kUseCentralPixel = 2 31 }; 27 32 28 33 void Interpolate() const; 29 34 void Unmap() const; 35 void StreamPrimitive(ofstream &out) const; 30 36 31 37 public: 32 38 MBlindPixelCalc(const char *name=NULL, const char *title=NULL); 33 39 34 void SetUseInterpolation(Bool_t b=kTRUE) { fUseInterpolation=kTRUE; } 35 void SetUseCetralPixel(Bool_t b=kTRUE) { fUseCentralPixel=kTRUE; } 40 void SetUseInterpolation(Bool_t b=kTRUE) 41 { 42 b ? SETBIT(fFlags, kUseInterpolation) : CLRBIT(fFlags, kUseInterpolation); 43 } 44 void SetUseCetralPixel(Bool_t b=kTRUE) 45 { 46 b ? SETBIT(fFlags, kUseCentralPixel) : CLRBIT(fFlags, kUseCentralPixel); 47 } 36 48 37 49 Bool_t PreProcess(MParList *pList); … … 39 51 40 52 void SetPixels(Int_t num, Short_t *ids); 53 void SetPixels(const TArrayS pix) { SetPixels(pix.GetSize(), pix.GetArray()); } 41 54 virtual Bool_t ReInit(MParList *pList); 42 55 43 ClassDef(MBlindPixelCalc, 0) // task to disable given pixels for analysis56 ClassDef(MBlindPixelCalc, 1) // task to deal with hot spots (star, broken pixels, etc) 44 57 }; 45 58 -
trunk/MagicSoft/Mars/manalysis/MHillasSrcCalc.cc
r1483 r1487 45 45 ClassImp(MHillasSrcCalc); 46 46 47 static const TString gsDefName = "MHillasSrcCalc"; 48 static const TString gsDefTitle = "Calculate position dependant image parameters"; 49 47 50 // ------------------------------------------------------------------------- 48 51 // … … 55 58 MHillasSrcCalc::MHillasSrcCalc(const char *src, const char *hil, 56 59 const char *name, const char *title) 60 : fHillas(NULL), fSrcPos(NULL), fHillasSrc(NULL) 57 61 { 58 fName = name ? name : "MHillasSrcCalc";59 fTitle = title ? title : "add parameters dependent on source position (MHillasSrc)";62 fName = name ? name : gsDefName.Data(); 63 fTitle = title ? title : gsDefTitle.Data(); 60 64 61 65 fSrcName = src; … … 122 126 out << "\"" << fSrcName << "\""; 123 127 128 out << ", "; 129 124 130 if (fHillasSrc) 125 131 out << "&" << fHillasSrc->GetUniqueName(); … … 127 133 out << "\"" << fHillasName << "\""; 128 134 129 out << ", \"" << fName << "\", \"" << fTitle << "\");" << endl; 135 if (fName!=gsDefName || fTitle!=gsDefTitle) 136 { 137 out << ", \"" << fName << "\""; 138 if (fTitle!=gsDefTitle) 139 out << ", \"" << fTitle << "\""; 140 } 141 out << ");" << endl; 130 142 } -
trunk/MagicSoft/Mars/manalysis/MHillasSrcCalc.h
r1477 r1487 13 13 { 14 14 private: 15 MHillas *fHillas; // Pointer to the source independant hillas parameters16 MSrcPosCam *fSrcPos; // Pointer to the source position17 MHillasSrc *fHillasSrc; // Pointer to the output container for the source dependant parameters15 MHillas *fHillas; //! Pointer to the source independant hillas parameters 16 MSrcPosCam *fSrcPos; //! Pointer to the source position 17 MHillasSrc *fHillasSrc; //! Pointer to the output container for the source dependant parameters 18 18 19 19 TString fSrcName; -
trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc
r1483 r1487 68 68 }; 69 69 70 static const TString gsDefName = "MImgCleanStd"; 71 static const TString gsDefTitle = "Task to perform a standard image cleaning"; 72 70 73 // -------------------------------------------------------------------------- 71 74 // … … 78 81 : fCleanLvl1(lvl1), fCleanLvl2(lvl2) 79 82 { 80 fName = name ? name : "MImgCleanStd";81 fTitle = title ? title : "Task which does a standard image cleaning";83 fName = name ? name : gsDefName.Data(); 84 fTitle = title ? title : gsDefTitle.Data(); 82 85 83 86 Print(); … … 417 420 { 418 421 out << " MImgCleanStd " << GetUniqueName() << "("; 419 out << fCleanLvl1 << ", " << fCleanLvl2 << ", \""; 420 out << fName << "\", \"" << fTitle << "\");" << endl; 421 } 422 out << fCleanLvl1 << ", " << fCleanLvl2; 423 424 if (fName!=gsDefName || fTitle!=gsDefTitle) 425 { 426 out << ", \"" << fName << "\""; 427 if (fTitle!=gsDefTitle) 428 out << ", \"" << fTitle << "\""; 429 } 430 out << ");" << endl; 431 } -
trunk/MagicSoft/Mars/manalysis/MSrcPosCam.cc
r1483 r1487 41 41 ClassImp(MSrcPosCam); 42 42 43 static const TString gsDefName = "MSrcPosCam"; 44 static const TString gsDefTitle = "Virtual source position in the camera"; 45 43 46 // -------------------------------------------------------------------------- 44 47 // … … 47 50 MSrcPosCam::MSrcPosCam(const char *name, const char *title) : fX(0), fY(0) 48 51 { 49 fName = name ? name : "MSrcPosCam";50 fTitle = title ? title : "Source position in the camera";52 fName = name ? name : gsDefName.Data(); 53 fTitle = title ? title : gsDefTitle.Data(); 51 54 } 52 55 … … 90 93 void MSrcPosCam::StreamPrimitive(ofstream &out) const 91 94 { 92 out << " MSrcPosCam " << GetUniqueName() << "(\""; 93 out << fName << "\", \"" << fTitle << "\");" << endl; 95 out << " MSrcPosCam " << GetUniqueName(); 96 if (fName!=gsDefName) 97 { 98 out << "(\"" << fName << "\""; 99 if (fTitle!=gsDefTitle) 100 out << ", \"" << fTitle << "\""; 101 out <<")"; 102 } 103 out << ";" << endl; 94 104 95 105 out << " " << GetUniqueName() << ".SetXY(" << fX << ", " << fY << ");" << endl;}
Note:
See TracChangeset
for help on using the changeset viewer.