59 token_primaryVertex(consumes<
reco::
VertexCollection>(params.getParameter<edm::InputTag>(
"primaryVertices"))),
60 token_secondaryVertex(consumes<
reco::
VertexCollection>(params.getParameter<edm::InputTag>(
"secondaryVertices"))),
61 minDRForUnique(params.getUntrackedParameter<double>(
"minDRUnique",0.4)),
62 vecSumIMCUTForUnique(params.getUntrackedParameter<double>(
"minvecSumIMifsmallDRUnique",5.5)),
63 minCosPAtomerge(params.getUntrackedParameter<double>(
"minCosPAtomerge",0.99)),
64 maxPtreltomerge(params.getUntrackedParameter<double>(
"maxPtreltomerge",7777.0))
68 produces<reco::VertexCollection>();
78 if(PVcoll->size()!=0) {
90 std::vector<vertexProxy> vertexProxyColl;
91 for(std::vector<reco::Vertex>::const_iterator sv = secondaryVertices->begin();
92 sv != secondaryVertices->end(); ++sv) {
93 vertexProxy vtx = {*sv,(*sv).p4().M(),(*sv).tracksSize()};
94 vertexProxyColl.push_back( vtx );
98 sort( vertexProxyColl.begin(), vertexProxyColl.end());
102 for(
unsigned int iVtx=0; iVtx < vertexProxyColl.size(); iVtx++){
106 for(
unsigned int kVtx=vertexProxyColl.size()-1; kVtx>iVtx; kVtx--){
114 for(std::vector<vertexProxy>::iterator it=vertexProxyColl.begin(); it!=vertexProxyColl.end(); it++) bvertices->push_back((*it).vert);
115 std::auto_ptr<VertexCollection> bvertColl(bvertices);
116 iEvent.
put(bvertColl);
120 iEvent.
put(bvertCollEmpty);
127 using namespace reco;
146 momentumNear = momentum2;
147 momentumFar = momentum1;
152 double cosPA = nearToFar.dot(momentumFar) / momentumFar.mag()/ nearToFar.mag();
153 double cosa = pvToNear.
dot(momentumFar) / pvToNear.mag() / momentumFar.mag();
154 double ptrel =
sqrt(1.0 - cosa*cosa)* momentumFar.mag();
159 std::set<reco::TrackRef> trackrefs;
162 if(sv1.trackWeight(*ti)>0.5){
176 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> > mother;
177 for(std::set<reco::TrackRef>::const_iterator it = trackrefs.begin(); it!= trackrefs.end(); it++){
178 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> >
temp ( (*it)->px(),(*it)->py(),(*it)->pz(), 0.13957 );
189 bool bFoundDuplicate=
false;
193 else bFoundDuplicate=
true;
200 std::vector<TrackBaseRef >
tracks_;
201 std::vector<Track> refittedTracks_;
202 std::vector<float> weights_;
204 tracks_.push_back( *it);
205 refittedTracks_.push_back( coll[i].vert.refittedTrack(*it));
206 weights_.push_back( coll[i].vert.trackWeight(*it) );
209 coll[
i].vert.removeTracks();
210 std::vector<Track>::iterator it2 = refittedTracks_.begin();
211 std::vector<float>::iterator it3 = weights_.begin();
215 Track refittedTrackWithLargerWeight = *it2;
216 if( weight2 >weight) {
220 coll[
i].vert.add(*it , refittedTrackWithLargerWeight , weight);
225 coll.erase( coll.begin() +
k );
const std::vector< reco::PFCandidatePtr > & tracks_
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
trackRef_iterator tracks_end() const
last iterator over tracks
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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
double vecSumIMCUTForUnique
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>
trackRef_iterator tracks_begin() const
first iterator over tracks
edm::EDGetTokenT< reco::VertexCollection > token_secondaryVertex
Global3DVector GlobalVector