Changeset 1629
- Timestamp:
- 11/18/02 10:46:48 (22 years ago)
- Location:
- trunk/MagicSoft
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1628 r1629 1 1 -*-*- END -*-*- 2 3 2002/11/18: Thomas Bretz 4 5 * macros/multidimdist2.C: 6 - fixed a typo 7 - added Alpha and Theta 8 9 * mbase/MTime.h: 10 - added minus-operator 11 12 * mdata/MDataChain.[h,cc]: 13 - added floor 14 15 * mhist/MFillH.[h,cc]: 16 - moved MMap and MMap support MHArray 17 18 * mhist/MHArray.[h,cc]: 19 - added MMap 20 - added MMap-support 21 - added legend 22 - added more draw options 23 24 * mhist/MHFadcCam.[h,cc]: 25 - added Fill(const MRawEvtData*) 26 - added const getter functions 27 28 * mhist/MHFadcPix.h: 29 - added const getter functions 30 31 * mmc/MMcCorsikaRunHeader.[h,cc]: 32 - removed underscores from names 33 - removed empty destructor 34 35 36 2 37 2002/11/16: Abelardo Moralejo 3 38 4 39 * mmc/MMcCorsikaRunHeader.cc: 5 40 - added default destructor 41 42 6 43 7 44 2002/11/15: Thomas Bretz -
trunk/MagicSoft/Mars/macros/multidimdist2.C
r1608 r1629 65 65 // Give the names of the star-files to be read 66 66 // Here you give the trainings sample(s) for 67 // the hadrons67 // the gammas 68 68 // --------------------------------------------- 69 69 MReadMarsFile readg("Events", "star_gammas.root"); … … 83 83 matrix.AddColumn("MHillasSrc.fDist"); 84 84 matrix.AddColumn("log10(MHillas.fSize)"); 85 matrix.AddColumn("MHillasSrc.fAlpha"); 86 matrix.AddColumn("MMcEvt.fTheta"); 85 87 plist.AddToList(&matrix); 86 88 -
trunk/MagicSoft/Mars/mbase/MTime.h
r1014 r1629 86 86 }; 87 87 88 inline Double_t operator-(MTime &t1, MTime &t2) 89 { 90 return (Double_t)t1.GetTimeLo()-(Double_t)t2.GetTimeLo(); 91 } 92 88 93 inline Bool_t operator<(MTime &t1, MTime &t2) 89 94 { -
trunk/MagicSoft/Mars/mdata/MDataChain.cc
r1574 r1629 70 70 // sqrt(x) square root of x 71 71 // abs(x) absolute value of x, |x| 72 // floor(x) round down to the nearest integer (floor(9.9)=9) 72 73 // 73 74 // … … 227 228 if (txt=="pow10") return kEPow10; 228 229 if (txt=="sgn") return kESgn; 230 if (txt=="floor") return kEFloor; 229 231 if (txt[0]=='-') return kENegative; 230 232 if (txt[0]=='+') return kEPositive; … … 471 473 case kENegative: return -val; 472 474 case kEPositive: return val; 475 case kEFloor: return floor(val); 473 476 case kENoop: return val; 474 477 } … … 553 556 case kENegative: str += "-" ; break; 554 557 case kEPositive: str += "+" ; break; 558 case kEFloor: str += "floor"; break; 555 559 case kENoop: 556 560 break; -
trunk/MagicSoft/Mars/mdata/MDataChain.h
r1574 r1629 38 38 kESgn, 39 39 kEPositive, 40 kENegative 40 kENegative, 41 kEFloor 41 42 } OperatorType_t; 42 43 -
trunk/MagicSoft/Mars/mhist/MFillH.cc
r1574 r1629 85 85 ClassImp(MFillH); 86 86 87 //////////////////////////////////////////////////////////////////////////////88 //89 // MMap90 //91 // This class maps a key-value to a given value. In its simple versions it92 // maps a key to an index.93 //94 //////////////////////////////////////////////////////////////////////////////95 #include <TArrayI.h>96 97 class MMap98 {99 private:100 TArrayI fKeys;101 TArrayI fValues;102 103 Int_t K(Int_t i) const { return ((TArrayI)fKeys)[i]; }104 Int_t V(Int_t i) const { return ((TArrayI)fValues)[i]; }105 106 public:107 // --------------------------------------------------------------------------108 //109 // Get the value which corresponds to the given key-value110 //111 Int_t GetValue(Int_t key) const112 {113 const Int_t n = fKeys.GetSize();114 for (int i=0; i<n; i++)115 {116 if (K(i)==key)117 return V(i);118 }119 return -1;120 }121 122 // --------------------------------------------------------------------------123 //124 // Adds a new pair key-value. While the key is the key to the value.125 // if the key already exists the pair is ignored.126 //127 void Add(Int_t key, Int_t value)128 {129 if (GetValue(key)>=0)130 return;131 132 const Int_t n = fKeys.GetSize();133 134 fKeys.Set(n+1);135 fValues.Set(n+1);136 137 fKeys[n] = key;138 fValues[n] = value;139 }140 141 // --------------------------------------------------------------------------142 //143 // Adds a new pair key-value. While the key is the key to the value.144 // In this case the value is an automatically sequential created index.145 // if the key already exists the pair is ignored.146 //147 Int_t Add(Int_t key)148 {149 const Int_t k = GetValue(key);150 if (k>=0)151 return k;152 153 const Int_t n = fKeys.GetSize();154 155 fKeys.Set(n+1);156 fValues.Set(n+1);157 158 fKeys[n] = key;159 fValues[n] = n;160 161 return n;162 }163 };164 165 87 // -------------------------------------------------------------------------- 166 88 // … … 177 99 178 100 fIndex = NULL; 179 fMapIdx = new MMap;180 101 } 181 102 … … 326 247 if (fIndex->TestBit(kCanDelete)) 327 248 delete fIndex; 328 329 delete fMapIdx;330 249 } 331 250 … … 500 419 { 501 420 if (fIndex) 502 { 503 const Int_t key = (Int_t)fIndex->GetValue(); 504 const Int_t idx = fMapIdx->Add(key); 505 ((MHArray*)fH)->SetIndex(idx); 506 } 421 ((MHArray*)fH)->SetIndexByKey(fIndex->GetValue()); 422 /* 423 const Int_t key = (Int_t)fIndex->GetValue(); 424 const Int_t idx = fMapIdx->Add(key); 425 ((MHArray*)fH)->SetIndex(idx); 426 */ 507 427 508 428 return fH->Fill(fParContainer); -
trunk/MagicSoft/Mars/mhist/MHArray.cc
r1576 r1629 37 37 // by its index. 38 38 // 39 // To map a key to the index use/see MFillH, which automatically maps a 40 // key-value to the array index. 39 // To access the histograms by a key instead of an index use SetIndexByKey 40 // instead of Set/Inc/DecIndex. It will take the integerpart of the 41 // floating point value (2 in case of 2.9). For each new key a new 42 // index in the Mapping Table is created. So that you can access your 43 // histograms by the key (eg in case of the Angle Theta=23.2deg use 44 // SetIndexByKey(23.2) 45 // 46 // If the index is equal to the number of histograms in the array a call 47 // to the Fill-member-function will create a new histogram. 41 48 // 42 49 // In the constructor istempl leads to two different behaviours of the … … 73 80 ClassImp(MHArray); 74 81 75 // -------------------------------------------------------------------------- 76 // 77 // Default Constructor. hname is the name of the histogram class which 78 // is in the array. 82 ////////////////////////////////////////////////////////////////////////////// 83 // 84 // MMap 85 // 86 // This class maps a key-value to a given value. In its simple versions it 87 // maps a key to an index. 88 // 89 ////////////////////////////////////////////////////////////////////////////// 90 #include <TArrayI.h> 91 92 class MMap 93 { 94 private: 95 TArrayI fKeys; 96 TArrayI fValues; 97 98 Int_t K(Int_t i) const { return ((TArrayI)fKeys)[i]; } 99 Int_t V(Int_t i) const { return ((TArrayI)fValues)[i]; } 100 101 public: 102 // -------------------------------------------------------------------------- 103 // 104 // Return the size of the table 105 // 106 Int_t GetSize() const 107 { 108 return fKeys.GetSize(); 109 } 110 111 // -------------------------------------------------------------------------- 112 // 113 // Get the value which corresponds to the given key-value 114 // 115 Int_t GetValue(Int_t key) const 116 { 117 const Int_t n = fKeys.GetSize(); 118 for (int i=0; i<n; i++) 119 { 120 if (K(i)==key) 121 return V(i); 122 } 123 return -1; 124 } 125 126 // -------------------------------------------------------------------------- 127 // 128 // Get the key which corresponds to the given index 129 // 130 Int_t GetKey(Int_t value) const 131 { 132 const Int_t n = fKeys.GetSize(); 133 for (int i=0; i<n; i++) 134 { 135 if (V(i)==value) 136 return K(i); 137 } 138 return -1; 139 } 140 141 // -------------------------------------------------------------------------- 142 // 143 // Adds a new pair key-value. While the key is the key to the value. 144 // if the key already exists the pair is ignored. 145 // 146 void Add(Int_t key, Int_t value) 147 { 148 if (GetValue(key)>=0) 149 return; 150 151 const Int_t n = fKeys.GetSize(); 152 153 fKeys.Set(n+1); 154 fValues.Set(n+1); 155 156 fKeys[n] = key; 157 fValues[n] = value; 158 } 159 160 // -------------------------------------------------------------------------- 161 // 162 // Adds a new pair key-value. While the key is the key to the value. 163 // In this case the value is an automatically sequential created index. 164 // if the key already exists the pair is ignored. 165 // 166 Int_t Add(Int_t key) 167 { 168 const Int_t k = GetValue(key); 169 if (k>=0) 170 return k; 171 172 const Int_t n = fKeys.GetSize(); 173 174 fKeys.Set(n+1); 175 fValues.Set(n+1); 176 177 fKeys[n] = key; 178 fValues[n] = n; 179 180 return n; 181 } 182 }; 183 184 // -------------------------------------------------------------------------- 185 // 186 // hname is the name of the histogram class which is in the array. 79 187 // 80 188 // istempl=kTRUE tells MHArray to use the first histogram retrieved from the … … 95 203 fTitle = title ? TString(title) : (TString("Base class for Mars histogram arrays:") + hname); 96 204 205 fMapIdx = new MMap; 206 97 207 fArray = new TList; 98 208 fArray->SetOwner(); … … 131 241 // -------------------------------------------------------------------------- 132 242 // 243 // Default Constructor. hname is the name of the histogram class which 244 // is in the array. 245 // 246 // istempl=kTRUE tells MHArray to use the first histogram retrieved from the 247 // ParameterList by hname to be used as a template. New histograms are not 248 // created using the root dictionary, but the New-member function (see 249 // MParConatiner) 250 // In the case istempl=kFALSE new histograms are created using the root 251 // dictionary while hname is the class name. For the creation their 252 // default constructor is used. 253 // 254 MHArray::MHArray(const MH *hist, const char *name, const char *title) 255 : fIdx(0), fClass(NULL), fTemplate(hist), fTemplateName("<dummy>") 256 { 257 // 258 // set the name and title of this object 259 // 260 fName = name ? name : "MHArray"; 261 fTitle = title ? TString(title) : (TString("Base class for Mars histogram arrays:") + hist->GetName()); 262 263 fMapIdx = new MMap; 264 265 fArray = new TList; 266 fArray->SetOwner(); 267 } 268 269 // -------------------------------------------------------------------------- 270 // 133 271 // Destructor: Deleteing the array and all histograms which are part of the 134 272 // array. … … 138 276 fArray->Delete(); 139 277 delete fArray; 140 } 141 142 278 delete fMapIdx; 279 } 280 281 // -------------------------------------------------------------------------- 282 // 283 // Use this to access the histograms by a key. If you use values like 284 // (in this order) 2.5, 7.2, 2.5, 9.3, 9.3, 3.3, 2.2, 1.1 285 // it will be mapped to the following indices internally: 286 // 0 1 0 2 2 3 4 5 287 // 288 // WARNING: Make sure that you don't create new histograms by setting 289 // a new index (SetIndex or IncIndex) which is equal the size 290 // of the array and create new histogram by CreateH. In this 291 // case you will confuse the mapping completely. 292 // 293 void MHArray::SetIndexByKey(Double_t key) 294 { 295 fIdx = fMapIdx->Add((Int_t)key); 296 } 297 298 // -------------------------------------------------------------------------- 299 // 300 // Use this function to access a histogram by its index in the array. 301 // Becarefull the index isn't checked! 302 // 143 303 MH &MHArray::operator[](Int_t i) 144 304 { … … 146 306 } 147 307 308 // -------------------------------------------------------------------------- 309 // 310 // Use this function to access a histogram by its index in the array. 311 // Becarefull the index isn't checked! 312 // 148 313 MH *MHArray::At(Int_t i) 149 314 { … … 151 316 } 152 317 318 // -------------------------------------------------------------------------- 319 // 320 // Use this function to access the histogram corresponding to the 321 // currently set index (by Set/Inc/DecIndex or SetIndexByKey) 322 // Becarefull the index set isn't checked! 323 // 153 324 MH *MHArray::GetH() 154 325 { … … 170 341 if (fTemplate) 171 342 { 343 // 344 // create the parameter container as a clone of the existing 345 // template histogram. 346 // 172 347 hist = (MH*)fTemplate->New(); 173 348 } … … 226 401 fIdx = 0; 227 402 403 if (fTemplate) 404 return kTRUE; 405 228 406 if (!fTemplateName.IsNull()) 229 407 { … … 246 424 const Int_t n = fArray->GetSize(); 247 425 248 if (fIdx 426 if (fIdx<0 || fIdx>n) 249 427 { 250 428 *fLog << warn << "Histogram Index #" << fIdx << " out of bounds (>"; … … 287 465 *fLog << all << GetDescriptor() << " contains " << fArray->GetSize(); 288 466 *fLog << " histograms." << endl; 289 } 467 468 if (fMapIdx->GetSize()<=0) 469 return; 470 471 *fLog << " idx\t key" << endl; 472 for (int i=0; i<fMapIdx->GetSize(); i++) 473 *fLog << " " << i << "\t<--> " << fMapIdx->GetKey(i) << endl; 474 *fLog << endl; 475 } 476 477 // -------------------------------------------------------------------------- 478 // 479 // Adds the given object to the given legend (if != NULL). The Legend 480 // entry name is created from the key... 481 // 482 void MHArray::AddLegendEntry(TLegend *leg, TObject *obj, Int_t idx) const 483 { 484 if (!leg) 485 return; 486 487 TString name = " "; 488 name += fMapIdx->GetKey(idx); 489 leg->AddEntry(obj, name, "lpf"); // l=line, p=polymarker, f=fill 490 } 491 290 492 291 493 // -------------------------------------------------------------------------- … … 302 504 gStyle->SetOptStat(0); 303 505 506 // 507 // if the keymapping is used create a legend to identify the histograms 508 // 509 TLegend *leg = NULL; 510 if (fMapIdx->GetSize()>0) 511 { 512 leg = new TLegend(0.85, 0.80, 0.99, 0.99); 513 leg->SetBit(kCanDelete); 514 } 515 304 516 TIter Next(fArray); 305 517 MH *hist = (MH*)Next(); 306 518 307 Int_t col=2;519 Int_t idx=0; 308 520 Double_t max=0; 309 521 Double_t min=0; … … 311 523 TH1 *h1=NULL; 312 524 525 // 526 // If the array has at least one entry: 527 // - find the starting boundaries 528 // - draw it and set its line color 529 // 313 530 if (hist) 314 531 { … … 316 533 { 317 534 h1->Draw(); 318 h1->SetLineColor( col++);535 h1->SetLineColor(idx+2); 319 536 max = h1->GetMaximum(); 320 537 min = h1->GetMinimum(); 538 539 AddLegendEntry(leg, h1, idx); 321 540 } 322 541 } 323 542 543 // 544 // For all following histograms: 545 // - update the boundaries 546 // - draw it and set its line color 547 // 324 548 while ((hist=(MH*)Next())) 325 549 { … … 330 554 331 555 h->Draw("same"); 332 h->SetLineColor( col++);556 h->SetLineColor(idx+2); 333 557 if (max<h->GetMaximum()) 334 558 max = h->GetMaximum(); 335 559 if (min>h->GetMinimum()) 336 560 min = h->GetMinimum(); 337 } 338 561 562 AddLegendEntry(leg, h, idx++); 563 } 564 565 // 566 // Now update the drawing region so that everything is displayed 567 // 339 568 if (h1) 340 569 { … … 342 571 h1->SetMaximum(max>0 ? max*1.05 : max*0.95); 343 572 } 573 574 if (leg) 575 leg->Draw(); 576 344 577 gPad->Modified(); 345 578 gPad->Update(); … … 353 586 // the MH entries by calling their GetHistByName function. 354 587 // If the option also contains 'nonew' no new canvas is created. 588 // The option "Scale=1" scales the area of all histogram to 1 589 // The option "Scale=max" scales the maximum of all histogram to 1 355 590 // 356 591 TObject *MHArray::DrawClone(Option_t *opt) const … … 360 595 TCanvas *c = NULL; 361 596 362 Int_t nonew = o.Index("nonew", TString::kIgnoreCase); 597 Int_t scale1 = o.Index("scale=1", TString::kIgnoreCase); 598 Int_t scalemax = o.Index("scale=max", TString::kIgnoreCase); 599 Int_t nonew = o.Index("nonew", TString::kIgnoreCase); 600 601 if (o.BeginsWith("scale=1", TString::kIgnoreCase)) 602 scale1 = 0; 603 if (o.BeginsWith("scale=max", TString::kIgnoreCase)) 604 scalemax = 0; 605 if (o.BeginsWith("nonew", TString::kIgnoreCase)) 606 nonew = 0; 607 363 608 if (nonew>=0) 364 609 { … … 372 617 o.Remove(nonew, 5); 373 618 } 619 if (scale1>=0) 620 o.Remove(scale1, 7); 621 if (scalemax>=0) 622 o.Remove(scalemax, 9); 374 623 375 624 const Stat_t sstyle = gStyle->GetOptStat(); 376 625 gStyle->SetOptStat(0); 377 626 627 // 628 // if the keymapping is used create a legend to identify the histograms 629 // 630 TLegend *leg = NULL; 631 if (fMapIdx->GetSize()>0) 632 { 633 leg = new TLegend(0.85, 0.80, 0.99, 0.99); 634 leg->SetBit(kCanDelete); 635 } 636 378 637 TIter Next(fArray); 379 638 MH *hist = (MH*)Next(); 380 639 381 Int_t col=2;640 Int_t idx=0; 382 641 Double_t max=0; 383 642 Double_t min=0; … … 385 644 TH1 *h1=NULL; 386 645 646 // 647 // If the array has at least one entry: 648 // - find the starting boundaries 649 // - draw it and set its line color 650 // 387 651 if (hist) 388 652 { … … 390 654 { 391 655 h1 = (TH1*)h1->DrawCopy(); 392 h1->SetMarkerColor(col); 393 h1->SetLineColor(col++); 656 657 if (scale1>=0) 658 h1->Scale(1./h1->Integral()); 659 if (scalemax>=0) 660 h1->Scale(1./h1->GetMaximum()); 661 662 h1->SetMarkerColor(idx); 663 h1->SetLineColor(idx+2); 394 664 h1->SetFillStyle(4000); 395 665 max = h1->GetMaximum(); 396 666 min = h1->GetMinimum(); 667 668 AddLegendEntry(leg, h1, idx++); 397 669 } 398 670 } 399 671 672 // 673 // For all following histograms: 674 // - update the boundaries 675 // - draw it and set its line color 676 // 400 677 while ((hist=(MH*)Next())) 401 678 { … … 406 683 407 684 h = (TH1*)h->DrawCopy("same"); 408 h->SetMarkerColor(col); 409 h->SetLineColor(col++); 410 h->SetFillStyle(4000); 685 686 if (scale1>=0) 687 h->Scale(1./h->Integral()); 688 if (scalemax>=0) 689 h->Scale(1./h->GetMaximum()); 690 691 h->SetMarkerColor(idx); 692 h->SetLineColor(idx+2); 693 h->SetFillStyle(4000); // transperent (why is this necessary?) 411 694 if (max<h->GetMaximum()) 412 695 max = h->GetMaximum(); 413 696 if (min>h->GetMinimum()) 414 697 min = h->GetMinimum(); 415 } 416 698 699 AddLegendEntry(leg, h, idx++); 700 } 701 702 // 703 // Now update the drawing region so that everything is displayed 704 // 417 705 if (h1) 418 706 { … … 420 708 h1->SetMaximum(max>0 ? max*1.05 : max*0.95); 421 709 } 710 711 if (leg) 712 leg->Draw(); 713 422 714 gPad->Modified(); 423 715 gPad->Update(); -
trunk/MagicSoft/Mars/mhist/MHArray.h
r1574 r1629 7 7 8 8 class TList; 9 class TLegend; 10 11 class MMap; 9 12 10 13 class MHArray : public MH … … 15 18 16 19 const MParList *fParList; //! pointer to parameter list used for SetupFill when a new Hist is created 17 TClass *fClass; // !pointer to class entry in root dictionary20 TClass *fClass; // pointer to class entry in root dictionary 18 21 19 MH *fTemplate; //! pointer to a template histogram 20 TString fTemplateName; //! name of the template class 22 const MH *fTemplate; //-> pointer to a template histogram 23 TString fTemplateName; // name of the template class 24 25 MMap *fMapIdx; //! Table to map keys to array indices 21 26 22 27 Bool_t CreateH(); 28 void AddLegendEntry(TLegend *leg, TObject *obj, Int_t idx) const; 23 29 24 30 enum { kUseTemplate=BIT(14) }; … … 26 32 public: 27 33 MHArray(const TString hname, Bool_t istempl=kFALSE, const char *name=NULL, const char *title=NULL); 34 MHArray(const MH *hist, const char *name=NULL, const char *title=NULL); 28 35 ~MHArray(); 29 36 … … 36 43 37 44 MH *GetH(); 45 46 void SetIndexByKey(Double_t key); 38 47 39 48 void SetIndex(Int_t i) { fIdx=i; } -
trunk/MagicSoft/Mars/mhist/MHFadcCam.cc
r1600 r1629 100 100 const UInt_t id = pixel.GetPixelId(); 101 101 102 for (Int_t i=0; 102 for (Int_t i=0; i<nhisamples; i++) 103 103 FillHi(id, pixel.GetHiGainSamples()[i]); 104 104 … … 113 113 } 114 114 115 Bool_t MHFadcCam::Fill(const MRawEvtData *par) 116 { 117 return Fill((MParContainer*)par); 118 } 119 115 120 void MHFadcCam::ResetHistograms() 116 121 { -
trunk/MagicSoft/Mars/mhist/MHFadcCam.h
r1600 r1629 17 17 #endif 18 18 19 class MRawEvtData; 20 19 21 class MHFadcCam : public MH 20 22 { … … 30 32 31 33 MHFadcPix *operator[](UInt_t i) { return (MHFadcPix*)(fArray->At(i)); } 34 const MHFadcPix *operator[](UInt_t i) const { return (MHFadcPix*)(fArray->At(i)); } 32 35 33 36 TH1F *GetHistHi(UInt_t i) { return (*this)[i]->GetHistHi(); } 34 37 TH1F *GetHistLo(UInt_t i) { return (*this)[i]->GetHistLo(); } 35 38 39 const TH1F *GetHistHi(UInt_t i) const { return (*this)[i]->GetHistHi(); } 40 const TH1F *GetHistLo(UInt_t i) const { return (*this)[i]->GetHistLo(); } 41 36 42 Bool_t Fill(const MParContainer *par); 43 Bool_t Fill(const MRawEvtData *par); 37 44 38 45 void ResetHistograms(); -
trunk/MagicSoft/Mars/mhist/MHFadcPix.h
r1303 r1629 23 23 TH1F *GetHistLo() { return fHistLo; } 24 24 25 const TH1F *GetHistHi() const { return fHistHi; } 26 const TH1F *GetHistLo() const { return fHistLo; } 27 25 28 void FillHi(Byte_t i); 26 29 void FillLo(Byte_t i); -
trunk/MagicSoft/include-Classes/MMcFormat/MMcCorsikaRunHeader.cc
r1628 r1629 47 47 fTitle = title ? title : "Translation of the CORSIKA header"; 48 48 49 fRunNumber = 0.0; 50 fDate = 0.0; 51 fCorsika_version = 0.0; 52 fNumObsLev = 0.0; 53 for(int i=0;i<10;i++) 54 fHeightLev[i]=0.0; 55 fSlopeSpec = 0.0; 56 fELowLim = 0.0; 57 fEUppLim = 0.0; 58 fEGS4_flag = 0.0; 59 fNKG_flag = 0.0; 60 fEcutoffh = 0.0; 61 fEcutoffm = 0.0; 62 fEcutoffe = 0.0; 63 fEcutoffg = 0.0; 49 fRunNumber = 0; 50 fDate = 0; 51 fCorsikaVersion = 0; 52 fNumObsLev = 0; 64 53 65 for(int i=0;i<50;i++) fC[i] = 0.0; 66 for(int i=0;i<40;i++) fCKA[i] = 0.0; 67 for(int i=0;i<5 ;i++) fCETA[i] = 0.0; 68 for(int i=0;i<11;i++) fCSTRBA[i] = 0.0; 69 for(int i=0;i<5;i++){ 70 fAATM[i] = 0.0; 71 fBATM[i] = 0.0; 72 fCATM[i] = 0.0; 54 for (int i=0; i<10; i++) 55 fHeightLev[i]=0; 56 57 fSlopeSpec = 0; 58 fELowLim = 0; 59 fEUppLim = 0; 60 fEGS4flag = 0; 61 fNKGflag = 0; 62 fEcutoffh = 0; 63 fEcutoffm = 0; 64 fEcutoffe = 0; 65 fEcutoffg = 0; 66 67 for(int i=0; i<50; i++) fC[i] = 0; 68 for(int i=0; i<40; i++) fCKA[i] = 0; 69 for(int i=0; i<5; i++) fCETA[i] = 0; 70 for(int i=0; i<11; i++) fCSTRBA[i] = 0; 71 for(int i=0; i<5; i++) 72 { 73 fAATM[i] = 0; 74 fBATM[i] = 0; 75 fCATM[i] = 0; 73 76 } 74 for (int i=0;i<4;i++) fNFL[i] = 0.0;77 for (int i=0;i<4; i++) fNFL[i] = 0; 75 78 76 79 } … … 105 108 fRunNumber = runnumber; 106 109 fDate = date; 107 fCorsika _version = vers;110 fCorsikaVersion = vers; 108 111 fNumObsLev = numobslev; 109 for(int i=0;i<10;i++) 112 113 for (int i=0; i<10; i++) 110 114 fHeightLev[i]=height[i]; 115 111 116 fSlopeSpec = slope; 112 117 fELowLim = elow; 113 118 fEUppLim = eupp; 114 fEGS4 _flag = egs4;115 fNKG _flag = nkg;119 fEGS4flag = egs4; 120 fNKGflag = nkg; 116 121 fEcutoffh = eh; 117 122 fEcutoffm = em; … … 119 124 fEcutoffg = eg; 120 125 121 for(int i=0;i<50;i++) fC[i] = c[i]; 122 for(int i=0;i<40;i++) fCKA[i] = cka[i]; 123 for(int i=0;i<5 ;i++) fCETA[i] = ceta[i]; 124 for(int i=0;i<11;i++) fCSTRBA[i] = cstrba[i]; 125 for(int i=0;i<5;i++){ 126 for (int i=0; i<50; i++) fC[i] = c[i]; 127 for (int i=0; i<40; i++) fCKA[i] = cka[i]; 128 for (int i=0; i<5 ; i++) fCETA[i] = ceta[i]; 129 for (int i=0; i<11; i++) fCSTRBA[i] = cstrba[i]; 130 for (int i=0; i<5; i++) 131 { 126 132 fAATM[i] = aatm[i]; 127 133 fBATM[i] = batm[i]; 128 134 fCATM[i] = catm[i]; 129 130 for (int i=0;i<4;i++) fNFL[i] = nfl[i];135 } 136 for (int i=0; i<4; i++) fNFL[i] = nfl[i]; 131 137 } 132 138 -
trunk/MagicSoft/include-Classes/MMcFormat/MMcCorsikaRunHeader.h
r1623 r1629 20 20 Float_t fRunNumber; 21 21 Float_t fDate; 22 Float_t fCorsika _version;22 Float_t fCorsikaVersion; 23 23 Float_t fNumObsLev; 24 24 Float_t fHeightLev[10]; … … 26 26 Float_t fELowLim; 27 27 Float_t fEUppLim; // Limits of energy range for generation 28 Float_t fEGS4 _flag;29 Float_t fNKG _flag;28 Float_t fEGS4flag; 29 Float_t fNKGflag; 30 30 Float_t fEcutoffh; 31 31 Float_t fEcutoffm; … … 45 45 public: 46 46 MMcCorsikaRunHeader(const char *name=NULL, const char *title=NULL); 47 ~MMcCorsikaRunHeader();48 47 49 48 void Fill(const Float_t runnumber,
Note:
See TracChangeset
for help on using the changeset viewer.