CMS 3D CMS Logo

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

Class which reads a root file containing "commissioning histograms", analyzes the histograms to extract "monitorables", creates summary histograms, and uploads to DB. More...

#include <SiStripCommissioningOfflineDbClient.h>

Inheritance diagram for SiStripCommissioningOfflineDbClient:
SiStripCommissioningOfflineClient edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 SiStripCommissioningOfflineDbClient (const edm::ParameterSet &)
 
virtual ~SiStripCommissioningOfflineDbClient ()
 
- Public Member Functions inherited from SiStripCommissioningOfflineClient
virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
 SiStripCommissioningOfflineClient (const edm::ParameterSet &)
 
virtual ~SiStripCommissioningOfflineClient ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void createHistos (const edm::ParameterSet &, const edm::EventSetup &)
 
void uploadToConfigDb ()
 
- Protected Member Functions inherited from SiStripCommissioningOfflineClient
virtual void setInputFiles (std::vector< std::string > &, const std::string, uint32_t, bool)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Attributes

bool uploadAnal_
 
bool uploadConf_
 
bool uploadToDb_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from SiStripCommissioningOfflineClient
typedef std::vector< TH1 * > Histos
 
typedef std::map< uint32_t,
Histos
HistosMap
 
- Protected Attributes inherited from SiStripCommissioningOfflineClient
bool analyzeHistos_
 
DQMStorebei_
 
bool clientHistos_
 
bool collateHistos_
 
bool createSummaryPlots_
 
CommissioningHistogramshistos_
 
std::vector< std::string > inputFiles_
 
HistosMap map_
 
std::string outputFileName_
 
edm::ParameterSet parameters_
 
std::vector< SummaryPlotplots_
 
uint32_t runNumber_
 
sistrip::RunType runType_
 
bool uploadToDb_
 
std::string xmlFile_
 

Detailed Description

Class which reads a root file containing "commissioning histograms", analyzes the histograms to extract "monitorables", creates summary histograms, and uploads to DB.

Author
R.Bainbridge, M.Wingham

Definition at line 18 of file SiStripCommissioningOfflineDbClient.h.

Constructor & Destructor Documentation

SiStripCommissioningOfflineDbClient::SiStripCommissioningOfflineDbClient ( const edm::ParameterSet pset)

Definition at line 27 of file SiStripCommissioningOfflineDbClient.cc.

References LogTrace, sistrip::mlDqmClient_, uploadAnal_, and uploadConf_.

29  uploadAnal_( pset.getUntrackedParameter<bool>("UploadAnalyses",false) ),
30  uploadConf_( pset.getUntrackedParameter<bool>("UploadHwConfig",false) )
31 {
33  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
34  << " Constructing object...";
35  if ( !uploadConf_ ) {
37  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
38  << " ===> TEST only! No hardware configurations"
39  << " will be uploaded to the DB...";
40  }
41  if ( !uploadAnal_ ) {
43  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
44  << " ===> TEST only! No analysis descriptions"
45  << " will be uploaded to the DB...";
46  }
47 
48 }
T getUntrackedParameter(std::string const &, T const &) const
static const char mlDqmClient_[]
SiStripCommissioningOfflineClient(const edm::ParameterSet &)
#define LogTrace(id)
SiStripCommissioningOfflineDbClient::~SiStripCommissioningOfflineDbClient ( )
virtual

Definition at line 52 of file SiStripCommissioningOfflineDbClient.cc.

References LogTrace, and sistrip::mlDqmClient_.

52  {
54  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
55  << " Destructing object...";
56 }
static const char mlDqmClient_[]
#define LogTrace(id)

Member Function Documentation

void SiStripCommissioningOfflineDbClient::createHistos ( const edm::ParameterSet pset,
const edm::EventSetup setup 
)
protectedvirtual

Reimplemented from SiStripCommissioningOfflineClient.

Definition at line 60 of file SiStripCommissioningOfflineDbClient.cc.

References sistrip::APV_LATENCY, sistrip::APV_TIMING, SiStripCommissioningOfflineClient::bei_, sistrip::CALIBRATION, sistrip::CALIBRATION_DECO, sistrip::CALIBRATION_SCAN, sistrip::CALIBRATION_SCAN_DECO, CommissioningHistograms::configure(), EcalCondDB::db, CommissioningHistosUsingDb::doUploadAnal(), CommissioningHistosUsingDb::doUploadConf(), sistrip::FAST_CABLING, sistrip::FINE_DELAY, SiStripCommissioningOfflineClient::histos_, LogTrace, sistrip::mlCabling_, sistrip::mlDqmClient_, sistrip::NOISE, cppFunctionSkipper::operator, sistrip::OPTO_SCAN, sistrip::PEDESTALS, sistrip::PEDS_FULL_NOISE, sistrip::PEDS_ONLY, SiStripCommissioningOfflineClient::runType_, tmp, sistrip::UNDEFINED_RUN_TYPE, sistrip::UNKNOWN_RUN_TYPE, uploadAnal_, uploadConf_, and sistrip::VPSP_SCAN.

