CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/DQM/RPCMonitorClient/src/RPCEfficiencySecond.cc

Go to the documentation of this file.
00001 /***************************************
00002 Author: 
00003 Camilo Carrillo
00004 Universidad de los Andes Bogota Colombia
00005 camilo.carrilloATcern.ch
00006 ****************************************/
00007 
00008 #include <memory>
00009 
00010 // user include files
00011 #include "FWCore/Framework/interface/Frameworkfwd.h"
00012 #include "FWCore/Framework/interface/EDAnalyzer.h"
00013 
00014 #include "FWCore/Framework/interface/Event.h"
00015 #include "FWCore/Framework/interface/MakerMacros.h"
00016 
00017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00018 #include <Geometry/RPCGeometry/interface/RPCGeometry.h>
00019 #include <Geometry/RPCGeometry/interface/RPCGeomServ.h>
00020 #include <Geometry/CommonDetUnit/interface/GeomDet.h>
00021 #include <Geometry/Records/interface/MuonGeometryRecord.h>
00022 #include "FWCore/Framework/interface/ESHandle.h"
00023 
00024 #include <DataFormats/MuonDetId/interface/RPCDetId.h>
00025 #include "DQMServices/Core/interface/MonitorElement.h"
00026 
00027 #include "Geometry/RPCGeometry/interface/RPCGeomServ.h"
00028 
00029 #include<string>
00030 #include<fstream>
00031 #include<iostream>
00032 #include <vector>
00033 #include "DQM/RPCMonitorClient/interface/RPCEfficiencySecond.h"
00034 #include "DQM/RPCMonitorDigi/interface/RPCBookFolderStructure.h"
00035 
00036 #include "TH1F.h"
00037 
00038 int RPCEfficiencySecond::rollY(std::string shortname,std::vector<std::string> rollNames){
00039   int myy=0;
00040   for(int i=1;i<22;i++){
00041     //std::cout<<"In map="<<rollNames[i]<<" shortname="<<shortname<<std::endl;
00042     if(rollNames[i].compare(shortname)==0){
00043       myy=i;
00044       return myy;
00045     }
00046   }
00047   if(myy==0){
00048     if(debug) std::cout<<"Problem with "<<shortname<<std::endl;
00049   }
00050   return myy;
00051 }
00052 
00053 
00054 RPCEfficiencySecond::RPCEfficiencySecond(const edm::ParameterSet& iConfig){
00055   SaveFile  = iConfig.getUntrackedParameter<bool>("SaveFile", false); 
00056   NameFile  = iConfig.getUntrackedParameter<std::string>("NameFile","RPCEfficiency.root"); 
00057   folderPath  = iConfig.getUntrackedParameter<std::string>("folderPath","RPC/RPCEfficiency/"); 
00058   debug = iConfig.getUntrackedParameter<bool>("debug",false); 
00059   barrel = iConfig.getUntrackedParameter<bool>("barrel"); 
00060   endcap = iConfig.getUntrackedParameter<bool>("endcap"); 
00061 }
00062  
00063 RPCEfficiencySecond::~RPCEfficiencySecond(){}
00064 
00065 void RPCEfficiencySecond::beginRun(const edm::Run&, const edm::EventSetup& iSetup){
00066   
00067   dbe = edm::Service<DQMStore>().operator->();
00068 
00069   if(debug) std::cout<<"Booking Residuals Barrel"<<std::endl;
00070   dbe->setCurrentFolder(folderPath+"ResidualsBarrel/");
00071  
00072   //Barrel
00073   hGlobal2ResClu1La1 = dbe->book1D("GlobalResidualsClu1La1","RPC Residuals Layer 1 Cluster Size 1",101,-10.,10.);
00074   hGlobal2ResClu1La2 = dbe->book1D("GlobalResidualsClu1La2","RPC Residuals Layer 2 Cluster Size 1",101,-10.,10.);
00075   hGlobal2ResClu1La3 = dbe->book1D("GlobalResidualsClu1La3","RPC Residuals Layer 3 Cluster Size 1",101,-10.,10.);
00076   hGlobal2ResClu1La4 = dbe->book1D("GlobalResidualsClu1La4","RPC Residuals Layer 4 Cluster Size 1",101,-10.,10.);
00077   hGlobal2ResClu1La5 = dbe->book1D("GlobalResidualsClu1La5","RPC Residuals Layer 5 Cluster Size 1",101,-10.,10.);
00078   hGlobal2ResClu1La6 = dbe->book1D("GlobalResidualsClu1La6","RPC Residuals Layer 6 Cluster Size 1",101,-10.,10.);
00079 
00080   hGlobal2ResClu2La1 = dbe->book1D("GlobalResidualsClu2La1","RPC Residuals Layer 1 Cluster Size 2",101,-10.,10.);
00081   hGlobal2ResClu2La2 = dbe->book1D("GlobalResidualsClu2La2","RPC Residuals Layer 2 Cluster Size 2",101,-10.,10.);
00082   hGlobal2ResClu2La3 = dbe->book1D("GlobalResidualsClu2La3","RPC Residuals Layer 3 Cluster Size 2",101,-10.,10.);
00083   hGlobal2ResClu2La4 = dbe->book1D("GlobalResidualsClu2La4","RPC Residuals Layer 4 Cluster Size 2",101,-10.,10.);
00084   hGlobal2ResClu2La5 = dbe->book1D("GlobalResidualsClu2La5","RPC Residuals Layer 5 Cluster Size 2",101,-10.,10.);
00085   hGlobal2ResClu2La6 = dbe->book1D("GlobalResidualsClu2La6","RPC Residuals Layer 6 Cluster Size 2",101,-10.,10.);
00086 
00087   hGlobal2ResClu3La1 = dbe->book1D("GlobalResidualsClu3La1","RPC Residuals Layer 1 Cluster Size 3",101,-10.,10.);
00088   hGlobal2ResClu3La2 = dbe->book1D("GlobalResidualsClu3La2","RPC Residuals Layer 2 Cluster Size 3",101,-10.,10.);
00089   hGlobal2ResClu3La3 = dbe->book1D("GlobalResidualsClu3La3","RPC Residuals Layer 3 Cluster Size 3",101,-10.,10.);
00090   hGlobal2ResClu3La4 = dbe->book1D("GlobalResidualsClu3La4","RPC Residuals Layer 4 Cluster Size 3",101,-10.,10.);
00091   hGlobal2ResClu3La5 = dbe->book1D("GlobalResidualsClu3La5","RPC Residuals Layer 5 Cluster Size 3",101,-10.,10.);
00092   hGlobal2ResClu3La6 = dbe->book1D("GlobalResidualsClu3La6","RPC Residuals Layer 6 Cluster Size 3",101,-10.,10.);
00093 
00094   if(debug) std::cout<<"Booking Residuals EndCaps"<<std::endl;
00095   dbe->setCurrentFolder(folderPath+"ResidualsEndCaps/");
00096 
00097   //Endcap  
00098   hGlobal2ResClu1R3C = dbe->book1D("GlobalResidualsClu1R3C","RPC Residuals Ring 3 Roll C Cluster Size 1",101,-10.,10.);
00099   hGlobal2ResClu1R3B = dbe->book1D("GlobalResidualsClu1R3B","RPC Residuals Ring 3 Roll B Cluster Size 1",101,-10.,10.);
00100   hGlobal2ResClu1R3A = dbe->book1D("GlobalResidualsClu1R3A","RPC Residuals Ring 3 Roll A Cluster Size 1",101,-10.,10.);
00101   hGlobal2ResClu1R2C = dbe->book1D("GlobalResidualsClu1R2C","RPC Residuals Ring 2 Roll C Cluster Size 1",101,-10.,10.);
00102   hGlobal2ResClu1R2B = dbe->book1D("GlobalResidualsClu1R2B","RPC Residuals Ring 2 Roll B Cluster Size 1",101,-10.,10.);
00103   hGlobal2ResClu1R2A = dbe->book1D("GlobalResidualsClu1R2A","RPC Residuals Ring 2 Roll A Cluster Size 1",101,-10.,10.);
00104   
00105   hGlobal2ResClu2R3C = dbe->book1D("GlobalResidualsClu2R3C","RPC Residuals Ring 3 Roll C Cluster Size 2",101,-10.,10.);
00106   hGlobal2ResClu2R3B = dbe->book1D("GlobalResidualsClu2R3B","RPC Residuals Ring 3 Roll B Cluster Size 2",101,-10.,10.);
00107   hGlobal2ResClu2R3A = dbe->book1D("GlobalResidualsClu2R3A","RPC Residuals Ring 3 Roll A Cluster Size 2",101,-10.,10.);
00108   hGlobal2ResClu2R2C = dbe->book1D("GlobalResidualsClu2R2C","RPC Residuals Ring 2 Roll C Cluster Size 2",101,-10.,10.);
00109   hGlobal2ResClu2R2B = dbe->book1D("GlobalResidualsClu2R2B","RPC Residuals Ring 2 Roll B Cluster Size 2",101,-10.,10.);
00110   hGlobal2ResClu2R2A = dbe->book1D("GlobalResidualsClu2R2A","RPC Residuals Ring 2 Roll A Cluster Size 2",101,-10.,10.);
00111   
00112   hGlobal2ResClu3R3C = dbe->book1D("GlobalResidualsClu3R3C","RPC Residuals Ring 3 Roll C Cluster Size 3",101,-10.,10.);
00113   hGlobal2ResClu3R3B = dbe->book1D("GlobalResidualsClu3R3B","RPC Residuals Ring 3 Roll B Cluster Size 3",101,-10.,10.);
00114   hGlobal2ResClu3R3A = dbe->book1D("GlobalResidualsClu3R3A","RPC Residuals Ring 3 Roll A Cluster Size 3",101,-10.,10.);
00115   hGlobal2ResClu3R2C = dbe->book1D("GlobalResidualsClu3R2C","RPC Residuals Ring 2 Roll C Cluster Size 3",101,-10.,10.);
00116   hGlobal2ResClu3R2B = dbe->book1D("GlobalResidualsClu3R2B","RPC Residuals Ring 2 Roll B Cluster Size 3",101,-10.,10.);
00117   hGlobal2ResClu3R2A = dbe->book1D("GlobalResidualsClu3R2A","RPC Residuals Ring 2 Roll A Cluster Size 3",101,-10.,10.);
00118 
00119   if(debug) std::cout<<"Booking EffDistros"<<std::endl;
00120   dbe->setCurrentFolder(folderPath);
00121 
00122   if(debug) std::cout<<"Booking statistcs2"<<std::endl;
00123   dbe->setCurrentFolder(folderPath);
00124   statistics2 = dbe->book1D("AllStatistics","Analyzed Events DT and CSC Segments",33,0.5,33.5);
00125   
00126   //Barrel 
00127   
00128   dbe->setCurrentFolder(folderPath+"Wheel_-2");
00129   EffDistroWm2=dbe->book1D("EffDistroWheel_-2near","Efficiency Distribution for Near Side Wheel -2 ",20,0.5,100.5);
00130   EffDistroWm2far=dbe->book1D("EffDistroWheel_-2far","Efficiency Distribution for Far Side Wheel -2 ",20,0.5,100.5);
00131   EffGlobWm2=dbe->book1D("GlobEfficiencyWheel_-2near","Efficiency Near Side Wheel -2 ",101,0.5,101.5);
00132   EffGlobWm2far=dbe->book1D("GlobEfficiencyWheel_-2far","Efficiency Far Side Wheel -2",105,0.5,105.5);
00133   BXGlobWm2= dbe->book1D("GlobBXWheel_-2near","BX Near Side Wheel -2",101,0.5,101.5);
00134   BXGlobWm2far= dbe->book1D("GlobBXWheel_-2far","BX Far Side Wheel -2",105,0.5,105.5);
00135   MaskedGlobWm2= dbe->book1D("GlobMaskedWheel_-2near","Masked Near Side Wheel -2",101,0.5,101.5);
00136   MaskedGlobWm2far= dbe->book1D("GlobMaskedWheel_-2far","Masked Far Side Wheel -2",105,0.5,105.5);
00137   AverageEffWm2=dbe->book1D("AverageEfficiencyWheel_-2near","Average Efficiency Near Side Wheel -2 ",101,0.5,101.5);
00138   AverageEffWm2far =dbe->book1D("AverageEfficiencyWheel_-2far","Average Efficiency Far Side Wheel -2 ",105,0.5,105.5);
00139   NoPredictionWm2=dbe->book1D("NoPredictionWheel_-2near","No Predictions Near Side Wheel -2 ",101,0.5,101.5);
00140   NoPredictionWm2far=dbe->book1D("NoPredictionWheel_-2far","No Predictions Efficiency Far Side Wheel -2 ",105,0.5,105.5);
00141   
00142   dbe->setCurrentFolder(folderPath+"Wheel_-1");
00143   EffDistroWm1=dbe->book1D("EffDistroWheel_-1near","Efficiency Distribution for Near Side Wheel -1 ",20,0.5,100.5);
00144   EffDistroWm1far=dbe->book1D("EffDistroWheel_-1far","Efficiency Distribution for Far Side Wheel -1 ",20,0.5,100.5);
00145   EffGlobWm1= dbe->book1D("GlobEfficiencyWheel_-1near","Efficiency Near Side Wheel -1",101,0.5,101.5);
00146   EffGlobWm1far=dbe->book1D("GlobEfficiencyWheel_-1far","Efficiency Far Side Wheel -1",105,0.5,105.5);
00147   BXGlobWm1= dbe->book1D("GlobBXWheel_-1near","BX Near Side Wheel -1",101,0.5,101.5);
00148   BXGlobWm1far= dbe->book1D("GlobBXWheel_-1far","BX Far Side Wheel -1",105,0.5,105.5);
00149   MaskedGlobWm1= dbe->book1D("GlobMaskedWheel_-1near","Masked Near Side Wheel -1",101,0.5,101.5);
00150   MaskedGlobWm1far= dbe->book1D("GlobMaskedWheel_-1far","Masked Far Side Wheel -1",105,0.5,105.5);
00151   AverageEffWm1=dbe->book1D("AverageEfficiencyWheel_-1near","Average Efficiency Near Side Wheel -1 ",101,0.5,101.5);
00152   AverageEffWm1far=dbe->book1D("AverageEfficiencyWheel_-1far","Average Efficiency Far Side Wheel -1 ",105,0.5,105.5);
00153   NoPredictionWm1=dbe->book1D("NoPredictionWheel_-1near","No Predictions Near Side Wheel -1 ",101,0.5,101.5);
00154   NoPredictionWm1far=dbe->book1D("NoPredictionWheel_-1far","No Predictions Efficiency Far Side Wheel -1 ",105,0.5,105.5);
00155 
00156   dbe->setCurrentFolder(folderPath+"Wheel_0");
00157   EffDistroW0=dbe->book1D("EffDistroWheel_0near","Efficiency Distribution for Near Side Wheel 0 ",20,0.5,100.5);
00158   EffDistroW0far=dbe->book1D("EffDistroWheel_0far","Efficiency Distribution for Far Side Wheel 0 ",20,0.5,100.5);
00159   EffGlobW0 = dbe->book1D("GlobEfficiencyWheel_0near","Efficiency Near Side Wheel 0",101,0.5,101.5);
00160   EffGlobW0far =dbe->book1D("GlobEfficiencyWheel_0far","Efficiency Far Side Wheel 0",105,0.5,105.5);
00161   BXGlobW0 = dbe->book1D("GlobBXWheel_0near","BX Near Side Wheel 0",101,0.5,101.5);
00162   BXGlobW0far = dbe->book1D("GlobBXWheel_0far","BX Far Side Wheel 0",105,0.5,105.5);
00163   MaskedGlobW0 = dbe->book1D("GlobMaskedWheel_0near","Masked Near Side Wheel 0",101,0.5,101.5);
00164   MaskedGlobW0far = dbe->book1D("GlobMaskedWheel_0far","Masked Far Side Wheel 0",105,0.5,105.5);
00165   AverageEffW0=dbe->book1D("AverageEfficiencyWheel_0near","Average Efficiency Near Side Wheel 0 ",101,0.5,101.5);
00166   AverageEffW0far=dbe->book1D("AverageEfficiencyWheel_0far","Average Efficiency Far Side Wheel 0 ",105,0.5,105.5);
00167   NoPredictionW0=dbe->book1D("NoPredictionWheel_0near","No Predictions Near Side Wheel 0 ",101,0.5,101.5);
00168   NoPredictionW0far=dbe->book1D("NoPredictionWheel_0far","No Predictions Efficiency Far Side Wheel 0 ",105,0.5,105.5);
00169 
00170   dbe->setCurrentFolder(folderPath+"Wheel_1");
00171   EffDistroW1=dbe->book1D("EffDistroWheel_1near","Efficiency Distribution for Near Side Wheel 1 ",20,0.5,100.5);
00172   EffDistroW1far=dbe->book1D("EffDistroWheel_1far","Efficiency Distribution for Far Side Wheel 1 ",20,0.5,100.5);
00173   EffGlobW1 = dbe->book1D("GlobEfficiencyWheel_1near","Efficiency Near Side Wheel 1",101,0.5,101.5);
00174   EffGlobW1far =dbe->book1D("GlobEfficiencyWheel_1far","Efficiency Far Side Wheel 1",105,0.5,105.5);  
00175   BXGlobW1 = dbe->book1D("GlobBXWheel_1near","BX Near Side Wheel 1",101,0.5,101.5);
00176   BXGlobW1far = dbe->book1D("GlobBXWheel_1far","BX Far Side Wheel 1",105,0.5,105.5);
00177   MaskedGlobW1 = dbe->book1D("GlobMaskedWheel_1near","Masked Near Side Wheel 1",101,0.5,101.5);
00178   MaskedGlobW1far = dbe->book1D("GlobMaskedWheel_1far","Masked Far Side Wheel 1",105,0.5,105.5);
00179   AverageEffW1=dbe->book1D("AverageEfficiencyWheel_1near","Average Efficiency Near Side Wheel 1 ",101,0.5,101.5);
00180   AverageEffW1far=dbe->book1D("AverageEfficiencyWheel_1far","Average Efficiency Far Side Wheel 1 ",105,0.5,105.5);
00181   NoPredictionW1=dbe->book1D("NoPredictionWheel_1near","No Predictions Near Side Wheel 1 ",101,0.5,101.5);
00182   NoPredictionW1far=dbe->book1D("NoPredictionWheel_1far","No Predictions Efficiency Far Side Wheel 1 ",105,0.5,105.5);
00183 
00184   dbe->setCurrentFolder(folderPath+"Wheel_2");
00185   EffDistroW2=dbe->book1D("EffDistroWheel_2near","Efficiency Distribution for Near Side Wheel 2 ",20,0.5,100.5);
00186   EffDistroW2far=dbe->book1D("EffDistroWheel_2far","Efficiency Distribution for Far Side Wheel 2 ",20,0.5,100.5);
00187   EffGlobW2 = dbe->book1D("GlobEfficiencyWheel_2near","Efficiency Near Side Wheel 2",101,0.5,101.5);
00188   EffGlobW2far =dbe->book1D("GlobEfficiencyWheel_2far","Efficiency Far Side Wheel 2",105,0.5,105.5);
00189   BXGlobW2 = dbe->book1D("GlobBXWheel_2near","BX Near Side Wheel 2",101,0.5,101.5);
00190   BXGlobW2far = dbe->book1D("GlobBXWheel_2far","BX Far Side Wheel 2",105,0.5,105.5);
00191   MaskedGlobW2 = dbe->book1D("GlobMaskedWheel_2near","Masked Near Side Wheel 2",101,0.5,101.5);
00192   MaskedGlobW2far = dbe->book1D("GlobMaskedWheel_2far","Masked Far Side Wheel 2",105,0.5,105.5);
00193   AverageEffW2=dbe->book1D("AverageEfficiencyWheel_2near","Average Efficiency Near Side Wheel 2 ",101,0.5,101.5);
00194   AverageEffW2far=dbe->book1D("AverageEfficiencyWheel_2far","Average Efficiency Far Side Wheel 2 ",105,0.5,105.5);
00195   NoPredictionW2=dbe->book1D("NoPredictionWheel_2near","No Predictions Near Side Wheel 2 ",101,0.5,101.5);
00196   NoPredictionW2far=dbe->book1D("NoPredictionWheel_2far","No Predictions Efficiency Far Side Wheel 2 ",105,0.5,105.5);
00197 
00198   //EndCap
00199 
00200   dbe->setCurrentFolder(folderPath+"Disk_3");
00201   EffDistroD3=dbe->book1D("EffDistroDisk_3near","Efficiency Distribution Near Side Disk 3 ",20,0.5,100.5);
00202   EffDistroD3far=dbe->book1D("EffDistroDisk_3far","Efficiency Distribution Far Side Disk 3 ",20,0.5,100.5);
00203   EffGlobD3 = dbe->book1D("GlobEfficiencyDisk_3near","Efficiency Near Side Disk 3",109,0.5,109.5);
00204   EffGlobD3far =dbe->book1D("GlobEfficiencyDisk_3far","Efficiency Far Side Disk 3",109,0.5,109.5);
00205   BXGlobD3 = dbe->book1D("GlobBXDisk_3near","BX Near Side Disk 3",109,0.5,109.5);
00206   BXGlobD3far = dbe->book1D("GlobBXDisk_3far","BX Far Side Disk 3",109,0.5,109.5);
00207   MaskedGlobD3 = dbe->book1D("GlobMaskedDisk_3near","Masked Near Side Disk 3",109,0.5,109.5);
00208   MaskedGlobD3far = dbe->book1D("GlobMaskedDisk_3far","Masked Far Side Disk 3",109,0.5,109.5);
00209   AverageEffD3=dbe->book1D("AverageEfficiencyDisk_3near","Average Efficiency Near Side Disk 3 ",109,0.5,109.5);
00210   AverageEffD3far=dbe->book1D("AverageEfficiencyDisk_3far","Average Efficiency Far Side Disk 3 ",109,0.5,109.5);
00211   NoPredictionD3=dbe->book1D("NoPredictionDisk_3near","No Predictions Near Side Disk 3 ",109,0.5,109.5);
00212   NoPredictionD3far=dbe->book1D("NoPredictionDisk_3far","No Predictions Efficiency Far Side Disk 3 ",109,0.5,109.5);
00213 
00214   dbe->setCurrentFolder(folderPath+"Disk_2");
00215   EffDistroD2=dbe->book1D("EffDistroDisk_2near","Efficiency Distribution Near Side Disk 2 ",20,0.5,100.5);
00216   EffDistroD2far=dbe->book1D("EffDistroDisk_2far","Efficiency Distribution Far Side Disk 2 ",20,0.5,100.5);
00217   EffGlobD2 = dbe->book1D("GlobEfficiencyDisk_2near","Efficiency Near Side Disk 2",109,0.5,109.5);
00218   EffGlobD2far =dbe->book1D("GlobEfficiencyDisk_2far","Efficiency Far Side Disk 2",109,0.5,109.5);
00219   BXGlobD2 = dbe->book1D("GlobBXDisk_2near","BX Near Side Disk 2",109,0.5,109.5);
00220   BXGlobD2far = dbe->book1D("GlobBXDisk_2far","BX Far Side Disk 2",109,0.5,109.5);
00221   MaskedGlobD2 = dbe->book1D("GlobMaskedDisk_2near","Masked Near Side Disk 2",109,0.5,109.5);
00222   MaskedGlobD2far = dbe->book1D("GlobMaskedDisk_2far","Masked Far Side Disk 2",109,0.5,109.5);
00223   AverageEffD2=dbe->book1D("AverageEfficiencyDisk_2near","Average Efficiency Near Side Disk 2 ",109,0.5,109.5);
00224   AverageEffD2far=dbe->book1D("AverageEfficiencyDisk_2far","Average Efficiency Far Side Disk 2 ",109,0.5,109.5);
00225   NoPredictionD2=dbe->book1D("NoPredictionDisk_2near","No Predictions Near Side Disk 2 ",109,0.5,109.5);
00226   NoPredictionD2far=dbe->book1D("NoPredictionDisk_2far","No Predictions Efficiency Far Side Disk 2 ",109,0.5,109.5);
00227 
00228   dbe->setCurrentFolder(folderPath+"Disk_1");
00229   EffDistroD1=dbe->book1D("EffDistroDisk_1near","Efficiency Distribution Near Side Disk 1 ",20,0.5,100.5);
00230   EffDistroD1far=dbe->book1D("EffDistroDisk_1far","Efficiency Distribution Far Side Disk 1 ",20,0.5,100.5);
00231   EffGlobD1 = dbe->book1D("GlobEfficiencyDisk_1near","Efficiency Near Side Disk 1",109,0.5,109.5);
00232   EffGlobD1far =dbe->book1D("GlobEfficiencyDisk_1far","Efficiency Far Side Disk 1",109,0.5,109.5);
00233   BXGlobD1 = dbe->book1D("GlobBXDisk_1near","BX Near Side Disk 1",109,0.5,109.5);
00234   BXGlobD1far = dbe->book1D("GlobBXDisk_1far","BX Far Side Disk 1",109,0.5,109.5);
00235   MaskedGlobD1 = dbe->book1D("GlobMaskedDisk_1near","Masked Near Side Disk 1",109,0.5,109.5);
00236   MaskedGlobD1far = dbe->book1D("GlobMaskedDisk_1far","Masked Far Side Disk 1",109,0.5,109.5);
00237   AverageEffD1=dbe->book1D("AverageEfficiencyDisk_1near","Average Efficiency Near Side Disk 1 ",109,0.5,109.5);
00238   AverageEffD1far=dbe->book1D("AverageEfficiencyDisk_1far","Average Efficiency Far Side Disk 1 ",109,0.5,109.5);
00239   NoPredictionD1=dbe->book1D("NoPredictionDisk_1near","No Predictions Near Side Disk 1 ",109,0.5,109.5);
00240   NoPredictionD1far=dbe->book1D("NoPredictionDisk_1far","No Predictions Efficiency Far Side Disk 1 ",109,0.5,109.5);
00241 
00242   dbe->setCurrentFolder(folderPath+"Disk_-1");
00243   EffDistroDm1=dbe->book1D("EffDistroDisk_m1near","Efficiency Distribution Near Side Disk - 1 ",20,0.5,100.5);
00244   EffDistroDm1far=dbe->book1D("EffDistroDisk_m1far","Efficiency Distribution Far Side Disk - 1 ",20,0.5,100.5);
00245   EffGlobDm1 = dbe->book1D("GlobEfficiencyDisk_m1near","Efficiency Near Side Disk -1",109,0.5,109.5);
00246   EffGlobDm1far =dbe->book1D("GlobEfficiencyDisk_m1far","Efficiency Far Side Disk -1",109,0.5,109.5);
00247   BXGlobDm1 = dbe->book1D("GlobBXDisk_m1near","BX Near Side Disk -1",109,0.5,109.5);
00248   BXGlobDm1far = dbe->book1D("GlobBXDisk_m1far","BX Far Side Disk -1",109,0.5,109.5);
00249   MaskedGlobDm1 = dbe->book1D("GlobMaskedDisk_m1near","Masked Near Side Disk -1",109,0.5,109.5);
00250   MaskedGlobDm1far = dbe->book1D("GlobMaskedDisk_m1far","Masked Far Side Disk -1",109,0.5,109.5);
00251   AverageEffDm1=dbe->book1D("AverageEfficiencyDisk_m1near","Average Efficiency Near Side Disk -1 ",109,0.5,109.5);
00252   AverageEffDm1far=dbe->book1D("AverageEfficiencyDisk_m1far","Average Efficiency Far Side Disk -1 ",109,0.5,109.5);
00253   NoPredictionDm1=dbe->book1D("NoPredictionDisk_m1near","No Predictions Near Side Disk -1 ",109,0.5,109.5);
00254   NoPredictionDm1far=dbe->book1D("NoPredictionDisk_m1far","No Predictions Efficiency Far Side Disk -1 ",109,0.5,109.5);
00255 
00256   dbe->setCurrentFolder(folderPath+"Disk_-2");
00257   EffDistroDm2=dbe->book1D("EffDistroDisk_m2near","Efficiency Distribution Near Side Disk - 2 ",20,0.5,100.5);
00258   EffDistroDm2far=dbe->book1D("EffDistroDisk_m2far","Efficiency Distribution Far Side Disk - 2 ",20,0.5,100.5);
00259   EffGlobDm2 = dbe->book1D("GlobEfficiencyDisk_m2near","Efficiency Near Side Disk -2",109,0.5,109.5);
00260   EffGlobDm2far =dbe->book1D("GlobEfficiencyDisk_m2far","Efficiency Far Side Disk -2",109,0.5,109.5);
00261   BXGlobDm2 = dbe->book1D("GlobBXDisk_m2near","BX Near Side Disk -2",109,0.5,109.5);
00262   BXGlobDm2far = dbe->book1D("GlobBXDisk_m2far","BX Far Side Disk -2",109,0.5,109.5);
00263   MaskedGlobDm2 = dbe->book1D("GlobMaskedDisk_m2near","Masked Near Side Disk -2",109,0.5,109.5);
00264   MaskedGlobDm2far = dbe->book1D("GlobMaskedDisk_m2far","Masked Far Side Disk -2",109,0.5,109.5);
00265   AverageEffDm2=dbe->book1D("AverageEfficiencyDisk_m2near","Average Efficiency Near Side Disk -2 ",109,0.5,109.5);
00266   AverageEffDm2far=dbe->book1D("AverageEfficiencyDisk_m2far","Average Efficiency Far Side Disk -2 ",109,0.5,109.5);
00267   NoPredictionDm2=dbe->book1D("NoPredictionDisk_m2near","No Predictions Near Side Disk -2 ",109,0.5,109.5);
00268   NoPredictionDm2far=dbe->book1D("NoPredictionDisk_m2far","No Predictions Efficiency Far Side Disk -2 ",109,0.5,109.5);
00269 
00270   dbe->setCurrentFolder(folderPath+"Disk_-3");
00271   EffDistroDm3=dbe->book1D("EffDistroDisk_m3near","Efficiency Distribution Near Side Disk - 3 ",20,0.5,100.5);
00272   EffDistroDm3far=dbe->book1D("EffDistroDisk_m3far","Efficiency Distribution Far Side Disk - 3 ",20,0.5,100.5);
00273   EffGlobDm3 = dbe->book1D("GlobEfficiencyDisk_m3near","Efficiency Near Side Disk -3",109,0.5,109.5);
00274   EffGlobDm3far =dbe->book1D("GlobEfficiencyDisk_m3far","Efficiency Far Side Disk -3",109,0.5,109.5);
00275   BXGlobDm3 = dbe->book1D("GlobBXDisk_m3near","BX Near Side Disk -3",109,0.5,109.5);
00276   BXGlobDm3far = dbe->book1D("GlobBXDisk_m3far","BX Far Side Disk -3",109,0.5,109.5);
00277   MaskedGlobDm3 = dbe->book1D("GlobMaskedDisk_m3near","Masked Near Side Disk -3",109,0.5,109.5);
00278   MaskedGlobDm3far = dbe->book1D("GlobMaskedDisk_m3far","Masked Far Side Disk -3",109,0.5,109.5);
00279   AverageEffDm3=dbe->book1D("AverageEfficiencyDisk_m3near","Average Efficiency Near Side Disk -3 ",109,0.5,109.5);
00280   AverageEffDm3far=dbe->book1D("AverageEfficiencyDisk_m3far","Average Efficiency Far Side Disk -3 ",109,0.5,109.5);
00281   NoPredictionDm3=dbe->book1D("NoPredictionDisk_m3near","No Predictions Near Side Disk -3 ",109,0.5,109.5);
00282   NoPredictionDm3far=dbe->book1D("NoPredictionDisk_m3far","No Predictions Efficiency Far Side Disk -3 ",109,0.5,109.5);
00283 
00284   //Summary Histograms
00285   
00286 
00287   dbe->setCurrentFolder(folderPath);
00288   std::string os;
00289   os="Efficiency_Roll_vs_Sector_Wheel_-2";                                      
00290   Wheelm2Summary = dbe->book2D(os, os, 12, 0.5,12.5, 21, 0.5, 21.5);
00291   os="Efficiency_Roll_vs_Sector_Wheel_-1";                                      
00292   Wheelm1Summary = dbe->book2D(os, os, 12, 0.5,12.5, 21, 0.5, 21.5);
00293   os="Efficiency_Roll_vs_Sector_Wheel_0";                                      
00294   Wheel0Summary = dbe->book2D(os, os, 12, 0.5,12.5, 21, 0.5, 21.5);
00295   os="Efficiency_Roll_vs_Sector_Wheel_+1";                                      
00296   Wheel1Summary = dbe->book2D(os, os, 12, 0.5,12.5, 21, 0.5, 21.5);
00297   os="Efficiency_Roll_vs_Sector_Wheel_+2";                                      
00298   Wheel2Summary = dbe->book2D(os, os, 12, 0.5,12.5, 21, 0.5, 21.5);
00299 
00300   os="Efficiency_Roll_vs_Segment_Disk_-3";
00301   Diskm3Summary = dbe->book2D(os,os,36,0.5,36.5,6,0.5,6.5);
00302   os="Efficiency_Roll_vs_Segment_Disk_-2";
00303   Diskm2Summary = dbe->book2D(os,os,36,0.5,36.5,6,0.5,6.5);
00304   os="Efficiency_Roll_vs_Segment_Disk_-1";
00305   Diskm1Summary = dbe->book2D(os,os,36,0.5,36.5,6,0.5,6.5);
00306   os="Efficiency_Roll_vs_Segment_Disk_1";
00307   Disk1Summary = dbe->book2D(os,os,36,0.5,36.5,6,0.5,6.5);
00308   os="Efficiency_Roll_vs_Segment_Disk_2";
00309   Disk2Summary = dbe->book2D(os,os,36,0.5,36.5,6,0.5,6.5);
00310   os="Efficiency_Roll_vs_Segment_Disk_3";
00311   Disk3Summary = dbe->book2D(os,os,36,0.5,36.5,6,0.5,6.5);
00312   
00313   //Azimutal Histograms
00314 
00315   dbe->setCurrentFolder(folderPath+"Azimutal/");
00316   sectorEffWm2= dbe->book1D("AzimutalDistroWm2","Efficiency per Sector Wheel -2",12,0.5,12.5);
00317   sectorEffWm1= dbe->book1D("AzimutalDistroWm1","Efficiency per Sector Wheel -1",12,0.5,12.5);
00318   sectorEffW0= dbe->book1D("AzimutalDistroW0","Efficiency per Sector Wheel 0",12,0.5,12.5);
00319   sectorEffW1= dbe->book1D("AzimutalDistroW1","Efficiency per Sector Wheel 1",12,0.5,12.5);
00320   sectorEffW2= dbe->book1D("AzimutalDistroW2","Efficiency per Sector Wheel 2",12,0.5,12.5);
00321 
00322   OcsectorEffWm2= dbe->book1D("AzimutalDistroWm2","Occupancy per Sector Wheel -2",12,0.5,12.5);
00323   OcsectorEffWm1= dbe->book1D("AzimutalDistroWm1","Occupancy per Sector Wheel -1",12,0.5,12.5);
00324   OcsectorEffW0= dbe->book1D("AzimutalDistroW0","Ocuppancy per Sector Wheel 0",12,0.5,12.5);
00325   OcsectorEffW1= dbe->book1D("AzimutalDistroW1","Ocuppancy per Sector Wheel 1",12,0.5,12.5);
00326   OcsectorEffW2= dbe->book1D("AzimutalDistroW2","Ocupancy per Sector Wheel 2",12,0.5,12.5);
00327 
00328 
00329   ExsectorEffWm2= dbe->book1D("AzimutalDistroWm2","Expected per Sector Wheel -2",12,0.5,12.5);
00330   ExsectorEffWm1= dbe->book1D("AzimutalDistroWm1","Expected per Sector Wheel -1",12,0.5,12.5);
00331   ExsectorEffW0= dbe->book1D("AzimutalDistroW0","Expected per Sector Wheel 0",12,0.5,12.5);
00332   ExsectorEffW1= dbe->book1D("AzimutalDistroW1","Expected per Sector Wheel 1",12,0.5,12.5);
00333   ExsectorEffW2= dbe->book1D("AzimutalDistroW2","Expected per Sector Wheel 2",12,0.5,12.5);
00334   
00335   GregD1R2= dbe->book1D("GregDistroD1R2","Efficiency for Station 1 Ring 2",36,0.5,36.5);
00336   GregD1R3= dbe->book1D("GregDistroD1R3","Efficiency for Station 1 Ring 3",36,0.5,36.5);
00337   GregD2R2= dbe->book1D("GregDistroD2R2","Efficiency for Station 2 Ring 2",36,0.5,36.5);
00338   GregD2R3= dbe->book1D("GregDistroD2R3","Efficiency for Station 2 Ring 3",36,0.5,36.5);
00339   GregD3R2= dbe->book1D("GregDistroD3R2","Efficiency for Station 3 Ring 2",36,0.5,36.5);
00340   GregD3R3= dbe->book1D("GregDistroD3R3","Efficiency for Station 3 Ring 3",36,0.5,36.5);
00341 
00342   OcGregD1R2= dbe->book1D("OcGregDistroD1R2","Occupancy Distribution for Station 1 Ring 2",36,0.5,36.5);
00343   OcGregD1R3= dbe->book1D("OcGregDistroD1R3","Occupancy Distribution for Station 1 Ring 3",36,0.5,36.5);
00344   OcGregD2R2= dbe->book1D("OcGregDistroD2R2","Occupancy Distribution for Station 2 Ring 2",36,0.5,36.5);
00345   OcGregD2R3= dbe->book1D("OcGregDistroD2R3","Occupancy Distribution for Station 2 Ring 3",36,0.5,36.5);
00346   OcGregD3R2= dbe->book1D("OcGregDistroD3R2","Occupancy Distribution for Station 3 Ring 2",36,0.5,36.5);
00347   OcGregD3R3= dbe->book1D("OcGregDistroD3R3","Occupancy Distribution for Station 3 Ring 3",36,0.5,36.5);
00348 
00349   ExGregD1R2= dbe->book1D("ExGregDistroD1R2","Expected Distribution for Station 1 Ring 2",36,0.5,36.5);
00350   ExGregD1R3= dbe->book1D("ExGregDistroD1R3","Expected Distribution for Station 1 Ring 3",36,0.5,36.5);
00351   ExGregD2R2= dbe->book1D("ExGregDistroD2R2","Expected Distribution for Station 2 Ring 2",36,0.5,36.5);
00352   ExGregD2R3= dbe->book1D("ExGregDistroD2R3","Expected Distribution for Station 2 Ring 3",36,0.5,36.5);
00353   ExGregD3R2= dbe->book1D("ExGregDistroD3R2","Expected Distribution for Station 3 Ring 2",36,0.5,36.5);
00354   ExGregD3R3= dbe->book1D("ExGregDistroD3R3","Expected Distribution for Station 3 Ring 3",36,0.5,36.5);
00355 }
00356 
00357 void RPCEfficiencySecond::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup){ }
00358 
00359 void RPCEfficiencySecond::endRun(const edm::Run& r, const edm::EventSetup& iSetup){
00360 
00361   if(debug) std::cout <<"\t Getting the RPC Geometry"<<std::endl;
00362   edm::ESHandle<RPCGeometry> rpcGeo;
00363   iSetup.get<MuonGeometryRecord>().get(rpcGeo);
00364   
00365   std::string label,folder;
00366   folder = folderPath;
00367   label = folder + "MuonSegEff/Statistics";
00368   if(debug) std::cout<<"Getting statistcs="<<label<<std::endl;
00369   statistics = dbe->get(label);
00370   if(!statistics){
00371 
00372     std::cout<<"Statistics Doesn't exist Not access to a monitor element"<<std::endl;
00373     std::cout<<label<<std::endl;
00374     edm::LogWarning("Missing rpcSource in the sequence") << " Statistics Doesn't exist.";
00375     return;
00376   }
00377   if(debug) std::cout<<"Cloning statistcs"<<std::endl;
00378   for(int i=1;i<=33;i++){
00379     if(debug) std::cout<<statistics->getBinContent(i)<<std::endl;
00380     statistics2->setBinContent(i,statistics->getBinContent(i));
00381   }
00382   
00383   statistics2->setBinLabel(1,"Events ",1);
00384   statistics2->setBinLabel(2,"Events with DT seg",1);
00385   statistics2->setBinLabel(3,"1 DT seg",1);
00386   statistics2->setBinLabel(4,"2 DT seg",1);
00387   statistics2->setBinLabel(5,"3 DT seg",1);
00388   statistics2->setBinLabel(6,"4 DT seg",1);
00389   statistics2->setBinLabel(7,"5 DT seg",1);
00390   statistics2->setBinLabel(8,"6 DT seg",1);
00391   statistics2->setBinLabel(9,"7 DT seg",1);
00392   statistics2->setBinLabel(10,"8 DT seg",1);
00393   statistics2->setBinLabel(11,"9 DT seg",1);
00394   statistics2->setBinLabel(12,"10 DT seg",1);
00395   statistics2->setBinLabel(13,"11 DT seg",1);
00396   statistics2->setBinLabel(14,"12 DT seg",1);
00397   statistics2->setBinLabel(15,"13 DT seg",1);
00398   statistics2->setBinLabel(16,"14 DT seg",1);
00399   statistics2->setBinLabel(17,"15 DT seg",1);
00400   statistics2->setBinLabel(18,"Events with CSC seg",1);
00401   statistics2->setBinLabel(16+3,"1 CSC seg",1);
00402   statistics2->setBinLabel(16+4,"2 CSC seg",1);
00403   statistics2->setBinLabel(16+5,"3 CSC seg",1);
00404   statistics2->setBinLabel(16+6,"4 CSC seg",1);
00405   statistics2->setBinLabel(16+7,"5 CSC seg",1);
00406   statistics2->setBinLabel(16+8,"6 CSC seg",1);
00407   statistics2->setBinLabel(16+9,"7 CSC seg",1);
00408   statistics2->setBinLabel(16+10,"8 CSC seg",1);
00409   statistics2->setBinLabel(16+11,"9 CSC seg",1);
00410   statistics2->setBinLabel(16+12,"10 CSC seg",1);
00411   statistics2->setBinLabel(16+13,"11 CSC seg",1);
00412   statistics2->setBinLabel(16+14,"12 CSC seg",1);
00413   statistics2->setBinLabel(16+15,"13 CSC seg",1);
00414   statistics2->setBinLabel(16+16,"14 CSC seg",1);
00415   statistics2->setBinLabel(16+17,"15 CSC seg",1);
00416   
00417   //Cloning Residuals.
00418 
00419   folder = folderPath+"MuonSegEff/Residuals/Barrel/";
00420   
00421   label = folder + "GlobalResidualsClu1La1"; hGlobalResClu1La1 = dbe->get(label);
00422   label = folder + "GlobalResidualsClu1La2"; hGlobalResClu1La2 = dbe->get(label);
00423   label = folder + "GlobalResidualsClu1La3"; hGlobalResClu1La3 = dbe->get(label);
00424   label = folder + "GlobalResidualsClu1La4"; hGlobalResClu1La4 = dbe->get(label);
00425   label = folder + "GlobalResidualsClu1La5"; hGlobalResClu1La5 = dbe->get(label);
00426   label = folder + "GlobalResidualsClu1La6"; hGlobalResClu1La6 = dbe->get(label);
00427 
00428   label = folder + "GlobalResidualsClu2La1"; hGlobalResClu2La1 = dbe->get(label);
00429   label = folder + "GlobalResidualsClu2La2"; hGlobalResClu2La2 = dbe->get(label);
00430   label = folder + "GlobalResidualsClu2La3"; hGlobalResClu2La3 = dbe->get(label);
00431   label = folder + "GlobalResidualsClu2La4"; hGlobalResClu2La4 = dbe->get(label);
00432   label = folder + "GlobalResidualsClu2La5"; hGlobalResClu2La5 = dbe->get(label);
00433   label = folder + "GlobalResidualsClu2La6"; hGlobalResClu2La6 = dbe->get(label);
00434 
00435   label = folder + "GlobalResidualsClu3La1"; hGlobalResClu3La1 = dbe->get(label);
00436   label = folder + "GlobalResidualsClu3La2"; hGlobalResClu3La2 = dbe->get(label);
00437   label = folder + "GlobalResidualsClu3La3"; hGlobalResClu3La3 = dbe->get(label);
00438   label = folder + "GlobalResidualsClu3La4"; hGlobalResClu3La4 = dbe->get(label);
00439   label = folder + "GlobalResidualsClu3La5"; hGlobalResClu3La5 = dbe->get(label);
00440   label = folder + "GlobalResidualsClu3La6"; hGlobalResClu3La6 = dbe->get(label);
00441  
00442   if(debug) std::cout<<"Clonning for Barrel"<<std::endl;
00443   
00444   for(int i=1;i<=101;i++){
00445     if(debug) std::cout<<"Global Residual"<<hGlobalResClu1La1->getBinContent(i)<<std::endl;
00446     hGlobal2ResClu1La1->setBinContent(i,hGlobalResClu1La1->getBinContent(i));
00447     hGlobal2ResClu1La2->setBinContent(i,hGlobalResClu1La2->getBinContent(i));
00448     hGlobal2ResClu1La3->setBinContent(i,hGlobalResClu1La3->getBinContent(i));
00449     hGlobal2ResClu1La4->setBinContent(i,hGlobalResClu1La4->getBinContent(i));
00450     hGlobal2ResClu1La5->setBinContent(i,hGlobalResClu1La5->getBinContent(i));
00451     hGlobal2ResClu1La6->setBinContent(i,hGlobalResClu1La6->getBinContent(i));
00452 
00453     hGlobal2ResClu2La1->setBinContent(i,hGlobalResClu2La1->getBinContent(i));
00454     hGlobal2ResClu2La2->setBinContent(i,hGlobalResClu2La2->getBinContent(i));
00455     hGlobal2ResClu2La3->setBinContent(i,hGlobalResClu2La3->getBinContent(i));
00456     hGlobal2ResClu2La4->setBinContent(i,hGlobalResClu2La4->getBinContent(i));
00457     hGlobal2ResClu2La5->setBinContent(i,hGlobalResClu2La5->getBinContent(i));
00458     hGlobal2ResClu2La6->setBinContent(i,hGlobalResClu2La6->getBinContent(i));
00459 
00460     hGlobal2ResClu3La1->setBinContent(i,hGlobalResClu3La1->getBinContent(i));
00461     hGlobal2ResClu3La2->setBinContent(i,hGlobalResClu3La2->getBinContent(i));
00462     hGlobal2ResClu3La3->setBinContent(i,hGlobalResClu3La3->getBinContent(i));
00463     hGlobal2ResClu3La4->setBinContent(i,hGlobalResClu3La4->getBinContent(i));
00464     hGlobal2ResClu3La5->setBinContent(i,hGlobalResClu3La5->getBinContent(i));
00465     hGlobal2ResClu3La6->setBinContent(i,hGlobalResClu3La6->getBinContent(i));
00466   }
00467 
00468   if(debug) std::cout<<"Clonning the EndCap"<<std::endl;
00469   folder = folderPath+"MuonSegEff/Residuals/EndCap/";
00470   if(debug) std::cout<<folder<<std::endl;
00471   
00472   label = folder + "GlobalResidualsClu1R3C"; hGlobalResClu1R3C = dbe->get(label); 
00473   //if(!hGlobalResClu1R3C)std::cout<<"hGlobal2ResClu1R3C dont exist"<<std::endl;
00474   //std::cout<<label<<std::endl;
00475   label = folder + "GlobalResidualsClu1R3B"; hGlobalResClu1R3B = dbe->get(label);
00476   //if(!hGlobalResClu1R3B)std::cout<<"hGlobal2ResClu1R3B dont exist"<<std::endl;
00477   //std::cout<<label<<std::endl;
00478   label = folder + "GlobalResidualsClu1R3A"; hGlobalResClu1R3A = dbe->get(label); 
00479   label = folder + "GlobalResidualsClu1R2C"; hGlobalResClu1R2C = dbe->get(label); 
00480   label = folder + "GlobalResidualsClu1R2B"; hGlobalResClu1R2B = dbe->get(label); 
00481   label = folder + "GlobalResidualsClu1R2A"; hGlobalResClu1R2A = dbe->get(label); 
00482                                                                                            
00483   label = folder + "GlobalResidualsClu2R3C"; hGlobalResClu2R3C = dbe->get(label); 
00484   label = folder + "GlobalResidualsClu2R3B"; hGlobalResClu2R3B = dbe->get(label); 
00485   label = folder + "GlobalResidualsClu2R3A"; hGlobalResClu2R3A = dbe->get(label); 
00486   label = folder + "GlobalResidualsClu2R2C"; hGlobalResClu2R2C = dbe->get(label); 
00487   label = folder + "GlobalResidualsClu2R2B"; hGlobalResClu2R2B = dbe->get(label); 
00488   label = folder + "GlobalResidualsClu2R2A"; hGlobalResClu2R2A = dbe->get(label); 
00489                                                                                            
00490   label = folder + "GlobalResidualsClu3R3C"; hGlobalResClu3R3C = dbe->get(label); 
00491   label = folder + "GlobalResidualsClu3R3B"; hGlobalResClu3R3B = dbe->get(label); 
00492   label = folder + "GlobalResidualsClu3R3A"; hGlobalResClu3R3A = dbe->get(label); 
00493   label = folder + "GlobalResidualsClu3R2C"; hGlobalResClu3R2C = dbe->get(label); 
00494   label = folder + "GlobalResidualsClu3R2B"; hGlobalResClu3R2B = dbe->get(label); 
00495   label = folder + "GlobalResidualsClu3R2A"; hGlobalResClu3R2A = dbe->get(label); 
00496 
00497 
00498   if(debug) std::cout<<"Going for!"<<std::endl;
00499   /*for(int i=1;i<=101;i++){
00500     if(debug) std::cout<<i<<std::endl;
00501     hGlobal2ResClu1R3C->setBinContent(i,hGlobalResClu1R3C->getBinContent(i)); std::cout<<"hGlobal2ResClu1R3C"<<std::endl;
00502     hGlobal2ResClu1R3B->setBinContent(i,hGlobalResClu1R3B->getBinContent(i)); std::cout<<"hGlobal2ResClu1R3B"<<std::endl;
00503     hGlobal2ResClu1R3A->setBinContent(i,hGlobalResClu1R3A->getBinContent(i)); std::cout<<"hGlobal2ResClu1R3A"<<std::endl;
00504     hGlobal2ResClu1R2C->setBinContent(i,hGlobalResClu1R2C->getBinContent(i)); std::cout<<"hGlobal2ResClu1R2C"<<std::endl;
00505     hGlobal2ResClu1R2B->setBinContent(i,hGlobalResClu1R2B->getBinContent(i)); std::cout<<"hGlobal2ResClu1R2B"<<std::endl;
00506     hGlobal2ResClu1R2A->setBinContent(i,hGlobalResClu1R2A->getBinContent(i)); std::cout<<"hGlobal2ResClu1R2A"<<std::endl;
00507                                                                                                                        
00508     hGlobal2ResClu2R3C->setBinContent(i,hGlobalResClu2R3C->getBinContent(i)); std::cout<<"hGlobal2ResClu2R3C"<<std::endl;
00509     hGlobal2ResClu2R3B->setBinContent(i,hGlobalResClu2R3B->getBinContent(i)); std::cout<<"hGlobal2ResClu2R3B"<<std::endl;
00510     hGlobal2ResClu2R3A->setBinContent(i,hGlobalResClu2R3A->getBinContent(i)); std::cout<<"hGlobal2ResClu2R3A"<<std::endl;
00511     hGlobal2ResClu2R2C->setBinContent(i,hGlobalResClu2R2C->getBinContent(i)); std::cout<<"hGlobal2ResClu2R2C"<<std::endl;
00512     hGlobal2ResClu2R2B->setBinContent(i,hGlobalResClu2R2B->getBinContent(i)); std::cout<<"hGlobal2ResClu2R2B"<<std::endl;
00513     hGlobal2ResClu2R2A->setBinContent(i,hGlobalResClu2R2A->getBinContent(i)); std::cout<<"hGlobal2ResClu2R2A"<<std::endl;
00514                                                                                                                        
00515     hGlobal2ResClu3R3C->setBinContent(i,hGlobalResClu3R3C->getBinContent(i)); std::cout<<"hGlobal2ResClu3R3C"<<std::endl;
00516     hGlobal2ResClu3R3B->setBinContent(i,hGlobalResClu3R3B->getBinContent(i)); std::cout<<"hGlobal2ResClu3R3B"<<std::endl;
00517     hGlobal2ResClu3R3A->setBinContent(i,hGlobalResClu3R3A->getBinContent(i)); std::cout<<"hGlobal2ResClu3R3A"<<std::endl;
00518     hGlobal2ResClu3R2C->setBinContent(i,hGlobalResClu3R2C->getBinContent(i)); std::cout<<"hGlobal2ResClu3R2C"<<std::endl;
00519     hGlobal2ResClu3R2B->setBinContent(i,hGlobalResClu3R2B->getBinContent(i)); std::cout<<"hGlobal2ResClu3R2B"<<std::endl;
00520     hGlobal2ResClu3R2A->setBinContent(i,hGlobalResClu3R2A->getBinContent(i)); std::cout<<"hGlobal2ResClu3R2A"<<std::endl;
00521     }*/
00522    
00523   //Setting Labels in Summary Label.
00524   std::stringstream binLabel;
00525 
00526   if(debug) std::cout<<"Putting Labels"<<std::endl;
00527 
00528   for(int i=1;i<=12;i++){
00529     binLabel.str("");
00530     binLabel<<"Sec "<<i;
00531     Wheelm2Summary->setBinLabel(i,binLabel.str(),1);
00532     Wheelm1Summary->setBinLabel(i,binLabel.str(),1);
00533     Wheel0Summary->setBinLabel(i,binLabel.str(),1);
00534     Wheel1Summary->setBinLabel(i,binLabel.str(),1);
00535     Wheel2Summary->setBinLabel(i,binLabel.str(),1);
00536   }
00537   binLabel.str("");
00538 
00539   if(debug) std::cout<<"Default -1 for Barrel GUI"<<std::endl;
00540   
00541   for(int x = 1;x<=12;x++){
00542     for(int y = 1;y<=21;y++){
00543       Wheelm2Summary->setBinContent(x,y,-1);
00544       Wheelm1Summary->setBinContent(x,y,-1);
00545       Wheel0Summary->setBinContent(x,y,-1);
00546       Wheel1Summary->setBinContent(x,y,-1);
00547       Wheel2Summary->setBinContent(x,y,-1);
00548     }
00549   }
00550   
00551   for(int i=1;i<=36;i++){
00552     binLabel.str("");
00553     binLabel<<i;
00554     //if(debug) std::cout<<"Labeling EndCaps"<<binLabel.str()<<std::endl;
00555     Diskm3Summary->setBinLabel(i,binLabel.str(),1);
00556     Diskm2Summary->setBinLabel(i,binLabel.str(),1);
00557     Diskm1Summary->setBinLabel(i,binLabel.str(),1);
00558     Disk1Summary->setBinLabel(i,binLabel.str(),1);
00559     Disk2Summary->setBinLabel(i,binLabel.str(),1);
00560     Disk3Summary->setBinLabel(i,binLabel.str(),1);
00561   }
00562   
00563   for(int ri=2;ri<=3;ri++){
00564     for(int roll=1;roll<=3;roll++){
00565       binLabel.str("");
00566       if(roll==3) binLabel<<"Ring "<<ri<<" A";
00567       else if(roll==2) binLabel<<"Ring "<<ri<<" B";
00568       else if(roll==1) binLabel<<"Ring "<<ri<<" C";
00569       //if(debug) std::cout<<"Labeling EndCaps "<<binLabel.str()<<std::endl;
00570       Diskm3Summary->setBinLabel((ri-2)*3+roll,binLabel.str(),2);
00571       Diskm2Summary->setBinLabel((ri-2)*3+roll,binLabel.str(),2);
00572       Diskm1Summary->setBinLabel((ri-2)*3+roll,binLabel.str(),2);
00573       Disk1Summary->setBinLabel((ri-2)*3+roll,binLabel.str(),2);
00574       Disk2Summary->setBinLabel((ri-2)*3+roll,binLabel.str(),2);
00575       Disk3Summary->setBinLabel((ri-2)*3+roll,binLabel.str(),2);
00576     }
00577   }
00578 
00579   if(debug) std::cout<<"Default -1 for EndCap GUI"<<std::endl;
00580 
00581   for(int x = 1;x<=36;x++){
00582     for(int y = 1;y<=6;y++){
00583       Diskm3Summary->setBinContent(x,y,-1);
00584       Diskm2Summary->setBinContent(x,y,-1);
00585       Diskm1Summary->setBinContent(x,y,-1);
00586       Disk1Summary->setBinContent(x,y,-1);
00587       Disk2Summary->setBinContent(x,y,-1);
00588       Disk3Summary->setBinContent(x,y,-1);
00589     }
00590   }
00591 
00592   binLabel.str("");
00593 
00594   std::vector<std::string> rollNamesInter (22);
00595 
00596   rollNamesInter[1]="RB1in B";
00597   rollNamesInter[2]="RB1in F";
00598   rollNamesInter[3]="RB1out B";
00599   rollNamesInter[4]="RB1out F";
00600   rollNamesInter[5]="RB2in B";
00601   rollNamesInter[6]="RB2in M";
00602   rollNamesInter[7]="RB2in F";
00603   rollNamesInter[8]="RB2out B";
00604   rollNamesInter[9]="RB2out F";
00605   rollNamesInter[10]="RB3- B";
00606   rollNamesInter[11]="RB3- F";
00607   rollNamesInter[12]="RB3+ B";
00608   rollNamesInter[13]="RB3+ F";
00609   rollNamesInter[14]="RB4,-,-- B";
00610   rollNamesInter[15]="RB4,-,-- F";
00611   rollNamesInter[16]="RB4+,++ B";
00612   rollNamesInter[17]="RB4+,++ F";
00613   rollNamesInter[18]="RB4-+ B";
00614   rollNamesInter[19]="RB4-+ F";
00615   rollNamesInter[20]="RB4+- B";
00616   rollNamesInter[21]="RB4+- F";
00617 
00618   std::vector<std::string> rollNamesExter (22);
00619   
00620   for(int i=1;i<22;i++){
00621     rollNamesExter[i]=rollNamesInter[i];
00622   }
00623 
00624   rollNamesExter[6]="RB2in F";
00625   rollNamesExter[7]="RB2out B";
00626   rollNamesExter[8]="RB2out M";
00627 
00628   //for(int i=1;i<22;i++){
00629   //  std::cout<<rollNamesExter[i]<<std::endl;
00630   // }
00631 
00632   for(int i=1;i<22;i++){
00633     Wheelm1Summary->setBinLabel(i,rollNamesInter[i],2);
00634     Wheel0Summary->setBinLabel(i,rollNamesInter[i],2);
00635     Wheel1Summary->setBinLabel(i,rollNamesInter[i],2); 
00636   }
00637 
00638   for(int i=1;i<22;i++){
00639     Wheelm2Summary->setBinLabel(i,rollNamesExter[i],2);
00640     Wheel2Summary->setBinLabel(i,rollNamesExter[i],2);
00641   }
00642 
00643   int indexWheel[5];
00644   for(int j=0;j<5;j++){
00645     indexWheel[j]=0;
00646   }
00647   
00648   int indexWheelf[5];
00649   for(int j=0;j<5;j++){
00650     indexWheelf[j]=0;
00651   }
00652 
00653   int indexDisk[6];
00654   for(int j=0;j<6;j++){
00655     indexDisk[j]=0;
00656   }
00657   
00658   int indexDiskf[6];
00659   for(int j=0;j<6;j++){
00660     indexDiskf[j]=0;
00661   }
00662 
00663   for(TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
00664     if(dynamic_cast< RPCChamber* >( *it ) != 0 ){
00665       RPCChamber* ch = dynamic_cast< RPCChamber* >( *it ); 
00666       std::vector< const RPCRoll*> roles = (ch->rolls());
00667       for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
00668         RPCDetId rpcId = (*r)->id();
00669         RPCGeomServ rpcsrv(rpcId);
00670         std::string nameRoll = rpcsrv.name();
00671         if(debug) std::cout<<"Booking for "<<nameRoll<<std::endl;
00672         meCollection[rpcId.rawId()] = bookDetUnitSeg(rpcId,(*r)->nstrips(),folderPath);
00673       }
00674     }
00675   }
00676 
00677   //if(debug) dbe->showDirStructure();
00678 
00679   for(TrackingGeometry::DetContainer::const_iterator it=rpcGeo->dets().begin();it<rpcGeo->dets().end();it++){
00680     if(dynamic_cast< RPCChamber* >( *it ) != 0 ){
00681       RPCChamber* ch = dynamic_cast< RPCChamber* >( *it ); 
00682       std::vector< const RPCRoll*> roles = (ch->rolls());
00683       for(std::vector<const RPCRoll*>::const_iterator r = roles.begin();r != roles.end(); ++r){
00684         RPCDetId rpcId = (*r)->id();
00685         RPCGeomServ rpcsrv(rpcId);
00686         int sector = rpcId.sector();    
00687         std::string nameRoll = rpcsrv.name();
00688         std::map<std::string, MonitorElement*> meMap=meCollection[rpcId.rawId()];
00689         if(debug){
00690           std::map<std::string, MonitorElement*>::const_iterator it;
00691           for (it = meMap.begin(); it != meMap.end(); ++it){
00692             std::cout<<"Histo name:" <<it->first<<std::endl;
00693           }
00694         }
00695         
00696         if(meCollection.find(rpcId.rawId())==meCollection.end()){
00697           std::cout<<"WARNING!!! Empty RecHit collection map"<<std::endl;
00698         }
00699 
00700         if(debug){
00701           std::cout<<rpcId<<std::endl;
00702           //printing indexes
00703           std::cout<<"indexWheel=";
00704           for(int j=0;j<5;j++){
00705             std::cout<<indexWheel[j]<<" ";
00706           }
00707           std::cout<<std::endl;
00708           std::cout<<"indexWheelf=";
00709           for(int j=0;j<5;j++){
00710             std::cout<<indexWheelf[j]<<" ";
00711           }
00712           std::cout<<std::endl;
00713           std::cout<<"indexDisk=";
00714           for(int j=0;j<6;j++){
00715             std::cout<<indexDisk[j]<<" ";
00716           }
00717           std::cout<<std::endl;
00718           std::cout<<"indexDiskf=";
00719           for(int j=0;j<6;j++){
00720             std::cout<<indexDiskf[j]<<" ";
00721           }
00722           std::cout<<std::endl;
00723         }
00724         
00725         if(rpcId.region()==0){
00726           std::stringstream meIdRPC,  meIdDT,  bxDistroId;
00727           std::string      meIdPRO, meIdRPC2, meIdDT2, bxDistroId2;
00728           
00729           RPCBookFolderStructure *  folderStr = new RPCBookFolderStructure();
00730           
00731           std::string folder = folderPath+"MuonSegEff";
00732 
00733           if(debug) std::cout<<"Setting the folder "<<folder<<std::endl;
00734 
00735           meIdRPC<<folder<<"/RPCDataOccupancyFromDT_"<<rpcId.rawId();
00736           meIdDT<<folder<<"/ExpectedOccupancyFromDT_"<<rpcId.rawId();
00737           bxDistroId<<folder<<"/BXDistribution_"<<rpcId.rawId();
00738       
00739           std::string folder2 = folderPath+"RollByRoll/" +  folderStr->folderStructure(rpcId); 
00740 
00741           delete folderStr;
00742 
00743           meIdRPC2 = "RPCDataOccupancyFromDT_" + rpcsrv.name(); 
00744           meIdDT2 =  "ExpectedOccupancyFromDT_"+ rpcsrv.name();
00745           bxDistroId2 = "BXDistribution_"+ rpcsrv.name();
00746           
00747           meIdPRO = "Profile_"+ rpcsrv.name();
00748           
00749           histoRPC= dbe->get(meIdRPC.str());
00750           histoDT= dbe->get(meIdDT.str());
00751           histoPRO=dbe->get(meIdPRO);
00752           BXDistribution = dbe->get(bxDistroId.str());
00753 
00754           int NumberWithOutPrediction=0;
00755           double p = 0.;
00756           double o = 0.;
00757           float mybxhisto = 0.;
00758           float mybxerror = 0.;
00759           float ef = 0.;
00760           float er = 0.;
00761           float buffef = 0.;
00762           float buffer = 0.;
00763           float sumbuffef = 0.;
00764           float sumbuffer = 0.;
00765           float averageeff = 0.;
00766           float averageerr = 0.;
00767           int NumberStripsPointed = 0;
00768           
00769           if(debug) std::cout<<"Cloning BX"<<std::endl; //problema con sector 9 y sector 11
00770 
00771           for(int i=1;i<=11;i++){
00772             if(debug) std::cout<<i<<"-"<<BXDistribution->getBinContent(i)<<std::endl;
00773             meMap[bxDistroId2]->setBinContent(i,BXDistribution->getBinContent(i));
00774           }
00775           
00776           if(histoRPC && histoDT && BXDistribution){
00777             if(debug) std::cout <<rpcsrv.name()<<std::endl;
00778             
00779             for(int i=1;i<=int((*r)->nstrips());++i){
00780               if(debug) std::cout<<"Cloning histoDT "<<meIdDT2<<std::endl;
00781               meMap[meIdDT2]->setBinContent(i,histoDT->getBinContent(i));
00782               if(debug) std::cout<<"Cloning histoRPC:"<<meIdRPC2<<std::endl;
00783               meMap[meIdRPC2]->setBinContent(i,histoRPC->getBinContent(i));
00784               
00785               if(meMap.find(meIdPRO)==meMap.end()){
00786                 std::cout<<"Empty Map"<<std::endl;
00787               }
00788 
00789               if(histoDT->getBinContent(i)!=0){
00790                 if(debug) std::cout<<"Inside the If"<<std::endl;
00791                 buffef = float(histoRPC->getBinContent(i))/float(histoDT->getBinContent(i));
00792                 meMap[meIdPRO]->setBinContent(i,buffef); 
00793                 buffer = sqrt(buffef*(1.-buffef)/float(histoDT->getBinContent(i)));
00794                 meMap[meIdPRO]->setBinError(i,buffer);
00795                 sumbuffef=sumbuffef+buffef;
00796                 sumbuffer = sumbuffer + buffer*buffer;
00797                 NumberStripsPointed++;
00798               }else{
00799                 NumberWithOutPrediction++;
00800               }
00801               if(debug) std::cout<<"\t Strip="<<i<<" RPC="<<histoRPC->getBinContent(i)<<" DT="<<histoDT->getBinContent(i)<<" buffef="<<buffef<<" buffer="<<buffer<<" sumbuffef="<<sumbuffef<<" sumbuffer="<<sumbuffer<<" NumberStripsPointed="<<NumberStripsPointed<<" NumberWithOutPrediction"<<NumberWithOutPrediction<<std::endl;
00802             }
00803             
00804             p=histoDT->getTH1F()->Integral();
00805             o=histoRPC->getTH1F()->Integral();
00806             
00807             if(NumberStripsPointed!=0){
00808               averageeff = (sumbuffef/float(NumberStripsPointed))*100.;
00809               averageerr = sqrt(sumbuffer/float(NumberStripsPointed))*100.;
00810             }
00811             
00812             mybxhisto = 50.+BXDistribution->getMean()*10;
00813             mybxerror = BXDistribution->getRMS()*10;
00814             
00815           }
00816           
00817           int Ring = rpcId.ring();
00818           
00819           if(p!=0){
00820             ef = float(o)/float(p); 
00821             er = sqrt(ef*(1.-ef)/float(p));
00822           }
00823             
00824           ef=ef*100;
00825           er=er*100;
00826 
00827 
00828            //Filling azimutal Wheel Histograms
00829 
00830           int wheel = rpcId.ring();
00831           int sector = rpcId.sector();
00832           int region = rpcId.region();
00833           
00834           
00835           if(region ==0){
00836             if(wheel==-2){ExsectorEffWm2->Fill(sector,p); OcsectorEffWm2->Fill(sector,o);}
00837             else if(wheel==-1){ExsectorEffWm1->Fill(sector,p); OcsectorEffWm1->Fill(sector,o);}
00838             else if(wheel==0){ExsectorEffW0->Fill(sector,p); OcsectorEffW0->Fill(sector,o);}
00839             else if(wheel==1){ExsectorEffW1->Fill(sector,p); OcsectorEffW1->Fill(sector,o);}
00840             else if(wheel==2){ExsectorEffW2->Fill(sector,p); OcsectorEffW2->Fill(sector,o);}
00841           }
00842 
00843             
00844           std::string camera = rpcsrv.name();
00845             
00846           float nopredictionsratio = (float(NumberWithOutPrediction)/float((*r)->nstrips()))*100.;
00847 
00848           //Efficiency for Pigis Histos
00849 
00850           if(debug) std::cout<<"Pigi "<<camera<<" "<<rpcsrv.shortname()<<" "
00851                              <<(*r)->id()<<std::endl;
00852           
00853           if(p > 100){//We need at least 100 predictions to fill the summary plot
00854             if(abs((*r)->id().ring())==2){
00855               if(debug) std::cout<<rollY(rpcsrv.shortname(),rollNamesExter)
00856                                  <<"--"<<rpcsrv.shortname()
00857                                  <<" "<<rpcsrv.name()
00858                                  <<" averageEff"<<averageeff<<std::endl;
00859               if((*r)->id().ring()==2) Wheel2Summary->setBinContent((*r)->id().sector(),rollY(rpcsrv.shortname(),rollNamesExter),averageeff);
00860               else Wheelm2Summary->setBinContent((*r)->id().sector(),rollY(rpcsrv.shortname(),rollNamesExter),averageeff);
00861             }else{
00862               if(debug) std::cout<<rollY(rpcsrv.shortname(),rollNamesInter)
00863                                  <<"--"<<rpcsrv.shortname()
00864                                  <<" "<<rpcsrv.name()
00865                                  <<" averageEff"<<averageeff<<std::endl;
00866             
00867               if((*r)->id().ring()==-1) Wheelm1Summary->setBinContent((*r)->id().sector(),rollY(rpcsrv.shortname(),rollNamesInter),averageeff);
00868               else if((*r)->id().ring()==0) Wheel0Summary->setBinContent((*r)->id().sector(),rollY(rpcsrv.shortname(),rollNamesInter),averageeff);
00869               else if((*r)->id().ring()==1) Wheel1Summary->setBinContent((*r)->id().sector(),rollY(rpcsrv.shortname(),rollNamesInter),averageeff);
00870             }
00871           }
00872           
00873           //Near Side
00874 
00875           float maskedratio =0;
00876 
00877           if((sector==1||sector==2||sector==3||sector==10||sector==11||sector==12)){
00878             if(Ring==-2){
00879               EffDistroWm2->Fill(averageeff);
00880               indexWheel[0]++;  
00881               EffGlobWm2->setBinContent(indexWheel[0],ef);  
00882               EffGlobWm2->setBinError(indexWheel[0],er);  
00883               EffGlobWm2->setBinLabel(indexWheel[0],camera,1);
00884 
00885               BXGlobWm2->setBinContent(indexWheel[0],mybxhisto);  
00886               BXGlobWm2->setBinError(indexWheel[0],mybxerror);  
00887               BXGlobWm2->setBinLabel(indexWheel[0],camera,1);
00888               
00889               MaskedGlobWm2->setBinContent(indexWheel[0],maskedratio);  
00890               MaskedGlobWm2->setBinLabel(indexWheel[0],camera,1);
00891 
00892               AverageEffWm2->setBinContent(indexWheel[0],averageeff);
00893               AverageEffWm2->setBinError(indexWheel[0],averageerr);  
00894               AverageEffWm2->setBinLabel(indexWheel[0],camera,1);
00895               
00896               NoPredictionWm2->setBinContent(indexWheel[0],nopredictionsratio);
00897               NoPredictionWm2->setBinLabel(indexWheel[0],camera,1);
00898             }else if(Ring==-1){
00899               EffDistroWm1->Fill(averageeff);
00900               indexWheel[1]++;  
00901               EffGlobWm1->setBinContent(indexWheel[1],ef);  
00902               EffGlobWm1->setBinError(indexWheel[1],er);  
00903               EffGlobWm1->setBinLabel(indexWheel[1],camera,1);  
00904               
00905               BXGlobWm1->setBinContent(indexWheel[1],mybxhisto);  
00906               BXGlobWm1->setBinError(indexWheel[1],mybxerror);  
00907               BXGlobWm1->setBinLabel(indexWheel[1],camera,1);
00908               
00909               MaskedGlobWm1->setBinContent(indexWheel[1],maskedratio);  
00910               MaskedGlobWm1->setBinLabel(indexWheel[1],camera,1);
00911 
00912               AverageEffWm1->setBinContent(indexWheel[1],averageeff);
00913               AverageEffWm1->setBinError(indexWheel[1],averageerr);  
00914               AverageEffWm1->setBinLabel(indexWheel[1],camera,1);
00915               
00916               NoPredictionWm1->setBinContent(indexWheel[1],nopredictionsratio);
00917               NoPredictionWm1->setBinLabel(indexWheel[1],camera,1);
00918 
00919             }else if(Ring==0){
00920               EffDistroW0->Fill(averageeff);
00921               indexWheel[2]++;  
00922               EffGlobW0->setBinContent(indexWheel[2],ef);  
00923               EffGlobW0->setBinError(indexWheel[2],er);  
00924               EffGlobW0->setBinLabel(indexWheel[2],camera,1);  
00925               
00926               BXGlobW0->setBinContent(indexWheel[2],mybxhisto);  
00927               BXGlobW0->setBinError(indexWheel[2],mybxerror);  
00928               BXGlobW0->setBinLabel(indexWheel[2],camera,1);
00929 
00930               MaskedGlobW0->setBinContent(indexWheel[2],maskedratio);  
00931               MaskedGlobW0->setBinLabel(indexWheel[2],camera,1);
00932               
00933               AverageEffW0->setBinContent(indexWheel[2],averageeff);
00934               AverageEffW0->setBinError(indexWheel[2],averageerr);  
00935               AverageEffW0->setBinLabel(indexWheel[2],camera,1);
00936               
00937               NoPredictionW0->setBinContent(indexWheel[2],nopredictionsratio);
00938               NoPredictionW0->setBinLabel(indexWheel[2],camera,1);            
00939             }else if(Ring==1){
00940               EffDistroW1->Fill(averageeff);
00941               indexWheel[3]++;  
00942               EffGlobW1->setBinContent(indexWheel[3],ef);  
00943               EffGlobW1->setBinError(indexWheel[3],er);  
00944               EffGlobW1->setBinLabel(indexWheel[3],camera,1);  
00945               
00946               BXGlobW1->setBinContent(indexWheel[3],mybxhisto);  
00947               BXGlobW1->setBinError(indexWheel[3],mybxerror);  
00948               BXGlobW1->setBinLabel(indexWheel[3],camera,1);
00949 
00950               MaskedGlobW1->setBinContent(indexWheel[3],maskedratio);  
00951               MaskedGlobW1->setBinLabel(indexWheel[3],camera,1);
00952 
00953               AverageEffW1->setBinContent(indexWheel[3],averageeff);
00954               AverageEffW1->setBinError(indexWheel[3],averageerr);  
00955               AverageEffW1->setBinLabel(indexWheel[3],camera,1);
00956               
00957               NoPredictionW1->setBinContent(indexWheel[3],nopredictionsratio);
00958               NoPredictionW1->setBinLabel(indexWheel[3],camera,1);            
00959             }else if(Ring==2){
00960               EffDistroW2->Fill(averageeff);
00961               indexWheel[4]++;
00962               EffGlobW2->setBinContent(indexWheel[4],ef);
00963               EffGlobW2->setBinError(indexWheel[4],er);
00964               EffGlobW2->setBinLabel(indexWheel[4],camera,1);
00965 
00966               BXGlobW2->setBinContent(indexWheel[4],mybxhisto);  
00967               BXGlobW2->setBinError(indexWheel[4],mybxerror);  
00968               BXGlobW2->setBinLabel(indexWheel[4],camera,1);
00969               
00970               MaskedGlobW2->setBinContent(indexWheel[4],maskedratio);  
00971               MaskedGlobW2->setBinLabel(indexWheel[4],camera,1);
00972 
00973               AverageEffW2->setBinContent(indexWheel[4],averageeff);
00974               AverageEffW2->setBinError(indexWheel[4],averageerr);  
00975               AverageEffW2->setBinLabel(indexWheel[4],camera,1);
00976               
00977               NoPredictionW2->setBinContent(indexWheel[4],nopredictionsratio);
00978               NoPredictionW2->setBinLabel(indexWheel[4],camera,1);            
00979             }
00980           }else{//Far Side 
00981             if(Ring==-2){
00982               EffDistroWm2far->Fill(averageeff);
00983               indexWheelf[0]++;  
00984               EffGlobWm2far->setBinContent(indexWheelf[0],ef);  
00985               EffGlobWm2far->setBinError(indexWheelf[0],er);  
00986               EffGlobWm2far->setBinLabel(indexWheelf[0],camera,1);
00987 
00988               BXGlobWm2far->setBinContent(indexWheelf[0],mybxhisto);  
00989               BXGlobWm2far->setBinError(indexWheelf[0],mybxerror);  
00990               BXGlobWm2far->setBinLabel(indexWheelf[0],camera);
00991               
00992               MaskedGlobWm2far->setBinContent(indexWheelf[0],maskedratio);
00993               MaskedGlobWm2far->setBinLabel(indexWheelf[0],camera,1);
00994               
00995               AverageEffWm2far->setBinContent(indexWheelf[0],averageeff);
00996               AverageEffWm2far->setBinError(indexWheelf[0],averageerr);
00997               AverageEffWm2far->setBinLabel(indexWheelf[0],camera,1);
00998 
00999               NoPredictionWm2->setBinContent(indexWheel[0],nopredictionsratio);
01000               NoPredictionWm2->setBinLabel(indexWheel[0],camera,1);
01001 
01002             }else if(Ring==-1){
01003               EffDistroWm1far->Fill(averageeff);
01004               indexWheelf[1]++;  
01005               EffGlobWm1far->setBinContent(indexWheelf[1],ef);  
01006               EffGlobWm1far->setBinError(indexWheelf[1],er);  
01007               EffGlobWm1far->setBinLabel(indexWheelf[1],camera,1);  
01008               
01009               BXGlobWm1far->setBinContent(indexWheelf[1],mybxhisto);  
01010               BXGlobWm1far->setBinError(indexWheelf[1],mybxerror);  
01011               BXGlobWm1far->setBinLabel(indexWheelf[1],camera,1);
01012               
01013               MaskedGlobWm1far->setBinContent(indexWheelf[1],maskedratio);
01014               MaskedGlobWm1far->setBinLabel(indexWheelf[1],camera,1);
01015 
01016               AverageEffWm1far->setBinContent(indexWheelf[1],averageeff);
01017               AverageEffWm1far->setBinError(indexWheelf[1],averageerr);
01018               AverageEffWm1far->setBinLabel(indexWheelf[1],camera,1);
01019 
01020               NoPredictionWm1far->setBinContent(indexWheelf[1],nopredictionsratio);
01021               NoPredictionWm1far->setBinLabel(indexWheelf[1],camera,1);
01022 
01023             }else  if(Ring==0){
01024               EffDistroW0far->Fill(averageeff);
01025               indexWheelf[2]++;  
01026               EffGlobW0far->setBinContent(indexWheelf[2],ef);  
01027               EffGlobW0far->setBinError(indexWheelf[2],er);  
01028               EffGlobW0far->setBinLabel(indexWheelf[2],camera,1);  
01029               
01030               BXGlobW0far->setBinContent(indexWheelf[2],mybxhisto);  
01031               BXGlobW0far->setBinError(indexWheelf[2],mybxerror);  
01032               BXGlobW0far->setBinLabel(indexWheelf[2],camera,1);
01033 
01034               MaskedGlobW0far->setBinContent(indexWheelf[2],maskedratio);
01035               MaskedGlobW0far->setBinLabel(indexWheelf[2],camera,1);
01036 
01037               AverageEffW0far->setBinContent(indexWheelf[2],averageeff);
01038               AverageEffW0far->setBinError(indexWheelf[2],averageerr);
01039               AverageEffW0far->setBinLabel(indexWheelf[2],camera,1);
01040 
01041               NoPredictionW0far->setBinContent(indexWheelf[2],nopredictionsratio);
01042               NoPredictionW0far->setBinLabel(indexWheelf[2],camera,1);
01043             }else if(Ring==1){
01044               EffDistroW1far->Fill(averageeff);
01045               indexWheelf[3]++;  
01046               EffGlobW1far->setBinContent(indexWheelf[3],ef);  
01047               EffGlobW1far->setBinError(indexWheelf[3],er);  
01048               EffGlobW1far->setBinLabel(indexWheelf[3],camera,1);  
01049               
01050               BXGlobW1far->setBinContent(indexWheelf[3],mybxhisto);  
01051               BXGlobW1far->setBinError(indexWheelf[3],mybxerror);  
01052               BXGlobW1far->setBinLabel(indexWheelf[3],camera,1);
01053 
01054               MaskedGlobW1far->setBinContent(indexWheelf[3],maskedratio);
01055               MaskedGlobW1far->setBinLabel(indexWheelf[3],camera,1);
01056               
01057               AverageEffW1far->setBinContent(indexWheelf[3],averageeff);
01058               AverageEffW1far->setBinError(indexWheelf[3],averageerr);
01059               AverageEffW1far->setBinLabel(indexWheelf[3],camera,1);
01060 
01061               NoPredictionW1far->setBinContent(indexWheelf[3],nopredictionsratio);
01062               NoPredictionW1far->setBinLabel(indexWheelf[3],camera,1);
01063 
01064             }else if(Ring==2){
01065               EffDistroW2far->Fill(averageeff);
01066               indexWheelf[4]++;
01067               EffGlobW2far->setBinContent(indexWheelf[4],ef);
01068               EffGlobW2far->setBinError(indexWheelf[4],er);
01069               EffGlobW2far->setBinLabel(indexWheelf[4],camera,1);
01070 
01071               BXGlobW2far->setBinContent(indexWheelf[4],mybxhisto);  
01072               BXGlobW2far->setBinError(indexWheelf[4],mybxerror);  
01073               BXGlobW2far->setBinLabel(indexWheelf[4],camera,1);
01074               
01075               MaskedGlobW2far->setBinContent(indexWheelf[4],maskedratio);
01076               MaskedGlobW2far->setBinLabel(indexWheelf[4],camera,1);
01077 
01078               AverageEffW2far->setBinContent(indexWheelf[4],averageeff);
01079               AverageEffW2far->setBinError(indexWheelf[4],averageerr);
01080               AverageEffW2far->setBinLabel(indexWheelf[4],camera,1);
01081 
01082               NoPredictionW2far->setBinContent(indexWheelf[4],nopredictionsratio);
01083               NoPredictionW2far->setBinLabel(indexWheelf[4],camera,1);
01084             }
01085           }
01086         }else{//EndCap
01087 
01088           std::stringstream meIdRPC,meIdCSC, bxDistroId;
01089           std::string      meIdPRO, meIdRPC2, meIdCSC2, bxDistroId2;
01090           
01091           RPCBookFolderStructure *  folderStr = new RPCBookFolderStructure();
01092 
01093           std::string folder = folderPath+"MuonSegEff";
01094           
01095           meIdRPC<<folder<<"/RPCDataOccupancyFromCSC_"<<rpcId.rawId();
01096           meIdCSC<<folder<<"/ExpectedOccupancyFromCSC_"<<rpcId.rawId();
01097           bxDistroId<<folder<<"/BXDistribution_"<<rpcId.rawId();
01098                 
01099           std::string folder2 = folderPath+"RollByRoll/" +  folderStr->folderStructure(rpcId); 
01100           
01101           delete folderStr;
01102 
01103           meIdRPC2 = "RPCDataOccupancyFromCSC_" + rpcsrv.name();        
01104           meIdCSC2 =  "ExpectedOccupancyFromCSC_"+ rpcsrv.name();
01105           bxDistroId2 = "BXDistribution_"+ rpcsrv.name();
01106 
01107           meIdPRO = "Profile_"+ rpcsrv.name();
01108 
01109           histoRPC= dbe->get(meIdRPC.str());
01110           histoCSC= dbe->get(meIdCSC.str());
01111           BXDistribution = dbe->get(bxDistroId.str());
01112                           
01113           int NumberWithOutPrediction=0;
01114           double p = 0;
01115           double o = 0;
01116           float mybxhisto = 0;
01117           float mybxerror = 0;
01118           float ef =0;
01119           float er =0;
01120           float buffef = 0;
01121           float buffer = 0;
01122           float sumbuffef = 0;
01123           float sumbuffer = 0;
01124           float averageeff = 0;
01125           float averageerr = 0;
01126           int NumberStripsPointed = 0;
01127 
01128           if(debug) std::cout<<"Cloning BX"<<std::endl;
01129 
01130           for(int i=1;i<=11;i++){
01131             if(debug) std::cout<<i<<"-"<<BXDistribution->getBinContent(i)<<std::endl;
01132             meMap[bxDistroId2]->setBinContent(i,BXDistribution->getBinContent(i));
01133           }
01134 
01135           if(histoRPC && histoCSC && BXDistribution){
01136             if(debug) std::cout <<rpcsrv.name()<<std::endl;
01137             
01138             for(int i=1;i<=int((*r)->nstrips());++i){
01139               if(debug) std::cout<<"Cloning histoCSC "<<meIdCSC2<<std::endl;
01140               meMap[meIdCSC2]->setBinContent(i,histoCSC->getBinContent(i));
01141               if(debug) std::cout<<"Cloning histoRPC:"<<meIdRPC2<<std::endl;
01142               meMap[meIdRPC2]->setBinContent(i,histoRPC->getBinContent(i));
01143               
01144               if(meMap.find(meIdPRO)==meMap.end()){
01145                 std::cout<<"Empty Map"<<std::endl;
01146               }
01147 
01148               if(histoCSC->getBinContent(i)!=0){
01149                 if(debug) std::cout<<"Inside the If"<<std::endl;
01150                 buffef = float(histoRPC->getBinContent(i))/float(histoCSC->getBinContent(i));
01151                 meMap[meIdPRO]->setBinContent(i,buffef); 
01152                 buffer = sqrt(buffef*(1.-buffef)/float(histoCSC->getBinContent(i)));
01153                 meMap[meIdPRO]->setBinError(i,buffer);
01154                 sumbuffef=sumbuffef+buffef;
01155                 sumbuffer = sumbuffer + buffer*buffer;
01156                 NumberStripsPointed++;
01157               }else{
01158                 NumberWithOutPrediction++;
01159               }
01160               
01161               if(debug) std::cout<<"\t Strip="<<i<<" RPC="<<histoRPC->getBinContent(i)<<" CSC="<<histoCSC->getBinContent(i)<<" buffef="<<buffef<<" buffer="<<buffer<<" sumbuffef="<<sumbuffef<<" sumbuffer="<<sumbuffer<<" NumberStripsPointed="<<NumberStripsPointed<<" NumberWithOutPrediction"<<NumberWithOutPrediction<<std::endl;
01162             }
01163             p=histoCSC->getTH1F()->Integral();
01164             o=histoRPC->getTH1F()->Integral();
01165             
01166             if(NumberStripsPointed!=0){
01167               averageeff = (sumbuffef/float(NumberStripsPointed))*100.;
01168               averageerr = sqrt(sumbuffer/float(NumberStripsPointed))*100.;
01169             }
01170             
01171             mybxhisto = 50.+BXDistribution->getMean()*10;
01172             mybxerror = BXDistribution->getRMS()*10;
01173           }
01174           
01175           int Disk = rpcId.station()*rpcId.region();
01176 
01177           if(p!=0){
01178             ef = float(o)/float(p); 
01179             er = sqrt(ef*(1.-ef)/float(p));
01180           }
01181             
01182           ef=ef*100;
01183           er=er*100;
01184 
01185            //Filling azimutal GregHistograms
01186           
01187           if(rpcId.region()==1){
01188             if(rpcId.station()==1 && rpcId.ring()==2){ ExGregD1R2->Fill(rpcsrv.segment(),p);OcGregD1R2->Fill(rpcsrv.segment(),o);} 
01189             if(rpcId.station()==1 && rpcId.ring()==3){ ExGregD1R3->Fill(rpcsrv.segment(),p);OcGregD1R3->Fill(rpcsrv.segment(),o);}
01190             if(rpcId.station()==2 && rpcId.ring()==2){ ExGregD2R2->Fill(rpcsrv.segment(),p);OcGregD2R2->Fill(rpcsrv.segment(),o);}
01191             if(rpcId.station()==2 && rpcId.ring()==3){ ExGregD2R3->Fill(rpcsrv.segment(),p);OcGregD2R3->Fill(rpcsrv.segment(),o);}
01192             if(rpcId.station()==3 && rpcId.ring()==2){ ExGregD3R2->Fill(rpcsrv.segment(),p);OcGregD3R2->Fill(rpcsrv.segment(),o);}
01193             if(rpcId.station()==3 && rpcId.ring()==3){ ExGregD3R3->Fill(rpcsrv.segment(),p);OcGregD3R3->Fill(rpcsrv.segment(),o);}
01194           }
01195 
01196 
01197 
01198 
01199             
01200           std::string camera = rpcsrv.name();
01201             
01202           float nopredictionsratio = (float(NumberWithOutPrediction)/float((*r)->nstrips()))*100.;
01203           
01204 
01205           //Efficiency for Pigis Histos
01206 
01207           if(debug) std::cout<<"Pigi "<<camera<<" "<<rpcsrv.shortname()<<" "
01208                              <<(*r)->id()<<std::endl;
01209 
01210 
01211 
01212           if(p > 100){ //We need at least 100 predictions to fill the summary plot
01213             int rollY = (*r)->id().roll();
01214             if(rollY==1) rollY=3;
01215             else if(rollY==3) rollY=1;
01216             int Y=((*r)->id().ring()-2)*3+rollY;
01217             if(Disk==-3) Diskm3Summary->setBinContent(rpcsrv.segment(),Y,averageeff);
01218             else if(Disk==-2) Diskm2Summary->setBinContent(rpcsrv.segment(),Y,averageeff);
01219             else if(Disk==-1) Diskm1Summary->setBinContent(rpcsrv.segment(),Y,averageeff);
01220             else if(Disk==1) Disk1Summary->setBinContent(rpcsrv.segment(),Y,averageeff);
01221             else if(Disk==2) Disk2Summary->setBinContent(rpcsrv.segment(),Y,averageeff);
01222             else if(Disk==3) Disk3Summary->setBinContent(rpcsrv.segment(),Y,averageeff);
01223           }
01224 
01225           //Near Side
01226 
01227           float maskedratio =0;
01228 
01229           if(sector==1||sector==2||sector==6){
01230 
01231             if(Disk==-3){
01232               EffDistroDm3->Fill(averageeff);
01233               indexDisk[0]++;  
01234               EffGlobDm3->setBinContent(indexDisk[0],ef);  
01235               EffGlobDm3->setBinError(indexDisk[0],er);  
01236               EffGlobDm3->setBinLabel(indexDisk[0],camera,1);
01237 
01238               BXGlobDm3->setBinContent(indexDisk[0],mybxhisto);  
01239               BXGlobDm3->setBinError(indexDisk[0],mybxerror);  
01240               BXGlobDm3->setBinLabel(indexDisk[0],camera,1);
01241               
01242               MaskedGlobDm3->setBinContent(indexDisk[0],maskedratio);  
01243               MaskedGlobDm3->setBinLabel(indexDisk[0],camera,1);
01244 
01245               AverageEffDm3->setBinContent(indexDisk[0],averageeff);
01246               AverageEffDm3->setBinError(indexDisk[0],averageerr);  
01247               AverageEffDm3->setBinLabel(indexDisk[0],camera,1);
01248               
01249               NoPredictionDm3->setBinContent(indexDisk[0],nopredictionsratio);
01250               NoPredictionDm3->setBinLabel(indexDisk[0],camera,1);
01251             }else if(Disk==-2){
01252               EffDistroDm2->Fill(averageeff);
01253               indexDisk[1]++;  
01254               EffGlobDm2->setBinContent(indexDisk[1],ef);  
01255               EffGlobDm2->setBinError(indexDisk[1],er);  
01256               EffGlobDm2->setBinLabel(indexDisk[1],camera,1);
01257 
01258               BXGlobDm2->setBinContent(indexDisk[1],mybxhisto);  
01259               BXGlobDm2->setBinError(indexDisk[1],mybxerror);  
01260               BXGlobDm2->setBinLabel(indexDisk[1],camera,1);
01261               
01262               MaskedGlobDm2->setBinContent(indexDisk[1],maskedratio);  
01263               MaskedGlobDm2->setBinLabel(indexDisk[1],camera,1);
01264 
01265               AverageEffDm2->setBinContent(indexDisk[1],averageeff);
01266               AverageEffDm2->setBinError(indexDisk[1],averageerr);  
01267               AverageEffDm2->setBinLabel(indexDisk[1],camera,1);
01268               
01269               NoPredictionDm2->setBinContent(indexDisk[1],nopredictionsratio);
01270               NoPredictionDm2->setBinLabel(indexDisk[1],camera,1);
01271             }else if(Disk==-1){
01272               EffDistroDm1->Fill(averageeff);
01273               indexDisk[2]++;  
01274               EffGlobDm1->setBinContent(indexDisk[2],ef);  
01275               EffGlobDm1->setBinError(indexDisk[2],er);  
01276               EffGlobDm1->setBinLabel(indexDisk[2],camera,1);  
01277               
01278               BXGlobDm1->setBinContent(indexDisk[2],mybxhisto);  
01279               BXGlobDm1->setBinError(indexDisk[2],mybxerror);  
01280               BXGlobDm1->setBinLabel(indexDisk[2],camera,1);
01281               
01282               MaskedGlobDm1->setBinContent(indexDisk[2],maskedratio);  
01283               MaskedGlobDm1->setBinLabel(indexDisk[2],camera,1);
01284 
01285               AverageEffDm1->setBinContent(indexDisk[2],averageeff);
01286               AverageEffDm1->setBinError(indexDisk[2],averageerr);  
01287               AverageEffDm1->setBinLabel(indexDisk[2],camera,1);
01288               
01289               NoPredictionDm1->setBinContent(indexDisk[2],nopredictionsratio);
01290               NoPredictionDm1->setBinLabel(indexDisk[2],camera,1);
01291 
01292             }else if(Disk==1){
01293               EffDistroD1->Fill(averageeff);
01294               indexDisk[3]++;  
01295               EffGlobD1->setBinContent(indexDisk[3],ef);  
01296               EffGlobD1->setBinError(indexDisk[3],er);  
01297               EffGlobD1->setBinLabel(indexDisk[3],camera,1);  
01298               
01299               BXGlobD1->setBinContent(indexDisk[3],mybxhisto);  
01300               BXGlobD1->setBinError(indexDisk[3],mybxerror);  
01301               BXGlobD1->setBinLabel(indexDisk[3],camera,1);
01302 
01303               MaskedGlobD1->setBinContent(indexDisk[3],maskedratio);  
01304               MaskedGlobD1->setBinLabel(indexDisk[3],camera,1);
01305 
01306               AverageEffD1->setBinContent(indexDisk[3],averageeff);
01307               AverageEffD1->setBinError(indexDisk[3],averageerr);  
01308               AverageEffD1->setBinLabel(indexDisk[3],camera,1);
01309               
01310               NoPredictionD1->setBinContent(indexDisk[3],nopredictionsratio);
01311               NoPredictionD1->setBinLabel(indexDisk[3],camera,1);             
01312             }else if(Disk==2){
01313               EffDistroD2->Fill(averageeff);
01314               indexDisk[4]++;
01315               EffGlobD2->setBinContent(indexDisk[4],ef);
01316               EffGlobD2->setBinError(indexDisk[4],er);
01317               EffGlobD2->setBinLabel(indexDisk[4],camera,1);
01318 
01319               BXGlobD2->setBinContent(indexDisk[4],mybxhisto);  
01320               BXGlobD2->setBinError(indexDisk[4],mybxerror);  
01321               BXGlobD2->setBinLabel(indexDisk[4],camera,1);
01322               
01323               MaskedGlobD2->setBinContent(indexDisk[4],maskedratio);  
01324               MaskedGlobD2->setBinLabel(indexDisk[4],camera,1);
01325 
01326               AverageEffD2->setBinContent(indexDisk[4],averageeff);
01327               AverageEffD2->setBinError(indexDisk[4],averageerr);  
01328               AverageEffD2->setBinLabel(indexDisk[4],camera,1);
01329               
01330               NoPredictionD2->setBinContent(indexDisk[4],nopredictionsratio);
01331               NoPredictionD2->setBinLabel(indexDisk[4],camera,1);             
01332             }else if(Disk==3){
01333               EffDistroD3->Fill(averageeff);
01334               indexDisk[5]++;
01335               EffGlobD3->setBinContent(indexDisk[5],ef);
01336               EffGlobD3->setBinError(indexDisk[5],er);
01337               EffGlobD3->setBinLabel(indexDisk[5],camera,1);
01338 
01339               BXGlobD3->setBinContent(indexDisk[5],mybxhisto);  
01340               BXGlobD3->setBinError(indexDisk[5],mybxerror);  
01341               BXGlobD3->setBinLabel(indexDisk[5],camera,1);
01342               
01343               MaskedGlobD3->setBinContent(indexDisk[5],maskedratio);  
01344               MaskedGlobD3->setBinLabel(indexDisk[5],camera,1);
01345 
01346               AverageEffD3->setBinContent(indexDisk[5],averageeff);
01347               AverageEffD3->setBinError(indexDisk[5],averageerr);  
01348               AverageEffD3->setBinLabel(indexDisk[5],camera,1);
01349               
01350               NoPredictionD3->setBinContent(indexDisk[5],nopredictionsratio);
01351               NoPredictionD3->setBinLabel(indexDisk[5],camera,1);             
01352             }
01353           }else{//Far Side 
01354             
01355             if(Disk==-3){
01356               EffDistroDm3far->Fill(averageeff);
01357               indexDiskf[0]++;  
01358               EffGlobDm3far->setBinContent(indexDiskf[0],ef);  
01359               EffGlobDm3far->setBinError(indexDiskf[0],er);  
01360               EffGlobDm3far->setBinLabel(indexDiskf[0],camera,1);
01361 
01362               BXGlobDm3far->setBinContent(indexDiskf[0],mybxhisto);  
01363               BXGlobDm3far->setBinError(indexDiskf[0],mybxerror);  
01364               BXGlobDm3far->setBinLabel(indexDiskf[0],camera);
01365               
01366               MaskedGlobDm3far->setBinContent(indexDiskf[0],maskedratio);
01367               MaskedGlobDm3far->setBinLabel(indexDiskf[0],camera,1);
01368               
01369               AverageEffDm3far->setBinContent(indexDiskf[0],averageeff);
01370               AverageEffDm3far->setBinError(indexDiskf[0],averageerr);
01371               AverageEffDm3far->setBinLabel(indexDiskf[0],camera,1);
01372 
01373               NoPredictionDm3->setBinContent(indexDisk[0],nopredictionsratio);
01374               NoPredictionDm3->setBinLabel(indexDisk[0],camera,1);
01375 
01376             }
01377             else if(Disk==-2){
01378               EffDistroDm2far->Fill(averageeff);
01379               indexDiskf[1]++;  
01380               EffGlobDm2far->setBinContent(indexDiskf[1],ef);  
01381               EffGlobDm2far->setBinError(indexDiskf[1],er);  
01382               EffGlobDm2far->setBinLabel(indexDiskf[1],camera,1);
01383 
01384               BXGlobDm2far->setBinContent(indexDiskf[1],mybxhisto);  
01385               BXGlobDm2far->setBinError(indexDiskf[1],mybxerror);  
01386               BXGlobDm2far->setBinLabel(indexDiskf[1],camera);
01387               
01388               MaskedGlobDm2far->setBinContent(indexDiskf[1],maskedratio);
01389               MaskedGlobDm2far->setBinLabel(indexDiskf[1],camera,1);
01390               
01391               AverageEffDm2far->setBinContent(indexDiskf[1],averageeff);
01392               AverageEffDm2far->setBinError(indexDiskf[1],averageerr);
01393               AverageEffDm2far->setBinLabel(indexDiskf[1],camera,1);
01394 
01395               NoPredictionDm2->setBinContent(indexDisk[1],nopredictionsratio);
01396               NoPredictionDm2->setBinLabel(indexDisk[1],camera,1);
01397 
01398             }else if(Disk==-1){
01399               EffDistroDm1far->Fill(averageeff);
01400               indexDiskf[2]++;  
01401               EffGlobDm1far->setBinContent(indexDiskf[2],ef);  
01402               EffGlobDm1far->setBinError(indexDiskf[2],er);  
01403               EffGlobDm1far->setBinLabel(indexDiskf[2],camera,1);  
01404               
01405               BXGlobDm1far->setBinContent(indexDiskf[2],mybxhisto);  
01406               BXGlobDm1far->setBinError(indexDiskf[2],mybxerror);  
01407               BXGlobDm1far->setBinLabel(indexDiskf[2],camera,1);
01408               
01409               MaskedGlobDm1far->setBinContent(indexDiskf[2],maskedratio);
01410               MaskedGlobDm1far->setBinLabel(indexDiskf[2],camera,1);
01411 
01412               AverageEffDm1far->setBinContent(indexDiskf[2],averageeff);
01413               AverageEffDm1far->setBinError(indexDiskf[2],averageerr);
01414               AverageEffDm1far->setBinLabel(indexDiskf[2],camera,1);
01415 
01416               NoPredictionDm1far->setBinContent(indexDiskf[2],nopredictionsratio);
01417               NoPredictionDm1far->setBinLabel(indexDiskf[2],camera,1);
01418 
01419             }else if(Disk==1){
01420               EffDistroD1far->Fill(averageeff);
01421               indexDiskf[3]++;  
01422               EffGlobD1far->setBinContent(indexDiskf[3],ef);  
01423               EffGlobD1far->setBinError(indexDiskf[3],er);  
01424               EffGlobD1far->setBinLabel(indexDiskf[3],camera,1);  
01425               
01426               BXGlobD1far->setBinContent(indexDiskf[3],mybxhisto);  
01427               BXGlobD1far->setBinError(indexDiskf[3],mybxerror);  
01428               BXGlobD1far->setBinLabel(indexDiskf[3],camera,1);
01429 
01430               MaskedGlobD1far->setBinContent(indexDiskf[3],maskedratio);
01431               MaskedGlobD1far->setBinLabel(indexDiskf[3],camera,1);
01432               
01433               AverageEffD1far->setBinContent(indexDiskf[3],averageeff);
01434               AverageEffD1far->setBinError(indexDiskf[3],averageerr);
01435               AverageEffD1far->setBinLabel(indexDiskf[3],camera,1);
01436 
01437               NoPredictionD1far->setBinContent(indexDiskf[3],nopredictionsratio);
01438               NoPredictionD1far->setBinLabel(indexDiskf[3],camera,1);
01439 
01440             }else if(Disk==2){
01441               EffDistroD2far->Fill(averageeff);
01442               indexDiskf[4]++;
01443               EffGlobD2far->setBinContent(indexDiskf[4],ef);
01444               EffGlobD2far->setBinError(indexDiskf[4],er);
01445               EffGlobD2far->setBinLabel(indexDiskf[4],camera,1);
01446 
01447               BXGlobD2far->setBinContent(indexDiskf[4],mybxhisto);  
01448               BXGlobD2far->setBinError(indexDiskf[4],mybxerror);  
01449               BXGlobD2far->setBinLabel(indexDiskf[4],camera,1);
01450               
01451               MaskedGlobD2far->setBinContent(indexDiskf[4],maskedratio);
01452               MaskedGlobD2far->setBinLabel(indexDiskf[4],camera,1);
01453 
01454               AverageEffD2far->setBinContent(indexDiskf[4],averageeff);
01455               AverageEffD2far->setBinError(indexDiskf[4],averageerr);
01456               AverageEffD2far->setBinLabel(indexDiskf[4],camera,1);
01457 
01458               NoPredictionD2far->setBinContent(indexDiskf[4],nopredictionsratio);
01459               NoPredictionD2far->setBinLabel(indexDiskf[4],camera,1);
01460             }else if(Disk==3){
01461               EffDistroD3far->Fill(averageeff);
01462               indexDiskf[5]++;
01463               EffGlobD3far->setBinContent(indexDiskf[5],ef);
01464               EffGlobD3far->setBinError(indexDiskf[5],er);
01465               EffGlobD3far->setBinLabel(indexDiskf[5],camera,1);
01466 
01467               BXGlobD3far->setBinContent(indexDiskf[5],mybxhisto);  
01468               BXGlobD3far->setBinError(indexDiskf[5],mybxerror);  
01469               BXGlobD3far->setBinLabel(indexDiskf[5],camera,1);
01470               
01471               MaskedGlobD3far->setBinContent(indexDiskf[5],maskedratio);
01472               MaskedGlobD3far->setBinLabel(indexDiskf[5],camera,1);
01473 
01474               AverageEffD3far->setBinContent(indexDiskf[5],averageeff);
01475               AverageEffD3far->setBinError(indexDiskf[5],averageerr);
01476               AverageEffD3far->setBinLabel(indexDiskf[5],camera,1);
01477 
01478               NoPredictionD3far->setBinContent(indexDiskf[5],nopredictionsratio);
01479               NoPredictionD3far->setBinLabel(indexDiskf[5],camera,1);
01480             }
01481           }//Finishing EndCap
01482         }
01483       }
01484     }
01485   }
01486 
01487  float eff,N,err;
01488  int k;
01489  for(k=1;k<=36;k++){
01490    err=0; eff=0; N=ExGregD1R2->getBinContent(k);
01491    if(N!=0.){ eff = OcGregD1R2->getBinContent(k)/N; err=sqrt(eff*(1-eff)/N);}
01492    GregD1R2->setBinContent(k,eff); GregD1R2->setBinError(k,err);
01493    
01494    err=0; eff=0; N=ExGregD1R3->getBinContent(k);
01495    if(N!=0.){eff = OcGregD1R3->getBinContent(k)/N;err=sqrt(eff*(1-eff)/N);}
01496    GregD1R3->setBinContent(k,eff); GregD1R3->setBinError(k,err);
01497    
01498    err=0; eff=0; N=ExGregD2R2->getBinContent(k);
01499    if(N!=0.){ eff = OcGregD2R2->getBinContent(k)/N;err=sqrt(eff*(1-eff)/N);}
01500    GregD2R2->setBinContent(k,eff); GregD2R2->setBinError(k,err);
01501    
01502    err=0; eff=0; N=ExGregD2R3->getBinContent(k);
01503    if(N!=0.){ eff = OcGregD2R3->getBinContent(k)/N;err=sqrt(eff*(1-eff)/N);}
01504    GregD2R3->setBinContent(k,eff); GregD2R3->setBinError(k,err);
01505    
01506    err=0; eff=0; N=ExGregD3R2->getBinContent(k);
01507    if(N!=0.){ eff = OcGregD3R2->getBinContent(k)/N;err=sqrt(eff*(1-eff)/N);}
01508    GregD3R2->setBinContent(k,eff); GregD3R2->setBinError(k,err);
01509    
01510    err=0; eff=0; N=ExGregD3R3->getBinContent(k);
01511    if(N!=0.){ eff = OcGregD3R3->getBinContent(k)/N;err=sqrt(eff*(1-eff)/N);}
01512    GregD3R3->setBinContent(k,eff); GregD3R3->setBinError(k,err);
01513  }
01514 
01515   for(k=1;k<=12;k++){
01516     err=0; eff=0; N=ExsectorEffWm2->getBinContent(k);
01517     if(N!=0.){ eff = OcsectorEffWm2->getBinContent(k)/N;err=sqrt(eff*(1-eff)/N);}
01518     sectorEffWm2->setBinContent(k,eff); sectorEffWm2->setBinError(k,err);
01519 
01520     err=0; eff=0; N=ExsectorEffWm1->getBinContent(k);
01521     if(N!=0.){ eff = OcsectorEffWm1->getBinContent(k)/N;err=sqrt(eff*(1-eff)/N);}
01522     sectorEffWm1->setBinContent(k,eff); sectorEffWm1->setBinError(k,err);
01523 
01524     err=0; eff=0; N=ExsectorEffW0->getBinContent(k);
01525     if(N!=0.){ eff = OcsectorEffW0->getBinContent(k)/N;err=sqrt(eff*(1-eff)/N);}
01526     sectorEffW0->setBinContent(k,eff); sectorEffW0->setBinError(k,err);
01527 
01528     err=0; eff=0; N=ExsectorEffW1->getBinContent(k);
01529     if(N!=0.){ eff = OcsectorEffW1->getBinContent(k)/N;err=sqrt(eff*(1-eff)/N);}
01530     sectorEffW1->setBinContent(k,eff); sectorEffW1->setBinError(k,err);
01531 
01532     err=0; eff=0; N=ExsectorEffW2->getBinContent(k);
01533     if(N!=0.){ eff = OcsectorEffW2->getBinContent(k)/N;err=sqrt(eff*(1-eff)/N);}
01534     sectorEffW2->setBinContent(k,eff); sectorEffW2->setBinError(k,err);
01535   }
01536 
01537   //Ranges for Both
01538   //Barrel
01539 
01540   if(barrel){
01541     EffGlobWm2->setAxisRange(-4.,100.,2);
01542     EffGlobWm1->setAxisRange(-4.,100.,2);
01543     EffGlobW0->setAxisRange(-4.,100.,2);
01544     EffGlobW1->setAxisRange(-4.,100.,2);
01545     EffGlobW2->setAxisRange(-4.,100.,2);
01546   
01547     EffGlobWm2far->setAxisRange(-4.,100.,2);
01548     EffGlobWm1far->setAxisRange(-4.,100.,2);
01549     EffGlobW0far->setAxisRange(-4.,100.,2);
01550     EffGlobW1far->setAxisRange(-4.,100.,2);
01551     EffGlobW2far->setAxisRange(-4.,100.,2);
01552 
01553     AverageEffWm2->setAxisRange(-4.,100.,2);
01554     AverageEffWm1->setAxisRange(-4.,100.,2);
01555     AverageEffW0->setAxisRange(-4.,100.,2);
01556     AverageEffW1->setAxisRange(-4.,100.,2);
01557     AverageEffW2->setAxisRange(-4.,100.,2);
01558   
01559     AverageEffWm2far->setAxisRange(-4.,100.,2);
01560     AverageEffWm1far->setAxisRange(-4.,100.,2);
01561     AverageEffW0far->setAxisRange(-4.,100.,2);
01562     AverageEffW1far->setAxisRange(-4.,100.,2);
01563     AverageEffW2far->setAxisRange(-4.,100.,2);
01564 
01565     MaskedGlobWm2->setAxisRange(-4.,100.,2);
01566     MaskedGlobWm1->setAxisRange(-4.,100.,2);
01567     MaskedGlobW0->setAxisRange(-4.,100.,2);
01568     MaskedGlobW1->setAxisRange(-4.,100.,2);
01569     MaskedGlobW2->setAxisRange(-4.,100.,2);
01570   
01571     MaskedGlobWm2far->setAxisRange(-4.,100.,2);
01572     MaskedGlobWm1far->setAxisRange(-4.,100.,2);
01573     MaskedGlobW0far->setAxisRange(-4.,100.,2);
01574     MaskedGlobW1far->setAxisRange(-4.,100.,2);
01575     MaskedGlobW2far->setAxisRange(-4.,100.,2);
01576 
01577     NoPredictionWm2->setAxisRange(-4.,100.,2);
01578     NoPredictionWm1->setAxisRange(-4.,100.,2);
01579     NoPredictionW0->setAxisRange(-4.,100.,2);
01580     NoPredictionW1->setAxisRange(-4.,100.,2);
01581     NoPredictionW2->setAxisRange(-4.,100.,2);
01582   
01583     NoPredictionWm2far->setAxisRange(-4.,100.,2);
01584     NoPredictionWm1far->setAxisRange(-4.,100.,2);
01585     NoPredictionW0far->setAxisRange(-4.,100.,2);
01586     NoPredictionW1far->setAxisRange(-4.,100.,2);
01587     NoPredictionW2far->setAxisRange(-4.,100.,2);
01588   }
01589   //EndCap
01590 
01591   if(endcap){
01592     EffGlobDm3->setAxisRange(-4.,100.,2);
01593     EffGlobDm2->setAxisRange(-4.,100.,2);
01594     EffGlobDm1->setAxisRange(-4.,100.,2);
01595     EffGlobD1->setAxisRange(-4.,100.,2);
01596     EffGlobD2->setAxisRange(-4.,100.,2);
01597     EffGlobD3->setAxisRange(-4.,100.,2);
01598 
01599     EffGlobDm3far->setAxisRange(-4.,100.,2);
01600     EffGlobDm2far->setAxisRange(-4.,100.,2);
01601     EffGlobDm1far->setAxisRange(-4.,100.,2);
01602     EffGlobD1far->setAxisRange(-4.,100.,2);
01603     EffGlobD2far->setAxisRange(-4.,100.,2);
01604     EffGlobD3far->setAxisRange(-4.,100.,2);
01605 
01606     BXGlobDm3->setAxisRange(-4.,100.,2);
01607     BXGlobDm2->setAxisRange(-4.,100.,2);
01608     BXGlobDm1->setAxisRange(-4.,100.,2);
01609     BXGlobD1->setAxisRange(-4.,100.,2);
01610     BXGlobD2->setAxisRange(-4.,100.,2);
01611     BXGlobD3->setAxisRange(-4.,100.,2);
01612   
01613     BXGlobDm3far->setAxisRange(-4.,100.,2);
01614     BXGlobDm2far->setAxisRange(-4.,100.,2);
01615     BXGlobDm1far->setAxisRange(-4.,100.,2);
01616     BXGlobD1far->setAxisRange(-4.,100.,2);
01617     BXGlobD2far->setAxisRange(-4.,100.,2);
01618     BXGlobD3far->setAxisRange(-4.,100.,2);
01619 
01620     MaskedGlobDm3->setAxisRange(-4.,100.,2);
01621     MaskedGlobDm2->setAxisRange(-4.,100.,2);
01622     MaskedGlobDm1->setAxisRange(-4.,100.,2);
01623     MaskedGlobD1->setAxisRange(-4.,100.,2);
01624     MaskedGlobD2->setAxisRange(-4.,100.,2);
01625     MaskedGlobD3->setAxisRange(-4.,100.,2);
01626   
01627     MaskedGlobDm3far->setAxisRange(-4.,100.,2);
01628     MaskedGlobDm2far->setAxisRange(-4.,100.,2);
01629     MaskedGlobDm1far->setAxisRange(-4.,100.,2);
01630     MaskedGlobD1far->setAxisRange(-4.,100.,2);
01631     MaskedGlobD2far->setAxisRange(-4.,100.,2);
01632     MaskedGlobD3far->setAxisRange(-4.,100.,2);
01633 
01634     AverageEffDm3->setAxisRange(-4.,100.,2);
01635     AverageEffDm2->setAxisRange(-4.,100.,2);
01636     AverageEffDm1->setAxisRange(-4.,100.,2);
01637     AverageEffD1->setAxisRange(-4.,100.,2);
01638     AverageEffD2->setAxisRange(-4.,100.,2);
01639     AverageEffD3->setAxisRange(-4.,100.,2);
01640 
01641     AverageEffDm3far->setAxisRange(-4.,100.,2);
01642     AverageEffDm2far->setAxisRange(-4.,100.,2);
01643     AverageEffDm1far->setAxisRange(-4.,100.,2);
01644     AverageEffD1far->setAxisRange(-4.,100.,2);
01645     AverageEffD2far->setAxisRange(-4.,100.,2);
01646     AverageEffD3far->setAxisRange(-4.,100.,2);
01647 
01648     NoPredictionDm3->setAxisRange(-4.,100.,2);
01649     NoPredictionDm2->setAxisRange(-4.,100.,2);
01650     NoPredictionDm1->setAxisRange(-4.,100.,2);
01651     NoPredictionD1->setAxisRange(-4.,100.,2);
01652     NoPredictionD2->setAxisRange(-4.,100.,2);
01653     NoPredictionD3->setAxisRange(-4.,100.,2);
01654 
01655     NoPredictionDm3far->setAxisRange(-4.,100.,2);
01656     NoPredictionDm2far->setAxisRange(-4.,100.,2);
01657     NoPredictionDm1far->setAxisRange(-4.,100.,2);
01658     NoPredictionD1far->setAxisRange(-4.,100.,2);
01659     NoPredictionD2far->setAxisRange(-4.,100.,2);
01660     NoPredictionD3far->setAxisRange(-4.,100.,2);
01661   }
01662 
01663   //Title for Both
01664 
01665   //Barrel
01666   if(barrel){
01667     EffGlobWm2->setAxisTitle("%",2);
01668     EffGlobWm1->setAxisTitle("%",2);
01669     EffGlobW0->setAxisTitle("%",2);
01670     EffGlobW1->setAxisTitle("%",2);
01671     EffGlobW2->setAxisTitle("%",2);
01672   
01673     EffGlobWm2far->setAxisTitle("%",2);
01674     EffGlobWm1far->setAxisTitle("%",2);
01675     EffGlobW0far->setAxisTitle("%",2);
01676     EffGlobW1far->setAxisTitle("%",2);
01677     EffGlobW2far->setAxisTitle("%",2);
01678 
01679     AverageEffWm2->setAxisTitle("%",2);
01680     AverageEffWm1->setAxisTitle("%",2);
01681     AverageEffW0->setAxisTitle("%",2);
01682     AverageEffW1->setAxisTitle("%",2);
01683     AverageEffW2->setAxisTitle("%",2);
01684   
01685     AverageEffWm2far->setAxisTitle("%",2);
01686     AverageEffWm1far->setAxisTitle("%",2);
01687     AverageEffW0far->setAxisTitle("%",2);
01688     AverageEffW1far->setAxisTitle("%",2);
01689     AverageEffW2far->setAxisTitle("%",2);
01690 
01691     MaskedGlobWm2->setAxisTitle("%",2);
01692     MaskedGlobWm1->setAxisTitle("%",2);
01693     MaskedGlobW0->setAxisTitle("%",2);
01694     MaskedGlobW1->setAxisTitle("%",2);
01695     MaskedGlobW2->setAxisTitle("%",2);
01696   
01697     MaskedGlobWm2far->setAxisTitle("%",2);
01698     MaskedGlobWm1far->setAxisTitle("%",2);
01699     MaskedGlobW0far->setAxisTitle("%",2);
01700     MaskedGlobW1far->setAxisTitle("%",2);
01701     MaskedGlobW2far->setAxisTitle("%",2);
01702 
01703     NoPredictionWm2->setAxisTitle("%",2);
01704     NoPredictionWm1->setAxisTitle("%",2);
01705     NoPredictionW0->setAxisTitle("%",2);
01706     NoPredictionW1->setAxisTitle("%",2);
01707     NoPredictionW2->setAxisTitle("%",2);
01708   
01709     NoPredictionWm2far->setAxisTitle("%",2);
01710     NoPredictionWm1far->setAxisTitle("%",2);
01711     NoPredictionW0far->setAxisTitle("%",2);
01712     NoPredictionW1far->setAxisTitle("%",2);
01713     NoPredictionW2far->setAxisTitle("%",2);
01714   }
01715   //EndCap
01716 
01717   if(endcap){
01718     EffGlobDm3->setAxisTitle("%",2);
01719     EffGlobDm2->setAxisTitle("%",2);
01720     EffGlobDm1->setAxisTitle("%",2);
01721     EffGlobD1->setAxisTitle("%",2);
01722     EffGlobD2->setAxisTitle("%",2);
01723     EffGlobD3->setAxisTitle("%",2);
01724 
01725     EffGlobDm3far->setAxisTitle("%",2);
01726     EffGlobDm2far->setAxisTitle("%",2);
01727     EffGlobDm1far->setAxisTitle("%",2);
01728     EffGlobD1far->setAxisTitle("%",2);
01729     EffGlobD2far->setAxisTitle("%",2);
01730     EffGlobD3far->setAxisTitle("%",2);
01731 
01732     BXGlobDm3->setAxisTitle("%",2);
01733     BXGlobDm2->setAxisTitle("%",2);
01734     BXGlobDm1->setAxisTitle("%",2);
01735     BXGlobD1->setAxisTitle("%",2);
01736     BXGlobD2->setAxisTitle("%",2);
01737     BXGlobD3->setAxisTitle("%",2);
01738   
01739     BXGlobDm3far->setAxisTitle("%",2);
01740     BXGlobDm2far->setAxisTitle("%",2);
01741     BXGlobDm1far->setAxisTitle("%",2);
01742     BXGlobD1far->setAxisTitle("%",2);
01743     BXGlobD2far->setAxisTitle("%",2);
01744     BXGlobD3far->setAxisTitle("%",2);
01745 
01746     MaskedGlobDm3->setAxisTitle("%",2);
01747     MaskedGlobDm2->setAxisTitle("%",2);
01748     MaskedGlobDm1->setAxisTitle("%",2);
01749     MaskedGlobD1->setAxisTitle("%",2);
01750     MaskedGlobD2->setAxisTitle("%",2);
01751     MaskedGlobD3->setAxisTitle("%",2);
01752   
01753     MaskedGlobDm3far->setAxisTitle("%",2);
01754     MaskedGlobDm2far->setAxisTitle("%",2);
01755     MaskedGlobDm1far->setAxisTitle("%",2);
01756     MaskedGlobD1far->setAxisTitle("%",2);
01757     MaskedGlobD2far->setAxisTitle("%",2);
01758     MaskedGlobD3far->setAxisTitle("%",2);
01759 
01760     AverageEffDm3->setAxisTitle("%",2);
01761     AverageEffDm2->setAxisTitle("%",2);
01762     AverageEffDm1->setAxisTitle("%",2);
01763     AverageEffD1->setAxisTitle("%",2);
01764     AverageEffD2->setAxisTitle("%",2);
01765     AverageEffD3->setAxisTitle("%",2);
01766 
01767     AverageEffDm3far->setAxisTitle("%",2);
01768     AverageEffDm2far->setAxisTitle("%",2);
01769     AverageEffDm1far->setAxisTitle("%",2);
01770     AverageEffD1far->setAxisTitle("%",2);
01771     AverageEffD2far->setAxisTitle("%",2);
01772     AverageEffD3far->setAxisTitle("%",2);
01773 
01774     NoPredictionDm3->setAxisTitle("%",2);
01775     NoPredictionDm2->setAxisTitle("%",2);
01776     NoPredictionDm1->setAxisTitle("%",2);
01777     NoPredictionD1->setAxisTitle("%",2);
01778     NoPredictionD2->setAxisTitle("%",2);
01779     NoPredictionD3->setAxisTitle("%",2);
01780   
01781     NoPredictionDm3far->setAxisTitle("%",2);
01782     NoPredictionDm2far->setAxisTitle("%",2);
01783     NoPredictionDm1far->setAxisTitle("%",2);
01784     NoPredictionD1far->setAxisTitle("%",2);
01785     NoPredictionD2far->setAxisTitle("%",2);
01786     NoPredictionD3far->setAxisTitle("%",2);
01787   }
01788   
01789   EffGlobDm3->setAxisTitle("%",2);
01790   EffGlobDm2->setAxisTitle("%",2);
01791   EffGlobDm1->setAxisTitle("%",2);
01792   EffGlobD1->setAxisTitle("%",2);
01793   EffGlobD2->setAxisTitle("%",2);
01794   EffGlobD3->setAxisTitle("%",2);
01795 
01796   EffGlobDm3far->setAxisTitle("%",2);
01797   EffGlobDm2far->setAxisTitle("%",2);
01798   EffGlobDm1far->setAxisTitle("%",2);
01799   EffGlobD1far->setAxisTitle("%",2);
01800   EffGlobD2far->setAxisTitle("%",2);
01801   EffGlobD3far->setAxisTitle("%",2);
01802 
01803   BXGlobDm3->setAxisTitle("%",2);
01804   BXGlobDm2->setAxisTitle("%",2);
01805   BXGlobDm1->setAxisTitle("%",2);
01806   BXGlobD1->setAxisTitle("%",2);
01807   BXGlobD2->setAxisTitle("%",2);
01808   BXGlobD3->setAxisTitle("%",2);
01809   
01810   BXGlobDm3far->setAxisTitle("%",2);
01811   BXGlobDm2far->setAxisTitle("%",2);
01812   BXGlobDm1far->setAxisTitle("%",2);
01813   BXGlobD1far->setAxisTitle("%",2);
01814   BXGlobD2far->setAxisTitle("%",2);
01815   BXGlobD3far->setAxisTitle("%",2);
01816 
01817   MaskedGlobDm3->setAxisTitle("%",2);
01818   MaskedGlobDm2->setAxisTitle("%",2);
01819   MaskedGlobDm1->setAxisTitle("%",2);
01820   MaskedGlobD1->setAxisTitle("%",2);
01821   MaskedGlobD2->setAxisTitle("%",2);
01822   MaskedGlobD3->setAxisTitle("%",2);
01823   
01824   MaskedGlobDm3far->setAxisTitle("%",2);
01825   MaskedGlobDm2far->setAxisTitle("%",2);
01826   MaskedGlobDm1far->setAxisTitle("%",2);
01827   MaskedGlobD1far->setAxisTitle("%",2);
01828   MaskedGlobD2far->setAxisTitle("%",2);
01829   MaskedGlobD3far->setAxisTitle("%",2);
01830 
01831   AverageEffDm3->setAxisTitle("%",2);
01832   AverageEffDm2->setAxisTitle("%",2);
01833   AverageEffDm1->setAxisTitle("%",2);
01834   AverageEffD1->setAxisTitle("%",2);
01835   AverageEffD2->setAxisTitle("%",2);
01836   AverageEffD3->setAxisTitle("%",2);
01837 
01838   AverageEffDm3far->setAxisTitle("%",2);
01839   AverageEffDm2far->setAxisTitle("%",2);
01840   AverageEffDm1far->setAxisTitle("%",2);
01841   AverageEffD1far->setAxisTitle("%",2);
01842   AverageEffD2far->setAxisTitle("%",2);
01843   AverageEffD3far->setAxisTitle("%",2);
01844 
01845   NoPredictionDm3->setAxisTitle("%",2);
01846   NoPredictionDm2->setAxisTitle("%",2);
01847   NoPredictionDm1->setAxisTitle("%",2);
01848   NoPredictionD1->setAxisTitle("%",2);
01849   NoPredictionD2->setAxisTitle("%",2);
01850   NoPredictionD3->setAxisTitle("%",2);
01851   
01852   NoPredictionDm3far->setAxisTitle("%",2);
01853   NoPredictionDm2far->setAxisTitle("%",2);
01854   NoPredictionDm1far->setAxisTitle("%",2);
01855   NoPredictionD1far->setAxisTitle("%",2);
01856   NoPredictionD2far->setAxisTitle("%",2);
01857   NoPredictionD3far->setAxisTitle("%",2);
01858   
01859   if(debug) std::cout<<"Saving RootFile"<<std::endl;
01860   if(SaveFile)dbe->save(NameFile);
01861   if(debug) std::cout<<"RPCEFFICIENCY SECOND DONE"<<std::endl;
01862   
01863 }
01864 
01865 void RPCEfficiencySecond::endJob(){
01866   
01867 }
01868