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 "DQMServices/Core/interface/DQMStore.h"
00019 #include "DQMServices/Core/interface/MonitorElement.h"
00020
00021 #include <DataFormats/MuonDetId/interface/RPCDetId.h>
00022
00023
00024 #include<string>
00025 #include<map>
00026 #include<fstream>
00027
00028 class RPCDetId;
00029 class TFile;
00030 class TH1F;
00031 class TFile;
00032 class TCanvas;
00033 class TH2F;
00034 class TString;
00035
00036
00037 class DTStationIndex{
00038 public:
00039 DTStationIndex():_region(0),_wheel(0),_sector(0),_station(0){}
00040 DTStationIndex(int region, int wheel, int sector, int station) :
00041 _region(region),
00042 _wheel(wheel),
00043 _sector(sector),
00044 _station(station){}
00045 ~DTStationIndex(){}
00046 int region() const {return _region;}
00047 int wheel() const {return _wheel;}
00048 int sector() const {return _sector;}
00049 int station() const {return _station;}
00050 bool operator<(const DTStationIndex& dtind) const{
00051 if(dtind.region()!=this->region())
00052 return dtind.region()<this->region();
00053 else if(dtind.wheel()!=this->wheel())
00054 return dtind.wheel()<this->wheel();
00055 else if(dtind.sector()!=this->sector())
00056 return dtind.sector()<this->sector();
00057 else if(dtind.station()!=this->station())
00058 return dtind.station()<this->station();
00059 return false;
00060 }
00061 private:
00062 int _region;
00063 int _wheel;
00064 int _sector;
00065 int _station;
00066 };
00067
00068
00069 class CSCStationIndex{
00070 public:
00071 CSCStationIndex():_region(0),_station(0),_ring(0),_chamber(0){}
00072 CSCStationIndex(int region, int station, int ring, int chamber):
00073 _region(region),
00074 _station(station),
00075 _ring(ring),
00076 _chamber(chamber){}
00077 ~CSCStationIndex(){}
00078 int region() const {return _region;}
00079 int station() const {return _station;}
00080 int ring() const {return _ring;}
00081 int chamber() const {return _chamber;}
00082 bool operator<(const CSCStationIndex& cscind) const{
00083 if(cscind.region()!=this->region())
00084 return cscind.region()<this->region();
00085 else if(cscind.station()!=this->station())
00086 return cscind.station()<this->station();
00087 else if(cscind.ring()!=this->ring())
00088 return cscind.ring()<this->ring();
00089 else if(cscind.chamber()!=this->chamber())
00090 return cscind.chamber()<this->chamber();
00091 return false;
00092 }
00093
00094 private:
00095 int _region;
00096 int _station;
00097 int _ring;
00098 int _chamber;
00099 };
00100
00101 class MuonSegmentEff : public edm::EDAnalyzer {
00102 public:
00103 explicit MuonSegmentEff(const edm::ParameterSet&);
00104 ~MuonSegmentEff();
00105 virtual void beginJob(const edm::EventSetup&) ;
00106 virtual void analyze(const edm::Event&, const edm::EventSetup&);
00107 virtual void endJob() ;
00108 std::map<std::string, MonitorElement*> bookDetUnitSeg(RPCDetId & detId);
00109
00110 std::set<RPCDetId> allrollstoreBarrel;
00111
00112 std::map<DTStationIndex,std::set<RPCDetId> > rollstoreDT;
00113 std::map<CSCStationIndex,std::set<RPCDetId> > rollstoreCSC;
00114
00115 private:
00116
00117 std::vector<std::map<RPCDetId, int> > counter;
00118 std::vector<int> totalcounter;
00119 std::ofstream ofrej;
00120 std::ofstream ofeff;
00121 bool incldt;
00122 bool incldtMB4;
00123 bool inclcsc;
00124 bool prodImages;
00125 bool calcEffi;
00126 bool mydqm;
00127 double MinimalResidual;
00128 double MinimalResidualRB4;
00129 double MinCosAng;
00130 double MaxD;
00131 double MaxDrb4;
00132 double MaxStripToCountInAverage;
00133 double MaxStripToCountInAverageRB4;
00134 std::string muonRPCDigis;
00135 std::string cscSegments;
00136 std::string dt4DSegments;
00137 std::string rejected;
00138 std::string rollseff;
00139
00140
00141
00142 std::map<std::string, std::map<std::string, MonitorElement*> > meCollection;
00143 bool EffSaveRootFile;
00144 int EffSaveRootFileEventsInterval;
00145 std::string EffRootFileName;
00146 std::string nameInLog;
00147 DQMStore * dbe;
00148 std::vector<std::string> _idList;
00149
00150
00151 std::string GlobalRootLabel;
00152 TFile* fOutputFile;
00153
00154 TH1F* mydqmHbxdistro;
00155 TH1F* mydqmHdigisdistro;
00156
00157 TH1F* hGlobalRes;
00158 TH1F* statistics;
00159
00160 TH1F* hGlobalResLa1;
00161 TH1F* hGlobalResLa2;
00162 TH1F* hGlobalResLa3;
00163 TH1F* hGlobalResLa4;
00164 TH1F* hGlobalResLa5;
00165 TH1F* hGlobalResLa6;
00166
00167 TH1F* hGlobalResClu1La1;
00168 TH1F* hGlobalResClu1La2;
00169 TH1F* hGlobalResClu1La3;
00170 TH1F* hGlobalResClu1La4;
00171 TH1F* hGlobalResClu1La5;
00172 TH1F* hGlobalResClu1La6;
00173
00174 TH1F* hGlobalResClu2La1;
00175 TH1F* hGlobalResClu2La2;
00176 TH1F* hGlobalResClu2La3;
00177 TH1F* hGlobalResClu2La4;
00178 TH1F* hGlobalResClu2La5;
00179 TH1F* hGlobalResClu2La6;
00180
00181 TH1F* hGlobalResClu3La1;
00182 TH1F* hGlobalResClu3La2;
00183 TH1F* hGlobalResClu3La3;
00184 TH1F* hGlobalResClu3La4;
00185 TH1F* hGlobalResClu3La5;
00186 TH1F* hGlobalResClu3La6;
00187
00188 TCanvas * Ca2;
00189
00190 TH1F* hGlobalResY;
00191
00192 TH1F* hGlobalYResLa1;
00193 TH1F* hGlobalYResLa2;
00194 TH1F* hGlobalYResLa3;
00195 TH1F* hGlobalYResLa4;
00196 TH1F* hGlobalYResLa5;
00197 TH1F* hGlobalYResLa6;
00198
00199
00200
00201 TH1F* OGlobWm2;
00202 TH1F* PGlobWm2;
00203 TH1F* EffGlobWm2;
00204 TH1F* EffGlobm2s1; TH1F* EffGlobm2s2; TH1F* EffGlobm2s3; TH1F* EffGlobm2s4; TH1F* EffGlobm2s5; TH1F* EffGlobm2s6;
00205 TH1F* EffGlobm2s7; TH1F* EffGlobm2s8; TH1F* EffGlobm2s9; TH1F* EffGlobm2s10; TH1F* EffGlobm2s11; TH1F* EffGlobm2s12;
00206
00207
00208 TH1F* OGlobWm1;
00209 TH1F* PGlobWm1;
00210 TH1F* EffGlobWm1;
00211 TH1F* EffGlobm1s1; TH1F* EffGlobm1s2; TH1F* EffGlobm1s3; TH1F* EffGlobm1s4; TH1F* EffGlobm1s5; TH1F* EffGlobm1s6;
00212 TH1F* EffGlobm1s7; TH1F* EffGlobm1s8; TH1F* EffGlobm1s9; TH1F* EffGlobm1s10; TH1F* EffGlobm1s11; TH1F* EffGlobm1s12;
00213
00214
00215 TH1F* OGlobW0;
00216 TH1F* PGlobW0;
00217 TH1F* EffGlobW0;
00218 TH1F* EffGlob1; TH1F* EffGlob2; TH1F* EffGlob3; TH1F* EffGlob4; TH1F* EffGlob5; TH1F* EffGlob6;
00219 TH1F* EffGlob7; TH1F* EffGlob8; TH1F* EffGlob9; TH1F* EffGlob10; TH1F* EffGlob11; TH1F* EffGlob12;
00220
00221
00222 TH1F* OGlobW1;
00223 TH1F* PGlobW1;
00224 TH1F* EffGlobW1;
00225 TH1F* EffGlob1s1; TH1F* EffGlob1s2; TH1F* EffGlob1s3; TH1F* EffGlob1s4; TH1F* EffGlob1s5; TH1F* EffGlob1s6;
00226 TH1F* EffGlob1s7; TH1F* EffGlob1s8; TH1F* EffGlob1s9; TH1F* EffGlob1s10; TH1F* EffGlob1s11; TH1F* EffGlob1s12;
00227
00228
00229 TH1F* OGlobW2;
00230 TH1F* PGlobW2;
00231 TH1F* EffGlobW2;
00232 TH1F* EffGlob2s1; TH1F* EffGlob2s2; TH1F* EffGlob2s3; TH1F* EffGlob2s4; TH1F* EffGlob2s5; TH1F* EffGlob2s6;
00233 TH1F* EffGlob2s7; TH1F* EffGlob2s8; TH1F* EffGlob2s9; TH1F* EffGlob2s10; TH1F* EffGlob2s11; TH1F* EffGlob2s12;
00234 };