61 primaryVertexCollection(params.getParameter<edm::InputTag>(
"primaryVertices")),
62 secondaryVertexCollection(params.getParameter<edm::InputTag>(
"secondaryVertices")),
63 minDRForUnique(params.getUntrackedParameter<double>(
"minDRUnique",0.4)),
64 vecSumIMCUTForUnique(params.getUntrackedParameter<double>(
"minvecSumIMifsmallDRUnique",5.5)),
65 minCosPAtomerge(params.getUntrackedParameter<double>(
"minCosPAtomerge",0.99)),
66 maxPtreltomerge(params.getUntrackedParameter<double>(
"maxPtreltomerge",7777.0))
70 produces<reco::VertexCollection>();
80 if(PVcoll->size()!=0) {
92 std::vector<vertexProxy> vertexProxyColl;
93 for(std::vector<reco::Vertex>::const_iterator sv = secondaryVertices->begin();
94 sv != secondaryVertices->end(); ++sv) {
95 vertexProxy vtx = {*sv,(*sv).p4().M(),(*sv).tracksSize()};
96 vertexProxyColl.push_back( vtx );
100 sort( vertexProxyColl.begin(), vertexProxyColl.end());
104 for(
unsigned int iVtx=0; iVtx < vertexProxyColl.size(); iVtx++){
108 for(
unsigned int kVtx=vertexProxyColl.size()-1; kVtx>iVtx; kVtx--){
116 for(std::vector<vertexProxy>::iterator it=vertexProxyColl.begin(); it!=vertexProxyColl.end(); it++) bvertices->push_back((*it).vert);
117 std::auto_ptr<VertexCollection> bvertColl(bvertices);
118 iEvent.
put(bvertColl);
122 iEvent.
put(bvertCollEmpty);
129 using namespace reco;
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){
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;
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();
217 Track refittedTrackWithLargerWeight = *it2;
218 if( weight2 >weight) {
222 coll[
i].vert.add(*it , refittedTrackWithLargerWeight , weight);
227 coll.erase( coll.begin() +
k );
edm::InputTag primaryVertexCollection
trackRef_iterator tracks_end() const
last iterator over tracks
Measurement1D dist3d() const
Track refittedTrack(const TrackBaseRef &track) const
#define DEFINE_FWK_MODULE(type)
void resolveBtoDchain(std::vector< vertexProxy > &coll, unsigned int i, unsigned int k)
virtual void produce(edm::Event &event, const edm::EventSetup &es)
std::vector< Vertex > VertexCollection
collection of Vertex objects
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const Point & position() const
position
GlobalVector flightDirection(reco::Vertex &pv, reco::Vertex &sv)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
float trackWeight(const TrackBaseRef &r) const
returns the weight with which a Track has contributed to the vertex-fit.
friend bool operator<(vertexProxy v1, vertexProxy v2)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double vecSumIMCUTForUnique
edm::InputTag secondaryVertexCollection
BtoCharmDecayVertexMerger(const edm::ParameterSet ¶ms)
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_
trackRef_iterator tracks_begin() const
first iterator over tracks
Global3DVector GlobalVector