@@ -84,6 +84,7 @@ class HLTObjectMonitor : public DQMEDAnalyzer {
8484
8585public:
8686 explicit HLTObjectMonitor (const edm::ParameterSet&);
87+ static void fillDescriptions (edm::ConfigurationDescriptions& descriptions);
8788
8889private:
8990 void analyze (const edm::Event&, const edm::EventSetup&) override ;
@@ -309,24 +310,23 @@ HLTObjectMonitor::HLTObjectMonitor(const edm::ParameterSet& iConfig)
309310 wallTime_pset = iConfig.getParameter <edm::ParameterSet>(" wallTime" );
310311 plotMap[&wallTime_] = &wallTime_pset;
311312
312- for (auto item = plotMap. begin (); item != plotMap. end (); item++ ) {
313- (*item-> first ). pathName = (*item-> second ). getParameter <string>(" pathName" );
314- (*item-> first ). moduleName = (*item-> second ). getParameter <string>(" moduleName" );
315- (*item-> first ). nBins = (*item-> second ). getParameter <int >(" NbinsX" );
316- (*item-> first ). xMin = (*item-> second ). getParameter <double >(" Xmin" );
317- (*item-> first ). xMax = (*item-> second ). getParameter <double >(" Xmax" );
318- (*item-> first ). xAxisLabel = (*item-> second ). getParameter <string>(" axisLabel" );
319- (*item-> first ). plotLabel = (*item-> second ). getParameter <string>(" plotLabel" );
320- (*item-> first ). displayInPrimary = (*item-> second ). getParameter <bool >(" mainWorkspace" );
321-
322- if ((*item-> second ). exists (" pathName_OR" )) {
323- (*item-> first ). pathNameOR = (*item-> second ). getParameter <string>(" pathName_OR" );
313+ for (auto & [key, value] : plotMap) {
314+ key-> pathName = value-> getParameter <std:: string>(" pathName" );
315+ key-> moduleName = value-> getParameter <std:: string>(" moduleName" );
316+ key-> nBins = value-> getParameter <int >(" NbinsX" );
317+ key-> xMin = value-> getParameter <double >(" Xmin" );
318+ key-> xMax = value-> getParameter <double >(" Xmax" );
319+ key-> xAxisLabel = value-> getParameter <std:: string>(" axisLabel" );
320+ key-> plotLabel = value-> getParameter <std:: string>(" plotLabel" );
321+ key-> displayInPrimary = value-> getParameter <bool >(" mainWorkspace" );
322+
323+ if (value-> exists (" pathName_OR" )) {
324+ key-> pathNameOR = value-> getParameter <std:: string>(" pathName_OR" );
324325 }
325- if ((*item-> second ). exists (" moduleName_OR" )) {
326- (*item-> first ). moduleNameOR = (*item-> second ). getParameter <string>(" moduleName_OR" );
326+ if (value-> exists (" moduleName_OR" )) {
327+ key-> moduleNameOR = value-> getParameter <std:: string>(" moduleName_OR" );
327328 }
328-
329- plotList.push_back (item->first );
329+ plotList.push_back (key);
330330 }
331331 plotMap.clear ();
332332
@@ -862,31 +862,69 @@ double HLTObjectMonitor::get_wall_time() {
862862 return (double )time.tv_sec + (double )time.tv_usec * .000001 ;
863863}
864864
865- // ------------ method called when starting to processes a luminosity block ------------
866- /*
867- void
868- HLTObjectMonitor::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&)
869- {
870- }
871- */
865+ // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
866+ void HLTObjectMonitor::fillDescriptions (edm::ConfigurationDescriptions& descriptions) {
867+ edm::ParameterSetDescription desc;
868+ desc.add <std::string>(" processName" , " HLT" );
869+
870+ auto addPSet = [](edm::ParameterSetDescription& desc, const std::string& name) {
871+ edm::ParameterSetDescription pset;
872+ pset.add <std::string>(" pathName" , " " );
873+ pset.add <std::string>(" moduleName" , " " );
874+ pset.addOptional <std::string>(" pathName_OR" );
875+ pset.addOptional <std::string>(" moduleName_OR" );
876+ pset.add <std::string>(" plotLabel" , " " );
877+ pset.add <std::string>(" axisLabel" , " " );
878+ pset.add <bool >(" mainWorkspace" , false );
879+ pset.add <int >(" NbinsX" , 50 );
880+ pset.add <double >(" Xmin" , 0.0 );
881+ pset.add <double >(" Xmax" , 1.0 );
882+ desc.add <edm::ParameterSetDescription>(name, pset);
883+ };
872884
873- // ------------ method called when ending the processing of a luminosity block ------------
874- /*
875- void
876- HLTObjectMonitor::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&)
877- {
885+ addPSet (desc, " alphaT" );
886+ addPSet (desc, " photonPt" );
887+ addPSet (desc, " photonEta" );
888+ addPSet (desc, " photonPhi" );
889+ addPSet (desc, " muonPt" );
890+ addPSet (desc, " muonEta" );
891+ addPSet (desc, " muonPhi" );
892+ addPSet (desc, " l2muonPt" );
893+ addPSet (desc, " l2muonEta" );
894+ addPSet (desc, " l2muonPhi" );
895+ addPSet (desc, " l2NoBPTXmuonPt" );
896+ addPSet (desc, " l2NoBPTXmuonEta" );
897+ addPSet (desc, " l2NoBPTXmuonPhi" );
898+ addPSet (desc, " electronPt" );
899+ addPSet (desc, " electronEta" );
900+ addPSet (desc, " electronPhi" );
901+ addPSet (desc, " jetPt" );
902+ addPSet (desc, " jetAK8Pt" );
903+ addPSet (desc, " jetAK8Mass" );
904+ addPSet (desc, " tauPt" );
905+ addPSet (desc, " diMuonLowMass" );
906+ addPSet (desc, " caloMetPt" );
907+ addPSet (desc, " caloMetPhi" );
908+ addPSet (desc, " pfMetPt" );
909+ addPSet (desc, " pfMetPhi" );
910+ addPSet (desc, " caloHtPt" );
911+ addPSet (desc, " pfHtPt" );
912+ addPSet (desc, " bJetEta" );
913+ addPSet (desc, " bJetPhi" );
914+ addPSet (desc, " bJetCSVCalo" );
915+ addPSet (desc, " bJetCSVPF" );
916+ addPSet (desc, " rsq" );
917+ addPSet (desc, " mr" );
918+ addPSet (desc, " diMuonMass" );
919+ addPSet (desc, " pAL1DoubleMuZMass" );
920+ addPSet (desc, " pAL2DoubleMuZMass" );
921+ addPSet (desc, " pAL3DoubleMuZMass" );
922+ addPSet (desc, " diElecMass" );
923+ addPSet (desc, " muonDxy" );
924+ addPSet (desc, " muonDz" );
925+ addPSet (desc, " wallTime" );
926+ descriptions.addWithDefaultLabel (desc);
878927}
879- */
880-
881- // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
882- // void
883- // HLTObjectMonitor::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
884- // //The following says we do not know what parameters are allowed so do no validation
885- // // Please change this to state exactly what you do use, even if it is no parameters
886- // edm::ParameterSetDescription desc;
887- // desc.setUnknown();
888- // descriptions.addDefault(desc);
889- // }
890928
891929// define this as a plug-in
892930DEFINE_FWK_MODULE (HLTObjectMonitor);
0 commit comments