Skip to content

Commit bc1b708

Browse files
authored
Merge pull request #47513 from SWuchterl/dev/fillDescr
add fillDescriptions to several BTV plugins used at HLT
2 parents 49423c2 + 54cc22d commit bc1b708

File tree

5 files changed

+160
-105
lines changed

5 files changed

+160
-105
lines changed

RecoBTag/Combined/plugins/BTagProbabilityToDiscriminator.cc

+43-38
Original file line numberDiff line numberDiff line change
@@ -171,58 +171,63 @@ void BTagProbabilityToDiscriminator::fillDescriptions(edm::ConfigurationDescript
171171
edm::ParameterSetDescription desc;
172172
{
173173
edm::ParameterSetDescription vpsd1;
174+
vpsd1.setAllowAnything(); // Allow any string-to-string mappings
174175
vpsd1.add<std::vector<edm::InputTag>>("denominator", {});
175176
vpsd1.add<std::vector<edm::InputTag>>("numerator",
176177
{
177178
edm::InputTag("pfDeepCSVJetTags", "probb"),
178179
edm::InputTag("pfDeepCSVJetTags", "probbb"),
179180
});
180181
vpsd1.add<std::string>("name", "BvsAll");
181-
std::vector<edm::ParameterSet> temp1;
182-
temp1.reserve(3);
182+
std::vector<edm::ParameterSet> vectorOfDiscriminators;
183+
vectorOfDiscriminators.reserve(3);
183184
{
184-
edm::ParameterSet temp2;
185-
temp2.addParameter<std::vector<edm::InputTag>>("denominator", {});
186-
temp2.addParameter<std::vector<edm::InputTag>>("numerator",
187-
{
188-
edm::InputTag("pfDeepCSVJetTags", "probb"),
189-
edm::InputTag("pfDeepCSVJetTags", "probbb"),
190-
});
191-
temp2.addParameter<std::string>("name", "BvsAll");
192-
temp1.push_back(temp2);
185+
edm::ParameterSet tempDiscriminator;
186+
tempDiscriminator.addParameter<std::vector<edm::InputTag>>("denominator", {});
187+
tempDiscriminator.addParameter<std::vector<edm::InputTag>>("numerator",
188+
{
189+
edm::InputTag("pfDeepCSVJetTags", "probb"),
190+
edm::InputTag("pfDeepCSVJetTags", "probbb"),
191+
});
192+
tempDiscriminator.addParameter<std::string>("name", "BvsAll");
193+
vectorOfDiscriminators.push_back(tempDiscriminator);
193194
}
194195
{
195-
edm::ParameterSet temp2;
196-
temp2.addParameter<std::vector<edm::InputTag>>("denominator",
197-
{
198-
edm::InputTag("pfDeepCSVJetTags", "probc"),
199-
edm::InputTag("pfDeepCSVJetTags", "probb"),
200-
edm::InputTag("pfDeepCSVJetTags", "probbb"),
201-
});
202-
temp2.addParameter<std::vector<edm::InputTag>>("numerator",
203-
{
204-
edm::InputTag("pfDeepCSVJetTags", "probc"),
205-
});
206-
temp2.addParameter<std::string>("name", "CvsB");
207-
temp1.push_back(temp2);
196+
edm::ParameterSet tempDiscriminator;
197+
tempDiscriminator.addParameter<std::vector<edm::InputTag>>("denominator",
198+
{
199+
edm::InputTag("pfDeepCSVJetTags", "probc"),
200+
edm::InputTag("pfDeepCSVJetTags", "probb"),
201+
edm::InputTag("pfDeepCSVJetTags", "probbb"),
202+
});
203+
tempDiscriminator.addParameter<std::vector<edm::InputTag>>("numerator",
204+
{
205+
edm::InputTag("pfDeepCSVJetTags", "probc"),
206+
});
207+
tempDiscriminator.addParameter<std::string>("name", "CvsB");
208+
vectorOfDiscriminators.push_back(tempDiscriminator);
208209
}
209210
{
210-
edm::ParameterSet temp2;
211-
temp2.addParameter<std::vector<edm::InputTag>>("denominator",
212-
{
213-
edm::InputTag("pfDeepCSVJetTags", "probudsg"),
214-
edm::InputTag("pfDeepCSVJetTags", "probc"),
215-
});
216-
temp2.addParameter<std::vector<edm::InputTag>>("numerator",
217-
{
218-
edm::InputTag("pfDeepCSVJetTags", "probc"),
219-
});
220-
temp2.addParameter<std::string>("name", "CvsL");
221-
temp1.push_back(temp2);
211+
edm::ParameterSet tempDiscriminator;
212+
tempDiscriminator.addParameter<std::vector<edm::InputTag>>("denominator",
213+
{
214+
edm::InputTag("pfDeepCSVJetTags", "probudsg"),
215+
edm::InputTag("pfDeepCSVJetTags", "probc"),
216+
});
217+
tempDiscriminator.addParameter<std::vector<edm::InputTag>>("numerator",
218+
{
219+
edm::InputTag("pfDeepCSVJetTags", "probc"),
220+
});
221+
tempDiscriminator.addParameter<std::string>("name", "CvsL");
222+
vectorOfDiscriminators.push_back(tempDiscriminator);
222223
}
223-
desc.addVPSet("discriminators", vpsd1, temp1);
224+
desc.addVPSet("discriminators", vpsd1, vectorOfDiscriminators)
225+
->setComment(
226+
"List of ParameterSets to create new ratio-based neural network discriminants. "
227+
"Each entry is a ParameterSet where 'name' is the new name of the variable, and 'numerator' and "
228+
"'denominator' are vector of InputTags of the pure neural network scores to be used in the calculation.");
224229
}
225-
descriptions.addDefault(desc);
230+
descriptions.addWithDefaultLabel(desc);
226231
}
227232

