Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:07:05

0001 #ifndef DTNoiseAnalysisTest_H
0002 #define DTNoiseAnalysisTest_H
0003 
0004 /** \class DTNoiseAnalysisTest
0005  * *
0006  *  DQM Test Client
0007  *
0008  *  \author  G. Mila - INFN Torino
0009  *
0010  *  threadsafe version (//-) oct/nov 2014 - WATWanAbdullah -ncpp-um-my
0011  *
0012  *   
0013  */
0014 
0015 #include "FWCore/Framework/interface/Frameworkfwd.h"
0016 #include "DQMServices/Core/interface/DQMStore.h"
0017 #include "FWCore/Framework/interface/ESHandle.h"
0018 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0019 #include "DQMServices/Core/interface/DQMEDHarvester.h"
0020 
0021 #include <iostream>
0022 #include <string>
0023 #include <map>
0024 
0025 class DTGeometry;
0026 class DTChamberId;
0027 class DTSuperLayerId;
0028 
0029 class DTNoiseAnalysisTest : public DQMEDHarvester {
0030 public:
0031   /// Constructor
0032   DTNoiseAnalysisTest(const edm::ParameterSet& ps);
0033 
0034   /// Destructor
0035   ~DTNoiseAnalysisTest() override;
0036 
0037 protected:
0038   /// BeginRun
0039   void beginRun(edm::Run const& run, edm::EventSetup const& context) override;
0040 
0041   /// book the summary histograms
0042 
0043   void bookHistos(DQMStore::IBooker&);
0044 
0045   /// DQM Client Diagnostic
0046   void dqmEndLuminosityBlock(DQMStore::IBooker&,
0047                              DQMStore::IGetter&,
0048                              edm::LuminosityBlock const&,
0049                              edm::EventSetup const&) override;
0050 
0051   void dqmEndJob(DQMStore::IBooker&, DQMStore::IGetter&) override;
0052 
0053 private:
0054   /// Get the ME name
0055   std::string getMEName(const DTChamberId& chID);
0056   std::string getSynchNoiseMEName(int wheelId) const;
0057 
0058   int nevents;
0059   int nMinEvts;
0060 
0061   bool bookingdone;
0062 
0063   // the dt geometry
0064   edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
0065   const DTGeometry* muonGeom;
0066 
0067   // paramaters from cfg
0068   int noisyCellDef;
0069   bool isCosmics;
0070   bool doSynchNoise;
0071   bool detailedAnalysis;
0072   double maxSynchNoiseRate;
0073   double noiseSafetyFactor;
0074 
0075   // wheel summary histograms
0076   std::map<int, MonitorElement*> noiseHistos;
0077   std::map<int, MonitorElement*> noisyCellHistos;
0078   MonitorElement* summaryNoiseHisto;
0079   MonitorElement* threshChannelsHisto;
0080   MonitorElement* summarySynchNoiseHisto;
0081   MonitorElement* glbSummarySynchNoiseHisto;
0082 
0083   //values based on F. Romana research, estimate the background rate per chamber and set a threshold to spot noisy wires with a safety factor
0084   static constexpr float cellW = 4.2;    //cm
0085   static constexpr float instLumi = 20;  //E33 cm-2 s-1, reference for Run3
0086   static constexpr std::array<std::array<float, 4>, 3> kW_MB = {
0087       {{{0.41, 0.08, 0.01, 0.15}},
0088        {{0.17, 0.04, 0.01, 0.15}},
0089        {{0.06, 0.02, 0.01, 0.15}}}};  // in units of E33 cm-2 s-1, 3 wheel types x 4 MB stations
0090   static constexpr std::array<std::array<float, 4>, 2> lenghtSL_MB = {
0091       {{{206, 252, 302, 0}}, {{240, 240, 240, 240}}}};  //Theta and Phi SL1 SL3
0092 };
0093 
0094 #endif