CMS 3D CMS Logo

List of all members | Public Member Functions
PedsFullNoiseHistograms Class Reference

#include <PedsFullNoiseHistograms.h>

Inheritance diagram for PedsFullNoiseHistograms:
CommissioningHistograms PedsFullNoiseHistosUsingDb

Public Member Functions

void histoAnalysis (bool debug) override
 
 PedsFullNoiseHistograms (const edm::ParameterSet &pset, DQMStore *)
 
void printAnalyses () override
 
 ~PedsFullNoiseHistograms () 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 > &)
 
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 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 SummaryPlotFactory< CommissioningAnalysis * > Factory
 
typedef std::map< uint32_t, uint32_t > FedToFecMap
 
typedef std::vector< Histo * > Histos
 
typedef std::map< uint32_t, HistosHistosMap
 
- 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 8 of file PedsFullNoiseHistograms.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file PedsFullNoiseHistograms.cc.

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

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

Definition at line 33 of file PedsFullNoiseHistograms.cc.

References LogTrace, and sistrip::mlDqmClient_.

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

Member Function Documentation

void PedsFullNoiseHistograms::histoAnalysis ( bool  debug)
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 41 of file PedsFullNoiseHistograms.cc.

References patPFMETCorrections_cff::algo, CommissioningAlgorithm::analysis(), begin, KineDebug3::count(), CommissioningHistograms::data(), relativeConstraints::empty, benchmark_cfg::errors, extract(), CommissioningAnalysis::getErrorCodes(), CommissioningHistograms::histos(), compare::hists, cuy::ii, PedsFullNoiseAnalysis::isValid(), LogTrace, sistrip::mlDqmClient_, and CommissioningHistograms::pset().

41  {
42 
44  << "[PedsFullNoiseHistograms::" << __func__ << "]";
45 
46  // Some initialisation
47  uint16_t valid = 0;
48  HistosMap::const_iterator iter;
49  Analyses::iterator ianal;
50  std::map<std::string,uint16_t> errors;
51 
52  // Clear map holding analysis objects
53  for ( ianal = data().begin(); ianal != data().end(); ianal++ ) {
54  if ( ianal->second ) { delete ianal->second; }
55  }
56  data().clear();
57 
58  // Iterate through map containing histograms
59  long int ichannel = 0;
60  long int nchannel = histos().size();
61  for ( iter = histos().begin();
62  iter != histos().end(); iter++ ) {
63 
64  // Check vector of histos is not empty
65  if ( iter->second.empty() ) {
67  << "[PedsFullNoiseHistograms::" << __func__ << "]"
68  << " Zero histograms found!";
69  continue;
70  }
71 
72  // Retrieve pointers to peds and noise histos
73  std::vector<TH1*> hists;
74  Histos::const_iterator ihis = iter->second.begin();
75 
76  for ( ; ihis != iter->second.end(); ihis++ ) {
77  // pedestal and noise 1D profiles
78  TProfile* prof = ExtractTObject<TProfile>().extract( (*ihis)->me_ );
79  if ( prof ) { hists.push_back(prof);
80  }
81  // 2D noise histograms
82  TH2S * his2D = ExtractTObject<TH2S>().extract( (*ihis)->me_ );
83  if ( his2D ) {
84  hists.push_back(his2D); }
85  }
86 
87  if(ichannel % 100 == 0)
89  << "[PedsFullNoiseHistograms::" << __func__ << "]"
90  << " Analyzing channel " << ichannel << " out of "<<nchannel;
91  ichannel++;
92 
93  // Perform histo analysis
94  PedsFullNoiseAnalysis * anal = new PedsFullNoiseAnalysis( iter->first );
95  PedsFullNoiseAlgorithm algo( this->pset(), anal );
96  algo.analysis( hists );
97 
98  data()[iter->first] = anal;
99  if (anal->isValid() ) { valid++; }
100  if (!anal->getErrorCodes().empty() ) {
101  errors[anal->getErrorCodes()[0]]++;
102  }
103 
104  }
105 
106  if ( !histos().empty() ) {
108  << "[PedsFullNoiseHistograms::" << __func__ << "]"
109  << " Analyzed histograms for " << histos().size()
110  << " FED channels, of which " << valid
111  << " (" << 100 * valid / histos().size()
112  << "%) are valid.";
113  if ( !errors.empty() ) {
114  uint16_t count = 0;
115  std::stringstream ss;
116  ss << std::endl;
117  std::map<std::string,uint16_t>::const_iterator ii;
118  for ( ii = errors.begin(); ii != errors.end(); ++ii ) {
119  ss << " " << ii->first << ": " << ii->second << std::endl;
120  count += ii->second;
121  }
123  << "[PedsFullNoiseHistograms::" << __func__ << "]"
124  << " Found " << count << " errors ("
125  << 100 * count / histos().size() << "%): "
126  << ss.str();
127  }
128  } else {
130  << "[PedsFullNoiseHistograms::" << __func__ << "]"
131  << " No histograms to analyze!";
132  }
133 
134 }
Analyses & data(bool getMaskedData=false)
const edm::ParameterSet & pset() const
static const char mlDqmClient_[]
Histogram-based analysis for pedestal run.
Histogram-based analysis for pedestal run.
#define LogTrace(id)
ii
Definition: cuy.py:590
int extract(std::vector< int > *output, const std::string &dati)
#define begin
Definition: vmac.h:32
const VString & getErrorCodes() const
bool isValid() const override
const HistosMap & histos() const
void PedsFullNoiseHistograms::printAnalyses ( )
overridevirtual

Reimplemented from CommissioningHistograms.

Definition at line 138 of file PedsFullNoiseHistograms.cc.

References CommissioningHistograms::data(), LogTrace, and sistrip::mlDqmClient_.

138  {
139  Analyses::iterator ianal = data().begin();
140  Analyses::iterator janal = data().end();
141  for ( ; ianal != janal; ++ianal ) {
142  if ( ianal->second ) {
143  std::stringstream ss;
144  ianal->second->print( ss, 1 );
145  ianal->second->print( ss, 2 );
146  if ( ianal->second->isValid() ) { LogTrace(mlDqmClient_) << ss.str();
147  } else { edm::LogWarning(mlDqmClient_) << ss.str(); }
148  }
149  }
150 }
Analyses & data(bool getMaskedData=false)
static const char mlDqmClient_[]
#define LogTrace(id)