228233
// define this as a plug-in

RecoBTag/ImpactParameter/plugins/IPProducer.h

+52-33
Original file line numberDiff line numberDiff line change
@@ -443,46 +443,65 @@ template <>
443443
inline void IPProducer<reco::TrackRefVector, reco::JTATagInfo, IPProducerHelpers::FromJTA>::fillDescriptions(
444444
edm::ConfigurationDescriptions& descriptions) {
445445
edm::ParameterSetDescription desc;
446-
desc.add<double>("maximumTransverseImpactParameter", 0.2);
447-
desc.add<int>("minimumNumberOfHits", 8);
448-
desc.add<double>("minimumTransverseMomentum", 1.0);
449-
desc.add<edm::InputTag>("primaryVertex", edm::InputTag("offlinePrimaryVertices"));
450-
desc.add<double>("maximumLongitudinalImpactParameter", 17.0);
451-
desc.add<bool>("computeGhostTrack", true);
452-
desc.add<double>("ghostTrackPriorDeltaR", 0.03);
453-
desc.add<edm::InputTag>("jetTracks", edm::InputTag("ak4JetTracksAssociatorAtVertexPF"));
454-
desc.add<bool>("jetDirectionUsingGhostTrack", false);
455-
desc.add<int>("minimumNumberOfPixelHits", 2);
456-
desc.add<bool>("jetDirectionUsingTracks", false);
457-
desc.add<bool>("computeProbabilities", true);
458-
desc.add<bool>("useTrackQuality", false);
459-
desc.add<double>("maximumChiSquared", 5.0);
460-
descriptions.addDefault(desc);
446+
desc.add<double>("maximumTransverseImpactParameter", 0.2)
447+
->setComment("Set upper threshold for the track transverse impact parameter.");
448+
desc.add<int>("minimumNumberOfHits", 8)->setComment("Set lower threshold for the number of valid hits per track.");
449+
desc.add<double>("minimumTransverseMomentum", 1.0)
450+
->setComment("Set lower threshold for the minimum track transverse momentum.");
451+
desc.add<edm::InputTag>("primaryVertex", edm::InputTag("offlinePrimaryVertices"))
452+
->setComment("InputTag for the primary vertex collection.");
453+
desc.add<double>("maximumLongitudinalImpactParameter", 17.0)
454+
->setComment("Set upper threshold for the track transverse impact parameter.");
455+
desc.add<bool>("computeGhostTrack", true)->setComment("Flag to produce ghost track collection.");
456+
desc.add<double>("ghostTrackPriorDeltaR", 0.03)->setComment("Set cone radius for the ghost track fit.");
457+
desc.add<edm::InputTag>("jetTracks", edm::InputTag("ak4JetTracksAssociatorAtVertexPF"))
458+
->setComment("InputTag for the jet-track association collection.");
459+
desc.add<bool>("jetDirectionUsingGhostTrack", false)
460+
->setComment("Flag to build the jet momentum using ghost tracks.");
461+
desc.add<int>("minimumNumberOfPixelHits", 2)
462+
->setComment("Set lower threshold for the number of valid pixel hits per track.");
463+
desc.add<bool>("jetDirectionUsingTracks", false)
464+
->setComment("Flag to include the track momentum into the jet momentum.");
465+
desc.add<bool>("computeProbabilities", true)
466+
->setComment("Flag to produce output probabilities for the tracks to originate from the PV.");
467+
desc.add<bool>("useTrackQuality", false)->setComment("Flag to use the track quality in the probability calculation.");
468+
desc.add<double>("maximumChiSquared", 5.0)->setComment("Set upper threshold for the track normalized chi2.");
469+
descriptions.addWithDefaultLabel(desc);
461470
}
462471

