129 using namespace reco;
145 if(sv1.dist3d().value() >= sv2.dist3d().value()){
148 momentumNear = momentum2;
149 momentumFar = momentum1;
154 double cosPA = nearToFar.dot(momentumFar) / momentumFar.mag()/ nearToFar.mag();
155 double cosa = pvToNear.
dot(momentumFar) / pvToNear.mag() / momentumFar.mag();
156 double ptrel =
sqrt(1.0 - cosa*cosa)* momentumFar.mag();
161 std::set<reco::TrackRef> trackrefs;
164 if(sv1.trackWeight(*ti)>0.5){
171 if(sv2.trackWeight(*ti)>0.5){
178 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> > mother;
179 for(std::set<reco::TrackRef>::const_iterator it = trackrefs.begin(); it!= trackrefs.end(); it++){
180 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> >
temp ( (*it)->px(),(*it)->py(),(*it)->pz(), 0.13957 );
191 bool bFoundDuplicate=
false;
194 if (it==sv1.tracks_end())
coll[
i].vert.add( *ti, sv2.refittedTrack(*ti), sv2.trackWeight(*ti) );
195 else bFoundDuplicate=
true;
202 std::vector<TrackBaseRef >
tracks_;
203 std::vector<Track> refittedTracks_;
204 std::vector<float> weights_;
207 refittedTracks_.push_back(
coll[
i].vert.refittedTrack(*it));
208 weights_.push_back(
coll[
i].vert.trackWeight(*it) );
211 coll[
i].vert.removeTracks();
212 std::vector<Track>::iterator it2 = refittedTracks_.begin();
213 std::vector<float>::iterator it3 = weights_.begin();
216 float weight2= sv2.trackWeight(*it);
217 Track refittedTrackWithLargerWeight = *it2;
218 if( weight2 >weight) {
220 refittedTrackWithLargerWeight = sv2.refittedTrack(*it);
222 coll[
i].vert.add(*it , refittedTrackWithLargerWeight , weight);
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
GlobalVector flightDirection(reco::Vertex &pv, reco::Vertex &sv)
double vecSumIMCUTForUnique
double deltaR(const Vector1 &v1, const Vector2 &v2)
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
const reco::PFCandidateRefVector & tracks_
Global3DVector GlobalVector