15 if (pfCandPtr->trackRef().isNonnull())
16 return pfCandPtr->trackRef().get();
17 else if (pfCandPtr->gsfTrackRef().isNonnull())
18 return pfCandPtr->gsfTrackRef().get();
33 return pfCandPtr->trackRef();
57 edm::LogError(
"QCutsNoPrimaryVertex") <<
"Primary vertex Ref in "
58 <<
"RecoTauQualityCuts is invalid. - minPackedCandVertexWeight";
70 LogDebug(
"TauQCuts") <<
" packedCand: Pt = " << pCand.
pt() <<
", eta = " << pCand.
eta()
71 <<
", phi = " << pCand.
phi();
72 LogDebug(
"TauQCuts") <<
" vertex: x = " << (*pv)->position().x() <<
", y = " << (*pv)->position().y()
73 <<
", z = " << (*pv)->position().z();
74 LogDebug(
"TauQCuts") <<
"--> trackWeight from packedCand = " <<
weight <<
" (cut = " <<
cut <<
")";
86 std::set<std::string> passedOptionSet;
89 for (
auto const&
option : passedOptions) {
90 passedOptionSet.insert(
option);
93 unsigned int nCuts = 0;
94 auto getDouble = [&qcuts, &passedOptionSet, &nCuts](
const std::string&
name) {
97 passedOptionSet.erase(
name);
102 auto getUint = [&qcuts, &passedOptionSet, &nCuts](
const std::string&
name) ->
unsigned int {
105 passedOptionSet.erase(
name);
134 if (!passedOptionSet.empty()) {
136 bool thereIsABadParameter =
false;
137 for (
auto const&
option : passedOptionSet) {
139 if (
option ==
"useTracksInsteadOfPFHadrons") {
141 if (qcuts.
getParameter<
bool>(
"useTracksInsteadOfPFHadrons")) {
142 throw cms::Exception(
"DontUseTracksInQcuts") <<
"The obsolete exception useTracksInsteadOfPFHadrons "
143 <<
"is set to true in the quality cut config." << std::endl;
149 thereIsABadParameter =
true;
151 unParsedOptions +=
option;
152 unParsedOptions +=
"\n";
154 if (thereIsABadParameter) {
155 throw cms::Exception(
"BadQualityCutConfig") <<
" The PSet passed to the RecoTauQualityCuts class had"
156 <<
" the following unrecognized options: " << std::endl
163 throw cms::Exception(
"BadQualityCutConfig") <<
" No options were passed to the quality cut class!" << std::endl;
171 std::vector<std::string> inputNames =
input.getParameterNames();
172 for (
auto const&
cut : inputNames) {
173 if (
cut ==
"minTrackVertexWeight" ||
cut ==
"maxDeltaZ" ||
cut ==
"maxDeltaZToLeadTrack") {
179 return std::make_pair(puCuts, nonPUCuts);
213 edm::LogError(
"QCutsNoPrimaryVertex") <<
"Primary vertex Ref in "
214 <<
"RecoTauQualityCuts is invalid. - filterTrack";
225 edm::LogError(
"QCutsNoValidLeadTrack") <<
"Lead track Ref in "
226 <<
"RecoTauQualityCuts is invalid. - filterTrack";
238 if (
cand.charge() == 0)
241 if (pCand ==
nullptr)
247 if (
track !=
nullptr) {
254 edm::LogError(
"QCutsNoPrimaryVertex") <<
"Primary vertex Ref in "
255 <<
"RecoTauQualityCuts is invalid. - filterChargedCand";
266 edm::LogError(
"QCutsNoValidLeadTrack") <<
"Lead track Ref in "
267 <<
"RecoTauQualityCuts is invalid. - filterChargedCand";
313 auto trackRef = getTrackRef(
cand);
316 if (trackRef.isNonnull()) {
319 auto gsfTrackRef = getGsfTrackRef(
cand);
320 if (gsfTrackRef.isNonnull())
322 else if (
cand.charge() != 0) {
348 desc_signalQualityCuts.
add<
double>(
"minTrackPt", 0.5);
349 desc_signalQualityCuts.
add<
double>(
"maxTrackChi2", 100.0);
350 desc_signalQualityCuts.
add<
double>(
"maxTransverseImpactParameter", 0.1);
351 desc_signalQualityCuts.
add<
double>(
"maxDeltaZ", 0.4);
352 desc_signalQualityCuts.
add<
double>(
"maxDeltaZToLeadTrack", -1.0);
353 desc_signalQualityCuts.
add<
double>(
"minTrackVertexWeight", -1.0);
354 desc_signalQualityCuts.
add<
unsigned int>(
"minTrackPixelHits", 0);
355 desc_signalQualityCuts.
add<
unsigned int>(
"minTrackHits", 3);
356 desc_signalQualityCuts.
add<
double>(
"minGammaEt", 1.0);
357 desc_signalQualityCuts.
addOptional<
bool>(
"useTracksInsteadOfPFHadrons");
358 desc_signalQualityCuts.
add<
double>(
"minNeutralHadronEt", 30.0);
361 desc_isolationQualityCuts.
add<
double>(
"minTrackPt", 1.0);
362 desc_isolationQualityCuts.
add<
double>(
"maxTrackChi2", 100.0);
363 desc_isolationQualityCuts.
add<
double>(
"maxTransverseImpactParameter", 0.03);
364 desc_isolationQualityCuts.
add<
double>(
"maxDeltaZ", 0.2);
365 desc_isolationQualityCuts.
add<
double>(
"maxDeltaZToLeadTrack", -1.0);
366 desc_isolationQualityCuts.
add<
double>(
"minTrackVertexWeight", -1.0);
367 desc_isolationQualityCuts.
add<
unsigned int>(
"minTrackPixelHits", 0);
368 desc_isolationQualityCuts.
add<
unsigned int>(
"minTrackHits", 8);
369 desc_isolationQualityCuts.
add<
double>(
"minGammaEt", 1.5);
370 desc_isolationQualityCuts.
addOptional<
bool>(
"useTracksInsteadOfPFHadrons");
373 desc_vxAssocQualityCuts.
add<
double>(
"minTrackPt", 0.5);
374 desc_vxAssocQualityCuts.add<
double>(
"maxTrackChi2", 100.0);
375 desc_vxAssocQualityCuts.add<
double>(
"maxTransverseImpactParameter", 0.1);
376 desc_vxAssocQualityCuts.add<
double>(
"minTrackVertexWeight", -1.0);
377 desc_vxAssocQualityCuts.add<
unsigned int>(
"minTrackPixelHits", 0);
378 desc_vxAssocQualityCuts.add<
unsigned int>(
"minTrackHits", 3);
379 desc_vxAssocQualityCuts.add<
double>(
"minGammaEt", 1.0);
380 desc_vxAssocQualityCuts.addOptional<
bool>(
"useTracksInsteadOfPFHadrons");
386 desc_qualityCuts.
add<
std::string>(
"pvFindingAlgo",
"closestInDeltaZ");
387 desc_qualityCuts.
add<
bool>(
"vertexTrackFiltering",
false);
388 desc_qualityCuts.
add<
bool>(
"recoverLeadingTrk",
false);
389 desc_qualityCuts.
add<
std::string>(
"leadingTrkOrPFCandOption",
"leadPFCand");