Changeset 1525
- Timestamp:
- 09/16/02 10:35:17 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1511 r1525 1 1 -*-*- END -*-*- 2 3 2002/09/16: Thomas Bretz 4 5 * macros/rootlogon.C: 6 - added SetMakeSharedLib to make it work correctly on linux 7 8 * manalysis/AnalysisLinkDef.h, manalysis/Makefile: 9 - added MEnergyEstParam 10 - added MMatrixLoop 11 12 * manalysis/MEnergyEstParam.[h,cc], manalysis/MMatrixLoop.[h,cc]: 13 - added 14 15 * manalysis/MEnergyEst.h: 16 - added fImpact provisionally 17 - changed to 'no-storage' 18 19 * manalysis/MHillas.[h,cc], manalysis/MHillasExt.[h,cc], 20 manalysis/MHillasSrc.[h,cc]: 21 - added set function to support Thomas Schweitzers Image files 22 23 * mbase/MFilter.cc: 24 - small changes to output 25 26 * mbase/MLog.[h,cc]: 27 - added IsNull to switch off output completely 28 29 * mbase/MParList.[h,cc]: 30 - added Remove function 31 - added IsOwner function 32 - changes to SavePrimitive 33 - kDoNotReset-support 34 35 * mbase/MTaskList.cc: 36 - make sure, that in sub-tasklist the parameterlist isn't reset 37 38 * mdata/MDataLinkDef.h, mdata/Makefile: 39 - added MDataElement 40 - added mhist-path 41 42 * mdata/MDataChain.[h,cc]: 43 - added support for MDataElement 44 45 * mhist/MH3.[h,cc]: 46 - added enums for log-scale 47 - set logscale automatic when drawing 48 - added 'only' option to draw functions 49 - set colors when 'col' option is given 50 51 * mhist/MHHillas.cc: 52 - better hist range for fCenter 53 54 * mhist/MHMatrix.[h,cc]: 55 - made default name and title a static class member 56 - changed AddColumn now returning the new comlumn index 57 - added Fill to fill Matrix from file 58 - added locking 59 - added IsValid 60 - added GetNumRows 61 - added SetNumRow 62 - added []-operator 63 - added GetNumRow 64 65 * mhist/MHStarMap.cc: 66 - fixed some comments 67 2 68 3 69 2002/09/02: Thomas Bretz -
trunk/MagicSoft/Mars/manalysis/MEnergyEst.cc
r1211 r1525 34 34 #include "MEnergyEst.h" 35 35 36 #include "MLog.h" 37 #include "MLogManip.h" 38 36 39 ClassImp(MEnergyEst); 37 40 … … 46 49 } 47 50 51 void MEnergyEst::Print(Option_t *o) const 52 { 53 *fLog << all << GetDescriptor() << ": Eest = " << (int)fEnergy << "GeV \t Ir = " << (int)(fImpact/100) << "m" << endl; 54 } 48 55 -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r1498 r1525 101 101 MEvtLoop::MEvtLoop() : fParList(NULL), fProgress(NULL) 102 102 { 103 fName = "Evtloop"; 103 104 } 104 105 … … 300 301 // eventloop setup as a macro. The default name is "evtloop.C". The default 301 302 // extension is .C If the extension is not given, .C is added. 303 // I the last character in the argument is a '+' the file is not closed. 304 // This is usefull if you have an eventloop which runs three times and 305 // you want to write one macro. If the first character is a '+' no 306 // opening is written, eg: 307 // 308 // MEvtLoop evtloop; 309 // // some setup 310 // evtloop.MakeMacro("mymacro+"); 311 // // replace the tasklist the first time 312 // evtloop.MakeMacro("+mymacro+"); 313 // // replace the tasklist the second time 314 // evtloop.MakeMacro("+mymacro"); 302 315 // 303 316 void MEvtLoop::MakeMacro(const char *filename) 304 317 { 305 318 TString name(filename); 319 320 name = name.Strip(TString::kBoth); 321 322 Bool_t open = kTRUE; 323 Bool_t close = kTRUE; 324 if (name[0]=='+') 325 { 326 open = kFALSE; 327 name.Remove(0, 1); 328 name = name.Strip(TString::kBoth); 329 } 330 331 if (name[name.Length()-1]=='+') 332 { 333 close = kFALSE; 334 name.Remove(name.Length()-1, 1); 335 name = name.Strip(TString::kBoth); 336 } 306 337 307 338 if (!name.EndsWith(".C")) 308 339 name += ".C"; 309 340 310 time_t t = time(NULL); 311 312 ofstream fout(name); 313 fout << 314 "/* ======================================================================== *\\" << endl << 315 "!" << endl << 316 "! *" << endl << 317 "! * This file is part of MARS, the MAGIC Analysis and Reconstruction" << endl << 318 "! * Software. It is distributed to you in the hope that it can be a useful" << endl << 319 "! * and timesaving tool in analysing Data of imaging Cerenkov telescopes." << endl << 320 "! * It is distributed WITHOUT ANY WARRANTY." << endl << 321 "! *" << endl << 322 "! * Permission to use, copy, modify and distribute this software and its" << endl << 323 "! * documentation for any purpose is hereby granted without fee," << endl << 324 "! * provided that the above copyright notice appear in all copies and" << endl << 325 "! * that both that copyright notice and this permission notice appear" << endl << 326 "! * in supporting documentation. It is provided \"as is\" without express" << endl << 327 "! * or implied warranty." << endl << 328 "! *" << endl << 329 "!" << endl << 330 "!" << endl << 331 "! Author(s): Thomas Bretz et al. <mailto:tbretz@astro.uni-wuerzburg.de>" << endl << 332 "!" << endl << 333 "! Copyright: MAGIC Software Development, 2000-2002" << endl << 334 "!" << endl << 335 "!" << endl << 336 "\\* ======================================================================== */" << endl << endl << 337 "// ------------------------------------------------------------------------" << endl << 338 "//" << endl << 339 "// This macro was automatically created on" << endl<< 340 "// " << ctime(&t) << 341 "// with the MEvtLoop::MakeMacro tool." << endl << 342 "//" << endl << 343 "// ------------------------------------------------------------------------" << endl << endl << 344 "void " << name(0, name.Length()-2) << "()" << endl << 345 "{" << endl; 346 347 SavePrimitive(fout); 341 ofstream fout; 342 343 if (!open) 344 { 345 fout.open(name, ios::app); 346 fout << endl; 347 fout << " // ----------------------------------------------------------------------" << endl; 348 fout << endl; 349 } 350 else 351 { 352 fout.open(name); 353 354 time_t t = time(NULL); 355 fout << 356 "/* ======================================================================== *\\" << endl << 357 "!" << endl << 358 "! *" << endl << 359 "! * This file is part of MARS, the MAGIC Analysis and Reconstruction" << endl << 360 "! * Software. It is distributed to you in the hope that it can be a useful" << endl << 361 "! * and timesaving tool in analysing Data of imaging Cerenkov telescopes." << endl << 362 "! * It is distributed WITHOUT ANY WARRANTY." << endl << 363 "! *" << endl << 364 "! * Permission to use, copy, modify and distribute this software and its" << endl << 365 "! * documentation for any purpose is hereby granted without fee," << endl << 366 "! * provided that the above copyright notice appear in all copies and" << endl << 367 "! * that both that copyright notice and this permission notice appear" << endl << 368 "! * in supporting documentation. It is provided \"as is\" without express" << endl << 369 "! * or implied warranty." << endl << 370 "! *" << endl << 371 "!" << endl << 372 "!" << endl << 373 "! Author(s): Thomas Bretz et al. <mailto:tbretz@astro.uni-wuerzburg.de>" << endl << 374 "!" << endl << 375 "! Copyright: MAGIC Software Development, 2000-2002" << endl << 376 "!" << endl << 377 "!" << endl << 378 "\\* ======================================================================== */" << endl << endl << 379 "// ------------------------------------------------------------------------" << endl << 380 "//" << endl << 381 "// This macro was automatically created on" << endl<< 382 "// " << ctime(&t) << 383 "// with the MEvtLoop::MakeMacro tool." << endl << 384 "//" << endl << 385 "// ------------------------------------------------------------------------" << endl << endl << 386 "void " << name(0, name.Length()-2) << "()" << endl << 387 "{" << endl; 388 } 389 390 SavePrimitive(fout, (TString)"" + (open?"open":"") + (close?"close":"")); 391 392 if (!close) 393 return; 348 394 349 395 fout << "}" << endl; … … 358 404 // gui elements to a macro-file. 359 405 // 360 void MEvtLoop::SavePrimitive(ofstream &out, Option_t *) 361 { 406 407 void MEvtLoop::StreamPrimitive(ofstream &out) const 408 { 409 out << " MEvtLoop " << GetUniqueName() << ";" << endl; 410 } 411 412 void MEvtLoop::SavePrimitive(ofstream &out, Option_t *opt) 413 { 414 TString options = opt; 415 options.ToLower(); 416 362 417 if (HasDuplicateNames("MEvtLoop::SavePrimitive")) 363 418 { … … 370 425 } 371 426 372 gListOfPrimitives = new TList; 427 if (!options.Contains("open")) 428 { 429 if (gListOfPrimitives) 430 { 431 *fLog << err << "MEvtLoop::SavePrimitive - Error: old file not closed." << endl; 432 gListOfPrimitives->ForEach(TObject, ResetBit)(BIT(15)); 433 delete gListOfPrimitives; 434 } 435 gListOfPrimitives = new TList; 436 } 373 437 374 438 if (fParList) 375 439 fParList->SavePrimitive(out); 376 440 377 out << " MEvtLoop evtloop;" << endl; 441 MParContainer::SavePrimitive(out); 442 378 443 if (fParList) 379 out << " evtloop.SetParList(&" << fParList->GetUniqueName() << ");" << endl;444 out << " " << GetUniqueName() << ".SetParList(&" << fParList->GetUniqueName() << ");" << endl; 380 445 else 381 446 out << " // fParList empty..." << endl; 382 out << " if (! evtloop.Eventloop())" << endl;447 out << " if (!" << GetUniqueName() << ".Eventloop())" << endl; 383 448 out << " return;" << endl; 449 450 if (!options.Contains("close")) 451 return; 384 452 385 453 gListOfPrimitives->ForEach(TObject, ResetBit)(BIT(15)); 386 454 delete gListOfPrimitives; 387 455 gListOfPrimitives = 0; 388 389 // remove all objects with BIT(15) set from gObjectTable390 456 } 391 457 -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r1483 r1525 34 34 MLog *fLog; // The general log facility for this object, initialized with the global object 35 35 36 virtual void StreamPrimitive(ofstream &out) const;37 38 36 private: 39 Bool_t fReadyToSave; // should be set to true if the contents of the container is changed somehow40 41 37 enum { 42 38 kIsSavedAsPrimitive = BIT(15) 43 39 }; 40 41 Bool_t fReadyToSave; // should be set to true if the contents of the container is changed somehow 42 43 virtual void StreamPrimitive(ofstream &out) const; 44 44 45 45 public:
Note:
See TracChangeset
for help on using the changeset viewer.