CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GlobalRecHitsProducer.h
Go to the documentation of this file.
1 #ifndef GlobalRecHitsProducer_h
2 #define GlobalRecHitsProducer_h
3 
15 // framework & common header files
22 
23 //DQM services
26 
27 
28 
29 //#include "DataFormats/Common/interface/Provenance.h"
34 
35 // ecal calorimeter info
44 
45 // hcal calorimeter info
63 
64 // silicon strip info
83 
84 // silicon pixel info
93 
94 // muon DT info
103 //#include "Validation/GlobalRecHits/interface/DTHitQualityUtils.h"
105 
106 // muon CSC info
115 
116 // muon RPC info
122 
123 // event info
130 
131 // general info
135 
136 // helper files
137 //#include <CLHEP/Vector/LorentzVector.h>
138 //#include <CLHEP/Units/SystemOfUnits.h>
139 
140 #include <iostream>
141 #include <stdlib.h>
142 #include <string>
143 #include <memory>
144 #include <vector>
145 #include <map>
146 #include <math.h>
147 
148 #include "TString.h"
149 
150 class PGlobalRecHit;
151 
153 {
154 
155  public:
156 
157  typedef std::vector<float> FloatVector;
158  typedef std::vector<double> DoubleVector;
159  typedef std::vector<int> IntVector;
160  typedef std::map<uint32_t,float,std::less<uint32_t> > MapType;
161 
162  explicit GlobalRecHitsProducer(const edm::ParameterSet&);
163  virtual ~GlobalRecHitsProducer();
164  virtual void beginJob();
165  virtual void endJob();
166  virtual void produce(edm::Event&, const edm::EventSetup&);
167 
168  private:
169 
170  // production related methods
171  void fillECal(edm::Event&, const edm::EventSetup&);
172  void storeECal(PGlobalRecHit&);
173  void fillHCal(edm::Event&, const edm::EventSetup&);
174  void storeHCal(PGlobalRecHit&);
175  void fillTrk(edm::Event&, const edm::EventSetup&);
176  void storeTrk(PGlobalRecHit&);
177  void fillMuon(edm::Event&, const edm::EventSetup&);
178  void storeMuon(PGlobalRecHit&);
179 
180  void clear();
181 
182  private:
183 
184  // parameter information
191 
192  // Electromagnetic info
193  // ECal info
194 
197 
200 
203 
209 
210  // HCal info
211 
215 
219 
223 
227 
229 
230  // Tracker info
231  // SiStrip
232 
237 
242 
247 
249  TECW8RX;
251  TECW8RY;
253  TECW8SX;
255  TECW8SY;
256 
258 
259  std::vector<PSimHit> matched;
260  std::pair<LocalPoint,LocalVector>
261  projectHit( const PSimHit& hit,
262  const StripGeomDetUnit* stripDet,
263  const BoundPlane& plane);
265 
266  // SiPxl
267 
272 
277 
279 
280  // Muon info
281  // DT
282 
285 
288 
289  // Return a map between DTRecHit1DPair and wireId
290  std::map<DTWireId, std::vector<DTRecHit1DPair> >
291  map1DRecHitsPerWire(const DTRecHitCollection* dt1DRecHitPairs);
292 
293  // Compute SimHit distance from wire (cm)
294  float simHitDistFromWire(const DTLayer* layer,
295  DTWireId wireId,
296  const PSimHit& hit);
297 
298  // Find the RecHit closest to the muon SimHit
299  template <typename type>
300  const type*
301  findBestRecHit(const DTLayer* layer,
302  DTWireId wireId,
303  const std::vector<type>& recHits,
304  const float simHitDist);
305 
306  // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
307  float recHitDistFromWire(const DTRecHit1DPair& hitPair,
308  const DTLayer* layer);
309  // Compute the distance from wire (cm) of a hits in a DTRecHit1D
310  float recHitDistFromWire(const DTRecHit1D& recHit, const DTLayer* layer);
311 
312  // Does the real job
313  template <typename type>
314  int compute(const DTGeometry *dtGeom,
315  const std::map<DTWireId, std::vector<PSimHit> >& simHitsPerWire,
316  const std::map<DTWireId, std::vector<type> >& recHitsPerWire,
317  int step);
318 
319  // CSC
320 
324 
326 
327  std::map<int, edm::PSimHitContainer> theMap;
328  void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit,
329  const CSCLayer *layer, int chamberType);
330 
331  // RPC
332 
335 
338 
339  // private statistics information
340  unsigned int count;
341 
342 }; // end class declaration
343 
344 #endif
345 
346 #ifndef GlobalHitMap
347 #define GlobalHitMap
348 
349 // geometry mapping
350 static const int dTrk = 1;
351 static const int sdPxlBrl = 1;
352 static const int sdPxlFwd = 2;
353 static const int sdSiTIB = 3;
354 static const int sdSiTID = 4;
355 static const int sdSiTOB = 5;
356 static const int sdSiTEC = 6;
357 
358 static const int dMuon = 2;
359 static const int sdMuonDT = 1;
360 static const int sdMuonCSC = 2;
361 static const int sdMuonRPC = 3;
362 static const int sdMuonRPCRgnBrl = 0;
363 static const int sdMuonRPCRgnFwdp = 1;
364 static const int sdMuonRPCRgnFwdn = -1;
365 
366 static const int dEcal = 3;
367 static const int sdEcalBrl = 1;
368 static const int sdEcalFwd = 2;
369 static const int sdEcalPS = 3;
370 static const int sdEcalTT = 4;
371 static const int sdEcalLPnD = 5;
372 
373 static const int dHcal = 4;
374 static const int sdHcalEmpty = 0;
375 static const int sdHcalBrl = 1;
376 static const int sdHcalEC = 2;
377 static const int sdHcalOut = 3;
378 static const int sdHcalFwd = 4;
379 static const int sdHcalTT = 5;
380 static const int sdHcalCalib = 6;
381 static const int sdHcalCompst = 7;
382 
383 #endif //PGlobalRecHitsProducer_h
GlobalRecHitsProducer(const edm::ParameterSet &)
type
Definition: HCALResponse.h:21
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)
static const int sdHcalCompst
static const int sdPxlBrl
static const int sdEcalPS
static const int sdHcalBrl
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
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 &)
static const int dTrk
static const int sdMuonRPCRgnFwdp
static const int sdMuonCSC
static const int dHcal
static const int sdHcalEC
void storeMuon(PGlobalRecHit &)
static const int sdEcalLPnD
void storeECal(PGlobalRecHit &)
std::map< int, edm::PSimHitContainer > theMap
dictionary map
Definition: Association.py:205
virtual void produce(edm::Event &, const edm::EventSetup &)
static const int sdHcalTT
static const int sdMuonRPC
std::map< uint32_t, float, std::less< uint32_t > > MapType
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
static const int sdEcalFwd
void storeTrk(PGlobalRecHit &)
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
static const int sdSiTOB
std::vector< double > DoubleVector
void storeHCal(PGlobalRecHit &)
std::vector< float > FloatVector
static const int sdHcalFwd
static const int sdMuonRPCRgnBrl
static const int sdEcalBrl
void fillTrk(edm::Event &, const edm::EventSetup &)
int compute(const DTGeometry *dtGeom, const std::map< DTWireId, std::vector< PSimHit > > &simHitsPerWire, const std::map< DTWireId, std::vector< type > > &recHitsPerWire, int step)
void fillECal(edm::Event &, const edm::EventSetup &)
static const int sdHcalOut
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs)