CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
FastFedCablingHistograms Class Reference

#include <FastFedCablingHistograms.h>

Inheritance diagram for FastFedCablingHistograms:
CommissioningHistograms FastFedCablingHistosUsingDb

Public Member Functions

 FastFedCablingHistograms (const edm::ParameterSet &pset, DQMStore *)
 
void histoAnalysis (bool debug)
 
void printAnalyses ()
 
void printSummary ()
 
virtual ~FastFedCablingHistograms ()
 
- 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 > &)
 
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 > &)
 
void remove (std::string pattern="")
 
void save (std::string &filename, uint32_t run_number=0)
 
virtual ~CommissioningHistograms ()
 

Additional Inherited Members

- 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,
Histos
HistosMap
 
- Static Public Member Functions inherited from CommissioningHistograms
static void copyCustomInformation (DQMStore *const, const std::vector< std::string > &)
 
static void getContents (DQMStore *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 ()
 
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::auto_ptr< Factoryfactory_
 

Detailed Description

Definition at line 8 of file FastFedCablingHistograms.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file FastFedCablingHistograms.cc.

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

20  : CommissioningHistograms( pset.getParameter<edm::ParameterSet>("FastFedCablingParameters"),
21  bei,
23 {
24  factory_ = auto_ptr<FastFedCablingSummaryFactory>( new FastFedCablingSummaryFactory );
26  << "[FastFedCablingHistograms::" << __func__ << "]"
27  << " Constructing object...";
28 }
T getParameter(std::string const &) const
static const char mlDqmClient_[]
#define LogTrace(id)
std::auto_ptr< Factory > factory_
FastFedCablingHistograms::~FastFedCablingHistograms ( )
virtual

Definition at line 32 of file FastFedCablingHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

void FastFedCablingHistograms::histoAnalysis ( bool  debug)
virtual

Reimplemented from CommissioningHistograms.

Definition at line 40 of file FastFedCablingHistograms.cc.

References CommissioningAlgorithm::analysis(), begin, prof2calltree::count, CommissioningHistograms::data(), relativeConstraints::empty, end, benchmark_cfg::errors, extract(), CommissioningAnalysis::fecKey(), CommissioningAnalysis::getErrorCodes(), CommissioningHistograms::histos(), FastFedCablingAnalysis::isValid(), LogTrace, CommissioningHistograms::mapping(), sistrip::mlDqmClient_, CommissioningHistograms::pset(), and TrackValidation_HighPurity_cff::valid.

40  {
42  << "[FastFedCablingHistograms::" << __func__ << "]";
43 
44  // Some initialisation
45  uint16_t valid = 0;
46  HistosMap::const_iterator iter;
47  Analyses::iterator ianal;
48  std::map<std::string,uint16_t> errors;
49 
50  // Clear map holding analysis objects
51  for ( ianal = data().begin(); ianal != data().end(); ianal++ ) {
52  if ( ianal->second ) { delete ianal->second; }
53  }
54  data().clear();
55 
56  // Iterate through map containing histograms
57  for ( iter = histos().begin();
58  iter != histos().end(); iter++ ) {
59 
60  // Check vector of histos is not empty
61  if ( iter->second.empty() ) {
63  << "[FastFedCablingHistograms::" << __func__ << "]"
64  << " Zero histograms found!";
65  continue;
66  }
67 
68  // Retrieve pointers to histos
69  std::vector<TH1*> profs;
70  Histos::const_iterator ihis = iter->second.begin();
71  for ( ; ihis != iter->second.end(); ihis++ ) {
72  TProfile* prof = ExtractTObject<TProfile>().extract( (*ihis)->me_ );
73  if ( prof ) { profs.push_back(prof); }
74  }
75 
76  // Perform histo analysis
77  FastFedCablingAnalysis* anal = new FastFedCablingAnalysis( iter->first );
78  FastFedCablingAlgorithm algo( this->pset(), anal );
79  FedToFecMap::const_iterator ifed = mapping().find( iter->first );
80  if ( ifed != mapping().end() ) { anal->fecKey( ifed->second ); }
81  algo.analysis( profs );
82  data()[iter->first] = anal;
83  if ( anal->isValid() ) { valid++; }
84  if ( !anal->getErrorCodes().empty() ) {
85  errors[anal->getErrorCodes()[0]]++;
86  }
87 
88  }
89 
90  if ( !histos().empty() ) {
92  << "[FastFedCablingHistograms::" << __func__ << "]"
93  << " Analyzed histograms for " << histos().size()
94  << " FED channels, of which " << valid
95  << " (" << 100 * valid / histos().size()
96  << "%) are valid.";
97  if ( !errors.empty() ) {
98  uint16_t count = 0;
99  std::stringstream ss;
100  ss << std::endl;
101  std::map<std::string,uint16_t>::const_iterator ii;
102  for ( ii = errors.begin(); ii != errors.end(); ++ii ) {
103  ss << " " << ii->first << ": " << ii->second << std::endl;
104  count += ii->second;
105  }
107  << "[FastFedCablingHistograms::" << __func__ << "]"
108  << " Found " << count << " error strings: "
109  << ss.str();
110  }
111  } else {
113  << "[FastFedCablingHistograms::" << __func__ << "]"
114  << " No histograms to analyze!";
115  }
116 
117 }
const FedToFecMap & mapping() const
const edm::ParameterSet & pset() const
static const char mlDqmClient_[]
Histogram-based analysis for connection loop.
Histogram-based analysis for connection loop.
const uint32_t & fecKey() const
#define end
Definition: vmac.h:38
#define LogTrace(id)
int extract(std::vector< int > *output, const std::string &dati)
#define begin
Definition: vmac.h:31
const VString & getErrorCodes() const
const HistosMap & histos() const
void FastFedCablingHistograms::printAnalyses ( )
virtual

Reimplemented from CommissioningHistograms.

Definition at line 121 of file FastFedCablingHistograms.cc.

References FastFedCablingAnalysis::badTrimDac(), CommissioningHistograms::data(), FastFedCablingAnalysis::isDirty(), FastFedCablingAnalysis::isValid(), LogTrace, sistrip::mlDqmClient_, and FastFedCablingAnalysis::print().

121  {
122  Analyses::iterator ianal = data().begin();
123  Analyses::iterator janal = data().end();
124  for ( ; ianal != janal; ++ianal ) {
125 
126  FastFedCablingAnalysis* anal = dynamic_cast<FastFedCablingAnalysis*>( ianal->second );
127  if ( !anal ) {
129  << "[FastFedCablingHistograms::" << __func__ << "]"
130  << " NULL pointer to analysis object!";
131  continue;
132  }
133 
134  std::stringstream ss;
135  anal->print( ss );
136  if ( anal->isValid() &&
137  !(anal->isDirty()) &&
138  !(anal->badTrimDac()) ) { LogTrace(mlDqmClient_) << ss.str();
139  } else { edm::LogWarning(mlDqmClient_) << ss.str(); }
140 
141  }
142 
143 }
static const char mlDqmClient_[]
Histogram-based analysis for connection loop.
void print(std::stringstream &, uint32_t not_used=0)
#define LogTrace(id)
void FastFedCablingHistograms::printSummary ( )
virtual

Reimplemented from CommissioningHistograms.

Definition at line 147 of file FastFedCablingHistograms.cc.

References cond::ecalcond::bad(), FastFedCablingAnalysis::badTrimDac(), CommissioningHistograms::data(), FastFedCablingAnalysis::isDirty(), FastFedCablingAnalysis::isValid(), LogTrace, sistrip::mlDqmClient_, and FastFedCablingAnalysis::summary().

147  {
148 
149  std::stringstream good;
150  std::stringstream bad;
151 
152  Analyses::iterator ianal = data().begin();
153  Analyses::iterator janal = data().end();
154  for ( ; ianal != janal; ++ianal ) {
155 
156  FastFedCablingAnalysis* anal = dynamic_cast<FastFedCablingAnalysis*>( ianal->second );
157  if ( !anal ) {
159  << "[FastFedCablingHistograms::" << __func__ << "]"
160  << " NULL pointer to analysis object!";
161  continue;
162  }
163 
164  if ( anal->isValid() &&
165  !(anal->isDirty()) &&
166  !(anal->badTrimDac()) ) {
167  anal->summary( good );
168  } else { anal->summary( bad ); }
169 
170  }
171 
172  if ( good.str().empty() ) { good << "None found!"; }
174  << "[FastFedCablingHistograms::" << __func__ << "]"
175  << " Printing summary of good analyses:" << "\n"
176  << good.str();
177 
178  if ( bad.str().empty() ) { return; } //@@ bad << "None found!"; }
180  << "[FastFedCablingHistograms::" << __func__ << "]"
181  << " Printing summary of bad analyses:" << "\n"
182  << bad.str();
183 
184 }
void summary(std::stringstream &) const
static const char mlDqmClient_[]
int bad(Items const &cont)
Histogram-based analysis for connection loop.
#define LogTrace(id)