Changeset 7442 for trunk/MagicSoft
- Timestamp:
- 12/05/05 16:36:41 (19 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7440 r7442 18 18 19 19 -*-*- END OF LINE -*-*- 20 2005/12/06 Thomas Bretz 21 22 * mbase/MEnv.[h,cc]: 23 - added new function to get fillstyle by name 24 - added new function to get attributes of a TPave 25 26 * mbase/MTime.cc: 27 - fixed layout of a comment 28 29 * mhflux/MAlphaFitter.[h,cc]: 30 - added a function to calc upper limits 31 - exchaged some GetListOfFunctions()-Remove() with SetName 32 33 34 20 35 2005/12/01 Thomas Bretz 21 36 … … 110 125 * mjobs/MJCut.cc: 111 126 - output is called "Hadronness" not "MHadronness" 127 128 * mjtrain/MJTrainDisp.cc, mjtrain/MJTrainEnergy.cc: 129 - fixed bug which caused the traincuts to be ignored 112 130 113 131 -
trunk/MagicSoft/Mars/mbase/MEnv.cc
r7432 r7442 37 37 #include <TObjString.h> 38 38 39 #include <TPave.h> 39 40 #include <TAttText.h> 40 #include <TAttFill.h>41 #include <TAttLine.h>41 //#include <TAttFill.h> 42 //#include <TAttLine.h> 42 43 #include <TAttMarker.h> 43 44 … … 68 69 fChecked.Add(new TObjString(name)); 69 70 return TEnv::GetValue(name, dflt); 71 } 72 73 Int_t MEnv::GetFillStyle(const char *name, Int_t dftl) 74 { 75 TString str = GetValue(name, ""); 76 str = str.Strip(TString::kBoth); 77 if (str.IsNull()) 78 return dftl; 79 80 str.ToLower(); 81 82 switch (str.Hash()) 83 { 84 case (unsigned)-1920099718/*2374867578*/: return 0;// hollow 85 case 764279305: return 1001;// solid 86 case 1854683492: return 2001; // hatch 87 } 88 89 return str.EndsWith("%") ? 4000+str.Atoi() : str.Atoi(); 70 90 } 71 91 … … 106 126 TString MEnv::Compile(TString str, const char *post) const 107 127 { 108 if (!str.IsNull() && str[str.Length()-1]!='.')128 if (!str.IsNull() && !str.EndsWith(".")) 109 129 str += "."; 110 130 … … 165 185 166 186 const Color_t col = GetColor(color, dftl->GetFillColor()); 167 const Style_t sty = Get Value(style, dftl->GetFillStyle());168 187 const Style_t sty = GetFillStyle(style, dftl->GetFillStyle()); 188 169 189 fill.SetFillColor(col); 170 190 fill.SetFillStyle(sty); … … 187 207 marker.SetMarkerStyle(sty); 188 208 marker.SetMarkerSize(siz); 209 } 210 211 void MEnv::GetAttPave(const char *str, TPave &pave, TPave *dftl) 212 { 213 const TString post(str); 214 215 TString name(pave.GetName()); 216 if (!name.IsNull() && name!=pave.ClassName()) 217 name = Compile(name, post); 218 219 GetAttLine(name, pave, dftl); 220 GetAttFill(name, pave, dftl); 221 222 const TString corner = Compile(name, "CornerRadius"); 223 const TString border = Compile(name, "BorderSize"); 224 const TString option = Compile(name, "Option"); 225 226 if (!dftl) 227 dftl = &pave; 228 229 const Double_t cor = GetValue(corner, dftl->GetCornerRadius()); 230 const Int_t bor = GetValue(border, dftl->GetBorderSize()); 231 232 pave.SetCornerRadius(cor); 233 pave.SetBorderSize(bor); 234 235 TString opt = GetValue(option, dftl->GetOption()); 236 opt.ToLower(); 237 238 const Bool_t has = pave.GetCornerRadius()>0; 239 240 if (has && !opt.Contains("arc")) 241 opt += "arc"; 242 243 if (!has && opt.Contains("arc")) 244 opt.ReplaceAll("arc", ""); 245 246 pave.SetOption(opt); 247 189 248 } 190 249 … … 204 263 //TAttTextEditor *line = dynamic_cast<TAttTextEditor*>(obj); 205 264 265 TPave *pave = dynamic_cast<TPave*>(/*(TAttLine*)*/obj); 206 266 TAttLine *line = dynamic_cast<TAttLine*>(/*(TAttLine*)*/obj); 207 267 TAttText *text = dynamic_cast<TAttText*>(/*(TAttText*)*/obj); … … 210 270 211 271 cout << line << " " << text << " " << fill << " " << mark << endl; 272 273 if (pave) 274 { 275 GetAttPave(name, *pave, dynamic_cast<TPave*>(dftl)); 276 return; 277 } 212 278 213 279 if (line) … … 228 294 TIter Next(GetTable()); 229 295 TObject *o=0; 296 230 297 while ((o=Next())) 231 298 if (!fChecked.FindObject(o->GetName())) -
trunk/MagicSoft/Mars/mbase/MEnv.h
r7432 r7442 14 14 class TAttText; 15 15 class TAttFill; 16 class TPave; 16 17 17 18 class MEnv : public TEnv … … 30 31 31 32 Int_t GetColor(const char *name, Int_t dftl); 33 Int_t GetFillStyle(const char *name, Int_t dftl); 32 34 33 35 void GetAttributes(const char *name, TObject *obj, TObject *dftl=0); … … 36 38 void GetAttFill(const char *name, TAttFill &fill, TAttFill *dftl=0); 37 39 void GetAttMarker(const char *name, TAttMarker &marker, TAttMarker *dftl=0); 40 void GetAttPave(const char *name, TPave &pave, TPave *dftl=0); 38 41 39 42 void PrintUntouched() const; -
trunk/MagicSoft/Mars/mbase/MTime.cc
r7432 r7442 532 532 // The maximum size of the return string is 128 (incl. NULL) 533 533 // 534 // For dates before 1. 1.1902 a null string is returned534 // For dates before 1. 1.1902 a null string is returned 535 535 // For dates after 31.12.2037 a null string is returned 536 536 // -
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc
r7392 r7442 47 47 48 48 #include <TRandom.h> 49 #include <TFeldmanCousins.h> 49 50 50 51 #include <TLine.h> … … 256 257 257 258 return kTRUE; 259 } 260 261 // -------------------------------------------------------------------------- 262 // 263 // Calculate the upper limit for fEventsSignal number of observed events 264 // and fEventsBackground number of background events. 265 // 266 // Therefor TFeldmanCousin is used. 267 // 268 // The Feldman-Cousins method as described in PRD V57 #7, p3873-3889 269 // 270 Double_t MAlphaFitter::CalcUpperLimit() const 271 { 272 // get a FeldmanCousins calculation object with the default limits 273 // of calculating a 90% CL with the minimum signal value scanned 274 // = 0.0 and the maximum signal value scanned of 50.0 275 TFeldmanCousins f; 276 f.SetMuStep(0.05); 277 f.SetMuMax(100); 278 return f.CalculateUpperLimit(fEventsSignal, fEventsBackground); 258 279 } 259 280 … … 315 336 TF1 *fcn = f.fFunc; 316 337 f.fFunc = new TF1(*fFunc); 338 f.fFunc->SetName("Dummy"); 317 339 gROOT->GetListOfFunctions()->Remove(f.fFunc); 318 f.fFunc->SetName("Dummy");319 340 delete fcn; 320 341 } -
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h
r7392 r7442 53 53 SignalFunc_t fSignalFunc; // Type of signal function 54 54 // Result 55 Double_t fSignificance; // significance of signal56 Double_t fSignificanceExc; // significance of excess55 Double_t fSignificance; // significance of an unknown signal (Li/Ma 17) 56 Double_t fSignificanceExc; // significance of a known excess (Li/Ma 5) 57 57 Double_t fEventsExcess; // calculated number of excess events (signal-bg) 58 58 Double_t fEventsSignal; // calculated number of signal events … … 88 88 fTitle = title ? title : "Fit alpha"; 89 89 90 fFunc->SetName("Dummy"); 90 91 gROOT->GetListOfFunctions()->Remove(fFunc); 91 fFunc->SetName("Dummy");92 92 93 93 Clear(); … … 147 147 } 148 148 fSignalFunc=func; 149 fFunc->SetName("Dummy"); 149 150 gROOT->GetListOfFunctions()->Remove(fFunc); 150 fFunc->SetName("Dummy");151 151 fCoefficients.Set(3+fPolynomOrder+1); 152 152 fCoefficients.Reset(); … … 175 175 Double_t Eval(Double_t d) const { return fFunc ? fFunc->Eval(d) : 0; } 176 176 177 Double_t CalcUpperLimit() const; 178 177 179 // Interface to fit 178 180 Bool_t Fit(TH1D &h, Bool_t paint=kFALSE);
Note:
See TracChangeset
for help on using the changeset viewer.