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
84 
85 // silicon pixel info
96 
97 // muon DT info
107 
108 // muon CSC info
117 
118 // muon RPC info
124 
125 // event info
131 
132 // general info
136 
137 #include <iostream>
138 #include <stdlib.h>
139 #include <string>
140 #include <memory>
141 #include <vector>
142 #include <map>
143 #include <math.h>
144 
145 #include "TString.h"
147 
148 
150 {
151 
152  public:
153 
154  typedef std::map<uint32_t,float,std::less<uint32_t> > MapType;
155 
156  explicit GlobalRecHitsAnalyzer(const edm::ParameterSet&);
157  virtual ~GlobalRecHitsAnalyzer();
158  virtual void beginJob();
159  virtual void endJob();
160  virtual void analyze(const edm::Event&, const edm::EventSetup&);
161 
162  private:
163 
164  // production related methods
165  void fillECal(const edm::Event&, const edm::EventSetup&);
166  //void storeECal(PGlobalRecHit&);
167  void fillHCal(const edm::Event&, const edm::EventSetup&);
168  //void storeHCal(PGlobalRecHit&);
169  void fillTrk(const edm::Event&, const edm::EventSetup&);
170  //void storeTrk(PGlobalRecHit&);
171  void fillMuon(const edm::Event&, const edm::EventSetup&);
172  //void storeMuon(PGlobalRecHit&);
173 
174  //void clear();
175 
176  private:
177 
178  // parameter information
179  std::string fName;
182  std::string label;
185  std::string hitsProducer;
186 
188 
189  // Electromagnetic info
190  // ECal info
191 
194 
200 
201  // HCal info
202 
205 
207 
208  // Tracker info
209  // SiStrip
210 
214 
216 
217  std::vector<PSimHit> matched;
218  std::pair<LocalPoint,LocalVector>
219  projectHit( const PSimHit& hit,
220  const StripGeomDetUnit* stripDet,
221  const BoundPlane& plane);
223 
224  // SiPxl
225 
229 
231 
232  // Muon info
233  // DT
234 
241 
244 
245  // Return a map between DTRecHit1DPair and wireId
246  std::map<DTWireId, std::vector<DTRecHit1DPair> >
247  map1DRecHitsPerWire(const DTRecHitCollection* dt1DRecHitPairs);
248 
249  // Compute SimHit distance from wire (cm)
250  float simHitDistFromWire(const DTLayer* layer,
251  DTWireId wireId,
252  const PSimHit& hit);
253 
254  // Find the RecHit closest to the muon SimHit
255  template <typename type>
256  const type*
257  findBestRecHit(const DTLayer* layer,
258  DTWireId wireId,
259  const std::vector<type>& recHits,
260  const float simHitDist);
261 
262  // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
263  float recHitDistFromWire(const DTRecHit1DPair& hitPair,
264  const DTLayer* layer);
265  // Compute the distance from wire (cm) of a hits in a DTRecHit1D
266  float recHitDistFromWire(const DTRecHit1D& recHit, const DTLayer* layer);
267 
268  // Does the real job
269  template <typename type>
270  int compute(const DTGeometry *dtGeom,
271  std::map<DTWireId, std::vector<PSimHit> > simHitsPerWire,
272  std::map<DTWireId, std::vector<type> > recHitsPerWire,
273  int step);
274 
275  // CSC
276  //Defined above....
277 
279 
280  std::map<int, edm::PSimHitContainer> theMap;
281  void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit,
282  const CSCLayer *layer, int chamberType);
283 
284  // RPC
285 
286  //Defined above...
287 
290 
291  // private statistics information
292  unsigned int count;
293 
294 }; // end class declaration
295 
296 #endif
297 
298 #ifndef GlobalHitMap
299 #define GlobalHitMap
300 
301 // geometry mapping
302 static const int dTrk = 1;
303 static const int sdPxlBrl = 1;
304 static const int sdPxlFwd = 2;
305 static const int sdSiTIB = 3;
306 static const int sdSiTID = 4;
307 static const int sdSiTOB = 5;
308 static const int sdSiTEC = 6;
309 
310 static const int dMuon = 2;
311 static const int sdMuonDT = 1;
312 static const int sdMuonCSC = 2;
313 static const int sdMuonRPC = 3;
314 static const int sdMuonRPCRgnBrl = 0;
315 static const int sdMuonRPCRgnFwdp = 1;
316 static const int sdMuonRPCRgnFwdn = -1;
317 
318 static const int dEcal = 3;
319 static const int sdEcalBrl = 1;
320 static const int sdEcalFwd = 2;
321 static const int sdEcalPS = 3;
322 static const int sdEcalTT = 4;
323 static const int sdEcalLPnD = 5;
324 
325 static const int dHcal = 4;
326 static const int sdHcalEmpty = 0;
327 static const int sdHcalBrl = 1;
328 static const int sdHcalEC = 2;
329 static const int sdHcalOut = 3;
330 static const int sdHcalFwd = 4;
331 static const int sdHcalTT = 5;
332 static const int sdHcalCalib = 6;
333 static const int sdHcalCompst = 7;
334 
335 #endif //PGlobalRecHitsProducer_h
static const int sdSiTEC
static const int dTrk
type
Definition: HCALResponse.h:22
GlobalRecHitsAnalyzer(const edm::ParameterSet &)
MonitorElement * mehCSCResRDPhi
static const int sdMuonRPCRgnBrl
std::vector< PSimHit > matched
list step
Definition: launcher.py:15
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:196
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, std::map< DTWireId, std::vector< PSimHit > > simHitsPerWire, 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