Changeset 2015 for trunk/MagicSoft/Mars/mhistmc
- Timestamp:
- 04/28/03 09:52:57 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mhistmc
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.cc
r1974 r2015 160 160 } 161 161 162 // --------------------------------------------------------------------------163 //164 // Creates a new canvas and draws the histogram into it.165 // Be careful: The histogram belongs to this object and won't get deleted166 // together with the canvas.167 //168 TObject *MHMcCollectionArea::DrawClone(Option_t* opt) const169 {170 return MH::DrawClone(opt);171 /*172 TCanvas *c = MH::MakeDefCanvas(fHistCol);173 174 //175 // This is necessary to get the expected bahviour of DrawClone176 //177 gROOT->SetSelectedPad(NULL);178 179 fHistCol->DrawCopy(option);180 181 gPad->SetLogx();182 183 c->Modified();184 c->Update();185 186 return c;*/187 }188 189 162 void MHMcCollectionArea::Draw(Option_t* option) 190 163 { 191 164 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 192 165 pad->SetBorderMode(0); 193 // if (!gPad)194 // MH::MakeDefCanvas(fHistCol);195 166 196 167 fHistCol->Draw(option); -
trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.h
r1974 r2015 36 36 37 37 void Draw(Option_t *option=""); 38 TObject *DrawClone(Option_t *option="") const;39 38 40 39 void CalcEfficiency(); -
trunk/MagicSoft/Mars/mhistmc/MHMcDifRate.cc
r1974 r2015 82 82 } 83 83 84 //-------------------------------------------------------------------------85 //86 // Defualt Destructor87 //88 MHMcDifRate::~MHMcDifRate()89 {90 }91 92 84 // ------------------------------------------------------------------------ 93 85 // … … 96 88 void MHMcDifRate::Draw(Option_t *option) 97 89 { 98 if (!gPad)99 MH::MakeDefCanvas(&fHist);90 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 91 pad->SetBorderMode(0); 100 92 101 gPad->SetLogx(); 93 AppendPad(""); 94 95 pad->SetLogx(); 102 96 103 97 fHist.Draw(option); 104 98 105 gPad->Modified(); 106 gPad->Update(); 107 } 108 109 TObject *MHMcDifRate::DrawClone(Option_t *option) const 110 { 111 TCanvas *c = MH::MakeDefCanvas(&fHist); 112 113 c->SetLogx(); 114 115 // 116 // This is necessary to get the expected bahviour of DrawClone 117 // 118 gROOT->SetSelectedPad(NULL); 119 120 ((TH1D&)fHist).DrawCopy(option); 121 122 c->Modified(); 123 c->Update(); 124 125 return c; 99 pad->Modified(); 100 pad->Update(); 126 101 } 127 102 /* -
trunk/MagicSoft/Mars/mhistmc/MHMcDifRate.h
r1974 r2015 23 23 public: 24 24 MHMcDifRate(const char *name=NULL, const char *title=NULL); 25 ~MHMcDifRate();26 25 27 26 void SetName(const char *name); … … 34 33 35 34 void Draw(Option_t* option = ""); 36 TObject *DrawClone(Option_t* option = "") const;37 35 38 36 // void Calc(const TH2D &hsel, const TH2D &hall); -
trunk/MagicSoft/Mars/mhistmc/MHMcEfficiency.cc
r1974 r2015 91 91 } 92 92 93 //-------------------------------------------------------------------------94 //95 // Defualt Destructor96 //97 MHMcEfficiency::~MHMcEfficiency()98 {99 }100 101 93 // ------------------------------------------------------------------------ 102 94 // … … 105 97 void MHMcEfficiency::Draw(Option_t *option) 106 98 { 107 if (!gPad)108 MH::MakeDefCanvas(&fHist);99 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 100 pad->SetBorderMode(0); 109 101 110 gPad->SetLogx(); 102 AppendPad(""); 103 104 pad->SetLogx(); 111 105 112 106 fHist.Draw(option); 113 107 114 gPad->Modified(); 115 gPad->Update(); 116 } 117 118 TObject *MHMcEfficiency::DrawClone(Option_t *option) const 119 { 120 TCanvas *c = MH::MakeDefCanvas(&fHist); 121 122 c->SetLogx(); 123 124 // 125 // This is necessary to get the expected bahviour of DrawClone 126 // 127 gROOT->SetSelectedPad(NULL); 128 129 ((TH2D&)fHist).DrawCopy(option); 130 131 c->Modified(); 132 c->Update(); 133 134 return c; 108 pad->Modified(); 109 pad->Update(); 135 110 } 136 111 -
trunk/MagicSoft/Mars/mhistmc/MHMcEfficiency.h
r1974 r2015 22 22 public: 23 23 MHMcEfficiency(const char *name=NULL, const char *title=NULL); 24 ~MHMcEfficiency();25 24 26 25 void SetName(const char *name); … … 33 32 34 33 void Draw(Option_t* option = ""); 35 TObject *DrawClone(Option_t* option = "") const;36 34 37 35 void Calc(const TH2D &hsel, const TH2D &hall); -
trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyEnergy.cc
r1974 r2015 86 86 } 87 87 88 //-------------------------------------------------------------------------89 //90 // Defualt Destructor91 //92 MHMcEfficiencyEnergy::~MHMcEfficiencyEnergy()93 {94 }95 96 88 // ------------------------------------------------------------------------ 97 89 // … … 100 92 void MHMcEfficiencyEnergy::Draw(Option_t *option) 101 93 { 102 if (!gPad)103 MH::MakeDefCanvas(&fHist);94 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 95 pad->SetBorderMode(0); 104 96 105 gPad->SetLogx(); 97 AppendPad(""); 98 99 pad->SetLogx(); 106 100 107 101 fHist.Draw(option); 108 102 109 gPad->Modified(); 110 gPad->Update(); 111 } 112 113 TObject *MHMcEfficiencyEnergy::DrawClone(Option_t *option) const 114 { 115 TCanvas *c = MH::MakeDefCanvas(&fHist); 116 117 c->SetLogx(); 118 119 // 120 // This is necessary to get the expected bahviour of DrawClone 121 // 122 gROOT->SetSelectedPad(NULL); 123 124 ((TH1D&)fHist).DrawCopy(option); 125 126 c->Modified(); 127 c->Update(); 128 129 return c; 103 pad->Modified(); 104 pad->Update(); 130 105 } 131 106 -
trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyEnergy.h
r1974 r2015 22 22 public: 23 23 MHMcEfficiencyEnergy(const char *name=NULL, const char *title=NULL); 24 ~MHMcEfficiencyEnergy();25 24 26 25 void SetName(const char *name); … … 33 32 34 33 void Draw(Option_t* option = ""); 35 TObject *DrawClone(Option_t* option = "") const;36 34 37 35 void Calc(const TH2D &hsel, const TH2D &hall); -
trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyImpact.cc
r1974 r2015 86 86 } 87 87 88 //-------------------------------------------------------------------------89 //90 // Defualt Destructor91 //92 MHMcEfficiencyImpact::~MHMcEfficiencyImpact()93 {94 }95 96 88 // ------------------------------------------------------------------------ 97 89 // … … 100 92 void MHMcEfficiencyImpact::Draw(Option_t *option) 101 93 { 102 if (!gPad)103 MH::MakeDefCanvas(&fHist);94 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 95 pad->SetBorderMode(0); 104 96 105 gPad->SetLogx(); 97 AppendPad(""); 98 99 pad->SetLogx(); 106 100 107 101 fHist.Draw(option); 108 102 109 gPad->Modified();110 gPad->Update();103 pad->Modified(); 104 pad->Update(); 111 105 } 112 106 -
trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyImpact.h
r1974 r2015 22 22 public: 23 23 MHMcEfficiencyImpact(const char *name=NULL, const char *title=NULL); 24 ~MHMcEfficiencyImpact();25 24 26 25 void SetName(const char *name); … … 33 32 34 33 void Draw(Option_t* option = ""); 35 TObject *DrawClone(Option_t* option = "") const;36 34 37 35 void Calc(const TH2D &hsel, const TH2D &hall); -
trunk/MagicSoft/Mars/mhistmc/MHMcEnergy.cc
r1974 r2015 170 170 void MHMcEnergy::Draw(Option_t *option) 171 171 { 172 if (!gPad) 173 MH::MakeDefCanvas(fHist); 172 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 173 pad->SetBorderMode(0); 174 175 AppendPad(""); 174 176 175 177 fHist->Draw(option); … … 177 179 DrawLegend(); 178 180 179 gPad->Modified(); 180 gPad->Update(); 181 } 182 183 TObject *MHMcEnergy::DrawClone(Option_t *option) const 184 { 185 TCanvas *c = MH::MakeDefCanvas(fHist); 186 187 // 188 // This is necessary to get the expected bahviour of DrawClone 189 // 190 gROOT->SetSelectedPad(NULL); 191 192 fHist->DrawClone(option); 193 194 DrawLegend(); 195 196 c->Modified(); 197 c->Update(); 198 199 return c; 181 pad->Modified(); 182 pad->Update(); 200 183 } 201 184 -
trunk/MagicSoft/Mars/mhistmc/MHMcEnergy.h
r1974 r2015 49 49 50 50 void Draw(Option_t* option = ""); 51 TObject *DrawClone(Option_t* option = "") const;52 51 53 52 void Print(Option_t* option = NULL) const; -
trunk/MagicSoft/Mars/mhistmc/MHMcEnergyImpact.cc
r1992 r2015 93 93 } 94 94 95 //-------------------------------------------------------------------------96 //97 // Defualt Destructor98 //99 MHMcEnergyImpact::~MHMcEnergyImpact()100 {101 }102 103 104 95 Bool_t MHMcEnergyImpact::SetupFill(const MParList *pList) 105 96 { … … 137 128 void MHMcEnergyImpact::Draw(Option_t *option) 138 129 { 139 if (!gPad)140 MH::MakeDefCanvas(&fHist);130 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 131 pad->SetBorderMode(0); 141 132 142 gPad->SetLogx(); 133 AppendPad(""); 134 135 pad->SetLogx(); 143 136 144 137 fHist.Draw(option); 145 138 146 gPad->Modified();147 gPad->Update();139 pad->Modified(); 140 pad->Update(); 148 141 } 149 150 TObject *MHMcEnergyImpact::DrawClone(Option_t *option) const151 {152 TCanvas *c = MH::MakeDefCanvas(&fHist);153 154 c->SetLogx();155 156 //157 // This is necessary to get the expected bahviour of DrawClone158 //159 gROOT->SetSelectedPad(NULL);160 161 ((TH2D&)fHist).DrawCopy(option);162 163 c->Modified();164 c->Update();165 166 return c;167 }168 -
trunk/MagicSoft/Mars/mhistmc/MHMcEnergyImpact.h
r1992 r2015 18 18 public: 19 19 MHMcEnergyImpact(const char *name=NULL, const char *title=NULL); 20 ~MHMcEnergyImpact();21 20 22 21 void SetName(const char *name); … … 32 31 33 32 void Draw(Option_t* option = ""); 34 TObject *DrawClone(Option_t* option = "") const;35 33 36 34 ClassDef(MHMcEnergyImpact, 1) // Histogram container for 2D histogram in Energy and Impact -
trunk/MagicSoft/Mars/mhistmc/MHMcEnergyMigration.cc
r1992 r2015 107 107 // -------------------------------------------------------------------------- 108 108 // 109 // Draw a copy of the histogram110 //111 TObject *MHMcEnergyMigration::DrawClone(Option_t *opt) const112 {113 TCanvas &c = *MakeDefCanvas("EnergyMigration", "E-est vs. E-true");114 115 c.Divide(2, 2);116 117 gROOT->SetSelectedPad(NULL);118 119 TH1 *h;120 121 c.cd(1);122 h = ((TH3*)(&fHist))->Project3D("expro");123 124 h->SetTitle("Distribution of E-true");125 h->SetXTitle("E_{true} [GeV]");126 h->SetYTitle("Counts");127 128 h->Draw(opt);129 h->SetBit(kCanDelete);130 gPad->SetLogx();131 132 133 c.cd(2);134 h = ((TH3*)(&fHist))->Project3D("eypro");135 136 h->SetTitle("Distribution of E-est");137 h->SetXTitle("E_{est} [GeV]");138 h->SetYTitle("Counts");139 140 h->Draw(opt);141 h->SetBit(kCanDelete);142 gPad->SetLogx();143 144 c.cd(3);145 h = ((TH3*)(&fHist))->Project3D("ezpro");146 147 h->SetTitle("Distribution of Theta");148 h->SetXTitle("\\Theta [\\circ]");149 h->SetYTitle("Counts");150 151 h->Draw(opt);152 h->SetBit(kCanDelete);153 154 155 c.cd(4);156 ((TH3*)(&fHist))->DrawCopy(opt);157 158 c.Modified();159 c.Update();160 161 return &c;162 }163 164 // --------------------------------------------------------------------------165 //166 109 // Draw the histogram 167 110 // 168 111 void MHMcEnergyMigration::Draw(Option_t *opt) 169 112 { 170 if (!gPad)171 MakeDefCanvas("EnergyMigration", "E-est vs. E-true");113 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist); 114 pad->SetBorderMode(0); 172 115 173 gPad->Divide(2,2); 116 AppendPad(""); 117 118 pad->Divide(2,2); 174 119 175 120 TH1 *h; 176 121 177 gPad->cd(1); 122 pad->cd(1); 123 gPad->SetBorderMode(0); 124 gPad->SetLogx(); 178 125 h = fHist.Project3D("ex_pro"); 179 180 h->SetTitle("Distribution of E-true"); 126 h->SetTitle("Distribution of E_{true}"); 181 127 h->SetXTitle("E_{true} [GeV]"); 182 183 128 h->Draw(opt); 184 129 h->SetBit(kCanDelete); 130 131 pad->cd(2); 132 gPad->SetBorderMode(0); 185 133 gPad->SetLogx(); 186 187 188 gPad->cd(2);189 134 h = fHist.Project3D("ey_pro"); 190 191 h->SetTitle("Distribution of E-est"); 135 h->SetTitle("Distribution of E_{est}"); 192 136 h->SetXTitle("E_{est} [GeV]"); 193 137 h->Draw(opt); 194 138 h->SetBit(kCanDelete); 195 gPad->SetLogx();196 139 197 gPad->cd(3); 140 pad->cd(3); 141 gPad->SetBorderMode(0); 198 142 h = fHist.Project3D("ez_pro"); 199 200 h->SetTitle("Distribution of Theta"); 143 h->SetTitle("Distribution of \\Theta"); 201 144 h->SetXTitle("\\Theta [\\circ]"); 202 145 h->Draw(opt); 203 146 h->SetBit(kCanDelete); 204 147 148 pad->cd(4); 149 gPad->SetBorderMode(0); 150 fHist.Draw(opt); 205 151 206 gPad->cd(4); 207 fHist.DrawCopy(opt); 208 209 gPad->Modified(); 210 gPad->Update(); 152 pad->Modified(); 153 pad->Update(); 211 154 } 212 155 -
trunk/MagicSoft/Mars/mhistmc/MHMcEnergyMigration.h
r2010 r2015 34 34 35 35 void Draw(Option_t *option=""); 36 TObject *DrawClone(Option_t *option="") const;37 36 38 37 ClassDef(MHMcEnergyMigration, 1) //3D-histogram E-true E-est Theta -
trunk/MagicSoft/Mars/mhistmc/MHMcRate.cc
r1974 r2015 20 20 ! Author(s): Abelardo Moralejo 2/2003 21 21 ! 22 ! Explanations on the rate calculation can be found in23 ! chapter 7 of the following diploma thesis:24 ! http://www.pd.infn.it/magic/tesi2.ps.gz (in Italian)25 !26 22 ! Copyright: MAGIC Software Development, 2000-2001 27 23 ! 28 24 ! 29 25 \* ======================================================================== */ 26 27 ///////////////////////////////////////////////////////////////////////////// 28 // 29 // Explanations on the rate calculation can be found in 30 // chapter 7 of the following diploma thesis: 31 // http://www.pd.infn.it/magic/tesi2.ps.gz (in Italian) 32 // 33 //////////////////////////////////////////////////////////////////////////// 30 34 31 35 #include "MHMcRate.h" … … 251 255 } 252 256 253 TObject *MHMcRate::DrawClone(Option_t *) const 254 { 255 *fLog << all << dbginf << " - MHMcRate::DrawClone: To be iplemented" << endl; 256 return NULL; 257 } 257 q -
trunk/MagicSoft/Mars/mhistmc/MHMcRate.h
r1974 r2015 12 12 UShort_t fPartId; // Type of particle 13 13 14 Float_t fEnergyMax; // Maximum Energy in TeV15 Float_t fEnergyMin; // Minimum Energy in TeV14 Float_t fEnergyMax; // Maximum Energy [TeV] 15 Float_t fEnergyMin; // Minimum Energy [TeV] 16 16 17 Float_t fThetaMax; // Maximum theta angle of run 18 Float_t fThetaMin; // Minimum theta angle of run 19 Float_t fPhiMax; // Maximum phi angle of run 20 Float_t fPhiMin; // Minimum phi angle of run 17 Float_t fThetaMax; // Maximum theta angle of run [?] 18 Float_t fThetaMin; // Minimum theta angle of run [?] 19 Float_t fPhiMax; // Maximum phi angle of run [?] 20 Float_t fPhiMin; // Minimum phi angle of run [?] 21 21 22 Float_t fSolidAngle; // Solid angle within which incident directions 23 // are distributed (sr) 22 Float_t fSolidAngle; // Solid angle within which incident directions are distributed [sr] 24 23 25 Float_t fImpactMax; // Maximum impact parameter (cm)26 Float_t fImpactMin; // Minimum impact parameter (cm)24 Float_t fImpactMax; //[cm] Maximum impact parameter [cm] 25 Float_t fImpactMin; //[cm] Minimum impact parameter [cm] 27 26 28 27 Float_t fBackTrig; // Number of triggers from background … … 38 37 Float_t fTriggerRateError; // Estimated error for the trigger rate in Hz 39 38 40 Float_t fMeanThreshold; // Mean discriminator threshold (mV) of trigger 41 // pixels. 39 Float_t fMeanThreshold; // Mean discriminator threshold of trigger pixels [mV] 42 40 43 41 Short_t fMultiplicity; // L1 trigger multiplicity. 44 42 45 Short_t fTriggerCondNum; // Trigger condition number, for the case of 46 // running over camra files containing several. 43 Short_t fTriggerCondNum; // Trigger condition number, for the case of running over camra files containing several. 47 44 48 45 void Init(const char *name, const char *title); … … 93 90 94 91 void Draw(Option_t *o=NULL); 95 TObject *DrawClone(Option_t *o=NULL) const;96 92 97 93 ClassDef(MHMcRate, 1) // Data Container to calculate trigger rate
Note:
See TracChangeset
for help on using the changeset viewer.