ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/SchieferD/jetcalib/mcresponse_x.cpp
(Generate patch)

Comparing UserCode/SchieferD/jetcalib/mcresponse_x.cpp (file contents):
Revision 1.6 by schiefer, Fri Aug 31 13:56:04 2007 UTC vs.
Revision 1.7 by schiefer, Sat Sep 1 12:16:09 2007 UTC

# Line 30 | Line 30 | using namespace std;
30  
31  
32   ////////////////////////////////////////////////////////////////////////////////
33 // defaults
34 ////////////////////////////////////////////////////////////////////////////////
35 string dflt_etbins ="8,12,15,20,25,30,45,65,90,120,180";
36 string dflt_etabins=".2,.4,.6,.8,1.,1.2,1.4,1.6,1.8,2.,2.3,2.5,2.7,3.0,3.3";
37 string dflt_phibins="-2.75,-2.25,-1.75.,-1.25,-.75,-.25,.25,.75,1.25,1.75,2.25,2.75";
38 string dflt_emfbins="0.2,0.4,0.6,0.8";
39
40
41 ////////////////////////////////////////////////////////////////////////////////
33   // declare global functions
34   ////////////////////////////////////////////////////////////////////////////////
35   void     replaceHistos(int nbins,
# Line 77 | Line 68 | int main(int argc,char**argv)
68    short          applyjes  = cl.get_value<short>  ("applyjes",          0);
69    string         treename  = cl.get_value<string> ("treename",        "t");
70    float          nsigma    = cl.get_value<float>  ("nsigma",          3.0);
71 <  vector<float>  etbins    = cl.get_vector<float> ("etbins",  dflt_etbins);
72 <  vector<float>  etabins   = cl.get_vector<float> ("etabins",dflt_etabins);
73 <  vector<float>  phibins   = cl.get_vector<float> ("phibins",dflt_phibins);
74 <  vector<float>  emfbins   = cl.get_vector<float> ("emfbins",dflt_emfbins);
71 >  vector<float>  etbins    = cl.get_vector<float> ("etbins",           "");
72 >  vector<float>  etabins   = cl.get_vector<float> ("etabins",          "");
73 >  vector<float>  phibins   = cl.get_vector<float> ("phibins",          "");
74 >  vector<float>  emfbins   = cl.get_vector<float> ("emfbins",          "");
75    bool           abseta    = cl.get_value<bool>   ("abseta",         true);
76    
77    if (!cl.check()) return 0;
78    cl.print();
79    
80 <
80 >  int netbins  = (etbins.size() >0) ? etbins.size() +1 : 0;
81 >  int netabins = (etabins.size()>0) ? etabins.size()+1 : 0;
82 >  int nphibins = (phibins.size()>0) ? phibins.size()+1 : 0;
83 >  int nemfbins = (emfbins.size()>0) ? emfbins.size()+1 : 0;
84 >  
85 >  if (netbins+netabins+nphibins+nemfbins==0) {
86 >    cout<<"Must specify bins: etbins, etabins, phibins, AND/OR emfbins!"<<endl;
87 >    return 0;
88 >  }
89 >  
90    // etabins
91 <  if (!abseta) {
91 >  if (netabins>0&&!abseta) {
92      int neta=(int)etabins.size();
93      std::reverse(etabins.begin(),etabins.end());
94      for (int ieta=neta-1;ieta>=0;ieta--) etabins.push_back(etabins[ieta]);
# Line 117 | Line 117 | int main(int argc,char**argv)
117    float jtgendr[100];
118    float jtjes[100][3];
119    
120  int netbins  = etbins.size()+1;
121  int netabins = etabins.size()+1;
122  int nphibins = phibins.size()+1;
123  int nemfbins = emfbins.size()+1;
124  
120    argc=3; argv[1]="-l"; argv[2]="-b";
121    TRint* app = new TRint(argv[0],&argc,argv); app->Argc();
122    
# Line 155 | Line 150 | int main(int argc,char**argv)
150      string absrsp_xtitle = "E_{T}^{gen}-E_{T} [GeV]";
151      string relrsp_xtitle = "E_{T}^{rec}/E_{T}";
152  
158    TH1F** hGenEt       = hist::initHistos("GenEt",jetalgs[i],100,
159                                           "jet E_{T}^{gen} [GeV]","GenEt",etbins);
160    TH1F** hEtCorrGenEt = hist::initHistos("EtCorrGenEt",jetalgs[i],100,
161                                           "jet E_{T}^{gen} [GeV]","GenEt",etbins);
162    TH1F** hAbsRspGenEt = hist::initHistos("AbsRspGenEt",jetalgs[i],100,-50,150,
163                                           absrsp_xtitle,"GenEt",etbins);
164    TH1F** hRelRspGenEt = hist::initHistos("RelRspGenEt",jetalgs[i],100,0,2,
165                                           relrsp_xtitle,"GenEt",etbins);
166    
167    TH1F** hEt       = hist::initHistos("Et",jetalgs[i],100,
168                                        "jet E_{T} [GeV]","Et",etbins);
169    TH1F** hEtCorrEt = hist::initHistos("EtCorrEt",jetalgs[i],100,
170                                        "jet E_{T} [GeV]","Et",etbins);
171    TH1F** hAbsRspEt = hist::initHistos("AbsRspEt",jetalgs[i],100,-50,150,
172                                        absrsp_xtitle,"Et",etbins);
173    TH1F** hRelRspEt = hist::initHistos("RelRspEt",jetalgs[i],100,0,2,
174                                        relrsp_xtitle,"Et",etbins);
175    
176    TH1F** hEta       = hist::initHistos("Eta",jetalgs[i],100,
177                                         "jet #eta","Eta",etabins);
178    TH1F** hEtCorrEta = hist::initHistos("EtCorrEta",jetalgs[i],100,
179                                         "jet E_{T} [GeV]","Eta",etabins);
180    TH1F** hAbsRspEta = hist::initHistos("AbsRspEta",jetalgs[i],100,-50,150,
181                                         absrsp_xtitle,"Eta",etabins);
182    TH1F** hRelRspEta = hist::initHistos("RelRspEta",jetalgs[i],100,0,2,
183                                         relrsp_xtitle,"Eta",etabins);
184    
185    TH1F** hPhi       = hist::initHistos("Phi",jetalgs[i],100,
186                                         "jet #phi","Phi",phibins);
187    TH1F** hEtCorrPhi = hist::initHistos("EtCorrPhi",jetalgs[i],100,
188                                         "jet E_{T} [Gev]","Phi",phibins);
189    TH1F** hAbsRspPhi = hist::initHistos("AbsRspPhi",jetalgs[i],100,-50,150,
190                                         absrsp_xtitle,"Phi",phibins);
191    TH1F** hRelRspPhi = hist::initHistos("RelRspPhi",jetalgs[i],100,0,2,
192                                         relrsp_xtitle,"Phi",phibins);
193    
194    TH1F** hEmf       = hist::initHistos("Emf",jetalgs[i],100,
195                                         "jet emf","Emf",emfbins);
196    TH1F** hEtCorrEmf = hist::initHistos("EtCorrEmf",jetalgs[i],100,
197                                         "jet E_{T} [Gev]","Emf",emfbins);
198    TH1F** hAbsRspEmf = hist::initHistos("AbsRspEmf",jetalgs[i],100,-50,150,
199                                         absrsp_xtitle,"Emf",emfbins);
200    TH1F** hRelRspEmf = hist::initHistos("RelRspEmf",jetalgs[i],100,0,2,
201                                         relrsp_xtitle,"Emf",emfbins);
202    
203    TH1F*** hEtEtaEt     = hist::initHistos("Et",jetalgs[i],100,"jet E_{T} [GeV]",
204                                            "Eta",etabins,"Et",etbins);
205    TH1F*** hEtCorrEtaEt = hist::initHistos("EtCorrEtaEt",jetalgs[i],100,
206                                            "jet E_{T} [GeV]",
207                                            "Eta",etabins,"Et",etbins);
208    TH1F*** hAbsRspEtaEt = hist::initHistos("AbsRspEtaEt",jetalgs[i],100,-50,150,
209                                            absrsp_xtitle,
210                                            "Eta",etabins,"Et",etbins);
211    TH1F*** hRelRspEtaEt = hist::initHistos("RelRspEtaEt",jetalgs[i],100,0,2,
212                                            relrsp_xtitle,
213                                            "Eta",etabins,"Et",etbins);
214    
215    TH1F*** hEtEmfEt     = hist::initHistos("Et",jetalgs[i],100,"jet E_{T} [GeV]",
216                                            "Emf",emfbins,"Et",etbins);
217    TH1F*** hEtCorrEmfEt = hist::initHistos("EtCorrEmfEt",jetalgs[i],100,
218                                            "jet E_{T} [GeV]",
219                                            "Emf",emfbins,"Et",etbins);
220    TH1F*** hAbsRspEmfEt = hist::initHistos("AbsRspEmfEt",jetalgs[i],100,-50,150,
221                                            absrsp_xtitle,
222                                            "Emf",emfbins,"Et",etbins);
223    TH1F*** hRelRspEmfEt = hist::initHistos("RelRspEmfEt",jetalgs[i],100,0,2,
224                                            relrsp_xtitle,
225                                            "Emf",emfbins,"Et",etbins);
226    
227    TH1F**** hEtEmfEtaEt     = hist::initHistos("Et",jetalgs[i],100,"jet E_{T} [GeV]",
228                                                "Emf",emfbins,
229                                                "Eta",etabins,
230                                                "Et", etbins);
231    TH1F**** hEtCorrEmfEtaEt = hist::initHistos("EtCorrEmfEtaEt",jetalgs[i],100,
232                                                "jet E_{T} [GeV]",
233                                                "Emf",emfbins,
234                                                "Eta",etabins,
235                                                "Et", etbins);
236    TH1F**** hAbsRspEmfEtaEt = hist::initHistos("AbsRspEmfEtaEt",jetalgs[i],
237                                                100,-50,150,absrsp_xtitle,
238                                                "Emf",emfbins,
239                                                "Eta",etabins,
240                                                "Et", etbins);
241    TH1F**** hRelRspEmfEtaEt = hist::initHistos("RelRspEmfEtaEt",jetalgs[i],
242                                                100,0,2,relrsp_xtitle,
243                                                "Emf",emfbins,
244                                                "Eta",etabins,
245                                                "Et", etbins);
153      
154 +    TH1F** hGenEt(0);
155 +    TH1F** hEtCorrGenEt(0);
156 +    TH1F** hAbsRspGenEt(0);
157 +    TH1F** hRelRspGenEt(0);
158 +    
159 +    if (netbins>0) {
160 +      hGenEt       = hist::initHistos("GenEt",jetalgs[i],100,
161 +                                      "jet E_{T}^{gen} [GeV]",
162 +                                      "GenEt",etbins);
163 +      hEtCorrGenEt = hist::initHistos("EtCorrGenEt",jetalgs[i],100,
164 +                                      "jet E_{T}^{gen} [GeV]",
165 +                                      "GenEt",etbins);
166 +      hAbsRspGenEt = hist::initHistos("AbsRspGenEt",jetalgs[i],
167 +                                      100,-50,150,
168 +                                      absrsp_xtitle,
169 +                                      "GenEt",etbins);
170 +      hRelRspGenEt = hist::initHistos("RelRspGenEt",jetalgs[i],
171 +                                      100,0,2,
172 +                                      relrsp_xtitle,
173 +                                      "GenEt",etbins);
174 +    }
175 +    
176 +
177 +    TH1F** hEt(0);
178 +    TH1F** hEtCorrEt(0);
179 +    TH1F** hAbsRspEt(0);
180 +    TH1F** hRelRspEt(0);
181 +    
182 +    if (netbins>0) {
183 +      hEt       = hist::initHistos("Et",jetalgs[i],100,
184 +                                   "jet E_{T} [GeV]","Et",etbins);
185 +      hEtCorrEt = hist::initHistos("EtCorrEt",jetalgs[i],100,
186 +                                   "jet E_{T} [GeV]","Et",etbins);
187 +      hAbsRspEt = hist::initHistos("AbsRspEt",jetalgs[i],100,-50,150,
188 +                                   absrsp_xtitle,"Et",etbins);
189 +      hRelRspEt = hist::initHistos("RelRspEt",jetalgs[i],100,0,2,
190 +                                   relrsp_xtitle,"Et",etbins);
191 +    }
192 +    
193 +
194 +    TH1F** hEta(0);
195 +    TH1F** hEtCorrEta(0);
196 +    TH1F** hAbsRspEta(0);
197 +    TH1F** hRelRspEta(0);
198 +    
199 +    if (netabins>0) {
200 +      hEta       = hist::initHistos("Eta",jetalgs[i],100,
201 +                                    "jet #eta","Eta",etabins);
202 +      hEtCorrEta = hist::initHistos("EtCorrEta",jetalgs[i],100,
203 +                                    "jet E_{T} [GeV]","Eta",etabins);
204 +      hAbsRspEta = hist::initHistos("AbsRspEta",jetalgs[i],100,-50,150,
205 +                                    absrsp_xtitle,"Eta",etabins);
206 +      hRelRspEta = hist::initHistos("RelRspEta",jetalgs[i],100,0,2,
207 +                                    relrsp_xtitle,"Eta",etabins);
208 +    }
209 +    
210 +
211 +    TH1F** hPhi(0);
212 +    TH1F** hEtCorrPhi(0);
213 +    TH1F** hAbsRspPhi(0);
214 +    TH1F** hRelRspPhi(0);
215 +    
216 +    if (nphibins>0) {
217 +      hPhi       = hist::initHistos("Phi",jetalgs[i],100,
218 +                                    "jet #phi","Phi",phibins);
219 +      hEtCorrPhi = hist::initHistos("EtCorrPhi",jetalgs[i],100,
220 +                                    "jet E_{T} [Gev]","Phi",phibins);
221 +      hAbsRspPhi = hist::initHistos("AbsRspPhi",jetalgs[i],100,-50,150,
222 +                                    absrsp_xtitle,"Phi",phibins);
223 +      hRelRspPhi = hist::initHistos("RelRspPhi",jetalgs[i],100,0,2,
224 +                                    relrsp_xtitle,"Phi",phibins);
225 +    }
226 +    
227 +
228 +    TH1F** hEmf(0);
229 +    TH1F** hEtCorrEmf(0);
230 +    TH1F** hAbsRspEmf(0);
231 +    TH1F** hRelRspEmf(0);
232 +    
233 +    if (nemfbins>0) {
234 +      hEmf       = hist::initHistos("Emf",jetalgs[i],100,
235 +                                    "jet emf","Emf",emfbins);
236 +      hEtCorrEmf = hist::initHistos("EtCorrEmf",jetalgs[i],100,
237 +                                    "jet E_{T} [Gev]","Emf",emfbins);
238 +      hAbsRspEmf = hist::initHistos("AbsRspEmf",jetalgs[i],100,-50,150,
239 +                                    absrsp_xtitle,"Emf",emfbins);
240 +      hRelRspEmf = hist::initHistos("RelRspEmf",jetalgs[i],100,0,2,
241 +                                    relrsp_xtitle,"Emf",emfbins);
242 +    }
243 +    
244 +    
245 +    TH1F*** hEtEtaEt(0);
246 +    TH1F*** hEtCorrEtaEt(0);
247 +    TH1F*** hAbsRspEtaEt(0);
248 +    TH1F*** hRelRspEtaEt(0);
249 +    
250 +    if (netbins>0&&netabins>0) {
251 +      hEtEtaEt     = hist::initHistos("Et",jetalgs[i],100,"jet E_{T} [GeV]",
252 +                                      "Eta",etabins,"Et",etbins);
253 +      hEtCorrEtaEt = hist::initHistos("EtCorrEtaEt",jetalgs[i],100,
254 +                                      "jet E_{T} [GeV]",
255 +                                      "Eta",etabins,"Et",etbins);
256 +      hAbsRspEtaEt = hist::initHistos("AbsRspEtaEt",jetalgs[i],100,-50,150,
257 +                                      absrsp_xtitle,
258 +                                      "Eta",etabins,"Et",etbins);
259 +      hRelRspEtaEt = hist::initHistos("RelRspEtaEt",jetalgs[i],100,0,2,
260 +                                      relrsp_xtitle,
261 +                                      "Eta",etabins,"Et",etbins);
262 +    }
263 +
264 +
265 +    TH1F*** hEtEmfEt(0);
266 +    TH1F*** hEtCorrEmfEt(0);
267 +    TH1F*** hAbsRspEmfEt(0);
268 +    TH1F*** hRelRspEmfEt(0);
269 +    
270 +    if (netbins>0&&nemfbins>0) {
271 +      hEtEmfEt     = hist::initHistos("Et",jetalgs[i],100,"jet E_{T} [GeV]",
272 +                                      "Emf",emfbins,"Et",etbins);
273 +      hEtCorrEmfEt = hist::initHistos("EtCorrEmfEt",jetalgs[i],100,
274 +                                      "jet E_{T} [GeV]",
275 +                                      "Emf",emfbins,"Et",etbins);
276 +      hAbsRspEmfEt = hist::initHistos("AbsRspEmfEt",jetalgs[i],100,-50,150,
277 +                                      absrsp_xtitle,
278 +                                      "Emf",emfbins,"Et",etbins);
279 +      hRelRspEmfEt = hist::initHistos("RelRspEmfEt",jetalgs[i],100,0,2,
280 +                                      relrsp_xtitle,
281 +                                      "Emf",emfbins,"Et",etbins);
282 +    }
283 +    
284 +
285 +    TH1F**** hEtEmfEtaEt(0);
286 +    TH1F**** hEtCorrEmfEtaEt(0);
287 +    TH1F**** hAbsRspEmfEtaEt(0);
288 +    TH1F**** hRelRspEmfEtaEt(0);
289 +    
290 +    if (netbins>0&&netabins>0&&nemfbins>0) {
291 +      hEtEmfEtaEt     = hist::initHistos("Et",jetalgs[i],100,"jet E_{T} [GeV]",
292 +                                         "Emf",emfbins,
293 +                                         "Eta",etabins,
294 +                                         "Et", etbins);
295 +      hEtCorrEmfEtaEt = hist::initHistos("EtCorrEmfEtaEt",jetalgs[i],100,
296 +                                         "jet E_{T} [GeV]",
297 +                                         "Emf",emfbins,
298 +                                         "Eta",etabins,
299 +                                         "Et", etbins);
300 +      hAbsRspEmfEtaEt = hist::initHistos("AbsRspEmfEtaEt",jetalgs[i],
301 +                                         100,-50,150,absrsp_xtitle,
302 +                                         "Emf",emfbins,
303 +                                         "Eta",etabins,
304 +                                         "Et", etbins);
305 +      hRelRspEmfEtaEt = hist::initHistos("RelRspEmfEtaEt",jetalgs[i],
306 +                                         100,0,2,relrsp_xtitle,
307 +                                         "Emf",emfbins,
308 +                                         "Eta",etabins,
309 +                                         "Et", etbins);
310 +    }
311      
312      int nevts = el->GetN();
313      cout<<jetalgs[i]<<": "<<nevts<<" events selected."<<endl;
314      
315      // prepare intermediate trees
316      float genet,et,eta,phi,emf,etcorr,absrsp,relrsp;
317 <    TTree**   tGenEt      = new TTree*[netbins];
318 <    TTree**   tEt         = new TTree*[netbins];
319 <    TTree**   tEta        = new TTree*[netabins];
320 <    TTree**   tPhi        = new TTree*[nphibins];
321 <    TTree**   tEmf        = new TTree*[nemfbins];
322 <    TTree***  tEtEtaEt    = new TTree**[netabins];
323 <    TTree***  tEtEmfEt    = new TTree**[nemfbins];
324 <    TTree**** tEtEmfEtaEt = new TTree***[nemfbins];
317 >
318 >    TTree**   tGenEt(0);
319 >    TTree**   tEt(0);
320 >    TTree**   tEta(0);
321 >    TTree**   tPhi(0);
322 >    TTree**   tEmf(0);
323 >    TTree***  tEtEtaEt(0);
324 >    TTree***  tEtEmfEt(0);
325 >    TTree**** tEtEmfEtaEt(0);
326 >
327 >    if (netbins>0)  tGenEt = new TTree*[netbins];
328 >    if (netbins>0)  tEt    = new TTree*[netbins];
329 >    if (netabins>0) tEta   = new TTree*[netabins];
330 >    if (nphibins>0) tPhi   = new TTree*[nphibins];
331 >    if (nemfbins>0) tEmf   = new TTree*[nemfbins];
332 >    if (netbins>0&&netabins>0) tEtEtaEt = new TTree**[netabins];
333 >    if (netbins>0&&nemfbins>0) tEtEmfEt = new TTree**[nemfbins];
334 >    if (netbins>0&&netabins>0&&nemfbins>0) tEtEmfEtaEt = new TTree***[nemfbins];
335      
336      for (int iet=0;iet<netbins;iet++) {
337        
# Line 349 | Line 423 | int main(int argc,char**argv)
423          
424          if (jtgendr[ijt]<0.0||jtgendr[ijt]>drmax) continue;
425  
426 <        // if (ijt>0) continue;
427 <
426 >        //if (ijt>ijtmax) continue;
427 >        
428          et      = jtet[ijt];
429          genet   = jtgenet[ijt];
430          eta     = (abseta) ? std::abs(jteta[ijt]) : jteta[ijt];
# Line 364 | Line 438 | int main(int argc,char**argv)
438  
439          if (TMath::IsNaN(emf)) emf = 0.0;
440          
441 <        
442 <        // genet
443 <        int igenet = hist::get_ibin(genet,etbins);
444 <        tGenEt[igenet]->Fill();
445 <        
446 <        // et
447 <        int iet = hist::get_ibin(et,etbins);
448 <        tEt[iet]->Fill();
449 <        
450 <        // eta
451 <        int ieta = hist::get_ibin(eta,etabins);
452 <        tEta[ieta]->Fill();
453 <        
454 <        // phi
455 <        int iphi = hist::get_ibin(phi,phibins);
456 <        tPhi[iphi]->Fill();
457 <        
384 <        // emf
385 <        int iemf = hist::get_ibin(emf,emfbins);
386 <        tEmf[iemf]->Fill();
387 <        
388 <        // et-eta
389 <        tEtEtaEt[ieta][iet]->Fill();
390 <        
391 <        // et-emf
392 <        tEtEmfEt[iemf][iet]->Fill();
393 <        
394 <        // et-eta-emf
395 <        tEtEmfEtaEt[iemf][ieta][iet]->Fill();
441 >        int igenet = (netbins>0)  ? hist::get_ibin(genet,etbins) : -1;
442 >        int iet    = (netbins>0)  ? hist::get_ibin(et,etbins)    : -1;
443 >        int ieta   = (netabins>0) ? hist::get_ibin(eta,etabins)  : -1;
444 >        int iphi   = (nphibins>0) ? hist::get_ibin(phi,phibins)  : -1;
445 >        int iemf   = (nemfbins>0) ? hist::get_ibin(emf,emfbins)  : -1;
446 >        
447 >        if (netbins>0)  tGenEt[igenet]->Fill();
448 >        if (netbins>0)  tEt[iet]->Fill();
449 >        if (netabins>0) tEta[ieta]->Fill();
450 >        if (nphibins>0) tPhi[iphi]->Fill();
451 >        if (nemfbins>0) tEmf[iemf]->Fill();
452 >
453 >        if (netbins>0&&netabins>0) tEtEtaEt[ieta][iet]->Fill();
454 >        if (netbins>0&&nemfbins>0) tEtEmfEt[iemf][iet]->Fill();
455 >
456 >        if (netbins>0&&netabins>0&&nemfbins>0)
457 >          tEtEmfEtaEt[iemf][ieta][iet]->Fill();
458          
459        } // jets
460      } // evts
# Line 519 | Line 581 | void replaceHistos(int nbins,
581                     TH1F**& hVar,TH1F**& hEtCorr,TH1F**& hAbsRsp,TH1F**& hRelRsp,
582                     TTree**& tVar)
583   {
584 +  if (nbins==0) return;
585 +  
586    TH1::SetDefaultSumw2();
587    for (int ibin=0;ibin<nbins;ibin++) {
588      
# Line 570 | Line 634 | void replaceHistos(int nbins1,int nbins2
634                     TH1F***& hVar,TH1F***& hEtCorr,TH1F***& hAbsRsp,TH1F***& hRelRsp,
635                     TTree***& tVar)
636   {
637 +  if (nbins1==0) return;
638 +  
639    for (int i1=0;i1<nbins1;i1++)
640      replaceHistos(nbins2,hVar[i1],hEtCorr[i1],hAbsRsp[i1],hRelRsp[i1],tVar[i1]);
641    delete [] tVar;
# Line 581 | Line 647 | void replaceHistos(int nbins1,int nbins2
647                     TH1F****& hVar,TH1F****& hEtCorr,TH1F****&hAbsRsp,TH1F****&hRelRsp,
648                     TTree****& tVar)
649   {
650 +  if (nbins1==0) return;
651    for (int i1=0;i1<nbins1;i1++)
652      replaceHistos(nbins2,nbins3,
653                    hVar[i1],hEtCorr[i1],hAbsRsp[i1],hRelRsp[i1],tVar[i1]);
# Line 623 | Line 690 | void fitHistos(TH1F**** histos,int n1,in
690   //______________________________________________________________________________
691   void saveHistos(TH1F**& histos,int n)
692   {
693 +  if (n==0) return;
694    for (int i=0;i<n;i++) {
695      histos[i]->Write();
696      delete histos[i];
# Line 634 | Line 702 | void saveHistos(TH1F**& histos,int n)
702   //______________________________________________________________________________
703   void saveHistos(TH1F***& histos,int n1,int n2)
704   {
705 +  if (n1==0) return;
706    for (int i1=0;i1<n1;i1++) saveHistos(histos[i1],n2);
707    delete [] histos;
708   }
# Line 642 | Line 711 | void saveHistos(TH1F***& histos,int n1,i
711   //______________________________________________________________________________
712   void saveHistos(TH1F****& histos,int n1,int n2,int n3)
713   {
714 +  if (n1==0) return;
715    for (int i1=0;i1<n1;i1++) saveHistos(histos[i1],n2,n3);
716    delete [] histos;
717   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines