CMS 3D CMS Logo

CSCOfflineMonitor.h
Go to the documentation of this file.
1 #ifndef RecoLocalMuon_CSCOfflineMonitor_H
2 #define RecoLocalMuon_CSCOfflineMonitor_H
3 
26 
39 
45 
51 
53 
56 
62 
70 
72 public:
74  ~CSCOfflineMonitor() override{};
75 
77  enum AxisType { X = 1, Y = 2, Z = 3 };
78 
79 protected:
80  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
81  void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override;
82 
83 private:
85 
93 
95 
97 
98  // modules
119  const edm::Event &event,
120  const edm::EventSetup &eventSetup);
121 
122  // used by modules
123  float fitX(const CLHEP::HepMatrix &sp, const CLHEP::HepMatrix &ep);
124  float getSignal(const CSCStripDigiCollection &stripdigis, CSCDetId idRH, int centerStrip);
125  int typeIndex(CSCDetId id, int flag = 1);
126  int chamberSerial(CSCDetId id);
128 
129  // for efficiency calculations
130  // - these functions handle Stoyan's efficiency code
131 
132  void fillEfficiencyHistos(int bin, int flag);
133  // void getEfficiency(float bin, float Norm, std::vector<float> &eff);
134  // void histoEfficiency(TH1F *readHisto, MonitorElement *writeHisto);
135 
136  double lineParametrization(double z1Position, double z2Position, double z1Direction) {
137  double parameterLine = (z2Position - z1Position) / z1Direction;
138  return parameterLine;
139  }
140 
141  double extrapolate1D(double initPosition, double initDirection, double parameterOfTheLine) {
142  double extrapolatedPosition = initPosition + initDirection * parameterOfTheLine;
143  return extrapolatedPosition;
144  }
145 
146  bool withinSensitiveRegion(LocalPoint localPos,
147  const std::array<const float, 4> &layerBounds,
148  int station,
149  int ring,
150  float shiftFromEdge,
151  float shiftFromDeadZone);
152 
153  // for BX monitor plots
154  // void harvestChamberMeans(MonitorElement* meMean1D, MonitorElement *meMean2D, MonitorElement *hNum, MonitorElement *meDenom);
155  // void normalize(MonitorElement* me);
156 
157  // Wire digis
160  std::vector<MonitorElement *> hWireTBin;
161  std::vector<MonitorElement *> hWireNumber;
162 
163  // Strip Digis
166  std::vector<MonitorElement *> hStripNumber;
167  std::vector<MonitorElement *> hStripPed;
168 
169  // Rechits
172  std::vector<MonitorElement *> hRHGlobal;
173  std::vector<MonitorElement *> hRHSumQ;
174  std::vector<MonitorElement *> hRHTiming;
175  std::vector<MonitorElement *> hRHTimingAnode;
176  std::vector<MonitorElement *> hRHRatioQ;
177  std::vector<MonitorElement *> hRHstpos;
178  std::vector<MonitorElement *> hRHsterr;
179 
180  // Segments
183  std::vector<MonitorElement *> hSnhits;
185  std::vector<MonitorElement *> hSChiSq;
187  std::vector<MonitorElement *> hSChiSqProb;
191  std::vector<MonitorElement *> hSTimeDiffByChamberType;
193  std::vector<MonitorElement *> hSTimeAnodeByChamberType;
195  std::vector<MonitorElement *> hSTimeCathodeByChamberType;
197  std::vector<MonitorElement *> hSTimeCombinedByChamberType;
204 
205  // Resolution
206  std::vector<MonitorElement *> hSResid;
207 
208  // Occupancies
220 
221  // Efficiencies
226  // MonitorElement *hSEff;
227  // MonitorElement *hRHEff;
232  // MonitorElement *hSEff2;
233  // MonitorElement *hRHEff2;
234  // MonitorElement *hStripEff2;
235  // MonitorElement *hWireEff2;
236  // MonitorElement *hStripReadoutEff2;
239 
240  // BX monitoring
243  // MonitorElement *hALCTgetBXChamberMeans;
244  // MonitorElement *hALCTgetBX2DMeans;
247 
250  // MonitorElement *hALCTMatchChamberMeans;
251  // MonitorElement *hALCTMatch2DMeans;
254 
257  // MonitorElement *hCLCTL1AChamberMeans;
258  // MonitorElement *hCLCTL1A2DMeans;
261 };
262 #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)