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 ( const edm::ParameterSet pset,
DQMStore bei,
const sistrip::RunType task = sistrip::APV_LATENCY 
)

Definition at line 19 of file SamplingHistograms.cc.

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

20  : CommissioningHistograms(pset.getParameter<edm::ParameterSet>("SamplingParameters"), bei, task), sOnCut_(3) {
21  LogTrace(mlDqmClient_) << "[SamplingHistograms::" << __func__ << "]"
22  << " Constructing object...";
23  factory_ = unique_ptr<SamplingSummaryFactory>(new SamplingSummaryFactory);
24  // retreive the latency code from the root file
25  std::string dataPath = std::string(sistrip::collate_) + "/" + sistrip::root_ + "/latencyCode";
26  MonitorElement* codeElement = bei->get(dataPath);
27  if (codeElement)
28  latencyCode_ = codeElement->getIntValue();
29  else
30  latencyCode_ = 0;
31 }
T getParameter(std::string const &) const
const sistrip::RunType & task() const
virtual int64_t getIntValue() const
static const char mlDqmClient_[]
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
Definition: DQMStore.cc:1509
DQMStore *const bei() const
#define LogTrace(id)
std::unique_ptr< Factory > factory_
static const char root_[]
static const char collate_[]
SamplingHistograms::~SamplingHistograms ( )
override

Definition at line 35 of file SamplingHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

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

Reimplemented from CommissioningHistograms.

Reimplemented in FineDelayHistosUsingDb, and LatencyHistosUsingDb.

Definition at line 81 of file SamplingHistograms.cc.

References sOnCut_.

Referenced by FineDelayHistosUsingDb::configure().

81  {
82  //TODO: should use the parameter set. Why is this crashing ???
83  // sOnCut_ = pset.getParameter<double>("SignalToNoiseCut");
84  sOnCut_ = 3.;
85 }
void SamplingHistograms::histoAnalysis ( bool  debug)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 42 of file SamplingHistograms.cc.

References ecalcalib_dqm_sourceclient-live_cfg::algo, conversion_template_cfg::anal, CommissioningAlgorithm::analysis(), begin, CommissioningHistograms::data(), extract(), CommissioningHistograms::histos(), latencyCode_, sistrip::mlDqmClient_, CommissioningHistograms::pset(), SamplingAnalysis::setSoNcut(), and sOnCut_.

42  {
43  // Clear map holding analysis objects
44  Analyses::iterator ianal;
45  for (ianal = data().begin(); ianal != data().end(); ianal++) {
46  if (ianal->second) {
47  delete ianal->second;
48  }
49  }
50  data().clear();
51 
52  // Iterate through map containing vectors of profile histograms
53  HistosMap::const_iterator iter = histos().begin();
54  for (; iter != histos().end(); iter++) {
55  // Check vector of histos is not empty (should be 1 histo)
56  if (iter->second.empty()) {
57  edm::LogWarning(mlDqmClient_) << "[SamplingHistograms::" << __func__ << "]"
58  << " Zero collation histograms found!";
59  continue;
60  }
61 
62  // Retrieve pointers to profile histos for this FED channel
63  vector<TH1*> profs;
64  Histos::const_iterator ihis = iter->second.begin();
65  for (; ihis != iter->second.end(); ihis++) {
66  TProfile* prof = ExtractTObject<TProfile>().extract((*ihis)->me_);
67  if (prof) {
68  profs.push_back(prof);
69  }
70  }
71 
72  // Perform histo analysis
73  SamplingAnalysis* anal = new SamplingAnalysis(iter->first);
74  anal->setSoNcut(sOnCut_);
75  SamplingAlgorithm algo(this->pset(), anal, latencyCode_);
76  algo.analysis(profs);
77  data()[iter->first] = anal;
78  }
79 }
Analysis for latency run.
Algorithm for latency run.
Analyses & data(bool getMaskedData=false)
const edm::ParameterSet & pset() const
void setSoNcut(const float sOnCut)
static const char mlDqmClient_[]
int extract(std::vector< int > *output, const std::string &dati)
#define begin
Definition: vmac.h:32
const HistosMap & histos() const

Member Data Documentation

int SamplingHistograms::latencyCode_
private

Definition at line 21 of file SamplingHistograms.h.

Referenced by histoAnalysis(), and SamplingHistograms().

float SamplingHistograms::sOnCut_
private

Definition at line 19 of file SamplingHistograms.h.

Referenced by configure(), and histoAnalysis().