Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-07 22:41:38

0001 #include <iostream>
0002 #include <sstream>
0003 #include "CondCore/Utilities/interface/PayloadInspector.h"
0004 #include "CondCore/SiPixelPlugins/plugins/SiPixelLorentzAngle_PayloadInspector.cc"
0005 #include "CondCore/SiPixelPlugins/plugins/SiPixelQuality_PayloadInspector.cc"
0006 #include "CondCore/SiPixelPlugins/plugins/SiPixelGainCalibrationOffline_PayloadInspector.cc"
0007 #include "CondCore/SiPixelPlugins/plugins/SiPixelTemplateDBObject_PayloadInspector.cc"
0008 #include "CondCore/SiPixelPlugins/plugins/SiPixelGenErrorDBObject_PayloadInspector.cc"
0009 #include "CondCore/SiPixelPlugins/plugins/SiPixelVCal_PayloadInspector.cc"
0010 #include "CondCore/SiPixelPlugins/plugins/SiPixelQualityProbabilities_PayloadInspector.cc"
0011 #include "CondCore/SiPixelPlugins/plugins/SiPixelDynamicInefficiency_PayloadInspector.cc"
0012 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0013 #include "FWCore/PluginManager/interface/PluginManager.h"
0014 #include "FWCore/PluginManager/interface/standard.h"
0015 #include "FWCore/PluginManager/interface/SharedLibrary.h"
0016 #include "FWCore/ServiceRegistry/interface/ServiceRegistry.h"
0017 
0018 int main(int argc, char** argv) {
0019   Py_Initialize();
0020 
0021   edmplugin::PluginManager::Config config;
0022   edmplugin::PluginManager::configure(edmplugin::standard::config());
0023 
0024   std::vector<edm::ParameterSet> psets;
0025   edm::ParameterSet pSet;
0026   pSet.addParameter("@service_type", std::string("SiteLocalConfigService"));
0027   psets.push_back(pSet);
0028   edm::ServiceToken servToken(edm::ServiceRegistry::createSet(psets));
0029   edm::ServiceRegistry::Operate operate(servToken);
0030 
0031   std::string connectionString("frontier://FrontierProd/CMS_CONDITIONS");
0032 
0033   // Lorentz Angle
0034 
0035   std::string tag = "SiPixelLorentzAngle_v11_offline";
0036   cond::Time_t start = static_cast<unsigned long long>(303790);
0037   cond::Time_t end = static_cast<unsigned long long>(324245);
0038 
0039   edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising Lorentz Angle plots " << std::endl;
0040 
0041   SiPixelLorentzAngleValues histo1;
0042   histo1.process(connectionString, PI::mk_input(tag, start, start));
0043   edm::LogPrint("testSiPixelPayloadInspector") << histo1.data() << std::endl;
0044 
0045   SiPixelLorentzAngleValueComparisonSingleTag histo2;
0046   histo2.process(connectionString, PI::mk_input(tag, start, end));
0047   edm::LogPrint("testSiPixelPayloadInspector") << histo2.data() << std::endl;
0048 
0049   SiPixelLorentzAngleByRegionComparisonSingleTag histo3;
0050   histo3.process(connectionString, PI::mk_input(tag, start, end));
0051   edm::LogPrint("testSiPixelPayloadInspector") << histo3.data() << std::endl;
0052 
0053   SiPixelBPixLorentzAngleMap histo4;
0054   histo4.process(connectionString, PI::mk_input(tag, start, start));
0055   edm::LogPrint("testSiPixelPayloadInspector") << histo4.data() << std::endl;
0056 
0057   SiPixelFPixLorentzAngleMap histo5;
0058   histo5.process(connectionString, PI::mk_input(tag, end, end));
0059   edm::LogPrint("testSiPixelPayloadInspector") << histo5.data() << std::endl;
0060 
0061   std::string f_tagPhase2 = "SiPixelLorentzAngle_phase2_T15_v5_mc";
0062   std::string l_tagPhase2 = "SiPixelLorentzAngle_phase2_T19_v1_mc";
0063 
0064   SiPixelLorentzAngleValuesBarrelCompareTwoTags histoPhase2;
0065   histoPhase2.process(connectionString, PI::mk_input(f_tagPhase2, 1, 1, l_tagPhase2, 1, 1));
0066   edm::LogPrint("testSiPixelPayloadInspector") << histoPhase2.data() << std::endl;
0067 
0068   // 2 tags comparisons
0069 
0070   std::string tag2 = "SiPixelLorentzAngle_2016_ultralegacymc_v2";
0071   cond::Time_t start2 = static_cast<unsigned long long>(1);
0072 
0073   SiPixelLorentzAngleValueComparisonTwoTags histo6;
0074   histo6.process(connectionString, PI::mk_input(tag, start, start, tag2, start2, start2));
0075   edm::LogPrint("testSiPixelPayloadInspector") << histo6.data() << std::endl;
0076 
0077   SiPixelLorentzAngleByRegionComparisonTwoTags histo7;
0078   histo7.process(connectionString, PI::mk_input(tag, start, start, tag2, start2, start2));
0079   edm::LogPrint("testSiPixelPayloadInspector") << histo7.data() << std::endl;
0080 
0081   // SiPixelQuality
0082 
0083   tag = "SiPixelQuality_forDigitizer_phase1_2018_permanentlyBad";
0084   start = static_cast<unsigned long long>(1);
0085   end = static_cast<unsigned long long>(1);
0086 
0087   edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixelQuality plots " << std::endl;
0088 
0089   SiPixelBPixQualityMap histo8;
0090   histo8.process(connectionString, PI::mk_input(tag, start, end));
0091   edm::LogPrint("testSiPixelPayloadInspector") << histo8.data() << std::endl;
0092 
0093   SiPixelFPixQualityMap histo9;
0094   histo9.process(connectionString, PI::mk_input(tag, start, end));
0095   edm::LogPrint("testSiPixelPayloadInspector") << histo9.data() << std::endl;
0096 
0097   // SiPixelGainCalibrationOffline
0098 
0099   tag = "SiPixelGainCalibration_2009runs_express";
0100   start = static_cast<unsigned long long>(312203);
0101   end = static_cast<unsigned long long>(312203);
0102 
0103   edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixelGainCalibrationOffline plots " << std::endl;
0104 
0105   SiPixelGainCalibrationOfflineGainsValues histo10;
0106   histo10.process(connectionString, PI::mk_input(tag, start, end));
0107   edm::LogPrint("testSiPixelPayloadInspector") << histo10.data() << std::endl;
0108 
0109   SiPixelGainCalibrationOfflinePedestalsValues histo11;
0110   histo11.process(connectionString, PI::mk_input(tag, start, end));
0111   edm::LogPrint("testSiPixelPayloadInspector") << histo11.data() << std::endl;
0112 
0113   SiPixelGainCalibrationOfflineGainsByPart histo12;
0114   histo12.process(connectionString, PI::mk_input(tag, start, end));
0115   edm::LogPrint("testSiPixelPayloadInspector") << histo12.data() << std::endl;
0116 
0117   SiPixelGainCalibrationOfflinePedestalsByPart histo13;
0118   histo13.process(connectionString, PI::mk_input(tag, start, end));
0119   edm::LogPrint("testSiPixelPayloadInspector") << histo13.data() << std::endl;
0120 
0121   end = static_cast<unsigned long long>(326851);
0122 
0123   SiPixelGainCalibOfflinePedestalComparisonSingleTag histo14;
0124   histo14.process(connectionString, PI::mk_input(tag, start, end));
0125   edm::LogPrint("testSiPixelPayloadInspector") << histo14.data() << std::endl;
0126 
0127   SiPixelGainCalibOfflineGainByRegionComparisonSingleTag histo15;
0128   histo15.process(connectionString, PI::mk_input(tag, start, end));
0129   edm::LogPrint("testSiPixelPayloadInspector") << histo15.data() << std::endl;
0130 
0131   SiPixelGainCalibrationOfflineCorrelations histo16;
0132   histo16.process(connectionString, PI::mk_input(tag, end, end));
0133   edm::LogPrint("testSiPixelPayloadInspector") << histo16.data() << std::endl;
0134 
0135   py::dict inputs;
0136   inputs["SetLog"] = "True";  // sets to true, 1,True,Yes will work
0137 
0138   SiPixelGainCalibrationOfflineGainsValuesBarrel histo17;
0139   histo17.setInputParamValues(inputs);
0140   histo17.process(connectionString, PI::mk_input(tag, end, end));
0141   edm::LogPrint("testSiPixelPayloadInspector") << histo17.data() << std::endl;
0142 
0143   // SiPixelTemplates
0144 
0145   tag = "SiPixelTemplateDBObject38Tv3_express";
0146   start = static_cast<unsigned long long>(326083);
0147   end = static_cast<unsigned long long>(326083);
0148 
0149   edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixelTemplates plots " << std::endl;
0150 
0151   SiPixelTemplateIDsBPixMap histo18;
0152   histo18.process(connectionString, PI::mk_input(tag, start, end));
0153   edm::LogPrint("testSiPixelPayloadInspector") << histo18.data() << std::endl;
0154 
0155   SiPixelTemplateLAFPixMap histo19;
0156   histo19.process(connectionString, PI::mk_input(tag, start, end));
0157   edm::LogPrint("testSiPixelPayloadInspector") << histo19.data() << std::endl;
0158 
0159   // SiPixelVCal
0160 
0161   tag = "SiPixelVCal_v1";
0162 
0163   edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixelVCal plots " << std::endl;
0164 
0165   SiPixelVCalValues histo20;
0166   histo20.process("frontier://FrontierPrep/CMS_CONDITIONS", PI::mk_input(tag, 1, 1));
0167   edm::LogPrint("testSiPixelPayloadInspector") << histo20.data() << std::endl;
0168 
0169   SiPixelVCalSlopeValuesBarrel histo21;
0170   histo21.process("frontier://FrontierPrep/CMS_CONDITIONS", PI::mk_input(tag, 1, 1));
0171   edm::LogPrint("testSiPixelPayloadInspector") << histo21.data() << std::endl;
0172 
0173   SiPixelVCalOffsetValuesEndcap histo22;
0174   histo22.process("frontier://FrontierPrep/CMS_CONDITIONS", PI::mk_input(tag, 1, 1));
0175   edm::LogPrint("testSiPixelPayloadInspector") << histo22.data() << std::endl;
0176 
0177   // SiPixelGenErrors
0178 
0179   tag = "SiPixelGenErrorDBObject_phase1_BoR3_HV350_Tr2000";
0180   start = static_cast<unsigned long long>(1);
0181   end = static_cast<unsigned long long>(1);
0182 
0183   edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixelGenErrors plots " << std::endl;
0184 
0185   SiPixelGenErrorHeaderTable histo23;
0186   histo23.process(connectionString, PI::mk_input(tag, start, end));
0187   edm::LogPrint("testSiPixelPayloadInspector") << histo23.data() << std::endl;
0188 
0189   SiPixelGenErrorIDsBPixMap histo24;
0190   histo24.process(connectionString, PI::mk_input(tag, start, end));
0191   edm::LogPrint("testSiPixelPayloadInspector") << histo24.data() << std::endl;
0192 
0193   // SiPixelQualityProbabilities
0194 
0195   tag = "SiPixelQualityProbabilities_UltraLegacy2018_v0_mc";
0196   start = static_cast<unsigned long long>(1);
0197   end = static_cast<unsigned long long>(1);
0198 
0199   edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixelQualityProbabilities plots " << std::endl;
0200 
0201   SiPixelQualityProbabilitiesScenariosCount histo25;
0202   histo25.process(connectionString, PI::mk_input(tag, start, end));
0203   edm::LogPrint("testSiPixelPayloadInspector") << histo25.data() << std::endl;
0204 
0205   // SiPixelDynamicInefficiency
0206 
0207   tag = "SiPixelDynamicInefficiency_PhaseI_v9";
0208   start = static_cast<unsigned long long>(1);
0209   end = static_cast<unsigned long long>(1);
0210 
0211   edm::LogPrint("testSiPixelPayloadInspector") << "## Exercising SiPixeDynamicInefficiency plots " << std::endl;
0212 
0213   SiPixelFullIneffROCfromDynIneffMap histo26;
0214   histo26.process(connectionString, PI::mk_input(tag, start, end));
0215   edm::LogPrint("testSiPixelPayloadInspector") << histo26.data() << std::endl;
0216 
0217   tag2 = "SiPixelDynamicInefficiency_PhaseI_v6";
0218   start2 = static_cast<unsigned long long>(1);
0219 
0220   SiPixelFullIneffROCsMapCompareTwoTags histo27;
0221   histo27.process(connectionString, PI::mk_input(tag, start, start, tag2, start2, start2));
0222   edm::LogPrint("testSiPixelPayloadInspector") << histo27.data() << std::endl;
0223 
0224   inputs.clear();
0225 #if PY_MAJOR_VERSION >= 3
0226   // TODO I don't know why this Py_INCREF is necessary...
0227   Py_INCREF(inputs.ptr());
0228 #endif
0229 
0230   Py_Finalize();
0231 }