CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GlobalRecHitsAnalyzer.h
Go to the documentation of this file.
1 #ifndef GlobalRecHitsAnalyzer_h
2 #define GlobalRecHitsAnalyzer_h
3 
13 // framework & common header files
20 
21 //DQM services
24 
29 
30 // ecal calorimeter info
39 
40 // hcal calorimeter info
58 
59 // silicon strip info
78 
79 // silicon pixel info
88 
89 // muon DT info
99 
100 // muon CSC info
109 
110 // muon RPC info
116 
117 // event info
123 
124 // general info
128 
129 #include <cstdlib>
130 #include <string>
131 #include <memory>
132 #include <vector>
133 #include <map>
134 #include <cmath>
135 
136 #include "TString.h"
138 
139 class CaloGeometryRecord;
140 class TrackerTopology;
141 
143 public:
144  typedef std::map<uint32_t, float, std::less<uint32_t>> MapType;
145 
146  explicit GlobalRecHitsAnalyzer(const edm::ParameterSet &);
147  ~GlobalRecHitsAnalyzer() override;
148  void analyze(const edm::Event &, const edm::EventSetup &) override;
149 
150 protected:
151  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
152 
153 private:
154  // production related methods
155  void fillECal(const edm::Event &, const edm::EventSetup &);
156  //void storeECal(PGlobalRecHit&);
157  void fillHCal(const edm::Event &, const edm::EventSetup &);
158  //void storeHCal(PGlobalRecHit&);
159  void fillTrk(const edm::Event &, const edm::EventSetup &);
160  //void storeTrk(PGlobalRecHit&);
161  void fillMuon(const edm::Event &, const edm::EventSetup &);
162  //void storeMuon(PGlobalRecHit&);
163 
164  //void clear();
165 
166 private:
167  // parameter information
175 
176  // Electromagnetic info
177  // ECal info
178 
181 
195 
196  // HCal info
197 
200 
203 
204  // Tracker info
205  // SiStrip
206 
210 
213 
214  std::vector<PSimHit> matched;
215  std::pair<LocalPoint, LocalVector> projectHit(const PSimHit &hit,
216  const StripGeomDetUnit *stripDet,
217  const BoundPlane &plane);
219 
220  // SiPxl
221 
225 
228 
229  // Muon info
230  // DT
231 
238 
243 
244  // Return a map between DTRecHit1DPair and wireId
245  std::map<DTWireId, std::vector<DTRecHit1DPair>> map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs);
246 
247  // Compute SimHit distance from wire (cm)
248  float simHitDistFromWire(const DTLayer *layer, DTWireId wireId, const PSimHit &hit);
249 
250  // Find the RecHit closest to the muon SimHit
251  template <typename type>
252  const type *findBestRecHit(const DTLayer *layer,
253  DTWireId wireId,
254  const std::vector<type> &recHits,
255  const float simHitDist);
256 
257  // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
258  float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer);
259  // Compute the distance from wire (cm) of a hits in a DTRecHit1D
260  float recHitDistFromWire(const DTRecHit1D &recHit, const DTLayer *layer);
261 
262  // Does the real job
263  template <typename type>
264  int compute(const DTGeometry *dtGeom,
265  const std::map<DTWireId, std::vector<PSimHit>> &simHitsPerWire,
266  const std::map<DTWireId, std::vector<type>> &recHitsPerWire,
267  int step);
268 
269  // CSC
270  //Defined above....
271 
275 
276  std::map<int, edm::PSimHitContainer> theMap;
277  void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType);
278 
279  // RPC
280 
281  //Defined above...
282 
287 
294 
295  // private statistics information
296  unsigned int count;
297 
298 }; // end class declaration
299 
300 #endif
301 
302 #ifndef GlobalHitMap
303 #define GlobalHitMap
304 
305 // geometry mapping
306 static const int dTrk = 1;
307 static const int sdPxlBrl = 1;
308 static const int sdPxlFwd = 2;
309 static const int sdSiTIB = 3;
310 static const int sdSiTID = 4;
311 static const int sdSiTOB = 5;
312 static const int sdSiTEC = 6;
313 
314 static const int dMuon = 2;
315 static const int sdMuonDT = 1;
316 static const int sdMuonCSC = 2;
317 static const int sdMuonRPC = 3;
318 static const int sdMuonRPCRgnBrl = 0;
319 static const int sdMuonRPCRgnFwdp = 1;
320 static const int sdMuonRPCRgnFwdn = -1;
321 
322 static const int dEcal = 3;
323 static const int sdEcalBrl = 1;
324 static const int sdEcalFwd = 2;
325 static const int sdEcalPS = 3;
326 static const int sdEcalTT = 4;
327 static const int sdEcalLPnD = 5;
328 
329 static const int dHcal = 4;
330 static const int sdHcalEmpty = 0;
331 static const int sdHcalBrl = 1;
332 static const int sdHcalEC = 2;
333 static const int sdHcalOut = 3;
334 static const int sdHcalFwd = 4;
335 static const int sdHcalTT = 5;
336 static const int sdHcalCalib = 6;
337 static const int sdHcalCompst = 7;
338 
339 #endif //PGlobalRecHitsProducer_h
static const int sdSiTEC
edm::EDGetTokenT< SiPixelRecHitCollection > SiPxlSrc_Token_
static const int dTrk
GlobalRecHitsAnalyzer(const edm::ParameterSet &)
MonitorElement * mehCSCResRDPhi
static const int sdMuonRPCRgnBrl
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
edm::EDGetTokenT< EBRecHitCollection > ECalEBSrc_Token_
std::vector< PSimHit > matched
edm::EDGetTokenT< ESRecHitCollection > ECalESSrc_Token_
static const int sdSiTOB
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
MonitorElement * mehHcalRes[4]
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuCSCHits_Token_
void fillMuon(const edm::Event &, const edm::EventSetup &)
static const int dMuon
static const int sdMuonDT
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tGeomToken_
static const int sdEcalLPnD
float simHitDistFromWire(const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
MonitorElement * mehEcalRes[3]
static const int dEcal
static const int sdMuonRPC
static const int sdHcalEmpty
edm::EDGetTokenT< edm::PSimHitContainer > MuDTSimSrc_Token_
MonitorElement * mehSiStripn[19]
constexpr std::array< uint8_t, layerIndexSize > layer
void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
void analyze(const edm::Event &, const edm::EventSetup &) override
std::map< int, edm::PSimHitContainer > theMap
int compute(const DTGeometry *dtGeom, const std::map< DTWireId, std::vector< PSimHit >> &simHitsPerWire, const std::map< DTWireId, std::vector< type >> &recHitsPerWire, int step)
static const int sdEcalBrl
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs)
static const int sdHcalBrl
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
edm::EDGetTokenT< EBUncalibratedRecHitCollection > ECalUncalEBSrc_Token_
static const int sdPxlBrl
edm::EDGetTokenT< CSCRecHit2DCollection > MuCSCSrc_Token_
MonitorElement * mehSiPixelResX[7]
static const int sdPxlFwd
MonitorElement * mehEcaln[3]
const type * findBestRecHit(const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
static const int sdEcalFwd
MonitorElement * mehSiPixelResY[7]
MonitorElement * mehSiStripResY[19]
edm::EDGetTokenT< RPCRecHitCollection > MuRPCSrc_Token_
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
std::map< uint32_t, float, std::less< uint32_t > > MapType
static const int sdHcalEC
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
static const int sdEcalPS
static const int sdMuonRPCRgnFwdn
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
MonitorElement * mehSiPixeln[7]
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken_
static const int sdHcalTT
static const int sdHcalOut
void fillTrk(const edm::Event &, const edm::EventSetup &)
static const int sdEcalTT
static const int sdHcalCompst
edm::EDGetTokenT< DTRecHitCollection > MuDTSrc_Token_
MonitorElement * mehHcaln[4]
edm::EDGetTokenT< EEUncalibratedRecHitCollection > ECalUncalEESrc_Token_
static const int sdHcalCalib
static const int sdMuonCSC
void fillECal(const edm::Event &, const edm::EventSetup &)
static const int dHcal
static const int sdSiTIB
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
step
Definition: StallMonitor.cc:94
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomToken_
TrackerHitAssociator::Config trackerHitAssociatorConfig_
static const int sdSiTID
edm::EDGetTokenT< edm::PSimHitContainer > MuRPCSimSrc_Token_
MonitorElement * mehSiStripResX[19]
Definition: Run.h:45
void fillHCal(const edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< EERecHitCollection > ECalEESrc_Token_
static const int sdMuonRPCRgnFwdp
static const int sdHcalFwd
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > SiStripSrc_Token_