Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-25 23:40:02

0001 // -*- C++ -*-
0002 //
0003 // Package:    SiStripCorrelateBadStripAndNoise
0004 // Class:      SiStripCorrelateBadStripAndNoise
0005 //
0006 /**\class SiStripCorrelateBadStripAndNoise SiStripCorrelateBadStripAndNoise.cc
0007  DQM/SiStripMonitorSummary/plugins/SiStripCorrelateBadStripAndNoise.cc
0008 
0009  Description: <one line class summary>
0010 
0011  Implementation:
0012      <Notes on implementation>
0013 */
0014 //
0015 // Original Author:  Domenico GIORDANO
0016 //         Created:  Mon Aug 10 10:42:04 CEST 2009
0017 //
0018 //
0019 
0020 // system include files
0021 #include <memory>
0022 
0023 // user include files
0024 #include "CalibFormats/SiStripObjects/interface/SiStripQuality.h"
0025 #include "CondFormats/SiStripObjects/interface/SiStripNoises.h"
0026 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0027 #include "FWCore/Framework/interface/ESWatcher.h"
0028 #include "FWCore/Framework/interface/Frameworkfwd.h"
0029 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0030 #include "FWCore/Framework/interface/Event.h"
0031 #include "FWCore/Framework/interface/MakerMacros.h"
0032 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0033 #include "CalibTracker/Records/interface/SiStripDependentRecords.h"
0034 #include "CommonTools/TrackerMap/interface/TrackerMap.h"
0035 
0036 // ROOT includes
0037 #include "TFile.h"
0038 #include "TH1F.h"
0039 #include "TH2F.h"
0040 
0041 //
0042 // class decleration
0043 //
0044 class TrackerTopology;
0045 class TrackerGeometry;
0046 class SiStripCorrelateBadStripAndNoise : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
0047 public:
0048   explicit SiStripCorrelateBadStripAndNoise(const edm::ParameterSet &);
0049   ~SiStripCorrelateBadStripAndNoise() override = default;
0050 
0051 private:
0052   void beginRun(const edm::Run &run, const edm::EventSetup &es) override;
0053   void analyze(const edm::Event &, const edm::EventSetup &) override{};
0054   void endRun(const edm::Run &run, const edm::EventSetup &es) override{};
0055   void endJob() override;
0056 
0057   void DoAnalysis(const edm::EventSetup &);
0058   void getHistos(const uint32_t &detid, const TrackerTopology &tTopo, std::vector<TH2F *> &histos);
0059   TH2F *getHisto(const long unsigned int &index);
0060 
0061   void iterateOnDets(const TrackerTopology &tTopo, const TrackerGeometry &tGeom);
0062   void iterateOnBadStrips(const uint32_t &detid,
0063                           const TrackerTopology &tTopo,
0064                           const TrackerGeometry &tGeom,
0065                           SiStripQuality::Range &sqrange);
0066   void correlateWithNoise(const uint32_t &detid,
0067                           const TrackerTopology &tTopo,
0068                           const uint32_t &firstStrip,
0069                           const uint32_t &range);
0070   float getMeanNoise(const SiStripNoises::Range &noiseRange, const uint32_t &first, const uint32_t &range);
0071 
0072   // ----------member data ---------------------------
0073 
0074   edm::ESWatcher<SiStripQualityRcd> qualityWatcher_;
0075   edm::ESWatcher<SiStripNoisesRcd> noiseWatcher_;
0076   edm::ESGetToken<SiStripQuality, SiStripQualityRcd> qualityToken_;
0077   edm::ESGetToken<SiStripNoises, SiStripNoisesRcd> noiseToken_;
0078   edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_;
0079   edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> tkGeomToken_;
0080   const SiStripQuality *quality_;
0081   const SiStripNoises *noises_;
0082 
0083   TFile *file;
0084   std::vector<TH2F *> vTH2;
0085 
0086   TrackerMap *tkmap;
0087 };