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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) 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::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
 
- 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 17 of file SiStripCommissioningOfflineDbClient.h.

Constructor & Destructor Documentation

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

Definition at line 26 of file SiStripCommissioningOfflineDbClient.cc.

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

28  uploadAnal_( pset.getUntrackedParameter<bool>("UploadAnalyses",false) ),
29  uploadConf_( pset.getUntrackedParameter<bool>("UploadHwConfig",false) )
30 {
32  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
33  << " Constructing object...";
34  if ( !uploadConf_ ) {
36  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
37  << " ===> TEST only! No hardware configurations"
38  << " will be uploaded to the DB...";
39  }
40  if ( !uploadAnal_ ) {
42  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
43  << " ===> TEST only! No analysis descriptions"
44  << " will be uploaded to the DB...";
45  }
46 
47 }
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 51 of file SiStripCommissioningOfflineDbClient.cc.

References LogTrace, and sistrip::mlDqmClient_.

51  {
53  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
54  << " Destructing object...";
55 }
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 59 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_, contentValuesCheck::ss, tmp, sistrip::UNDEFINED_RUN_TYPE, sistrip::UNKNOWN_RUN_TYPE, uploadAnal_, uploadConf_, and sistrip::VPSP_SCAN.

59  {
60 
61  // Check pointer
62  if ( histos_ ) {
64  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
65  << " CommissioningHistogram object already exists!"
66  << " Aborting...";
67  return;
68  }
69 
70  // Check pointer to BEI
71  // is this needed here? bei_ = edm::Service<DQMStore>().operator->();
72  if ( !bei_ ) {
74  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
75  << " NULL pointer to DQMStore!";
76  return;
77  }
78 
79  // Create DB connection
80  SiStripConfigDb* db = edm::Service<SiStripConfigDb>().operator->(); //@@ NOT GUARANTEED TO BE THREAD SAFE!
82  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
83  << " Nota bene: using the SiStripConfigDb API"
84  << " as a \"service\" does not presently guarantee"
85  << " thread-safe behaviour!...";
86 
87  // Check DB connection
88  if ( !db ) {
90  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
91  << " NULL pointer to SiStripConfigDb!"
92  << " Aborting...";
93  return;
94  }
95 
96  // Create corresponding "commissioning histograms" object
98  else if ( runType_ == sistrip::APV_TIMING ) { histos_ = new ApvTimingHistosUsingDb( pset, bei_, db ); }
99  else if ( runType_ == sistrip::OPTO_SCAN ) { histos_ = new OptoScanHistosUsingDb( pset, bei_, db ); }
100  else if ( runType_ == sistrip::VPSP_SCAN ) { histos_ = new VpspScanHistosUsingDb( pset, bei_, db ); }
101  else if ( runType_ == sistrip::PEDESTALS ) { histos_ = new PedestalsHistosUsingDb( pset, bei_, db ); }
102  else if ( runType_ == sistrip::PEDS_ONLY ) { histos_ = new PedsOnlyHistosUsingDb( pset, bei_, db ); }
103  else if ( runType_ == sistrip::PEDS_FULL_NOISE ) { histos_ = new PedsFullNoiseHistosUsingDb( pset, bei_, db ); }
104  else if ( runType_ == sistrip::NOISE ) { histos_ = new NoiseHistosUsingDb( pset, bei_, db ); }
105  else if ( runType_ == sistrip::APV_LATENCY ) { histos_ = new LatencyHistosUsingDb( pset, bei_, db ); }
106  else if ( runType_ == sistrip::FINE_DELAY ) { histos_ = new FineDelayHistosUsingDb( pset, bei_, db ); }
107  else if ( runType_ == sistrip::CALIBRATION ||
111  { histos_ = new CalibrationHistosUsingDb( pset, bei_, db, runType_ ); }
112  else if ( runType_ == sistrip::UNDEFINED_RUN_TYPE ) {
113  histos_ = 0;
115  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
116  << " Undefined run type!";
117  return;
118  } else if ( runType_ == sistrip::UNKNOWN_RUN_TYPE ) {
119  histos_ = 0;
121  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
122  << " Unknown run type!";
123  return;
124  }
125  histos_->configure(pset,setup);
126 
128  if ( tmp ) {
129  tmp->doUploadConf( uploadConf_ );
130  tmp->doUploadAnal( uploadAnal_ );
131  std::stringstream ss;
132  ss << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
133  << std::endl
134  << " Uploading hardware configurations? : "
135  << ( tmp->doUploadConf() ? "true" : "false" )
136  << std::endl
137  << " Uploading calibrations from analysis? : "
138  << ( tmp->doUploadAnal() ? "true" : "false" )
139  << std::endl;
140  edm::LogVerbatim(mlDqmClient_) << ss.str();
141  } else {
143  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
144  << " NULL pointer to CommissioningHistosUsingDb!";
145  }
146 
147 }
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 151 of file SiStripCommissioningOfflineDbClient.cc.

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

151  {
153  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
154  << " Uploading parameters to database...";
156  if ( tmp ) {
157  tmp->uploadToConfigDb();
159  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
160  << " Uploaded parameters to database!";
161  } else {
163  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
164  << " NULL pointer to CommissioningHistosUsingDb object!"
165  << " Upload aborted!...";
166  }
167 }
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 33 of file SiStripCommissioningOfflineDbClient.h.