Changeset 1966 for trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc
- Timestamp:
- 04/20/03 12:51:47 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc
r1668 r1966 95 95 // -------------------------------------------------------------------------- 96 96 // 97 // Draw a copy of the histogram98 //99 TObject *MHTimeDiffTime::DrawClone(Option_t *opt) const100 {101 102 TCanvas &c = *MakeDefCanvas("DiffTimeTime", "Distrib of dt and t");103 104 c.Divide(2, 2);105 106 gROOT->SetSelectedPad(NULL);107 108 TH1D *h;109 110 c.cd(1);111 h = ((TH2*)&fHist)->ProjectionX("ProjX-sumtime", -1, 9999, "E");112 113 h->SetTitle("Distribution of \\Delta t [s]");114 h->SetXTitle("\\Delta t [s]");115 h->SetYTitle("Counts");116 117 h->Draw(opt);118 h->SetBit(kCanDelete);119 gPad->SetLogy();120 121 c.cd(2);122 h = ((TH2*)&fHist)->ProjectionY("ProjY-sumtimediff", -1, 9999, "E");123 124 h->SetTitle("Distribution of time [s]");125 h->SetXTitle("time [s]");126 h->SetYTitle("Counts");127 128 h->Draw(opt);129 h->SetBit(kCanDelete);130 131 c.cd(3);132 ((TH2*)&fHist)->DrawCopy(opt);133 134 c.Modified();135 c.Update();136 137 return &c;138 }139 140 // --------------------------------------------------------------------------141 //142 97 // Draw the histogram 143 98 // 144 99 void MHTimeDiffTime::Draw(Option_t *opt) 145 100 { 146 if (!gPad)147 MakeDefCanvas("DiffTimeTime", "Distrib of \\Delta t, time");101 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); 102 pad->SetBorderMode(0); 148 103 149 gPad->Divide(2,2); 104 AppendPad(""); 105 106 pad->Divide(2,2); 150 107 151 108 TH1D *h; 152 109 153 gPad->cd(1); 110 pad->cd(1); 111 gPad->SetLogy(); 154 112 h = fHist.ProjectionX("ProjX_sumtime", -1, 9999, "E"); 155 156 113 h->SetTitle("Distribution of \\Delta t [s]"); 157 114 h->SetXTitle("\\Delta t [s]"); 158 115 h->SetYTitle("Counts"); 159 160 116 h->Draw(opt); 161 117 h->SetBit(kCanDelete); 162 gPad->SetLogy();163 118 164 gPad->cd(2);119 pad->cd(2); 165 120 h = fHist.ProjectionY("ProjY_sumtimediff", -1, 9999, "E"); 166 167 121 h->SetTitle("Distribution of time [s]"); 168 122 h->SetXTitle("time [s]"); 169 123 h->SetYTitle("Counts"); 170 171 124 h->Draw(opt); 172 125 h->SetBit(kCanDelete); 173 126 174 gPad->cd(3);127 pad->cd(3); 175 128 fHist.DrawCopy(opt); 176 129 177 gPad->Modified(); 178 gPad->Update(); 179 130 pad->Modified(); 131 pad->Update(); 180 132 } 181 133
Note:
See TracChangeset
for help on using the changeset viewer.