72 iConfig.getParameter<
edm::
InputTag>(
"PFTauPVATag"))),
74 iConfig.getParameter<
edm::
InputTag>(
"PFTauSVATag"))),
75 useFullCalculation_(iConfig.getParameter<
bool>(
"useFullCalculation")) {
76 produces<edm::AssociationVector<PFTauRefProd, std::vector<reco::PFTauTransverseImpactParameterRef>>>();
77 produces<PFTauTransverseImpactParameterCollection>(
"PFTauTIP");
85 if (pfCandPtr !=
nullptr) {
117 std::make_unique<edm::AssociationVector<PFTauRefProd, std::vector<reco::PFTauTransverseImpactParameterRef>>>(
119 auto TIPCollection_out = std::make_unique<PFTauTransverseImpactParameterCollection>();
128 const std::vector<reco::VertexRef>
SV = PFTauSVA->value(RefPFTau.
key());
129 double dxy(-999), dxy_err(-999);
131 double ip3d(-999), ip3d_err(-999);
133 if (RefPFTau->leadChargedHadrCand().
isNonnull()) {
135 if (
track !=
nullptr) {
139 RefPFTau->p4().px(), RefPFTau->p4().py(), RefPFTau->p4().pz());
140 std::pair<bool, Measurement1D> signed_IP2D =
142 dxy = signed_IP2D.second.value();
143 dxy_err = signed_IP2D.second.error();
145 ip3d = signed_IP3D.second.value();
146 ip3d_err = signed_IP3D.second.error();
158 dxy_err =
track->d0Error();
160 ip3d_err =
track->dzError();
170 cov(
i,
j) =
SV.at(0)->covariance(
i,
j) +
PV->covariance(
i,
j);
173 GlobalVector direction(RefPFTau->px(), RefPFTau->py(), RefPFTau->pz());
174 double vSig = SecondaryVertex::computeDist3d(*
PV, *
SV.at(0), direction,
true).
significance();
178 TIPCollection_out->push_back(TIPV);
179 AVPFTauTIP->setValue(iPFTau, TIPVRef);
184 TIPCollection_out->push_back(TIPV);
185 AVPFTauTIP->setValue(iPFTau, TIPVRef);
197 desc.add<
bool>(
"useFullCalculation",
false);
200 descriptions.
add(
"PFTauTransverseImpactParameters",
desc);