463472
template <>
464473
inline void
465474
IPProducer<std::vector<reco::CandidatePtr>, reco::JetTagInfo, IPProducerHelpers::FromJetAndCands>::fillDescriptions(
466475
edm::ConfigurationDescriptions& descriptions) {
467476
edm::ParameterSetDescription desc;
468-
desc.add<double>("maximumTransverseImpactParameter", 0.2);
469-
desc.add<int>("minimumNumberOfHits", 8);
470-
desc.add<double>("minimumTransverseMomentum", 1.0);
471-
desc.add<edm::InputTag>("primaryVertex", edm::InputTag("offlinePrimaryVertices"));
472-
desc.add<double>("maximumLongitudinalImpactParameter", 17.0);
473-
desc.add<bool>("computeGhostTrack", true);
474-
desc.add<double>("maxDeltaR", 0.4);
475-
desc.add<edm::InputTag>("candidates", edm::InputTag("particleFlow"));
476-
desc.add<bool>("jetDirectionUsingGhostTrack", false);
477-
desc.add<int>("minimumNumberOfPixelHits", 2);
478-
desc.add<bool>("jetDirectionUsingTracks", false);
479-
desc.add<bool>("computeProbabilities", true);
480-
desc.add<bool>("useTrackQuality", false);
481-
desc.add<edm::InputTag>("jets", edm::InputTag("ak4PFJetsCHS"));
482-
desc.add<double>("ghostTrackPriorDeltaR", 0.03);
483-
desc.add<double>("maximumChiSquared", 5.0);
484-
desc.addOptional<bool>("explicitJTA", false);
485-
descriptions.addDefault(desc);
477+
desc.add<double>("maximumTransverseImpactParameter", 0.2)
478+
->setComment("Set upper threshold for the track transverse impact parameter.");
479+
desc.add<int>("minimumNumberOfHits", 8)->setComment("Set lower threshold for the number of valid hits per track.");
480+
desc.add<double>("minimumTransverseMomentum", 1.0)
481+
->setComment("Set lower threshold for the minimum track transverse momentum.");
482+
desc.add<edm::InputTag>("primaryVertex", edm::InputTag("offlinePrimaryVertices"))
483+
->setComment("InputTag for the primary vertex collection.");
484+
desc.add<double>("maximumLongitudinalImpactParameter", 17.0)
485+
->setComment("Set upper threshold for the track transverse impact parameter.");
486+
desc.add<bool>("computeGhostTrack", true)->setComment("Flag to produce ghost track collection.");
487+
desc.add<double>("maxDeltaR", 0.4)
488+
->setComment("Set upper threshold for the maximum distance between tracks and jets.");
489+
desc.add<edm::InputTag>("candidates", edm::InputTag("particleFlow"))
490+
->setComment("InputTag for the particle flow candidate collection.");
491+
desc.add<bool>("jetDirectionUsingGhostTrack", false)
492+
->setComment("Flag to build the jet momentum using ghost tracks.");
493+
desc.add<int>("minimumNumberOfPixelHits", 2)
494+
->setComment("Set lower threshold for the number of valid pixel hits per track.");
495+
desc.add<bool>("jetDirectionUsingTracks", false)
496+
->setComment("Flag to include the track momentum into the jet momentum.");
497+
desc.add<bool>("computeProbabilities", true)
498+
->setComment("Flag to produce output probabilities for the tracks to originate from the PV.");
499+
desc.add<bool>("useTrackQuality", false)->setComment("Flag to use the track quality in the probability calculation.");
500+
desc.add<edm::InputTag>("jets", edm::InputTag("ak4PFJetsCHS"))->setComment("InputTag for the jet collection.");
501+
desc.add<double>("ghostTrackPriorDeltaR", 0.03)->setComment("Set cone radius for the ghost track fit.");
502+
desc.add<double>("maximumChiSquared", 5.0)->setComment("Set upper threshold for the track normalized chi2.");
503+
desc.addOptional<bool>("explicitJTA", false)->setComment("Flag to explicitly assign jets to tracks.");
504+
descriptions.addWithDefaultLabel(desc);
486505
}
487506

