CMS 3D CMS Logo

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