CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/DQM/RPCMonitorDigi/interface/RPCEfficiency.h

Go to the documentation of this file.
00001 
00012 #include <FWCore/Framework/interface/Frameworkfwd.h>
00013 #include <FWCore/Framework/interface/EDAnalyzer.h>
00014 #include <FWCore/Framework/interface/Event.h>
00015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00016 #include "FWCore/ServiceRegistry/interface/Service.h"
00017 
00018 #include "DataFormats/Common/interface/Handle.h"
00019 
00020 #include "DQMServices/Core/interface/DQMStore.h"
00021 #include "DQMServices/Core/interface/MonitorElement.h"
00022 
00023 #include <DataFormats/MuonDetId/interface/RPCDetId.h>
00024 #include "FWCore/Framework/interface/ESHandle.h"
00025 #include <Geometry/RPCGeometry/interface/RPCGeometry.h>
00026 #include "Geometry/DTGeometry/interface/DTGeometry.h"
00027 #include <Geometry/CSCGeometry/interface/CSCGeometry.h>
00028 
00029 #include<string>
00030 #include<map>
00031 //#include<fstream>
00032 
00033 //class RPCDetId;
00034 /* class TFile; */
00035 /* class TH1F; */
00036 /* class TFile; */
00037 /* class TCanvas; */
00038 /* class TH2F; */
00039 /* class TString; */
00040 
00041 
00042 class DTStationIndex{
00043 public: 
00044   DTStationIndex():_region(0),_wheel(0),_sector(0),_station(0){}
00045   DTStationIndex(int region, int wheel, int sector, int station) : 
00046     _region(region),
00047     _wheel(wheel),
00048     _sector(sector),
00049     _station(station){}
00050   ~DTStationIndex(){}
00051   int region() const {return _region;}
00052   int wheel() const {return _wheel;}
00053   int sector() const {return _sector;}
00054   int station() const {return _station;}
00055   bool operator<(const DTStationIndex& dtind) const{
00056     if(dtind.region()!=this->region())
00057       return dtind.region()<this->region();
00058     else if(dtind.wheel()!=this->wheel())
00059       return dtind.wheel()<this->wheel();
00060     else if(dtind.sector()!=this->sector())
00061       return dtind.sector()<this->sector();
00062     else if(dtind.station()!=this->station())
00063       return dtind.station()<this->station();
00064     return false;
00065   }
00066 private:
00067   int _region;
00068   int _wheel;
00069   int _sector;
00070   int _station; 
00071 };
00072 
00073 
00074 class CSCStationIndex{
00075 public:
00076   CSCStationIndex():_region(0),_station(0),_ring(0),_chamber(0){}
00077   CSCStationIndex(int region, int station, int ring, int chamber):
00078     _region(region),
00079     _station(station),
00080     _ring(ring),
00081     _chamber(chamber){}
00082   ~CSCStationIndex(){}
00083   int region() const {return _region;}
00084   int station() const {return _station;}
00085   int ring() const {return _ring;}
00086   int chamber() const {return _chamber;}
00087   bool operator<(const CSCStationIndex& cscind) const{
00088     if(cscind.region()!=this->region())
00089       return cscind.region()<this->region();
00090     else if(cscind.station()!=this->station())
00091       return cscind.station()<this->station();
00092     else if(cscind.ring()!=this->ring())
00093       return cscind.ring()<this->ring();
00094     else if(cscind.chamber()!=this->chamber())
00095       return cscind.chamber()<this->chamber();
00096     return false;
00097   }
00098 
00099 private:
00100   int _region;
00101   int _station;
00102   int _ring;  
00103   int _chamber;
00104 };
00105 
00106 
00107 class RPCEfficiency : public edm::EDAnalyzer {
00108    public:
00109       explicit RPCEfficiency(const edm::ParameterSet&);
00110       ~RPCEfficiency();
00111       virtual void beginJob() ;
00112       virtual void beginRun(const edm::Run&, const edm::EventSetup&);
00113       virtual void analyze(const edm::Event&, const edm::EventSetup&);
00114       virtual void endJob() ;
00115       void bookDetUnitSeg(RPCDetId & detId,int nstrips, std::string folder, std::map<std::string, MonitorElement*> & );
00116       virtual void endRun(const edm::Run& r, const edm::EventSetup& iSetup);
00117       std::map<DTStationIndex,std::set<RPCDetId> > rollstoreDT;
00118       std::map<CSCStationIndex,std::set<RPCDetId> > rollstoreCSC;
00119    
00120       /*       edm::ESHandle<RPCGeometry> rpcGeo; */
00121       /*       edm::ESHandle<DTGeometry> dtGeo; */
00122       /*       edm::ESHandle<CSCGeometry> cscGeo; */
00123       
00124       MonitorElement * statistics;
00125 
00126       //Distance Strip
00127    
00128     
00129       
00130       //Residuals
00131       MonitorElement * hGlobalResClu1La[6];
00132       MonitorElement * hGlobalResClu2La[6];
00133       MonitorElement * hGlobalResClu3La[6];
00134 
00135       //Endcap  
00136       MonitorElement * hGlobalResClu1R3C;
00137       MonitorElement * hGlobalResClu1R3B;
00138       MonitorElement * hGlobalResClu1R3A;
00139       MonitorElement * hGlobalResClu1R2C;
00140       MonitorElement * hGlobalResClu1R2B; 
00141       MonitorElement * hGlobalResClu1R2A;
00142 
00143       MonitorElement * hGlobalResClu2R3C;
00144       MonitorElement * hGlobalResClu2R3B;
00145       MonitorElement * hGlobalResClu2R3A;
00146       MonitorElement * hGlobalResClu2R2C;
00147       MonitorElement * hGlobalResClu2R2B;
00148       MonitorElement * hGlobalResClu2R2A;
00149 
00150       MonitorElement * hGlobalResClu3R3C;
00151       MonitorElement * hGlobalResClu3R3B;
00152       MonitorElement * hGlobalResClu3R3A;
00153       MonitorElement * hGlobalResClu3R2C;
00154       MonitorElement * hGlobalResClu3R2B;
00155       MonitorElement * hGlobalResClu3R2A;
00156 
00157  private:
00158       std::vector<std::map<RPCDetId, int> > counter;
00159       std::vector<int> totalcounter;
00160       //   std::ofstream ofrej;
00161       bool incldt;
00162       bool incldtMB4;
00163       bool inclcsc;
00164       bool debug;
00165       //   bool paper;
00166       bool inves;
00167       double rangestrips;
00168       double rangestripsRB4;
00169       double MinCosAng;
00170       double MaxD;
00171       double MaxDrb4;
00172       int dupli;
00173   
00174     //      std::string muonRPCDigis;
00175       edm::InputTag cscSegments;
00176       edm::InputTag dt4DSegments;
00177       edm::InputTag RPCRecHitLabel_;
00178 
00179       std::string folderPath;
00180       //   std::string rejected;
00181       std::string rollseff;
00182       
00183       std::map<int, std::map<std::string, MonitorElement*> >  meCollection;
00184       
00185       bool EffSaveRootFile;
00186       std::string EffRootFileName;
00187       DQMStore * dbe;
00188 };