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
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 <iostream>
130 #include <cstdlib>
131 #include <string>
132 #include <memory>
133 #include <vector>
134 #include <map>
135 #include <cmath>
136 
137 #include "TString.h"
140 
141 
143 {
144 
145  public:
146 
147  typedef std::map<uint32_t,float,std::less<uint32_t> > MapType;
148 
149  explicit GlobalRecHitsAnalyzer(const edm::ParameterSet&);
150  ~GlobalRecHitsAnalyzer() override;
151  void analyze(const edm::Event&, const edm::EventSetup&) override;
152 
153  protected:
154  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
155 
156  private:
157 
158  // production related methods
159  void fillECal(const edm::Event&, const edm::EventSetup&);
160  //void storeECal(PGlobalRecHit&);
161  void fillHCal(const edm::Event&, const edm::EventSetup&);
162  //void storeHCal(PGlobalRecHit&);
163  void fillTrk(const edm::Event&, const edm::EventSetup&);
164  //void storeTrk(PGlobalRecHit&);
165  void fillMuon(const edm::Event&, const edm::EventSetup&);
166  //void storeMuon(PGlobalRecHit&);
167 
168  //void clear();
169 
170  private:
171 
172  // parameter information
180 
181  // Electromagnetic info
182  // ECal info
183 
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>
221  projectHit( const PSimHit& hit,
222  const StripGeomDetUnit* stripDet,
223  const BoundPlane& plane);
225 
226  // SiPxl
227 
231 
234 
235  // Muon info
236  // DT
237 
244 
249 
250  // Return a map between DTRecHit1DPair and wireId
251  std::map<DTWireId, std::vector<DTRecHit1DPair> >
252  map1DRecHitsPerWire(const DTRecHitCollection* dt1DRecHitPairs);
253 
254  // Compute SimHit distance from wire (cm)
255  float simHitDistFromWire(const DTLayer* layer,
256  DTWireId wireId,
257  const PSimHit& hit);
258 
259  // Find the RecHit closest to the muon SimHit
260  template <typename type>
261  const type*
262  findBestRecHit(const DTLayer* layer,
263  DTWireId wireId,
264  const std::vector<type>& recHits,
265  const float simHitDist);
266 
267  // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
268  float recHitDistFromWire(const DTRecHit1DPair& hitPair,
269  const DTLayer* layer);
270  // Compute the distance from wire (cm) of a hits in a DTRecHit1D
271  float recHitDistFromWire(const DTRecHit1D& recHit, const DTLayer* layer);
272 
273  // Does the real job
274  template <typename type>
275  int compute(const DTGeometry *dtGeom,
276  const std::map<DTWireId, std::vector<PSimHit> >& simHitsPerWire,
277  const std::map<DTWireId, std::vector<type> >& recHitsPerWire,
278  int step);
279 
280  // CSC
281  //Defined above....
282 
286 
287  std::map<int, edm::PSimHitContainer> theMap;
288  void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit,
289  const CSCLayer *layer, int chamberType);
290 
291  // RPC
292 
293  //Defined above...
294 
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
type
Definition: HCALResponse.h:21
GlobalRecHitsAnalyzer(const edm::ParameterSet &)
MonitorElement * mehCSCResRDPhi
static const int sdMuonRPCRgnBrl
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)
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
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::EDGetTokenT< EBUncalibratedRecHitCollection > ECalUncalEBSrc_Token_
static const int sdPxlBrl
int compute(const DTGeometry *dtGeom, const std::map< DTWireId, std::vector< PSimHit > > &simHitsPerWire, const std::map< DTWireId, std::vector< type > > &recHitsPerWire, int step)
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)
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]
static const int sdHcalTT
std::map< uint32_t, float, std::less< uint32_t > > MapType
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
step
TrackerHitAssociator::Config trackerHitAssociatorConfig_
static const int sdSiTID
edm::EDGetTokenT< edm::PSimHitContainer > MuRPCSimSrc_Token_
MonitorElement * mehSiStripResX[19]
Definition: Run.h:43
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_