Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:32:24

0001 #include "TFile.h"
0002 #include "TTree.h"
0003 #include "TText.h"
0004 
0005 void EcalDigisPlotCompare( TString currentfile = "EcalDigisValidation_new.root",
0006                            TString referencefile = "EcalDigisValidation_old.root" )
0007 {
0008 
0009  gROOT ->Reset();
0010  char*  rfilename = referencefile ;
0011  char*  sfilename = currentfile ;
0012 
0013  int rcolor = 2;
0014  int scolor = 4;
0015 
0016  delete gROOT->GetListOfFiles()->FindObject(rfilename);
0017  delete gROOT->GetListOfFiles()->FindObject(sfilename);
0018 
0019  TText* te = new TText();
0020  te->SetTextSize(0.1);
0021  TFile * rfile = new TFile(rfilename);
0022  TFile * sfile = new TFile(sfilename);
0023 
0024  rfile->cd("DQMData/EcalDigisV/EcalDigiTask");
0025  gDirectory->ls();
0026 
0027  sfile->cd("DQMData/EcalDigisV/EcalDigiTask");
0028  gDirectory->ls();
0029 
0030  Char_t histo[200];
0031 
0032  gStyle->SetOptStat("n");
0033 
0034  gROOT->ProcessLine(".x HistoCompare.C");
0035  HistoCompare * myPV = new HistoCompare();
0036 
0037 //////////////////////////////////////////////////////////////
0038 
0039 // Particle Gun
0040  
0041  if (1) {
0042    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0043    Ecal->Divide(1,3);
0044    
0045    TH1* meGunEnergy_;
0046    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Gun Momentum;1",meGunEnergy_);
0047    meGunEnergy_;
0048    meGunEnergy_->SetLineColor(rcolor);
0049    
0050    TH1* meGunEta_;
0051    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Gun Eta;1",meGunEta_);
0052    meGunEta_;
0053    meGunEta_->SetLineColor(rcolor);
0054    
0055    TH1* meGunPhi_; 
0056    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Gun Phi;1",meGunPhi_);
0057    meGunPhi_; 
0058    meGunPhi_->SetLineColor(rcolor); 
0059    
0060    TH1* newmeGunEnergy_;
0061    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Gun Momentum;1",newmeGunEnergy_);
0062    newmeGunEnergy_;
0063    newmeGunEnergy_->SetLineColor(scolor);
0064    
0065    TH1* newmeGunEta_;
0066    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Gun Eta;1",newmeGunEta_);
0067    newmeGunEta_;
0068    newmeGunEta_->SetLineColor(scolor);
0069    
0070    TH1* newmeGunPhi_; 
0071    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Gun Phi;1",newmeGunPhi_);
0072    newmeGunPhi_; 
0073    newmeGunPhi_->SetLineColor(scolor); 
0074    
0075    
0076    Ecal->cd(1); 
0077    if ( meGunEnergy_ && newmeGunEnergy_ ) {
0078      meGunEnergy_->Draw(); 
0079      newmeGunEnergy_->Draw("same"); 
0080      myPV->PVCompute( meGunEnergy_ , newmeGunEnergy_ , te );
0081    }
0082    Ecal->cd(2); 
0083    if ( meGunEta_ && newmeGunEta_ ) {
0084      meGunEta_->Draw(); 
0085      newmeGunEta_->Draw("same"); 
0086      myPV->PVCompute( meGunEta_ , newmeGunEta_ , te );
0087    }
0088    Ecal->cd(3); 
0089    if ( meGunPhi_ && newmeGunPhi_ ) {
0090      meGunPhi_->Draw(); 
0091      newmeGunPhi_->Draw("same"); 
0092      myPV->PVCompute( meGunPhi_ , newmeGunPhi_ , te );
0093    }
0094    Ecal->Print("ParticleGun_compare.eps"); 
0095  }
0096 
0097  // Barrel occupancy
0098 
0099  if (1) {
0100    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0101    Ecal->Divide(1,2);
0102 
0103    TH2 * meEBDigiOccupancy_;
0104    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel occupancy;1",meEBDigiOccupancy_);
0105    meEBDigiOccupancy_;
0106    meEBDigiOccupancy_->SetLineColor(rcolor);
0107 
0108    TH2 * newmeEBDigiOccupancy_;
0109    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel occupancy;1",newmeEBDigiOccupancy_);
0110    newmeEBDigiOccupancy_;
0111    newmeEBDigiOccupancy_->SetLineColor(scolor);
0112 
0113    if ( meEBDigiOccupancy_ && newmeEBDigiOccupancy_ ) {
0114      Ecal->cd(1);
0115      meEBDigiOccupancy_->Draw("colz");
0116      Ecal->cd(2);
0117      newmeEBDigiOccupancy_->Draw("colz");
0118      myPV->PVCompute(meEBDigiOccupancy_ , newmeEBDigiOccupancy_ , te);
0119    }
0120    Ecal->Print("Barrel_Occupancy_compare.eps");
0121  }
0122 
0123 
0124  // Endcap occupancy
0125 
0126  if (1) {
0127    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0128    Ecal->Divide(2,2);
0129 
0130    TH2 * meEEDigiOccupancyzp_;
0131    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap occupancy z+;1",meEEDigiOccupancyzp_);
0132    meEEDigiOccupancyzp_;
0133    meEEDigiOccupancyzp_->SetLineColor(rcolor);
0134 
0135    TH2 * meEEDigiOccupancyzm_;
0136    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap occupancy z-;1",meEEDigiOccupancyzm_);
0137    meEEDigiOccupancyzm_;
0138    meEEDigiOccupancyzm_->SetLineColor(rcolor);
0139 
0140    TH2 * newmeEEDigiOccupancyzp_;
0141    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap occupancy z+;1",newmeEEDigiOccupancyzp_);
0142    newmeEEDigiOccupancyzp_;
0143    newmeEEDigiOccupancyzp_->SetLineColor(scolor);
0144 
0145    TH2 * newmeEEDigiOccupancyzm_;
0146    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap occupancy z-;1",newmeEEDigiOccupancyzm_);
0147    newmeEEDigiOccupancyzm_;
0148    newmeEEDigiOccupancyzm_->SetLineColor(scolor);
0149 
0150    if ( meEEDigiOccupancyzp_ && newmeEEDigiOccupancyzp_ && meEEDigiOccupancyzm_ && newmeEEDigiOccupancyzm_ ) {
0151      Ecal->cd(1);
0152      meEEDigiOccupancyzp_->Draw("colz");
0153      Ecal->cd(3);
0154      newmeEEDigiOccupancyzp_->Draw("colz");
0155      myPV->PVCompute(meEEDigiOccupancyzp_ , newmeEEDigiOccupancyzp_ , te);
0156      Ecal->cd(2);
0157      meEEDigiOccupancyzm_->Draw("colz");
0158      Ecal->cd(4);
0159      newmeEEDigiOccupancyzm_->Draw("colz");
0160      myPV->PVCompute(meEEDigiOccupancyzm_ , newmeEEDigiOccupancyzm_ , te);
0161    }
0162    Ecal->Print("Endcap_Occupancy_compare.eps");
0163  }
0164 
0165  // Multiplicities
0166 
0167  if (1) {
0168    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0169    Ecal->Divide(2,2);
0170 
0171    TH1 * meEBDigiMultiplicity_;
0172    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel digis multiplicity;1",meEBDigiMultiplicity_);
0173    meEBDigiMultiplicity_;
0174    meEBDigiMultiplicity_->SetLineColor(rcolor);
0175 
0176    TH1 * meESDigiMultiplicity_;
0177    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Preshower digis multiplicity;1",meESDigiMultiplicity_);
0178    meESDigiMultiplicity_;
0179    meESDigiMultiplicity_->SetLineColor(rcolor);
0180 
0181    TH1 * meEEDigiMultiplicityzp_;
0182    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap multiplicity z+;1",meEEDigiMultiplicityzp_);
0183    meEEDigiMultiplicityzp_;
0184    meEEDigiMultiplicityzp_->SetLineColor(rcolor);
0185 
0186    TH1 * meEEDigiMultiplicityzm_;
0187    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap multiplicity z-;1",meEEDigiMultiplicityzm_);
0188    meEEDigiMultiplicityzm_;
0189    meEEDigiMultiplicityzm_->SetLineColor(rcolor);
0190 
0191    TH1 * newmeEBDigiMultiplicity_;
0192    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel digis multiplicity;1",newmeEBDigiMultiplicity_);
0193    newmeEBDigiMultiplicity_;
0194    newmeEBDigiMultiplicity_->SetLineColor(scolor);
0195 
0196    TH1 * newmeESDigiMultiplicity_;
0197    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Preshower digis multiplicity;1",newmeESDigiMultiplicity_);
0198    newmeESDigiMultiplicity_;
0199    newmeESDigiMultiplicity_->SetLineColor(scolor);
0200 
0201    TH1 * newmeEEDigiMultiplicityzp_;
0202    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap multiplicity z+;1",newmeEEDigiMultiplicityzp_);
0203    newmeEEDigiMultiplicityzp_;
0204    newmeEEDigiMultiplicityzp_->SetLineColor(scolor);
0205 
0206    TH1 * newmeEEDigiMultiplicityzm_;
0207    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap multiplicity z-;1",newmeEEDigiMultiplicityzm_);
0208    newmeEEDigiMultiplicityzm_;
0209    newmeEEDigiMultiplicityzm_->SetLineColor(scolor);
0210 
0211    Ecal->cd(1);
0212    if ( meEBDigiMultiplicity_ && newmeEBDigiMultiplicity_ ) {
0213      gPad->SetLogx(0);
0214      meEBDigiMultiplicity_->Draw();
0215      newmeEBDigiMultiplicity_->Draw("same");
0216      myPV->PVCompute(meEBDigiMultiplicity_ , newmeEBDigiMultiplicity_ , te);
0217      gPad->SetLogx(1);
0218    }
0219    Ecal->cd(2);
0220    if ( meESDigiMultiplicity_ && newmeESDigiMultiplicity_ ) {
0221      gPad->SetLogx(0);
0222      meESDigiMultiplicity_->Draw();
0223      newmeESDigiMultiplicity_->Draw("same");
0224      myPV->PVCompute(meESDigiMultiplicity_ , newmeESDigiMultiplicity_ , te);
0225      gPad->SetLogx(1);
0226    }
0227    Ecal->cd(3);
0228    if ( meEEDigiMultiplicityzp_ && newmeEEDigiMultiplicityzp_ ) {
0229      gPad->SetLogx(0);
0230      meEEDigiMultiplicityzp_->Draw();
0231      newmeEEDigiMultiplicityzp_->Draw("same");
0232      myPV->PVCompute(meEEDigiMultiplicityzp_ , newmeEEDigiMultiplicityzp_ , te);
0233      gPad->SetLogx(1);
0234    }
0235    Ecal->cd(4);
0236    if ( meEEDigiMultiplicityzm_ && newmeEEDigiMultiplicityzm_ ) {
0237      gPad->SetLogx(0);
0238      meEEDigiMultiplicityzm_->Draw();
0239      newmeEEDigiMultiplicityzm_->Draw("same");
0240      myPV->PVCompute(meEEDigiMultiplicityzm_ , newmeEEDigiMultiplicityzm_ , te);
0241      gPad->SetLogx(1);
0242    }
0243    Ecal->Print("Multiplicity_compare.eps");
0244  }
0245 
0246 
0247  // global pulse shapes
0248 
0249  if (1) {
0250    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0251    Ecal->Divide(1,2);
0252 
0253    TProfile * meEBDigiADCGlobal_;
0254    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel global pulse shape;1",meEBDigiADCGlobal_) ;
0255    meEBDigiADCGlobal_;
0256    meEBDigiADCGlobal_->SetLineColor(rcolor);
0257 
0258    TProfile * meEEDigiADCGlobal_;
0259    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap global pulse shape;1",meEEDigiADCGlobal_) ;
0260    meEEDigiADCGlobal_;
0261    meEEDigiADCGlobal_->SetLineColor(rcolor);
0262 
0263    TProfile * newmeEBDigiADCGlobal_;
0264    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel global pulse shape;1",newmeEBDigiADCGlobal_) ;
0265    newmeEBDigiADCGlobal_;
0266    newmeEBDigiADCGlobal_->SetLineColor(scolor);
0267 
0268    TProfile * newmeEEDigiADCGlobal_;
0269    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap global pulse shape;1",newmeEEDigiADCGlobal_) ;
0270    newmeEEDigiADCGlobal_;
0271    newmeEEDigiADCGlobal_->SetLineColor(scolor);
0272 
0273    Ecal->cd(1);
0274    if ( meEBDigiADCGlobal_ && newmeEBDigiADCGlobal_ ) {
0275      meEBDigiADCGlobal_->Draw();
0276      newmeEBDigiADCGlobal_->Draw("same");
0277      myPV->PVCompute(meEBDigiADCGlobal_ , newmeEBDigiADCGlobal_ , te);
0278    }
0279    Ecal->cd(2);
0280    if ( meEEDigiADCGlobal_ && newmeEEDigiADCGlobal_ ) { 
0281      meEEDigiADCGlobal_->Draw();
0282      newmeEEDigiADCGlobal_->Draw("same");
0283      myPV->PVCompute(meEEDigiADCGlobal_ , newmeEEDigiADCGlobal_ , te);
0284    }
0285    Ecal->Print("Global_pulse_shape_compare.eps");
0286  }
0287 
0288  // maximum Digi over Sim ratio
0289 
0290  if (1) {
0291    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0292    Ecal->Divide(1,2);
0293 
0294    TH1 * meEBDigiSimRatio_;
0295    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel maximum Digi over Sim ratio;1",meEBDigiSimRatio_);
0296    meEBDigiSimRatio_;
0297    meEBDigiSimRatio_->SetLineColor(rcolor);
0298 
0299    TH1 * meEEDigiSimRatio_;
0300    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap maximum Digi over Sim ratio;1",meEEDigiSimRatio_);
0301    meEEDigiSimRatio_;
0302    meEEDigiSimRatio_->SetLineColor(rcolor);
0303 
0304    TH1 * newmeEBDigiSimRatio_;
0305    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel maximum Digi over Sim ratio;1",newmeEBDigiSimRatio_);
0306    newmeEBDigiSimRatio_;
0307    newmeEBDigiSimRatio_->SetLineColor(scolor);
0308 
0309    TH1 * newmeEEDigiSimRatio_;
0310    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap maximum Digi over Sim ratio;1",newmeEEDigiSimRatio_);
0311    newmeEEDigiSimRatio_;
0312    newmeEEDigiSimRatio_->SetLineColor(scolor);
0313 
0314    Ecal->cd(1);
0315    gPad->SetLogy(0);
0316    if ( meEBDigiSimRatio_ && newmeEBDigiSimRatio_ ) {
0317      meEBDigiSimRatio_->Draw();
0318      newmeEBDigiSimRatio_->Draw("same");
0319      myPV->PVCompute(meEBDigiSimRatio_ , newmeEBDigiSimRatio_ , te);
0320    }
0321    gPad->SetLogy(1);
0322    Ecal->cd(2);
0323    gPad->SetLogy(0);
0324    if ( meEEDigiSimRatio_ && newmeEEDigiSimRatio_ ) {
0325      meEEDigiSimRatio_->Draw();
0326      newmeEEDigiSimRatio_->Draw("same");
0327      myPV->PVCompute(meEEDigiSimRatio_ , newmeEEDigiSimRatio_ , te);
0328    }
0329    gPad->SetLogy(1);
0330    Ecal->Print("MaxADC_over_Sim_Ratio_compare.eps");
0331  } 
0332 
0333  if (1) {
0334    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0335    Ecal->Divide(1,2);
0336 
0337    TH1 * meEBDigiSimRatiogt10ADC_;
0338    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel maximum Digi over Sim ratio gt 10 ADC;1",meEBDigiSimRatiogt10ADC_);
0339    meEBDigiSimRatiogt10ADC_;
0340    meEBDigiSimRatiogt10ADC_->SetLineColor(rcolor);
0341 
0342    TH1 * meEEDigiSimRatiogt20ADC_;
0343    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap maximum Digi over Sim ratio gt 20 ADC;1",meEEDigiSimRatiogt20ADC_);
0344    meEEDigiSimRatiogt20ADC_;
0345    meEEDigiSimRatiogt20ADC_->SetLineColor(rcolor);
0346 
0347    TH1 * newmeEBDigiSimRatiogt10ADC_;
0348    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel maximum Digi over Sim ratio gt 10 ADC;1",newmeEBDigiSimRatiogt10ADC_);
0349    newmeEBDigiSimRatiogt10ADC_;
0350    newmeEBDigiSimRatiogt10ADC_->SetLineColor(scolor);
0351 
0352    TH1 * newmeEEDigiSimRatiogt20ADC_;
0353    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap maximum Digi over Sim ratio gt 20 ADC;1",newmeEEDigiSimRatiogt20ADC_);
0354    newmeEEDigiSimRatiogt20ADC_;
0355    newmeEEDigiSimRatiogt20ADC_->SetLineColor(scolor);
0356 
0357    Ecal->cd(1);
0358    gPad->SetLogy(0);
0359    if ( meEBDigiSimRatiogt10ADC_ && newmeEBDigiSimRatiogt10ADC_ ) {
0360      meEBDigiSimRatiogt10ADC_->Draw();
0361      newmeEBDigiSimRatiogt10ADC_->Draw("same");
0362      myPV->PVCompute(meEBDigiSimRatiogt10ADC_ , newmeEBDigiSimRatiogt10ADC_ , te);
0363    }
0364    gPad->SetLogy(1);
0365    Ecal->cd(2);
0366    gPad->SetLogy(0);
0367    if ( meEEDigiSimRatiogt20ADC_ && newmeEEDigiSimRatiogt20ADC_ ) {
0368      meEEDigiSimRatiogt20ADC_->Draw();
0369      newmeEEDigiSimRatiogt20ADC_->Draw("same");
0370      myPV->PVCompute(meEEDigiSimRatiogt20ADC_ , newmeEEDigiSimRatiogt20ADC_ , te);
0371    }
0372    gPad->SetLogy(1);
0373    Ecal->Print("MaxADC_over_Sim_Ratio_gt10ADC_compare.eps");
0374  } 
0375 
0376  if (1) {
0377    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0378    Ecal->Divide(1,2);
0379 
0380    TH1 * meEBDigiSimRatiogt100ADC_;
0381    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel maximum Digi over Sim ratio gt 100 ADC;1",meEBDigiSimRatiogt100ADC_);
0382    meEBDigiSimRatiogt100ADC_;
0383    meEBDigiSimRatiogt100ADC_->SetLineColor(rcolor);
0384 
0385    TH1 * meEEDigiSimRatiogt100ADC_;
0386    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap maximum Digi over Sim ratio gt 100 ADC;1",meEEDigiSimRatiogt100ADC_);
0387    meEEDigiSimRatiogt100ADC_;
0388    meEEDigiSimRatiogt100ADC_->SetLineColor(rcolor);
0389 
0390    TH1 * newmeEBDigiSimRatiogt100ADC_;
0391    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel maximum Digi over Sim ratio gt 100 ADC;1",newmeEBDigiSimRatiogt100ADC_);
0392    newmeEBDigiSimRatiogt100ADC_;
0393    newmeEBDigiSimRatiogt100ADC_->SetLineColor(scolor);
0394 
0395    TH1 * newmeEEDigiSimRatiogt100ADC_;
0396    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap maximum Digi over Sim ratio gt 100 ADC;1",newmeEEDigiSimRatiogt100ADC_);
0397    newmeEEDigiSimRatiogt100ADC_;
0398    newmeEEDigiSimRatiogt100ADC_->SetLineColor(scolor);
0399 
0400    Ecal->cd(1);
0401    gPad->SetLogy(0);
0402    if ( meEBDigiSimRatiogt100ADC_ && newmeEBDigiSimRatiogt100ADC_ ) {
0403      meEBDigiSimRatiogt100ADC_->Draw();
0404      newmeEBDigiSimRatiogt100ADC_->Draw("same");
0405      myPV->PVCompute(meEBDigiSimRatiogt100ADC_ , newmeEBDigiSimRatiogt100ADC_ , te );
0406    }
0407    gPad->SetLogy(1);
0408    Ecal->cd(2);
0409    gPad->SetLogy(0);
0410    if ( meEEDigiSimRatiogt100ADC_ && newmeEEDigiSimRatiogt100ADC_ ) {
0411      meEEDigiSimRatiogt100ADC_->Draw();
0412      newmeEEDigiSimRatiogt100ADC_->Draw("same");
0413      myPV->PVCompute(meEEDigiSimRatiogt100ADC_ , newmeEEDigiSimRatiogt100ADC_ , te );
0414    }
0415    gPad->SetLogy(1);
0416    Ecal->Print("MaxADC_over_Sim_Ratio_gt100ADC_compare.eps");
0417  } 
0418 
0419  // Gain switch check
0420 
0421  if (1) {
0422    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0423    Ecal->Divide(1,2);
0424 
0425    TH1 * meEBnADCafterSwitch_;
0426    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel ADC counts after gain switch;1", meEBnADCafterSwitch_) ;
0427    meEBnADCafterSwitch_;
0428    meEBnADCafterSwitch_->SetLineColor(rcolor);
0429 
0430    TH1 * meEEnADCafterSwitch_;
0431    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap ADC counts after gain switch;1", meEEnADCafterSwitch_) ;
0432    meEEnADCafterSwitch_;
0433    meEEnADCafterSwitch_->SetLineColor(rcolor);
0434 
0435    TH1 * newmeEBnADCafterSwitch_;
0436    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel ADC counts after gain switch;1", newmeEBnADCafterSwitch_) ;
0437    newmeEBnADCafterSwitch_;
0438    newmeEBnADCafterSwitch_->SetLineColor(scolor);
0439 
0440    TH1 * newmeEEnADCafterSwitch_;
0441    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap ADC counts after gain switch;1", newmeEEnADCafterSwitch_) ;
0442    newmeEEnADCafterSwitch_;
0443    newmeEEnADCafterSwitch_->SetLineColor(scolor);
0444 
0445    Ecal->cd(1);
0446    if ( meEBnADCafterSwitch_ && newmeEBnADCafterSwitch_ ) {
0447      meEBnADCafterSwitch_->Draw();
0448      newmeEBnADCafterSwitch_->Draw("same");
0449      myPV->PVCompute(meEBnADCafterSwitch_ , newmeEBnADCafterSwitch_ , te );
0450    }
0451    Ecal->cd(2);
0452    if ( meEEnADCafterSwitch_ && newmeEEnADCafterSwitch_ ) {
0453      meEEnADCafterSwitch_->Draw();
0454      newmeEEnADCafterSwitch_->Draw("same");
0455      myPV->PVCompute(meEEnADCafterSwitch_ , newmeEEnADCafterSwitch_ , te );
0456    }
0457    Ecal->Print("Counts_after_gain_switch_compare.eps");
0458  }
0459 
0460  // pedestal for pre-sample
0461 
0462  if (1) {
0463    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0464    Ecal->Divide(1,2);
0465 
0466    TH1 * meEBPedestal_;
0467    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel pedestal for pre-sample;1",meEBPedestal_);
0468    meEBPedestal_;
0469    meEBPedestal_->SetLineColor(rcolor);
0470 
0471    TH1 * meEEPedestal_;
0472    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap pedestal for pre-sample;1",meEEPedestal_);
0473    meEEPedestal_;
0474    meEEPedestal_->SetLineColor(rcolor);
0475 
0476    TH1 * newmeEBPedestal_;
0477    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel pedestal for pre-sample;1",newmeEBPedestal_);
0478    newmeEBPedestal_;
0479    newmeEBPedestal_->SetLineColor(scolor);
0480 
0481    TH1 * newmeEEPedestal_;
0482    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap pedestal for pre-sample;1",newmeEEPedestal_);
0483    newmeEEPedestal_;
0484    newmeEEPedestal_->SetLineColor(scolor);
0485 
0486    Ecal->cd(1);
0487    if ( meEBPedestal_ && newmeEBPedestal_ ) {
0488      meEBPedestal_->Draw();
0489      newmeEBPedestal_->Draw("same");
0490      myPV->PVCompute(meEBPedestal_ , newmeEBPedestal_ , te );
0491    }
0492    Ecal->cd(2);
0493    if ( meEEPedestal_ && newmeEEPedestal_ ) {
0494      meEEPedestal_->Draw();
0495      newmeEEPedestal_->Draw("same");
0496      myPV->PVCompute(meEEPedestal_ , newmeEEPedestal_ , te );
0497    }
0498    Ecal->Print("Presample_pedestal_compare.eps");
0499  } 
0500 
0501  // maximum position
0502 
0503 
0504  if (1) {
0505    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0506    Ecal->Divide(1,2);
0507 
0508    TH1 * meEBMaximumgt100ADC_;
0509    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel maximum position gt 100 ADC;1",meEBMaximumgt100ADC_);
0510    meEBMaximumgt100ADC_;
0511    meEBMaximumgt100ADC_->SetLineColor(rcolor);
0512 
0513    TH1 * meEEMaximumgt100ADC_;
0514    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap maximum position gt 100 ADC;1",meEEMaximumgt100ADC_);
0515    meEEMaximumgt100ADC_;
0516    meEEMaximumgt100ADC_->SetLineColor(rcolor);
0517 
0518    TH1 * newmeEBMaximumgt100ADC_;
0519    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel maximum position gt 100 ADC;1",newmeEBMaximumgt100ADC_);
0520    newmeEBMaximumgt100ADC_;
0521    newmeEBMaximumgt100ADC_->SetLineColor(scolor);
0522 
0523    TH1 * newmeEEMaximumgt100ADC_;
0524    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap maximum position gt 100 ADC;1",newmeEEMaximumgt100ADC_);
0525    newmeEEMaximumgt100ADC_;
0526    newmeEEMaximumgt100ADC_->SetLineColor(scolor);
0527 
0528    Ecal->cd(1);
0529    if ( meEBMaximumgt100ADC_ && newmeEBMaximumgt100ADC_ ) { 
0530      meEBMaximumgt100ADC_->Draw();
0531      newmeEBMaximumgt100ADC_->Draw("same");
0532      myPV->PVCompute(meEBMaximumgt100ADC_ , newmeEBMaximumgt100ADC_ , te );
0533    }
0534    Ecal->cd(2);
0535    if ( meEEMaximumgt100ADC_ && newmeEEMaximumgt100ADC_ ) {
0536      meEEMaximumgt100ADC_->Draw();
0537      newmeEEMaximumgt100ADC_->Draw("same");
0538      myPV->PVCompute(meEEMaximumgt100ADC_ , newmeEEMaximumgt100ADC_ , te );
0539    }
0540    Ecal->Print("Maximum_position_gt100ADC_compare.eps");
0541  }
0542 
0543  if (1) {
0544    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0545    Ecal->Divide(1,2);
0546 
0547    TH1 * meEBMaximumgt10ADC_;
0548    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel maximum position gt 10 ADC;1",meEBMaximumgt10ADC_);
0549    meEBMaximumgt10ADC_;
0550    meEBMaximumgt10ADC_->SetLineColor(rcolor);
0551 
0552    TH1 * meEEMaximumgt20ADC_;
0553    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap maximum position gt 20 ADC;1",meEEMaximumgt20ADC_);
0554    meEEMaximumgt20ADC_;
0555    meEEMaximumgt20ADC_->SetLineColor(rcolor);
0556 
0557    TH1 * newmeEBMaximumgt10ADC_;
0558    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel maximum position gt 10 ADC;1",newmeEBMaximumgt10ADC_);
0559    newmeEBMaximumgt10ADC_;
0560    newmeEBMaximumgt10ADC_->SetLineColor(scolor);
0561 
0562    TH1 * newmeEEMaximumgt20ADC_;
0563    sfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap maximum position gt 20 ADC;1",newmeEEMaximumgt20ADC_);
0564    newmeEEMaximumgt20ADC_;
0565    newmeEEMaximumgt20ADC_->SetLineColor(scolor);
0566 
0567    Ecal->cd(1);
0568    if ( meEBMaximumgt10ADC_ && newmeEBMaximumgt10ADC_ ) {
0569      meEBMaximumgt10ADC_->Draw();
0570      newmeEBMaximumgt10ADC_->Draw("same");
0571      myPV->PVCompute(meEBMaximumgt10ADC_ , newmeEBMaximumgt10ADC_ , te ); 
0572    }
0573    Ecal->cd(2);
0574    if ( meEEMaximumgt20ADC_ && newmeEEMaximumgt20ADC_ ) {
0575      meEEMaximumgt20ADC_->Draw();
0576      newmeEEMaximumgt20ADC_->Draw("same");
0577      myPV->PVCompute(meEEMaximumgt20ADC_ , newmeEEMaximumgt20ADC_ , te ); 
0578    }
0579    Ecal->Print("Maximum_position_gt10ADC_compare.eps");
0580  }
0581 
0582  // Preshower ADC counts
0583 
0584  if (1) {
0585    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0586    Ecal->Divide(1,3);
0587 
0588    TH1 * meESDigiADC_[3];
0589    TH1 * newmeESDigiADC_[3];
0590    for ( Int_t  i=0 ; i<3; i++ ) {
0591      sprintf (histo, "DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Preshower ADC pulse %02d;1", i+1) ;
0592      rfile->GetObject(histo,meESDigiADC_[i]);
0593      meESDigiADC_[i];
0594      meESDigiADC_[i]->SetLineColor(rcolor);
0595      sfile->GetObject(histo,newmeESDigiADC_[i]);
0596      newmeESDigiADC_[i];
0597      newmeESDigiADC_[i]->SetLineColor(scolor);
0598    }
0599    for ( Int_t  i=0 ; i<3; i++ ) {
0600      Ecal->cd(i+1);
0601      gPad->SetLogy(0);
0602      if ( meESDigiADC_[i] && newmeESDigiADC_[i] ) { 
0603        meESDigiADC_[i]->Draw();
0604        newmeESDigiADC_[i]->Draw("same");
0605        myPV->PVCompute(meESDigiADC_[i] , newmeESDigiADC_[i] , te );
0606      }
0607      gPad->SetLogy(1);
0608    }
0609    Ecal->Print("Preshower_ADC_counts_compare.eps");
0610  }
0611  
0612  // Barrel analog pulse
0613 
0614  if (1) {
0615    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0616    Ecal->Divide(2,5);
0617 
0618    TH1 * meEBDigiADCAnalog_[10];
0619    TH1 * newmeEBDigiADCAnalog_[10];
0620    for ( Int_t  i=0 ; i<10; i++ ) {
0621      sprintf (histo, "DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel analog pulse %02d;1", i+1) ;
0622      rfile->GetObject(histo,meEBDigiADCAnalog_[i]);
0623      meEBDigiADCAnalog_[i];
0624      meEBDigiADCAnalog_[i]->SetLineColor(rcolor);
0625      sfile->GetObject(histo,newmeEBDigiADCAnalog_[i]);
0626      newmeEBDigiADCAnalog_[i];
0627      newmeEBDigiADCAnalog_[i]->SetLineColor(scolor);
0628    }
0629    for ( Int_t  i=0 ; i<10; i++ ) {
0630      Ecal->cd(i+1);
0631      gPad->SetLogy(0);
0632      if ( meEBDigiADCAnalog_[i] && newmeEBDigiADCAnalog_[i] ) {
0633        meEBDigiADCAnalog_[i]->Draw();
0634        newmeEBDigiADCAnalog_[i]->Draw("same");
0635        myPV->PVCompute(meEBDigiADCAnalog_[i] , newmeEBDigiADCAnalog_[i] , te );
0636      }
0637      gPad->SetLogy(1);
0638    }
0639    Ecal->Print("Barrel_analog_ADC_counts_compare.eps");
0640  }
0641 
0642  // Barrel ADC counts gain 1
0643 
0644  if (1) {
0645    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0646    Ecal->Divide(2,5);
0647 
0648    TH1 * meEBDigiADCg1_[10];
0649    TH1 * newmeEBDigiADCg1_[10];
0650    for ( Int_t  i=0 ; i<10; i++ ) {
0651      sprintf (histo, "DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel ADC pulse %02d Gain 1;1", i+1) ;
0652      rfile->GetObject(histo,meEBDigiADCg1_[i]);
0653      meEBDigiADCg1_[i];
0654      meEBDigiADCg1_[i]->SetLineColor(rcolor);
0655      sfile->GetObject(histo,newmeEBDigiADCg1_[i]);
0656      newmeEBDigiADCg1_[i];
0657      newmeEBDigiADCg1_[i]->SetLineColor(scolor);
0658    }
0659    for ( Int_t  i=0 ; i<10; i++ ) {
0660      Ecal->cd(i+1);
0661      gPad->SetLogy(0);
0662      if ( meEBDigiADCg1_[i] && newmeEBDigiADCg1_[i] ) {
0663        meEBDigiADCg1_[i]->Draw();
0664        newmeEBDigiADCg1_[i]->Draw("same");
0665        myPV->PVCompute(meEBDigiADCg1_[i] , newmeEBDigiADCg1_[i] , te );
0666      }
0667      gPad->SetLogy(1);
0668    }
0669    Ecal->Print("Barrel_ADC_counts_gain1_compare.eps");
0670  }
0671 
0672  // Barrel ADC counts gain 6
0673 
0674  if (1) {
0675    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0676    Ecal->Divide(2,5);
0677 
0678    TH1 * meEBDigiADCg6_[10];
0679    TH1 * newmeEBDigiADCg6_[10];
0680    for ( Int_t  i=0 ; i<10; i++ ) {
0681      sprintf (histo, "DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel ADC pulse %02d Gain 6;1", i+1) ;
0682      rfile->GetObject(histo,meEBDigiADCg6_[i]);
0683      meEBDigiADCg6_[i];
0684      meEBDigiADCg6_[i]->SetLineColor(rcolor);
0685      sfile->GetObject(histo,newmeEBDigiADCg6_[i]);
0686      newmeEBDigiADCg6_[i];
0687      newmeEBDigiADCg6_[i]->SetLineColor(scolor);
0688    }
0689    for ( Int_t  i=0 ; i<10; i++ ) {
0690      Ecal->cd(i+1);
0691      gPad->SetLogy(0);
0692      if ( meEBDigiADCg6_[i] && newmeEBDigiADCg6_[i] ) {
0693        meEBDigiADCg6_[i]->Draw();
0694        newmeEBDigiADCg6_[i]->Draw("same");
0695        myPV->PVCompute(meEBDigiADCg6_[i] , newmeEBDigiADCg6_[i] , te );
0696      }
0697      gPad->SetLogy(1);
0698    }
0699    Ecal->Print("Barrel_ADC_counts_gain6_compare.eps");
0700  }
0701 
0702  // Barrel ADC counts gain 12
0703 
0704  if (1) {
0705    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0706    Ecal->Divide(2,5);
0707 
0708    TH1 * meEBDigiADCg12_[10];
0709    TH1 * newmeEBDigiADCg12_[10];
0710    for ( Int_t  i=0 ; i<10; i++ ) {
0711      sprintf (histo, "DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel ADC pulse %02d Gain 12;1", i+1) ;
0712      rfile->GetObject(histo,meEBDigiADCg12_[i]);
0713      meEBDigiADCg12_[i];
0714      meEBDigiADCg12_[i]->SetLineColor(rcolor);
0715      sfile->GetObject(histo,newmeEBDigiADCg12_[i]);
0716      newmeEBDigiADCg12_[i];
0717      newmeEBDigiADCg12_[i]->SetLineColor(scolor);
0718    }
0719    for ( Int_t  i=0 ; i<10; i++ ) {
0720      Ecal->cd(i+1);
0721      gPad->SetLogy(0);
0722      if ( meEBDigiADCg12_[i] && newmeEBDigiADCg12_[i] ) {
0723        meEBDigiADCg12_[i]->Draw();
0724        newmeEBDigiADCg12_[i]->Draw("same");
0725        myPV->PVCompute(meEBDigiADCg12_[i] , newmeEBDigiADCg12_[i] , te );
0726      }
0727      gPad->SetLogy(1);
0728    }
0729    Ecal->Print("Barrel_ADC_counts_gain12_compare.eps");
0730  }
0731 
0732  // Barrel gain distributions
0733 
0734  if (1) {
0735    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0736    Ecal->Divide(2,5);
0737 
0738    TH1 * meEBDigiGain_[10];
0739    TH1 * newmeEBDigiGain_[10];
0740    for ( Int_t  i=0 ; i<10; i++ ) {
0741      sprintf (histo, "DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel gain pulse %02d;1", i+1) ;
0742      rfile->GetObject(histo,meEBDigiGain_[i]);
0743      meEBDigiGain_[i];
0744      meEBDigiGain_[i]->SetLineColor(rcolor);
0745      sfile->GetObject(histo,newmeEBDigiGain_[i]);
0746      newmeEBDigiGain_[i];
0747      newmeEBDigiGain_[i]->SetLineColor(scolor);
0748    }
0749    for ( Int_t  i=0 ; i<10; i++ ) {
0750      Ecal->cd(i+1);
0751      gPad->SetLogy(0);
0752      if ( meEBDigiGain_[i] && newmeEBDigiGain_[i] ) {
0753        meEBDigiGain_[i]->Draw();
0754        newmeEBDigiGain_[i]->Draw("same");
0755        myPV->PVCompute(meEBDigiGain_[i] , newmeEBDigiGain_[i] , te );
0756      }
0757      gPad->SetLogy(1);
0758    }
0759    Ecal->Print("Barrel_ADC_gain_compare.eps");
0760  }
0761  
0762  // Endcap analog pulse
0763 
0764  if (1) {
0765    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0766    Ecal->Divide(2,5);
0767 
0768    TH1 * meEEDigiADCAnalog_[10];
0769    TH1 * newmeEEDigiADCAnalog_[10];
0770    for ( Int_t  i=0 ; i<10; i++ ) {
0771      sprintf (histo, "DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap analog pulse %02d;1", i+1) ;
0772      rfile->GetObject(histo,meEEDigiADCAnalog_[i]);
0773      meEEDigiADCAnalog_[i];
0774      meEEDigiADCAnalog_[i]->SetLineColor(rcolor);
0775      sfile->GetObject(histo,newmeEEDigiADCAnalog_[i]);
0776      newmeEEDigiADCAnalog_[i];
0777      newmeEEDigiADCAnalog_[i]->SetLineColor(scolor);
0778    }
0779    for ( Int_t  i=0 ; i<10; i++ ) {
0780      Ecal->cd(i+1);
0781      gPad->SetLogy(0);
0782      if ( meEEDigiADCAnalog_[i] && newmeEEDigiADCAnalog_[i] ) {
0783        meEEDigiADCAnalog_[i]->Draw();
0784        newmeEEDigiADCAnalog_[i]->Draw("same");
0785        myPV->PVCompute(meEEDigiADCAnalog_[i] , newmeEEDigiADCAnalog_[i] , te );
0786      }
0787      gPad->SetLogy(1);
0788    }
0789    Ecal->Print("Endcap_analog_ADC_counts_compare.eps");
0790  }
0791 
0792  // Endcap ADC counts gain 1
0793 
0794  if (1) {
0795    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0796    Ecal->Divide(2,5);
0797 
0798    TH1 * meEEDigiADCg1_[10];
0799    TH1 * newmeEEDigiADCg1_[10];
0800    for ( Int_t  i=0 ; i<10; i++ ) {
0801      sprintf (histo, "DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap ADC pulse %02d Gain 1;1", i+1) ;
0802      rfile->GetObject(histo,meEEDigiADCg1_[i]);
0803      meEEDigiADCg1_[i];
0804      meEEDigiADCg1_[i]->SetLineColor(rcolor);
0805      sfile->GetObject(histo,newmeEEDigiADCg1_[i]);
0806      newmeEEDigiADCg1_[i];
0807      newmeEEDigiADCg1_[i]->SetLineColor(scolor);
0808    }
0809    for ( Int_t  i=0 ; i<10; i++ ) {
0810      Ecal->cd(i+1);
0811      gPad->SetLogy(0);
0812      if ( meEEDigiADCg1_[i] && newmeEEDigiADCg1_[i] ) {
0813        meEEDigiADCg1_[i]->Draw();
0814        newmeEEDigiADCg1_[i]->Draw("same");
0815        myPV->PVCompute(meEEDigiADCg1_[i] , newmeEEDigiADCg1_[i] , te );
0816      }
0817      gPad->SetLogy(1);
0818    }
0819    Ecal->Print("Endcap_ADC_counts_gain1_compare.eps");
0820  }
0821 
0822  // Endcap ADC counts gain 6
0823 
0824  if (1) {
0825    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0826    Ecal->Divide(2,5);
0827 
0828    TH1 * meEEDigiADCg6_[10];
0829    TH1 * newmeEEDigiADCg6_[10];
0830    for ( Int_t  i=0 ; i<10; i++ ) {
0831      sprintf (histo, "DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap ADC pulse %02d Gain 6;1", i+1) ;
0832      rfile->GetObject(histo,meEEDigiADCg6_[i]);
0833      meEEDigiADCg6_[i];
0834      meEEDigiADCg6_[i]->SetLineColor(rcolor);
0835      sfile->GetObject(histo,newmeEEDigiADCg6_[i]);
0836      newmeEEDigiADCg6_[i];
0837      newmeEEDigiADCg6_[i]->SetLineColor(scolor);
0838    }
0839    for ( Int_t  i=0 ; i<10; i++ ) {
0840      Ecal->cd(i+1);
0841      gPad->SetLogy(0);
0842      if ( meEEDigiADCg6_[i] && newmeEEDigiADCg6_[i] ) {
0843        meEEDigiADCg6_[i]->Draw();
0844        newmeEEDigiADCg6_[i]->Draw("same");
0845        myPV->PVCompute(meEEDigiADCg6_[i] , newmeEEDigiADCg6_[i] , te );
0846      }
0847      gPad->SetLogy(1);
0848    }
0849    Ecal->Print("Endcap_ADC_counts_gain6_compare.eps");
0850  }
0851 
0852  // Endcap ADC counts gain 12
0853 
0854  if (1) {
0855    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0856    Ecal->Divide(2,5);
0857 
0858    TH1 * meEEDigiADCg12_[10];
0859    TH1 * newmeEEDigiADCg12_[10];
0860    for ( Int_t  i=0 ; i<10; i++ ) {
0861      sprintf (histo, "DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap ADC pulse %02d Gain 12;1", i+1) ;
0862      rfile->GetObject(histo,meEEDigiADCg12_[i]);
0863      meEEDigiADCg12_[i];
0864      meEEDigiADCg12_[i]->SetLineColor(rcolor);
0865      sfile->GetObject(histo,newmeEEDigiADCg12_[i]);
0866      newmeEEDigiADCg12_[i];
0867      newmeEEDigiADCg12_[i]->SetLineColor(scolor);
0868    }
0869    for ( Int_t  i=0 ; i<10; i++ ) {
0870      Ecal->cd(i+1);
0871      gPad->SetLogy(0);
0872      if ( meEEDigiADCg12_[i] && newmeEEDigiADCg12_[i] ) {
0873        meEEDigiADCg12_[i]->Draw();
0874        newmeEEDigiADCg12_[i]->Draw("same");
0875        myPV->PVCompute(meEEDigiADCg12_[i] , newmeEEDigiADCg12_[i] , te );
0876      }
0877      gPad->SetLogy(1);
0878    }
0879    Ecal->Print("Endcap_ADC_counts_gain12_compare.eps");
0880  }
0881 
0882  // Endcap gain distributions
0883 
0884  if (1) {
0885    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0886    Ecal->Divide(2,5);
0887 
0888    TH1 * meEEDigiGain_[10];
0889    TH1 * newmeEEDigiGain_[10];
0890    for ( Int_t  i=0 ; i<10; i++ ) {
0891      sprintf (histo, "DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap gain pulse %02d;1", i+1) ;
0892      rfile->GetObject(histo,meEEDigiGain_[i]);
0893      meEEDigiGain_[i];
0894      meEEDigiGain_[i]->SetLineColor(rcolor);
0895      sfile->GetObject(histo,newmeEEDigiGain_[i]);
0896      newmeEEDigiGain_[i];
0897      newmeEEDigiGain_[i]->SetLineColor(scolor);
0898    }
0899    for ( Int_t  i=0 ; i<10; i++ ) {
0900      Ecal->cd(i+1);
0901      gPad->SetLogy(0);
0902      if ( meEEDigiGain_[i] && newmeEEDigiGain_[i] ) {
0903        meEEDigiGain_[i]->Draw();
0904        newmeEEDigiGain_[i]->Draw("same");
0905        myPV->PVCompute(meEEDigiGain_[i] , newmeEEDigiGain_[i] , te );
0906      }
0907      gPad->SetLogy(1);
0908    }
0909    Ecal->Print("Endcap_ADC_gain_compare.eps");
0910  }
0911 
0912 }
0913