CMS 3D CMS Logo

List of all members | Public Member Functions
ApvTimingHistograms Class Reference

#include <ApvTimingHistograms.h>

Inheritance diagram for ApvTimingHistograms:
CommissioningHistograms ApvTimingHistosUsingDb

Public Member Functions

 ApvTimingHistograms (const edm::ParameterSet &pset, DQMStore *)
 
void histoAnalysis (bool debug) override
 
 ~ApvTimingHistograms () override
 
- Public Member Functions inherited from CommissioningHistograms
 CommissioningHistograms ()
 
 CommissioningHistograms (const edm::ParameterSet &pset, DQMStore *const, const sistrip::RunType &)
 
virtual void configure (const edm::ParameterSet &, const edm::EventSetup &)
 
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 ()
 

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 7 of file ApvTimingHistograms.h.

Constructor & Destructor Documentation

◆ ApvTimingHistograms()

ApvTimingHistograms::ApvTimingHistograms ( const edm::ParameterSet pset,
DQMStore bei 
)

Definition at line 18 of file ApvTimingHistograms.cc.

20  factory_ = unique_ptr<ApvTimingSummaryFactory>(new ApvTimingSummaryFactory);
21  LogTrace(mlDqmClient_) << "[ApvTimingHistograms::" << __func__ << "]"
22  << " Constructing object...";
23 }

References CommissioningHistograms::factory_, LogTrace, and sistrip::mlDqmClient_.

◆ ~ApvTimingHistograms()

ApvTimingHistograms::~ApvTimingHistograms ( )
override

Definition at line 27 of file ApvTimingHistograms.cc.

27  {
28  LogTrace(mlDqmClient_) << "[ApvTimingHistograms::" << __func__ << "]"
29  << " Destructing object...";
30 }

References LogTrace, and sistrip::mlDqmClient_.

Member Function Documentation

◆ histoAnalysis()

void ApvTimingHistograms::histoAnalysis ( bool  debug)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 34 of file ApvTimingHistograms.cc.

34  {
35  LogTrace(mlDqmClient_) << "[ApvTimingHistograms::" << __func__ << "]";
36 
37  // Some initialisation
38  uint16_t valid = 0;
39  HistosMap::const_iterator iter;
40  Analyses::iterator ianal;
41  std::map<std::string, uint16_t> errors;
42 
43  // Clear map holding analysis objects
44  for (ianal = data().begin(); ianal != data().end(); ianal++) {
45  if (ianal->second) {
46  delete ianal->second;
47  }
48  }
49  data().clear();
50 
51  // Reset minimum / maximum delays
52  float time_min = 1. * sistrip::invalid_;
53  float time_max = -1. * sistrip::invalid_;
54  uint32_t device_min = sistrip::invalid_;
55  uint32_t device_max = sistrip::invalid_;
56 
57  // Iterate through map containing histograms
58  for (iter = histos().begin(); iter != histos().end(); iter++) {
59  // Check vector of histos is not empty
60  if (iter->second.empty()) {
61  edm::LogWarning(mlDqmClient_) << "[ApvTimingHistograms::" << __func__ << "]"
62  << " Zero histograms found!";
63  continue;
64  }
65 
66  // Retrieve pointers to histos
67  std::vector<TH1*> profs;
68  Histos::const_iterator ihis = iter->second.begin();
69  for (; ihis != iter->second.end(); ihis++) {
70  TProfile* prof = ExtractTObject<TProfile>().extract((*ihis)->me_);
71  if (prof) {
72  profs.push_back(prof);
73  }
74  }
75 
76  // Perform histo analysis
77  ApvTimingAnalysis* anal = new ApvTimingAnalysis(iter->first);
78  ApvTimingAlgorithm algo(this->pset(), anal);
79  algo.analysis(profs);
80  data()[iter->first] = anal;
81 
82  // Check if tick mark found
83  if (!anal->foundTickMark()) {
84  continue;
85  }
86 
87  // Find maximum time
88  if (anal->time() > time_max) {
89  time_max = anal->time();
90  device_max = iter->first;
91  }
92 
93  // Find minimum time
94  if (anal->time() < time_min) {
95  time_min = anal->time();
96  device_min = iter->first;
97  }
98  }
99 
100  // Adjust maximum (and minimum) delay(s) to find optimum sampling point(s)
101  if (time_max > sistrip::valid_ || time_max < -1. * sistrip::valid_) {
102  edm::LogWarning(mlDqmClient_) << "[ApvTimingHistograms::" << __func__ << "]"
103  << " Unable to set maximum time! Found unexpected value: " << time_max;
104 
105  } else {
106  SiStripFecKey min(device_min);
107  edm::LogVerbatim(mlDqmClient_) << "[ApvTimingHistograms::" << __func__ << "]"
108  << " Crate/FEC/Ring/CCU/module/channel: " << min.fecCrate() << "/" << min.fecSlot()
109  << "/" << min.fecRing() << "/" << min.ccuAddr() << "/" << min.ccuChan() << "/"
110  << min.lldChan() << " has minimum time for tick mark rising edge [ns]: " << time_min;
111 
112  SiStripFecKey max(device_max);
113  edm::LogVerbatim(mlDqmClient_) << "[ApvTimingHistograms::" << __func__ << "]"
114  << " Crate/FEC/Ring/CCU/module/channel: " << max.fecCrate() << "/" << max.fecSlot()
115  << "/" << max.fecRing() << "/" << max.ccuAddr() << "/" << max.ccuChan() << "/"
116  << max.lldChan() << " has maximum time for tick mark rising edge [ns]: " << time_max;
117 
118  edm::LogVerbatim(mlDqmClient_) << "[ApvTimingHistograms::" << __func__ << "]"
119  << " Difference b/w minimum and maximum times"
120  << " for tick mark rising edges [ns] is: " << (time_max - time_min);
121  }
122 
123  // Set reference time for all analysis objects
124  for (ianal = data().begin(); ianal != data().end(); ianal++) {
125  ApvTimingAnalysis* anal = dynamic_cast<ApvTimingAnalysis*>(ianal->second);
126  if (!anal) {
127  continue;
128  }
129  anal->refTime(time_max, this->pset().getParameter<int>("TargetDelay"));
130  if (anal->isValid()) {
131  valid++;
132  }
133  if (!anal->getErrorCodes().empty()) {
134  errors[anal->getErrorCodes()[0]]++;
135  }
136  }
137 
138  if (!histos().empty()) {
139  edm::LogVerbatim(mlDqmClient_) << "[ApvTimingHistograms::" << __func__ << "]"
140  << " Analyzed histograms for " << histos().size() << " FED channels, of which "
141  << valid << " (" << 100 * valid / histos().size() << "%) are valid.";
142  } else {
143  edm::LogWarning(mlDqmClient_) << "[ApvTimingHistograms::" << __func__ << "]"
144  << " No histograms to analyze!";
145  }
146 
147  if (!histos().empty()) {
148  edm::LogVerbatim(mlDqmClient_) << "[ApvTimingHistograms::" << __func__ << "]"
149  << " Analyzed histograms for " << histos().size() << " FED channels, of which "
150  << valid << " (" << 100 * valid / histos().size() << "%) are valid.";
151  if (!errors.empty()) {
152  uint16_t count = 0;
153  std::stringstream ss;
154  ss << std::endl;
155  std::map<std::string, uint16_t>::const_iterator ii;
156  for (ii = errors.begin(); ii != errors.end(); ++ii) {
157  ss << " " << ii->first << ": " << ii->second << std::endl;
158  count += ii->second;
159  }
160  edm::LogWarning(mlDqmClient_) << "[ApvTimingHistograms::" << __func__ << "]"
161  << " Found " << count << " errors (" << 100 * count / histos().size()
162  << "%): " << ss.str();
163  }
164  } else {
165  edm::LogWarning(mlDqmClient_) << "[ApvTimingHistograms::" << __func__ << "]"
166  << " No histograms to analyze!";
167  }
168 }

