CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Attributes
FedCablingHistograms Class Reference

#include <FedCablingHistograms.h>

Inheritance diagram for FedCablingHistograms:
CommissioningHistograms

Public Types

typedef std::map< uint32_t, FedCablingAnalysis * > Analyses
 
typedef SummaryPlotFactory< FedCablingAnalysis * > Factory
 
- Public Types inherited from CommissioningHistograms
typedef std::map< uint32_t, CommissioningAnalysis * > Analyses
 
typedef Analyses::iterator Analysis
 
typedef SummaryPlotFactory< CommissioningAnalysis * > Factory
 
typedef std::map< uint32_t, uint32_t > FedToFecMap
 
typedef std::vector< Histo * > Histos
 
typedef std::map< uint32_t, HistosHistosMap
 

Public Member Functions

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

Protected Attributes

Analyses data_
 
std::unique_ptr< Factoryfactory_
 
- Protected Attributes inherited from CommissioningHistograms
std::unique_ptr< Factoryfactory_
 

Additional Inherited Members

- 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
 

Detailed Description

Definition at line 11 of file FedCablingHistograms.h.

Member Typedef Documentation

Definition at line 19 of file FedCablingHistograms.h.

Definition at line 18 of file FedCablingHistograms.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file FedCablingHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

21  : CommissioningHistograms( pset.getParameter<edm::ParameterSet>("FedCablingParameters"),
22  bei,
24  factory_( new Factory )
25 {
27  << "[FedCablingHistograms::" << __func__ << "]"
28  << " Constructing object...";
29 }
T getParameter(std::string const &) const
static const char mlDqmClient_[]
std::unique_ptr< Factory > factory_
SummaryPlotFactory< FedCablingAnalysis * > Factory
#define LogTrace(id)
DQMStore *const bei() const
FedCablingHistograms::~FedCablingHistograms ( )
override

Definition at line 33 of file FedCablingHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

void FedCablingHistograms::createSummaryHisto ( const sistrip::Monitorable histo,
const sistrip::Presentation type,
const std::string &  top_level_dir,
const sistrip::Granularity gran 
)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 116 of file FedCablingHistograms.cc.

References data_, factory_, histoAnalysis(), CommissioningHistograms::histogram(), LogTrace, sistrip::mlDqmClient_, heppy_report::summary, sistrip::UNKNOWN_VIEW, SiStripEnumsAndStrings::view(), and fw3dlego::xbins.

119  {
121  << "[FedCablingHistograms::" << __func__ << "]";
122 
123  // Check view
125  if ( view == sistrip::UNKNOWN_VIEW ) { return; }
126 
127  // Analyze histograms if not done already
128  if ( data_.empty() ) { histoAnalysis( false ); }
129 
130  // Extract data to be histogrammed
131  uint32_t xbins = factory_->init( histo, type, view, dir, gran, data_ );
132 
133  // Create summary histogram (if it doesn't already exist)
134  TH1* summary = histogram( histo, type, view, dir, xbins );
135 
136  // Fill histogram with data
137  factory_->fill( *summary );
138 
139 }
type
Definition: HCALResponse.h:21
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 double xbins[]
static const char mlDqmClient_[]
std::unique_ptr< Factory > factory_
static std::string view(const sistrip::View &)
#define LogTrace(id)
dbl *** dir
Definition: mlp_gen.cc:35
void histoAnalysis(bool debug) override
void FedCablingHistograms::histoAnalysis ( bool  debug)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 41 of file FedCablingHistograms.cc.

References patPFMETCorrections_cff::algo, CommissioningAlgorithm::analysis(), begin, data_, extract(), CommissioningHistograms::histos(), FedCablingAnalysis::isValid(), LogTrace, sistrip::mlDqmClient_, and CommissioningHistograms::pset().

Referenced by createSummaryHisto().

41  {
43  << "[FedCablingHistograms::" << __func__ << "]";
44 
45  uint16_t valid = 0;
46  HistosMap::const_iterator iter;
47  Analyses::iterator ianal;
48 
49  // Clear map holding analysis objects
50  for ( ianal = data_.begin(); ianal != data_.end(); ianal++ ) {
51  if ( ianal->second ) { delete ianal->second; }
52  }
53  data_.clear();
54 
55  // Iterate through map containing histograms
56  for ( iter = histos().begin();
57  iter != histos().end(); iter++ ) {
58 
59  // Check vector of histos is not empty
60  if ( iter->second.empty() ) {
62  << "[FedCablingHistograms::" << __func__ << "]"
63  << " Zero histograms found!";
64  continue;
65  }
66 
67  // Retrieve pointers to histos
68  std::vector<TH1*> profs;
69  Histos::const_iterator ihis = iter->second.begin();
70  for ( ; ihis != iter->second.end(); ihis++ ) {
71  TProfile* prof = ExtractTObject<TProfile>().extract( (*ihis)->me_ );
72  if ( prof ) { profs.push_back(prof); }
73  }
74 
75  // Perform histo analysis
76  FedCablingAnalysis* anal = new FedCablingAnalysis( iter->first );
77  FedCablingAlgorithm algo( this->pset(), anal );
78  algo.analysis( profs );
79  data_[iter->first] = anal;
80  if ( anal->isValid() ) { valid++; }
81 
82  }
83 
84  if ( !histos().empty() ) {
86  << "[FedCablingHistograms::" << __func__ << "]"
87  << " Analyzed histograms for " << histos().size()
88  << " FED channels, of which " << valid
89  << " (" << 100 * valid / histos().size()
90  << "%) are valid.";
91  } else {
93  << "[FedCablingHistograms::" << __func__ << "]"
94  << " No histograms to analyze!";
95  }
96 
97 }
const edm::ParameterSet & pset() const
Histogram-based analysis for connection loop.
static const char mlDqmClient_[]
#define LogTrace(id)
int extract(std::vector< int > *output, const std::string &dati)
#define begin
Definition: vmac.h:32
bool isValid() const override
Histogram-based analysis for connection loop.
const HistosMap & histos() const
void FedCablingHistograms::printAnalyses ( )
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 101 of file FedCablingHistograms.cc.

References data_, LogTrace, and sistrip::mlDqmClient_.

101  {
102  Analyses::iterator ianal = data_.begin();
103  Analyses::iterator janal = data_.end();
104  for ( ; ianal != janal; ++ianal ) {
105  if ( ianal->second ) {
106  std::stringstream ss;
107  ianal->second->print( ss );
108  if ( ianal->second->isValid() ) { LogTrace(mlDqmClient_) << ss.str();
109  } else { edm::LogWarning(mlDqmClient_) << ss.str(); }
110  }
111  }
112 }
static const char mlDqmClient_[]
#define LogTrace(id)

Member Data Documentation

Analyses FedCablingHistograms::data_
protected

Definition at line 35 of file FedCablingHistograms.h.

Referenced by createSummaryHisto(), histoAnalysis(), and printAnalyses().

std::unique_ptr<Factory> FedCablingHistograms::factory_
protected

Definition at line 37 of file FedCablingHistograms.h.

Referenced by createSummaryHisto().