Changeset 1353 for trunk/MagicSoft
- Timestamp:
- 06/10/02 09:01:08 (22 years ago)
- Location:
- trunk/MagicSoft
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1351 r1353 1 1 -*-*- END -*-*- 2 2002/06/10: Thomas Bretz 3 4 * manalysis/MHillas.cc: 5 - changed atan2 to atan for fDelta 6 7 * mbase/MAGIC.h, mbase/BaseLinkDef.h: 8 - changed definitions for Particle Id to enum 9 10 * mbase/MGList.cc: 11 - IsA()->InheritsFrom() replaced with InheritsFrom() 12 13 * mbase/MWriteAsciiFile.cc: 14 - IsA()->InheritsFrom() replaced with InheritsFrom() 15 - removed some debug outputs 16 17 * mbase/MDataChain.[h,cc]: 18 - implemented sign '-' 19 20 * mhist/MH.h: 21 - changed default canvas size to 580x435 22 23 * mhist/MHHadroness.cc: 24 - added some more output to Print 25 26 * mhist/MHMatrix.h: 27 - changed some i,j to x,y 28 - removed fabs from distance calculation 29 - added sqrt to distance calculation 30 31 * mmc/MMcEvt.cxx: 32 - changed output of Print 33 34 35 2 36 2002/06/06: Thomas Bretz 3 37 4 * manalysis/MHillas .cc:5 - changed atan2 to atan 38 * manalysis/MHillasSrc.cc: 39 - changed atan2 to atan for fAlpha 6 40 7 41 -
trunk/MagicSoft/Mars/manalysis/MHillas.cc
r1218 r1353 281 281 // ------------------------------------------------------------------- 282 282 // 283 const float d = corryy - corrxx;284 285 fDelta = atan 2(d + sqrt(d*d + corrxy*corrxy*4), corrxy*2);283 const float d = (corryy - corrxx)/(corrxy*2); 284 285 fDelta = atan(d + sqrt(d*d + 1)); 286 286 287 287 fCosDelta = cos(fDelta); // need these in derived classes -
trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
r1116 r1353 5 5 #pragma link off all functions; 6 6 7 #pragma link C++ enum ParticleId_t; 8 7 9 #pragma link C++ global kCONTINUE; 8 #pragma link C++ global kGAMMA;9 #pragma link C++ global kPROTON;10 #pragma link C++ global kHELIUM;11 #pragma link C++ global kOXIGEN;12 #pragma link C++ global kIRON;13 10 #pragma link C++ global kPI; 14 11 #pragma link C++ global kRad2Deg; -
trunk/MagicSoft/Mars/mbase/MAGIC.h
r1337 r1353 22 22 // ParticleId for Monte Carlo simulation 23 23 // 24 const Int_t kGAMMA = 1; 25 const Int_t kPROTON = 14; 26 const Int_t kHELIUM = 402; 27 const Int_t kOXIGEN = 1608; 28 const Int_t kIRON = 5626; 24 typedef enum 25 { 26 kGAMMA = 1, 27 kPROTON = 14, 28 kHELIUM = 402, 29 kOXYGEN = 1608, 30 kIRON = 5626 31 } ParticleId_t; 29 32 30 33 const Double_t kPI = 3.1415926535897932384626433832795028841971693993751; -
trunk/MagicSoft/Mars/mbase/MGList.cc
r1218 r1353 99 99 // 100 100 #if ROOT_VERSION_CODE < ROOT_VERSION(3,02,07) 101 if (!obj->I sA()->InheritsFrom(TGWidget::Class()))101 if (!obj->InheritsFrom(TGWidget::Class())) 102 102 return NULL; 103 103 #endif -
trunk/MagicSoft/Mars/mbase/MWriteAsciiFile.cc
r1348 r1353 50 50 #include <fstream.h> 51 51 52 #include <TClass.h> // IsA53 52 #include <TMethodCall.h> // TMethodCall, AsciiWrite 54 53 … … 247 246 // MData is the highest class in the inheritance tree 248 247 // 249 if (obj->I sA()->InheritsFrom(MData::Class()))248 if (obj->InheritsFrom(MData::Class())) 250 249 { 251 250 if (!((MData*)obj)->PreProcess(plist)) … … 257 256 // MParContainer is the next class in the inheritance tree 258 257 // 259 if (obj->I sA()->InheritsFrom(MParContainer::Class()))258 if (obj->InheritsFrom(MParContainer::Class())) 260 259 continue; 261 260 … … 287 286 Int_t num = fList.GetEntries(); 288 287 289 *fLog << all << "CHECK&WRITE " << num << endl;290 291 288 TIter Next(&fList); 292 289 while ((obj=(MParContainer*)Next())) 293 290 { 294 *fLog << all << endl << obj->IsA()->GetName() << ": 0..." << flush;295 296 291 if (!obj->IsReadyToSave()) 297 292 continue; 298 293 299 *fLog << all << "1..." << flush;300 301 294 if (!obj->AsciiWrite(*fOut)) 302 295 continue; 303 296 304 *fLog << all << "2..." << flush;305 306 297 written = kTRUE; 307 298 -
trunk/MagicSoft/Mars/mdata/MDataChain.cc
r1348 r1353 163 163 int l = txt.Length(); 164 164 for (int i = 0; i<l; i++) 165 if (!isalnum(txt[i]) && txt[i]!='.' )165 if (!isalnum(txt[i]) && txt[i]!='.' && txt[i]!='-') 166 166 return i; 167 167 … … 208 208 if (txt=="exp") return kEExp; 209 209 if (txt=="pow10") return kEPow10; 210 if (txt=="sgn") return kESgn; 211 if (txt[0]=='-') return kENegative; 210 212 211 213 return kENoop; … … 276 278 { 277 279 // 278 // Check for the type of the conditional280 // Check for the type of the symbol 279 281 // 280 282 char is = txt[0]; … … 283 285 // 284 286 // If no filter is available or the available filter 285 // is of a different conditionalwe have to create a new286 // filter list with the new conditional287 // is of a different symbols we have to create a new 288 // data list with the new symbol 287 289 // 288 290 if (/*!member0->InheritsFrom(MDataMember::Class()) ||*/ type!=is) … … 301 303 } 302 304 303 *fLog << err << dbginf << "Syntax Error: First argument of condition missing." << endl; 304 if (member0) 305 delete member0; 306 return NULL; 305 if (txt[0]!='-' && txt[0]!='+') 306 { 307 *fLog << err << dbginf << "Syntax Error: First argument of symbol '"; 308 *fLog << txt[0] << "' missing." << endl; 309 if (member0) 310 delete member0; 311 return NULL; 312 } 313 314 // FALLTHROU 307 315 308 316 case '0': … … 316 324 case '8': 317 325 case '9': 326 if (txt[0]!='-' || isdigit(txt[1]) || txt[1]=='.') 318 327 { 319 328 char *end; … … 330 339 331 340 newmember = new MDataValue(num); 332 } 333 break; 341 break; 342 } 343 344 // FALLTHROUH 334 345 335 346 default: … … 365 376 366 377 Int_t first = GetBracket(txt); 367 TString sub = txt(1, first-1);378 TString sub = op==kENegative ? text.Remove(0,1) + txt : txt(1, first-1); 368 379 txt.Remove(0, first+1); 369 380 … … 407 418 switch (fOperatorType) 408 419 { 409 case kEAbs: return fabs(val); 410 case kELog: return log(val); 411 case kELog10: return log10(val); 412 case kESin: return sin(val); 413 case kECos: return cos(val); 414 case kETan: return tan(val); 415 case kESinH: return sinh(val); 416 case kECosH: return cosh(val); 417 case kETanH: return tanh(val); 418 case kEASin: return asin(val); 419 case kEACos: return acos(val); 420 case kEATan: return atan(val); 421 case kESqrt: return sqrt(val); 422 case kEExp: return exp(val); 423 case kEPow10: return pow(10, val); 424 case kENoop: return val; 420 case kEAbs: return fabs(val); 421 case kELog: return log(val); 422 case kELog10: return log10(val); 423 case kESin: return sin(val); 424 case kECos: return cos(val); 425 case kETan: return tan(val); 426 case kESinH: return sinh(val); 427 case kECosH: return cosh(val); 428 case kETanH: return tanh(val); 429 case kEASin: return asin(val); 430 case kEACos: return acos(val); 431 case kEATan: return atan(val); 432 case kESqrt: return sqrt(val); 433 case kEExp: return exp(val); 434 case kEPow10: return pow(10, val); 435 case kESgn: return val<0 ? -1 : 1; 436 case kENegative: return -val; 437 case kENoop: return val; 425 438 } 426 439 … … 436 449 switch (fOperatorType) 437 450 { 438 case kEAbs: *fLog << "abs" << flush; break; 439 case kELog: *fLog << "log" << flush; break; 440 case kELog10: *fLog << "log10" << flush; break; 441 case kESin: *fLog << "sin" << flush; break; 442 case kECos: *fLog << "cos" << flush; break; 443 case kETan: *fLog << "tan" << flush; break; 444 case kESinH: *fLog << "sinh" << flush; break; 445 case kECosH: *fLog << "cosh" << flush; break; 446 case kETanH: *fLog << "tanh" << flush; break; 447 case kEASin: *fLog << "asin" << flush; break; 448 case kEACos: *fLog << "acos" << flush; break; 449 case kEATan: *fLog << "atan" << flush; break; 450 case kESqrt: *fLog << "sqrt" << flush; break; 451 case kEExp: *fLog << "exp" << flush; break; 452 case kEPow10: *fLog << "pow10" << flush; break; 451 case kEAbs: *fLog << "abs" << flush; break; 452 case kELog: *fLog << "log" << flush; break; 453 case kELog10: *fLog << "log10" << flush; break; 454 case kESin: *fLog << "sin" << flush; break; 455 case kECos: *fLog << "cos" << flush; break; 456 case kETan: *fLog << "tan" << flush; break; 457 case kESinH: *fLog << "sinh" << flush; break; 458 case kECosH: *fLog << "cosh" << flush; break; 459 case kETanH: *fLog << "tanh" << flush; break; 460 case kEASin: *fLog << "asin" << flush; break; 461 case kEACos: *fLog << "acos" << flush; break; 462 case kEATan: *fLog << "atan" << flush; break; 463 case kESqrt: *fLog << "sqrt" << flush; break; 464 case kEExp: *fLog << "exp" << flush; break; 465 case kEPow10: *fLog << "pow10" << flush; break; 466 case kESgn: *fLog << "sgn" << flush; break; 467 case kENegative: *fLog << "-" << flush; break; 453 468 case kENoop: 454 469 break; -
trunk/MagicSoft/Mars/mdata/MDataChain.h
r1348 r1353 35 35 kESqrt, 36 36 kEPow10, 37 kEExp 37 kEExp, 38 kESgn, 39 kENegative 38 40 } OperatorType_t; 39 41 -
trunk/MagicSoft/Mars/mhist/MH.h
r1334 r1353 26 26 27 27 static TCanvas *MakeDefCanvas(TString name="", const char *title="", 28 const UInt_t w= 700, const UInt_t h=500);28 const UInt_t w=580, const UInt_t h=435); 29 29 static TCanvas *MakeDefCanvas(const TObject *obj, 30 const UInt_t w= 700, const UInt_t h=500);30 const UInt_t w=580, const UInt_t h=435); 31 31 32 32 static void SetBinning(TH1 *h, const MBinning *binsx); -
trunk/MagicSoft/Mars/mhist/MHHadroness.cc
r1346 r1353 197 197 Bool_t MHHadroness::Finalize() 198 198 { 199 *fLog << inf << "Finished filling hadroness histograms." << endl;200 201 199 Int_t n = fGhness->GetNbinsX(); 202 200 … … 268 266 *fLog << "Hadroness histograms:" << endl; 269 267 *fLog << "---------------------" << endl; 268 *fLog << "Acc Gammas at 1% Hadron-acc: " << Form("%3.0f", GetGammaAcceptance(0.01)*100) << "%" << endl; 269 *fLog << "Acc Gammas at 2% Hadron-acc: " << Form("%3.0f", GetGammaAcceptance(0.02)*100) << "%" << endl; 270 *fLog << "Acc Gammas at 5% Hadron-acc: " << Form("%3.0f", GetGammaAcceptance(0.05)*100) << "%" << endl; 270 271 *fLog << "Acc Gammas at 10% Hadron-acc: " << Form("%3.0f", GetGammaAcceptance(0.1)*100) << "%" << endl; 271 272 *fLog << "Acc Gammas at 20% Hadron-acc: " << Form("%3.0f", GetGammaAcceptance(0.2)*100) << "%" << endl; … … 274 275 *fLog << "Acc Gammas at 50% Hadron-acc: " << Form("%3.0f", GetGammaAcceptance(0.5)*100) << "%" << endl; 275 276 const Int_t h = fMinDist->GetMaximumBin(); 276 *fLog << "Minimum Distance to (0, 1): " << Form("%.2f", 1-fMinDist->GetMaximum()) << " atH=" << fMinDist->GetBinCenter(h) << endl;277 *fLog << " Acc Gammas = " << Form("%3.0f", fIntGhness->GetBinContent(h)*100) << "%, ";277 *fLog << "Minimum Distance to (0, 1): " << Form("%.2f", 1-fMinDist->GetMaximum()) << " @ H=" << fMinDist->GetBinCenter(h) << endl; 278 *fLog << " Acc Gammas = " << Form("%3.0f", fIntGhness->GetBinContent(h)*100) << "%, "; 278 279 *fLog << "Acc Hadrons = " << Form("%3.0f", fIntPhness->GetBinContent(h)*100) << "%" << endl; 279 *fLog << "Maximum Q-Factor: " << GetQfac()->GetMaximum() << endl; 280 280 const Int_t q = GetQfac()->GetMaximumBin(); 281 *fLog << "Maximum Q-Factor: " << GetQfac()->GetMaximum() << " @ H="; 282 *fLog << GetQfac()->GetBinCenter(q) << endl;; 283 *fLog << " Acc Gammas = " << Form("%3.0f", fIntGhness->GetBinContent(q)*100) << "%, "; 284 *fLog << "Acc Hadrons = " << Form("%3.0f", fIntPhness->GetBinContent(q)*100) << "%" << endl; 281 285 *fLog << endl; 282 286 } -
trunk/MagicSoft/Mars/mhist/MHMatrix.h
r1336 r1353 39 39 const TList *GetRules() const { return fRules; } 40 40 41 void SetEnergy(MHMatrix *m) { fEnergy = m; } 42 41 43 //void Draw(Option_t *opt=NULL); 42 44 //TObject *DrawClone(Option_t *opt=NULL) const; -
trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx
r1288 r1353 170 170 */ 171 171 172 void MMcEvt::Print(Option_t *Option) const { 173 // 174 // print out the data member on screen 175 // 176 cout << endl; 177 cout << "Monte Carlo output:" << endl; 178 cout << " Particle Id: " << fPartId; 179 cout << " Energy: " << fEnergy << "GeV"; 180 cout << " Impactpar.: " << fImpact/100 << "m"; 181 cout << " Photoelectrons: " << fPhotElfromShower; 182 cout << endl; 183 } 172 // -------------------------------------------------------------------------- 173 // 174 // Print the contents of the container. 175 // 176 // if you specify an option only the requested data members are printed: 177 // allowed options are: 178 // id, energy, impact 179 // 180 void MMcEvt::Print(Option_t *opt) const 181 { 182 // 183 // print out the data member on screen 184 // 185 TString str(opt); 186 if (str.IsNull()) 187 { 188 cout << endl; 189 cout << "Monte Carlo output:" << endl; 190 cout << " Particle Id: "; 191 switch(fPartId) 192 { 193 case kGAMMA: 194 cout << "Gamma" << endl; 195 break; 196 case kPROTON: 197 cout << "Proton" << endl; 198 break; 199 case kHELIUM: 200 cout << "Helium" << endl; 201 break; 202 } 203 cout << " Energy: " << fEnergy << "GeV" << endl; 204 cout << " Impactpar.: " << fImpact/100 << "m" << endl; 205 cout << " Photoelectrons: " << fPhotElfromShower << endl; 206 cout << endl; 207 return; 208 } 209 if (str.Contains("id", TString::kIgnoreCase)) 210 switch(fPartId) 211 { 212 case kGAMMA: 213 cout << "Particle: Gamma" << endl; 214 break; 215 case kPROTON: 216 cout << "Particle: Proton" << endl; 217 break; 218 case kHELIUM: 219 cout << "Particle: Helium" << endl; 220 break; 221 } 222 if (str.Contains("energy", TString::kIgnoreCase)) 223 cout << "Energy: " << fEnergy << "GeV" << endl; 224 if (str.Contains("impact", TString::kIgnoreCase)) 225 cout << "Impact: " << fImpact << "cm" << endl; 226 }
Note:
See TracChangeset
for help on using the changeset viewer.