Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-05 04:09:43

0001 #ifndef SiStripQualityHotStripIdentifierRoot_H
0002 #define SiStripQualityHotStripIdentifierRoot_H
0003 
0004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0005 #include "FWCore/Utilities/interface/Exception.h"
0006 #include "FWCore/Framework/interface/ESWatcher.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008 
0009 #include "CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h"
0010 #include "CondFormats/SiStripObjects/interface/SiStripBadStrip.h"
0011 
0012 #include "CalibTracker/SiStripQuality/interface/SiStripQualityHistos.h"
0013 #include "DQMServices/Core/interface/DQMStore.h"
0014 
0015 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0016 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0017 #include "CalibFormats/SiStripObjects/interface/SiStripQuality.h"
0018 #include "CalibTracker/Records/interface/SiStripQualityRcd.h"
0019 
0020 #include <vector>
0021 #include <memory>
0022 #include <iostream>
0023 #include <cstdio>
0024 #include <cstring>
0025 #include <sstream>
0026 #include <fstream>
0027 #include <string>
0028 #include "TFile.h"
0029 
0030 class SiStripHotStripAlgorithmFromClusterOccupancy;
0031 class SiStripBadAPVAlgorithmFromClusterOccupancy;
0032 class SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy;
0033 class TrackerTopology;
0034 
0035 class SiStripQualityHotStripIdentifierRoot : public ConditionDBWriter<SiStripBadStrip> {
0036 public:
0037   typedef dqm::legacy::MonitorElement MonitorElement;
0038   typedef dqm::legacy::DQMStore DQMStore;
0039 
0040   explicit SiStripQualityHotStripIdentifierRoot(const edm::ParameterSet&);
0041   ~SiStripQualityHotStripIdentifierRoot() override;
0042 
0043 private:
0044   //Will be called at the beginning of each run in the job
0045   void algoBeginRun(const edm::Run&, const edm::EventSetup&) override;
0046   //Will be called at the beginning of each luminosity block in the run
0047   void algoBeginLuminosityBlock(const edm::LuminosityBlock&, const edm::EventSetup&) override {}
0048   //Will be called at the end of the job
0049   void algoEndJob() override;
0050 
0051   //Will be called at every event
0052   void algoAnalyze(const edm::Event&, const edm::EventSetup&) override{};
0053 
0054   std::unique_ptr<SiStripBadStrip> getNewObject() override;
0055 
0056   void bookHistos();
0057 
0058 private:
0059   bool UseInputDB_;
0060   const edm::ParameterSet conf_;
0061 
0062   const TrackerGeometry* tracker_;
0063   const TrackerTopology* tTopo;
0064   const SiStripQuality* SiStripQuality_;
0065 
0066   DQMStore* dqmStore_;
0067 
0068   TFile* file0;
0069   std::string filename, dirpath;
0070   unsigned short MinClusterWidth_, MaxClusterWidth_;
0071   double TotNumberOfEvents;
0072   double MeanNumberOfCluster;
0073   uint32_t calibrationthreshold;
0074 
0075   edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_;
0076   edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> tkGeomToken_;
0077   edm::ESGetToken<SiStripQuality, SiStripQualityRcd> stripQualityToken_;
0078   edm::ESWatcher<SiStripQualityRcd> stripQualityWatcher_;
0079 
0080   SiStrip::QualityHistosMap ClusterPositionHistoMap;
0081   SiStripHotStripAlgorithmFromClusterOccupancy* theIdentifier;
0082   SiStripBadAPVAlgorithmFromClusterOccupancy* theIdentifier2;
0083   SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy* theIdentifier3;
0084 };
0085 #endif