CMS 3D CMS Logo

GlobalRecHitsAnalyzer.h
Go to the documentation of this file.
1 #ifndef GlobalRecHitsAnalyzer_h
2 #define GlobalRecHitsAnalyzer_h
3 
13 // framework & common header files
21 
22 //DQM services
25 
30 
31 // ecal calorimeter info
40 
41 // hcal calorimeter info
59 
60 // silicon strip info
79 
80 // silicon pixel info
89 
90 // muon DT info
100 
101 // muon CSC info
110 
111 // muon RPC info
117 
118 // event info
124 
125 // general info
129 
130 #include <cstdlib>
131 #include <string>
132 #include <memory>
133 #include <vector>
134 #include <map>
135 #include <cmath>
136 
137 #include "TString.h"
139 
140 class CaloGeometryRecord;
141 class TrackerTopology;
142 
144 public:
145  typedef std::map<uint32_t, float, std::less<uint32_t>> MapType;
146 
147  explicit GlobalRecHitsAnalyzer(const edm::ParameterSet &);
148  ~GlobalRecHitsAnalyzer() override;
149  void analyze(const edm::Event &, const edm::EventSetup &) override;
150 
151 protected:
152  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
153 
154 private:
155  // production related methods
156  void fillECal(const edm::Event &, const edm::EventSetup &);
157  //void storeECal(PGlobalRecHit&);
158  void fillHCal(const edm::Event &, const edm::EventSetup &);
159  //void storeHCal(PGlobalRecHit&);
160  void fillTrk(const edm::Event &, const edm::EventSetup &);
161  //void storeTrk(PGlobalRecHit&);
162  void fillMuon(const edm::Event &, const edm::EventSetup &);
163  //void storeMuon(PGlobalRecHit&);
164 
165  //void clear();
166 
167 private:
168  // parameter information
176 
177  // Electromagnetic info
178  // ECal info
179 
182 
186 
200 
201  // HCal info
202 
205 
208 
209  // Tracker info
210  // SiStrip
211 
215 
218 
219  std::vector<PSimHit> matched;
220  std::pair<LocalPoint, LocalVector> projectHit(const PSimHit &hit,
221  const StripGeomDetUnit *stripDet,
222  const BoundPlane &plane);
224 
225  // SiPxl
226 
230 
233 
234  // Muon info
235  // DT
236 
243 
248 
249  // Return a map between DTRecHit1DPair and wireId
250  std::map<DTWireId, std::vector<DTRecHit1DPair>> map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs);
251 
252  // Compute SimHit distance from wire (cm)
253  float simHitDistFromWire(const DTLayer *layer, DTWireId wireId, const PSimHit &hit);
254 
255  // Find the RecHit closest to the muon SimHit
256  template <typename type>
257  const type *findBestRecHit(const DTLayer *layer,
258  DTWireId wireId,
259  const std::vector<type> &recHits,
260  const float simHitDist);
261 
262  // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
263  float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer);
264  // Compute the distance from wire (cm) of a hits in a DTRecHit1D
265  float recHitDistFromWire(const DTRecHit1D &recHit, const DTLayer *layer);
266 
267  // Does the real job
268  template <typename type>
269  int compute(const DTGeometry *dtGeom,
270  const std::map<DTWireId, std::vector<PSimHit>> &simHitsPerWire,
271  const std::map<DTWireId, std::vector<type>> &recHitsPerWire,
272  int step);
273 
274  // CSC
275  //Defined above....
276 
280 
281  std::map<int, edm::PSimHitContainer> theMap;
282  void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType);
283 
284  // RPC
285 
286  //Defined above...
287 
292 
299 
300  // private statistics information
301  unsigned int count;
302 
303 }; // end class declaration
304 
305 #endif
306 
307 #ifndef GlobalHitMap
308 #define GlobalHitMap
309 
310 // geometry mapping
311 static const int dTrk = 1;
312 static const int sdPxlBrl = 1;
313 static const int sdPxlFwd = 2;
314 static const int sdSiTIB = 3;
315 static const int sdSiTID = 4;
316 static const int sdSiTOB = 5;
317 static const int sdSiTEC = 6;
318 
319 static const int dMuon = 2;
320 static const int sdMuonDT = 1;
321 static const int sdMuonCSC = 2;
322 static const int sdMuonRPC = 3;
323 static const int sdMuonRPCRgnBrl = 0;
324 static const int sdMuonRPCRgnFwdp = 1;
325 static const int sdMuonRPCRgnFwdn = -1;
326 
327 static const int dEcal = 3;
328 static const int sdEcalBrl = 1;
329 static const int sdEcalFwd = 2;
330 static const int sdEcalPS = 3;
331 static const int sdEcalTT = 4;
332 static const int sdEcalLPnD = 5;
333 
334 static const int dHcal = 4;
335 static const int sdHcalEmpty = 0;
336 static const int sdHcalBrl = 1;
337 static const int sdHcalEC = 2;
338 static const int sdHcalOut = 3;
339 static const int sdHcalFwd = 4;
340 static const int sdHcalTT = 5;
341 static const int sdHcalCalib = 6;
342 static const int sdHcalCompst = 7;
343 
344 #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::GetterOfProducts< edm::SortedCollection< HORecHit, edm::StrictWeakOrdering< HORecHit > > > HORecHitgetter_
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]
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)
edm::GetterOfProducts< edm::SortedCollection< HFRecHit, edm::StrictWeakOrdering< HFRecHit > > > HFRecHitgetter_
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
edm::GetterOfProducts< edm::SortedCollection< HBHERecHit, edm::StrictWeakOrdering< HBHERecHit > > > HBHERecHitgetter_
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:83
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_