Changeset 1542
- Timestamp:
- 10/16/02 10:40:39 (22 years ago)
- Location:
- trunk/MagicSoft
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1540 r1542 1 1 -*-*- END -*-*- 2 2002/10/16: Thomas Bretz 3 4 * macros/readMagic.C: 5 - added MPrint for MRawEvtHeader 6 - changed to MPrint to new Skip-Style 7 8 * manalysis/MHillasCalc.cc, manalysis/MHillasSrcCalc.cc: 9 - corrected output stream in case of hex or setfill was used 10 11 * mbase/MPrint.[h,cc]: 12 - introduced new behaviour of PreProcess (EnableSkip) 13 14 * mbase/MTaskList.cc: 15 - fixed a bug in Process which caused Histograms to be written 16 after each event 17 18 * meventdisp/MGEvtDisplay.cc: 19 - introduced printing of MRawEvtHeader 20 21 * mmc/MMcEvt.cxx: 22 - some small changes 23 - changed Print output from cout to fLog 24 - changes to the default values 25 26 * mraw/MRawEvtHeader.[h,cc]: 27 - removed the second empty line after Print 28 - added Getter-function for the DAQEvtNumber 29 30 31 2 32 2002/10/15: Thomas Bretz 3 33 -
trunk/MagicSoft/Mars/macros/readMagic.C
r1540 r1542 58 58 plist.AddToList(&tlist); 59 59 60 MReadMarsFile 60 MReadMarsFile read("Events", fname); 61 61 read.DisableAutoScheme(); 62 62 63 MPrint print("MMcEvt"); 63 MPrint print1("MMcEvt"); 64 MPrint print2("MRawEvtHeader"); 65 print1.EnableSkip(); 66 print2.EnableSkip(); 67 64 68 MMcPedestalCopy pcopy; 65 69 MMcPedestalNSBAdd pnsb; … … 73 77 74 78 tlist.AddToList(&read); 75 tlist.AddToList(&print); 79 tlist.AddToList(&print1); 80 tlist.AddToList(&print2); 76 81 tlist.AddToList(&pcopy); 77 82 tlist.AddToList(&pnsb); -
trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc
r1540 r1542 125 125 *fLog << inf << endl; 126 126 *fLog << GetDescriptor() << " execution statistics:" << endl; 127 *fLog << dec << setfill(' '); 127 128 *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Event has less than 3 pixels" << endl; 128 129 *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) << (int)(fErrors[2]*100/GetNumExecutions()) << "%) Evts skipped due to: Calculated Size == 0" << endl; -
trunk/MagicSoft/Mars/manalysis/MHillasSrcCalc.cc
r1540 r1542 122 122 *fLog << inf << endl; 123 123 *fLog << GetDescriptor() << " execution statistics:" << endl; 124 *fLog << dec << setfill(' '); 124 125 *fLog << " " << fErrors << " (" << (int)(fErrors*100/GetNumExecutions()) << "%) Evts skipped due to: Dist==0" << endl; 125 126 *fLog << endl; -
trunk/MagicSoft/Mars/mbase/MPrint.cc
r1080 r1542 67 67 // must be overloaded. You can also set an option string to use 68 68 // when calling TObject::Print 69 // If you want that the MPrint instance is removed from the tasklist 70 // if the container to be printed is not found in the PreProcess, call: 71 // MPrint::EnableSkip(); 69 72 // 70 73 MPrint::MPrint(const char *obj, const char *option, … … 84 87 // must be overloaded. You can also set an option string to use 85 88 // when calling TObject::Print 89 // if the container to be printed is not found in the PreProcess, call: 90 // MPrint::EnableSkip(); 86 91 // 87 92 MPrint::MPrint(const TObject *obj, const char *option, … … 118 123 // If it couldn't get found stop Eventloop 119 124 // 120 *fLog << err << dbginf << fObjName << " not found... aborting." << endl; 121 return kFALSE; 125 *fLog << err << dbginf << fObjName << " not found... "; 126 if (TestBit(kSKIP)) 127 { 128 *fLog << "removing task from list." << endl; 129 return kSKIP; 130 } 131 else 132 { 133 *fLog << "aborting." << endl; 134 return kFALSE; 135 } 122 136 } 123 137 -
trunk/MagicSoft/Mars/mbase/MPrint.h
r1014 r1542 15 15 TString fOption; // Print option 16 16 17 enum { kSkip = BIT(14) }; 18 17 19 void Init(const char *name, const char *title); 18 20 … … 22 24 23 25 void SetOption(Option_t *option) { fOption = option; } 26 void EnableSkip(Bool_t skip=kTRUE) { skip ? SetBit(kSkip) : ResetBit(kSkip); } 24 27 25 28 Bool_t PreProcess(MParList *pList); -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r1540 r1542 380 380 if (!noreset) 381 381 { 382 fParList->SetReadyToSave( );382 fParList->SetReadyToSave(kFALSE); 383 383 fParList->Reset(); 384 384 fParList->SetBit(MParList::kDoNotReset); -
trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.cc
r1540 r1542 46 46 #include "MReadMarsFile.h" 47 47 #include "MGeomCamMagic.h" 48 #include "MRawEvtHeader.h" 48 49 49 50 #include "MMcEvt.hxx" … … 484 485 txt += "PhEl"; 485 486 487 const MRawEvtHeader *hed = (MRawEvtHeader*)GetParList()->FindObject("MRawEvtHeader"); 488 if (hed) 489 { 490 txt += " DAQEvt #"; 491 txt += hed->GetDAQEvtNumber(); 492 } 493 486 494 fEvtInfo->SetText(txt); 487 495 } -
trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc
r1082 r1542 214 214 } 215 215 } 216 217 *fLog << endl;218 216 *fLog << endl; 219 217 } -
trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h
r1018 r1542 54 54 55 55 UShort_t GetTrigType() const { return fTrigType; } 56 UInt_t GetDAQEvtNumber() const { return fDAQEvtNumber; } 56 57 57 58 int ReadEvt(istream& fin); -
trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx
r1353 r1542 1 1 #include "MMcEvt.hxx" 2 2 3 #include <iostream.h> 4 #include <fstream.h> 5 3 #include "MLog.h" 4 #include "MLogManip.h" 6 5 7 6 //========== … … 18 17 19 18 20 MMcEvt::MMcEvt() { 21 // 22 // default constructor 23 // set all values to zero 19 MMcEvt::MMcEvt() 20 { 21 // 22 // default constructor 23 // set all values to zero 24 24 fName = "MMcEvt"; 25 25 fTitle = "Event info from Monte Carlo"; 26 26 27 fPartId = 0 ; 28 fEnergy = 0. ; 29 30 fTheta = 0. ; 31 fPhi = 0. ; 32 33 fCoreD = 0. ; 34 fCoreX = 0. ; 35 fCoreY = 0. ; 36 fImpact = 0. ; 37 38 fPhotIni = 0 ; 39 fPassPhotAtm = 0 ; 40 fPassPhotRef = 0 ; 41 fPassPhotCone = 0 ; 42 fPhotElfromShower = 0 ; 43 fPhotElinCamera = 0 ; 44 } 45 46 MMcEvt::MMcEvt( UShort_t usPId, 27 Clear(); 28 } 29 30 MMcEvt::MMcEvt( UShort_t usPId, 47 31 Float_t fEner, 48 32 Float_t fThet, … … 99 83 100 84 101 void MMcEvt::Clear(Option_t *opt) {102 // 103 //104 // reset all values to zero105 106 fPartId = 0;107 fEnergy = 0.;108 109 fTheta = 0.;110 fPhi = 0.;111 112 fCoreD = 0.;113 fCoreX = 0.;114 fCoreY = 0.;115 fImpact = 0.;116 117 fPhotIni = 0;118 fPassPhotAtm = 0;119 fPassPhotRef = 0;120 fPassPhotCone = 0;121 fPhotElfromShower = 0;122 fPhotElinCamera = 0;85 void MMcEvt::Clear(Option_t *opt) 86 { 87 // 88 // reset all values to values as nonsense as possible 89 // 90 fPartId = 0; 91 fEnergy = -1; 92 93 fTheta = 0; 94 fPhi = 0; 95 96 fCoreD = 0; 97 fCoreX = 0; 98 fCoreY = 0; 99 fImpact = -1; 100 101 fPhotIni = 0; 102 fPassPhotAtm = 0; 103 fPassPhotRef = 0; 104 fPassPhotCone = 0; 105 fPhotElfromShower = 0; 106 fPhotElinCamera = 0; 123 107 } 124 108 … … 186 170 if (str.IsNull()) 187 171 { 188 cout<< endl;189 cout<< "Monte Carlo output:" << endl;190 cout<< " Particle Id: ";172 *fLog << all << endl; 173 *fLog << "Monte Carlo output:" << endl; 174 *fLog << " Particle Id: "; 191 175 switch(fPartId) 192 176 { 193 177 case kGAMMA: 194 cout<< "Gamma" << endl;178 *fLog << "Gamma" << endl; 195 179 break; 196 180 case kPROTON: 197 cout<< "Proton" << endl;181 *fLog << "Proton" << endl; 198 182 break; 199 183 case kHELIUM: 200 cout<< "Helium" << endl;184 *fLog << "Helium" << endl; 201 185 break; 202 186 } 203 cout<< " Energy: " << fEnergy << "GeV" << endl;204 cout<< " Impactpar.: " << fImpact/100 << "m" << endl;205 cout<< " Photoelectrons: " << fPhotElfromShower << endl;206 cout<< endl;187 *fLog << " Energy: " << fEnergy << "GeV" << endl; 188 *fLog << " Impactpar.: " << fImpact/100 << "m" << endl; 189 *fLog << " Photoelectrons: " << fPhotElfromShower << endl; 190 *fLog << endl; 207 191 return; 208 192 } … … 211 195 { 212 196 case kGAMMA: 213 cout<< "Particle: Gamma" << endl;197 *fLog << "Particle: Gamma" << endl; 214 198 break; 215 199 case kPROTON: 216 cout<< "Particle: Proton" << endl;200 *fLog << "Particle: Proton" << endl; 217 201 break; 218 202 case kHELIUM: 219 cout<< "Particle: Helium" << endl;203 *fLog << "Particle: Helium" << endl; 220 204 break; 221 205 } 222 206 if (str.Contains("energy", TString::kIgnoreCase)) 223 cout<< "Energy: " << fEnergy << "GeV" << endl;207 *fLog << "Energy: " << fEnergy << "GeV" << endl; 224 208 if (str.Contains("impact", TString::kIgnoreCase)) 225 cout<< "Impact: " << fImpact << "cm" << endl;226 } 209 *fLog << "Impact: " << fImpact << "cm" << endl; 210 }
Note:
See TracChangeset
for help on using the changeset viewer.