488507
#endif

RecoBTag/SecondaryVertex/plugins/TemplatedSecondaryVertexProducer.cc

+45-21
Original file line numberDiff line numberDiff line change
@@ -1215,8 +1215,10 @@ void TemplatedSecondaryVertexProducer<IPTI, VTX>::matchSubjets(const edm::Handle
12151215
template <class IPTI, class VTX>
12161216
void TemplatedSecondaryVertexProducer<IPTI, VTX>::fillDescriptions(edm::ConfigurationDescriptions &descriptions) {
12171217
edm::ParameterSetDescription desc;
1218-
desc.add<double>("extSVDeltaRToJet", 0.3);
1219-
desc.add<edm::InputTag>("beamSpotTag", edm::InputTag("offlineBeamSpot"));
1218+
desc.add<double>("extSVDeltaRToJet", 0.3)
1219+
->setComment("Minimum distance between jets and external secondary vertex collection, if provided.");
1220+
desc.add<edm::InputTag>("beamSpotTag", edm::InputTag("offlineBeamSpot"))
1221+
->setComment("InputTag for the beamspot collection.");
12201222
{
12211223
edm::ParameterSetDescription vertexReco;
12221224
vertexReco.add<double>("primcut", 1.8);
@@ -1231,15 +1233,21 @@ void TemplatedSecondaryVertexProducer<IPTI, VTX>::fillDescriptions(edm::Configur
12311233
edm::ParameterDescription<double>("mergeThreshold", 3.0, true) and
12321234
edm::ParameterDescription<std::string>("fitType", "RefitGhostTrackWithVertices", true),
12331235
true);
1234-
desc.add<edm::ParameterSetDescription>("vertexReco", vertexReco);
1236+
desc.add<edm::ParameterSetDescription>("vertexReco", vertexReco)
1237+
->setComment("ParameterSet to steer the secondary vertex reconstruction parameters.");
12351238
}
12361239
{
12371240
edm::ParameterSetDescription vertexSelection;
12381241
vertexSelection.add<std::string>("sortCriterium", "dist3dError");
1239-
desc.add<edm::ParameterSetDescription>("vertexSelection", vertexSelection);
1242+
desc.add<edm::ParameterSetDescription>("vertexSelection", vertexSelection)
1243+
->setComment("ParameterSet steering the secondary vertex sorting.");
12401244
}
1241-
desc.add<std::string>("constraint", "BeamSpot");
1242-
desc.add<edm::InputTag>("trackIPTagInfos", edm::InputTag("impactParameterTagInfos"));
1245+
desc.add<std::string>("constraint", "BeamSpot")
1246+
->setComment(
1247+
"Option to set any constraint for the SV fit. Options are 'None', 'BeamSpot' (default), "
1248+
"'BeamSpot+PVPosition', 'BeamSpotZ+PVErrorScaledXY', 'PVErrorScaled', and 'BeamSpot+PVTracksInFit'.");
1249+
desc.add<edm::InputTag>("trackIPTagInfos", edm::InputTag("impactParameterTagInfos"))
1250+
->setComment("InputTag for the track impact parameter information collection.");
12431251
{
12441252
edm::ParameterSetDescription vertexCuts;
12451253
vertexCuts.add<double>("distSig3dMax", 99999.9);
@@ -1261,11 +1269,13 @@ void TemplatedSecondaryVertexProducer<IPTI, VTX>::fillDescriptions(edm::Configur
12611269
vertexCuts.add<double>("distVal3dMin", -99999.9);
12621270
vertexCuts.add<double>("massMax", 6.5);
12631271
vertexCuts.add<double>("distSig3dMin", -99999.9);
1264-
desc.add<edm::ParameterSetDescription>("vertexCuts", vertexCuts);
1272+
desc.add<edm::ParameterSetDescription>("vertexCuts", vertexCuts)
1273+
->setComment("ParameterSet steering the secondary vertex selection.");
12651274
}
1266-
desc.add<bool>("useExternalSV", false);
1267-
desc.add<double>("minimumTrackWeight", 0.5);
1268-
desc.add<bool>("usePVError", true);
1275+
desc.add<bool>("useExternalSV", false)
1276+
->setComment("Flag to consider an external secondary vertex collection as input.");
1277+
desc.add<double>("minimumTrackWeight", 0.5)->setComment("Setting a lower threshold for the track weight.");
1278+
desc.add<bool>("usePVError", true)->setComment("Flag to consider the error on the PV.");
12691279
{
12701280
edm::ParameterSetDescription trackSelection;
12711281
trackSelection.add<double>("b_pT", 0.3684);
@@ -1294,21 +1304,35 @@ void TemplatedSecondaryVertexProducer<IPTI, VTX>::fillDescriptions(edm::Configur
12941304
trackSelection.add<double>("sip3dSigMax", 99999.9);
12951305
trackSelection.add<double>("sip2dSigMin", -99999.9);
12961306
trackSelection.add<double>("b_dR", 0.6263);
1297-
desc.add<edm::ParameterSetDescription>("trackSelection", trackSelection);
1307+
desc.add<edm::ParameterSetDescription>("trackSelection", trackSelection)
1308+
->setComment("ParameterSet steering the track selection.");
12981309
}
1299-
desc.add<std::string>("trackSort", "sip3dSig");
1300-
desc.add<edm::InputTag>("extSVCollection", edm::InputTag("secondaryVertices"));
1310+
desc.add<std::string>("trackSort", "sip3dSig")->setComment("Set the sorting of the tracks, default is 'sip3dSig'.");
1311+
desc.add<edm::InputTag>("extSVCollection", edm::InputTag("secondaryVertices"))
1312+
->setComment("InputTag for an (optional) external secondary vertex collection.");
13011313
desc.addOptionalNode(edm::ParameterDescription<bool>("useSVClustering", false, true) and
13021314
edm::ParameterDescription<std::string>("jetAlgorithm", true) and
13031315
edm::ParameterDescription<double>("rParam", true),
1304-
true);
1305-
desc.addOptional<bool>("useSVMomentum", false);
1306-
desc.addOptional<double>("ghostRescaling", 1e-18);
1307-
desc.addOptional<double>("relPtTolerance", 1e-03);
1308-
desc.addOptional<edm::InputTag>("fatJets");
1309-
desc.addOptional<edm::InputTag>("groomedFatJets");
1310-
desc.add<edm::InputTag>("weights", edm::InputTag(""));
1311-
descriptions.addDefault(desc);
1316+
true)
1317+
->setComment("Optional ParameterSet to steer any secondary vertex reclustering.");
1318+
desc.addOptional<bool>("useSVMomentum", false)
1319+
->setComment(
1320+
"Flag to consider the secondary vertex momentum instead of the direction only for the ghost clustering.");
1321+
desc.addOptional<double>("ghostRescaling", 1e-18)
1322+
->setComment("Parameter to scale down the secondary vertex momentum for the ghost clustering.");
1323+
desc.addOptional<double>("relPtTolerance", 1e-03)
1324+
->setComment("Tolerance for relative difference in transverse momentum for the ghost clustering.");
1325+
desc.addOptional<double>("pvErrorScaling", 1.0)
1326+
->setComment(
1327+
"Scaling of the primary vertex error if 'PVErrorScaled' or 'BeamSpotZ+PVErrorScaledXY' is set for the "
1328+
"constraint.");
1329+
desc.addOptional<edm::InputTag>("fatJets")->setComment(
1330+
"InputTag for any fatjet collection to cluster secondary vertices.");
1331+
desc.addOptional<edm::InputTag>("groomedFatJets")
1332+
->setComment("InputTag for any groomed fatjet collection to cluster secondary vertices.");
1333+
desc.add<edm::InputTag>("weights", edm::InputTag(""))
1334+
->setComment("InputTag for any weight collection, e.g., from PUPPI.");
1335+
descriptions.addWithDefaultLabel(desc);
13121336
}
13131337

13141338
//define this as a plug-in

0 commit comments

Comments
 (0)