Changeset 7094
- Timestamp:
- 05/27/05 09:46:22 (20 years ago)
- Location:
- trunk/MagicSoft
- Files:
-
- 2 added
- 6 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7091 r7094 29 29 - implement usage of extractor resolution (only if UseExtractorRes 30 30 is set). 31 32 33 2005/05/27 Thomas Bretz 34 35 * Makefile: 36 - removed mmontecarlo directory 37 38 * mmontecarlo/MMcEnergyEst.[h,cc], 39 mmontecarlo/MMcTimeGenerate.[h,cc], 40 mmontecarlo/MMcWeightEnergySpecCalc.[h,cc]: 41 - removed 42 43 * sponde.rc: 44 - added new line for weighted spectral index 45 46 * mbadpixels/MBadPixelsCalc.[h,cc]: 47 - added an option to perform the checks also in PostProcess 48 49 * mhbase/MFillH.h: 50 - added default argument to SetWeight 51 52 * mhbase/MH3.h: 53 - added Sumw2() member function 54 55 * mhflux/MHCollectionArea.[h,cc]: 56 - added TLatex output to plots 57 - added some Getter 58 59 * mjobs/MJSpectrum.[h,cc]: 60 - implemented the possibility to weight the monte carlo spectrum 61 to a new index or function. More details can be found 62 in MMcSpectrumWeight 63 - slightly changed the plot comparing the size distributions 64 - scale the comparsison plots by the resulting spectrum 65 66 * mjobs/MJob.[h,cc]: 67 - added a member function to check ReadEnv of a single 68 container 69 70 * mjobs/Makefile: 71 - added -I../mmc 72 73 * mmc/MMcEvt.[hxx,cxx], mmc/McEvtBasic.[hxx,cxx]: 74 - changed the inheritance: MMcEvt now derives from MMcEvtBasic 75 so that both classes are interchangable 76 - increased both class versions 77 - chaged the default partictle in MMcEvtBasic from 78 kGAMMA to kUNDEFINED 79 - added new particle type: kUNDEFINED 80 81 * mhflux/MMcSpectrumWeight.[h,cc]: 82 - added 31 83 32 84 -
trunk/MagicSoft/Mars/Makefile
r6979 r7094 56 56 msql \ 57 57 mimage \ 58 mmontecarlo \59 58 mhft \ 60 59 mmc \ -
trunk/MagicSoft/Mars/NEWS
r7082 r7094 2 2 3 3 *** Version <cvs> 4 5 - general: MMcEvt now derived from MMcEvtBasic which should 6 have no influence on compatibility with older camera files 7 8 - sponde: The input MC spectrum can now be weighted to fake a 9 different spectrum. This is done via MMcSpectrumWeight. For 10 more details see the class description and sponde.rc 11 12 - sponde: The paremetr comparsion plots are not scaled by 13 their entries anymore. Instead the MC plot is scaled by using 14 the result spectrum of the analysis. If the input MC spectrum 15 and the result spectrum has different slopes the absolut 16 normalization is normally wrong. 4 17 5 18 -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.cc
r7035 r7094 86 86 // 87 87 MBadPixelsCalc::MBadPixelsCalc(const char *name, const char *title) 88 : fPedestalLevel(3), fPedestalLevelVariance(5), fNamePedPhotCam("MPedPhotCam") 88 : fPedestalLevel(3), fPedestalLevelVariance(5), fNamePedPhotCam("MPedPhotCam"), 89 fCheckInProcess(kTRUE), fCheckInPostProcess(kFALSE) 89 90 { 90 91 fName = name ? name : gsDefName.Data(); … … 129 130 // -------------------------------------------------------------------------- 130 131 // 131 // Check the pedestal RMS of every pixel with respect to the mean pedestal RMS132 // of the camera (Sigmabar).133 //134 // The pixels can be set as blind if the pedestalRMS is too big or 0.135 //136 // If you don't want to use this option set the PedestalLevel<=0;137 //138 // MBadPixelsCalc calc;139 // calc.SetPedestalLevel(-1);140 /*141 void MBadPixelsCalc::CheckPedestalRMS() const142 {143 const Int_t entries = fPedPhotCam->GetSize();144 145 const Float_t meanPedRMS = fSigmabar->GetSigmabar();146 147 for (Int_t i=0; i<entries; i++)148 {149 //150 // get pixel as entry from list151 //152 const Double_t nratio = fGeomCam->GetPixRatio(i);153 const Double_t pixPedRms = (*fPedPhotCam)[i].GetRms();154 155 if (pixPedRms*nratio > fPedestalLevel * meanPedRMS || pixPedRms == 0)156 (*fBadPixels)[i].SetUnsuitable(MBadPixelsPix::kUnsuitableEvt);157 }158 }159 */160 161 // --------------------------------------------------------------------------162 //163 132 // Check the pedestal Rms of the pixels: compute with 2 iterations the mean 164 133 // for inner and outer pixels. Set as blind the pixels with too small or 165 134 // too high pedestal Rms with respect to the mean. 166 135 // 167 Bool_t MBadPixelsCalc::CheckPedestalRms() const 168 { 136 Bool_t MBadPixelsCalc::CheckPedestalRms(MBadPixelsPix::UnsuitableType_t type) const 137 { 138 if (fPedestalLevel<=0 && fPedestalLevelVariance<=0) 139 return kTRUE; 140 169 141 const Int_t entries = fPedPhotCam->GetSize(); 170 142 … … 266 238 continue; 267 239 268 (*fBadPixels)[i].SetUnsuitable(MBadPixelsPix::kUnsuitableEvt); 240 (*fBadPixels)[i].SetUnsuitable(type); 241 if (type==MBadPixelsPix::kUnsuitableRun) 242 (*fBadPixels)[i].SetUncalibrated(MBadPixelsPix::kDeadPedestalRms); 243 269 244 bads++; 270 245 } … … 281 256 } 282 257 283 284 258 // -------------------------------------------------------------------------- 285 259 // … … 287 261 Int_t MBadPixelsCalc::Process() 288 262 { 289 if (fPedestalLevel>0 || fPedestalLevelVariance>0) 290 CheckPedestalRms(); 291 292 return kTRUE; 263 return fCheckInProcess ? CheckPedestalRms(MBadPixelsPix::kUnsuitableEvt) : kTRUE; 264 } 265 266 // -------------------------------------------------------------------------- 267 // 268 // 269 Int_t MBadPixelsCalc::PostProcess() 270 { 271 return fCheckInPostProcess ? CheckPedestalRms(MBadPixelsPix::kUnsuitableRun) : kTRUE; 293 272 } 294 273 -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.h
r5777 r7094 4 4 #ifndef MARS_MTask 5 5 #include "MTask.h" 6 #endif 7 #ifndef MARS_MBadPixelsPix 8 #include "MBadPixelsPix.h" 6 9 #endif 7 10 … … 21 24 22 25 TString fNamePedPhotCam; // name of the 'MPedPhotCam' container 23 24 // void CheckPedestalRMS() const;25 Bool_t CheckPedestalRms() const;26 26 27 Bool_t fCheckInProcess; 28 Bool_t fCheckInPostProcess; 29 30 // MBadPixelsCalc 31 Bool_t CheckPedestalRms(MBadPixelsPix::UnsuitableType_t t) const; 32 33 // MTask 27 34 Int_t PreProcess(MParList *pList); 28 35 Int_t Process(); 36 Int_t PostProcess(); 37 38 // MParContainer 29 39 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 30 40 … … 32 42 MBadPixelsCalc(const char *name=NULL, const char *title=NULL); 33 43 44 // Setter 34 45 void SetPedestalLevel(Float_t f) { fPedestalLevel=f; } 35 46 void SetPedestalLevelVariance(Float_t f) { fPedestalLevelVariance=f; } 36 47 void SetNamePedPhotCam(const char *name) { fNamePedPhotCam = name; } 48 49 void EnableCheckInProcess(Bool_t b=kTRUE) { fCheckInProcess = b; } 50 void EnableCheckInPostProcess(Bool_t b=kTRUE) { fCheckInPostProcess = b; } 37 51 38 52 ClassDef(MBadPixelsCalc, 1) // Task to find bad pixels (star, broken pixels, etc) -
trunk/MagicSoft/Mars/mhbase/MFillH.h
r6915 r7094 63 63 64 64 void SetWeight(MParameterD *w) { fWeight = w; } 65 void SetWeight(const char *name ) { fWeightName = name; }65 void SetWeight(const char *name="MWeight") { fWeightName = name; } 66 66 67 67 void SetDrawOption(Option_t *option=""); -
trunk/MagicSoft/Mars/mhbase/MH3.h
r6978 r7094 26 26 Double_t fScale[3]; // Scale for the three axis (eg unit) 27 27 28 // TString fNameProfX; //! This should make sure, that gROOT doen't confuse the profile with something else29 // TString fNameProfY; //! This should make sure, that gROOT doen't confuse the profile with something else30 31 28 void StreamPrimitive(ofstream &out) const; 32 29 … … 36 33 kIsLogz = BIT(19) 37 34 }; 38 39 // Int_t DistancetoPrimitive(Int_t px, Int_t py);40 // void ExecuteEvent(Int_t event, Int_t px, Int_t py);41 35 42 36 public: … … 48 42 ~MH3(); 49 43 44 // Setter 50 45 void SetScaleX(Double_t scale) { fScale[0] = scale; } 51 46 void SetScaleY(Double_t scale) { fScale[1] = scale; } … … 56 51 void SetLogz(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogz) : fHist->ResetBit(kIsLogz); } 57 52 53 void Sumw2() const { if (fHist) fHist->Sumw2(); } 54 55 // Getter 58 56 Int_t GetDimension() const { return fDimension; } 59 57 Int_t GetNbins() const; 60 58 Int_t FindFixBin(Double_t x, Double_t y=0, Double_t z=0) const; 61 59 62 void SetName(const char *name); 63 void SetTitle(const char *title); 64 65 Bool_t SetupFill(const MParList *pList); 66 Bool_t Fill(const MParContainer *par, const Stat_t w=1); 60 TH1 &GetHist() { return *fHist; } 61 const TH1 &GetHist() const { return *fHist; } 67 62 68 63 TString GetDataMember() const; 69 64 TString GetRule(const Char_t axis='x') const; 70 65 71 TH1 &GetHist() { return *fHist; } 72 const TH1 &GetHist() const { return *fHist; } 66 // MH 67 Bool_t SetupFill(const MParList *pList); 68 Bool_t Fill(const MParContainer *par, const Stat_t w=1); 73 69 74 70 TH1 *GetHistByName(const TString name="") const { return fHist; } … … 79 75 } 80 76 77 // MParContainer 78 MParContainer *New() const; 79 80 // TObject 81 void SetName(const char *name); 82 void SetTitle(const char *title); 83 81 84 void SetColors() const; 82 85 void Draw(Option_t *opt=NULL); 83 86 void Paint(Option_t *opt=""); 84 85 MParContainer *New() const;86 87 87 88 ClassDef(MH3, 1) // Generalized 1/2/3D-histogram for Mars variables -
trunk/MagicSoft/Mars/mhflux/MHCollectionArea.cc
r6976 r7094 31 31 #include "MHCollectionArea.h" 32 32 33 #include <TLatex.h> 33 34 #include <TCanvas.h> 34 35 #include <TPaveStats.h> … … 81 82 fHistAll.SetTitle("Number of events produced"); 82 83 fHistAll.SetXTitle("\\Theta [deg]"); 83 fHistAll.SetYTitle("E [GeV]");84 fHistAll.SetYTitle("E_{mc} [GeV]"); 84 85 fHistAll.SetDirectory(NULL); 85 86 fHistAll.UseCurrentStyle(); 86 87 87 88 fHEnergy.SetName("CollEnergy"); 88 fHEnergy.SetTitle("Collection Area vs Energy");89 fHEnergy.SetTitle("Collection Area"); 89 90 fHEnergy.SetXTitle("E [GeV]"); 90 fHEnergy.SetYTitle("A [m^{2}]");91 fHEnergy.SetYTitle("A_{eff} [m^{2}]"); 91 92 fHEnergy.SetDirectory(NULL); 92 93 fHEnergy.UseCurrentStyle(); … … 119 120 // read from run header, but it is not yet in!! 120 121 // 121 const Float_t r1 = 0; 122 const Float_t r2 = fMcAreaRadius; 123 124 //*fLog << warn << endl << dbginf << "WARNING! I will assume a maximum impact parameter of " << fMCAreaRadius << " meters for the MC events. Check that this is the true one!" <<endl<<endl; 125 const Float_t total_area = TMath::Pi() * (r2*r2 - r1*r1); 122 const Float_t totalarea = GetCollectionAreaAbs();//TMath::Pi() * (r2*r2 - r1*r1); 126 123 127 124 for (Int_t ix=1; ix<=nbinx; ix++) … … 141 138 continue; 142 139 143 const Double_t eff = Ns/Na; 144 145 const Double_t efferr = TMath::Sqrt((1.-eff)*Ns)/Na; 140 const Double_t eff = Ns/Na; 141 const Double_t efferr = TMath::Sqrt((1.-eff)*Ns)/Na; 146 142 147 const Float_t col _area = eff * total_area;148 const Float_t col _area_error = efferr * total_area;149 150 fHEnergy.SetBinContent(ix, col _area);151 fHEnergy.SetBinError(ix, col_area_error);143 const Float_t colarea = eff * totalarea; 144 const Float_t colareaerror = efferr * totalarea; 145 146 fHEnergy.SetBinContent(ix, colarea); 147 fHEnergy.SetBinError(ix, colareaerror); 152 148 } 153 149 … … 275 271 void MHCollectionArea::Paint(Option_t *option) 276 272 { 273 if (TString(option)=="paint3") 274 { 275 /* 276 TH1 *h = dynamic_cast<TH1*>(gPad->FindObject("Efficiency")); 277 if (h) 278 { 279 const TString txt = Form("N/N_{0}=%.2f", 280 GetCollectionAreaEff(), 281 GetCollectionAreaAbs(), fMcAreaRadius); 282 283 TLatex text(0.31, 0.95, txt); 284 text.SetBit(TLatex::kTextNDC); 285 text.SetTextSize(0.04); 286 text.Paint();*/ 287 return; 288 } 289 if (TString(option)=="paint4") 290 { 291 const TString txt = Form("A_{eff}=%.0fm^{2} A_{abs}=%.0fm^{2} r=%.0fm", 292 GetCollectionAreaEff(), 293 GetCollectionAreaAbs(), fMcAreaRadius); 294 295 TLatex text(0.31, 0.95, txt); 296 text.SetBit(TLatex::kTextNDC); 297 text.SetTextSize(0.04); 298 text.Paint(); 299 return; 300 } 301 277 302 TVirtualPad *pad; 278 303 … … 405 430 h->SetNameTitle("Efficiency", "Combined cut and trigger efficiency"); 406 431 h->SetDirectory(NULL); 432 AppendPad("paint3"); 407 433 } 408 434 else … … 416 442 gPad->SetGridy(); 417 443 fHEnergy.Draw(); 444 AppendPad("paint4"); 418 445 } 419 446 else … … 428 455 //*fLog << energy << " " << theta << endl; 429 456 430 fHistSel.Fill(theta, energy );457 fHistSel.Fill(theta, energy, weight); 431 458 432 459 return kTRUE; -
trunk/MagicSoft/Mars/mhflux/MHCollectionArea.h
r6976 r7094 56 56 const TH1D &GetHEnergy() const { return fHEnergy; } 57 57 58 Double_t GetEntries() const { return fHistAll.Integral(); } 59 Double_t GetCollectionAreaEff() const { return fHEnergy.Integral(); } 60 Double_t GetCollectionAreaAbs() const { return TMath::Pi()*fMcAreaRadius*fMcAreaRadius; } 61 58 62 /* 59 63 void DrawAll(Option_t *option=""); -
trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc
r7071 r7094 52 52 #include "MBinning.h" 53 53 #include "MDataSet.h" 54 #include "MMcCorsikaRunHeader.h" 54 55 55 56 // Spectrum … … 58 59 #include "../mhflux/MHCollectionArea.h" 59 60 #include "../mhflux/MHEnergyEst.h" 61 #include "../mhflux/MMcSpectrumWeight.h" 60 62 61 63 // Eventloop … … 155 157 } 156 158 159 // -------------------------------------------------------------------------- 160 // 161 // Read the first MMcCorsikaRunHeader from the RunHeaders tree in 162 // the dataset. 163 // The simulated energy range and spectral slope is initialized from 164 // there. 165 // In the following eventloops the forced check in MMcSpectrumWeight 166 // ensures, that the spectral slope and energy range doesn't change. 167 // 168 Bool_t MJSpectrum::InitWeighting(const MDataSet &set, MMcSpectrumWeight &w) const 169 { 170 fLog->Separator("Initialize energy weighting"); 171 172 MParList l; 173 l.AddToList(&w); 174 if (!CheckEnv(l)) 175 { 176 *fLog << err << "ERROR - Reading resources for MMcSpectrumWeight failed." << endl; 177 return kFALSE; 178 } 179 180 TChain chain("RunHeaders"); 181 set.AddFilesOn(chain); 182 183 MMcCorsikaRunHeader *h=0; 184 chain.SetBranchAddress("MMcCorsikaRunHeader.", &h); 185 chain.GetEntry(1); 186 187 if (!h) 188 { 189 *fLog << err << "ERROR - Couldn't read MMcCorsikaRunHeader from DataSet." << endl; 190 return kFALSE; 191 } 192 193 if (!w.Set(*h)) 194 { 195 *fLog << err << "ERROR - Initializing MMcSpectrumWeight failed." << endl; 196 return kFALSE; 197 } 198 199 w.Print(); 200 return kTRUE; 201 } 202 157 203 Float_t MJSpectrum::ReadInput(MParList &plist, TH1D &h1, TH1D &h2) 158 204 { … … 211 257 } 212 258 213 Bool_t MJSpectrum::ReadOrigMCDistribution(const MDataSet &set, TH1 &h ) const259 Bool_t MJSpectrum::ReadOrigMCDistribution(const MDataSet &set, TH1 &h, MMcSpectrumWeight &weight) const 214 260 { 215 261 // Some debug output 216 262 fLog->Separator("Compiling original MC distribution"); 217 263 218 *fLog << inf << "Please stand by, this may take a while..." << flush; 264 weight.SetNameMcEvt("MMcEvtBasic"); 265 const TString w(weight.GetFormulaWeights()); 266 weight.SetNameMcEvt(); 267 268 *fLog << inf << "Using weights: " << w << endl; 269 *fLog << "Please stand by, this may take a while..." << flush; 219 270 220 271 if (fDisplay) … … 236 287 h.SetYTitle("E [GeV]"); 237 288 h.SetZTitle("Counts"); 238 chain.Draw("MMcEvtBasic.fEnergy:MMcEvtBasic.fTelescopeTheta*TMath::RadToDeg()>>ThetaEMC", "", "goff");289 chain.Draw("MMcEvtBasic.fEnergy:MMcEvtBasic.fTelescopeTheta*TMath::RadToDeg()>>ThetaEMC", w, "goff"); 239 290 } 240 291 else … … 243 294 h.SetXTitle("\\Theta [\\circ]"); 244 295 h.SetYTitle("Counts"); 245 chain.Draw("MMcEvtBasic.fTelescopeTheta*TMath::RadToDeg()>>ThetaMC", "", "goff");296 chain.Draw("MMcEvtBasic.fTelescopeTheta*TMath::RadToDeg()>>ThetaMC", w, "goff"); 246 297 } 247 298 h.SetDirectory(0); … … 413 464 } 414 465 415 Bool_t MJSpectrum::IntermediateLoop(MParList &plist, MH3 &mh1, TH1D &temp1, const MDataSet &set ) const466 Bool_t MJSpectrum::IntermediateLoop(MParList &plist, MH3 &mh1, TH1D &temp1, const MDataSet &set, MMcSpectrumWeight &weight) const 416 467 { 417 468 MTaskList tlist1; … … 439 490 } 440 491 tlist1.AddToList(&readmc); 492 tlist1.AddToList(&weight); 441 493 442 494 temp1.SetXTitle("MMcEvtBasic.fTelescopeTheta*kRad2Deg"); … … 477 529 bins3->SetName("BinningTheta"); 478 530 } 531 479 532 return kTRUE; 480 533 } 481 534 482 voidMJSpectrum::DisplaySpectrum(MHCollectionArea &area, TH1D &excess, MHEnergyEst &hest, Double_t ontime) const535 TArrayD MJSpectrum::DisplaySpectrum(MHCollectionArea &area, TH1D &excess, MHEnergyEst &hest, Double_t ontime) const 483 536 { 484 537 TH1D collarea(area.GetHEnergy()); … … 546 599 f.SetParameter(1, 1.9e-6); 547 600 f.SetLineColor(kGreen); 548 spectrum.Fit(&f, "NI ", "", 55, 2e4);601 spectrum.Fit(&f, "NIM", "", 55, 2e4); 549 602 f.DrawCopy("same"); 550 603 … … 558 611 tex.DrawLatex(2e2, 7e-5, str); 559 612 */ 560 } 561 562 Bool_t MJSpectrum::PlotSame(MStatusArray &arr, MParList &plist, const char *name, const char *tab, const char *plot) const 563 { 564 cout << name << endl; 613 614 TArrayD res(2); 615 res[0] = f.GetParameter(0); 616 res[1] = f.GetParameter(1); 617 return res; 618 } 619 620 Bool_t MJSpectrum::PlotSame(MStatusArray &arr, MParList &plist, const char *name, const char *tab, const char *plot, Double_t scale) const 621 { 565 622 TString same(name); 566 623 same += "Same"; … … 587 644 588 645 const MAlphaFitter *fit = (MAlphaFitter*)plist.FindObject("MAlphaFitter"); 589 const Double_t scale = fit ? fit->GetScaleFactor() : 1;646 const Double_t ascale = fit ? fit->GetScaleFactor() : 1; 590 647 591 648 gPad->SetBorderMode(0); 592 649 h2->SetLineColor(kBlack); 593 650 h3->SetLineColor(kBlue); 594 h2->Add(h1, - scale);595 596 h2->Scale(1./h2->Integral());597 h3->Scale( 1./h3->Integral());651 h2->Add(h1, -ascale); 652 653 //h2->Scale(1./ontime); //h2->Integral()); 654 h3->Scale(scale); //h3->Integral()); 598 655 599 656 h2->SetMaximum(1.05*TMath::Max(h2->GetMaximum(), h3->GetMaximum())); … … 609 666 } 610 667 611 Bool_t MJSpectrum::DisplaySize(MParList &plist ) const668 Bool_t MJSpectrum::DisplaySize(MParList &plist, Double_t scale) const 612 669 { 613 670 *fLog << inf << "Reading from file: " << fPathIn << endl; … … 644 701 645 702 excess->SetTitle("Number of excess events vs Size (data, mc/blue)"); 646 excess->Scale(1./excess->Integral()); 647 excess = excess->DrawCopy(); 703 excess = excess->DrawCopy("E2"); 648 704 // Don't do this on the original object! 649 705 excess->SetStats(kFALSE); 706 excess->SetMarkerStyle(kFullDotMedium); 707 excess->SetFillColor(kBlack); 708 excess->SetFillStyle(0); 709 excess->SetName("Excess "); 710 excess->SetDirectory(0); 650 711 651 712 TObject *o=0; 652 if ((o=plist.FindObject("Excess Size")))713 if ((o=plist.FindObject("ExcessMC"))) 653 714 { 654 715 TH1 *histsel = (TH1F*)o->FindObject(""); 655 716 if (histsel) 656 717 { 657 histsel->Scale(1./histsel->Integral()); 718 if (scale<0) 719 scale = excess->Integral()/histsel->Integral(); 720 721 histsel->Scale(scale); 658 722 histsel->SetLineColor(kBlue); 659 723 histsel->SetBit(kCanDelete); 660 histsel = histsel->DrawCopy(" same");724 histsel = histsel->DrawCopy("E1 same"); 661 725 // Don't do this on the original object! 662 726 histsel->SetStats(kFALSE); 727 728 fLog->Separator("Kolmogorov Test"); 729 histsel->KolmogorovTest(excess, "DX"); 730 fLog->Separator("Chi^2 Test"); 731 histsel->Chi2Test(excess, "P"); 663 732 } 664 733 } … … 666 735 // -------------- Comparison of Image Parameters -------------- 667 736 c.cd(2); 668 PlotSame(arr, plist, "Dist", "HilSrc", "MHHilSrcMCPost" );737 PlotSame(arr, plist, "Dist", "HilSrc", "MHHilSrcMCPost", scale); 669 738 670 739 c.cd(3); 671 PlotSame(arr, plist, "Length", "PostCut", "MHHillasMCPost" );740 PlotSame(arr, plist, "Length", "PostCut", "MHHillasMCPost", scale); 672 741 673 742 c.cd(4); 674 PlotSame(arr, plist, "M3l", "HilExt", "MHHilExtMCPost" );743 PlotSame(arr, plist, "M3l", "HilExt", "MHHilExtMCPost", scale); 675 744 676 745 c.cd(5); 677 PlotSame(arr, plist, "Conc1", "NewPar", "MHNewParMCPost" );746 PlotSame(arr, plist, "Conc1", "NewPar", "MHNewParMCPost", scale); 678 747 679 748 c.cd(6); 680 PlotSame(arr, plist, "Width", "PostCut", "MHHillasMCPost" );749 PlotSame(arr, plist, "Width", "PostCut", "MHHillasMCPost", scale); 681 750 682 751 return kTRUE; … … 734 803 } 735 804 805 MMcSpectrumWeight weight; 806 if (!InitWeighting(set, weight)) 807 return kFALSE; 808 736 809 PrintSetup(fit); 737 810 bins3.SetEdges(temp1, 'x'); 738 811 739 812 TH1D temp2(temp1); 740 if (!ReadOrigMCDistribution(set, temp2 ))813 if (!ReadOrigMCDistribution(set, temp2, weight)) 741 814 return kFALSE; 742 815 … … 754 827 hist.UseCurrentStyle(); 755 828 MH::SetBinning(&hist, &bins3/*temp1.GetXaxis()*/, &bins2/*excess.GetXaxis()*/); 756 if (!ReadOrigMCDistribution(set, hist ))829 if (!ReadOrigMCDistribution(set, hist, weight)) 757 830 return kFALSE; 758 831 … … 762 835 for (int x=0; x<hist.GetNbinsX(); x++) 763 836 hist.SetBinContent(x, y, hist.GetBinContent(x, y)*temp1.GetBinContent(x)); 837 //hist.SetEntries(hist.Integral()); 764 838 } 765 839 } 766 840 else 767 if (!IntermediateLoop(plist, mh1, temp1, set)) 841 { 842 weight.SetNameMcEvt("MMcEvtBasic"); 843 if (!IntermediateLoop(plist, mh1, temp1, set, weight)) 768 844 return kFALSE; 845 weight.SetNameMcEvt(); 846 } 769 847 770 848 DisplayResult(fSimpleMode ? hist : (TH2D&)mh1.GetHist()); … … 813 891 MFillH fill3(&area, "", "FillCollectionArea"); 814 892 MFillH fill4(&hest, "", "FillEnergyEst"); 893 fill3.SetWeight(); 894 fill4.SetWeight(); 815 895 816 896 MH3 hsize("MHillas.fSize"); 817 //MH3 henergy("MEnergyEst.fVal");818 hsize.S etName("ExcessSize");819 //henergy.SetName("EnergyEst"); 820 MBinning bins(size, "BinningExcess Size");897 hsize.SetName("ExcessMC"); 898 hsize.Sumw2(); 899 900 MBinning bins(size, "BinningExcessMC"); 821 901 plist.AddToList(&hsize); 822 //plist.AddToList(&henergy);823 902 plist.AddToList(&bins); 824 903 … … 830 909 MFillH fill6a("MHImgParMCPost [MHImagePar]", "MImagePar", "FillImgParPost"); 831 910 MFillH fill7a("MHNewParMCPost [MHNewImagePar]", "MNewImagePar", "FillNewParPost"); 832 MFillH fill8a("ExcessSize [MH3]", "", "FillExcessSize"); 833 //MFillH fill9a("EnergyEst [MH3]", "", "FillExcessEEst"); 911 MFillH fill8a("ExcessMC [MH3]", "", "FillExcessMC"); 834 912 fill1a.SetNameTab("PreCut"); 835 913 fill2a.SetNameTab("PostCut"); … … 840 918 fill7a.SetNameTab("NewPar"); 841 919 fill8a.SetBit(MFillH::kDoNotDisplay); 842 //fill9a.SetBit(MFillH::kDoNotDisplay); 920 fill1a.SetWeight(); 921 fill2a.SetWeight(); 922 fill3a.SetWeight(); 923 fill4a.SetWeight(); 924 fill5a.SetWeight(); 925 fill6a.SetWeight(); 926 fill7a.SetWeight(); 927 fill8a.SetWeight(); 843 928 844 929 MEnergyEstimate est; … … 852 937 tlist2.AddToList(&hcalc1); 853 938 tlist2.AddToList(&hcalc2); 939 tlist2.AddToList(&weight); 854 940 tlist2.AddToList(&fill1a); 855 941 tlist2.AddToList(fCut0); … … 891 977 // -------------------------- Spectrum ---------------------------- 892 978 893 DisplaySpectrum(area, excess, hest, ontime); 894 DisplaySize(plist); 895 979 // Calculate and display spectrum (N/TeVsm^2 at 1TeV) 980 TArrayD res(DisplaySpectrum(area, excess, hest, ontime)); 981 982 // Spectrum fitted (convert res[1] from TeV to GeV) 983 TF1 flx("flx", Form("%e*pow(x/1000, %f)", res[1]/1000, res[0])); 984 985 // Number of events this spectrum would produce per s and m^2 986 Double_t n = flx.Integral(weight.GetEnergyMin(), weight.GetEnergyMax()); 987 988 // scale with effective collection area to get the event rate (N/s) 989 // scale with the effective observation time to absolute observed events 990 n *= area.GetCollectionAreaAbs()*ontime; // N 991 992 // Now calculate the scale factor from the number of events 993 // produced and the number of events which should have been 994 // observed with our telescope in the time ontime 995 const Double_t scale = n/area.GetEntries(); 996 997 // Print normalization constant 998 cout << "MC normalization factor: " << scale << endl; 999 1000 // Overlay normalized plots 1001 DisplaySize(plist, scale); 1002 1003 // check if output should be written 896 1004 if (!fPathOut.IsNull()) 897 1005 fDisplay->SaveAsRoot(fPathOut); -
trunk/MagicSoft/Mars/mjobs/MJSpectrum.h
r6978 r7094 18 18 class MStatusArray; 19 19 class MHCollectionArea; 20 class MMcSpectrumWeight; 20 21 21 22 class MJSpectrum : public MJob … … 35 36 Bool_t ReadTask(MTask* &task, const char *name) const; 36 37 Float_t ReadInput(MParList &plist, TH1D &h1, TH1D &size); 37 Bool_t ReadOrigMCDistribution(const MDataSet &set, TH1 &h ) const;38 Bool_t ReadOrigMCDistribution(const MDataSet &set, TH1 &h, MMcSpectrumWeight &w) const; 38 39 Bool_t GetThetaDistribution(TH1D &temp1, TH1D &temp2) const; 39 40 Bool_t Refill(MParList &plist, TH1D &h) const; 41 Bool_t InitWeighting(const MDataSet &set, MMcSpectrumWeight &w) const; 40 42 41 43 // Display Output 42 44 void PrintSetup(const MAlphaFitter &fit) const; 43 45 void DisplayResult(const TH2D &mh1) const; 44 Bool_t IntermediateLoop(MParList &plist, MH3 &h1, TH1D &temp1, const MDataSet &set ) const;45 voidDisplaySpectrum(MHCollectionArea &area, TH1D &excess, MHEnergyEst &hest, Double_t ontime) const;46 Bool_t DisplaySize(MParList &plist ) const;47 Bool_t PlotSame(MStatusArray &arr, MParList &plist, const char *name, const char *tab, const char *plot ) const;46 Bool_t IntermediateLoop(MParList &plist, MH3 &h1, TH1D &temp1, const MDataSet &set, MMcSpectrumWeight &w) const; 47 TArrayD DisplaySpectrum(MHCollectionArea &area, TH1D &excess, MHEnergyEst &hest, Double_t ontime) const; 48 Bool_t DisplaySize(MParList &plist, Double_t scale) const; 49 Bool_t PlotSame(MStatusArray &arr, MParList &plist, const char *name, const char *tab, const char *plot, Double_t scale) const; 48 50 49 51 public: -
trunk/MagicSoft/Mars/sponde.rc
r6977 r7094 1 1 EstimateEnergy.Rule: (0.380075+(MPointingPos.fZd*MPointingPos.fZd*0.00109028))*pow(MHillas.fSize,0.892462) 2 3 #MMcSpectrumWeight.NewSlope: -2.26 -
trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx
r5321 r7094 1 #include "MMcEvt.hxx" 2 3 #include "MLog.h" 4 #include "MLogManip.h" 5 6 //========== 7 // MMcEvt 8 // 1 /* ======================================================================== *\ 2 ! 3 ! * 4 ! * This file is part of MARS, the MAGIC Analysis and Reconstruction 5 ! * Software. It is distributed to you in the hope that it can be a useful 6 ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes. 7 ! * It is distributed WITHOUT ANY WARRANTY. 8 ! * 9 ! * Permission to use, copy, modify and distribute this software and its 10 ! * documentation for any purpose is hereby granted without fee, 11 ! * provided that the above copyright notice appear in all copies and 12 ! * that both that copyright notice and this permission notice appear 13 ! * in supporting documentation. It is provided "as is" without express 14 ! * or implied warranty. 15 ! * 16 ! 17 ! 18 ! Author(s): 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2005 21 ! 22 ! 23 \* ======================================================================== */ 24 25 ///////////////////////////////////////////////////////////////////////////// 26 // 27 // MMcEvt 28 // 9 29 // This class handles and contains the MonteCarlo information 10 30 // with which the events have been generated … … 19 39 // So, fTelescopeTheta=90, fTelescopePhi = 0 means the telescope is 20 40 // pointing horizontally towards South. For an explanation, see also 21 // TDAS 02-11. 22 // 41 // TDAS 02-11. 42 // 43 // Version 4: 44 // - Added member fFadcTimeJitter 45 // 46 // Version 5: 47 // - removed fPartId, fEnergy, fImpact, fTelescopeTheta, fTelescopePhi 48 // - derives now from MMcEvtBasic which contains all these values 49 // - moved ParticleId_t to base class MMcEvtBasic 50 // 51 ///////////////////////////////////////////////////////////////////////////// 52 #include "MMcEvt.hxx" 53 54 #include "MLog.h" 55 #include "MLogManip.h" 56 23 57 ClassImp(MMcEvt); 24 58 … … 26 60 27 61 62 // -------------------------------------------------------------------------- 63 // 64 // Default constructor. Calls Clear() 65 // 28 66 MMcEvt::MMcEvt() 29 67 { 30 //31 // default constructor32 // set all values to zero33 68 fName = "MMcEvt"; 34 69 fTitle = "Event info from Monte Carlo"; … … 37 72 } 38 73 39 MMcEvt::MMcEvt( UInt_t fEvtNum, 40 UShort_t usPId, 41 Float_t fEner, 42 Float_t fThi0, 43 Float_t fFirTar, 44 Float_t fzFirInt, 45 Float_t fThet, 46 Float_t fPhii, 47 Float_t fCorD, 48 Float_t fCorX, 49 Float_t fCorY, 50 Float_t fImpa, 51 Float_t fTPhii, 52 Float_t fTThet, 53 Float_t fTFirst, 54 Float_t fTLast, 55 Float_t fL_Nmax, 56 Float_t fL_t0, 57 Float_t fL_tmax, 58 Float_t fL_a, 59 Float_t fL_b, 60 Float_t fL_c, 61 Float_t fL_chi2, 62 UInt_t uiPin, 63 UInt_t uiPat, 64 UInt_t uiPre, 65 UInt_t uiPco, 66 UInt_t uiPelS, 67 UInt_t uiPelC, 68 Float_t elec, 69 Float_t muon, 70 Float_t other, 71 Float_t fadc_jitter) { 72 74 // -------------------------------------------------------------------------- 75 // 76 // Constructor. Use this to set all data members 77 // 78 // THIS FUNCTION IS FOR THE SIMULATION OLNY. 79 // DON'T USE THIS MEMBERFUNCTION IN THE ANALYSIS. 80 // 81 MMcEvt::MMcEvt(UInt_t fEvtNum, ParticleId_t usPId, Float_t fEner, 82 Float_t fThi0, Float_t fFirTar, Float_t fzFirInt, 83 Float_t fThet, Float_t fPhii, Float_t fCorD, 84 Float_t fCorX, Float_t fCorY, Float_t fImpa, 85 Float_t fTPhii, Float_t fTThet, Float_t fTFirst, 86 Float_t fTLast, Float_t fL_Nmax, Float_t fL_t0, 87 Float_t fL_tmax, Float_t fL_a, Float_t fL_b, 88 Float_t fL_c, Float_t fL_chi2, UInt_t uiPin, 89 UInt_t uiPat, UInt_t uiPre, UInt_t uiPco, 90 UInt_t uiPelS, UInt_t uiPelC, Float_t elec, 91 Float_t muon, Float_t other, Float_t fadc_jitter) 92 { 73 93 fName = "MMcEvt"; 74 94 fTitle = "Event info from Monte Carlo"; 75 // 76 // constuctor II 77 // 78 // All datamembers are parameters. 79 // 80 // Don't use this memberfunction in analysis 81 // 82 83 fEvtNumber = fEvtNum; 84 fPartId = usPId ; 85 fEnergy = fEner ; 86 fThick0 = fThi0; 87 fFirstTarget = fFirTar; 88 fZFirstInteraction = fzFirInt; 89 90 fTheta = fThet ; 91 fPhi = fPhii ; 92 93 fCoreD = fCorD ; 94 fCoreX = fCorX ; 95 fCoreY = fCorY ; 96 fImpact = fImpa ; 97 98 fTelescopePhi = fTPhii; 99 fTelescopeTheta = fTThet; 100 fTimeFirst = fTFirst; 101 fTimeLast = fTLast; 102 fLongiNmax = fL_Nmax; 103 fLongit0 = fL_t0; 104 fLongitmax = fL_tmax; 105 fLongia = fL_a; 106 fLongib = fL_b; 107 fLongic = fL_c; 108 fLongichi2 = fL_chi2; 109 110 111 fPhotIni = uiPin ; 112 fPassPhotAtm = uiPat ; 113 fPassPhotRef = uiPre ; 114 fPassPhotCone = uiPco ; 115 fPhotElfromShower = uiPelS ; 116 fPhotElinCamera = uiPelC ; 117 118 fElecCphFraction=elec; 119 fMuonCphFraction=muon; 120 fOtherCphFraction=other; 121 122 fFadcTimeJitter = fadc_jitter; 123 } 124 125 126 127 MMcEvt::~MMcEvt() { 128 // 129 // default destructor 130 // 131 } 132 133 134 135 95 96 Fill(fEvtNum, usPId, fEner, fThi0, fFirTar, fzFirInt, fThet, 97 fPhii, fCorD, fCorX, fCorY, fImpa, fTPhii, fTThet, fTFirst, 98 fTLast, fL_Nmax, fL_t0, fL_tmax, fL_a, fL_b, fL_c, fL_chi2, 99 uiPin, uiPat, uiPre, uiPco, uiPelS, uiPelC, elec, muon, other, 100 fadc_jitter); 101 } 102 103 // -------------------------------------------------------------------------- 104 // 105 // reset all values to values as nonsense as possible 106 // 136 107 void MMcEvt::Clear(Option_t *opt) 137 108 { 138 // 139 // reset all values to values as nonsense as possible 140 // 141 fPartId = 0; 109 fPartId = kUNDEFINED; 142 110 fEnergy = -1; 143 111 … … 162 130 } 163 131 164 void MMcEvt::Fill( UInt_t fEvtNum, 165 UShort_t usPId, 166 Float_t fEner, 167 Float_t fThi0, 168 Float_t fFirTar, 169 Float_t fzFirInt, 170 Float_t fThet, 171 Float_t fPhii, 172 Float_t fCorD, 173 Float_t fCorX, 174 Float_t fCorY, 175 Float_t fImpa, 176 Float_t fTPhii, 177 Float_t fTThet, 178 Float_t fTFirst, 179 Float_t fTLast, 180 Float_t fL_Nmax, 181 Float_t fL_t0, 182 Float_t fL_tmax, 183 Float_t fL_a, 184 Float_t fL_b, 185 Float_t fL_c, 186 Float_t fL_chi2, 187 UInt_t uiPin, 188 UInt_t uiPat, 189 UInt_t uiPre, 190 UInt_t uiPco, 191 UInt_t uiPelS, 192 UInt_t uiPelC, 193 Float_t elec, 194 Float_t muon, 195 Float_t other, 196 Float_t fadc_jitter) { 197 // 198 // All datamembers are filled with the correspondin parameters. 199 // 200 // Don't use this memberfunction in analysis 201 // 202 203 fEvtNumber = fEvtNum; 204 fPartId = usPId ; 205 fEnergy = fEner ; 206 fThick0 = fThi0; 207 fFirstTarget = fFirTar; 208 fZFirstInteraction = fzFirInt; 209 210 fTheta = fThet ; 211 fPhi = fPhii ; 212 213 fCoreD = fCorD ; 214 fCoreX = fCorX ; 215 fCoreY = fCorY ; 216 fImpact = fImpa ; 217 218 fTelescopePhi = fTPhii; 219 fTelescopeTheta = fTThet; 220 fTimeFirst = fTFirst; 221 fTimeLast = fTLast; 222 fLongiNmax = fL_Nmax; 223 fLongit0 = fL_t0; 224 fLongitmax = fL_tmax; 225 fLongia = fL_a; 226 fLongib = fL_b; 227 fLongic = fL_c; 228 fLongichi2 = fL_chi2; 229 230 fPhotIni = uiPin ; 231 fPassPhotAtm = fPhotIni-uiPat ; 232 fPassPhotRef = fPassPhotAtm-uiPre ; 233 fPassPhotCone = uiPco ; 234 fPhotElfromShower = uiPelS ; 235 fPhotElinCamera = uiPelC ; 236 237 fElecCphFraction=elec; 238 fMuonCphFraction=muon; 239 fOtherCphFraction=other; 240 241 fFadcTimeJitter = fadc_jitter; 242 } 243 244 /* 245 void MMcEvt::AsciiWrite(ofstream &fout) const 246 { 247 fout << fEnergy << " "; 248 fout << fTheta ; 249 } 250 */ 132 // -------------------------------------------------------------------------- 133 // 134 // Use this to set all data members 135 // 136 // THIS FUNCTION IS FOR THE SIMULATION OLNY. 137 // DON'T USE THIS MEMBERFUNCTION IN THE ANALYSIS. 138 // 139 void MMcEvt::Fill( UInt_t fEvtNum, ParticleId_t usPId, Float_t fEner, 140 Float_t fThi0, Float_t fFirTar, Float_t fzFirInt, 141 Float_t fThet, Float_t fPhii, Float_t fCorD, 142 Float_t fCorX, Float_t fCorY, Float_t fImpa, 143 Float_t fTPhii, Float_t fTThet, Float_t fTFirst, 144 Float_t fTLast, Float_t fL_Nmax, Float_t fL_t0, 145 Float_t fL_tmax, Float_t fL_a, Float_t fL_b, 146 Float_t fL_c, Float_t fL_chi2, UInt_t uiPin, 147 UInt_t uiPat, UInt_t uiPre, UInt_t uiPco, 148 UInt_t uiPelS, UInt_t uiPelC, Float_t elec, 149 Float_t muon, Float_t other, Float_t fadc_jitter) 150 { 151 // 152 // All datamembers are filled with the correspondin parameters. 153 // 154 // Don't use this memberfunction in analysis 155 // 156 fEvtNumber = fEvtNum; 157 fPartId = usPId ; 158 fEnergy = fEner ; 159 fThick0 = fThi0; 160 fFirstTarget = fFirTar; 161 fZFirstInteraction = fzFirInt; 162 163 fTheta = fThet ; 164 fPhi = fPhii ; 165 166 fCoreD = fCorD ; 167 fCoreX = fCorX ; 168 fCoreY = fCorY ; 169 fImpact = fImpa ; 170 171 fTelescopePhi = fTPhii; 172 fTelescopeTheta = fTThet; 173 fTimeFirst = fTFirst; 174 fTimeLast = fTLast; 175 fLongiNmax = fL_Nmax; 176 fLongit0 = fL_t0; 177 fLongitmax = fL_tmax; 178 fLongia = fL_a; 179 fLongib = fL_b; 180 fLongic = fL_c; 181 fLongichi2 = fL_chi2; 182 183 fPhotIni = uiPin ; 184 fPassPhotAtm = fPhotIni-uiPat ; 185 fPassPhotRef = fPassPhotAtm-uiPre ; 186 fPassPhotCone = uiPco ; 187 fPhotElfromShower = uiPelS ; 188 fPhotElinCamera = uiPelC ; 189 190 fElecCphFraction=elec; 191 fMuonCphFraction=muon; 192 fOtherCphFraction=other; 193 194 fFadcTimeJitter = fadc_jitter; 195 } 251 196 252 197 // -------------------------------------------------------------------------- … … 260 205 void MMcEvt::Print(Option_t *opt) const 261 206 { 262 // 263 // print out the data member on screen 264 // 207 MMcEvtBasic::Print(opt); 208 265 209 TString str(opt); 266 210 if (str.IsNull()) 267 211 { 268 *fLog << all << endl;269 *fLog << "Monte Carlo output:" << endl;270 *fLog << " Particle Id: ";271 switch(fPartId)272 {273 case kGAMMA:274 *fLog << "Gamma" << endl;275 break;276 case kPROTON:277 *fLog << "Proton" << endl;278 break;279 case kHELIUM:280 *fLog << "Helium" << endl;281 break;282 }283 *fLog << " Energy: " << fEnergy << "GeV" << endl;284 *fLog << " Impactpar.: " << fImpact/100 << "m" << endl;285 212 *fLog << " Photoelectrons: " << fPhotElfromShower << endl; 286 *fLog << endl;287 213 return; 288 214 } 289 if (str.Contains("id", TString::kIgnoreCase)) 290 switch(fPartId) 291 { 292 case kGAMMA: 293 *fLog << "Particle: Gamma" << endl; 294 break; 295 case kPROTON: 296 *fLog << "Particle: Proton" << endl; 297 break; 298 case kHELIUM: 299 *fLog << "Particle: Helium" << endl; 300 break; 301 } 302 if (str.Contains("energy", TString::kIgnoreCase)) 303 *fLog << "Energy: " << fEnergy << "GeV" << endl; 304 if (str.Contains("impact", TString::kIgnoreCase)) 305 *fLog << "Impact: " << fImpact << "cm" << endl; 306 } 215 } -
trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx
r5423 r7094 1 #ifndef __MMcEvt__2 #define __MMcEvt__1 #ifndef MARS_MMcEvt 2 #define MARS_MMcEvt 3 3 4 #ifndef MARS_M ParContainer5 #include "M ParContainer.h"4 #ifndef MARS_MMcEvtBasic 5 #include "MMcEvtBasic.h" 6 6 #endif 7 7 8 //9 // Version 4:10 // Added member fFadcTimeJitter11 //12 8 13 class MMcEvt : public M ParContainer9 class MMcEvt : public MMcEvtBasic 14 10 { 11 private: 12 UInt_t fEvtNumber; 13 Float_t fThick0; // [g/cm2] 14 Float_t fFirstTarget; // [] 15 Float_t fZFirstInteraction; // [cm] 16 17 Float_t fTheta; // [rad] Theta angle of event 18 Float_t fPhi; // [rad] Phi angle of event (see class description) 19 20 Float_t fCoreD; // [cm] Core d pos 21 Float_t fCoreX; // [cm] Core x pos 22 Float_t fCoreY; // [cm] Core y pos 23 24 // Up to here, the info from the CORSIKA event header. 25 26 // Time of first and last photon: 27 Float_t fTimeFirst; // [ns] 28 Float_t fTimeLast; // [ns] 29 30 // 6 parameters and chi2 of the NKG fit to the longitudinal 31 // particle distribution. See CORSIKA manual for explanation, 32 // section 4.42 "Longitudinal shower development": 33 // 34 Float_t fLongiNmax; // [particles] 35 Float_t fLongit0; // [g/cm2] 36 Float_t fLongitmax; // [g/cm2] 37 Float_t fLongia; // [g/cm2] 38 Float_t fLongib; // [] 39 Float_t fLongic; // [cm2/g] 40 Float_t fLongichi2; 41 42 UInt_t fPhotIni; // [ph] Initial number of photons 43 UInt_t fPassPhotAtm; // [ph] Passed atmosphere 44 UInt_t fPassPhotRef; // [ph] Passed reflector(reflectivity + effective area) 45 UInt_t fPassPhotCone; // [ph] Within any valid pixel, before plexiglas 46 UInt_t fPhotElfromShower; // [phe] Passed qe, coming from the shower 47 UInt_t fPhotElinCamera; // [phe] usPhotElfromShower + mean of phe from NSB 48 49 // Now follow the fraction of photons reaching the camera produced by 50 // electrons, muons and other particles respectively: 51 52 Float_t fElecCphFraction; 53 Float_t fMuonCphFraction; 54 Float_t fOtherCphFraction; 55 56 Float_t fFadcTimeJitter; 57 15 58 public: 16 // 17 // ParticleId for Monte Carlo simulation 18 // 19 enum ParticleId_t 20 { 21 kGAMMA = 1, 22 kPOSITRON = 2, 23 kELECTRON = 3, 24 kANTIMUON = 5, 25 kMUON = 6, 26 kPI0 = 7, 27 kNEUTRON = 13, 28 kPROTON = 14, 29 kHELIUM = 402, 30 kOXYGEN = 1608, 31 kIRON = 5626 32 }; 59 MMcEvt(); 60 MMcEvt(UInt_t, ParticleId_t, Float_t, Float_t, Float_t, 61 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, 62 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, 63 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, 64 UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, 65 Float_t, Float_t, Float_t, Float_t) ; 33 66 34 private: 35 UInt_t fEvtNumber; 36 UShort_t fPartId; // Type of particle 37 Float_t fEnergy; // [GeV] Energy 38 Float_t fThick0; // [g/cm2] 39 Float_t fFirstTarget; // [] 40 Float_t fZFirstInteraction; // [cm] 67 // Getter 68 UInt_t GetEvtNumber() const { return fEvtNumber; } //Get Event Number 69 Float_t GetTheta() const { return fTheta; } //Get Theta angle 70 Float_t GetPhi() const { return fPhi ; } //Get Phi angle 41 71 42 Float_t fTheta; // [rad] Theta angle of event43 Float_t fPhi; // [rad] Phi angle of event (see class description)72 Float_t GetCoreX() const { return fCoreX; } //Get Core x pos 73 Float_t GetCoreY() const { return fCoreY; } //Get Core y pos 44 74 45 Float_t fCoreD; // [cm] Core d pos 46 Float_t fCoreX; // [cm] Core x pos 47 Float_t fCoreY; // [cm] Core y pos 48 Float_t fImpact; // [cm] impact parameter 75 UInt_t GetPhotIni() const { return fPhotIni; } //Get Initial photons 76 UInt_t GetPassPhotAtm() const { return fPassPhotAtm;} //Get Passed atmosphere 77 UInt_t GetPassPhotRef() const { return fPassPhotRef; } //Get Passed reflector 78 UInt_t GetPassPhotCone() const { return fPassPhotCone; } //Get Passed glas 79 UInt_t GetPhotElfromShower() const { return fPhotElfromShower; } //Get Passed qe from shower 80 UInt_t GetPhotElinCamera() const { return fPhotElinCamera; } //Get Passed qe total 81 Float_t GetZFirstInteraction() const { return fZFirstInteraction; } 49 82 50 // Up to here, the info from the CORSIKA event header.83 Float_t GetOtherCphFraction() const { return fOtherCphFraction; } 51 84 52 // Telescope orientation: 53 Float_t fTelescopePhi; // [rad] (see class description) 54 Float_t fTelescopeTheta; // [rad] 85 Float_t GetLongiNmax() const { return fLongiNmax; } 86 Float_t GetLongia() const { return fLongia; } 87 Float_t GetLongib() const { return fLongib; } 88 Float_t GetLongic() const { return fLongic; } 89 Float_t GetLongichi2() const { return fLongichi2; } 90 Float_t GetLongit0() const { return fLongit0; } 91 Float_t GetLongitmax() const { return fLongitmax; } 55 92 56 // Time of first and last photon: 57 Float_t fTimeFirst; // [ns] 58 Float_t fTimeLast; // [ns] 93 Float_t GetFadcTimeJitter() const { return fFadcTimeJitter; } 59 94 60 // 6 parameters and chi2 of the NKG fit to the longitudinal 61 // particle distribution. See CORSIKA manual for explanation, 62 // section 4.42 "Longitudinal shower development": 63 // 64 Float_t fLongiNmax; // [particles] 65 Float_t fLongit0; // [g/cm2] 66 Float_t fLongitmax; // [g/cm2] 67 Float_t fLongia; // [g/cm2] 68 Float_t fLongib; // [] 69 Float_t fLongic; // [cm2/g] 70 Float_t fLongichi2; 95 Float_t GetMuonCphFraction() const { return fMuonCphFraction; } 71 96 72 UInt_t fPhotIni; // [ph] Initial number of photons 73 UInt_t fPassPhotAtm; // [ph] Passed atmosphere 74 UInt_t fPassPhotRef; // [ph] Passed reflector(reflectivity + effective area) 75 UInt_t fPassPhotCone; // [ph] Within any valid pixel, before plexiglas 76 UInt_t fPhotElfromShower; // [phe] Passed qe, coming from the shower 77 UInt_t fPhotElinCamera; // [phe] usPhotElfromShower + mean of phe 78 // from NSB 97 // Setter 98 void SetTheta(Float_t Theta) { fTheta=Theta; } //Set Theta angle 99 void SetPhi(Float_t Phi) { fPhi=Phi; } //Set Phi angle 100 void SetCoreD(Float_t CoreD) { fCoreD=CoreD; } //Set Core d pos 101 void SetCoreX(Float_t CoreX) { fCoreX=CoreX; } //Set Core x pos 102 void SetCoreY(Float_t CoreY) { fCoreY=CoreY; } //Set Core y pos 79 103 80 // Now follow the fraction of photons reaching the camera produced by 81 // electrons, muons and other particles respectively: 104 void Fill( UInt_t, ParticleId_t, Float_t, Float_t, Float_t, 105 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, 106 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, 107 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, 108 UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, 109 Float_t, Float_t, Float_t, Float_t) ; 82 110 83 Float_t fElecCphFraction; 84 Float_t fMuonCphFraction; 85 Float_t fOtherCphFraction; 86 87 Float_t fFadcTimeJitter; 111 // TObject 112 void Print(Option_t *opt=NULL) const; 113 void Clear(Option_t *opt=NULL); 88 114 89 public: 90 MMcEvt() ; 91 92 MMcEvt( UInt_t, UShort_t, Float_t, Float_t, Float_t, 93 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, 94 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, 95 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, 96 UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, 97 Float_t, Float_t, Float_t, Float_t) ; 98 99 ~MMcEvt(); 100 101 void Clear(Option_t *opt=NULL); 102 103 void Fill( UInt_t, UShort_t, Float_t, Float_t, Float_t, 104 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, 105 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, 106 Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, 107 UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, 108 Float_t, Float_t, Float_t, Float_t) ; 109 110 //virtual void AsciiWrite(ofstream &fout) const; 111 112 void Print(Option_t *opt=NULL) const; 113 114 UInt_t GetEvtNumber() const { return fEvtNumber; } //Get Event Number 115 Short_t GetPartId() const { return fPartId; } //Get Type of particle 116 Float_t GetEnergy() const { return fEnergy; } //Get Energy 117 118 Float_t GetTheta() const { return fTheta; } //Get Theta angle 119 Float_t GetPhi() const { return fPhi ; } //Get Phi angle 120 121 /* Float_t GetCoreD() { return fCoreD; } //Get Core d pos */ 122 Float_t GetCoreX() { return fCoreX; } //Get Core x pos 123 Float_t GetCoreY() { return fCoreY; } //Get Core y pos 124 Float_t GetImpact() const { return fImpact;} //Get impact parameter 125 126 UInt_t GetPhotIni() { return fPhotIni; } //Get Initial photons 127 UInt_t GetPassPhotAtm() { return fPassPhotAtm;} //Get Passed atmosphere 128 UInt_t GetPassPhotRef() { return fPassPhotRef; } //Get Passed reflector 129 UInt_t GetPassPhotCone() { return fPassPhotCone; } //Get Passed glas 130 UInt_t GetPhotElfromShower() { return fPhotElfromShower; } //Get Passed qe from shower 131 UInt_t GetPhotElinCamera() { return fPhotElinCamera; } //Get Passed qe total 132 Float_t GetZFirstInteraction() const { return fZFirstInteraction; } 133 134 Float_t GetTelescopePhi() const { return fTelescopePhi; } 135 Float_t GetTelescopeTheta() const { return fTelescopeTheta; } 136 Float_t GetOtherCphFraction() const { return fOtherCphFraction; } 137 138 Float_t GetLongiNmax() const { return fLongiNmax; } 139 Float_t GetLongia() const { return fLongia; } 140 Float_t GetLongib() const { return fLongib; } 141 Float_t GetLongic() const { return fLongic; } 142 Float_t GetLongichi2() const { return fLongichi2; } 143 Float_t GetLongit0() const { return fLongit0; } 144 Float_t GetLongitmax() const { return fLongitmax; } 145 146 Float_t GetFadcTimeJitter() const { return fFadcTimeJitter; } 147 148 Float_t GetMuonCphFraction() const { return fMuonCphFraction; } 149 150 void SetPartId(Short_t PartId) 151 {fPartId=PartId;} //Set Type of particle 152 153 TString GetParticleName() const 154 { 155 switch (fPartId) 156 { 157 case kGAMMA: return "Gamma"; 158 case kPOSITRON: return "Positron"; 159 case kELECTRON: return "Electron"; 160 case kANTIMUON: return "Anti-Muon"; 161 case kMUON: return "Muon"; 162 case kPI0: return "Pi-0"; 163 case kNEUTRON: return "Neutron"; 164 case kPROTON: return "Proton"; 165 case kHELIUM: return "Helium"; 166 case kOXYGEN: return "Oxygen"; 167 case kIRON: return "Iron"; 168 } 169 170 return Form("Id:%d", fPartId); 171 } 172 TString GetParticleSymbol() const 173 { 174 switch (fPartId) 175 { 176 case kGAMMA: return "\\gamma"; 177 case kPOSITRON: return "e^{+}"; 178 case kELECTRON: return "e^{-}"; 179 case kANTIMUON: return "\\mu^{+}"; 180 case kMUON: return "\\mu^{-}"; 181 case kPI0: return "\\pi^{0}"; 182 case kNEUTRON: return "n"; 183 case kPROTON: return "p"; 184 case kHELIUM: return "He"; 185 case kOXYGEN: return "O"; 186 case kIRON: return "Fe"; 187 } 188 189 return Form("Id:%d", fPartId); 190 } 191 TString GetEnergyStr() const 192 { 193 if (fEnergy>1000) 194 return Form("%.1fTeV", fEnergy/1000); 195 196 if (fEnergy>10) 197 return Form("%dGeV", (Int_t)(fEnergy+.5)); 198 199 if (fEnergy>1) 200 return Form("%.1fGeV", fEnergy); 201 202 return Form("%dMeV", (Int_t)(fEnergy*1000+.5)); 203 } 204 205 void SetEnergy(Float_t Energy) 206 { fEnergy=Energy; } //Set Energy 207 208 void SetTheta(Float_t Theta) 209 { fTheta=Theta; } //Set Theta angle 210 211 void SetPhi(Float_t Phi) 212 { fPhi=Phi; } //Set Phi angle 213 214 void SetCoreD(Float_t CoreD) 215 { fCoreD=CoreD; } //Set Core d pos 216 217 void SetCoreX(Float_t CoreX) 218 { fCoreX=CoreX; } //Set Core x pos 219 220 void SetCoreY(Float_t CoreY ) 221 { fCoreY=CoreY; } //Set Core y pos 222 223 void SetImpact(Float_t Impact) 224 { fImpact=Impact;} //Set impact parameter 225 226 // DO NOT USE THIS IS A WORKAROUND! 227 void SetTelescopeTheta(Float_t Theta) { fTelescopeTheta=Theta; } 228 void SetTelescopePhi(Float_t Phi) { fTelescopePhi=Phi; } 229 230 231 /* void SetPhotIni(Short_t PhotIni) */ 232 /* { fPhotIni=PhotIni; } //Set Initial photons */ 233 /* void SetPassPhotAtm(Short_t PassPhotAtm) */ 234 /* { fPassPhotAtm=PassPhotAtm;} //Set Passed atmosphere */ 235 /* void SetPassPhotRef(Short_t PassPhotRef) */ 236 /* { fPassPhotRef=PassPhotRef ; } //Set Passed reflector */ 237 /* void SetPassPhotCone(Short_t PhotCon) */ 238 /* { fPassPhotCone=PhotCon; } //Set Passed glas */ 239 240 241 ClassDef(MMcEvt, 4) //Stores Montecarlo Information of one event (eg. the energy) 242 115 ClassDef(MMcEvt, 5) //Stores Montecarlo Information of one event (eg. the energy) 243 116 }; 244 117 -
trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.cc
r6375 r7094 40 40 // South. 41 41 // 42 // 43 // Version 1: 44 // New container to keep the very basic informations on the 45 // original MC events produced by Corsika 46 // 47 // Version 2: 48 // - added typedef for ParticleId_t from MMcEvt 49 // - replaced MMcEvt::ParticleId_t by ParticleId_t 50 // 42 51 ///////////////////////////////////////////////////////////////////////////// 43 44 52 #include "MMcEvtBasic.h" 45 53 … … 52 60 53 61 // -------------------------------------------------------------------------- 54 // Default constructor set all values to zero 62 // 63 // Default constructor. Calls Clear() 55 64 // 56 65 MMcEvtBasic::MMcEvtBasic() 57 { 58 fName = "MMcEvtBasic";59 fTitle = "Basic event info from Monte Carlo";66 { 67 fName = "MMcEvtBasic"; 68 fTitle = "Basic event info from Monte Carlo"; 60 69 61 Clear();70 Clear(); 62 71 } 63 72 64 73 // -------------------------------------------------------------------------- 65 // constuctor II66 74 // 67 // All datamembers are parameters.75 // Constructor. Use this to set all data members 68 76 // 69 MMcEvtBasic::MMcEvtBasic(MMcEvt::ParticleId_t usPId, 70 Float_t fEner, 71 Float_t fImpa, 72 Float_t fTPhii,73 Float_t 77 // THIS FUNCTION IS FOR THE SIMULATION OLNY. 78 // DON'T USE THIS MEMBERFUNCTION IN THE ANALYSIS. 79 // 80 MMcEvtBasic::MMcEvtBasic(ParticleId_t usPId, Float_t fEner, 81 Float_t fImpa, Float_t fTPhii, Float_t fTThet) 74 82 { 75 fName = "MMcEvtBasic";76 fTitle = "Basic event info from Monte Carlo";83 fName = "MMcEvtBasic"; 84 fTitle = "Basic event info from Monte Carlo"; 77 85 78 fPartId = usPId; 79 fEnergy = fEner; 80 fImpact = fImpa; 81 fTelescopePhi = fTPhii; 82 fTelescopeTheta = fTThet; 86 Fill(usPId, fEner, fImpa, fTPhii, fTThet); 83 87 } 84 85 86 // --------------------------------------------------------------------------87 // default destructor88 //89 MMcEvtBasic::~MMcEvtBasic() {90 }91 92 88 93 89 // -------------------------------------------------------------------------- 94 90 // 95 // Reset all values. We have no "error" value for fPartId, 96 // we just set kGAMMA 91 // Reset all values: Fill(kUNDEFINED, -1, -1, 0, 0) 97 92 // 98 93 void MMcEvtBasic::Clear(Option_t *opt) 99 94 { 100 fPartId = MMcEvt::kGAMMA; 101 fEnergy = -1.; 102 fImpact = -1.; 103 fTelescopeTheta = -1.; 104 fTelescopePhi = -1.; 95 Fill(kUNDEFINED, -1, -1, 0, 0); 105 96 } 106 97 … … 109 100 // Fill all data members 110 101 // 111 void MMcEvtBasic::Fill(MMcEvt::ParticleId_t usPId, 112 Float_t fEner, 113 Float_t fImpa, 114 Float_t fTPhii, 115 Float_t fTThet) 102 void MMcEvtBasic::Fill(ParticleId_t usPId, Float_t fEner, 103 Float_t fImpa, Float_t fTPhii, Float_t fTThet) 116 104 { 117 fPartId = usPId; 118 fEnergy = fEner; 119 fImpact = fImpa; 120 fTelescopePhi = fTPhii; 121 fTelescopeTheta = fTThet; 105 fPartId = usPId; 106 107 fEnergy = fEner; 108 fImpact = fImpa; 109 110 fTelescopePhi = fTPhii; 111 fTelescopeTheta = fTThet; 122 112 } 123 113 … … 131 121 void MMcEvtBasic::Print(Option_t *opt) const 132 122 { 133 //134 // print out the data member on screen135 //136 TString str(opt);137 if (str.IsNull())123 // 124 // print out the data member on screen 125 // 126 TString str(opt); 127 if (str.IsNull()) 138 128 { 139 *fLog << all << endl; 140 *fLog << "Monte Carlo output:" << endl; 141 *fLog << " Particle Id: "; 142 switch(fPartId) 143 { 144 case MMcEvt::kGAMMA: 145 *fLog << "Gamma" << endl; 146 break; 147 case MMcEvt::kPROTON: 148 *fLog << "Proton" << endl; 149 break; 150 case MMcEvt::kHELIUM: 151 *fLog << "Helium" << endl; 152 break; 153 default: 154 break; 155 } 156 *fLog << " Energy: " << fEnergy << "GeV" << endl; 157 *fLog << " Impactpar.: " << fImpact/100 << "m" << endl; 158 *fLog << endl; 159 return; 129 *fLog << all << endl; 130 *fLog << "Monte Carlo output:" << endl; 131 *fLog << " Particle Id: " << GetParticleName() << endl; 132 *fLog << " Energy: " << fEnergy << "GeV" << endl; 133 *fLog << " Impactparam.: " << fImpact/100 << "m" << endl; 134 *fLog << endl; 135 return; 160 136 } 161 if (str.Contains("id", TString::kIgnoreCase)) 162 switch(fPartId) 163 { 164 case MMcEvt::kGAMMA: 165 *fLog << "Particle: Gamma" << endl; 166 break; 167 case MMcEvt::kPROTON: 168 *fLog << "Particle: Proton" << endl; 169 break; 170 case MMcEvt::kHELIUM: 171 *fLog << "Particle: Helium" << endl; 172 break; 173 default: 174 break; 175 } 176 if (str.Contains("energy", TString::kIgnoreCase)) 177 *fLog << "Energy: " << fEnergy << "GeV" << endl; 178 if (str.Contains("impact", TString::kIgnoreCase)) 179 *fLog << "Impact: " << fImpact << "cm" << endl; 137 if (str.Contains("id", TString::kIgnoreCase)) 138 *fLog << "Particle: " << GetParticleName() << endl; 139 if (str.Contains("energy", TString::kIgnoreCase)) 140 *fLog << "Energy: " << fEnergy << "GeV" << endl; 141 if (str.Contains("impact", TString::kIgnoreCase)) 142 *fLog << "Impact: " << fImpact << "cm" << endl; 180 143 } -
trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h
r6375 r7094 1 #ifndef __MMcEvtBasic__2 #define __MMcEvtBasic__1 #ifndef MARS_MMcEvtBasic 2 #define MARS_MMcEvtBasic 3 3 4 4 #ifndef MARS_MParContainer … … 6 6 #endif 7 7 8 #include "MMcEvt.hxx"9 10 //11 // Version 1:12 // New container to keep the very basic informations on the13 // original MC events produced by Corsika14 //15 8 16 9 class MMcEvtBasic : public MParContainer 17 10 { 11 public: 12 enum ParticleId_t 13 { 14 kUNDEFINED = -1, 15 kGAMMA = 1, 16 kPOSITRON = 2, 17 kELECTRON = 3, 18 kANTIMUON = 5, 19 kMUON = 6, 20 kPI0 = 7, 21 kNEUTRON = 13, 22 kPROTON = 14, 23 kHELIUM = 402, 24 kOXYGEN = 1608, 25 kIRON = 5626 26 }; 18 27 19 28 private: 20 MMcEvt::ParticleId_t fPartId; // Type of particle21 Float_t 22 Float_t 29 ParticleId_t fPartId; // Type of particle 30 Float_t fEnergy; // [GeV] Energy 31 Float_t fImpact; // [cm] impact parameter 23 32 24 33 // Telescope orientation (see TDAS 02-11 regarding the 25 34 // precise meaning of these angles): 26 Float_t fTelescopePhi; // [rad] 27 Float_t fTelescopeTheta; // [rad] 28 35 Float_t fTelescopePhi; // [rad] 36 Float_t fTelescopeTheta; // [rad] 29 37 30 38 public: 31 39 MMcEvtBasic(); 32 33 MMcEvtBasic(MMcEvt::ParticleId_t, Float_t, Float_t, Float_t, Float_t); 34 ~MMcEvtBasic(); 40 MMcEvtBasic(ParticleId_t, Float_t, Float_t, Float_t, Float_t); 35 41 36 void Clear(Option_t *opt=NULL); 42 // Getter 43 ParticleId_t GetPartId() const { return fPartId; } 37 44 38 void Fill(MMcEvt::ParticleId_t, Float_t, Float_t, Float_t, Float_t);39 40 void Print(Option_t *opt=NULL) const;41 42 MMcEvt::ParticleId_t GetPartId() const { return fPartId; }43 45 Float_t GetEnergy() const { return fEnergy; } 44 46 Float_t GetImpact() const { return fImpact; } 47 45 48 Float_t GetTelescopePhi() const { return fTelescopePhi; } 46 49 Float_t GetTelescopeTheta() const { return fTelescopeTheta; } … … 50 53 switch (fPartId) 51 54 { 52 case MMcEvt::kGAMMA: return "Gamma"; 53 case MMcEvt::kPOSITRON: return "Positron"; 54 case MMcEvt::kELECTRON: return "Electron"; 55 case MMcEvt::kANTIMUON: return "Anti-Muon"; 56 case MMcEvt::kMUON: return "Muon"; 57 case MMcEvt::kPI0: return "Pi-0"; 58 case MMcEvt::kNEUTRON: return "Neutron"; 59 case MMcEvt::kPROTON: return "Proton"; 60 case MMcEvt::kHELIUM: return "Helium"; 61 case MMcEvt::kOXYGEN: return "Oxygen"; 62 case MMcEvt::kIRON: return "Iron"; 55 case kUNDEFINED:return "Undefined"; 56 case kGAMMA: return "Gamma"; 57 case kPOSITRON: return "Positron"; 58 case kELECTRON: return "Electron"; 59 case kANTIMUON: return "Anti-Muon"; 60 case kMUON: return "Muon"; 61 case kPI0: return "Pi-0"; 62 case kNEUTRON: return "Neutron"; 63 case kPROTON: return "Proton"; 64 case kHELIUM: return "Helium"; 65 case kOXYGEN: return "Oxygen"; 66 case kIRON: return "Iron"; 63 67 } 64 68 … … 70 74 switch (fPartId) 71 75 { 72 case MMcEvt::kGAMMA: return "\\gamma"; 73 case MMcEvt::kPOSITRON: return "e^{+}"; 74 case MMcEvt::kELECTRON: return "e^{-}"; 75 case MMcEvt::kANTIMUON: return "\\mu^{+}"; 76 case MMcEvt::kMUON: return "\\mu^{-}"; 77 case MMcEvt::kPI0: return "\\pi^{0}"; 78 case MMcEvt::kNEUTRON: return "n"; 79 case MMcEvt::kPROTON: return "p"; 80 case MMcEvt::kHELIUM: return "He"; 81 case MMcEvt::kOXYGEN: return "O"; 82 case MMcEvt::kIRON: return "Fe"; 76 case kUNDEFINED:return "N/A"; 77 case kGAMMA: return "\\gamma"; 78 case kPOSITRON: return "e^{+}"; 79 case kELECTRON: return "e^{-}"; 80 case kANTIMUON: return "\\mu^{+}"; 81 case kMUON: return "\\mu^{-}"; 82 case kPI0: return "\\pi^{0}"; 83 case kNEUTRON: return "n"; 84 case kPROTON: return "p"; 85 case kHELIUM: return "He"; 86 case kOXYGEN: return "O"; 87 case kIRON: return "Fe"; 83 88 } 84 89 … … 101 106 102 107 103 void SetPartId(MMcEvt::ParticleId_t id) 104 { fPartId = id; } 105 106 void SetEnergy(Float_t Energy) 107 { fEnergy=Energy; } //Set Energy 108 109 void SetImpact(Float_t Impact) 110 { fImpact=Impact;} //Set impact parameter 108 // Setter 109 void SetPartId(ParticleId_t id) { fPartId = id; } 110 void SetEnergy(Float_t Energy) { fEnergy=Energy; } //Set Energy 111 void SetImpact(Float_t Impact) { fImpact=Impact;} //Set impact parameter 111 112 112 113 void SetTelescopeTheta(Float_t Theta) { fTelescopeTheta=Theta; } 113 114 114 void SetTelescopePhi (Float_t Phi) { fTelescopePhi=Phi; } 115 115 116 ClassDef(MMcEvtBasic, 1) //Stores Basic Montecarlo Information of one event 116 void Fill(ParticleId_t, Float_t, Float_t, Float_t, Float_t); 117 118 // TObject 119 void Clear(Option_t *opt=NULL); 120 void Print(Option_t *opt=NULL) const; 121 122 ClassDef(MMcEvtBasic, 2) //Stores Basic Montecarlo Information of one event 117 123 118 124 };
Note:
See TracChangeset
for help on using the changeset viewer.