CMS 3D CMS Logo

DTCalibValidation.h
Go to the documentation of this file.
1 
2 #ifndef DTCalibValidation_H
3 #define DTCalibValidation_H
4 
17 
20 
26 
27 #include <string>
28 #include <map>
29 #include <vector>
30 
31 // To remove into CMSSW versions before 20X
32 // To add into CMSSW versions before 20X
33 //class DaqMonitorBEInterface;
34 
35 class DTGeometry;
36 class DTChamber;
37 
38 // FR class DTCalibValidation: public edm::EDAnalyzer{
40 public:
43 
45  ~DTCalibValidation() override;
46 
48  void dqmBeginRun(const edm::Run& r, const edm::EventSetup& c) override;
49 
50  // Operations
51  void analyze(const edm::Event& event, const edm::EventSetup& setup) override;
52 
53 protected:
54  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
55 
56 private:
57  // Switch for verbosity
58  //bool debug;
62  int nevent;
63  // the analysis type
65  // the geometry
67 
68  // Lable of 1D rechits in the event
70  // Lable of 2D segments in the event
72  // Lable of 4D segments in the event
74 
75  // Return a map between DTRecHit1DPair and wireId
76  std::map<DTWireId, std::vector<DTRecHit1DPair> > map1DRecHitsPerWire(const DTRecHitCollection* dt1DRecHitPairs);
77 
78  // Return a map between DTRecHit1D and wireId
79  std::map<DTWireId, std::vector<DTRecHit1D> > map1DRecHitsPerWire(const DTRecSegment2DCollection* segment2Ds);
80 
81  // Return a map between DTRecHit1D and wireId
82  std::map<DTWireId, std::vector<DTRecHit1D> > map1DRecHitsPerWire(const DTRecSegment4DCollection* segment4Ds);
83 
84  template <typename type>
85  const type* findBestRecHit(const DTLayer* layer,
86  DTWireId wireId,
87  const std::vector<type>& recHits,
88  const float simHitDist);
89 
90  // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
91  float recHitDistFromWire(const DTRecHit1DPair& hitPair, const DTLayer* layer);
92  // Compute the distance from wire (cm) of a hits in a DTRecHit1D
93  float recHitDistFromWire(const DTRecHit1D& recHit, const DTLayer* layer);
94  // Compute the position with respect to the wire (cm) of a hits in a DTRecHit1DPair
95  float recHitPosition(
96  const DTRecHit1DPair& hitPair, const DTLayer* layer, const DTChamber* chamber, float segmPos, int sl);
97  // Compute the position with respect to the wire (cm) of a hits in a DTRecHit1D
98  float recHitPosition(const DTRecHit1D& recHit, const DTLayer* layer, const DTChamber* chamber, float segmPos, int sl);
99 
100  // Does the real job
101  template <typename type>
102  void compute(const DTGeometry* dtGeom,
103  const DTRecSegment4D& segment,
104  const std::map<DTWireId, std::vector<type> >& recHitsPerWire,
105  int step);
106 
107  // Book a set of histograms for a give chamber
108  void bookHistos(DTSuperLayerId slId, int step);
109  // Fill a set of histograms for a give chamber
110  void fillHistos(DTSuperLayerId slId,
111  float distance,
112  float residualOnDistance,
113  float position,
114  float residualOnPosition,
115  int step);
116 
117  std::map<std::pair<DTSuperLayerId, int>, std::vector<MonitorElement*> > histosPerSL;
118 };
119 #endif
120 
121 /* Local Variables: */
122 /* show-trailing-whitespace: t */
123 /* truncate-lines: t */
124 /* End: */
type
Definition: HCALResponse.h:21
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
edm::ESHandle< DTGeometry > dtGeom
void compute(const DTGeometry *dtGeom, const DTRecSegment4D &segment, const std::map< DTWireId, std::vector< type > > &recHitsPerWire, int step)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< DTRecSegment4DCollection > segment4DToken_
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs)
void fillHistos(DTSuperLayerId slId, float distance, float residualOnDistance, float position, float residualOnPosition, int step)
~DTCalibValidation() override
Destructor.
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
edm::EDGetTokenT< DTRecHitCollection > recHits1DToken_
void bookHistos(DTSuperLayerId slId, int step)
void dqmBeginRun(const edm::Run &r, const edm::EventSetup &c) override
BeginRun.
static int position[264][3]
Definition: ReadPGInfo.cc:289
std::map< std::pair< DTSuperLayerId, int >, std::vector< MonitorElement * > > histosPerSL
DTCalibValidation(const edm::ParameterSet &pset)
Constructor.
edm::ParameterSet parameters
step
Definition: StallMonitor.cc:94
float recHitPosition(const DTRecHit1DPair &hitPair, const DTLayer *layer, const DTChamber *chamber, float segmPos, int sl)
Definition: event.py:1
Definition: Run.h:45
const type * findBestRecHit(const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
edm::EDGetTokenT< DTRecSegment2DCollection > segment2DToken_