Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:51

0001 #include <iostream>
0002 #include <sstream>
0003 #include "CondCore/Utilities/interface/PayloadInspector.h"
0004 #include "CondCore/SiStripPlugins/plugins/SiStripApvGain_PayloadInspector.cc"
0005 #include "CondCore/SiStripPlugins/plugins/SiStripNoises_PayloadInspector.cc"
0006 #include "CondCore/SiStripPlugins/plugins/SiStripPedestals_PayloadInspector.cc"
0007 #include "CondCore/SiStripPlugins/plugins/SiStripThreshold_PayloadInspector.cc"
0008 #include "CondCore/SiStripPlugins/plugins/SiStripLatency_PayloadInspector.cc"
0009 #include "CondCore/SiStripPlugins/plugins/SiStripFedCabling_PayloadInspector.cc"
0010 #include "CondCore/SiStripPlugins/plugins/SiStripBadStrip_PayloadInspector.cc"
0011 
0012 #include "FWCore/PluginManager/interface/PluginManager.h"
0013 #include "FWCore/PluginManager/interface/standard.h"
0014 #include "FWCore/ServiceRegistry/interface/ServiceRegistry.h"
0015 
0016 int main(int argc, char** argv) {
0017   Py_Initialize();
0018 
0019   edmplugin::PluginManager::Config config;
0020   edmplugin::PluginManager::configure(edmplugin::standard::config());
0021 
0022   std::vector<edm::ParameterSet> psets;
0023   edm::ParameterSet pSet;
0024   pSet.addParameter("@service_type", std::string("SiteLocalConfigService"));
0025   psets.push_back(pSet);
0026   edm::ServiceToken servToken(edm::ServiceRegistry::createSet(psets));
0027   edm::ServiceRegistry::Operate operate(servToken);
0028 
0029   std::string connectionString("frontier://FrontierProd/CMS_CONDITIONS");
0030 
0031   // Gains
0032 
0033   std::string tag = "SiStripApvGain_FromParticles_GR10_v11_offline";
0034 
0035   cond::Time_t start = static_cast<unsigned long long>(132440);
0036   cond::Time_t end = static_cast<unsigned long long>(285368);
0037   py::dict inputs;
0038 
0039   edm::LogPrint("testSiStripPayloadInspector") << "## Exercising Gains plots " << std::endl;
0040 
0041   SiStripApvGainsAverageTrackerMap histo1;
0042   histo1.process(connectionString, PI::mk_input(tag, start, start));
0043   edm::LogPrint("testSiStripPayloadInspector") << histo1.data() << std::endl;
0044 
0045   SiStripApvGainsAvgDeviationRatioWithPreviousIOVTrackerMap histo2;
0046   inputs["nsigma"] = "1";
0047   histo2.setInputParamValues(inputs);
0048   histo2.process(connectionString, PI::mk_input(tag, start, end));
0049   edm::LogPrint("testSiStripPayloadInspector") << histo2.data() << std::endl;
0050 
0051   SiStripApvGainsMaxDeviationRatioWithPreviousIOVTrackerMap histo3;
0052   inputs["nsigma"] = "1";
0053   histo3.setInputParamValues(inputs);
0054   histo3.process(connectionString, PI::mk_input(tag, start, end));
0055   edm::LogPrint("testSiStripPayloadInspector") << histo3.data() << std::endl;
0056 
0057   SiStripApvGainsValuesComparatorSingleTag histo4;
0058   histo4.process(connectionString, PI::mk_input(tag, start, end));
0059   edm::LogPrint("testSiStripPayloadInspector") << histo4.data() << std::endl;
0060 
0061   SiStripApvGainsComparatorSingleTag histo5;
0062   histo5.process(connectionString, PI::mk_input(tag, start, end));
0063   edm::LogPrint("testSiStripPayloadInspector") << histo5.data() << std::endl;
0064 
0065   SiStripApvGainsComparatorByRegionSingleTag histo6;
0066   histo6.process(connectionString, PI::mk_input(tag, start, end));
0067   edm::LogPrint("testSiStripPayloadInspector") << histo6.data() << std::endl;
0068 
0069   SiStripApvGainsRatioComparatorByRegionSingleTag histo7;
0070   histo7.process(connectionString, PI::mk_input(tag, start, end));
0071   edm::LogPrint("testSiStripPayloadInspector") << histo7.data() << std::endl;
0072 
0073   // Noise
0074 
0075   tag = "SiStripNoise_GR10_v1_hlt";
0076   start = static_cast<unsigned long long>(312968);
0077   end = static_cast<unsigned long long>(313120);
0078 
0079   edm::LogPrint("testSiStripPayloadInspector") << "## Exercising Noise plots " << std::endl;
0080 
0081   SiStripNoiseValuePerAPV histo8;
0082   histo8.process(connectionString, PI::mk_input(tag, start, start));
0083   edm::LogPrint("testSiStripPayloadInspector") << histo8.data() << std::endl;
0084 
0085   SiStripNoiseValueComparisonPerAPVSingleTag histo9;
0086   histo9.process(connectionString, PI::mk_input(tag, start, end));
0087   edm::LogPrint("testSiStripPayloadInspector") << histo9.data() << std::endl;
0088 
0089   SiStripNoiseComparatorMeanByRegionSingleTag histoCompareMeanByRegion;
0090   histoCompareMeanByRegion.process(connectionString, PI::mk_input(tag, start, start));
0091   edm::LogPrint("testSiStripPayloadInspector") << histoCompareMeanByRegion.data() << std::endl;
0092 
0093   SiStripNoisePerDetId histoNoiseForDetId;
0094   inputs["DetIds"] = "470148232";
0095   histoNoiseForDetId.setInputParamValues(inputs);
0096   histoNoiseForDetId.process(connectionString, PI::mk_input(tag, start, start));
0097   edm::LogPrint("testSiStripPayloadInspector") << histoNoiseForDetId.data() << std::endl;
0098 
0099   SiStripNoiseCorrelationByPartition histoNoiseCorrelationByPartition;
0100   histoNoiseCorrelationByPartition.process(connectionString, PI::mk_input(tag, start, start));
0101   edm::LogPrint("testSiStripPayloadInspector") << histoNoiseCorrelationByPartition.data() << std::endl;
0102 
0103   // Pedestals
0104 
0105   tag = "SiStripPedestals_v2_prompt";
0106   start = static_cast<unsigned long long>(303420);
0107   end = static_cast<unsigned long long>(313120);
0108 
0109   edm::LogPrint("testSiStripPayloadInspector") << "## Exercising Pedestal plots " << std::endl;
0110 
0111   SiStripPedestalValuePerStrip histo10;
0112   histo10.process(connectionString, PI::mk_input(tag, start, start));
0113   edm::LogPrint("testSiStripPayloadInspector") << histo10.data() << std::endl;
0114 
0115   SiStripPedestalValueComparisonPerModuleSingleTag histo11;
0116   histo11.process(connectionString, PI::mk_input(tag, start, end));
0117   edm::LogPrint("testSiStripPayloadInspector") << histo11.data() << std::endl;
0118 
0119   SiStripPedestalPerDetId histoPedestalForDetId;
0120   inputs["DetIds"] = py::cast<std::string>(inputs["DetIds"]) +
0121                      ",470065830,369121594,369124670,470177668";  // add a bunch of other DetIds
0122   histoPedestalForDetId.setInputParamValues(inputs);
0123   histoPedestalForDetId.process(connectionString, PI::mk_input(tag, start, start));
0124   edm::LogPrint("testSiStripPayloadInspector") << histoPedestalForDetId.data() << std::endl;
0125 
0126   SiStripPedestalCorrelationByPartition histoPedestalCorrelationByPartition;
0127   histoPedestalCorrelationByPartition.process(connectionString, PI::mk_input(tag, start, start));
0128   edm::LogPrint("testSiStripPayloadInspector") << histoPedestalCorrelationByPartition.data() << std::endl;
0129 
0130   // Latency
0131 
0132   tag = "SiStripLatency_v2_prompt";
0133   start = static_cast<unsigned long long>(315347);
0134   end = static_cast<unsigned long long>(316675);
0135 
0136   edm::LogPrint("testSiStripPayloadInspector") << "## Exercising Latency plots " << std::endl;
0137 
0138   SiStripLatencyMode histo12;
0139   histo12.process(connectionString, PI::mk_input(tag, start, start));
0140   edm::LogPrint("testSiStripPayloadInspector") << histo12.data() << std::endl;
0141 
0142   SiStripLatencyModeHistory histo13;
0143   histo13.process(connectionString, PI::mk_input(tag, start, end));
0144   edm::LogPrint("testSiStripPayloadInspector") << histo13.data() << std::endl;
0145 
0146   // Threshold
0147   tag = "SiStripThreshold_v1_prompt";
0148   start = static_cast<unsigned long long>(315352);
0149   end = static_cast<unsigned long long>(315460);
0150 
0151   edm::LogPrint("testSiStripPayloadInspector") << "## Exercising Threshold plots " << std::endl;
0152 
0153   SiStripThresholdValueHigh histo14;
0154   histo14.process(connectionString, PI::mk_input(tag, start, end));
0155   edm::LogPrint("testSiStripPayloadInspector") << histo14.data() << std::endl;
0156 
0157   // test SiStripTkMaps
0158   tag = "SiStripBadComponents_startupMC_for2017_v1_mc";
0159   start = static_cast<unsigned long long>(1);
0160   end = static_cast<unsigned long long>(1);
0161 
0162   edm::LogPrint("testSiStripPayloadInspector") << "## Exercising SiStripTkMaps plots " << std::endl;
0163 
0164   SiStripBadStripFractionTH2PolyTkMap histoTkMap;
0165   histoTkMap.process(connectionString, PI::mk_input(tag, start, end));
0166   edm::LogPrint("testSiStripPayloadInspector") << histoTkMap.data() << std::endl;
0167 
0168   // test FED cabling
0169   tag = "SiStripFedCabling_GR10_v1_hlt";
0170   start = static_cast<unsigned long long>(1);
0171   end = static_cast<unsigned long long>(400000);
0172 
0173   edm::LogPrint("testSiStripPayloadInspector") << "## Exercising FEDCabling plots " << std::endl;
0174 
0175   SiStripFedCablingComparisonTrackerMapSingleTag histoFEDCablingCompare;
0176   histoFEDCablingCompare.process(connectionString, PI::mk_input(tag, start, end));
0177   edm::LogPrint("testSiStripPayloadInspector") << histoFEDCablingCompare.data() << std::endl;
0178 
0179   inputs.clear();
0180 #if PY_MAJOR_VERSION >= 3
0181   // TODO I don't know why this Py_INCREF is necessary...
0182   Py_INCREF(inputs.ptr());
0183 #endif
0184 
0185   Py_Finalize();
0186 }