CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SamplingHistograms Class Reference

#include <SamplingHistograms.h>

Inheritance diagram for SamplingHistograms:
CommissioningHistograms FineDelayHistosUsingDb LatencyHistosUsingDb

Public Member Functions

void configure (const edm::ParameterSet &, const edm::EventSetup &) override
 
void histoAnalysis (bool debug) override
 
 SamplingHistograms (const edm::ParameterSet &pset, DQMStore *, const sistrip::RunType &task=sistrip::APV_LATENCY)
 
 ~SamplingHistograms () override
 
- Public Member Functions inherited from CommissioningHistograms
 CommissioningHistograms (const edm::ParameterSet &pset, DQMStore *const, const sistrip::RunType &)
 
 CommissioningHistograms ()
 
void createCollations (const std::vector< std::string > &)
 
virtual void createSummaryHisto (const sistrip::Monitorable &, const sistrip::Presentation &, const std::string &top_level_dir, const sistrip::Granularity &)
 
void extractHistograms (const std::vector< std::string > &)
 
virtual void printAnalyses ()
 
virtual void printSummary ()
 
void remove (std::string pattern="")
 
void save (std::string &filename, uint32_t run_number=0, std::string partitionName="")
 
virtual ~CommissioningHistograms ()
 

Private Attributes

int latencyCode_
 
float sOnCut_
 

Additional Inherited Members

- Public Types inherited from CommissioningHistograms
typedef std::map< uint32_t, CommissioningAnalysis * > Analyses
 
typedef Analyses::iterator Analysis
 
typedef dqm::harvesting::DQMStore DQMStore
 
typedef SummaryPlotFactory< CommissioningAnalysis * > Factory
 
typedef std::map< uint32_t, uint32_t > FedToFecMap
 
typedef std::vector< Histo * > Histos
 
typedef std::map< uint32_t, HistosHistosMap
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Static Public Member Functions inherited from CommissioningHistograms
static void copyCustomInformation (DQMStore *const, const std::vector< std::string > &)
 
static uint32_t runNumber (DQMStore *const, const std::vector< std::string > &)
 
static sistrip::RunType runType (DQMStore *const, const std::vector< std::string > &)
 
- Protected Member Functions inherited from CommissioningHistograms
DQMStore *const bei () const
 
void clearHistosMap ()
 
Analysesdata (bool getMaskedData=false)
 
Factory *const factory ()
 
TH1 * histogram (const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory, const uint32_t &xbins, const float &xlow=1. *sistrip::invalid_, const float &xhigh=1. *sistrip::invalid_)
 
const HistosMaphistos () const
 
const FedToFecMapmapping () const
 
void printHistosMap ()
 
const edm::ParameterSetpset () const
 
const sistrip::RunTypetask () const
 
- Protected Attributes inherited from CommissioningHistograms
std::unique_ptr< Factoryfactory_
 

Detailed Description

Definition at line 9 of file SamplingHistograms.h.

Constructor & Destructor Documentation

◆ SamplingHistograms()

SamplingHistograms::SamplingHistograms ( const edm::ParameterSet pset,
DQMStore bei,
const sistrip::RunType task = sistrip::APV_LATENCY 
)

Definition at line 21 of file SamplingHistograms.cc.

References CommissioningHistograms::bei(), sistrip::collate_, CommissioningHistograms::factory_, dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getIntValue(), latencyCode_, LogTrace, sistrip::mlDqmClient_, sistrip::root_, and AlCaHLTBitMon_QueryRunRegistry::string.

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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
static const char mlDqmClient_[]
#define LogTrace(id)
std::unique_ptr< Factory > factory_
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:680
static const char root_[]
const edm::ParameterSet & pset() const
DQMStore *const bei() const
const sistrip::RunType & task() const
static const char collate_[]
virtual int64_t getIntValue() const

◆ ~SamplingHistograms()

SamplingHistograms::~SamplingHistograms ( )
override

Definition at line 37 of file SamplingHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

37  {
38  LogTrace(mlDqmClient_) << "[SamplingHistograms::" << __func__ << "]"
39  << " Deleting object...";
40 }
static const char mlDqmClient_[]
#define LogTrace(id)

Member Function Documentation

◆ configure()

void SamplingHistograms::configure ( const edm::ParameterSet pset,
const edm::EventSetup  
)
overridevirtual

Reimplemented from CommissioningHistograms.

Reimplemented in FineDelayHistosUsingDb, and LatencyHistosUsingDb.

Definition at line 83 of file SamplingHistograms.cc.

References sOnCut_.

Referenced by FineDelayHistosUsingDb::configure().

83  {
84  //TODO: should use the parameter set. Why is this crashing ???
85  // sOnCut_ = pset.getParameter<double>("SignalToNoiseCut");
86  sOnCut_ = 3.;
87 }

◆ histoAnalysis()

void SamplingHistograms::histoAnalysis ( bool  debug)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 44 of file SamplingHistograms.cc.

References conversion_template_cfg::anal, CommissioningHistograms::data(), extract(), CommissioningHistograms::histos(), latencyCode_, sistrip::mlDqmClient_, CommissioningHistograms::pset(), and sOnCut_.

44  {
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 }
Analysis for latency run.
const HistosMap & histos() const
Algorithm for latency run.
Analyses & data(bool getMaskedData=false)
static const char mlDqmClient_[]
int extract(std::vector< int > *output, const std::string &dati)
const edm::ParameterSet & pset() const
Log< level::Warning, false > LogWarning

Member Data Documentation

◆ latencyCode_

int SamplingHistograms::latencyCode_
private

Definition at line 21 of file SamplingHistograms.h.

Referenced by histoAnalysis(), and SamplingHistograms().

◆ sOnCut_

float SamplingHistograms::sOnCut_
private

Definition at line 19 of file SamplingHistograms.h.

Referenced by configure(), and histoAnalysis().