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 
94  // modules
115  const edm::Event &event,
116  const edm::EventSetup &eventSetup);
117 
118  // used by modules
119  float fitX(const CLHEP::HepMatrix &sp, const CLHEP::HepMatrix &ep);
120  float getSignal(const CSCStripDigiCollection &stripdigis, CSCDetId idRH, int centerStrip);
121  int typeIndex(CSCDetId id, int flag = 1);
122  int chamberSerial(CSCDetId id);
124 
125  // for efficiency calculations
126  // - these functions handle Stoyan's efficiency code
127 
128  void fillEfficiencyHistos(int bin, int flag);
129  // void getEfficiency(float bin, float Norm, std::vector<float> &eff);
130  // void histoEfficiency(TH1F *readHisto, MonitorElement *writeHisto);
131 
132  double lineParametrization(double z1Position, double z2Position, double z1Direction) {
133  double parameterLine = (z2Position - z1Position) / z1Direction;
134  return parameterLine;
135  }
136 
137  double extrapolate1D(double initPosition, double initDirection, double parameterOfTheLine) {
138  double extrapolatedPosition = initPosition + initDirection * parameterOfTheLine;
139  return extrapolatedPosition;
140  }
141 
142  bool withinSensitiveRegion(LocalPoint localPos,
143  const std::array<const float, 4> &layerBounds,
144  int station,
145  int ring,
146  float shiftFromEdge,
147  float shiftFromDeadZone);
148 
149  // for BX monitor plots
150  // void harvestChamberMeans(MonitorElement* meMean1D, MonitorElement *meMean2D, MonitorElement *hNum, MonitorElement *meDenom);
151  // void normalize(MonitorElement* me);
152 
153  // Wire digis
155  std::vector<MonitorElement *> hWireTBin;
156  std::vector<MonitorElement *> hWireNumber;
157 
158  // Strip Digis
160  std::vector<MonitorElement *> hStripNumber;
161  std::vector<MonitorElement *> hStripPed;
162 
163  // Rechits
165  std::vector<MonitorElement *> hRHGlobal;
166  std::vector<MonitorElement *> hRHSumQ;
167  std::vector<MonitorElement *> hRHTiming;
168  std::vector<MonitorElement *> hRHTimingAnode;
169  std::vector<MonitorElement *> hRHRatioQ;
170  std::vector<MonitorElement *> hRHstpos;
171  std::vector<MonitorElement *> hRHsterr;
172 
173  // Segments
176  std::vector<MonitorElement *> hSnhits;
178  std::vector<MonitorElement *> hSChiSq;
180  std::vector<MonitorElement *> hSChiSqProb;
184  std::vector<MonitorElement *> hSTimeDiffByChamberType;
186  std::vector<MonitorElement *> hSTimeAnodeByChamberType;
188  std::vector<MonitorElement *> hSTimeCathodeByChamberType;
190  std::vector<MonitorElement *> hSTimeCombinedByChamberType;
197 
198  // Resolution
199  std::vector<MonitorElement *> hSResid;
200 
201  // Occupancies
213 
214  // Efficiencies
219  // MonitorElement *hSEff;
220  // MonitorElement *hRHEff;
225  // MonitorElement *hSEff2;
226  // MonitorElement *hRHEff2;
227  // MonitorElement *hStripEff2;
228  // MonitorElement *hWireEff2;
229  // MonitorElement *hStripReadoutEff2;
232 
233  // BX monitoring
236  // MonitorElement *hALCTgetBXChamberMeans;
237  // MonitorElement *hALCTgetBX2DMeans;
240 
243  // MonitorElement *hALCTMatchChamberMeans;
244  // MonitorElement *hALCTMatch2DMeans;
247 
250  // MonitorElement *hCLCTL1AChamberMeans;
251  // MonitorElement *hCLCTL1A2DMeans;
254 };
255 #endif
MonitorElement * hEffDenominator
MonitorElement * hOSegmentsSerial
edm::EDGetTokenT< CSCALCTDigiCollection > al_token
MonitorElement * hRHden
std::vector< MonitorElement * > hSTimeCathodeByChamberType
MonitorElement * hOWireSerial
MonitorElement * hSensitiveAreaEvt
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
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 * 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
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
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)