CMS 3D CMS Logo

CSCOfflineMonitor.h
Go to the documentation of this file.
1 #ifndef RecoLocalMuon_CSCOfflineMonitor_H
2 #define RecoLocalMuon_CSCOfflineMonitor_H
3 
24 
37 
43 
49 
51 
54 
60 
68 
70 public:
72  ~CSCOfflineMonitor() override{};
73 
75  enum AxisType { X = 1, Y = 2, Z = 3 };
76 
77 protected:
78  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
79  void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override;
80 
81 private:
83 
91 
93 
95 
96  // modules
117  const edm::Event &event,
118  const edm::EventSetup &eventSetup);
119 
120  // used by modules
121  float fitX(const CLHEP::HepMatrix &sp, const CLHEP::HepMatrix &ep);
122  float getSignal(const CSCStripDigiCollection &stripdigis, CSCDetId idRH, int centerStrip);
123  int typeIndex(CSCDetId id, int flag = 1);
124  int chamberSerial(CSCDetId id);
126 
127  // for efficiency calculations
128  // - these functions handle Stoyan's efficiency code
129 
130  void fillEfficiencyHistos(int bin, int flag);
131  // void getEfficiency(float bin, float Norm, std::vector<float> &eff);
132  // void histoEfficiency(TH1F *readHisto, MonitorElement *writeHisto);
133 
134  double lineParametrization(double z1Position, double z2Position, double z1Direction) {
135  double parameterLine = (z2Position - z1Position) / z1Direction;
136  return parameterLine;
137  }
138 
139  double extrapolate1D(double initPosition, double initDirection, double parameterOfTheLine) {
140  double extrapolatedPosition = initPosition + initDirection * parameterOfTheLine;
141  return extrapolatedPosition;
142  }
143 
144  bool withinSensitiveRegion(LocalPoint localPos,
145  const std::array<const float, 4> &layerBounds,
146  int station,
147  int ring,
148  float shiftFromEdge,
149  float shiftFromDeadZone);
150 
151  // for BX monitor plots
152  // void harvestChamberMeans(MonitorElement* meMean1D, MonitorElement *meMean2D, MonitorElement *hNum, MonitorElement *meDenom);
153  // void normalize(MonitorElement* me);
154 
155  // Wire digis
158  std::vector<MonitorElement *> hWireTBin;
159  std::vector<MonitorElement *> hWireNumber;
160 
161  // Strip Digis
164  std::vector<MonitorElement *> hStripNumber;
165  std::vector<MonitorElement *> hStripPed;
166 
167  // Rechits
170  std::vector<MonitorElement *> hRHGlobal;
171  std::vector<MonitorElement *> hRHSumQ;
172  std::vector<MonitorElement *> hRHTiming;
173  std::vector<MonitorElement *> hRHTimingAnode;
174  std::vector<MonitorElement *> hRHRatioQ;
175  std::vector<MonitorElement *> hRHstpos;
176  std::vector<MonitorElement *> hRHsterr;
177 
178  // Segments
181  std::vector<MonitorElement *> hSnhits;
183  std::vector<MonitorElement *> hSChiSq;
185  std::vector<MonitorElement *> hSChiSqProb;
189  std::vector<MonitorElement *> hSTimeDiffByChamberType;
191  std::vector<MonitorElement *> hSTimeAnodeByChamberType;
193  std::vector<MonitorElement *> hSTimeCathodeByChamberType;
195  std::vector<MonitorElement *> hSTimeCombinedByChamberType;
202 
203  // Resolution
204  std::vector<MonitorElement *> hSResid;
205 
206  // Occupancies
218 
219  // Efficiencies
224  // MonitorElement *hSEff;
225  // MonitorElement *hRHEff;
230  // MonitorElement *hSEff2;
231  // MonitorElement *hRHEff2;
232  // MonitorElement *hStripEff2;
233  // MonitorElement *hWireEff2;
234  // MonitorElement *hStripReadoutEff2;
237 
238  // BX monitoring
241  // MonitorElement *hALCTgetBXChamberMeans;
242  // MonitorElement *hALCTgetBX2DMeans;
245 
248  // MonitorElement *hALCTMatchChamberMeans;
249  // MonitorElement *hALCTMatch2DMeans;
252 
255  // MonitorElement *hCLCTL1AChamberMeans;
256  // MonitorElement *hCLCTL1A2DMeans;
259 };
260 #endif
MonitorElement * hEffDenominator
MonitorElement * hOSegmentsSerial
edm::EDGetTokenT< CSCALCTDigiCollection > al_token
MonitorElement * hRHden
std::vector< MonitorElement * > hSTimeCathodeByChamberType
MonitorElement * hOWireSerial
MonitorElement * hSensitiveAreaEvt
const edm::ESGetToken< CSCCrateMap, CSCCrateMapRcd > hcrateToken_
MonitorElement * hOStrips
int chamberSerial(CSCDetId id)
std::vector< MonitorElement * > hSTimeAnodeByChamberType
std::vector< MonitorElement * > hSTimeDiffByChamberType
std::vector< MonitorElement * > hSResid
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * hORecHits
std::vector< MonitorElement * > hRHSumQ
MonitorElement * hStripSTE2
std::vector< MonitorElement * > hWireNumber
void doResolution(edm::Handle< CSCSegmentCollection > cscSegments, edm::ESHandle< CSCGeometry > cscGeom)
~CSCOfflineMonitor() override
std::vector< MonitorElement * > hRHGlobal
edm::EDGetTokenT< CSCWireDigiCollection > wd_token
MonitorElement * hALCTMatch2DNumerator
MonitorElement * hORecHitsSerial
float getSignal(const CSCStripDigiCollection &stripdigis, CSCDetId idRH, int centerStrip)
MonitorElement * hSTimeAnodeSerial
MonitorElement * hWirenGroupsTotal
MonitorElement * hCLCTL1ASerial
MonitorElement * hOStripSerial
std::vector< MonitorElement * > hStripNumber
edm::ParameterSet param
MonitorElement * hSSTE2
MonitorElement * hWireSTE2
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
MonitorElement * hSTimeAnode
MonitorElement * hSGlobalPhi
std::vector< MonitorElement * > hSnhits
CSCOfflineMonitor(const edm::ParameterSet &pset)
MonitorElement * hOWires
MonitorElement * hSnSegments
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken_
MonitorElement * hOStripsAndWiresAndCLCT
MonitorElement * hOSegments
edm::EDGetTokenT< FEDRawDataCollection > rd_token
std::vector< MonitorElement * > hRHstpos
MonitorElement * hALCTMatchSerial
int typeIndex(CSCDetId id, int flag=1)
MonitorElement * hSnhitsAll
float fitX(const CLHEP::HepMatrix &sp, const CLHEP::HepMatrix &ep)
MonitorElement * hRHnrechitsHi
MonitorElement * hALCTgetBX
edm::EDGetTokenT< CSCCLCTDigiCollection > cl_token
MonitorElement * hALCTMatch
std::vector< MonitorElement * > hSChiSq
MonitorElement * hSGlobalTheta
MonitorElement * hSTimeDiffSerial
MonitorElement * hSTimeCombined
MonitorElement * hOWiresAndCLCT
MonitorElement * hSden
void fillEfficiencyHistos(int bin, int flag)
MonitorElement * hCLCTL1A2Denominator
std::vector< MonitorElement * > hSTimeCombinedByChamberType
MonitorElement * hALCTgetBX2Denominator
edm::EDGetTokenT< CSCSegmentCollection > se_token
edm::EDGetTokenT< CSCStripDigiCollection > sd_token
MonitorElement * hSTimeVsZ
void doSegments(edm::Handle< CSCSegmentCollection > cscSegments, edm::ESHandle< CSCGeometry > cscGeom)
MonitorElement * hRHSTE2
MonitorElement * hSChiSqAll
MonitorElement * hCSCOccupancy
std::vector< MonitorElement * > hWireTBin
MonitorElement * hCLCTL1A2DNumerator
std::vector< MonitorElement * > hRHTiming
void doWireDigis(edm::Handle< CSCWireDigiCollection > wires)
MonitorElement * hALCTgetBX2DNumerator
MonitorElement * hALCTMatch2Denominator
MonitorElement * hCLCTL1A
std::vector< MonitorElement * > hRHTimingAnode
bool withinSensitiveRegion(LocalPoint localPos, const std::array< const float, 4 > &layerBounds, int station, int ring, float shiftFromEdge, float shiftFromDeadZone)
std::vector< MonitorElement * > hRHRatioQ
std::vector< MonitorElement * > hRHsterr
void doBXMonitor(edm::Handle< CSCALCTDigiCollection > alcts, edm::Handle< CSCCLCTDigiCollection > clcts, const edm::Event &event, const edm::EventSetup &eventSetup)
MonitorElement * hSTimeDiff
MonitorElement * hSTimeCathode
std::vector< MonitorElement * > hSChiSqProb
MonitorElement * hSTimeCathodeSerial
double a
Definition: hdecay.h:119
MonitorElement * hWirenGroupsTotalHi
void doStripDigis(edm::Handle< CSCStripDigiCollection > strips)
MonitorElement * hStripNFired
void doPedestalNoise(edm::Handle< CSCStripDigiCollection > strips, edm::ESHandle< CSCGeometry > cscGeom)
MonitorElement * hSTimeCombinedSerial
std::vector< MonitorElement * > hStripPed
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers.hcal.doNoise = False simEcalUnsuppressedDigis.doNoise = False mix.digitizers.ecal.doNoise = False simEcalUnsuppressedDigis.doESNoise = False simSiPixelDigis.AddNoise = False mix.digitizers.pixel.AddNoise = False simSiStripDigis.Noise = False mix.digitizers.strip.AddNoise = False
Definition: DigiDM_cff.py:32
edm::EDGetTokenT< CSCRecHit2DCollection > rh_token
MonitorElement * hALCTgetBXSerial
MonitorElement * hSTimeVsTOF
MonitorElement * hRHnrechits
MonitorElement * hSnum
MonitorElement * hStripNFiredHi
double extrapolate1D(double initPosition, double initDirection, double parameterOfTheLine)
double lineParametrization(double z1Position, double z2Position, double z1Direction)
void doEfficiencies(edm::Handle< CSCWireDigiCollection > wires, edm::Handle< CSCStripDigiCollection > strips, edm::Handle< CSCRecHit2DCollection > recHits, edm::Handle< CSCSegmentCollection > cscSegments, edm::ESHandle< CSCGeometry > cscGeom)
void doOccupancies(edm::Handle< CSCStripDigiCollection > strips, edm::Handle< CSCWireDigiCollection > wires, edm::Handle< CSCRecHit2DCollection > recHits, edm::Handle< CSCSegmentCollection > cscSegments, edm::Handle< CSCCLCTDigiCollection > clcts)
MonitorElement * hRHnum
Definition: event.py:1
Definition: Run.h:45
MonitorElement * hSChiSqProbAll
void doRecHits(edm::Handle< CSCRecHit2DCollection > recHits, edm::Handle< CSCStripDigiCollection > strips, edm::ESHandle< CSCGeometry > cscGeom)
void applyCSClabels(MonitorElement *meHisto, LabelType t, AxisType a)