Changeset 1487 for trunk/MagicSoft
- Timestamp:
- 08/07/02 14:32:26 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1486 r1487 1 1 -*-*- END -*-*- 2 3 2002/08/07: Thomas Bretz 4 5 * macros/dohtml.C: 6 - added missing paths 7 8 * manalysis/MBlindPixelCalc.[h,cc]: 9 - replaced booleans by fFlags 10 - added StreamPrimitive 11 - changed version number to 1 12 13 * manalysis/MHillasSrcCalc.[h,cc]: 14 - added correct initializations for the pointers 15 - made the pointers persistent 16 17 * manalysis/MImgCleanStd.cc, manalysis/MSrcPosCam.cc, 18 mfileio/MWriteRootFile.cc: 19 - don't stream name and title if not necessary 20 21 * mbase/MEvtLoop.[h,cc]: 22 - added some output 23 - added print function 24 - added gListOfPrimitives to delete BIT(15) of streamed containers 25 - Added default argument for Read and Write 26 27 * mbase/MParContainer.cc: 28 - added usage of gListOfPrimitives 29 30 * mbase/MParList.cc, mbase/MTaskList.cc, mhist/MBinning.cc: 31 - fixed a bug when only the title is different from the default 32 33 * mhist/MHHillas.cc: 34 - fixed the wrong usage of ApplyBinning for the 2D-Hist fCenter 35 36 2 37 3 38 2002/08/06: Thomas Bretz -
trunk/MagicSoft/Mars/macros/dohtml.C
r1337 r1487 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 120 ! Copyright: MAGIC Software Development, 2000-2002 21 21 ! 22 22 ! … … 36 36 37 37 html.SetOutputDir("htmldoc"); 38 html.SetSourceDir(".:mbase:m raw:mgui:manalysis:mdatacheck:mmain:meventdisp:mmc:mmontecarlo:mhist:mfilter");38 html.SetSourceDir(".:mbase:mdata:mdatacheck:meventdisp:mfileio:mfilter:mgeom:mgui:mhist:mmain:mmc:mmontecarlo:mraw:mtools"); 39 39 40 40 html.MakeAll(kTRUE); -
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;} -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r1483 r1487 92 92 //! Also we can derive MEvtLoop from MTaskList to have a static tasklist, too 93 93 //! 94 95 TList *gListOfPrimitives; // forard declaration in MParContainer.h 94 96 95 97 // -------------------------------------------------------------------------- … … 346 348 347 349 fout << "}" << endl; 350 351 *fLog << inf << "Macro '" << name << "' written." << endl; 348 352 } 349 353 … … 365 369 out << endl; 366 370 } 371 372 gListOfPrimitives = new TList; 367 373 368 374 if (fParList) … … 376 382 out << " if (!evtloop.Eventloop())" << endl; 377 383 out << " return;" << endl; 384 385 gListOfPrimitives->ForEach(TObject, ResetBit)(BIT(15)); 386 delete gListOfPrimitives; 387 gListOfPrimitives = 0; 388 389 // remove all objects with BIT(15) set from gObjectTable 378 390 } 379 391 … … 477 489 HasDuplicateNames(list, "MEvtLoop::Read"); 478 490 491 *fLog << inf << "Eventloop '" << name << "' read from file." << endl; 492 479 493 return n; 494 } 495 496 // -------------------------------------------------------------------------- 497 // 498 // If available print the contents of the parameter list. 499 // 500 void MEvtLoop::Print(Option_t *opt="") const 501 { 502 if (fParList) 503 fParList->Print(); 504 else 505 *fLog << all << "MEvtloop: No Parameter List available." << endl; 480 506 } 481 507 … … 530 556 HasDuplicateNames(list, "MEvtLoop::Write"); 531 557 558 *fLog << inf << "Eventloop written to file as " << name << "." << endl; 559 532 560 return n; 533 561 } -
trunk/MagicSoft/Mars/mbase/MEvtLoop.h
r1481 r1487 53 53 void SavePrimitive(ofstream &out, Option_t *o=""); 54 54 55 Int_t Read(const char *name); 56 Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0); 55 Int_t Read(const char *name="Evtloop"); 56 Int_t Write(const char *name="Evtloop", Int_t option=0, Int_t bufsize=0); 57 58 void Print(Option_t *opt="") const; 57 59 58 60 ClassDef(MEvtLoop, 1) // Class to execute the tasks in a tasklist 59 61 }; 60 62 63 R__EXTERN TList *gListOfPrimitives; // instantiation in MEvtLoop 64 61 65 #endif -
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r1483 r1487 51 51 #include "MLogManip.h" 52 52 53 #include "MEvtLoop.h" // gListOfPrimitives 54 53 55 ClassImp(MParContainer); 54 56 … … 383 385 return; 384 386 385 SetUniqueID(uid++/*gRandom->Uniform(kMaxInt)*/); 387 SetUniqueID(uid++); 388 SetBit(kIsSavedAsPrimitive); 389 390 if (gListOfPrimitives && !gListOfPrimitives->FindObject(this)) 391 gListOfPrimitives->Add(this); 392 386 393 StreamPrimitive(out); 387 SetBit(kIsSavedAsPrimitive);388 394 } 389 395 -
trunk/MagicSoft/Mars/mbase/MParList.cc
r1483 r1487 672 672 { 673 673 out << " MParList " << GetUniqueName(); 674 if (fName!=gsDefName )674 if (fName!=gsDefName || fTitle!=gsDefTitle) 675 675 { 676 676 out << "(\"" << fName << "\""; -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r1483 r1487 525 525 { 526 526 out << " MTaskList " << GetUniqueName(); 527 if (fName!=gsDefName )527 if (fName!=gsDefName || fTitle!=gsDefTitle) 528 528 { 529 529 out << "(\"" << fName << "\""; -
trunk/MagicSoft/Mars/mhist/MBinning.cc
r1484 r1487 120 120 { 121 121 out << " MBinning " << GetUniqueName(); 122 if (fName!=gsDefName )122 if (fName!=gsDefName || fTitle!=gsDefTitle) 123 123 { 124 124 out << "(\"" << fName << "\""; -
trunk/MagicSoft/Mars/mhist/MHHillas.cc
r1465 r1487 148 148 ApplyBinning(*plist, "Length", fLength); 149 149 ApplyBinning(*plist, "Dist", fDistC); 150 ApplyBinning(*plist, "Camera", fCenter);151 150 ApplyBinning(*plist, "Delta", fDelta); 152 151 ApplyBinning(*plist, "Size", fSize); 152 153 const MBinning *bins = (MBinning*)plist->FindObject("BinningCamera"); 154 if (!bins) 155 *fLog << warn << "Object 'BinningCamera' [MBinning] not found... no binning applied." << endl; 156 else 157 SetBinning(fCenter, bins, bins); 153 158 154 159 return kTRUE;
Note:
See TracChangeset
for help on using the changeset viewer.