Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "TFile.h"
0002 #include "TTree.h"
0003 #include "TText.h"
0004 
0005 void EcalMixingModulePlots( TString inputfile = "EcalDigisValidation.root" )
0006 {
0007 
0008  gROOT ->Reset();
0009  char*  rfilename = inputfile;
0010 
0011  delete gROOT->GetListOfFiles()->FindObject(rfilename);
0012 
0013  TText* te = new TText();
0014  TFile * rfile = new TFile(rfilename);
0015 
0016  rfile->cd("DQMData/EcalDigisV/EcalDigiTask");
0017  gDirectory->ls();
0018 
0019  Char_t histo[200];
0020 
0021  gStyle->SetOptStat("nemruoi");
0022 
0023 //////////////////////////////////////////////////////////////
0024 
0025 
0026  // maximum Digi over Sim ratio
0027 
0028  if (1) {
0029    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0030    Ecal->Divide(1,2);
0031 
0032    TH1 * meEBDigiMixRatiogt100ADC_;
0033    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel maximum Digi over sim signal ratio gt 100 ADC;1",meEBDigiMixRatiogt100ADC_);
0034    meEBDigiMixRatiogt100ADC_;
0035 
0036    TH1 * meEEDigiMixRatiogt100ADC_;
0037    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap maximum Digi over sim signal ratio gt 100 ADC;1",meEEDigiMixRatiogt100ADC_);
0038    meEEDigiMixRatiogt100ADC_;
0039 
0040    Ecal->cd(1);
0041    gPad->SetLogy(0);
0042    if ( meEBDigiMixRatiogt100ADC_ ) meEBDigiMixRatiogt100ADC_->Draw();
0043    gPad->SetLogy(1);
0044    Ecal->cd(2);
0045    gPad->SetLogy(0);
0046    if ( meEEDigiMixRatiogt100ADC_ ) meEEDigiMixRatiogt100ADC_->Draw();
0047    gPad->SetLogy(1);
0048    Ecal->Print("MaxADC_over_SimSignal_Ratio_gt100ADC.eps");
0049  } 
0050 
0051  if (1) {
0052    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0053    Ecal->Divide(1,2);
0054 
0055    TH1 * meEBDigiMixRatioOriggt50pc_;
0056    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel maximum Digi over sim signal ratio signal gt 50pc gun;1",meEBDigiMixRatioOriggt50pc_);
0057    meEBDigiMixRatioOriggt50pc_;
0058 
0059    TH1 * meEEDigiMixRatioOriggt40pc_;
0060    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap maximum Digi over sim signal ratio signal gt 40pc gun;1",meEEDigiMixRatioOriggt40pc_);
0061    meEEDigiMixRatioOriggt40pc_;
0062 
0063    Ecal->cd(1);
0064    gPad->SetLogy(0);
0065    if ( meEBDigiMixRatioOriggt50pc_ ) meEBDigiMixRatioOriggt50pc_->Draw();
0066    gPad->SetLogy(1);
0067    Ecal->cd(2);
0068    gPad->SetLogy(0);
0069    if ( meEEDigiMixRatioOriggt40pc_ ) meEEDigiMixRatioOriggt40pc_->Draw();
0070    gPad->SetLogy(1);
0071    Ecal->Print("MaxADC_over_SimSignal_Ratio_Origgt40pc.eps");
0072  } 
0073 
0074  // Bunch crossing distribution
0075 
0076  if (1) {
0077    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0078    Ecal->Divide(1,3);
0079 
0080    TH1 * meEBbunchCrossing_;
0081    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel bunch crossing;1",meEBbunchCrossing_);
0082    meEBbunchCrossing_;
0083 
0084    TH1 * meEEbunchCrossing_;
0085    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap bunch crossing;1",meEEbunchCrossing_);
0086    meEEbunchCrossing_;
0087 
0088    TH1 * meESbunchCrossing_;
0089    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Preshower bunch crossing;1",meESbunchCrossing_);
0090    meESbunchCrossing_;
0091    
0092    Ecal->cd(1); 
0093    if ( meEBbunchCrossing_ ) meEBbunchCrossing_->Draw(); 
0094    Ecal->cd(2); 
0095    if ( meEEbunchCrossing_ ) meEEbunchCrossing_->Draw(); 
0096    Ecal->cd(3); 
0097    if ( meESbunchCrossing_ ) meESbunchCrossing_->Draw(); 
0098    Ecal->Print("BunchCrossing.eps");
0099 
0100  }
0101 
0102  // Global shapes and ratios
0103 
0104  if (1) {
0105    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0106    Ecal->Divide(2,3);
0107    
0108    TProfile * meEBShape_;
0109    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel shape digi;1", meEBShape_);
0110    meEBShape_;
0111 
0112    TH1 * meEBShapeRatio_;
0113    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel shape digi ratio;1",  meEBShapeRatio_ );
0114    meEBShapeRatio_;
0115 
0116    TProfile * meEEShape_;
0117    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap shape digi;1", meEEShape_);
0118    meEEShape_;
0119 
0120    TH1 * meEEShapeRatio_;
0121    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap shape digi ratio;1",  meEEShapeRatio_ );
0122    meEEShapeRatio_;
0123 
0124    TProfile * meESShape_;
0125    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Preshower shape digi;1", meESShape_);
0126    meESShape_;
0127 
0128    TH1 * meESShapeRatio_;
0129    rfile->GetObject("DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Preshower shape digi ratio;1",  meESShapeRatio_ );
0130    meESShapeRatio_;
0131 
0132    Ecal->cd(1);
0133    if ( meEBShape_ ) meEBShape_->Draw();
0134    Ecal->cd(2);
0135    if ( meEBShapeRatio_ ) meEBShapeRatio_->Draw();
0136    Ecal->cd(3);
0137    if ( meEEShape_ ) meEEShape_->Draw();
0138    Ecal->cd(4);
0139    if ( meEEShapeRatio_ ) meEEShapeRatio_->Draw();
0140    Ecal->cd(5);
0141    if ( meESShape_ ) meESShape_->Draw();
0142    Ecal->cd(6);
0143    if ( meESShapeRatio_ ) meESShapeRatio_->Draw();
0144    Ecal->Print("MixingModule_shape_and_ratio.eps");
0145 
0146  }
0147 
0148  // Bunch by bunch shapes
0149 
0150  if (1) {
0151    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0152    Ecal->Divide(3,7);
0153 
0154    TProfile * meEBBunchShape_[21];
0155    for ( Int_t  i=0 ; i<21; i++ ) {
0156      sprintf (histo, "DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Barrel shape bunch crossing %02d;1", i-10 );
0157      rfile->GetObject(histo,meEBBunchShape_[i]);
0158      meEBBunchShape_[i];
0159    }
0160    for ( Int_t  i=0 ; i<21; i++ ) {
0161      Ecal->cd(i+1);
0162      if ( meEBBunchShape_[i] ) meEBBunchShape_[i]->Draw();
0163    }
0164    Ecal->Print("Barrel_bunch_by_bunch_shapes.eps");
0165   
0166  }
0167 
0168  if (1) {
0169    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0170    Ecal->Divide(3,7);
0171 
0172    TProfile * meEEBunchShape_[21];
0173    for ( Int_t  i=0 ; i<21; i++ ) {
0174      sprintf (histo, "DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Endcap shape bunch crossing %02d;1", i-10 );
0175      rfile->GetObject(histo,meEEBunchShape_[i]);
0176      meEEBunchShape_[i];
0177    }
0178    for ( Int_t  i=0 ; i<21; i++ ) {
0179      Ecal->cd(i+1);
0180      if ( meEEBunchShape_[i] ) meEEBunchShape_[i]->Draw();
0181    }
0182    Ecal->Print("Endcap_bunch_by_bunch_shapes.eps");
0183   
0184  }
0185 
0186  if (1) {
0187    TCanvas * Ecal = new TCanvas("Ecal","Ecal",800,1000);
0188    Ecal->Divide(3,7);
0189 
0190    TProfile * meESBunchShape_[21];
0191    for ( Int_t  i=0 ; i<21; i++ ) {
0192      sprintf (histo, "DQMData/EcalDigisV/EcalDigiTask/EcalDigiTask Preshower shape bunch crossing %02d;1", i-10 );
0193      rfile->GetObject(histo,meESBunchShape_[i]);
0194      meESBunchShape_[i];
0195    }
0196    for ( Int_t  i=0 ; i<21; i++ ) {
0197      Ecal->cd(i+1);
0198      if ( meESBunchShape_[i] ) meESBunchShape_[i]->Draw();
0199    }
0200    Ecal->Print("Preshower_bunch_by_bunch_shapes.eps");
0201   
0202  }
0203 
0204 }