72 iConfig.getParameter<edm::
InputTag>(
"PFTauPVATag"))),
74 iConfig.getParameter<edm::
InputTag>(
"PFTauSVATag"))),
76 useFullCalculation_(
iConfig.getParameter<
bool>(
"useFullCalculation")) {
77 produces<edm::AssociationVector<PFTauRefProd, std::vector<reco::PFTauTransverseImpactParameterRef>>>();
78 produces<PFTauTransverseImpactParameterCollection>(
"PFTauTIP");
86 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();
159 dxy = track->
dxy(PV->position());
161 ip3d = track->
dz(PV->position());
167 reco::Vertex::Point v(SV.at(0)->x() - PV->x(), SV.at(0)->y() - PV->y(), SV.at(0)->z() - PV->z());
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);
reco::Vertex::Point convertPos(const GlobalPoint &p)
double d0Error() const
error on d0
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool isNonnull() const
Checks for non-null.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
const MagneticField * field() const
key_type key() const
Accessor for product key.
edm::RefProd< PFTauCollection > PFTauRefProd
references to PFTau collection
math::Error< dimension >::type CovarianceMatrix
covariance error matrix (3x3)
edm::EDGetTokenT< std::vector< reco::PFTau > > PFTauToken_
reco::TrackRef trackRef() const
bool getData(T &iHolder) const
edm::EDGetTokenT< edm::AssociationVector< PFTauRefProd, std::vector< reco::VertexRef > > > PFTauPVAToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual const reco::Track & pseudoTrack() const
~PFTauTransverseImpactParameters() override
math::XYZPoint Point
point in the space
T const * get() const
Returns C++ pointer to the item.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
RefProd< PROD > getRefBeforePut()
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transTrackBuilderToken_
bool hasTrackDetails() const
Return true if a bestTrack can be extracted from this Candidate.
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
double dzError() const
error on dz
edm::EDGetTokenT< edm::AssociationVector< PFTauRefProd, std::vector< std::vector< reco::VertexRef > > > > PFTauSVAToken_
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::Ref< PFTauTransverseImpactParameterCollection > PFTauTransverseImpactParameterRef
presistent reference to a PFTauTransverseImpactParameter
PFTauTransverseImpactParameters(const edm::ParameterSet &iConfig)
Particle reconstructed by the particle flow algorithm.
reco::GsfTrackRef gsfTrackRef() const
TrajectoryStateOnSurface impactPointState() const
std::vector< reco::PFTauTransverseImpactParameter > PFTauTransverseImpactParameterCollection
collection of PFTauTransverseImpactParameter objects
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
void produce(edm::Event &, const edm::EventSetup &) override