File indexing completed on 2024-04-06 12:23:18
0001
0002 #include <iostream>
0003 #include <iomanip>
0004 #include <sstream>
0005 #include <string>
0006
0007
0008 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
0009 #include "DataFormats/SiStripCommon/interface/SiStripEnumsAndStrings.h"
0010 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0011 #include "FWCore/Framework/interface/Event.h"
0012 #include "FWCore/Framework/interface/EventSetup.h"
0013 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015 #include "FWCore/ServiceRegistry/interface/Service.h"
0016 #include "OnlineDB/SiStripConfigDb/interface/SiStripConfigDb.h"
0017
0018 class SiStripConfigDb;
0019
0020
0021
0022
0023
0024
0025 class testSiStripConfigDb : public edm::one::EDAnalyzer<> {
0026 public:
0027 testSiStripConfigDb(const edm::ParameterSet&);
0028 ~testSiStripConfigDb();
0029
0030 void analyze(const edm::Event&, const edm::EventSetup&) { ; }
0031 void beginJob();
0032
0033 private:
0034 SiStripConfigDb* db_;
0035
0036 const bool download_;
0037 const bool upload_;
0038 const bool conns_;
0039 const bool devices_;
0040 const bool feds_;
0041 const bool dcus_;
0042 const bool anals_;
0043 };
0044
0045 using namespace std;
0046 using namespace sistrip;
0047
0048
0049
0050 testSiStripConfigDb::testSiStripConfigDb(const edm::ParameterSet& pset)
0051 : db_(nullptr),
0052 download_(pset.getUntrackedParameter<bool>("Download", false)),
0053 upload_(pset.getUntrackedParameter<bool>("Upload", false)),
0054 conns_(pset.getUntrackedParameter<bool>("FedConnections", false)),
0055 devices_(pset.getUntrackedParameter<bool>("DeviceDescriptions", false)),
0056 feds_(pset.getUntrackedParameter<bool>("FedDescriptions", false)),
0057 dcus_(pset.getUntrackedParameter<bool>("DcuDetIds", false)),
0058 anals_(pset.getUntrackedParameter<bool>("AnalysisDescriptions", false)) {
0059 std::stringstream ss;
0060 ss << "[testSiStripConfigDb::" << __func__ << "]"
0061 << " Parameters:" << std::endl
0062 << " Download : " << download_ << std::endl
0063 << " Upload : " << upload_ << std::endl
0064 << " FedConnections : " << conns_ << std::endl
0065 << " DeviceDescriptions : " << devices_ << std::endl
0066 << " FedDescriptions : " << feds_ << std::endl
0067 << " DcuDetIds : " << dcus_ << std::endl
0068 << " AnalysisDescriptions : " << anals_;
0069 LogTrace(mlCabling_) << ss.str();
0070 }
0071
0072
0073
0074 testSiStripConfigDb::~testSiStripConfigDb() {
0075 LogTrace(mlCabling_) << "[testSiStripConfigDb::" << __func__ << "]"
0076 << " Destructing object...";
0077 }
0078
0079
0080
0081 void testSiStripConfigDb::beginJob() {
0082
0083
0084
0085 db_ = edm::Service<SiStripConfigDb>().operator->();
0086
0087
0088 if (db_) {
0089 edm::LogVerbatim(mlCabling_) << "[testSiStripConfigDb::" << __func__ << "]"
0090 << " Pointer to SiStripConfigDb: 0x" << std::setw(8) << std::setfill('0') << std::hex
0091 << db_ << std::dec;
0092 } else {
0093 edm::LogError(mlCabling_) << "[testSiStripConfigDb::" << __func__ << "]"
0094 << " NULL pointer to SiStripConfigDb!"
0095 << " Aborting!";
0096 return;
0097 }
0098
0099
0100 if (db_->deviceFactory() || db_->databaseCache()) {
0101 std::stringstream ss;
0102 ss << "[testSiStripConfigDb::" << __func__ << "]" << std::endl
0103 << " Pointer to DeviceFactory: 0x" << std::setw(8) << std::setfill('0') << std::hex << db_->deviceFactory()
0104 << std::dec << std::endl
0105 << " Pointer to DatabaseCache: 0x" << std::setw(8) << std::setfill('0') << std::hex << db_->databaseCache()
0106 << std::dec << std::endl;
0107 edm::LogVerbatim(mlCabling_) << ss.str();
0108 } else {
0109 edm::LogError(mlCabling_) << "[testSiStripConfigDb::" << __func__ << "]"
0110 << " NULL pointer to DeviceFactory AND DatabaseCache!"
0111 << " Aborting!";
0112 return;
0113 }
0114
0115
0116
0117 if (db_->dbParams().partitionsSize() < 1) {
0118 LogTrace(mlCabling_) << "[testSiStripConfigDb::" << __func__ << "]"
0119 << " Cannot test copy constructors as less than 2 partitions!";
0120 } else {
0121 SiStripDbParams tmp1(db_->dbParams());
0122 SiStripDbParams tmp2;
0123 tmp2 = db_->dbParams();
0124 std::stringstream ss;
0125 ss << "[testSiStripConfigDb::" << __func__ << "]"
0126 << " Test of copy constructors: " << std::endl
0127 << " ===> 'Original' DbParams: " << std::endl
0128 << db_->dbParams() << " ===> 'Copy constructed' DbParams: " << std::endl
0129 << tmp1 << " ===> 'Assignment constructed' DbParams: " << std::endl
0130 << tmp2;
0131
0132 ss << "[testSiStripConfigDb::" << __func__ << "]"
0133 << " Test of equality: " << std::endl;
0134 SiStripDbParams::SiStripPartitions::const_iterator ii = db_->dbParams().partitions().begin();
0135 SiStripDbParams::SiStripPartitions::const_iterator jj = db_->dbParams().partitions().end();
0136 SiStripDbParams::SiStripPartitions::const_iterator iii = db_->dbParams().partitions().begin();
0137 SiStripDbParams::SiStripPartitions::const_iterator jjj = db_->dbParams().partitions().end();
0138 for (; ii != jj; ++ii) {
0139 for (; iii != jjj; ++iii) {
0140 ss << "\"" << ii->second.partitionName() << "\" is equal to \"" << iii->second.partitionName() << "\"? "
0141 << std::boolalpha << (ii->second == iii->second) << std::noboolalpha << std::endl;
0142 ss << "\"" << ii->second.partitionName() << "\" is equal NOT to \"" << iii->second.partitionName() << "\"? "
0143 << std::boolalpha << (ii->second != iii->second) << std::noboolalpha << std::endl;
0144 }
0145 }
0146 LogTrace(mlCabling_) << ss.str();
0147 }
0148
0149
0150
0151
0152 SiStripConfigDb::Runs runs;
0153 db_->runs(runs);
0154
0155
0156 {
0157 std::stringstream ss;
0158 ss << "[testSiStripConfigDb::" << __func__ << "]"
0159 << " Retrieving run numbers by partition and run type:" << std::endl;
0160
0161 SiStripConfigDb::RunsByPartition partitions;
0162 db_->runs(runs, partitions);
0163
0164 if (partitions.empty()) {
0165 ss << " Found no partitions!";
0166 } else {
0167 SiStripConfigDb::RunsByPartition::const_iterator ii = partitions.begin();
0168 SiStripConfigDb::RunsByPartition::const_iterator jj = partitions.end();
0169 for (; ii != jj; ++ii) {
0170 SiStripConfigDb::RunsByType types;
0171 db_->runs(ii->second, types);
0172
0173 if (types.empty()) {
0174 ss << " Found no runs for partition \"" << ii->first << "\"!" << std::endl;
0175 } else {
0176 SiStripConfigDb::RunsByType::const_iterator iii = types.begin();
0177 SiStripConfigDb::RunsByType::const_iterator jjj = types.end();
0178 for (; iii != jjj; ++iii) {
0179 if (iii->second.empty()) {
0180 ss << " Found no runs for partition \"" << ii->first << "\" and run type \"" << iii->first << "\"!"
0181 << std::endl;
0182 } else {
0183 ss << " Found " << iii->second.size() << " runs for partition \"" << ii->first << "\" and run type \""
0184 << SiStripEnumsAndStrings::runType(iii->first) << "\": ";
0185 uint16_t cntr = 0;
0186 SiStripConfigDb::Runs::const_iterator iiii = iii->second.begin();
0187 SiStripConfigDb::Runs::const_iterator jjjj = iii->second.end();
0188 for (; iiii != jjjj; ++iiii) {
0189 if (cntr < 10) {
0190 iiii == iii->second.begin() ? ss << iiii->number_ : ss << ", " << iiii->number_;
0191 }
0192 cntr++;
0193 }
0194 ss << std::endl;
0195 }
0196 }
0197 }
0198 }
0199 }
0200 LogTrace(mlCabling_) << ss.str();
0201 }
0202
0203
0204 std::stringstream ss;
0205 SiStripConfigDb::DeviceDescriptions devices;
0206 SiStripConfigDb::FedDescriptions feds;
0207 SiStripConfigDb::FedConnections conns;
0208 SiStripConfigDb::DcuDetIds dcus;
0209
0210
0211
0212 if (upload_) {
0213
0214
0215 if (conns_) {
0216
0217 db_->clearFedConnections();
0218 SiStripConfigDb::FedConnections connections;
0219 SiStripDbParams::SiStripPartitions::const_iterator ii = db_->dbParams().partitions().begin();
0220 SiStripDbParams::SiStripPartitions::const_iterator jj = db_->dbParams().partitions().end();
0221 for (; ii != jj; ++ii) {
0222 SiStripConfigDb::FedConnectionsRange conns = db_->getFedConnections(ii->second.partitionName());
0223 if (conns != connections.emptyRange()) {
0224 std::vector<SiStripConfigDb::FedConnection*> tmp1(conns.begin(), conns.end());
0225 std::vector<SiStripConfigDb::FedConnection*> tmp2;
0226 ConnectionFactory::vectorCopyI(tmp2, tmp1, true);
0227 connections.loadNext(ii->second.partitionName(), tmp2);
0228 }
0229 }
0230 db_->printFedConnections();
0231 db_->clearFedConnections();
0232
0233
0234 SiStripDbParams::SiStripPartitions::const_iterator iter = db_->dbParams().partitions().begin();
0235 SiStripDbParams::SiStripPartitions::const_iterator jter = db_->dbParams().partitions().end();
0236 for (; iter != jter; ++iter) {
0237 SiStripConfigDb::FedConnectionsRange conns = connections.find(iter->second.partitionName());
0238 std::vector<SiStripConfigDb::FedConnection*> temp(conns.begin(), conns.end());
0239 db_->addFedConnections(iter->second.partitionName(), temp);
0240 db_->printFedConnections(iter->second.partitionName());
0241 db_->uploadFedConnections(iter->second.partitionName());
0242 }
0243
0244
0245 db_->printFedConnections();
0246 db_->uploadFedConnections();
0247 db_->clearFedConnections();
0248 db_->printFedConnections();
0249 }
0250
0251
0252
0253 if (devices_) {
0254
0255 db_->clearDeviceDescriptions();
0256 SiStripConfigDb::DeviceDescriptions devices;
0257 SiStripDbParams::SiStripPartitions::const_iterator ii = db_->dbParams().partitions().begin();
0258 SiStripDbParams::SiStripPartitions::const_iterator jj = db_->dbParams().partitions().end();
0259 for (; ii != jj; ++ii) {
0260 SiStripConfigDb::DeviceDescriptionsRange devs = db_->getDeviceDescriptions(ii->second.partitionName());
0261 if (devs != devices.emptyRange()) {
0262 std::vector<SiStripConfigDb::DeviceDescription*> tmp1(devs.begin(), devs.end());
0263 std::vector<SiStripConfigDb::DeviceDescription*> tmp2;
0264 FecFactory::vectorCopyI(tmp2, tmp1, true);
0265 devices.loadNext(ii->second.partitionName(), tmp2);
0266 }
0267 }
0268 db_->printDeviceDescriptions();
0269 db_->clearDeviceDescriptions();
0270
0271
0272 SiStripDbParams::SiStripPartitions::const_iterator iter = db_->dbParams().partitions().begin();
0273 SiStripDbParams::SiStripPartitions::const_iterator jter = db_->dbParams().partitions().end();
0274 for (; iter != jter; ++iter) {
0275 SiStripConfigDb::DeviceDescriptionsRange devs = devices.find(iter->second.partitionName());
0276 std::vector<SiStripConfigDb::DeviceDescription*> temp(devs.begin(), devs.end());
0277 db_->addDeviceDescriptions(iter->second.partitionName(), temp);
0278 db_->printDeviceDescriptions(iter->second.partitionName());
0279 db_->uploadDeviceDescriptions(iter->second.partitionName());
0280 }
0281
0282
0283 db_->printDeviceDescriptions();
0284 db_->uploadDeviceDescriptions();
0285 db_->clearDeviceDescriptions();
0286 db_->printDeviceDescriptions();
0287 }
0288
0289
0290
0291 if (feds_) {
0292
0293 db_->clearFedDescriptions();
0294 SiStripConfigDb::FedDescriptions feds;
0295 SiStripDbParams::SiStripPartitions::const_iterator ii = db_->dbParams().partitions().begin();
0296 SiStripDbParams::SiStripPartitions::const_iterator jj = db_->dbParams().partitions().end();
0297 for (; ii != jj; ++ii) {
0298 SiStripConfigDb::FedDescriptionsRange range = db_->getFedDescriptions(ii->second.partitionName());
0299 if (range != feds.emptyRange()) {
0300 std::vector<SiStripConfigDb::FedDescription*> tmp1(range.begin(), range.end());
0301 std::vector<SiStripConfigDb::FedDescription*> tmp2;
0302 Fed9U::Fed9UDeviceFactory::vectorCopy(tmp2, tmp1);
0303 feds.loadNext(ii->second.partitionName(), tmp2);
0304 }
0305 }
0306 db_->printFedDescriptions();
0307 db_->clearFedDescriptions();
0308
0309
0310 SiStripDbParams::SiStripPartitions::const_iterator iter = db_->dbParams().partitions().begin();
0311 SiStripDbParams::SiStripPartitions::const_iterator jter = db_->dbParams().partitions().end();
0312 for (; iter != jter; ++iter) {
0313 SiStripConfigDb::FedDescriptionsRange range = feds.find(iter->second.partitionName());
0314 std::vector<SiStripConfigDb::FedDescription*> temp(range.begin(), range.end());
0315 db_->addFedDescriptions(iter->second.partitionName(), temp);
0316 db_->printFedDescriptions(iter->second.partitionName());
0317 db_->uploadFedDescriptions(iter->second.partitionName());
0318 }
0319
0320
0321 db_->printFedDescriptions();
0322 db_->uploadFedDescriptions();
0323 db_->clearFedDescriptions();
0324 db_->printFedDescriptions();
0325 }
0326
0327
0328
0329 if (dcus_) {
0330
0331 db_->clearDcuDetIds();
0332 SiStripConfigDb::DcuDetIds feds;
0333 SiStripDbParams::SiStripPartitions::const_iterator ii = db_->dbParams().partitions().begin();
0334 SiStripDbParams::SiStripPartitions::const_iterator jj = db_->dbParams().partitions().end();
0335 for (; ii != jj; ++ii) {
0336 SiStripConfigDb::DcuDetIdsRange range = db_->getDcuDetIds(ii->second.partitionName());
0337 if (range != feds.emptyRange()) {
0338 std::vector<SiStripConfigDb::DcuDetId> tmp1(range.begin(), range.end());
0339 std::vector<SiStripConfigDb::DcuDetId> tmp2;
0340 db_->clone(tmp1, tmp2);
0341 feds.loadNext(ii->second.partitionName(), tmp2);
0342 }
0343 }
0344 db_->printDcuDetIds();
0345 db_->clearDcuDetIds();
0346
0347
0348 SiStripDbParams::SiStripPartitions::const_iterator iter = db_->dbParams().partitions().begin();
0349 SiStripDbParams::SiStripPartitions::const_iterator jter = db_->dbParams().partitions().end();
0350 for (; iter != jter; ++iter) {
0351 SiStripConfigDb::DcuDetIdsRange range = feds.find(iter->second.partitionName());
0352 std::vector<SiStripConfigDb::DcuDetId> temp(range.begin(), range.end());
0353 db_->addDcuDetIds(iter->second.partitionName(), temp);
0354 db_->printDcuDetIds(iter->second.partitionName());
0355 db_->uploadDcuDetIds(iter->second.partitionName());
0356 }
0357
0358
0359 db_->printDcuDetIds();
0360 db_->uploadDcuDetIds();
0361 db_->clearDcuDetIds();
0362 db_->printDcuDetIds();
0363 }
0364
0365
0366
0367 if (anals_) {
0368
0369 db_->clearAnalysisDescriptions();
0370 SiStripConfigDb::AnalysisDescriptions anals;
0371 SiStripDbParams::SiStripPartitions::const_iterator ii = db_->dbParams().partitions().begin();
0372 SiStripDbParams::SiStripPartitions::const_iterator jj = db_->dbParams().partitions().end();
0373 for (; ii != jj; ++ii) {
0374 SiStripConfigDb::AnalysisType type = SiStripConfigDb::AnalysisDescription::T_ANALYSIS_PEDESTALS;
0375 SiStripConfigDb::AnalysisDescriptionsRange range =
0376 db_->getAnalysisDescriptions(type, ii->second.partitionName());
0377 if (range != anals.emptyRange()) {
0378 SiStripConfigDb::AnalysisDescriptionsV tmp1(range.begin(), range.end());
0379 SiStripConfigDb::AnalysisDescriptionsV tmp2;
0380 CommissioningAnalysisFactory::vectorCopy(tmp1, tmp2);
0381 anals.loadNext(ii->second.partitionName(), tmp2);
0382 }
0383 }
0384 db_->printAnalysisDescriptions();
0385 db_->clearAnalysisDescriptions();
0386
0387
0388 SiStripDbParams::SiStripPartitions::const_iterator iter = db_->dbParams().partitions().begin();
0389 SiStripDbParams::SiStripPartitions::const_iterator jter = db_->dbParams().partitions().end();
0390 for (; iter != jter; ++iter) {
0391 SiStripConfigDb::AnalysisDescriptionsRange range = anals.find(iter->second.partitionName());
0392 std::vector<SiStripConfigDb::AnalysisDescription*> temp(range.begin(), range.end());
0393 db_->addAnalysisDescriptions(iter->second.partitionName(), temp);
0394 db_->printAnalysisDescriptions(iter->second.partitionName());
0395 db_->uploadAnalysisDescriptions(false, iter->second.partitionName());
0396 db_->uploadAnalysisDescriptions(true, iter->second.partitionName());
0397 }
0398
0399
0400 db_->printAnalysisDescriptions();
0401 db_->uploadAnalysisDescriptions(false);
0402 db_->uploadAnalysisDescriptions(true);
0403 db_->clearAnalysisDescriptions();
0404 db_->printAnalysisDescriptions();
0405 }
0406 }
0407
0408
0409
0410 if (download_) {
0411
0412
0413 if (conns_) {
0414
0415 db_->clearFedConnections();
0416 SiStripDbParams::SiStripPartitions::const_iterator iter = db_->dbParams().partitions().begin();
0417 SiStripDbParams::SiStripPartitions::const_iterator jter = db_->dbParams().partitions().end();
0418 for (; iter != jter; ++iter) {
0419 SiStripConfigDb::FedConnectionsRange conns = db_->getFedConnections(iter->second.partitionName());
0420 db_->printFedConnections(iter->second.partitionName());
0421 db_->clearFedConnections(iter->second.partitionName());
0422 db_->printFedConnections(iter->second.partitionName());
0423 std::stringstream ss;
0424 ss << "[testSiStripConfigDb::" << __func__ << "]"
0425 << " Downloaded " << conns.size() << " FED connections!";
0426 if (!conns.empty()) {
0427 edm::LogVerbatim("testSiStripConfigDb") << ss.str();
0428 } else {
0429 edm::LogWarning("testSiStripConfigDb") << ss.str();
0430 }
0431 }
0432
0433
0434 SiStripConfigDb::FedConnectionsRange conns = db_->getFedConnections();
0435 db_->printFedConnections();
0436 db_->clearFedConnections();
0437 db_->printFedConnections();
0438 std::stringstream ss;
0439 ss << "[testSiStripConfigDb::" << __func__ << "]"
0440 << " Downloaded " << conns.size() << " FED connections!";
0441 if (!conns.empty()) {
0442 edm::LogVerbatim("testSiStripConfigDb") << ss.str();
0443 } else {
0444 edm::LogWarning("testSiStripConfigDb") << ss.str();
0445 }
0446 }
0447
0448
0449
0450 if (devices_) {
0451
0452 db_->clearDeviceDescriptions();
0453 SiStripDbParams::SiStripPartitions::const_iterator iter = db_->dbParams().partitions().begin();
0454 SiStripDbParams::SiStripPartitions::const_iterator jter = db_->dbParams().partitions().end();
0455 for (; iter != jter; ++iter) {
0456 SiStripConfigDb::DeviceDescriptionsRange devs = db_->getDeviceDescriptions(iter->second.partitionName());
0457 std::stringstream ss;
0458 ss << "[testSiStripConfigDb::" << __func__ << "]"
0459 << " Downloaded " << devs.size() << " device descriptions!";
0460 SiStripConfigDb::DeviceDescriptionsRange apv = db_->getDeviceDescriptions(APV25, iter->second.partitionName());
0461 SiStripConfigDb::DeviceDescriptionsRange mux = db_->getDeviceDescriptions(APVMUX, iter->second.partitionName());
0462 SiStripConfigDb::DeviceDescriptionsRange dcu = db_->getDeviceDescriptions(DCU, iter->second.partitionName());
0463 SiStripConfigDb::DeviceDescriptionsRange lld =
0464 db_->getDeviceDescriptions(LASERDRIVER, iter->second.partitionName());
0465 SiStripConfigDb::DeviceDescriptionsRange doh = db_->getDeviceDescriptions(DOH, iter->second.partitionName());
0466 SiStripConfigDb::DeviceDescriptionsRange pll = db_->getDeviceDescriptions(PLL, iter->second.partitionName());
0467 if (!devs.empty()) {
0468 ss << std::endl
0469 << " Number of APV descriptions : " << apv.size() << std::endl
0470 << " Number of MUX descriptions : " << mux.size() << std::endl
0471 << " Number of DCU descriptions : " << dcu.size() << std::endl
0472 << " Number of LLD descriptions : " << lld.size() << std::endl
0473 << " Number of DOH descriptions : " << doh.size() << std::endl
0474 << " Number of PLL descriptions : " << pll.size();
0475 edm::LogVerbatim("testSiStripConfigDb") << ss.str();
0476 } else {
0477 edm::LogWarning("testSiStripConfigDb") << ss.str();
0478 }
0479 db_->printDeviceDescriptions(iter->second.partitionName());
0480 db_->clearDeviceDescriptions(iter->second.partitionName());
0481 db_->printDeviceDescriptions(iter->second.partitionName());
0482 }
0483
0484
0485 SiStripConfigDb::DeviceDescriptionsRange devs = db_->getDeviceDescriptions();
0486 db_->printDeviceDescriptions();
0487 db_->clearDeviceDescriptions();
0488 db_->printDeviceDescriptions();
0489 std::stringstream ss;
0490 ss << "[testSiStripConfigDb::" << __func__ << "]"
0491 << " Downloaded " << devs.size() << " device descriptions!";
0492 if (!devs.empty()) {
0493 edm::LogVerbatim("testSiStripConfigDb") << ss.str();
0494 } else {
0495 edm::LogWarning("testSiStripConfigDb") << ss.str();
0496 }
0497 }
0498
0499
0500
0501 if (feds_) {
0502
0503 db_->clearFedDescriptions();
0504 SiStripDbParams::SiStripPartitions::const_iterator iter = db_->dbParams().partitions().begin();
0505 SiStripDbParams::SiStripPartitions::const_iterator jter = db_->dbParams().partitions().end();
0506 for (; iter != jter; ++iter) {
0507 SiStripConfigDb::FedDescriptionsRange feds = db_->getFedDescriptions(iter->second.partitionName());
0508 std::stringstream ss;
0509 ss << "[testSiStripConfigDb::" << __func__ << "]"
0510 << " Downloaded " << feds.size() << " FED descriptions!";
0511 SiStripConfigDb::FedIdsRange ids = db_->getFedIds(iter->second.partitionName());
0512 if (!feds.empty()) {
0513 ss << std::endl << " Number of FED ids : " << ids.size();
0514 edm::LogVerbatim("testSiStripConfigDb") << ss.str();
0515 } else {
0516 edm::LogWarning("testSiStripConfigDb") << ss.str();
0517 }
0518 db_->printFedDescriptions(iter->second.partitionName());
0519 db_->clearFedDescriptions(iter->second.partitionName());
0520 db_->printFedDescriptions(iter->second.partitionName());
0521 }
0522
0523
0524 SiStripConfigDb::FedDescriptionsRange feds = db_->getFedDescriptions();
0525 db_->printFedDescriptions();
0526 db_->clearFedDescriptions();
0527 db_->printFedDescriptions();
0528 std::stringstream ss;
0529 ss << "[testSiStripConfigDb::" << __func__ << "]"
0530 << " Downloaded " << feds.size() << " FED descriptions!";
0531 if (!feds.empty()) {
0532 edm::LogVerbatim("testSiStripConfigDb") << ss.str();
0533 } else {
0534 edm::LogWarning("testSiStripConfigDb") << ss.str();
0535 }
0536 }
0537
0538
0539
0540 if (dcus_) {
0541
0542 db_->clearDcuDetIds();
0543 SiStripDbParams::SiStripPartitions::const_iterator iter = db_->dbParams().partitions().begin();
0544 SiStripDbParams::SiStripPartitions::const_iterator jter = db_->dbParams().partitions().end();
0545 for (; iter != jter; ++iter) {
0546 SiStripConfigDb::DcuDetIdsRange range = db_->getDcuDetIds(iter->second.partitionName());
0547 std::stringstream ss;
0548 ss << "[testSiStripConfigDb::" << __func__ << "]"
0549 << " Downloaded " << range.size() << " DCU-DetId map!";
0550 if (!range.empty()) {
0551 edm::LogVerbatim("testSiStripConfigDb") << ss.str();
0552 } else {
0553 edm::LogWarning("testSiStripConfigDb") << ss.str();
0554 }
0555 db_->printDcuDetIds(iter->second.partitionName());
0556 db_->clearDcuDetIds(iter->second.partitionName());
0557 db_->printDcuDetIds(iter->second.partitionName());
0558 }
0559
0560
0561 SiStripConfigDb::DcuDetIdsRange range = db_->getDcuDetIds();
0562 db_->printDcuDetIds();
0563 db_->clearDcuDetIds();
0564 db_->printDcuDetIds();
0565 std::stringstream ss;
0566 ss << "[testSiStripConfigDb::" << __func__ << "]"
0567 << " Downloaded " << range.size() << " DCU-DetId map!";
0568 if (!range.empty()) {
0569 edm::LogVerbatim("testSiStripConfigDb") << ss.str();
0570 } else {
0571 edm::LogWarning("testSiStripConfigDb") << ss.str();
0572 }
0573 }
0574
0575
0576
0577 if (anals_) {
0578
0579 db_->clearAnalysisDescriptions();
0580 SiStripDbParams::SiStripPartitions::const_iterator iter = db_->dbParams().partitions().begin();
0581 SiStripDbParams::SiStripPartitions::const_iterator jter = db_->dbParams().partitions().end();
0582 for (; iter != jter; ++iter) {
0583 SiStripConfigDb::AnalysisType type = SiStripConfigDb::AnalysisDescription::T_UNKNOWN;
0584 if (iter->second.runType() == sistrip::PHYSICS) {
0585 type = SiStripConfigDb::AnalysisDescription::T_ANALYSIS_PEDESTALS;
0586 } else if (iter->second.runType() == sistrip::FAST_CABLING) {
0587 type = SiStripConfigDb::AnalysisDescription::T_ANALYSIS_FASTFEDCABLING;
0588 } else if (iter->second.runType() == sistrip::APV_TIMING) {
0589 type = SiStripConfigDb::AnalysisDescription::T_ANALYSIS_TIMING;
0590 } else if (iter->second.runType() == sistrip::OPTO_SCAN) {
0591 type = SiStripConfigDb::AnalysisDescription::T_ANALYSIS_OPTOSCAN;
0592 } else if (iter->second.runType() == sistrip::PEDESTALS) {
0593 type = SiStripConfigDb::AnalysisDescription::T_ANALYSIS_PEDESTALS;
0594 } else if (iter->second.runType() != sistrip::UNKNOWN_RUN_TYPE &&
0595 iter->second.runType() != sistrip::UNDEFINED_RUN_TYPE) {
0596 type = SiStripConfigDb::AnalysisDescription::T_ANALYSIS_PEDESTALS;
0597 std::stringstream ss;
0598 ss << "[testSiStripConfigDb::" << __func__ << "]"
0599 << " Unexpected run type \"" << SiStripEnumsAndStrings::runType(iter->second.runType())
0600 << "\"! Using T_ANALYSIS_PEDESTALS as analysis type!";
0601 edm::LogWarning(mlConfigDb_) << ss.str();
0602 } else {
0603 type = SiStripConfigDb::AnalysisDescription::T_ANALYSIS_PEDESTALS;
0604 }
0605
0606 SiStripConfigDb::AnalysisDescriptionsRange anals =
0607 db_->getAnalysisDescriptions(type, iter->second.partitionName());
0608
0609 std::stringstream ss;
0610 ss << "[testSiStripConfigDb::" << __func__ << "]"
0611 << " Downloaded " << anals.size() << " analysis descriptions!";
0612 if (!anals.empty()) {
0613 edm::LogVerbatim("testSiStripConfigDb") << ss.str();
0614 } else {
0615 edm::LogWarning("testSiStripConfigDb") << ss.str();
0616 }
0617 db_->printAnalysisDescriptions(iter->second.partitionName());
0618 db_->clearAnalysisDescriptions(iter->second.partitionName());
0619 db_->printAnalysisDescriptions(iter->second.partitionName());
0620 }
0621
0622
0623 SiStripConfigDb::AnalysisType type = SiStripConfigDb::AnalysisDescription::T_ANALYSIS_PEDESTALS;
0624 SiStripConfigDb::AnalysisDescriptionsRange anals = db_->getAnalysisDescriptions(type);
0625 db_->printAnalysisDescriptions();
0626 db_->clearAnalysisDescriptions();
0627 db_->printAnalysisDescriptions();
0628 std::stringstream ss;
0629 ss << "[testSiStripConfigDb::" << __func__ << "]"
0630 << " Downloaded " << anals.size() << " analysis descriptions!";
0631 if (!anals.empty()) {
0632 edm::LogVerbatim("testSiStripConfigDb") << ss.str();
0633 } else {
0634 edm::LogWarning("testSiStripConfigDb") << ss.str();
0635 }
0636 }
0637 }
0638 }
0639
0640 #include "FWCore/Framework/interface/MakerMacros.h"
0641 DEFINE_FWK_MODULE(testSiStripConfigDb);