Changeset 3497
- Timestamp:
- 03/15/04 12:04:09 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3496 r3497 18 18 19 19 -*-*- END OF LINE -*-*- 20 2004/03/15: Thomas Bretz 21 22 * mastro/MObservatory.[h,cc]: 23 - implemented RotationAngle(ra, dec, time) 24 25 * mbase/MTask.[h,cc]: 26 - implemented usage of a TStopwatch to retriev time consumtion 27 informations 28 - changed PrintStatistics not to print classes having no 29 Process() function 30 31 * mbase/MTaskList.[h,cc], mfileio/MReadReports.[h,cc]: 32 - changed PrintStatistics according to changes in MTask 33 34 * mraw/MRawEvtHeader.cc: 35 - added a comment to Fill member function 36 37 * manalysis/MCerPhotEvt.[h,cc]: 38 - added fLut.Set to FixSize and resize fLut by a factor of 2 39 instead of +1 which acelerates creation of all pixels a lot 40 41 42 20 43 2004/03/13: Markus Gaug 21 44 22 * mcalib/MCalibrationChargeCalc.cc 23 * mcalib/MCalibrationChargePix.[h,cc] 24 * mcalib/MCalibrationChargeCam.cc 25 * mcalib/MHCalibrationChargeCam.cc 26 * mcalib/MHCalibrationChargeLoGainPix.cc 45 * mcalib/MCalibrationChargeCalc.cc, mcalib/MCalibrationChargeCam.cc, 46 mcalib/MCalibrationChargePix.[h,cc], 47 mcalib/MHCalibrationChargeCam.cc, 48 mcalib/MHCalibrationChargeLoGainPix.cc: 27 49 - fixed Low Gain calibration 28 50 29 30 * mcalib/MHGausEvents.cc 51 * mcalib/MHGausEvents.cc: 31 52 - changed default fit prob. limit from 0.005 to 0.001 32 53 33 * mbadpixels/MBadPixelsPix.h 54 * mbadpixels/MBadPixelsPix.h : 34 55 - IsCalibrationResultOK does not ask for FitOK any more 35 56 36 * mcalib/MHCalibrationChargeCam.cc 57 * mcalib/MHCalibrationChargeCam.cc: 37 58 - replaced Rel. Err. Limit for outliers in Phe's from 5 sigma to 7 38 59 39 * mraw/MRawEvtPixelIter.[h,cc] 60 * mraw/MRawEvtPixelIter.[h,cc]: 40 61 - function GetIdxMaxLoGainSamples can be called optionally with 41 62 offset (because first "loGain" samples are often in reality … … 43 64 44 65 66 45 67 2004/03/12: Sebastian Raducci 46 68 47 69 * manalysis/Makefile 48 70 - added mastro in the include directories 71 72 49 73 50 74 2004/03/12: Thomas Bretz -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
r3378 r3497 103 103 void MCerPhotEvt::FixSize() 104 104 { 105 fLut.Set(fNumPixels); 106 105 107 if (fPixels->GetEntriesFast() == (Int_t)fNumPixels) 106 108 return; -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
r3237 r3497 43 43 { 44 44 const Int_t n = fLut.GetSize(); 45 fLut.Set(idx +1);46 for (int i=n; i<idx ; i++)45 fLut.Set(idx*2+1); //idx+1 is slower than idx*2+1 46 for (int i=n; i<idx*2+1; i++) 47 47 fLut[i] = -1; 48 48 } -
trunk/MagicSoft/Mars/mastro/MObservatory.cc
r3366 r3497 34 34 #include "MObservatory.h" 35 35 36 #include <TVector3.h> 37 38 #include "MTime.h" 36 39 #include "MAstro.h" 37 40 … … 169 172 return TMath::ASin((fCosLatitude*sinp) / denom); 170 173 } 174 175 // -------------------------------------------------------------------------- 176 // 177 // RotationAngle 178 // 179 // calculates the angle for the rotation of the sky image in the camera; 180 // this angle is a function of the sky coordinates, the observatory 181 // location and the time 182 // 183 // ra [rad]: Right ascension 184 // dec [rad]: Declination 185 // 186 // Return RotationAngle in rad 187 // 188 Double_t MObservatory::RotationAngle(Double_t ra, Double_t dec, const MTime &t) const 189 { 190 const Double_t alpha = t.GetGmst() + GetElong(); 191 192 TVector3 v; 193 v.SetMagThetaPhi(1, TMath::Pi()/2-dec, alpha-ra); 194 v.RotateY(GetPhi()-TMath::Pi()/2); 195 196 return RotationAngle(v.Theta(), v.Phi()); 197 } -
trunk/MagicSoft/Mars/mastro/MObservatory.h
r3366 r3497 5 5 #include "MParContainer.h" 6 6 #endif 7 8 class MTime; 7 9 8 10 class MObservatory : public MParContainer … … 56 58 void RotationAngle(Double_t theta, Double_t phi, Double_t &sin, Double_t &cos) const; 57 59 Double_t RotationAngle(Double_t theta, Double_t phi) const; 60 Double_t RotationAngle(Double_t ra, Double_t dec, const MTime &t) const; 58 61 59 62 LocationName_t GetObservatoryKey() const { return fObservatoryKey; } -
trunk/MagicSoft/Mars/mbase/MTask.cc
r2858 r3497 90 90 91 91 #include <fstream> 92 #include <TBaseClass.h> 92 93 #include <TBaseClass.h> // OverwritesProcess 94 #include <TStopwatch.h> // TStopwatch 93 95 94 96 #include "MLog.h" … … 103 105 104 106 MTask::MTask(const char *name, const char *title) 105 : fFilter(NULL), fSerialNumber(0), fIsPreprocessed(kFALSE), fNumExecutions(0) 107 : fFilter(NULL), fSerialNumber(0), fIsPreprocessed(kFALSE), 108 fNumExecutions(0), fStopwatch(0) 106 109 { 107 110 fName = name ? name : "MTask"; … … 110 113 fListOfBranches = new TList; 111 114 fListOfBranches->SetOwner(); 115 116 fStopwatch = new TStopwatch; 112 117 } 113 118 114 119 MTask::~MTask() 115 120 { 121 delete fStopwatch; 116 122 delete fListOfBranches; 117 123 } … … 184 190 // Mapper function for PreProcess. 185 191 // Sets the preprocessed flag dependend on the return value of PreProcess. 192 // Resets number of executions and cpu consumtion timer. 186 193 // 187 194 Int_t MTask::CallPreProcess(MParList *plist) 188 195 { 189 196 fNumExecutions = 0; 197 fStopwatch->Reset(); 190 198 191 199 *fLog << all << fName << "... " << flush; … … 218 226 // return value. 219 227 // If Process is executed, the execution counter is increased. 228 // Count cpu consumtion time. 220 229 // 221 230 Int_t MTask::CallProcess() … … 232 241 233 242 fNumExecutions++; 234 return Process(); 243 244 fStopwatch->Start(kFALSE); 245 const Int_t rc = Process(); 246 fStopwatch->Stop(); 247 248 return rc; 235 249 } 236 250 … … 332 346 // -------------------------------------------------------------------------- 333 347 // 334 // Prints the number of times all the tasks in the list has been. 348 // Return total CPU execution time of task 349 // 350 Double_t MTask::GetCpuTime() const 351 { 352 return fStopwatch->CpuTime(); 353 } 354 355 // -------------------------------------------------------------------------- 356 // 357 // Return total real execution time of task 358 // 359 Double_t MTask::GetRealTime() const 360 { 361 return fStopwatch->RealTime(); 362 } 363 364 // -------------------------------------------------------------------------- 365 // 366 // Prints the relative time spent in Process() (relative means relative to 367 // its parent Tasklist) and the number of times Process() was executed. 335 368 // For convinience the lvl argument results in a number of spaces at the 336 369 // beginning of the line. So that the structur of a tasklist can be … … 338 371 // filter is printer in <>-brackets behind the number of executions. 339 372 // Use MTaskList::PrintStatistics without an argument. 340 // 341 void MTask::PrintStatistics(const Int_t lvl, Bool_t title) const 342 { 343 *fLog << all << setfill(' ') << setw(lvl) << " " << GetDescriptor() << "\t"; 373 // For tasks which don't overwrite Process() no action is perfomed. 374 // 375 void MTask::PrintStatistics(const Int_t lvl, Bool_t title, Double_t time) const 376 { 377 if (!OverwritesProcess()) 378 return; 379 380 *fLog << all << setfill(' ') << setw(lvl) << " "; 381 if (fStopwatch->CpuTime()>0 && time>0) 382 *fLog << setw(3) << (Int_t)(fStopwatch->CpuTime()/time*100+.5) << "% "; 383 else 384 *fLog << " "; 385 *fLog << GetDescriptor() << "\t"; 344 386 *fLog << dec << fNumExecutions; 345 387 if (fFilter) -
trunk/MagicSoft/Mars/mbase/MTask.h
r2589 r3497 15 15 16 16 class TList; 17 class TStopwatch; 17 18 18 19 class MFilter; … … 29 30 Bool_t fIsPreprocessed; //! Indicates the success of the PreProcessing (set by MTaskList) 30 31 UInt_t fNumExecutions; //! Number of Excutions 32 33 TStopwatch *fStopwatch; //! 31 34 32 35 virtual Int_t PreProcess(MParList *pList); … … 66 69 virtual ~MTask(); 67 70 71 const TList *GetListOfBranches() const { return fListOfBranches; } 72 Bool_t OverwritesProcess(TClass *cls=NULL) const; 73 74 // Filter functions 68 75 virtual void SetFilter(MFilter *filter) { fFilter=filter; } 69 76 const MFilter *GetFilter() const { return fFilter; } 70 77 MFilter *GetFilter() { return fFilter; } // for MContinue only 71 78 79 // Display functions 72 80 void SetDisplay(MStatusDisplay *d); 73 virtual void PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE) const;74 81 82 // Function for parallel executions 75 83 static TString AddSerialNumber(const char *str, UInt_t num) { TString s(str); if (num==0) return s; s += ";"; s += num; return s; } 76 84 static TString AddSerialNumber(const TString &str, UInt_t num) { return AddSerialNumber((const char*)str, num); } … … 83 91 const char *GetDescriptor() const; 84 92 93 // Task execution statistics 85 94 UInt_t GetNumExecutions() const { return fNumExecutions; } 95 Double_t GetCpuTime() const; 96 Double_t GetRealTime() const; 97 virtual void PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE, Double_t time=0) const; 86 98 99 // Task overwrite functions 87 100 virtual Bool_t ReInit(MParList *pList); 88 101 … … 90 103 virtual Int_t CallProcess(); 91 104 virtual Int_t CallPostProcess(); 92 93 const TList *GetListOfBranches() const { return fListOfBranches; }94 95 Bool_t OverwritesProcess(TClass *cls=NULL) const;96 105 97 106 void SavePrimitive(ofstream &out, Option_t *o=""); -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r2958 r3497 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto: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-2004 21 21 ! 22 22 ! … … 24 24 25 25 ///////////////////////////////////////////////////////////////////////////// 26 // //27 // MTaskList //28 // //29 // Collection of tasks. //30 // //31 // A tasklist is necessary to run the eventloop. It contains the scheduled //32 // tasks, which should be executed in your program. //33 // //34 // To add a task use AddToList. //35 // //36 // The tasklist itself is a task, too. You can add a tasklist to another //37 // tasklist. This makes sense, if you want to filter the execution of //38 // more than one task of your tasklist using the same filter. //39 // //40 // The tasks in the list are idetified by their names. If more than one //41 // task has the same name, the tasklist will still work correctly, but //42 // you might run into trouble trying to get a pointer to a task by name //43 // from the list. //44 // //45 // Warning: //46 // Be carefull if you are writing your tasklist //47 // (eg. MWriteRootFile("file.root", "MTaskList")) to a file. You may //48 // not be able to initialize a new working tasklist from a file if //49 // a) Two Paramerer containers with the same names are existing in the //50 // MParList. //51 // b) You used a container somewhere which is not part of MParList. //52 // (eg. You specified a pointer to a MH container in MFillH which is //53 // not added to the parameter list. //54 // //26 // 27 // MTaskList 28 // 29 // Collection of tasks. 30 // 31 // A tasklist is necessary to run the eventloop. It contains the scheduled 32 // tasks, which should be executed in your program. 33 // 34 // To add a task use AddToList. 35 // 36 // The tasklist itself is a task, too. You can add a tasklist to another 37 // tasklist. This makes sense, if you want to filter the execution of 38 // more than one task of your tasklist using the same filter. 39 // 40 // The tasks in the list are idetified by their names. If more than one 41 // task has the same name, the tasklist will still work correctly, but 42 // you might run into trouble trying to get a pointer to a task by name 43 // from the list. 44 // 45 // Warning: 46 // Be carefull if you are writing your tasklist 47 // (eg. MWriteRootFile("file.root", "MTaskList")) to a file. You may 48 // not be able to initialize a new working tasklist from a file if 49 // a) Two Paramerer containers with the same names are existing in the 50 // MParList. 51 // b) You used a container somewhere which is not part of MParList. 52 // (eg. You specified a pointer to a MH container in MFillH which is 53 // not added to the parameter list. 54 // 55 55 ///////////////////////////////////////////////////////////////////////////// 56 57 56 #include "MTaskList.h" 58 57 59 #include <fstream> // ofstream, SavePrimitive 60 61 #include <TClass.h> 62 #include <TSystem.h> // gSystem 63 #include <TOrdCollection.h> 58 #include <fstream> // ofstream, SavePrimitive 59 60 #include <TSystem.h> // gSystem 61 #include <TOrdCollection.h> // TOrdCollection 64 62 65 63 #include "MLog.h" … … 627 625 // Use MTaskList::PrintStatistics without an argument. 628 626 // 629 void MTaskList::PrintStatistics(const Int_t lvl, Bool_t title ) const627 void MTaskList::PrintStatistics(const Int_t lvl, Bool_t title, Double_t time) const 630 628 { 631 629 if (lvl==0) 632 630 { 633 *fLog << all << underline << " Execution Statistics:" << endl;631 *fLog << all << underline << "Process execution Statistics:" << endl; 634 632 *fLog << GetDescriptor(); 635 633 if (GetFilter()) … … 640 638 } 641 639 else 642 MTask::PrintStatistics(lvl, title );640 MTask::PrintStatistics(lvl, title, time); 643 641 644 642 // 645 643 // create the Iterator for the TaskList 646 644 // 647 fTasks->ForEach(MTask, PrintStatistics)(lvl+1, title );645 fTasks->ForEach(MTask, PrintStatistics)(lvl+1, title, GetCpuTime()); 648 646 649 647 if (lvl==0) … … 651 649 } 652 650 653 654 // -------------------------------------------------------------------------- 651 // -------------------------------------------------------------------------- 652 // 653 // Call 'Print()' of all tasks 654 // 655 655 void MTaskList::Print(Option_t *t) const 656 656 { -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r2470 r3497 70 70 71 71 void Print(Option_t *opt = "") const; 72 void PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE ) const;72 void PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE, Double_t time=0) const; 73 73 void SetOwner(Bool_t enable=kTRUE); 74 74 -
trunk/MagicSoft/Mars/mfileio/MReadReports.cc
r3226 r3497 375 375 // PrintStatistics of this task and of the MReadTree tasks in fTress 376 376 // 377 void MReadReports::PrintStatistics(const Int_t lvl, Bool_t title ) const378 { 379 MRead::PrintStatistics(lvl, title );380 fTrees->PrintStatistics(lvl, title );381 } 377 void MReadReports::PrintStatistics(const Int_t lvl, Bool_t title, Double_t time) const 378 { 379 MRead::PrintStatistics(lvl, title, time); 380 fTrees->PrintStatistics(lvl, title, GetCpuTime()); 381 } -
trunk/MagicSoft/Mars/mfileio/MReadReports.h
r2607 r3497 55 55 void AddToBranchList(const char *name); 56 56 57 void PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE ) const;57 void PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE, Double_t time=0) const; 58 58 59 59 void EnableAutoScheme(Bool_t e=kTRUE) { fEnableAutoScheme = e; } // Must be called BEFORE AddTree! -
trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc
r3483 r3497 227 227 // -------------------------------------------------------------------------- 228 228 // 229 // used to set the header information (eg. from MC) 229 // Used to set the header information. This is for MC only. NEVER, NEVER 230 // use this somewhere else! 230 231 // 231 232 void MRawEvtHeader::FillHeader(UInt_t uiN, Float_t ulTP)
Note:
See TracChangeset
for help on using the changeset viewer.