CMS 3D CMS Logo

SamplingHistograms.cc
Go to the documentation of this file.
9 #include <iostream>
10 #include <memory>
11 
12 #include <sstream>
13 #include <iomanip>
14 #include "TProfile.h"
15 
16 using namespace std;
17 using namespace sistrip;
18 
19 // -----------------------------------------------------------------------------
22  : CommissioningHistograms(pset.getParameter<edm::ParameterSet>("SamplingParameters"), bei, task), sOnCut_(3) {
23  LogTrace(mlDqmClient_) << "[SamplingHistograms::" << __func__ << "]"
24  << " Constructing object...";
25  factory_ = std::make_unique<SamplingSummaryFactory>();
26  // retreive the latency code from the root file
27  std::string dataPath = std::string(sistrip::collate_) + "/" + sistrip::root_ + "/latencyCode";
28  MonitorElement* codeElement = bei->get(dataPath);
29  if (codeElement)
30  latencyCode_ = codeElement->getIntValue();
31  else
32  latencyCode_ = 0;
33 }
34 
35 // -----------------------------------------------------------------------------
38  LogTrace(mlDqmClient_) << "[SamplingHistograms::" << __func__ << "]"
39  << " Deleting object...";
40 }
41 
42 // -----------------------------------------------------------------------------
45  // Clear map holding analysis objects
46  Analyses::iterator ianal;
47  for (ianal = data().begin(); ianal != data().end(); ianal++) {
48  if (ianal->second) {
49  delete ianal->second;
50  }
51  }
52  data().clear();
53 
54  // Iterate through map containing vectors of profile histograms
55  HistosMap::const_iterator iter = histos().begin();
56  for (; iter != histos().end(); iter++) {
57  // Check vector of histos is not empty (should be 1 histo)
58  if (iter->second.empty()) {
59  edm::LogWarning(mlDqmClient_) << "[SamplingHistograms::" << __func__ << "]"
60  << " Zero collation histograms found!";
61  continue;
62  }
63 
64  // Retrieve pointers to profile histos for this FED channel
65  vector<TH1*> profs;
66  Histos::const_iterator ihis = iter->second.begin();
67  for (; ihis != iter->second.end(); ihis++) {
68  TProfile* prof = ExtractTObject<TProfile>().extract((*ihis)->me_);
69  if (prof) {
70  profs.push_back(prof);
71  }
72  }
73 
74  // Perform histo analysis
75  SamplingAnalysis* anal = new SamplingAnalysis(iter->first);
76  anal->setSoNcut(sOnCut_);
77  SamplingAlgorithm algo(this->pset(), anal, latencyCode_);
78  algo.analysis(profs);
79  data()[iter->first] = anal;
80  }
81 }
82 
84  //TODO: should use the parameter set. Why is this crashing ???
85  // sOnCut_ = pset.getParameter<double>("SignalToNoiseCut");
86  sOnCut_ = 3.;
87 }
SamplingAlgorithm
Algorithm for latency run.
Definition: SamplingAlgorithm.h:18
SamplingHistograms::~SamplingHistograms
~SamplingHistograms() override
Definition: SamplingHistograms.cc:37
MessageLogger.h
SamplingHistograms::histoAnalysis
void histoAnalysis(bool debug) override
Definition: SamplingHistograms.cc:44
CommissioningHistograms::pset
const edm::ParameterSet & pset() const
Definition: CommissioningHistograms.h:163
CommissioningHistograms::bei
DQMStore *const bei() const
Definition: CommissioningHistograms.h:159
SamplingAnalysis
Analysis for latency run.
Definition: SamplingAnalysis.h:17
edm
HLT enums.
Definition: AlignableModifier.h:19
SamplingHistograms::sOnCut_
float sOnCut_
Definition: SamplingHistograms.h:19
ExtractTObject.h
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
sistrip::RunType
RunType
Definition: ConstantsForRunType.h:70
CommissioningHistograms::data
Analyses & data(bool getMaskedData=false)
Definition: CommissioningHistograms.cc:718
ExtractTObject
Definition: ExtractTObject.h:9
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
SamplingHistograms::SamplingHistograms
SamplingHistograms(const edm::ParameterSet &pset, DQMStore *, const sistrip::RunType &task=sistrip::APV_LATENCY)
Definition: SamplingHistograms.cc:21
sistrip::mlDqmClient_
static const char mlDqmClient_[]
Definition: ConstantsForLogger.h:19
cmsdt::algo
algo
Definition: constants.h:165
SamplingAnalysis.h
debug
#define debug
Definition: HDRShower.cc:19
SamplingHistograms::latencyCode_
int latencyCode_
Definition: SamplingHistograms.h:21
dqm::legacy::DQMStore
Definition: DQMStore.h:727
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:252
CommissioningHistograms::factory_
std::unique_ptr< Factory > factory_
Definition: CommissioningHistograms.h:129
SamplingHistograms::configure
void configure(const edm::ParameterSet &, const edm::EventSetup &) override
Definition: SamplingHistograms.cc:83
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripConstants.h
SamplingAlgorithm.h
edm::ParameterSet
Definition: ParameterSet.h:47
ParameterSet
Definition: Functions.h:16
ExtractTObject::extract
static T * extract(MonitorElement *me)
Definition: ExtractTObject.cc:21
sistrip::root_
static const char root_[]
Definition: ConstantsForDqm.h:30
edm::EventSetup
Definition: EventSetup.h:58
CommissioningHistograms
Definition: CommissioningHistograms.h:23
SamplingHistograms.h
std
Definition: JetResolutionObject.h:76
sistrip::collate_
static const char collate_[]
Definition: ConstantsForDqm.h:29
SiStripEnumsAndStrings.h
CommissioningHistograms::histos
const HistosMap & histos() const
Definition: CommissioningHistograms.h:161
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
SummaryGenerator.h
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
sistrip
sistrip classes
Definition: SiStripQualityHelpers.h:14
conversion_template_cfg.anal
anal
Definition: conversion_template_cfg.py:16
dqm::impl::MonitorElement::getIntValue
virtual int64_t getIntValue() const
Definition: MonitorElement.cc:924
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27