Changeset 1215 for trunk/MagicSoft/Mars
- Timestamp:
- 01/23/02 19:37:56 (23 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1212 r1215 1 1 -*-*- END -*-*- 2 2 3 2002/01/23: Thomas Bretz 4 5 * macros/flux.C: 6 - fixed some bugs 7 - uncommented all drawing 8 9 * mhist/MBinning.h: 10 - changed SetEdges(TArrayD) 11 12 * mhist/MH.cc: 13 - SetBinning(..., TAxis*,...) didn't work. Corrected. 14 15 * mhist/MHAlphaEnergyTheta.cc, mhist/MHAlphaEnergyTime.cc, 16 mhist/MHEffOnTimeTheta.cc, mhist/MHEffOnTimeTime.cc, 17 mhist/MHTimeDiffTheta.cc, mhist/MHTimeDiffTime.cc: 18 - changed wrong titles, names, etc. 19 - changed way of drawing projections 20 - fixed usage of MH::SetBinning(TH1*) 21 22 23 3 24 2002/01/22: Thomas Bretz 4 25 -
trunk/MagicSoft/Mars/macros/flux.C
r1211 r1215 54 54 55 55 MBinning binstheta("BinningTheta"); 56 binstheta.SetEdges( 5, 2.5, 27.5);56 binstheta.SetEdges(7, -2.5, 32.5); 57 57 58 58 MBinning binstime("BinningTime"); … … 72 72 // 73 73 MReadMarsFile reader("Events", "~/data/Gamma*.root"); 74 reader.EnableBranch("MMcEvt.fTheta"); 74 75 75 76 MGeomCamMagic geomcam; … … 168 169 tasklist.PrintStatistics(); 169 170 170 return; 171 172 parlist.FindObject("MHMcCollectionArea")->DrawClone(); 173 parlist.FindObject("MHStarMap")->DrawClone(); 174 175 // ------------ Eff On Time ----------------- 176 177 MHEnergyTime &alltime = *(MHEnergyTime*)parlist.FindObject("AllTime"); 178 MHEnergyTheta &alltheta = *(MHEnergyTheta*)parlist.FindObject("AllTheta"); 179 MHEnergyTime &seltime = *(MHEnergyTime*)parlist.FindObject("SelTime"); 180 MHEnergyTheta &seltheta = *(MHEnergyTheta*)parlist.FindObject("SelTheta"); 181 182 MHEnergyTime collareatime; 183 MHEnergyTheta collareatheta; 184 collareatime.Divide(&seltime, &alltime); 185 collareatheta.Divide(&seltheta, &alltheta); 186 187 MHTimeDiffTime &effontime = *(MHTimeDiffTime*)parlist.FindObject("EffOnTime"); 171 /* 172 parlist.FindObject("HSource")->DrawClone();; 173 parlist.FindObject("MHHillas")->DrawClone(); 174 parlist.FindObject("MHStarMap")->DrawClone(); 175 parlist.FindObject("HAntiSource")->DrawClone(); 176 parlist.FindObject("MHMcCollectionArea")->DrawClone(); 177 */ 178 179 /* 180 MHEnergyTime &alltime = *(MHEnergyTime*)parlist.FindObject("AllTime"); 181 MHEnergyTheta &alltheta = *(MHEnergyTheta*)parlist.FindObject("AllTheta"); 182 MHEnergyTime &seltime = *(MHEnergyTime*)parlist.FindObject("SelTime"); 183 MHEnergyTheta &seltheta = *(MHEnergyTheta*)parlist.FindObject("SelTheta"); 184 185 MHEnergyTime collareatime; 186 MHEnergyTheta collareatheta; 187 collareatime.Divide(&seltime, &alltime); 188 collareatheta.Divide(&seltheta, &alltheta); 189 */ 190 191 MHTimeDiffTime &effontime = *(MHTimeDiffTime*)parlist.FindObject("EffOnTime"); 188 192 MHTimeDiffTheta &effontheta = *(MHTimeDiffTheta*)parlist.FindObject("EffOnTheta"); 189 193 190 effontime.DrawClone(); 191 effontheta.DrawClone(); 192 193 MHEffOnTimeTime ontime; 194 MHEffOnTimeTheta ontheta; 195 ontime.SetupFill(&parlist); 196 ontheta.SetupFill(&parlist); 197 198 ontime.Calc(effontime.GetHist()); 199 ontheta.Calc(effontheta.GetHist()); 200 201 ontime.DrawClone(); 202 ontheta.DrawClone(); 203 204 parlist.FindObject("HSource")->DrawClone();; 205 parlist.FindObject("HAntiSource")->DrawClone(); 206 parlist.FindObject("MHHillas")->DrawClone(); 207 208 MHAlphaEnergyTime &fluxsp = *(MHAlphaEnergyTime)parlist.FindObject("HillasSrc"); 209 MHAlphaEnergyTime &fluxasp = *(MHAlphaEnergyTime)parlist.FindObject("HillasAntiSrc"); 210 MHAlphaEnergyTheta &fluxsptheta = *(MHAlphaEnergyTime)parlist.FindObject("HillasSrc"); 211 MHAlphaEnergyTheta &fluxasptheta = *(MHAlphaEnergyTime)parlist.FindObject("HillasAntiSrc"); 212 213 fluxsp.DrawClone(); 214 fluxasp.DrawClone(); 215 fluxsptheta.DrawClone(); 216 fluxasptheta.DrawClone(); 217 218 MHAlphaEnergyTheta resulttime; 219 MHAlphaEnergyTheta resulttheta; 220 resulttime.Substract(&fluxsp, &fluxasp); 221 resulttheta.Substract(&fluxsptheta, &fluxasptheta); 222 223 resulttime.DrawClone(); 224 resulttheta.DrawClone(); 225 226 TH2D &projecttime = *resulttime.GetAlphaProjection(-10, 10); 227 TH2D &projecttheta = *resulttheta.GetAlphaProjection(-10, 10); 228 229 projecttime.SetTitle("Number of Gammas vs. EnergyEst and Time (Alpha integrated between -10, 10deg)"); 230 projecttheta.SetTitle("Number of Gammas vs. EnergyEst and Theta (Alpha integrated between -10, 10deg)"); 231 232 c = new TCanvas("To be unfolded"); 233 c->Divide(2,2); 234 c->cd(1); 235 projecttime.DrawCopy(); 236 c->cd(2); 237 projecttheta.DrawCopy(); 238 239 for (int i=1; i<=binstime.GetNumBins(); i++) 240 { 241 if (ontime.GetHist()->GetBinContent(i)==0) 242 continue; 243 244 TH1D &hist = *projecttime.ProjectionX("Number of Gammas vs. EnergyEst for a fixed time", i, i); 245 246 /* UNFOLDING */ 247 248 //hist->Divide(collareatime); 249 hist.Scale(1./ontime.GetHist()->GetBinContent(i)); 250 251 for (int j=1; j<=binse.GetNumBins(); j++) 252 hist.SetBinContent(j, hist.GetBinContent(j)/hist.GetBinWidth(j)); 253 254 hist.SetName("Flux"); 255 hist.SetTitle("Flux[Gammas/s/m^2/GeV] vs. EnergyTrue for a fixed Time"); 256 257 char n[100]; 258 sprintf(n, "Canv%d", j); 259 c= new TCanvas(n, "Title"); 260 hist.DrawCopy(); 261 } 262 263 delete &projecttime; 264 delete &projecttheta; 265 266 return; 267 268 // ------------------------------------------ 269 270 MHMcCollectionArea carea; 271 TH1D *collareatime = carea.GetHist(); // FIXME! 272 TH1D *collareatheta = carea.GetHist(); // FIXME! 194 /* 195 effontime.DrawClone(); 196 effontheta.DrawClone(); 197 */ 198 199 MHEffOnTimeTime ontime; 200 MHEffOnTimeTheta ontheta; 201 ontime.SetupFill(&parlist); 202 ontheta.SetupFill(&parlist); 203 204 ontime.Calc(effontime.GetHist()); 205 ontheta.Calc(effontheta.GetHist()); 206 207 /* 208 ontime.DrawClone(); 209 ontheta.DrawClone(); 210 */ 211 212 MHAlphaEnergyTime &fluxsp = *(MHAlphaEnergyTime*)parlist.FindObject("FluxSrcTime"); 213 MHAlphaEnergyTime &fluxasp = *(MHAlphaEnergyTime*)parlist.FindObject("FluxASrcTime"); 214 MHAlphaEnergyTheta &fluxsptheta = *(MHAlphaEnergyTheta*)parlist.FindObject("FluxSrcTheta"); 215 MHAlphaEnergyTheta &fluxasptheta = *(MHAlphaEnergyTheta*)parlist.FindObject("FluxASrcTheta"); 216 217 /* 218 fluxsp.DrawClone(); 219 fluxasp.DrawClone(); 220 fluxsptheta.DrawClone(); 221 fluxasptheta.DrawClone(); 222 */ 223 224 MHAlphaEnergyTime resulttime; 225 MHAlphaEnergyTheta resulttheta; 226 resulttime.Substract(&fluxsp, &fluxasp); 227 resulttheta.Substract(&fluxsptheta, &fluxasptheta); 228 229 /* 230 resulttime.DrawClone(); 231 resulttheta.DrawClone(); 232 */ 233 234 TH2D &projecttime = *resulttime.GetAlphaProjection(-10, 10); 235 TH2D &projecttheta = *resulttheta.GetAlphaProjection(-10, 10); 236 237 projecttime.SetTitle("Number of Gammas vs. EnergyEst and Time (Alpha integrated between -10, 10deg)"); 238 projecttheta.SetTitle("Number of Gammas vs. EnergyEst and Theta (Alpha integrated between -10, 10deg)"); 239 240 /* 241 TCanvas *c = new TCanvas("Unfold", "To be unfolded", 350, 500); 242 c->Divide(1, 2); 243 c->cd(1); 244 projecttime.DrawCopy(); 245 c->cd(2); 246 projecttheta.DrawCopy(); 247 */ 248 249 return; 250 251 for (int i=1; i<=binstime.GetNumBins(); i++) 252 { 253 if (ontime.GetHist()->GetBinContent(i)==0) 254 continue; 255 256 TH1D &hist = *projecttime.ProjectionX("Number of Gammas vs. EnergyEst for a fixed time", i, i); 257 258 /* UNFOLDING */ 259 260 //hist->Divide(collareatime); 261 hist.Scale(1./ontime.GetHist()->GetBinContent(i)); 262 263 for (int j=1; j<=binse.GetNumBins(); j++) 264 hist.SetBinContent(j, hist.GetBinContent(j)/hist.GetBinWidth(j)); 265 266 hist.SetName("Flux"); 267 hist.SetTitle("Flux[Gammas/s/m^2/GeV] vs. EnergyTrue for a fixed Time"); 268 269 char n[100]; 270 sprintf(n, "Canv%d", j); 271 c= new TCanvas(n, "Title"); 272 hist.DrawCopy(); 273 } 274 275 delete &projecttime; 276 delete &projecttheta; 277 278 return; 279 280 // ------------------------------------------ 281 282 MHMcCollectionArea carea; 283 TH1D *collareatime = carea.GetHist(); // FIXME! 284 TH1D *collareatheta = carea.GetHist(); // FIXME! 273 285 } -
trunk/MagicSoft/Mars/mhist/MBinning.h
r1205 r1215 20 20 void SetEdges(const TArrayD &arr) 21 21 { 22 fEdges = arr;/* 22 23 const Int_t nbins = arr.GetSize(); 23 24 fEdges.Set(nbins); 24 for (int i=0; i< =nbins; i++)25 fEdges[i] = (*(TArrayD*)(&arr))[i]; 25 for (int i=0; i<nbins; i++) 26 fEdges[i] = (*(TArrayD*)(&arr))[i];*/ 26 27 } 27 28 -
trunk/MagicSoft/Mars/mhist/MH.cc
r1211 r1215 197 197 void MH::SetBinning(TH1 *h, const TAxis *binsx) 198 198 { 199 MBinning bx; 200 bx.SetEdges(*((TAxis*)binsx)->GetXbins()); // FIXME: Root! 199 const Int_t nx = binsx->GetNbins(); 200 201 TArrayD bx(nx+1); 202 for (int i=0; i<nx; i++) bx[i] = binsx->GetBinLowEdge(i+1); 203 bx[nx] = binsx->GetXmax(); 204 201 205 SetBinning(h, &bx); 202 206 } … … 204 208 void MH::SetBinning(TH1 *h, const TAxis *binsx, const TAxis *binsy) 205 209 { 206 MBinning bx; 207 MBinning by; 208 bx.SetEdges(*((TAxis*)binsx)->GetXbins()); // FIXME: Root! 209 by.SetEdges(*((TAxis*)binsy)->GetXbins()); // FIXME: Root! 210 const Int_t nx = binsx->GetNbins(); 211 const Int_t ny = binsy->GetNbins(); 212 213 TArrayD bx(nx+1); 214 TArrayD by(ny+1); 215 for (int i=0; i<nx; i++) bx[i] = binsx->GetBinLowEdge(i+1); 216 for (int i=0; i<ny; i++) by[i] = binsy->GetBinLowEdge(i+1); 217 bx[nx] = binsx->GetXmax(); 218 by[ny] = binsy->GetXmax(); 219 210 220 SetBinning(h, &bx, &by); 211 221 } … … 213 223 void MH::SetBinning(TH1 *h, const TAxis *binsx, const TAxis *binsy, const TAxis *binsz) 214 224 { 215 MBinning bx; 216 MBinning by; 217 MBinning bz; 218 bx.SetEdges(*((TAxis*)binsx)->GetXbins()); // FIXME: Root! 219 by.SetEdges(*((TAxis*)binsy)->GetXbins()); // FIXME: Root! 220 bz.SetEdges(*((TAxis*)binsz)->GetXbins()); // FIXME: Root! 225 const Int_t nx = binsx->GetNbins(); 226 const Int_t ny = binsy->GetNbins(); 227 const Int_t nz = binsz->GetNbins(); 228 229 TArrayD bx(nx+1); 230 TArrayD by(ny+1); 231 TArrayD bz(nz+1); 232 for (int i=0; i<nx; i++) bx[i] = binsx->GetBinLowEdge(i+1); 233 for (int i=0; i<ny; i++) by[i] = binsy->GetBinLowEdge(i+1); 234 for (int i=0; i<nz; i++) bz[i] = binsz->GetBinLowEdge(i+1); 235 bx[nx] = binsx->GetXmax(); 236 by[ny] = binsy->GetXmax(); 237 bz[nz] = binsz->GetXmax(); 238 221 239 SetBinning(h, &bx, &by, &bz); 222 240 } -
trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.cc
r1211 r1215 102 102 103 103 fHist.Fill(hil.GetAlpha(), fEnergy->GetEnergy(), fMcEvt->GetTheta()*kRad2Deg); 104 104 105 return kTRUE; 105 106 } … … 108 109 { 109 110 if (!gPad) 110 MakeDefCanvas("AlphaEnergyTheta", "Distrib of \\alpha, E, \\Theta");111 MakeDefCanvas("AlphaEnergyTheta", "Distrib of alpha, E, Theta"); 111 112 112 113 gPad->Divide(2,2); 113 114 115 TH1 *h; 116 114 117 gPad->cd(1); 115 fHist.Project3D("x")->Draw(opt); 118 h = fHist.Project3D("x"); 119 h->Draw(opt); 120 h->SetBit(kCanDelete); 116 121 117 122 gPad->cd(2); 118 fHist.Project3D("y")->Draw(opt); 123 h = fHist.Project3D("y"); 124 h->Draw(opt); 125 h->SetBit(kCanDelete); 119 126 120 127 gPad->cd(3); 121 fHist.Project3D("z")->Draw(opt); 128 h = fHist.Project3D("z"); 129 h->Draw(opt); 130 h->SetBit(kCanDelete); 122 131 123 132 gPad->cd(4); … … 130 139 TObject *MHAlphaEnergyTheta::DrawClone(Option_t *opt) const 131 140 { 132 TCanvas *c = MakeDefCanvas(" DiffTimeTheta", "Distrib of \\Delta t, \\Theta");141 TCanvas *c = MakeDefCanvas("AlphaEnergyTheta", "Distrib of alpha, E, Theta"); 133 142 c->Divide(2, 2); 134 143 … … 138 147 // FIXME: ProjectionX,Y is not const within root 139 148 // 149 TH1 *h; 150 140 151 c->cd(1); 141 ((TH3*)(&fHist))->Project3D("x")->DrawCopy(opt); 152 h = ((TH3*)(&fHist))->Project3D("x"); 153 h->Draw(opt); 154 h->SetBit(kCanDelete); 142 155 143 156 c->cd(2); 144 ((TH3*)(&fHist))->Project3D("y")->DrawCopy(opt); 157 h = ((TH3*)(&fHist))->Project3D("y"); 158 h->Draw(opt); 159 h->SetBit(kCanDelete); 145 160 146 161 c->cd(3); 147 ((TH3*)(&fHist))->Project3D("z")->DrawCopy(opt); 162 h = ((TH3*)(&fHist))->Project3D("z"); 163 h->Draw(opt); 164 h->SetBit(kCanDelete); 148 165 149 166 c->cd(4); … … 158 175 void MHAlphaEnergyTheta::Substract(const TH3D *h1, const TH3D *h2) 159 176 { 160 MH::SetBinning(&fHist, h1);177 MH::SetBinning(&fHist, (TH1*)h1); 161 178 162 179 fHist.Sumw2(); -
trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.cc
r1211 r1215 113 113 { 114 114 if (!gPad) 115 MakeDefCanvas("AlphaEnergyTime", "Distrib of \\alpha, E, t");115 MakeDefCanvas("AlphaEnergyTime", "Distrib of alpha, E, t"); 116 116 117 117 gPad->Divide(2,2); 118 118 119 TH1 *h; 120 119 121 gPad->cd(1); 120 fHist.Project3D("x")->Draw(opt); 122 h = fHist.Project3D("x"); 123 h->Draw(opt); 124 h->SetBit(kCanDelete); 121 125 122 126 gPad->cd(2); 123 fHist.Project3D("y")->Draw(opt); 127 h = fHist.Project3D("y"); 128 h->Draw(opt); 129 h->SetBit(kCanDelete); 124 130 125 131 gPad->cd(3); 126 fHist.Project3D("z")->Draw(opt); 132 h = fHist.Project3D("z"); 133 h->Draw(opt); 134 h->SetBit(kCanDelete); 127 135 128 136 gPad->cd(4); … … 135 143 TObject *MHAlphaEnergyTime::DrawClone(Option_t *opt) const 136 144 { 137 TCanvas *c = MakeDefCanvas(" DiffTimeTheta", "Distrib of \\Delta t, t");145 TCanvas *c = MakeDefCanvas("AlphaEnergyTime", "Distrib of alpha, E, t"); 138 146 c->Divide(2, 2); 139 147 … … 143 151 // FIXME: ProjectionX,Y is not const within root 144 152 // 153 TH1 *h; 154 145 155 c->cd(1); 146 ((TH3D*)(&fHist))->Project3D("x")->DrawCopy(opt); 156 h = ((TH3D*)(&fHist))->Project3D("x"); 157 h->Draw(opt); 158 h->SetBit(kCanDelete); 147 159 148 160 c->cd(2); 149 ((TH3D*)(&fHist))->Project3D("y")->DrawCopy(opt); 161 h = ((TH3D*)(&fHist))->Project3D("y"); 162 h->Draw(opt); 163 h->SetBit(kCanDelete); 150 164 151 165 c->cd(3); 152 ((TH3D*)(&fHist))->Project3D("z")->DrawCopy(opt); 166 h = ((TH3D*)(&fHist))->Project3D("z"); 167 h->Draw(opt); 168 h->SetBit(kCanDelete); 153 169 154 170 c->cd(4); … … 163 179 void MHAlphaEnergyTime::Substract(const TH3D *h1, const TH3D *h2) 164 180 { 165 MH::SetBinning(&fHist, h1);181 MH::SetBinning(&fHist, (TH1*)h1); 166 182 167 183 fHist.Sumw2(); -
trunk/MagicSoft/Mars/mhist/MHEffOnTimeTheta.cc
r1213 r1215 81 81 //new TCanvas(txt, "Title"); 82 82 83 TH1D *h =hist->ProjectionX("dTime-Distribution for fixed Time", i, i);83 TH1D &h = *hist->ProjectionX("dTime-Distribution for fixed Time", i, i); 84 84 85 85 //hist->Draw(); 86 86 //gPad->SetLogy(); 87 87 88 Double_t Nmdel = h ->Integral("width");89 Double_t mean = h ->GetMean();88 Double_t Nmdel = h.Integral("width"); 89 Double_t mean = h.GetMean(); 90 90 91 91 TF1 func("Poisson", "[1] * [0] * exp(-[0] *x)", … … 101 101 func.SetParName(1, "Nmdel"); 102 102 103 h ->Fit("Poisson", "RN");103 h.Fit("Poisson", "RN"); 104 104 105 105 //func.SetRange(0, 0.1); // Range of Drawing … … 113 113 //cout << "t_eff = " << h->Integral()/lambda << " T(last)=" << time.GetTimeLo()*0.0001 << endl; 114 114 115 fHist.SetBinContent(i, h->Integral()/lambda); 115 fHist.SetBinContent(i, h.Integral()/lambda); 116 117 delete &h; 116 118 } 117 119 } … … 133 135 TObject *MHEffOnTimeTheta::DrawClone(Option_t *opt) const 134 136 { 135 TCanvas *c = MakeDefCanvas("EffOnTimeTheta", "t_ {eff} vs. \\Theta");137 TCanvas *c = MakeDefCanvas("EffOnTimeTheta", "t_eff vs. Theta"); 136 138 137 139 gROOT->SetSelectedPad(NULL); … … 148 150 { 149 151 if (!gPad) 150 MakeDefCanvas("EffOnTimeTheta", "t_ {eff} vs. \\Theta");152 MakeDefCanvas("EffOnTimeTheta", "t_eff vs. Theta"); 151 153 152 154 fHist.Draw(opt); -
trunk/MagicSoft/Mars/mhist/MHEffOnTimeTime.cc
r1213 r1215 26 26 ////////////////////////////////////////////////////////////////////////////// 27 27 // // 28 // MHEffOnTimeTime //28 // MHEffOnTimeTime // 29 29 // // 30 30 // // … … 63 63 64 64 fHist.SetName("EffOn"); 65 fHist.SetTitle("Effective On Time Vs. T heta");65 fHist.SetTitle("Effective On Time Vs. Time"); 66 66 67 67 … … 74 74 TObject *MHEffOnTimeTime::DrawClone(Option_t *opt) const 75 75 { 76 TCanvas *c = MakeDefCanvas("EffOnTimeTheta", "t_ {eff}vs. t");76 TCanvas *c = MakeDefCanvas("EffOnTimeTheta", "t_eff vs. t"); 77 77 78 78 gROOT->SetSelectedPad(NULL); … … 89 89 { 90 90 if (!gPad) 91 MakeDefCanvas("EffOnTimeTheta", "t_ {eff}vs. t");91 MakeDefCanvas("EffOnTimeTheta", "t_eff vs. t"); 92 92 93 93 fHist.Draw(opt); … … 108 108 //new TCanvas(txt, "Title"); 109 109 110 TH1D *h =hist->ProjectionX("dTime-Distribution for fixed Theta", i, i);110 TH1D &h = *hist->ProjectionX("dTime-Distribution for fixed Theta", i, i); 111 111 112 112 //hist->Draw(); 113 113 //gPad->SetLogy(); 114 114 115 Double_t Nmdel = h ->Integral("width");116 Double_t mean = h ->GetMean();115 Double_t Nmdel = h.Integral("width"); 116 Double_t mean = h.GetMean(); 117 117 118 118 TF1 func("Poisson", "[1] * [0] * exp(-[0] *x)", … … 128 128 func.SetParName(1, "Nmdel"); 129 129 130 h ->Fit("Poisson", "RN");130 h.Fit("Poisson", "RN"); 131 131 132 132 //func.SetRange(0, 0.1); // Range of Drawing … … 140 140 //cout << "t_eff = " << h->Integral()/lambda << " T(last)=" << time.GetTimeLo()*0.0001 << endl; 141 141 142 fHist.SetBinContent(i, h->Integral()/lambda); 142 fHist.SetBinContent(i, h.Integral()/lambda); 143 144 delete &h; 143 145 } 144 146 } -
trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.cc
r1214 r1215 26 26 ////////////////////////////////////////////////////////////////////////////// 27 27 // // 28 // MHTimeDiffTheta //28 // MHTimeDiffTheta // 29 29 // // 30 30 // // … … 98 98 TObject *MHTimeDiffTheta::DrawClone(Option_t *opt) const 99 99 { 100 TCanvas *c = MakeDefCanvas("DiffTimeTheta", "Distrib \\Delta t, \\Theta");100 TCanvas *c = MakeDefCanvas("DiffTimeTheta", "Distrib of Delta t, Theta"); 101 101 c->Divide(2, 2); 102 102 … … 106 106 // FIXME: ProjectionX,Y is not const within root 107 107 // 108 TH1 *h; 109 108 110 c->cd(1); 109 ((TH2*)&fHist)->ProjectionX("ProX", -1, 9999, "E")->DrawCopy(opt); 111 h = ((TH2*)&fHist)->ProjectionX("ProX", -1, 9999, "E"); 112 h->DrawCopy(opt); 113 delete h; 110 114 gPad->SetLogy(); 111 115 112 116 c->cd(2); 113 ((TH2*)&fHist)->ProjectionY("ProY", -1, 9999, "E")->DrawCopy(opt); 117 h = ((TH2*)&fHist)->ProjectionY("ProY", -1, 9999, "E"); 118 h->DrawCopy(opt); 119 delete h; 114 120 115 121 c->cd(3); … … 125 131 { 126 132 if (!gPad) 127 MakeDefCanvas("DiffTimeTheta", "Distrib \\Delta t, \\Theta");133 MakeDefCanvas("DiffTimeTheta", "Distrib of Delta t, Theta"); 128 134 129 135 TH1 *h; -
trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc
r1214 r1215 26 26 ////////////////////////////////////////////////////////////////////////////// 27 27 // // 28 // MHTimeDiffTime //28 // MHTimeDiffTime // 29 29 // // 30 30 // // … … 98 98 // FIXME: ProjectionX,Y is not const within root 99 99 // 100 TH1 *h; 101 100 102 c->cd(1); 101 ((TH2*)&fHist)->ProjectionX("ProX", -1, 9999, "E")->DrawCopy(opt); 103 h = ((TH2*)&fHist)->ProjectionX("ProX", -1, 9999, "E"); 104 h->Draw(opt); 105 h->SetBit(kCanDelete); 102 106 gPad->SetLogy(); 103 107 104 108 c->cd(2); 105 ((TH2*)&fHist)->ProjectionY("ProY", -1, 9999, "E")->DrawCopy(opt); 109 h = ((TH2*)&fHist)->ProjectionY("ProY", -1, 9999, "E"); 110 h->Draw(opt); 111 h->SetBit(kCanDelete); 106 112 107 113 c->cd(3); … … 121 127 gPad->Divide(2,2); 122 128 129 TH1 *h; 130 123 131 gPad->cd(1); 124 fHist.ProjectionX("ProX", -1, 9999, "E")->DrawCopy(opt); 132 h = fHist.ProjectionX("ProX", -1, 9999, "E"); 133 h->Draw(opt); 134 h->SetBit(kCanDelete); 125 135 gPad->SetLogy(); 126 136 127 137 gPad->cd(2); 128 fHist.ProjectionY("ProY", -1, 9999, "E")->DrawCopy(opt); 138 h = fHist.ProjectionY("ProY", -1, 9999, "E"); 139 h->Draw(opt); 140 h->SetBit(kCanDelete); 129 141 130 142 gPad->cd(3);
Note:
See TracChangeset
for help on using the changeset viewer.