1 #ifndef InclusiveVertexFinder_h
2 #define InclusiveVertexFinder_h
35 template <
class InputContainer,
class VTX>
63 std::auto_ptr<VertexReconstructor>
vtxReco;
67 template <
class InputContainer,
class VTX>
69 minHits(params.getParameter<unsigned int>(
"minHits")),
70 maxNTracks(params.getParameter<unsigned int>(
"maxNTracks")),
71 maxLIP(params.getParameter<double>(
"maximumLongitudinalImpactParameter")),
72 minPt(params.getParameter<double>(
"minPt")),
73 vertexMinAngleCosine(params.getParameter<double>(
"vertexMinAngleCosine")),
74 vertexMinDLen2DSig(params.getParameter<double>(
"vertexMinDLen2DSig")),
75 vertexMinDLenSig(params.getParameter<double>(
"vertexMinDLenSig")),
76 fitterSigmacut(params.getParameter<double>(
"fitterSigmacut")),
77 fitterTini(params.getParameter<double>(
"fitterTini")),
78 fitterRatio(params.getParameter<double>(
"fitterRatio")),
79 useVertexFitter(params.getParameter<bool>(
"useDirectVertexFitter")),
80 useVertexReco(params.getParameter<bool>(
"useVertexReco")),
91 template <
class InputContainer,
class VTX>
96 if (track.
pt() < minPt )
102 template <
class InputContainer,
class VTX>
105 using namespace reco;
119 event.getByToken(token_beamSpot,
beamSpot);
122 event.getByToken(token_primaryVertex, primaryVertices);
125 event.getByToken(token_tracks,
tracks);
132 std::auto_ptr<Product> recoVertices(
new Product);
133 if(primaryVertices->size()!=0) {
138 std::vector<TransientTrack> tts;
140 for(
typename InputContainer::const_iterator track =
tracks->begin();
141 track !=
tracks->end(); ++track) {
153 std::vector<TracksClusteringFromDisplacedSeed::Cluster> clusters = clusterizer->clusters(pv,tts);
157 for(
unsigned int i = 0;
i < 7;
i++) {
158 for(
unsigned int j = 0;
j < 7;
j++) {
171 std::cout <<
"CLUSTERS " << clusters.size() << std::endl;
174 for(std::vector<TracksClusteringFromDisplacedSeed::Cluster>::iterator cluster = clusters.begin();
175 cluster != clusters.end(); ++cluster,++
i)
177 if(cluster->tracks.size() < 2 || cluster->tracks.size() > maxNTracks )
179 std::vector<TransientVertex> vertices;
181 vertices = vtxReco->vertices(cluster->tracks, bs);
184 if(useVertexFitter) {
185 singleFitVertex = theAdaptiveFitter.
vertex(cluster->tracks,cluster->seedPoint);
187 vertices.push_back(singleFitVertex);
189 for(std::vector<TransientVertex>::const_iterator
v = vertices.begin();
190 v != vertices.end(); ++
v) {
195 std::cout <<
"V chi2/n: " <<
v->normalisedChiSquared() <<
" ndof: " <<
v->degreesOfFreedom() ;
198 std::cout <<
" pos: " << vv.position() <<
" error: " <<vv.xError() <<
" " << vv.yError() <<
" " << vv.zError() << std::endl;
201 std::vector<reco::TransientTrack> ts =
v->originalTracks();
202 for(std::vector<reco::TransientTrack>::const_iterator i = ts.begin();
203 i != ts.end(); ++
i) {
204 float w =
v->trackWeight(*i);
205 if (w > 0.5) dir+=i->impactPointState().globalDirection();
207 std::cout <<
"\t[" << (*i).track().pt() <<
": "
208 << (*i).track().eta() <<
", "
209 << (*i).track().phi() <<
"], "
213 GlobalPoint sv((*v).position().x(),(*v).position().y(),(*v).position().z());
216 if(dlen.
significance() > vertexMinDLenSig && vscal > vertexMinAngleCosine &&
v->normalisedChiSquared() < 10 && dlen2.
significance() > vertexMinDLen2DSig)
218 recoVertices->push_back(*
v);
228 std::cout <<
"Final put " << recoVertices->size() << std::endl;
232 event.put(recoVertices);
math::Error< dimension >::type CovarianceMatrix
T getParameter(std::string const &) const
std::vector< VTX > Product
std::auto_ptr< TracksClusteringFromDisplacedSeed > clusterizer
void setBeamSpot(const reco::BeamSpot &beamSpot)
bool isValid() const
Make the ReferenceCountingProxy method to check validity public.
int numberOfValidHits() const
std::pair< std::vector< reco::TransientTrack >, GlobalPoint > nearTracks(const reco::TransientTrack &seed, const std::vector< reco::TransientTrack > &tracks, const reco::Vertex &primaryVertex) const
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
InputContainer::value_type TRK
const Point & position() const
position
double pt() const
track transverse momentum
virtual CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &) const
Abs< T >::type abs(const T &t)
double vertexMinAngleCosine
edm::EDGetTokenT< InputContainer > token_tracks
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
Container::value_type value_type
bool trackFilter(const reco::Track &track) const
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...
Vector3DBase unit() const
double significance() const
virtual void produce(edm::Event &event, const edm::EventSetup &es) override
const Track & track() const
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
double vertexMinDLen2DSig
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
TemplatedInclusiveVertexFinder(const edm::ParameterSet ¶ms)
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
std::auto_ptr< VertexReconstructor > vtxReco
reco::TransientTrack buildTT(edm::Handle< reco::TrackCollection > &tracks, edm::ESHandle< TransientTrackBuilder > &trackbuilder, unsigned int k)