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
87 
88 // silicon pixel info
99 
100 // muon DT info
109 //#include "Validation/GlobalRecHits/interface/DTHitQualityUtils.h"
111 
112 // muon CSC info
121 
122 // muon RPC info
128 
129 // event info
136 
137 // general info
141 
142 // helper files
143 //#include <CLHEP/Vector/LorentzVector.h>
144 //#include <CLHEP/Units/SystemOfUnits.h>
145 
146 #include <iostream>
147 #include <stdlib.h>
148 #include <string>
149 #include <memory>
150 #include <vector>
151 #include <map>
152 #include <math.h>
153 
154 #include "TString.h"
155 
156 class PGlobalRecHit;
157 
159 {
160 
161  public:
162 
163  typedef std::vector<float> FloatVector;
164  typedef std::vector<double> DoubleVector;
165  typedef std::vector<int> IntVector;
166  typedef std::map<uint32_t,float,std::less<uint32_t> > MapType;
167 
168  explicit GlobalRecHitsProducer(const edm::ParameterSet&);
169  virtual ~GlobalRecHitsProducer();
170  virtual void beginJob();
171  virtual void endJob();
172  virtual void produce(edm::Event&, const edm::EventSetup&);
173 
174  private:
175 
176  // production related methods
177  void fillECal(edm::Event&, const edm::EventSetup&);
178  void storeECal(PGlobalRecHit&);
179  void fillHCal(edm::Event&, const edm::EventSetup&);
180  void storeHCal(PGlobalRecHit&);
181  void fillTrk(edm::Event&, const edm::EventSetup&);
182  void storeTrk(PGlobalRecHit&);
183  void fillMuon(edm::Event&, const edm::EventSetup&);
184  void storeMuon(PGlobalRecHit&);
185 
186  void clear();
187 
188  private:
189 
190  // parameter information
191  std::string fName;
194  std::string label;
197 
198  // Electromagnetic info
199  // ECal info
200 
203 
206 
209 
215 
216  // HCal info
217 
221 
225 
229 
233 
235 
236  // Tracker info
237  // SiStrip
238 
243 
248 
253 
255  TECW8RX;
257  TECW8RY;
259  TECW8SX;
261  TECW8SY;
262 
264 
265  std::vector<PSimHit> matched;
266  std::pair<LocalPoint,LocalVector>
267  projectHit( const PSimHit& hit,
268  const StripGeomDetUnit* stripDet,
269  const BoundPlane& plane);
271 
272  // SiPxl
273 
278 
283 
285 
286  // Muon info
287  // DT
288 
291 
294 
295  // Return a map between DTRecHit1DPair and wireId
296  std::map<DTWireId, std::vector<DTRecHit1DPair> >
297  map1DRecHitsPerWire(const DTRecHitCollection* dt1DRecHitPairs);
298 
299  // Compute SimHit distance from wire (cm)
300  float simHitDistFromWire(const DTLayer* layer,
301  DTWireId wireId,
302  const PSimHit& hit);
303 
304  // Find the RecHit closest to the muon SimHit
305  template <typename type>
306  const type*
307  findBestRecHit(const DTLayer* layer,
308  DTWireId wireId,
309  const std::vector<type>& recHits,
310  const float simHitDist);
311 
312  // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
313  float recHitDistFromWire(const DTRecHit1DPair& hitPair,
314  const DTLayer* layer);
315  // Compute the distance from wire (cm) of a hits in a DTRecHit1D
316  float recHitDistFromWire(const DTRecHit1D& recHit, const DTLayer* layer);
317 
318  // Does the real job
319  template <typename type>
320  int compute(const DTGeometry *dtGeom,
321  std::map<DTWireId, std::vector<PSimHit> > simHitsPerWire,
322  std::map<DTWireId, std::vector<type> > recHitsPerWire,
323  int step);
324 
325  // CSC
326 
330 
332 
333  std::map<int, edm::PSimHitContainer> theMap;
334  void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit,
335  const CSCLayer *layer, int chamberType);
336 
337  // RPC
338 
341 
344 
345  // private statistics information
346  unsigned int count;
347 
348 }; // end class declaration
349 
350 #endif
351 
352 #ifndef GlobalHitMap
353 #define GlobalHitMap
354 
355 // geometry mapping
356 static const int dTrk = 1;
357 static const int sdPxlBrl = 1;
358 static const int sdPxlFwd = 2;
359 static const int sdSiTIB = 3;
360 static const int sdSiTID = 4;
361 static const int sdSiTOB = 5;
362 static const int sdSiTEC = 6;
363 
364 static const int dMuon = 2;
365 static const int sdMuonDT = 1;
366 static const int sdMuonCSC = 2;
367 static const int sdMuonRPC = 3;
368 static const int sdMuonRPCRgnBrl = 0;
369 static const int sdMuonRPCRgnFwdp = 1;
370 static const int sdMuonRPCRgnFwdn = -1;
371 
372 static const int dEcal = 3;
373 static const int sdEcalBrl = 1;
374 static const int sdEcalFwd = 2;
375 static const int sdEcalPS = 3;
376 static const int sdEcalTT = 4;
377 static const int sdEcalLPnD = 5;
378 
379 static const int dHcal = 4;
380 static const int sdHcalEmpty = 0;
381 static const int sdHcalBrl = 1;
382 static const int sdHcalEC = 2;
383 static const int sdHcalOut = 3;
384 static const int sdHcalFwd = 4;
385 static const int sdHcalTT = 5;
386 static const int sdHcalCalib = 6;
387 static const int sdHcalCompst = 7;
388 
389 #endif //PGlobalRecHitsProducer_h
GlobalRecHitsProducer(const edm::ParameterSet &)
type
Definition: HCALResponse.h:22
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)
list step
Definition: launcher.py:15
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:196
virtual void produce(edm::Event &, const edm::EventSetup &)
static const int sdHcalTT
int compute(const DTGeometry *dtGeom, std::map< DTWireId, std::vector< PSimHit > > simHitsPerWire, std::map< DTWireId, std::vector< type > > recHitsPerWire, int step)
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 &)
void fillECal(edm::Event &, const edm::EventSetup &)
static const int sdHcalOut
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs)