CMS 3D CMS Logo

SiStripCommissioningOfflineDbClient.cc
Go to the documentation of this file.
1 
22 
23 using namespace sistrip;
24 
25 // -----------------------------------------------------------------------------
26 //
29  uploadAnal_(pset.getUntrackedParameter<bool>("UploadAnalyses", false)),
30  uploadConf_(pset.getUntrackedParameter<bool>("UploadHwConfig", false)) {
31  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
32  << " Constructing object...";
33  if (!uploadConf_) {
34  edm::LogWarning(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
35  << " ===> TEST only! No hardware configurations"
36  << " will be uploaded to the DB...";
37  }
38  if (!uploadAnal_) {
39  edm::LogWarning(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
40  << " ===> TEST only! No analysis descriptions"
41  << " will be uploaded to the DB...";
42  }
43 }
44 
45 // -----------------------------------------------------------------------------
46 //
48  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
49  << " Destructing object...";
50 }
51 
52 // -----------------------------------------------------------------------------
53 //
55  // Check pointer
56  if (histos_) {
57  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
58  << " CommissioningHistogram object already exists!"
59  << " Aborting...";
60  return;
61  }
62 
63  // Check pointer to BEI
64  // is this needed here? bei_ = edm::Service<DQMStore>().operator->();
65  if (!bei_) {
66  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
67  << " NULL pointer to DQMStore!";
68  return;
69  }
70 
71  // Create DB connection
72  SiStripConfigDb* db = edm::Service<SiStripConfigDb>().operator->(); //@@ NOT GUARANTEED TO BE THREAD SAFE!
73  LogTrace(mlCabling_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
74  << " Nota bene: using the SiStripConfigDb API"
75  << " as a \"service\" does not presently guarantee"
76  << " thread-safe behaviour!...";
77 
78  // Check DB connection
79  if (!db) {
80  edm::LogError(mlCabling_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
81  << " NULL pointer to SiStripConfigDb!"
82  << " Aborting...";
83  return;
84  }
85 
86  // Create corresponding "commissioning histograms" object
89  } else if (runType_ == sistrip::APV_TIMING) {
91  } else if (runType_ == sistrip::OPTO_SCAN) {
93  } else if (runType_ == sistrip::VPSP_SCAN) {
95  } else if (runType_ == sistrip::PEDESTALS) {
97  } else if (runType_ == sistrip::PEDS_ONLY) {
99  } else if (runType_ == sistrip::PEDS_FULL_NOISE) {
101  } else if (runType_ == sistrip::NOISE) {
103  } else if (runType_ == sistrip::APV_LATENCY) {
105  } else if (runType_ == sistrip::FINE_DELAY) {
110  } else if (runType_ == sistrip::DAQ_SCOPE_MODE) {
112  } else if (runType_ == sistrip::UNDEFINED_RUN_TYPE) {
113  histos_ = nullptr;
114  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
115  << " Undefined run type!";
116  return;
117  } else if (runType_ == sistrip::UNKNOWN_RUN_TYPE) {
118  histos_ = nullptr;
119  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
120  << " Unknown run type!";
121  return;
122  }
124 
125  CommissioningHistosUsingDb* tmp = dynamic_cast<CommissioningHistosUsingDb*>(histos_);
126  if (tmp) {
127  tmp->doUploadConf(uploadConf_);
128  tmp->doUploadAnal(uploadAnal_);
129  std::stringstream ss;
130  ss << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]" << std::endl
131  << " Uploading hardware configurations? : " << (tmp->doUploadConf() ? "true" : "false") << std::endl
132  << " Uploading calibrations from analysis? : " << (tmp->doUploadAnal() ? "true" : "false") << std::endl;
133  edm::LogVerbatim(mlDqmClient_) << ss.str();
134  } else {
135  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
136  << " NULL pointer to CommissioningHistosUsingDb!";
137  }
138 }
139 
140 // -----------------------------------------------------------------------------
141 //
143  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
144  << " Uploading parameters to database...";
145  CommissioningHistosUsingDb* tmp = dynamic_cast<CommissioningHistosUsingDb*>(histos_);
146  if (tmp) {
147  tmp->uploadToConfigDb();
148  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
149  << " Uploaded parameters to database!";
150  } else {
151  edm::LogError(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
152  << " NULL pointer to CommissioningHistosUsingDb object!"
153  << " Upload aborted!...";
154  }
155 }
sistrip::CALIBRATION_SCAN
Definition: ConstantsForRunType.h:87
SiStripCommissioningOfflineDbClient::createHistos
void createHistos(const edm::ParameterSet &, const edm::EventSetup &) override
Definition: SiStripCommissioningOfflineDbClient.cc:54
DaqScopeModeHistosUsingDb
Definition: DaqScopeModeHistosUsingDb.h:7
CalibrationHistosUsingDb.h
sistrip::DAQ_SCOPE_MODE
Definition: ConstantsForRunType.h:83
electrons_cff.bool
bool
Definition: electrons_cff.py:372
sistrip::CALIBRATION
Definition: ConstantsForRunType.h:73
MessageLogger.h
sistrip::PEDS_FULL_NOISE
Definition: ConstantsForRunType.h:92
sistrip::VPSP_SCAN
Definition: ConstantsForRunType.h:82
sistrip::FAST_CABLING
Definition: ConstantsForRunType.h:89
funct::false
false
Definition: Factorize.h:34
SiStripCommissioningOfflineClient
Class which reads a root file containing "commissioning histograms", analyzes the histograms to extra...
Definition: SiStripCommissioningOfflineClient.h:29
PedestalsHistosUsingDb.h
sistrip::APV_TIMING
Definition: ConstantsForRunType.h:75
SiStripCommissioningOfflineDbClient.h
SiStripCommissioningOfflineClient::runType_
sistrip::RunType runType_
Definition: SiStripCommissioningOfflineClient.h:78
DaqScopeModeHistosUsingDb.h
FastFedCablingHistosUsingDb
Definition: FastFedCablingHistosUsingDb.h:8
VpspScanHistosUsingDb
Definition: VpspScanHistosUsingDb.h:8
CalibrationHistosUsingDb
Definition: CalibrationHistosUsingDb.h:13
sistrip::OPTO_SCAN
Definition: ConstantsForRunType.h:74
LatencyHistosUsingDb.h
OptoScanHistosUsingDb.h
DQMStore.h
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
CommissioningHistosUsingDb
Definition: CommissioningHistosUsingDb.h:16
sistrip::mlDqmClient_
static const char mlDqmClient_[]
Definition: ConstantsForLogger.h:19
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
SiStripCommissioningOfflineClient::histos_
CommissioningHistograms * histos_
Definition: SiStripCommissioningOfflineClient.h:51
SiStripCommissioningOfflineDbClient::~SiStripCommissioningOfflineDbClient
~SiStripCommissioningOfflineDbClient() override
Definition: SiStripCommissioningOfflineDbClient.cc:47
SiStripCommissioningOfflineDbClient::uploadConf_
bool uploadConf_
Definition: SiStripCommissioningOfflineDbClient.h:33
FineDelayHistosUsingDb.h
sistrip::FINE_DELAY
Definition: ConstantsForRunType.h:85
dqmiodatasetharvest.db
db
Definition: dqmiodatasetharvest.py:119
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
VpspScanHistosUsingDb.h
Service.h
SiStripConfigDb
An interface class to the DeviceFactory.
Definition: SiStripConfigDb.h:47
NoiseHistosUsingDb.h
SiStripFecKey.h
PedsOnlyHistosUsingDb.h
CommissioningHistograms::configure
virtual void configure(const edm::ParameterSet &, const edm::EventSetup &)
Definition: CommissioningHistograms.h:37
edm::LogWarning
Definition: MessageLogger.h:141
sistrip::mlCabling_
static const char mlCabling_[]
Definition: ConstantsForLogger.h:14
edm::ParameterSet
Definition: ParameterSet.h:36
sistrip::CALIBRATION_DECO
Definition: ConstantsForRunType.h:93
edm::LogError
Definition: MessageLogger.h:183
sistrip::PEDESTALS
Definition: ConstantsForRunType.h:72
sistrip::UNKNOWN_RUN_TYPE
Definition: ConstantsForRunType.h:94
PedsOnlyHistosUsingDb
Definition: PedsOnlyHistosUsingDb.h:8
edm::Service< SiStripConfigDb >
ApvTimingHistosUsingDb.h
edm::LogVerbatim
Definition: MessageLogger.h:297
sistrip::PEDS_ONLY
Definition: ConstantsForRunType.h:90
SiStripCommissioningOfflineDbClient::uploadToConfigDb
void uploadToConfigDb() override
Definition: SiStripCommissioningOfflineDbClient.cc:142
edm::EventSetup
Definition: EventSetup.h:57
SiStripCommissioningOfflineDbClient::SiStripCommissioningOfflineDbClient
SiStripCommissioningOfflineDbClient(const edm::ParameterSet &)
Definition: SiStripCommissioningOfflineDbClient.cc:27
SiStripConfigDb.h
sistrip::CALIBRATION_SCAN_DECO
Definition: ConstantsForRunType.h:88
sistrip::APV_LATENCY
Definition: ConstantsForRunType.h:76
SiStripEnumsAndStrings.h
sistrip::UNDEFINED_RUN_TYPE
Definition: ConstantsForRunType.h:95
SiStripHistoTitle.h
LatencyHistosUsingDb
Definition: LatencyHistosUsingDb.h:11
sistrip::NOISE
Definition: ConstantsForRunType.h:91
PedsFullNoiseHistosUsingDb
Definition: PedsFullNoiseHistosUsingDb.h:8
PedestalsHistosUsingDb
Definition: PedestalsHistosUsingDb.h:8
PedsFullNoiseHistosUsingDb.h
OptoScanHistosUsingDb
Definition: OptoScanHistosUsingDb.h:8
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
NoiseHistosUsingDb
Definition: NoiseHistosUsingDb.h:8
sistrip
sistrip classes
Definition: SiStripQualityHelpers.h:14
FastFedCablingHistosUsingDb.h
SiStripCommissioningOfflineClient::bei_
DQMStore * bei_
Definition: SiStripCommissioningOfflineClient.h:48
ApvTimingHistosUsingDb
Definition: ApvTimingHistosUsingDb.h:8
FineDelayHistosUsingDb
Definition: FineDelayHistosUsingDb.h:13
SiStripCommissioningOfflineDbClient::uploadAnal_
bool uploadAnal_
Definition: SiStripCommissioningOfflineDbClient.h:31
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27