Changeset 8892
- Timestamp:
- 05/19/08 15:04:36 (17 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8891 r8892 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2008/05/19 Thomas Bretz 22 23 * Makefile.conf.general, Makefile.conf.linux: 24 - distinguish between := (eval once) and = (eval every access) 25 26 * mbase/BaseLinkDef.h, mbase/Makefile: 27 - added MObjLookup 28 29 * mbase/MobjLookup.[h,cc]: 30 - added 31 32 * mbase/MEvtLoop.cc: 33 - set progress bar position to 0 before PreProcessing 34 35 * mdata/MDataMember.[h,cc]: 36 - added a member function to get a string 37 38 * mfilter/MFCosmics.cc: 39 - fixed a typo in a comment 40 41 * mhbase/MH.[h,cc]: 42 - improved SetBinning for newer root-versions 43 - improved SetBinning to correctly support axis with labels 44 (keeps the binning unchanged) 45 46 * mjobs/MJPedestal.cc: 47 - deny level1 and level2 triggers choosing pedestal events 48 49 * mraw/MRawRunHeader.h: 50 - added a member function returning the RunLength (stop-start) 51 52 * mtrigger/MTriggerPattern.[h,cc]: 53 - wrapped some comments 54 - improved comments 55 56 20 57 21 58 2008/05/15 Thomas Bretz -
trunk/MagicSoft/Mars/Makefile.conf.general
r8734 r8892 3 3 # 4 4 5 ROOTLIBS = `root-config --libs`-lASImage -lMinuit -lHistPainter -lThread6 ROOTGLIBS = `root-config --glibs`-lASImage -lMinuit -lHistPainter -lThread7 ROOTCFLAGS = `root-config --cflags`5 ROOTLIBS := $(shell root-config --libs) -lASImage -lMinuit -lHistPainter -lThread 6 ROOTGLIBS := $(shell root-config --glibs) -lASImage -lMinuit -lHistPainter -lThread 7 ROOTCFLAGS := $(shell root-config --cflags) 8 8 9 9 # … … 17 17 # export MARSLIBS="-lX11 -lXpm -L/usr/X11R6/lib" 18 18 # 19 DEFINES = -DMARSVER=\"\<cvs\>\" -D__MARS__ $(ARCHDEF) $(MARSDEFINES)19 DEFINES := -DMARSVER=\"\<cvs\>\" -D__MARS__ $(ARCHDEF) $(MARSDEFINES) 20 20 21 21 CXXFLAGS = $(ROOTCFLAGS) $(INCLUDES) $(OPTIM) $(DEBUG) $(DEFINES) -
trunk/MagicSoft/Mars/Makefile.conf.linux
r7780 r8892 9 9 # compilers 10 10 11 CC = gcc12 CXX = g++13 F77 = f7714 AR = ar -rc11 CC := gcc 12 CXX := g++ 13 F77 := f77 14 AR := ar -rc 15 15 16 16 # 17 17 # ----->>> settings for compilation 18 18 # 19 OPTIM = -O5 -Wall -fno-exceptions -fPIC -Wpointer-arith -Wcast-align -Wconversion -Woverloaded-virtual19 OPTIM := -O5 -Wall -fno-exceptions -fPIC -Wpointer-arith -Wcast-align -Wconversion -Woverloaded-virtual 20 20 # ggc 3.2: removed -fnonnull-objects -Wtraditional -Wnested-externs 21 DEBUG =22 ARCHDEF = -D__LINUX__23 SOFLAG = -shared21 DEBUG := 22 ARCHDEF := -D__LINUX__ 23 SOFLAG := -shared 24 24 25 25 # For debugging information use '-g' … … 27 27 28 28 #MARS_LIB = -Llib $(SUBDIRS:%=-l%) $(MARSLIBS) 29 MARS_LIB = -Llib $(MARSLIBS)30 INCLUDES = -I. $(SUBDIRS:%=-I%)29 MARS_LIB := -Llib $(MARSLIBS) 30 INCLUDES = -I. $(SUBDIRS:%=-I%) 31 31 32 32 # uncomment this for quiet compilation -
trunk/MagicSoft/Mars/NEWS
r8891 r8892 37 37 * the histogram classes MH3 and MHn now support profile histograms 38 38 39 * the histogram classes MH3 and MHn now support labels at the axis 40 39 41 * the Random Forest Train-classes (MJTRain*) now store the used datasets 40 42 in the output file … … 72 74 in the run-header disagrees now an error is raised (this can 73 75 happen in not well simulated Monte Carlo files) 76 77 * In the case of MUX-data pedestal events with the lvl1 trigger flag 78 could survive into the pedestal calculation -- fixed. 79 80 * Tab "TrigPat" added showing the distribution of the trigger pattern 81 as found in the run-files (normalized with the run length) 74 82 75 83 ;star … … 104 112 * the Monte Carlo events after cuts are now written to the output file 105 113 if an output file given 114 106 115 107 116 -
trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
r8842 r8892 26 26 #pragma link C++ namespace MARS; 27 27 #pragma link C++ namespace MMath; 28 //#pragma link C++ namespace UTF8; 28 29 #pragma link C++ class MString+; 29 30 #pragma link C++ class MEnv+; … … 70 71 #pragma link C++ class MArrayI; 71 72 73 #pragma link C++ class MObjLookup+; 74 72 75 #pragma link C++ class MTime+; 73 76 #pragma link C++ function operator<<(ostream&, const MTime&); -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r8746 r8892 249 249 } 250 250 #endif 251 252 if (fProgress) 253 fProgress->SetPosition(0); 251 254 252 255 // -
trunk/MagicSoft/Mars/mbase/Makefile
r8842 r8892 62 62 MPrint.cc \ 63 63 MZlib.cc \ 64 MThread.cc 64 MThread.cc \ 65 MObjLookup.cc 65 66 66 67 ############################################################ -
trunk/MagicSoft/Mars/mdata/MDataMember.cc
r8720 r8892 93 93 // -------------------------------------------------------------------------- 94 94 // 95 // Check if accessing fCall is safe 96 // 97 Bool_t MDataMember::CheckGet() const 98 { 99 if (!fObject) 100 { 101 *fLog << err << "ERROR - MDataMember::Get: fObject not initialized "; 102 *fLog << "(not PreProcessed)... returning 0." << endl; 103 return kFALSE; 104 } 105 106 if (!fCall) 107 { 108 *fLog << err << "ERROR - MDataMemberGet: No TMethodCall for " << fDataMember << " of "; 109 *fLog << fObject->GetName() << " available... returning 0." << endl; 110 return kFALSE; 111 } 112 113 return kTRUE; 114 } 115 116 // -------------------------------------------------------------------------- 117 // 95 118 // Returns the value you requested 96 119 // 97 120 Double_t MDataMember::GetValue() const 98 121 { 99 if (!fObject) 100 { 101 *fLog << err << "ERROR - MDataMember::GetValue: fObject not initialized "; 102 *fLog << "(not PreProcessed)... returning 0." << endl; 122 if (!CheckGet()) 103 123 return 0; 104 }105 106 if (!fCall)107 {108 *fLog << err << "No TMethodCall for " << fDataMember << " of ";109 *fLog << fObject->GetName() << " available... returning 0." << endl;110 return 0;111 }112 124 113 125 switch (fCall->ReturnType()) … … 127 139 *fLog << fObject->GetName() << " neither int nor float... returning 0." << endl; 128 140 return 0; 141 } 142 } 143 144 // -------------------------------------------------------------------------- 145 // 146 // Returns the string you requested 147 // 148 const char *MDataMember::GetString() const 149 { 150 if (!CheckGet()) 151 return NULL; 152 153 switch (fCall->ReturnType()) 154 { 155 case TMethodCall::kString: 156 { 157 char *c=NULL; 158 fCall->Execute(fObject, &c); 159 return c; 160 } 161 162 default: 163 *fLog << err << "DataMember " << fDataMember << " of "; 164 *fLog << fObject->GetName() << " not a char*... returning NULL." << endl; 165 return NULL; 129 166 } 130 167 } -
trunk/MagicSoft/Mars/mdata/MDataMember.h
r3572 r8892 22 22 enum { kIsInt = BIT(14) }; 23 23 24 Bool_t CheckGet() const; 25 24 26 public: 25 27 MDataMember(const char *member=NULL) : fObject(NULL), fCall(NULL) … … 32 34 33 35 Double_t GetValue() const; 36 const char *GetString() const; 34 37 Bool_t PreProcess(const MParList *plist); 35 38 -
trunk/MagicSoft/Mars/mfilter/MFCosmics.cc
r8211 r8892 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MFCosmics.cc,v 1.1 6 2006-11-02 20:00:02tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MFCosmics.cc,v 1.17 2008-05-19 14:04:11 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 216 216 // 217 217 // If the camera contains more than fMaxEmptyPixels 218 // presumed pixels due to cosmics, then the event is discar ted.218 // presumed pixels due to cosmics, then the event is discarded. 219 219 // 220 220 return cosmicpix > fMaxEmptyPixels*allpix; -
trunk/MagicSoft/Mars/mhbase/MH.cc
r8709 r8892 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.3 6 2007-08-25 15:30:24tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.37 2008-05-19 14:04:12 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 212 212 // -------------------------------------------------------------------------- 213 213 // 214 // Applies a given binning to a 1D-histogram 214 // If labels are set for this axis the correct MBinning corresponding 215 // to the existing label range is returned (this is necessary to 216 // maintain the correct number of bins in the histogram) 217 // otherwise the given binning is returned. 218 // 219 MBinning MH::GetBinningForLabels(TAxis &x, const MBinning *bins) 220 { 221 if (!x.GetLabels()) 222 return *bins; 223 224 const Int_t n = TMath::Max(x.GetLabels()->GetEntries(), 1); 225 return MBinning(n, 0, n); 226 } 227 228 // -------------------------------------------------------------------------- 229 // 230 // If Labels are set this function deletes the fXbins Array from 231 // the axis (which makes the axis a variable bin-size axis) 232 // and sets the Nbins, Xmin and Xmax according to the number of labels. 233 // 234 void MH::RestoreBinningForLabels(TAxis &x) 235 { 236 if (!x.GetLabels()) 237 return; 238 239 const Int_t n = TMath::Max(x.GetLabels()->GetEntries(), 1); 240 x.Set(n, 0, n); 241 242 const_cast<TArrayD*>(x.GetXbins())->Set(0); 243 } 244 245 // -------------------------------------------------------------------------- 246 // 247 // Applies a given binning to a 1D-histogram. In case the axis has labels 248 // (e.g. GetXaxis()->GetLabels()) the binning is set according to the 249 // labels. 215 250 // 216 251 void MH::SetBinning(TH1 *h, const MBinning *binsx) … … 225 260 #endif 226 261 262 #if ROOT_VERSION_CODE < ROOT_VERSION(5,12,00) 227 263 // All this is reset by TAxis::Set 228 264 const TAttAxis att(x); … … 247 283 x.SetTimeDisplay(tm); 248 284 x.SetTimeFormat(tf); 285 #else 286 if (!x.GetLabels()) 287 h->SetBins(binsx->GetNumBins(), binsx->GetEdges()); 288 #endif 289 249 290 250 291 #if ROOT_VERSION_CODE < ROOT_VERSION(3,03,03) … … 255 296 // -------------------------------------------------------------------------- 256 297 // 257 // Applies given binnings to the two axis of a 2D-histogram 298 // Applies given binnings to the two axis of a 2D-histogram. 299 // In case the axis has labels (e.g. GetXaxis()->GetLabels()) 300 // the binning is set according to the labels. 258 301 // 259 302 void MH::SetBinning(TH2 *h, const MBinning *binsx, const MBinning *binsy) … … 261 304 TAxis &x = *h->GetXaxis(); 262 305 TAxis &y = *h->GetYaxis(); 306 307 const MBinning bx(GetBinningForLabels(x, binsx)); 308 const MBinning by(GetBinningForLabels(y, binsy)); 263 309 264 310 // … … 270 316 #endif 271 317 318 #if ROOT_VERSION_CODE < ROOT_VERSION(5,12,00) 272 319 // All this is reset by TAxis::Set 273 320 const TAttAxis attx(x); … … 283 330 // TH1D::fNcells must be set correctly. 284 331 // 285 h->SetBins(b insx->GetNumBins(), 0, 1,286 b insy->GetNumBins(), 0, 1);332 h->SetBins(bx.GetNumBins(), 0, 1, 333 by.GetNumBins(), 0, 1); 287 334 288 335 // … … 290 337 // in one of the two given histograms 291 338 // 292 x.Set(b insx->GetNumBins(), binsx->GetEdges());293 y.Set(b insy->GetNumBins(), binsy->GetEdges());339 x.Set(bx.GetNumBins(), bx.GetEdges()); 340 y.Set(by.GetNumBins(), by.GetEdges()); 294 341 295 342 // All this is reset by TAxis::Set … … 300 347 x.SetTimeFormat(tfx); 301 348 y.SetTimeFormat(tfy); 349 #else 350 h->SetBins(bx.GetNumBins(), bx.GetEdges(), 351 by.GetNumBins(), by.GetEdges()); 352 #endif 353 354 RestoreBinningForLabels(x); 355 RestoreBinningForLabels(y); 302 356 303 357 #if ROOT_VERSION_CODE < ROOT_VERSION(3,03,03) … … 310 364 // 311 365 // Applies given binnings to the three axis of a 3D-histogram 366 // In case the axis has labels (e.g. GetXaxis()->GetLabels()) 367 // the binning is set according to the labels. 312 368 // 313 369 void MH::SetBinning(TH3 *h, const MBinning *binsx, const MBinning *binsy, const MBinning *binsz) … … 319 375 TAxis &y = *h->GetYaxis(); 320 376 TAxis &z = *h->GetZaxis(); 377 378 const MBinning bx(GetBinningForLabels(x, binsx)); 379 const MBinning by(GetBinningForLabels(y, binsy)); 380 const MBinning bz(GetBinningForLabels(z, binsz)); 321 381 322 382 #if ROOT_VERSION_CODE < ROOT_VERSION(3,03,03) … … 326 386 #endif 327 387 388 #if ROOT_VERSION_CODE < ROOT_VERSION(5,12,00) 328 389 // All this is reset by TAxis::Set 329 390 const TAttAxis attx(x); … … 336 397 const TString tfy(y.GetTimeFormat()); 337 398 const TString tfz(z.GetTimeFormat()); 399 #endif 338 400 339 401 // … … 342 404 // TH1D::fNcells must be set correctly. 343 405 // 344 h->SetBins(b insx->GetNumBins(), 0, 1,345 b insy->GetNumBins(), 0, 1,346 b insz->GetNumBins(), 0, 1);406 h->SetBins(bx.GetNumBins(), 0, 1, 407 by.GetNumBins(), 0, 1, 408 bz.GetNumBins(), 0, 1); 347 409 348 410 // … … 350 412 // in one of the two given histograms 351 413 // 352 x.Set(binsx->GetNumBins(), binsx->GetEdges()); 353 y.Set(binsy->GetNumBins(), binsy->GetEdges()); 354 z.Set(binsz->GetNumBins(), binsz->GetEdges()); 355 414 x.Set(bx.GetNumBins(), bx.GetEdges()); 415 y.Set(by.GetNumBins(), by.GetEdges()); 416 z.Set(bz.GetNumBins(), bz.GetEdges()); 417 418 RestoreBinningForLabels(x); 419 RestoreBinningForLabels(y); 420 RestoreBinningForLabels(z); 421 422 #if ROOT_VERSION_CODE < ROOT_VERSION(5,12,00) 356 423 // All this is reset by TAxis::Set 357 424 attx.Copy(x); … … 364 431 y.SetTimeFormat(tfy); 365 432 z.SetTimeFormat(tfz); 433 #endif 366 434 367 435 #if ROOT_VERSION_CODE < ROOT_VERSION(3,03,03) -
trunk/MagicSoft/Mars/mhbase/MH.h
r8696 r8892 26 26 Byte_t fSerialNumber; // Serial number (eg of telecope) 27 27 UInt_t fNumExecutions; // Number of calls to Fill function 28 29 static MBinning GetBinningForLabels(TAxis &x, const MBinning *bins); 30 static void RestoreBinningForLabels(TAxis &x); 28 31 29 32 public: -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r8795 r8892 1132 1132 MFTriggerPattern ftp2("PedestalFilter"); 1133 1133 ftp2.SetDefault(kTRUE); 1134 ftp2.RequirePedestal(); 1134 1135 ftp2.DenyCalibration(); 1135 ftp2.RequirePedestal(); 1136 1137 // NEW! 1138 ftp2.DenyTriggerLvl1(); 1139 ftp2.DenyTriggerLvl2(); 1136 1140 1137 1141 if (!fSequence.IsMonteCarlo() && (!fExtractor || !fExtractor->HasLoGain())) -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.h
r8704 r8892 111 111 const MTime &GetRunStart() const { return fRunStart; } 112 112 const MTime &GetRunEnd() const { return fRunStop; } 113 Double_t GetRunLength() const { return fRunStop-fRunStart; } 113 114 Short_t GetPixAssignment(UShort_t i) const; 114 115 UShort_t GetMaxPixId() const; -
trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.cc
r8787 r8892 96 96 // otherway you will have it. 97 97 // 98 // To select events by the trigger pattern you should use MFTriggerPattern filter.99 // This filter uses Require- and Deny- methods to select your trigger pattern.100 // Require- methods requires that your trigger bit is ON, otherway the event101 // is kicked out. Deny- methods requires that your trigger bit is OFF, otherway102 // your event is kicked out. Other bits not selected by your Require- or Deny- call103 // are ignored. Let's give an example. You want to select all events that have104 // both LT1 and LT2 trigger but which are not calibration neither Pin Diode events.105 // You should look at unprescaled bits to be sure106 // about which were the initial triggers. Then you can implement in your macro107 // something like:98 // To select events by the trigger pattern you should use MFTriggerPattern 99 // filter. This filter uses Require- and Deny- methods to select your 100 // trigger pattern. Require- methods requires that your trigger bit is ON, 101 // otherway the event is kicked out. Deny- methods requires that your 102 // trigger bit is OFF, otherway your event is kicked out. Other bits not 103 // selected by your Require- or Deny- call are ignored. Let's give an 104 // example. You want to select all events that have both LT1 and LT2 105 // trigger but which are not calibration neither Pin Diode events. You 106 // should look at unprescaled bits to be sure about which were the initial 107 // triggers. Then you can implement in your macro something like: 108 108 // 109 109 // MFTriggerPattern ftrigpatt; -
trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.h
r8787 r8892 12 12 public: 13 13 enum Pattern_t { 14 kTriggerLvl1 = BIT(0), 15 kCalibration = BIT(1), // Pulse Trigger16 kTriggerLvl2 = BIT(2), // LUT Pseudo Size selection17 kPedestal = BIT(3), 18 kPinDiode = BIT(4), 19 kSumTrigger = BIT(5) // Flag for an event taken with sum trigger14 kTriggerLvl1 = BIT(0), // 1: 15 kCalibration = BIT(1), // 2: Pulse Trigger 16 kTriggerLvl2 = BIT(2), // 4: LUT Pseudo Size selection 17 kPedestal = BIT(3), // 8: 18 kPinDiode = BIT(4), // 16: 19 kSumTrigger = BIT(5) // 32: Flag for an event taken with sum trigger 20 20 //kUnused = BIT(6) 21 21 //kUnused = BIT(7)
Note:
See TracChangeset
for help on using the changeset viewer.