References conversion_template_cfg::anal, begin, KineDebug3::count(), CommissioningHistograms::data(), relativeConstraints::empty, MessageLogger_cfi::errors, ExtractTObject< T >::extract(), CommissioningHistograms::histos(), cuy::ii, sistrip::invalid_, LogTrace, SiStripPI::max, min(), sistrip::mlDqmClient_, CommissioningHistograms::pset(), contentValuesCheck::ss, validateGeometry_cfg::valid, and sistrip::valid_.

sistrip::APV_TIMING
Definition: ConstantsForRunType.h:75
CommissioningHistograms::pset
const edm::ParameterSet & pset() const
Definition: CommissioningHistograms.h:163
CommissioningHistograms::bei
DQMStore *const bei() const
Definition: CommissioningHistograms.h:159
min
T min(T a, T b)
Definition: MathUtil.h:58
MessageLogger_cfi.errors
errors
Definition: MessageLogger_cfi.py:18
CommissioningHistograms::data
Analyses & data(bool getMaskedData=false)
Definition: CommissioningHistograms.cc:718
ExtractTObject
Definition: ExtractTObject.h:9
sistrip::mlDqmClient_
static const char mlDqmClient_[]
Definition: ConstantsForLogger.h:19
validateGeometry_cfg.valid
valid
Definition: validateGeometry_cfg.py:21
CommissioningHistograms::CommissioningHistograms
CommissioningHistograms()
Definition: CommissioningHistograms.cc:60
sistrip::valid_
static const uint16_t valid_
Definition: Constants.h:17
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
cmsdt::algo
algo
Definition: constants.h:164
errors
Definition: errors.py:1
CommissioningHistograms::factory_
std::unique_ptr< Factory > factory_
Definition: CommissioningHistograms.h:129
SiStripFecKey
Utility class that identifies a position within the strip tracker control structure,...
Definition: SiStripFecKey.h:45
edm::LogWarning
Definition: MessageLogger.h:141
edm::ParameterSet
Definition: ParameterSet.h:36
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
ApvTimingAnalysis
Analysis for timing run using APV tick marks.
Definition: ApvTimingAnalysis.h:15
ApvTimingAlgorithm
Analysis for timing run using APV tick marks.
Definition: ApvTimingAlgorithm.h:16
edm::LogVerbatim
Definition: MessageLogger.h:297
ExtractTObject::extract
static T * extract(MonitorElement *me)
Definition: ExtractTObject.cc:21
sistrip::invalid_
static const uint16_t invalid_
Definition: Constants.h:16
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
CommissioningHistograms::histos
const HistosMap & histos() const
Definition: CommissioningHistograms.h:161
ApvTimingSummaryFactory
Definition: ApvTimingSummaryFactory.h:6
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
conversion_template_cfg.anal
anal
Definition: conversion_template_cfg.py:16
cuy.ii
ii
Definition: cuy.py:590
begin
#define begin
Definition: vmac.h:32