CMS 3D CMS Logo

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 &)
 
 ~SiStripCommissioningOfflineDbClient () override
 
- Public Member Functions inherited from SiStripCommissioningOfflineClient
void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void endJob () override
 
 SiStripCommissioningOfflineClient (const edm::ParameterSet &)
 
 ~SiStripCommissioningOfflineClient () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void createHistos (const edm::ParameterSet &, const edm::EventSetup &) override
 
void uploadToConfigDb () override
 
- Protected Member Functions inherited from SiStripCommissioningOfflineClient
virtual void setInputFiles (std::vector< std::string > &, const 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ESProduct , Transition Tr = Transition::Event>
auto esConsumes (eventsetup::EventSetupRecordKey const &, ESInputTag const &tag)
 
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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Types inherited from SiStripCommissioningOfflineClient
typedef std::vector< TH1 * > Histos
 
typedef std::map< uint32_t, HistosHistosMap
 
- 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::string partitionName_
 
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 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 ( )
override

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 
)
overrideprotectedvirtual

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(), sistrip::DAQ_SCOPE_MODE, CommissioningHistosUsingDb::doUploadAnal(), CommissioningHistosUsingDb::doUploadConf(), sistrip::FAST_CABLING, sistrip::FINE_DELAY, SiStripCommissioningOfflineClient::histos_, LogTrace, sistrip::mlCabling_, sistrip::mlDqmClient_, sistrip::NOISE, Utilities::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::DAQ_SCOPE_MODE) {histos_ = new DaqScopeModeHistosUsingDb( pset, bei_, db);}
114  else if ( runType_ == sistrip::UNDEFINED_RUN_TYPE ) {
115  histos_ = nullptr;
117  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
118  << " Undefined run type!";
119  return;
120  } else if ( runType_ == sistrip::UNKNOWN_RUN_TYPE ) {
121  histos_ = nullptr;
123  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
124  << " Unknown run type!";
125  return;
126  }
127  histos_->configure(pset,setup);
128 
130  if ( tmp ) {
131  tmp->doUploadConf( uploadConf_ );
132  tmp->doUploadAnal( uploadAnal_ );
133  std::stringstream ss;
134  ss << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
135  << std::endl
136  << " Uploading hardware configurations? : "
137  << ( tmp->doUploadConf() ? "true" : "false" )
138  << std::endl
139  << " Uploading calibrations from analysis? : "
140  << ( tmp->doUploadAnal() ? "true" : "false" )
141  << std::endl;
142  edm::LogVerbatim(mlDqmClient_) << ss.str();
143  } else {
145  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
146  << " NULL pointer to CommissioningHistosUsingDb!";
147  }
148 
149 }
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 ( )
overrideprotectedvirtual

Reimplemented from SiStripCommissioningOfflineClient.

Definition at line 153 of file SiStripCommissioningOfflineDbClient.cc.

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

153  {
155  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
156  << " Uploading parameters to database...";
158  if ( tmp ) {
159  tmp->uploadToConfigDb();
161  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
162  << " Uploaded parameters to database!";
163  } else {
165  << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
166  << " NULL pointer to CommissioningHistosUsingDb object!"
167  << " Upload aborted!...";
168  }
169 }
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.