1 #ifndef InclusiveVertexFinder_h 2 #define InclusiveVertexFinder_h 37 #include <type_traits> 40 template <
class InputContainer,
class VTX>
53 pdesc.
add<
unsigned int>(
"minHits",8);
56 pdesc.
add<
unsigned int>(
"minHits",0);
61 pdesc.
add<
double>(
"maximumLongitudinalImpactParameter",0.3);
62 pdesc.
add<
double>(
"maximumTimeSignificance",3.0);
63 pdesc.
add<
double>(
"minPt",0.8);
64 pdesc.
add<
unsigned int>(
"maxNTracks",30);
67 clusterizer.add<
double>(
"seedMax3DIPSignificance",9999.0);
68 clusterizer.add<
double>(
"seedMax3DIPValue",9999.0);
69 clusterizer.add<
double>(
"seedMin3DIPSignificance",1.2);
70 clusterizer.add<
double>(
"seedMin3DIPValue",0.005);
71 clusterizer.add<
double>(
"clusterMaxDistance",0.05);
72 clusterizer.add<
double>(
"clusterMaxSignificance",4.5);
73 clusterizer.add<
double>(
"distanceRatio",20.0);
74 clusterizer.add<
double>(
"clusterMinAngleCosine",0.5);
75 clusterizer.add<
double>(
"maxTimeSignificance",3.5);
78 pdesc.
add<
double>(
"vertexMinAngleCosine",0.95);
79 pdesc.
add<
double>(
"vertexMinDLen2DSig",2.5);
80 pdesc.
add<
double>(
"vertexMinDLenSig",0.5);
81 pdesc.
add<
double>(
"fitterSigmacut",3.0);
82 pdesc.
add<
double>(
"fitterTini",256.0);
83 pdesc.
add<
double>(
"fitterRatio",0.25);
84 pdesc.
add<
bool>(
"useDirectVertexFitter",
true);
85 pdesc.
add<
bool>(
"useVertexReco",
true);
89 vertexReco.add<
double>(
"primcut",1.0);
90 vertexReco.add<
double>(
"seccut",3.0);
91 vertexReco.add<
bool>(
"smoothing",
true);
94 cdesc.
add(
"inclusiveVertexFinderDefault",pdesc);
96 cdesc.
add(
"inclusiveCandidateVertexFinderDefault",pdesc);
128 template <
class InputContainer,
class VTX>
130 minHits(params.getParameter<unsigned
int>(
"minHits")),
132 maxLIP(params.getParameter<double>(
"maximumLongitudinalImpactParameter")),
133 maxTimeSig(params.getParameter<double>(
"maximumTimeSignificance")),
134 minPt(params.getParameter<double>(
"minPt")),
139 fitterTini(params.getParameter<double>(
"fitterTini")),
140 fitterRatio(params.getParameter<double>(
"fitterRatio")),
153 template <
class InputContainer,
class VTX>
164 template <
class InputContainer,
class VTX>
167 using namespace reco;
194 auto recoVertices = std::make_unique<Product>();
195 if(primaryVertices->size()!=0) {
200 std::vector<TransientTrack> tts;
202 for(
typename InputContainer::const_iterator
track = tracks->begin();
220 std::vector<TracksClusteringFromDisplacedSeed::Cluster>
clusters =
clusterizer->clusters(pv,tts);
224 for(
unsigned int i = 0;
i < 7;
i++) {
225 for(
unsigned int j = 0; j < 7; j++) {
238 std::cout <<
"CLUSTERS " << clusters.size() << std::endl;
241 for(std::vector<TracksClusteringFromDisplacedSeed::Cluster>::iterator cluster = clusters.begin();
242 cluster != clusters.end(); ++cluster,++
i)
244 if(cluster->tracks.size() < 2 || cluster->tracks.size() >
maxNTracks )
246 std::vector<TransientVertex>
vertices;
248 vertices =
vtxReco->vertices(cluster->tracks, bs);
252 singleFitVertex = theAdaptiveFitter.
vertex(cluster->tracks,cluster->seedPoint);
254 vertices.push_back(singleFitVertex);
259 for(
auto&
vtx : vertices) {
264 for(std::vector<TransientVertex>::const_iterator
v = vertices.begin();
265 v != vertices.end(); ++
v) {
270 std::cout <<
"V chi2/n: " <<
v->normalisedChiSquared() <<
" ndof: " <<
v->degreesOfFreedom() ;
273 std::cout <<
" pos: " << vv.position() <<
" error: " <<vv.xError() <<
" " << vv.yError() <<
" " << vv.zError() << std::endl;
274 std::cout <<
" time: " << vv.time() <<
" error: " << vv.tError() << std::endl;
277 std::vector<reco::TransientTrack> ts =
v->originalTracks();
278 for(std::vector<reco::TransientTrack>::const_iterator i = ts.begin();
279 i != ts.end(); ++
i) {
280 float w =
v->trackWeight(*i);
281 if (w > 0.5) dir+=i->impactPointState().globalDirection();
283 std::cout <<
"\t[" << (*i).track().pt() <<
": " 284 << (*i).track().eta() <<
", " 285 << (*i).track().phi() <<
"], " 289 GlobalPoint sv((*v).position().x(),(*v).position().y(),(*v).position().z());
295 recoVertices->push_back(*
v);
306 std::cout <<
"Final put " << recoVertices->size() << std::endl;
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
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &) const override
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
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
Container::value_type value_type
void addDefault(ParameterSetDescription const &psetDescription)
double pt() const
track transverse momentum
Abs< T >::type abs(const T &t)
double vertexMinAngleCosine
edm::EDGetTokenT< InputContainer > token_tracks
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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
double dtErrorExt() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void updateVertexTime(TransientVertex &vtx)
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)
static void fillDescriptions(edm::ConfigurationDescriptions &cdesc)
Power< A, B >::type pow(const A &a, const B &b)
double t() const
t coordinate