Changeset 852 for trunk/MagicSoft/Mars/mmontecarlo
- Timestamp:
- 06/20/01 10:41:23 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mmontecarlo
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mmontecarlo/MCollArea.cc
r749 r852 17 17 ! 18 18 ! Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de) 19 ! Author(s):Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)19 ! Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de) 20 20 ! 21 21 ! Copyright: MAGIC Software Development, 2000-2001 … … 35 35 MCollArea::MCollArea(const char *name, const char *title) 36 36 { 37 //38 // default constructor39 //37 // 38 // default constructor 39 // 40 40 41 // initialize the histogram for the distribution r vs E42 //43 // we set the energy range from 1 Gev to 10000 GeV (in log 5 orders44 // of magnitude) and for each order we take 10 subdivision --> 50 xbins45 //46 // we set the radius range from 0 m to 500 m with 10 m bin --> 50 ybins41 // initialize the histogram for the distribution r vs E 42 // 43 // we set the energy range from 1 Gev to 10000 GeV (in log 5 orders 44 // of magnitude) and for each order we take 10 subdivision --> 50 xbins 45 // 46 // we set the radius range from 0 m to 500 m with 10 m bin --> 50 ybins 47 47 48 48 49 *fName = name ? name : "MCollArea"; 50 *fTitle = title ? title : "Data to Calculate Coll-Area"; 51 52 53 fHistAll = new TH2D("collAreaAll", "all showers - Radius vs log(E) distribution", 54 50, 0., 5., 55 50, 0., 500. ) ; 56 57 fHistSel = new TH2D("collAreaSel", "selected showers - Radius vs log(E) distribution", 58 50, 0., 5., 59 50, 0., 500. ) ; 49 *fName = name ? name : "MCollArea"; 50 *fTitle = title ? title : "Data to Calculate Coll-Area"; 60 51 61 fHistCol = new TH1D("collArea", "Collection Area", 62 50, 0., 5.) ; 63 64 } 52 53 fHistAll = new TH2D("collAreaAll", "all showers - Radius vs log(E) distribution", 54 50, 0., 5., 55 50, 0., 500. ) ; 56 57 fHistSel = new TH2D("collAreaSel", "selected showers - Radius vs log(E) distribution", 58 50, 0., 5., 59 50, 0., 500. ) ; 60 61 fHistCol = new TH1D("collArea", "Collection Area", 62 50, 0., 5.) ; 63 64 } 65 65 66 66 MCollArea::~MCollArea() 67 { 68 delete fHistAll ;69 delete fHistSel ;70 delete fHistCol ;71 } 67 { 68 delete fHistAll ; 69 delete fHistSel ; 70 delete fHistCol ; 71 } 72 72 73 73 void MCollArea::FillAll(Float_t log10E, Float_t radius) 74 { 75 fHistAll->Fill(log10E, radius ) ;76 } 74 { 75 fHistAll->Fill(log10E, radius ) ; 76 } 77 77 78 78 void MCollArea::FillSel(Float_t log10E, Float_t radius) 79 { 80 fHistSel->Fill(log10E, radius ) ;81 } 79 { 80 fHistSel->Fill(log10E, radius ) ; 81 } 82 82 83 void MCollArea::DrawAll() 84 { 85 fHistAll->Draw() ;86 } 83 void MCollArea::DrawAll() 84 { 85 fHistAll->Draw() ; 86 } 87 87 88 void MCollArea::DrawSel() 89 { 90 fHistSel->Draw() ;91 } 88 void MCollArea::DrawSel() 89 { 90 fHistSel->Draw() ; 91 } 92 92 93 void MCollArea::Draw(Option_t* option) 94 { 95 fHistCol->Draw(option) ;96 } 93 void MCollArea::Draw(Option_t* option) 94 { 95 fHistCol->Draw(option) ; 96 } 97 97 98 98 void MCollArea::CalcEfficiency() 99 { 99 { 100 100 // Description! 101 101 … … 114 114 const Float_t Nall = fHistAll->GetCellContent(ix, iy); 115 115 116 if ( Nall <= 0 ) { 117 // cout << ix << " " << iy << endl ; 116 if (Nall <= 0) 118 117 continue; 119 }120 118 121 119 const Double_t eff = N / Nall ; 122 120 const Double_t err = sqrt(Nall + Nall*N - N*N - N) / (Nall*Nall); 123 /* 124 cout << ix << " " << iy 125 << " N " << N 126 << " Nall " << Nall 127 << " effi " << eff 128 << " error " << err 129 << endl ; 130 */ 121 131 122 fHistSel->SetCellContent(ix, iy, eff); 132 123 fHistSel->SetCellError(ix, iy, err); -
trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.cc
r749 r852 17 17 ! 18 18 ! Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de) 19 ! Author(s):Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)19 ! Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de) 20 20 ! 21 21 ! Copyright: MAGIC Software Development, 2000-2001 … … 26 26 #include "MCollAreaTrigger.h" 27 27 28 #include "MParList.h" 29 28 30 #include "MLog.h" 29 31 #include "MLogManip.h" 30 #include "MParList.h"31 32 32 #include "MCollArea.h" 33 #include "MMcEvt.hxx" 33 #include "MMcEvt.hxx" 34 34 #include "MMcTrig.hxx" 35 36 #include "MHMcCollectionArea.h" 35 37 36 38 ClassImp(MCollAreaTrigger) … … 38 40 MCollAreaTrigger::MCollAreaTrigger (const char *name, const char *title) 39 41 { 40 *fName = name ? name : "MCollAreaTrigger";41 *fTitle = title ? title : "Task to calc the collection area ";42 *fName = name ? name : "MCollAreaTrigger"; 43 *fTitle = title ? title : "Task to calc the collection area "; 42 44 } 43 44 45 45 46 Bool_t MCollAreaTrigger::PreProcess (MParList *pList) 46 47 { 47 // connect the raw data with this task 48 49 fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt") ; 50 if (!fMcEvt) { 51 *fLog << dbginf << "MMcEvt not found... exit." << endl; 52 return kFALSE; 53 } 48 // connect the raw data with this task 54 49 55 fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig") ; 56 if (!fMcTrig) { 57 *fLog << dbginf << "MMcTrig not found... exit." << endl; 58 return kFALSE; 59 } 50 fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt"); 51 if (!fMcEvt) 52 { 53 *fLog << dbginf << "MMcEvt not found... exit." << endl; 54 return kFALSE; 55 } 60 56 61 fCollArea = (MCollArea*)pList->FindCreateObj("MCollArea") ; 62 if (!fCollArea) 63 return kFALSE; 57 fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig"); 58 if (!fMcTrig) 59 { 60 *fLog << dbginf << "MMcTrig not found... exit." << endl; 61 return kFALSE; 62 } 64 63 65 return kTRUE ; 64 fCollArea = (MHMcCollectionArea*)pList->FindCreateObj("MHMcCollectionArea"); 65 if (!fCollArea) 66 return kFALSE; 66 67 67 } 68 68 return kTRUE; 69 } 69 70 70 71 Bool_t MCollAreaTrigger::Process () … … 75 76 fCollArea->FillAll(energy, impact); 76 77 77 78 78 if (fMcTrig->GetFirstLevel() <= 0) 79 79 return kTRUE; … … 81 81 fCollArea->FillSel(energy, impact); 82 82 83 return kTRUE 83 return kTRUE; 84 84 } 85 85 86 86 Bool_t MCollAreaTrigger::PostProcess () 87 87 { 88 // 89 // do the calculation of the effectiv area 90 // 88 // 89 // do the calculation of the effectiv area 90 // 91 fCollArea->CalcEfficiency(); 91 92 92 fCollArea->CalcEfficiency() ; 93 94 return kTRUE ; 93 return kTRUE; 95 94 } -
trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.h
r698 r852 1 #ifndef M COLLAREATRIGGER_H2 #define M COLLAREATRIGGER_H1 #ifndef MMCCOLLECTIONAREACALC_H 2 #define MMCCOLLECTIONAREACALC_H 3 3 4 4 #ifndef MTASK_H … … 7 7 8 8 class MParList; 9 class MMcEvt ;10 class MMcTrig ;11 class M CollArea;9 class MMcEvt; 10 class MMcTrig; 11 class MHMcCollectionArea; 12 12 13 class M CollAreaTrigger : public MTask {14 private: 15 MMcEvt *fMcEvt ; //! 16 MMcTrig *fMcTrig ; //!17 MCollArea *fCollArea ; //!13 class MMcCollectionAreaCalc : public MTask 14 { 15 private: 16 MMcEvt *fMcEvt; 17 MMcTrig *fMcTrig; 18 18 19 public: 20 MCollAreaTrigger (const char *name=NULL, const char *title=NULL); 19 MHMcCollectionArea *fCollArea; 21 20 22 Bool_t PreProcess(MParList *pList); 23 Bool_t Process() ; 24 Bool_t PostProcess() ; 25 26 ClassDef(MCollAreaTrigger, 0) // Task to fill the collection area histograms 21 public: 22 MMcCollectionAreaCalc(const char *name=NULL, const char *title=NULL); 27 23 24 Bool_t PreProcess(MParList *pList); 25 Bool_t Process() ; 26 Bool_t PostProcess() ; 27 28 ClassDef(MMcCollectionAreaCalc, 0) // Task to calculate the collection area histogram 28 29 }; 29 30
Note:
See TracChangeset
for help on using the changeset viewer.