Changeset 1265 for trunk/MagicSoft/Mars/mhist/MH.cc
- Timestamp:
- 03/21/02 16:25:12 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MH.cc
r1215 r1265 117 117 { 118 118 // 119 // Another strange behaviour: TAxis::Set deletes the axis title! 120 // 121 TAxis &x = *h->GetXaxis(); 122 123 TString xtitle = x.GetTitle(); 124 125 // 119 126 // This is a necessary workaround if one wants to set 120 127 // non-equidistant bins after the initialization … … 127 134 // in one of the two given histograms 128 135 // 129 h->GetXaxis()->Set(binsx->GetNumBins(), binsx->GetEdges()); 136 x.Set(binsx->GetNumBins(), binsx->GetEdges()); 137 x.SetTitle(xtitle); 130 138 } 131 139 132 140 void MH::SetBinning(TH1 *h, const MBinning *binsx, const MBinning *binsy) 133 141 { 142 TAxis &x = *h->GetXaxis(); 143 TAxis &y = *h->GetYaxis(); 144 145 // 146 // Another strange behaviour: TAxis::Set deletes the axis title! 147 // 148 TString xtitle = x.GetTitle(); 149 TString ytitle = y.GetTitle(); 150 134 151 // 135 152 // This is a necessary workaround if one wants to set … … 144 161 // in one of the two given histograms 145 162 // 146 h->GetXaxis()->Set(binsx->GetNumBins(), binsx->GetEdges()); 147 h->GetYaxis()->Set(binsy->GetNumBins(), binsy->GetEdges()); 163 x.Set(binsx->GetNumBins(), binsx->GetEdges()); 164 y.Set(binsy->GetNumBins(), binsy->GetEdges()); 165 x.SetTitle(xtitle); 166 y.SetTitle(ytitle); 148 167 } 149 168 150 169 void MH::SetBinning(TH1 *h, const MBinning *binsx, const MBinning *binsy, const MBinning *binsz) 151 170 { 171 // 172 // Another strange behaviour: TAxis::Set deletes the axis title! 173 // 174 TAxis &x = *h->GetXaxis(); 175 TAxis &y = *h->GetYaxis(); 176 TAxis &z = *h->GetZaxis(); 177 178 TString xtitle = x.GetTitle(); 179 TString ytitle = y.GetTitle(); 180 TString ztitle = z.GetTitle(); 181 152 182 // 153 183 // This is a necessary workaround if one wants to set … … 163 193 // in one of the two given histograms 164 194 // 165 h->GetXaxis()->Set(binsx->GetNumBins(), binsx->GetEdges()); 166 h->GetYaxis()->Set(binsy->GetNumBins(), binsy->GetEdges()); 167 h->GetZaxis()->Set(binsz->GetNumBins(), binsz->GetEdges()); 195 x.Set(binsx->GetNumBins(), binsx->GetEdges()); 196 y.Set(binsy->GetNumBins(), binsy->GetEdges()); 197 z.Set(binsz->GetNumBins(), binsz->GetEdges()); 198 x.SetTitle(xtitle); 199 y.SetTitle(ytitle); 200 z.SetTitle(ztitle); 168 201 } 169 202
Note:
See TracChangeset
for help on using the changeset viewer.