60  {
61 
62  // Check pointer
63  if ( histos_ ) {
65  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
66  << " CommissioningHistogram object already exists!"
67  << " Aborting...";
68  return;
69  }
70 
71  // Check pointer to BEI
72  // is this needed here? bei_ = edm::Service<DQMStore>().operator->();
73  if ( !bei_ ) {
75  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
76  << " NULL pointer to DQMStore!";
77  return;
78  }
79 
80  // Create DB connection
81  SiStripConfigDb* db = edm::Service<SiStripConfigDb>().operator->(); //@@ NOT GUARANTEED TO BE THREAD SAFE!
83  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
84  << " Nota bene: using the SiStripConfigDb API"
85  << " as a \"service\" does not presently guarantee"
86  << " thread-safe behaviour!...";
87 
88  // Check DB connection
89  if ( !db ) {
91  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
92  << " NULL pointer to SiStripConfigDb!"
93  << " Aborting...";
94  return;
95  }
96 
97  // Create corresponding "commissioning histograms" object
99  else if ( runType_ == sistrip::APV_TIMING ) { histos_ = new ApvTimingHistosUsingDb( pset, bei_, db ); }
100  else if ( runType_ == sistrip::OPTO_SCAN ) { histos_ = new OptoScanHistosUsingDb( pset, bei_, db ); }
101  else if ( runType_ == sistrip::VPSP_SCAN ) { histos_ = new VpspScanHistosUsingDb( pset, bei_, db ); }
102  else if ( runType_ == sistrip::PEDESTALS ) { histos_ = new PedestalsHistosUsingDb( pset, bei_, db ); }
103  else if ( runType_ == sistrip::PEDS_ONLY ) { histos_ = new PedsOnlyHistosUsingDb( pset, bei_, db ); }
104  else if ( runType_ == sistrip::PEDS_FULL_NOISE ) { histos_ = new PedsFullNoiseHistosUsingDb( pset, bei_, db ); }
105  else if ( runType_ == sistrip::NOISE ) { histos_ = new NoiseHistosUsingDb( pset, bei_, db ); }
106  else if ( runType_ == sistrip::APV_LATENCY ) { histos_ = new LatencyHistosUsingDb( pset, bei_, db ); }
107  else if ( runType_ == sistrip::FINE_DELAY ) { histos_ = new FineDelayHistosUsingDb( pset, bei_, db ); }
108  else if ( runType_ == sistrip::CALIBRATION ||
112  { histos_ = new CalibrationHistosUsingDb( pset, bei_, db, runType_ ); }
113  else if ( runType_ == sistrip::UNDEFINED_RUN_TYPE ) {
114  histos_ = 0;
116  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
117  << " Undefined run type!";
118  return;
119  } else if ( runType_ == sistrip::UNKNOWN_RUN_TYPE ) {
120  histos_ = 0;
122  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
123  << " Unknown run type!";
124  return;
125  }
126  histos_->configure(pset,setup);
127 
129  if ( tmp ) {
130  tmp->doUploadConf( uploadConf_ );
131  tmp->doUploadAnal( uploadAnal_ );
132  std::stringstream ss;
133  ss << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
134  << std::endl
135  << " Uploading hardware configurations? : "
136  << ( tmp->doUploadConf() ? "true" : "false" )
137  << std::endl
138  << " Uploading calibrations from analysis? : "
139  << ( tmp->doUploadAnal() ? "true" : "false" )
140  << std::endl;
141  edm::LogVerbatim(mlDqmClient_) << ss.str();
142  } else {
144  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
145  << " NULL pointer to CommissioningHistosUsingDb!";
146  }
147 
148 }
tuple db
Definition: EcalCondDB.py:151
static const char mlDqmClient_[]
virtual void configure(const edm::ParameterSet &, const edm::EventSetup &)
static const char mlCabling_[]
An interface class to the DeviceFactory.
#define LogTrace(id)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void SiStripCommissioningOfflineDbClient::uploadToConfigDb ( )
protectedvirtual

Reimplemented from SiStripCommissioningOfflineClient.

Definition at line 152 of file SiStripCommissioningOfflineDbClient.cc.

References SiStripCommissioningOfflineClient::histos_, sistrip::mlDqmClient_, tmp, and CommissioningHistosUsingDb::uploadToConfigDb().

152  {
154  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
155  << " Uploading parameters to database...";
157  if ( tmp ) {
158  tmp->uploadToConfigDb();
160  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
161  << " Uploaded parameters to database!";
162  } else {
164  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
165  << " NULL pointer to CommissioningHistosUsingDb object!"
166  << " Upload aborted!...";
167  }
168 }
static const char mlDqmClient_[]
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100

Member Data Documentation

bool SiStripCommissioningOfflineDbClient::uploadAnal_
private
bool SiStripCommissioningOfflineDbClient::uploadConf_
private
bool SiStripCommissioningOfflineDbClient::uploadToDb_
private

Definition at line 34 of file SiStripCommissioningOfflineDbClient.h.