CMS 3D CMS Logo

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