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
19 
20 //DQM services
23 
28 
29 // ecal calorimeter info
38 
39 // hcal calorimeter info
57 
58 // silicon strip info
77 
78 // silicon pixel info
87 
88 // muon DT info
98 
99 // muon CSC info
108 
109 // muon RPC info
115 
116 // event info
122 
123 // general info
127 
128 #include <cstdlib>
129 #include <string>
130 #include <memory>
131 #include <vector>
132 #include <map>
133 #include <cmath>
134 
135 #include "TString.h"
137 
138 class CaloGeometryRecord;
139 class TrackerTopology;
140 
142 public:
143  typedef std::map<uint32_t, float, std::less<uint32_t>> MapType;
144 
145  explicit GlobalRecHitsAnalyzer(const edm::ParameterSet &);
146  ~GlobalRecHitsAnalyzer() override;
147  void analyze(const edm::Event &, const edm::EventSetup &) override;
148 
149 protected:
150  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
151 
152 private:
153  // production related methods
154  void fillECal(const edm::Event &, const edm::EventSetup &);
155  //void storeECal(PGlobalRecHit&);
156  void fillHCal(const edm::Event &, const edm::EventSetup &);
157  //void storeHCal(PGlobalRecHit&);
158  void fillTrk(const edm::Event &, const edm::EventSetup &);
159  //void storeTrk(PGlobalRecHit&);
160  void fillMuon(const edm::Event &, const edm::EventSetup &);
161  //void storeMuon(PGlobalRecHit&);
162 
163  //void clear();
164 
165 private:
166  // parameter information
174 
175  // Electromagnetic info
176  // ECal info
177 
180 
194 
195  // HCal info
196 
199 
202 
203  // Tracker info
204  // SiStrip
205 
209 
212 
213  std::vector<PSimHit> matched;
214  std::pair<LocalPoint, LocalVector> projectHit(const PSimHit &hit,
215  const StripGeomDetUnit *stripDet,
216  const BoundPlane &plane);
218 
219  // SiPxl
220 
224 
227 
228  // Muon info
229  // DT
230 
237 
242 
243  // Return a map between DTRecHit1DPair and wireId
244  std::map<DTWireId, std::vector<DTRecHit1DPair>> map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs);
245 
246  // Compute SimHit distance from wire (cm)
247  float simHitDistFromWire(const DTLayer *layer, DTWireId wireId, const PSimHit &hit);
248 
249  // Find the RecHit closest to the muon SimHit
250  template <typename type>
251  const type *findBestRecHit(const DTLayer *layer,
252  DTWireId wireId,
253  const std::vector<type> &recHits,
254  const float simHitDist);
255 
256  // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
257  float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer);
258  // Compute the distance from wire (cm) of a hits in a DTRecHit1D
259  float recHitDistFromWire(const DTRecHit1D &recHit, const DTLayer *layer);
260 
261  // Does the real job
262  template <typename type>
263  int compute(const DTGeometry *dtGeom,
264  const std::map<DTWireId, std::vector<PSimHit>> &simHitsPerWire,
265  const std::map<DTWireId, std::vector<type>> &recHitsPerWire,
266  int step);
267 
268  // CSC
269  //Defined above....
270 
274 
275  std::map<int, edm::PSimHitContainer> theMap;
276  void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType);
277 
278  // RPC
279 
280  //Defined above...
281 
286 
293 
294  // private statistics information
295  unsigned int count;
296 
297 }; // end class declaration
298 
299 #endif
300 
301 #ifndef GlobalHitMap
302 #define GlobalHitMap
303 
304 // geometry mapping
305 static const int dTrk = 1;
306 static const int sdPxlBrl = 1;
307 static const int sdPxlFwd = 2;
308 static const int sdSiTIB = 3;
309 static const int sdSiTID = 4;
310 static const int sdSiTOB = 5;
311 static const int sdSiTEC = 6;
312 
313 static const int dMuon = 2;
314 static const int sdMuonDT = 1;
315 static const int sdMuonCSC = 2;
316 static const int sdMuonRPC = 3;
317 static const int sdMuonRPCRgnBrl = 0;
318 static const int sdMuonRPCRgnFwdp = 1;
319 static const int sdMuonRPCRgnFwdn = -1;
320 
321 static const int dEcal = 3;
322 static const int sdEcalBrl = 1;
323 static const int sdEcalFwd = 2;
324 static const int sdEcalPS = 3;
325 static const int sdEcalTT = 4;
326 static const int sdEcalLPnD = 5;
327 
328 static const int dHcal = 4;
329 static const int sdHcalEmpty = 0;
330 static const int sdHcalBrl = 1;
331 static const int sdHcalEC = 2;
332 static const int sdHcalOut = 3;
333 static const int sdHcalFwd = 4;
334 static const int sdHcalTT = 5;
335 static const int sdHcalCalib = 6;
336 static const int sdHcalCompst = 7;
337 
338 #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]
void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
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:98
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_