CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 &)
 
 ~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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Private Attributes

edm::ESGetToken
< TrackerGeometry,
TrackerDigiGeometryRecord
tkGeomToken_
 
edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
tTopoToken_
 
bool uploadAnal_
 
bool uploadConf_
 
bool uploadToDb_
 

Additional Inherited Members

- Public Types inherited from SiStripCommissioningOfflineClient
typedef dqm::harvesting::DQMStore DQMStore
 
typedef
dqm::harvesting::MonitorElement 
MonitorElement
 
- 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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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::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 22 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_, tkGeomToken_, uploadAnal_, and uploadConf_.

29  uploadAnal_(pset.getUntrackedParameter<bool>("UploadAnalyses", false)),
30  uploadConf_(pset.getUntrackedParameter<bool>("UploadHwConfig", false)),
31  tTopoToken_{esConsumes<edm::Transition::BeginRun>()},
32  tkGeomToken_{esConsumes<edm::Transition::BeginRun>()} {
33  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
34  << " Constructing object...";
35  if (!uploadConf_) {
36  edm::LogWarning(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
37  << " ===> TEST only! No hardware configurations"
38  << " will be uploaded to the DB...";
39  }
40  if (!uploadAnal_) {
41  edm::LogWarning(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
42  << " ===> TEST only! No analysis descriptions"
43  << " will be uploaded to the DB...";
44  }
45 }
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
static const char mlDqmClient_[]
#define LogTrace(id)
SiStripCommissioningOfflineClient(const edm::ParameterSet &)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
Log< level::Warning, false > LogWarning
SiStripCommissioningOfflineDbClient::~SiStripCommissioningOfflineDbClient ( )
override

Definition at line 49 of file SiStripCommissioningOfflineDbClient.cc.

References LogTrace, and sistrip::mlDqmClient_.

49  {
50  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
51  << " Destructing object...";
52 }
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 56 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, EcalCondDB::db, 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_, contentValuesCheck::ss, tkGeomToken_, createJobs::tmp, tTopoToken_, sistrip::UNDEFINED_RUN_TYPE, sistrip::UNKNOWN_RUN_TYPE, uploadAnal_, uploadConf_, and sistrip::VPSP_SCAN.

56  {
57  // Check pointer
58  if (histos_) {
59  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
60  << " CommissioningHistogram object already exists!"
61  << " Aborting...";
62  return;
63  }
64 
65  // Check pointer to BEI
66  // is this needed here? bei_ = edm::Service<DQMStore>().operator->();
67  if (!bei_) {
68  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
69  << " NULL pointer to DQMStore!";
70  return;
71  }
72 
73  // Create DB connection
74  SiStripConfigDb* db = edm::Service<SiStripConfigDb>().operator->(); //@@ NOT GUARANTEED TO BE THREAD SAFE!
75  LogTrace(mlCabling_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
76  << " Nota bene: using the SiStripConfigDb API"
77  << " as a \"service\" does not presently guarantee"
78  << " thread-safe behaviour!...";
79 
80  // Check DB connection
81  if (!db) {
82  edm::LogError(mlCabling_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
83  << " NULL pointer to SiStripConfigDb!"
84  << " Aborting...";
85  return;
86  }
87 
88  // Create corresponding "commissioning histograms" object
91  } else if (runType_ == sistrip::APV_TIMING) {
93  } else if (runType_ == sistrip::OPTO_SCAN) {
95  } else if (runType_ == sistrip::VPSP_SCAN) {
97  } else if (runType_ == sistrip::PEDESTALS) {
99  } else if (runType_ == sistrip::PEDS_ONLY) {
101  } else if (runType_ == sistrip::PEDS_FULL_NOISE) {
103  } else if (runType_ == sistrip::NOISE) {
105  } else if (runType_ == sistrip::APV_LATENCY) {
107  } else if (runType_ == sistrip::FINE_DELAY) {
112  } else if (runType_ == sistrip::DAQ_SCOPE_MODE) {
114  } else if (runType_ == sistrip::UNDEFINED_RUN_TYPE) {
115  histos_ = nullptr;
116  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
117  << " Undefined run type!";
118  return;
119  } else if (runType_ == sistrip::UNKNOWN_RUN_TYPE) {
120  histos_ = nullptr;
121  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
122  << " Unknown run type!";
123  return;
124  }
125  histos_->configure(pset, setup);
126 
128  if (tmp) {
131  std::stringstream ss;
132  ss << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]" << std::endl
133  << " Uploading hardware configurations? : " << (tmp->doUploadConf() ? "true" : "false") << std::endl
134  << " Uploading calibrations from analysis? : " << (tmp->doUploadAnal() ? "true" : "false") << std::endl;
135  edm::LogVerbatim(mlDqmClient_) << ss.str();
136  } else {
137  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
138  << " NULL pointer to CommissioningHistosUsingDb!";
139  }
140 }
Log< level::Info, true > LogVerbatim
tuple db
Definition: EcalCondDB.py:153
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
static const char mlDqmClient_[]
Log< level::Error, false > LogError
virtual void configure(const edm::ParameterSet &, const edm::EventSetup &)
#define LogTrace(id)
static const char mlCabling_[]
An interface class to the DeviceFactory.
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
tmp
align.sh
Definition: createJobs.py:716
void SiStripCommissioningOfflineDbClient::uploadToConfigDb ( )
overrideprotectedvirtual

Reimplemented from SiStripCommissioningOfflineClient.

Definition at line 144 of file SiStripCommissioningOfflineDbClient.cc.

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

144  {
145  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
146  << " Uploading parameters to database...";
148  if (tmp) {
149  tmp->uploadToConfigDb();
150  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
151  << " Uploaded parameters to database!";
152  } else {
153  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
154  << " NULL pointer to CommissioningHistosUsingDb object!"
155  << " Upload aborted!...";
156  }
157 }
Log< level::Info, true > LogVerbatim
static const char mlDqmClient_[]
Log< level::Error, false > LogError
tmp
align.sh
Definition: createJobs.py:716

Member Data Documentation

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiStripCommissioningOfflineDbClient::tkGeomToken_
private
edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripCommissioningOfflineDbClient::tTopoToken_
private

Definition at line 40 of file SiStripCommissioningOfflineDbClient.h.

Referenced by createHistos().

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

Definition at line 34 of file SiStripCommissioningOfflineDbClient.h.