1 #ifndef InclusiveVertexFinder_h 2 #define InclusiveVertexFinder_h 38 #include <type_traits> 41 template <
class InputContainer,
class VTX>
54 pdesc.
add<
unsigned int>(
"minHits", 8);
57 pdesc.
add<
unsigned int>(
"minHits", 0);
62 pdesc.
add<
double>(
"maximumLongitudinalImpactParameter", 0.3);
63 pdesc.
add<
double>(
"maximumTimeSignificance", 3.0);
64 pdesc.
add<
double>(
"minPt", 0.8);
65 pdesc.
add<
unsigned int>(
"maxNTracks", 30);
68 clusterizer.add<
double>(
"seedMax3DIPSignificance", 9999.0);
69 clusterizer.add<
double>(
"seedMax3DIPValue", 9999.0);
70 clusterizer.add<
double>(
"seedMin3DIPSignificance", 1.2);
72 clusterizer.add<
double>(
"clusterMaxDistance", 0.05);
73 clusterizer.add<
double>(
"clusterMaxSignificance", 4.5);
75 clusterizer.add<
double>(
"clusterMinAngleCosine", 0.5);
76 clusterizer.add<
double>(
"maxTimeSignificance", 3.5);
79 pdesc.
add<
double>(
"vertexMinAngleCosine", 0.95);
80 pdesc.
add<
double>(
"vertexMinDLen2DSig", 2.5);
81 pdesc.
add<
double>(
"vertexMinDLenSig", 0.5);
82 pdesc.
add<
double>(
"fitterSigmacut", 3.0);
83 pdesc.
add<
double>(
"fitterTini", 256.0);
84 pdesc.
add<
double>(
"fitterRatio", 0.25);
85 pdesc.
add<
bool>(
"useDirectVertexFitter",
true);
86 pdesc.
add<
bool>(
"useVertexReco",
true);
95 cdesc.
add(
"inclusiveVertexFinderDefault", pdesc);
97 cdesc.
add(
"inclusiveCandidateVertexFinderDefault", pdesc);
108 const std::vector<reco::TransientTrack> &
tracks,
131 template <
class InputContainer,
class VTX>
135 maxLIP(
params.getParameter<double>(
"maximumLongitudinalImpactParameter")),
136 maxTimeSig(
params.getParameter<double>(
"maximumTimeSignificance")),
144 useVertexFitter(
params.getParameter<
bool>(
"useDirectVertexFitter")),
154 esConsumes<TransientTrackBuilder, TransientTrackRecord>(
edm::ESInputTag(
"",
"TransientTrackBuilder"));
158 template <
class InputContainer,
class VTX>
168 template <
class InputContainer,
class VTX>
170 using namespace reco;
182 event.getByToken(token_beamSpot,
beamSpot);
188 event.getByToken(token_tracks,
tracks);
192 auto recoVertices = std::make_unique<Product>();
197 std::vector<TransientTrack> tts;
212 if (dtSig > maxTimeSig)
222 for (
unsigned int i = 0;
i < 7;
i++) {
223 for (
unsigned int j = 0;
j < 7;
j++) {
225 cov(
i,
j) =
pv.covariance(
i,
j);
238 for (std::vector<TracksClusteringFromDisplacedSeed::Cluster>::iterator cluster =
clusters.begin();
241 if (cluster->tracks.size() < 2 || cluster->tracks.size() >
maxNTracks)
243 std::vector<TransientVertex>
vertices;
245 vertices = vtxReco->vertices(cluster->tracks,
bs);
248 if (useVertexFitter) {
249 singleFitVertex = theAdaptiveFitter.
vertex(cluster->tracks, cluster->seedPoint);
251 vertices.push_back(singleFitVertex);
255 if (
pv.covariance(3, 3) > 0.) {
261 for (std::vector<TransientVertex>::const_iterator
v =
vertices.begin();
v !=
vertices.end(); ++
v) {
266 std::cout <<
"V chi2/n: " <<
v->normalisedChiSquared() <<
" ndof: " <<
v->degreesOfFreedom();
270 std::cout <<
" pos: " << vv.position() <<
" error: " << vv.xError() <<
" " << vv.yError() <<
" " << vv.zError()
272 std::cout <<
" time: " << vv.time() <<
" error: " << vv.tError() << std::endl;
275 std::vector<reco::TransientTrack> ts =
v->originalTracks();
276 for (std::vector<reco::TransientTrack>::const_iterator
i = ts.begin();
i != ts.end(); ++
i) {
277 float w =
v->trackWeight(*
i);
279 dir +=
i->impactPointState().globalDirection();
281 std::cout <<
"\t[" << (*i).track().pt() <<
": " << (*i).track().eta() <<
", " << (*i).track().phi() <<
"], " 285 GlobalPoint sv((*v).position().x(), (*v).position().y(), (*v).position().z());
286 float vscal =
dir.unit().dot((
sv - ppv).
unit());
290 recoVertices->push_back(*
v);
300 std::cout <<
"Final put " << recoVertices->size() << std::endl;
math::Error< dimension >::type CovarianceMatrix
std::vector< VTX > Product
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
std::unique_ptr< VertexReconstructor > vtxReco
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &) const override
InputContainer::value_type TRK
constexpr bool isFinite(T x)
std::unique_ptr< TracksClusteringFromDisplacedSeed > clusterizer
Container::value_type value_type
void addDefault(ParameterSetDescription const &psetDescription)
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > token_trackBuilder
Abs< T >::type abs(const T &t)
double vertexMinAngleCosine
edm::EDGetTokenT< InputContainer > token_tracks
bool trackFilter(const reco::Track &track) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Basic3DVector unit() const
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
auto const & tracks
cannot be loose
void produce(edm::Event &event, const edm::EventSetup &es) override
double vertexMinDLen2DSig
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::pair< std::vector< reco::TransientTrack >, GlobalPoint > nearTracks(const reco::TransientTrack &seed, const std::vector< reco::TransientTrack > &tracks, const reco::Vertex &primaryVertex) const
double significance() const
void updateVertexTime(TransientVertex &vtx)
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
TemplatedInclusiveVertexFinder(const edm::ParameterSet ¶ms)
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
reco::TransientTrack buildTT(edm::Handle< reco::TrackCollection > &tracks, edm::ESHandle< TransientTrackBuilder > &trackbuilder, unsigned int k)
primaryVertex
hltOfflineBeamSpot for HLTMON
static void fillDescriptions(edm::ConfigurationDescriptions &cdesc)
Power< A, B >::type pow(const A &a, const B &b)