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  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 }
46 
47 // -----------------------------------------------------------------------------
48 //
50  LogTrace(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
51  << " Destructing object...";
52 }
53 
54 // -----------------------------------------------------------------------------
55 //
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  }
126 
127  CommissioningHistosUsingDb* tmp = dynamic_cast<CommissioningHistosUsingDb*>(histos_);
128  if (tmp) {
129  tmp->doUploadConf(uploadConf_);
130  tmp->doUploadAnal(uploadAnal_);
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 }
141 
142 // -----------------------------------------------------------------------------
143 //
145  edm::LogVerbatim(mlDqmClient_) << "[SiStripCommissioningOfflineDbClient::" << __func__ << "]"
146  << " Uploading parameters to database...";
147  CommissioningHistosUsingDb* tmp = dynamic_cast<CommissioningHistosUsingDb*>(histos_);
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 }
sistrip::CALIBRATION_SCAN
Definition: ConstantsForRunType.h:87
SiStripCommissioningOfflineDbClient::createHistos
void createHistos(const edm::ParameterSet &, const edm::EventSetup &) override
Definition: SiStripCommissioningOfflineDbClient.cc:56
DaqScopeModeHistosUsingDb
Definition: DaqScopeModeHistosUsingDb.h:7
CalibrationHistosUsingDb.h
sistrip::DAQ_SCOPE_MODE
Definition: ConstantsForRunType.h:83
electrons_cff.bool
bool
Definition: electrons_cff.py:366
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:29
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:18
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
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:49
SiStripCommissioningOfflineDbClient::uploadConf_
bool uploadConf_
Definition: SiStripCommissioningOfflineDbClient.h:38
FineDelayHistosUsingDb.h
sistrip::FINE_DELAY
Definition: ConstantsForRunType.h:85
dqmiodatasetharvest.db
db
Definition: dqmiodatasetharvest.py:119
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiStripCommissioningOfflineDbClient::tTopoToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
Definition: SiStripCommissioningOfflineDbClient.h:40
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
sistrip::mlCabling_
static const char mlCabling_[]
Definition: ConstantsForLogger.h:14
edm::ParameterSet
Definition: ParameterSet.h:47
sistrip::CALIBRATION_DECO
Definition: ConstantsForRunType.h:93
sistrip::PEDESTALS
Definition: ConstantsForRunType.h:72
sistrip::UNKNOWN_RUN_TYPE
Definition: ConstantsForRunType.h:94
PedsOnlyHistosUsingDb
Definition: PedsOnlyHistosUsingDb.h:8
edm::Service< SiStripConfigDb >
ApvTimingHistosUsingDb.h
sistrip::PEDS_ONLY
Definition: ConstantsForRunType.h:90
SiStripCommissioningOfflineDbClient::uploadToConfigDb
void uploadToConfigDb() override
Definition: SiStripCommissioningOfflineDbClient.cc:144
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
SiStripCommissioningOfflineDbClient::SiStripCommissioningOfflineDbClient
SiStripCommissioningOfflineDbClient(const edm::ParameterSet &)
Definition: SiStripCommissioningOfflineDbClient.cc:27
SiStripConfigDb.h
sistrip::CALIBRATION_SCAN_DECO
Definition: ConstantsForRunType.h:88
SiStripCommissioningOfflineDbClient::tkGeomToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
Definition: SiStripCommissioningOfflineDbClient.h:41
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
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:234
NoiseHistosUsingDb
Definition: NoiseHistosUsingDb.h:8
sistrip
sistrip classes
Definition: EnsembleCalibrationLA.cc:10
FastFedCablingHistosUsingDb.h
SiStripCommissioningOfflineClient::bei_
DQMStore * bei_
Definition: SiStripCommissioningOfflineClient.h:48
ApvTimingHistosUsingDb
Definition: ApvTimingHistosUsingDb.h:8
FineDelayHistosUsingDb
Definition: FineDelayHistosUsingDb.h:14
SiStripCommissioningOfflineDbClient::uploadAnal_
bool uploadAnal_
Definition: SiStripCommissioningOfflineDbClient.h:36
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27