CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GlobalRecHitsAnalyzer.h
Go to the documentation of this file.
1 #ifndef GlobalRecHitsAnalyzer_h
2 #define GlobalRecHitsAnalyzer_h
3 
15 // framework & common header files
22 
23 //DQM services
26 
31 
32 // ecal calorimeter info
41 
42 // hcal calorimeter info
60 
61 // silicon strip info
80 
81 // silicon pixel info
90 
91 // muon DT info
101 
102 // muon CSC info
111 
112 // muon RPC info
118 
119 // event info
125 
126 // general info
130 
131 #include <iostream>
132 #include <stdlib.h>
133 #include <string>
134 #include <memory>
135 #include <vector>
136 #include <map>
137 #include <math.h>
138 
139 #include "TString.h"
141 
142 
144 {
145 
146  public:
147 
148  typedef std::map<uint32_t,float,std::less<uint32_t> > MapType;
149 
150  explicit GlobalRecHitsAnalyzer(const edm::ParameterSet&);
151  virtual ~GlobalRecHitsAnalyzer();
152  virtual void beginJob();
153  virtual void endJob();
154  virtual void analyze(const edm::Event&, const edm::EventSetup&);
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 
182 
183  // Electromagnetic info
184  // ECal info
185 
188 
194 
195  // HCal info
196 
199 
201 
202  // Tracker info
203  // SiStrip
204 
208 
210 
211  std::vector<PSimHit> matched;
212  std::pair<LocalPoint,LocalVector>
213  projectHit( const PSimHit& hit,
214  const StripGeomDetUnit* stripDet,
215  const BoundPlane& plane);
217 
218  // SiPxl
219 
223 
225 
226  // Muon info
227  // DT
228 
235 
238 
239  // Return a map between DTRecHit1DPair and wireId
240  std::map<DTWireId, std::vector<DTRecHit1DPair> >
241  map1DRecHitsPerWire(const DTRecHitCollection* dt1DRecHitPairs);
242 
243  // Compute SimHit distance from wire (cm)
244  float simHitDistFromWire(const DTLayer* layer,
245  DTWireId wireId,
246  const PSimHit& hit);
247 
248  // Find the RecHit closest to the muon SimHit
249  template <typename type>
250  const type*
251  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,
258  const DTLayer* layer);
259  // Compute the distance from wire (cm) of a hits in a DTRecHit1D
260  float recHitDistFromWire(const DTRecHit1D& recHit, const DTLayer* layer);
261 
262  // Does the real job
263  template <typename type>
264  int compute(const DTGeometry *dtGeom,
265  const std::map<DTWireId, std::vector<PSimHit> >& simHitsPerWire,
266  const std::map<DTWireId, std::vector<type> >& recHitsPerWire,
267  int step);
268 
269  // CSC
270  //Defined above....
271 
273 
274  std::map<int, edm::PSimHitContainer> theMap;
275  void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit,
276  const CSCLayer *layer, int chamberType);
277 
278  // RPC
279 
280  //Defined above...
281 
284 
285  // private statistics information
286  unsigned int count;
287 
288 }; // end class declaration
289 
290 #endif
291 
292 #ifndef GlobalHitMap
293 #define GlobalHitMap
294 
295 // geometry mapping
296 static const int dTrk = 1;
297 static const int sdPxlBrl = 1;
298 static const int sdPxlFwd = 2;
299 static const int sdSiTIB = 3;
300 static const int sdSiTID = 4;
301 static const int sdSiTOB = 5;
302 static const int sdSiTEC = 6;
303 
304 static const int dMuon = 2;
305 static const int sdMuonDT = 1;
306 static const int sdMuonCSC = 2;
307 static const int sdMuonRPC = 3;
308 static const int sdMuonRPCRgnBrl = 0;
309 static const int sdMuonRPCRgnFwdp = 1;
310 static const int sdMuonRPCRgnFwdn = -1;
311 
312 static const int dEcal = 3;
313 static const int sdEcalBrl = 1;
314 static const int sdEcalFwd = 2;
315 static const int sdEcalPS = 3;
316 static const int sdEcalTT = 4;
317 static const int sdEcalLPnD = 5;
318 
319 static const int dHcal = 4;
320 static const int sdHcalEmpty = 0;
321 static const int sdHcalBrl = 1;
322 static const int sdHcalEC = 2;
323 static const int sdHcalOut = 3;
324 static const int sdHcalFwd = 4;
325 static const int sdHcalTT = 5;
326 static const int sdHcalCalib = 6;
327 static const int sdHcalCompst = 7;
328 
329 #endif //PGlobalRecHitsProducer_h
static const int sdSiTEC
static const int dTrk
type
Definition: HCALResponse.h:21
GlobalRecHitsAnalyzer(const edm::ParameterSet &)
MonitorElement * mehCSCResRDPhi
static const int sdMuonRPCRgnBrl
std::vector< PSimHit > matched
static const int sdSiTOB
MonitorElement * mehHcalRes[4]
void fillMuon(const edm::Event &, const edm::EventSetup &)
static const int dMuon
static const int sdMuonDT
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
MonitorElement * mehSiStripn[19]
dictionary map
Definition: Association.py:205
void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
std::map< int, edm::PSimHitContainer > theMap
static const int sdEcalBrl
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs)
static const int sdHcalBrl
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)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
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]
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
static const int sdHcalEC
static const int sdEcalPS
static const int sdMuonRPCRgnFwdn
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
MonitorElement * mehHcaln[4]
static const int sdHcalCalib
static const int sdMuonCSC
void fillECal(const edm::Event &, const edm::EventSetup &)
static const int dHcal
static const int sdSiTIB
static const int sdSiTID
MonitorElement * mehSiStripResX[19]
void fillHCal(const edm::Event &, const edm::EventSetup &)
static const int sdMuonRPCRgnFwdp
static const int sdHcalFwd