Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:33:38

0001 #ifndef testChannel_H
0002 #define testChannel_H
0003 
0004 /**
0005  * \file testChannel.h
0006  * \class testChannel
0007  * \brief calculate the best DAC value to obtain a pedestal = 200
0008  * \author P. Govoni (testChannel.govoni@cernNOSPAM.ch)
0009  *
0010  */
0011 
0012 #include "CalibCalorimetry/EcalPedestalOffsets/interface/TPedResult.h"
0013 #include "CalibCalorimetry/EcalPedestalOffsets/interface/TPedValues.h"
0014 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0015 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0016 #include "FWCore/Framework/interface/Event.h"
0017 #include "FWCore/Framework/interface/MakerMacros.h"
0018 #include <map>
0019 
0020 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0021 
0022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0023 
0024 #include "TROOT.h"
0025 #include "TStyle.h"
0026 
0027 #include "TH2.h"
0028 #include "TProfile.h"
0029 
0030 #include <fstream>
0031 #include <iostream>
0032 #include <memory>
0033 #include <string>
0034 #include <vector>
0035 
0036 class testChannel : public edm::one::EDAnalyzer<> {
0037 public:
0038   //! Constructor
0039   testChannel(const edm::ParameterSet &ps);
0040 
0041   //! Destructor
0042   ~testChannel() override;
0043 
0044   //! Subscribe/Unsubscribe to Monitoring Elements
0045   void subscribe(void);
0046   void subscribeNew(void);
0047   void unsubscribe(void);
0048 
0049   ///! Analyze
0050   void analyze(edm::Event const &event, edm::EventSetup const &eventSetup) override;
0051 
0052   //! BeginJob
0053   void beginJob() override;
0054 
0055   //! EndJob
0056   void endJob(void) override;
0057 
0058 private:
0059   int getHeaderSMId(const int headerId);
0060 
0061   const edm::EDGetTokenT<EBDigiCollection> m_digiProducerToken;         //! Token to access digis
0062   const edm::EDGetTokenT<EcalRawDataCollection> m_headerProducerToken;  //! Token to access headers
0063 
0064   const std::string m_xmlFile;  //! name of the xml file to be saved
0065 
0066   const int m_DACmin;
0067   const int m_DACmax;
0068   const double m_RMSmax;
0069   const int m_bestPed;
0070 
0071   const int m_xtal;
0072 
0073   TH2F m_pedVSDAC;
0074   TH2F m_singlePedVSDAC_1;
0075   TH2F m_singlePedVSDAC_2;
0076   TH2F m_singlePedVSDAC_3;
0077 };
0078 
0079 #endif