CMS 3D CMS Logo

GlobalRecHitsProducer.h
Go to the documentation of this file.
1 #ifndef GlobalRecHitsProducer_h
2 #define GlobalRecHitsProducer_h
3 
13 // framework & common header files
20 
21 //DQM services
24 
25 //#include "DataFormats/Common/interface/Provenance.h"
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
99 //#include "Validation/GlobalRecHits/interface/DTHitQualityUtils.h"
101 
102 // muon CSC info
111 
112 // muon RPC info
118 
119 // event info
126 
127 // general info
131 
132 // helper files
133 //#include <CLHEP/Vector/LorentzVector.h>
134 //#include <CLHEP/Units/SystemOfUnits.h>
135 
136 #include <iostream>
137 #include <cstdlib>
138 #include <string>
139 #include <memory>
140 #include <vector>
141 #include <map>
142 #include <cmath>
143 
144 #include "TString.h"
145 
146 class PGlobalRecHit;
147 class CaloGeometryRecord;
148 class TrackerTopology;
150 public:
151  typedef std::vector<float> FloatVector;
152  typedef std::vector<double> DoubleVector;
153  typedef std::vector<int> IntVector;
154  typedef std::map<uint32_t, float, std::less<uint32_t>> MapType;
155 
156  explicit GlobalRecHitsProducer(const edm::ParameterSet&);
157  ~GlobalRecHitsProducer() override;
158  void beginJob() override;
159  void endJob() override;
160  void produce(edm::Event&, const edm::EventSetup&) override;
161 
162 private:
163  // production related methods
164  void fillECal(edm::Event&, const edm::EventSetup&);
165  void storeECal(PGlobalRecHit&);
166  void fillHCal(edm::Event&, const edm::EventSetup&);
167  void storeHCal(PGlobalRecHit&);
168  void fillTrk(edm::Event&, const edm::EventSetup&);
169  void storeTrk(PGlobalRecHit&);
170  void fillMuon(edm::Event&, const edm::EventSetup&);
171  void storeMuon(PGlobalRecHit&);
172 
173  void clear();
174 
175 private:
176  // parameter information
183 
184  // Electromagnetic info
185  // ECal info
186 
189 
192 
195 
209 
210  // HCal info
211 
215 
219 
223 
227 
230 
231  // Tracker info
232  // SiStrip
233 
238 
243 
248 
253 
256 
257  std::vector<PSimHit> matched;
258  std::pair<LocalPoint, LocalVector> projectHit(const PSimHit& hit,
259  const StripGeomDetUnit* stripDet,
260  const BoundPlane& plane);
262 
263  // SiPxl
264 
269 
274 
277 
278  // Muon info
279  // DT
280 
283 
288 
289  // Return a map between DTRecHit1DPair and wireId
290  std::map<DTWireId, std::vector<DTRecHit1DPair>> map1DRecHitsPerWire(const DTRecHitCollection* dt1DRecHitPairs);
291 
292  // Compute SimHit distance from wire (cm)
293  float simHitDistFromWire(const DTLayer* layer, DTWireId wireId, const PSimHit& hit);
294 
295  // Find the RecHit closest to the muon SimHit
296  template <typename type>
297  const type* findBestRecHit(const DTLayer* layer,
298  DTWireId wireId,
299  const std::vector<type>& recHits,
300  const float simHitDist);
301 
302  // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
303  float recHitDistFromWire(const DTRecHit1DPair& hitPair, const DTLayer* layer);
304  // Compute the distance from wire (cm) of a hits in a DTRecHit1D
305  float recHitDistFromWire(const DTRecHit1D& recHit, const DTLayer* layer);
306 
307  // Does the real job
308  template <typename type>
309  int compute(const DTGeometry* dtGeom,
310  const std::map<DTWireId, std::vector<PSimHit>>& simHitsPerWire,
311  const std::map<DTWireId, std::vector<type>>& recHitsPerWire,
312  int step);
313 
314  // CSC
315 
319 
323 
324  std::map<int, edm::PSimHitContainer> theMap;
325  void plotResolution(const PSimHit& simHit, const CSCRecHit2D& recHit, const CSCLayer* layer, int chamberType);
326 
327  // RPC
328 
331 
336 
343 
344  // private statistics information
345  unsigned int count;
346 
347 }; // end class declaration
348 
349 #endif
350 
351 #ifndef GlobalHitMap
352 #define GlobalHitMap
353 
354 // geometry mapping
355 static const int dTrk = 1;
356 static const int sdPxlBrl = 1;
357 static const int sdPxlFwd = 2;
358 static const int sdSiTIB = 3;
359 static const int sdSiTID = 4;
360 static const int sdSiTOB = 5;
361 static const int sdSiTEC = 6;
362 
363 static const int dMuon = 2;
364 static const int sdMuonDT = 1;
365 static const int sdMuonCSC = 2;
366 static const int sdMuonRPC = 3;
367 static const int sdMuonRPCRgnBrl = 0;
368 static const int sdMuonRPCRgnFwdp = 1;
369 static const int sdMuonRPCRgnFwdn = -1;
370 
371 static const int dEcal = 3;
372 static const int sdEcalBrl = 1;
373 static const int sdEcalFwd = 2;
374 static const int sdEcalPS = 3;
375 static const int sdEcalTT = 4;
376 static const int sdEcalLPnD = 5;
377 
378 static const int dHcal = 4;
379 static const int sdHcalEmpty = 0;
380 static const int sdHcalBrl = 1;
381 static const int sdHcalEC = 2;
382 static const int sdHcalOut = 3;
383 static const int sdHcalFwd = 4;
384 static const int sdHcalTT = 5;
385 static const int sdHcalCalib = 6;
386 static const int sdHcalCompst = 7;
387 
388 #endif //PGlobalRecHitsProducer_h
GlobalRecHitsProducer(const edm::ParameterSet &)
edm::EDGetTokenT< edm::PSimHitContainer > MuDTSimSrc_Token_
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
static const int sdMuonRPCRgnFwdn
std::vector< int > IntVector
const type * findBestRecHit(const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
float simHitDistFromWire(const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
TrackerHitAssociator::Config trackerHitAssociatorConfig_
static const int sdHcalCompst
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
static const int sdPxlBrl
static const int sdEcalPS
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
edm::EDGetTokenT< EBUncalibratedRecHitCollection > ECalUncalEBSrc_Token_
static const int sdHcalBrl
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
int compute(const DTGeometry *dtGeom, const std::map< DTWireId, std::vector< PSimHit >> &simHitsPerWire, const std::map< DTWireId, std::vector< type >> &recHitsPerWire, int step)
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
std::vector< PSimHit > matched
void fillHCal(edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< EEUncalibratedRecHitCollection > ECalUncalEESrc_Token_
edm::EDGetTokenT< EERecHitCollection > ECalEESrc_Token_
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken_
static const int dTrk
static const int sdMuonRPCRgnFwdp
static const int sdMuonCSC
static const int dHcal
static const int sdHcalEC
void storeMuon(PGlobalRecHit &)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tGeomToken_
static const int sdEcalLPnD
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
void produce(edm::Event &, const edm::EventSetup &) override
void storeECal(PGlobalRecHit &)
std::map< int, edm::PSimHitContainer > theMap
static const int sdHcalTT
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuCSCHits_Token_
static const int sdMuonRPC
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > SiStripSrc_Token_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
static const int sdSiTIB
static const int sdHcalEmpty
static const int sdSiTID
static const int sdPxlFwd
edm::EDGetTokenT< CSCRecHit2DCollection > MuCSCSrc_Token_
edm::EDGetTokenT< ESRecHitCollection > ECalESSrc_Token_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
static const int sdEcalFwd
edm::EDGetTokenT< DTRecHitCollection > MuDTSrc_Token_
void storeTrk(PGlobalRecHit &)
edm::EDGetTokenT< RPCRecHitCollection > MuRPCSrc_Token_
static const int dEcal
static const int sdMuonDT
void fillMuon(edm::Event &, const edm::EventSetup &)
static const int dMuon
static const int sdEcalTT
static const int sdSiTEC
static const int sdHcalCalib
std::map< uint32_t, float, std::less< uint32_t > > MapType
static const int sdSiTOB
std::vector< double > DoubleVector
void storeHCal(PGlobalRecHit &)
std::vector< float > FloatVector
static const int sdHcalFwd
edm::EDGetTokenT< SiPixelRecHitCollection > SiPxlSrc_Token_
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomToken_
static const int sdMuonRPCRgnBrl
step
Definition: StallMonitor.cc:83
static const int sdEcalBrl
void fillTrk(edm::Event &, const edm::EventSetup &)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
edm::EDGetTokenT< edm::PSimHitContainer > MuRPCSimSrc_Token_
edm::EDGetTokenT< EBRecHitCollection > ECalEBSrc_Token_
void fillECal(edm::Event &, const edm::EventSetup &)
static const int sdHcalOut
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs)