CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
SiStripPopConPedestalsHandlerFromDQM Class Reference
Inheritance diagram for SiStripPopConPedestalsHandlerFromDQM:
SiStripDQMPopConSourceHandler< SiStripPedestals > popcon::PopConSourceHandler< SiStripPedestals >

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from SiStripDQMPopConSourceHandler< SiStripPedestals >
typedef dqm::legacy::DQMStore DQMStore
 
- Public Types inherited from popcon::PopConSourceHandler< SiStripPedestals >
typedef std::vector< Triplet > Container
 
typedef std::vector< std::pair< SiStripPedestals *, cond::Time_t > > OldContainer
 
typedef PopConSourceHandler< SiStripPedestalsself
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef SiStripPedestals value_type
 

Public Member Functions

void dqmEndJob (DQMStore::IBooker &booker, DQMStore::IGetter &getter) override
 
SiStripPedestalsgetObj () const override
 
 SiStripPopConPedestalsHandlerFromDQM (const edm::ParameterSet &iConfig)
 
 ~SiStripPopConPedestalsHandlerFromDQM () override
 
- Public Member Functions inherited from SiStripDQMPopConSourceHandler< SiStripPedestals >
virtual bool checkForCompatibility (const std::string &otherMetaData) const
 
virtual std::string getMetaDataString () const
 
void getNewObjects () override
 
std::string id () const override
 
virtual void initES (const edm::EventSetup &)
 
 SiStripDQMPopConSourceHandler (const edm::ParameterSet &pset)
 
 ~SiStripDQMPopConSourceHandler () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< SiStripPedestals >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
void initialize (const cond::persistency::Session &dbSession, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry_t const & logDBEntry () const
 
std::pair< Container const *, std::string const > operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo_t const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Private Attributes

edm::FileInPath fp_
 
SiStripPedestals m_obj
 
std::string MEDir_
 

Additional Inherited Members

- Protected Member Functions inherited from SiStripDQMPopConSourceHandler< SiStripPedestals >
uint32_t getRunNumber () const
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< SiStripPedestals >
int add (value_type *payload, Summary *summary, Time_t time)
 
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< SiStripPedestals >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Author
M. De Mattia, S. Dutta, D. Giordano

@popcon::PopConSourceHandler to extract pedestal values the DQM as bad and write in the database.

Definition at line 10 of file SiStripPopConPedestalsDQM.cc.

Member Typedef Documentation

◆ DQMStore

Definition at line 13 of file SiStripPopConPedestalsDQM.cc.

◆ MonitorElement

Definition at line 12 of file SiStripPopConPedestalsDQM.cc.

Constructor & Destructor Documentation

◆ SiStripPopConPedestalsHandlerFromDQM()

SiStripPopConPedestalsHandlerFromDQM::SiStripPopConPedestalsHandlerFromDQM ( const edm::ParameterSet iConfig)
explicit

Definition at line 30 of file SiStripPopConPedestalsDQM.cc.

33  "file", edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))},
34  MEDir_{iConfig.getUntrackedParameter<std::string>("ME_DIR", "DQMData")} {
35  edm::LogInfo("SiStripPedestalsDQMService") << "[SiStripPedestalsDQMService::SiStripPedestalsDQMService]";
36 }

References edm::ParameterSet::getUntrackedParameter().

◆ ~SiStripPopConPedestalsHandlerFromDQM()

SiStripPopConPedestalsHandlerFromDQM::~SiStripPopConPedestalsHandlerFromDQM ( )
override

Definition at line 38 of file SiStripPopConPedestalsDQM.cc.

38  {
39  edm::LogInfo("SiStripPedestalsDQMService") << "[SiStripPedestalsDQMService::~SiStripPedestalsDQMService]";
40 }

Member Function Documentation

◆ dqmEndJob()

void SiStripPopConPedestalsHandlerFromDQM::dqmEndJob ( DQMStore::IBooker booker,
DQMStore::IGetter getter 
)
overridevirtual

Reimplemented from SiStripDQMPopConSourceHandler< SiStripPedestals >.

Definition at line 42 of file SiStripPopConPedestalsDQM.cc.

42  {
43  std::cout << "SiStripPedestalsDQMService::readPedestals" << std::endl;
44 
46 
48 
49  // getter.cd(iConfig_.getUntrackedParameter<std::string>("ME_DIR"));
50  getter.cd();
51 
52  uint32_t stripsPerApv = 128;
53 
54  // Get the full list of monitoring elements
55  // const std::vector<MonitorElement*>& MEs = getter.getAllContents(iConfig_.getUntrackedParameter<std::string>("ME_DIR","DQMData"));
56 
57  // Take a copy of the vector
58  std::vector<MonitorElement*> MEs = getter.getAllContents(MEDir_);
59  // Remove all but the MEs we are using
60  MEs.erase(std::remove_if(MEs.begin(),
61  MEs.end(),
62  [](const MonitorElement* ME) -> bool {
63  return std::string::npos == ME->getName().find("PedsPerStrip__det__");
64  }),
65  MEs.end());
66 
67  // The histograms are one per DetId, loop on all the DetIds and extract the corresponding histogram
68  for (const auto& detInfo : reader.getAllData()) {
69  SiStripPedestals::InputVector theSiStripVector;
70 
71  // Take the path for each DetId and build the complete path + histogram name
72 
73  // MonitorElement * mE = getModuleHistogram(detInfo.first, "PedsPerStrip");
74  const MonitorElement* mE{nullptr};
75  std::string MEname("PedsPerStrip__det__" + std::to_string(detInfo.first));
76  for (const MonitorElement* ime : MEs) {
77  if (ime->getName() == MEname) {
78  mE = ime;
79  break;
80  }
81  }
82 
83  // find( MEs.begin(), MEs.end(), "PedsPerStrip__det__"+std::to_string(detInfo.first), findMEbyName() );
84  // MonitorElement * mE = *(find( MEs.begin(), MEs.end(), findMEbyName("PedsPerStrip__det__"+std::to_string(detInfo.first)) ));
85 
86  if (mE) {
87  TH1F* histo = mE->getTH1F();
88  if (histo) {
89  // Read the pedestals from the histograms
90  uint32_t nBinsX = histo->GetXaxis()->GetNbins();
91 
92  if (nBinsX != stripsPerApv * (detInfo.second.nApvs)) {
93  std::cout << "ERROR: number of bin = " << nBinsX
94  << " != number of strips = " << stripsPerApv * (detInfo.second.nApvs) << std::endl;
95  }
96 
97  // std::cout << "Bin 0 = " << histo->GetBinContent(0) << std::endl;
98  // TH1 bins start from 1, 0 is the underflow, nBinsX+1 the overflow.
99  for (uint32_t iBin = 1; iBin <= nBinsX; ++iBin) {
100  // encode the pedestal value and put it in the vector (push_back)
101  m_obj.setData(histo->GetBinContent(iBin), theSiStripVector);
102  }
103  } else {
104  std::cout << "ERROR: histo = " << histo << std::endl;
105  }
106  } else {
107  std::cout << "ERROR: ME = " << mE << std::endl;
108  }
109  // If the ME was absent fill the vector with 0
110  if (theSiStripVector.empty()) {
111  for (unsigned short j = 0; j < 128 * detInfo.second.nApvs; ++j) {
112  m_obj.setData(0, theSiStripVector);
113  }
114  }
115 
116  if (!m_obj.put(detInfo.first, theSiStripVector))
117  edm::LogError("SiStripPedestalsFakeESSource::produce ") << " detid already exists" << std::endl;
118  }
119  getter.cd();
120 }

References dqm::implementation::NavigatorBase::cd(), gather_cfg::cout, fp_, edm::FileInPath::fullPath(), dqm::implementation::IGetter::getAllContents(), timingPdfMaker::histo, dqmiolumiharvest::j, m_obj, MEDir_, EcalMEFormatter_cfi::MEs, SiStripPedestals::put(), DQM::reader, SiStripPedestals::setData(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ getObj()

SiStripPedestals * SiStripPopConPedestalsHandlerFromDQM::getObj ( ) const
overridevirtual

Implements SiStripDQMPopConSourceHandler< SiStripPedestals >.

Definition at line 122 of file SiStripPopConPedestalsDQM.cc.

122 { return new SiStripPedestals(m_obj); }

References m_obj.

Member Data Documentation

◆ fp_

edm::FileInPath SiStripPopConPedestalsHandlerFromDQM::fp_
private

Definition at line 22 of file SiStripPopConPedestalsDQM.cc.

Referenced by dqmEndJob().

◆ m_obj

SiStripPedestals SiStripPopConPedestalsHandlerFromDQM::m_obj
private

Definition at line 24 of file SiStripPopConPedestalsDQM.cc.

Referenced by dqmEndJob(), and getObj().

◆ MEDir_

std::string SiStripPopConPedestalsHandlerFromDQM::MEDir_
private

Definition at line 23 of file SiStripPopConPedestalsDQM.cc.

Referenced by dqmEndJob().

SiStripPedestals::put
bool put(const uint32_t &detID, InputVector &input)
Definition: SiStripPedestals.cc:5
SiStripDQMPopConSourceHandler< SiStripPedestals >
SiStripPedestals::setData
void setData(float ped, InputVector &vped)
Definition: SiStripPedestals.cc:47
gather_cfg.cout
cout
Definition: gather_cfg.py:144
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
dqm::implementation::IGetter::getAllContents
virtual std::vector< dqm::harvesting::MonitorElement * > getAllContents(std::string const &path) const
Definition: DQMStore.cc:609
SiStripDetInfoFileReader
Definition: SiStripDetInfoFileReader.h:30
SiStripPopConPedestalsHandlerFromDQM::fp_
edm::FileInPath fp_
Definition: SiStripPopConPedestalsDQM.cc:22
edm::FileInPath
Definition: FileInPath.h:64
DQM.reader
reader
Definition: DQM.py:105
SiStripPopConPedestalsHandlerFromDQM::MEDir_
std::string MEDir_
Definition: SiStripPopConPedestalsDQM.cc:23
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ME
dqm::harvesting::MonitorElement ME
Definition: TrackingDQMClientHeavyIons.cc:20
SiStripPopConPedestalsHandlerFromDQM::m_obj
SiStripPedestals m_obj
Definition: SiStripPopConPedestalsDQM.cc:24
EcalMEFormatter_cfi.MEs
MEs
Definition: EcalMEFormatter_cfi.py:25
ME
Definition: ME.h:11
SiStripPedestals::InputVector
std::vector< uint16_t > InputVector
Definition: SiStripPedestals.h:54
SiStripPedestals
Definition: SiStripPedestals.h:27
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::Log
Definition: MessageLogger.h:70
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163