12 theChi2(0), theNDF(0), vertexValid(
false), withPrior(
false),
13 theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
14 withRefittedTracks(
false)
19 const std::vector<TransientTrack> &
tracks,
float chi2) :
20 theVertexState(pos, posError), theOriginalTracks(tracks),
21 theChi2(chi2), theNDF(0), vertexValid(
true), withPrior(
false),
22 theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
23 withRefittedTracks(
false)
31 const std::vector<TransientTrack> &
tracks,
float chi2,
float ndf) :
32 theVertexState(pos, posError), theOriginalTracks(tracks),
33 theChi2(chi2), theNDF(ndf), vertexValid(
true), withPrior(
false),
34 theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
35 withRefittedTracks(
false)
43 const std::vector<TransientTrack> &
tracks,
float chi2) :
44 thePriorVertexState(priorPos, priorErr), theVertexState(pos, posError),
45 theOriginalTracks(tracks), theChi2(chi2), theNDF(0), vertexValid(
true),
46 withPrior(
true), theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
47 withRefittedTracks(
false)
56 const std::vector<TransientTrack> &
tracks,
float chi2,
float ndf) :
57 thePriorVertexState(priorPos, priorErr), theVertexState(pos, posError),
58 theOriginalTracks(tracks), theChi2(chi2), theNDF(ndf), vertexValid(
true),
59 withPrior(
true), theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
60 withRefittedTracks(
false)
67 const std::vector<TransientTrack> &
tracks,
float chi2) :
68 theVertexState(state), theOriginalTracks(tracks),
69 theChi2(chi2), theNDF(0), vertexValid(
true), withPrior(
false),
70 theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
71 withRefittedTracks(
false)
78 const std::vector<TransientTrack> &
tracks,
float chi2,
float ndf) :
79 theVertexState(state), theOriginalTracks(tracks),
80 theChi2(chi2), theNDF(ndf), vertexValid(
true), withPrior(
false),
81 theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
82 withRefittedTracks(
false)
90 const std::vector<TransientTrack> &
tracks,
92 thePriorVertexState(prior), theVertexState(state),
93 theOriginalTracks(tracks), theChi2(chi2), theNDF(0), vertexValid(
true),
94 withPrior(
true), theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
95 withRefittedTracks(
false)
104 const std::vector<TransientTrack> &
tracks,
105 float chi2,
float ndf) :
106 thePriorVertexState(prior), theVertexState(state),
107 theOriginalTracks(tracks), theChi2(chi2), theNDF(ndf), vertexValid(
true),
108 withPrior(
true), theWeightMapIsAvailable(
false),
109 theCovMapAvailable(
false), withRefittedTracks(
false)
125 if (refittedTracks.empty())
126 throw VertexException(
"TransientVertex::refittedTracks: No refitted tracks stored in input container");
144 TransientTrackToFloatMap::const_iterator it =
theWeightMap.find(track);
156 throw VertexException(
"TransientVertex::Track-to-track covariance matrices not available");
167 TTtoTTmap::const_iterator it =
theCovMap.find(*tr1);
169 const TTmap & tm = it->second;
170 TTmap::const_iterator nit = tm.find(*tr2);
171 if (nit != tm.end()) {
172 return( nit->second);
175 throw VertexException(
"TransientVertex::requested Track-to-track covariance matrix does not exist");
179 throw VertexException(
"TransientVertex::requested Track-to-track covariance matrix does not exist");
188 std::vector<TransientTrack>::const_iterator it =
200 std::vector<TransientTrack>::const_iterator it =
211 if (!isValid())
return Vertex();
215 theVertexState.error().matrix_new(),
216 totalChiSquared(), degreesOfFreedom(), theOriginalTracks.size() );
217 for (std::vector<TransientTrack>::const_iterator
i = theOriginalTracks.begin();
218 i != theOriginalTracks.end(); ++
i) {
224 if (withRefittedTracks) {
226 vertex.
add((*i).trackBaseRef(), refittedTrack(*i).track(),
trackWeight ( *
i ) );
237 using namespace reco;
243 vtxCompPtrCand.setChi2AndNdof(totalChiSquared(), degreesOfFreedom());
247 for(std::vector<reco::TransientTrack>::const_iterator
tt = theOriginalTracks.begin();
tt != theOriginalTracks.end(); ++
tt)
254 edm::LogError(
"DynamicCastingFailed") <<
"Casting of TransientTrack to CandidatePtrTransientTrack failed!";
258 vtxCompPtrCand.addDaughter(cptt->
candidate());
263 vtxCompPtrCand.setP4(
p4);
264 return vtxCompPtrCand;
CandidatePtr candidate() const
bool theWeightMapIsAvailable
std::map< reco::TransientTrack, float > TransientTrackToFloatMap
std::map< reco::TransientTrack, TTmap > TTtoTTmap
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::map< reco::TransientTrack, AlgebraicMatrix33 > TTmap
T x() const
Cartesian x coordinate.
reco::TransientTrack refittedTrack(const reco::TransientTrack &track) const
operator reco::Vertex() const
TransientTrackToFloatMap theWeightMap
math::XYZPoint Point
point in the space
std::vector< reco::TransientTrack > theOriginalTracks
float trackWeight(const reco::TransientTrack &track) const
void add(const TrackBaseRef &r, float w=1.0)
add a reference to a Track
float trackWeight(const reco::Vertex &sv, const reco::TransientTrack &track)
reco::TransientTrack originalTrack(const reco::TransientTrack &refTrack) const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
static int position[264][3]
void setCovariance(const CovarianceMatrix &m)
set covariance matrix
math::XYZPoint Point
point in the space
std::vector< reco::TransientTrack > const & refittedTracks() const
volatile std::atomic< bool > shutdown_flag false
std::vector< reco::TransientTrack > theRefittedTracks
AlgebraicMatrix33 tkToTkCovariance(const reco::TransientTrack &t1, const reco::TransientTrack &t2) const
TransientTrackToFloatMap weightMap() const
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33