|
|
Go to the documentation of this file.
24 #undef PIXVERTEX_DEBUG_PRODUCE
49 produces<reco::VertexCollection>();
59 descriptions.
add(
"pixelVertexFromSoA",
desc);
63 auto vertexes = std::make_unique<reco::VertexCollection>();
66 auto tracksSize = tracksHandle->size();
70 float x0 = 0, y0 = 0,
z0 = 0,
dxdz = 0,
dydz = 0;
71 std::vector<int32_t> itrk;
73 if (!bsHandle.isValid()) {
74 edm::LogWarning(
"PixelVertexProducer") <<
"No beamspot found. returning vertexes with (0,0,Z) ";
88 #ifdef PIXVERTEX_DEBUG_PRODUCE
89 std::cout <<
"converting " << nv <<
" vertices "
90 <<
" from " << indToEdm.size() <<
" tracks" << std::endl;
91 #endif // PIXVERTEX_DEBUG_PRODUCE
93 std::set<uint16_t> uind;
94 for (
int j = nv - 1;
j >= 0; --
j) {
107 for (
auto k = 0
U;
k < indToEdm.size(); ++
k) {
111 auto nt = itrk.size();
113 #ifdef PIXVERTEX_DEBUG_PRODUCE
114 std::cout <<
"vertex " <<
i <<
" with no tracks..." << std::endl;
115 #endif // PIXVERTEX_DEBUG_PRODUCE
123 auto &
v = (*vertexes).back();
124 v.reserve(itrk.size());
125 for (
auto it : itrk) {
126 assert(it <
int(indToEdm.size()));
127 auto k = indToEdm[it];
128 if (
k > tracksSize) {
129 edm::LogWarning(
"PixelVertexProducer") <<
"oops track " << it <<
" does not exists on CPU " <<
k;
138 LogDebug(
"PixelVertexProducer") <<
": Found " <<
vertexes->size() <<
" vertexes\n";
139 for (
unsigned int i = 0;
i <
vertexes->size(); ++
i) {
140 LogDebug(
"PixelVertexProducer") <<
"Vertex number " <<
i <<
" has " << (*vertexes)[
i].tracksSize()
141 <<
" tracks with a position of " << (*vertexes)[
i].z() <<
" +- "
146 if (
vertexes->empty() && bsHandle.isValid()) {
150 if ((bse.cxx() <= 0.) || (bse.cyy() <= 0.) || (bse.czz() <= 0.)) {
157 edm::LogInfo(
"PixelVertexProducer") <<
"No vertices found. Beamspot with invalid errors " << bse.matrix()
158 <<
"\nWill put Vertex derived from dummy-fake BeamSpot into Event.\n"
159 << (*vertexes)[0].x() <<
"\n"
160 << (*vertexes)[0].y() <<
"\n"
161 << (*vertexes)[0].z() <<
"\n";
165 edm::LogInfo(
"PixelVertexProducer") <<
"No vertices found. Will put Vertex derived from BeamSpot into Event:\n"
166 << (*vertexes)[0].x() <<
"\n"
167 << (*vertexes)[0].y() <<
"\n"
168 << (*vertexes)[0].z() <<
"\n";
170 }
else if (
vertexes->empty() && !bsHandle.isValid()) {
171 edm::LogWarning(
"PixelVertexProducer") <<
"No beamspot and no vertex found. No vertex returned.";
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
edm::EDGetTokenT< ZVertexHeterogeneous > tokenVertex_
edm::EDGetTokenT< reco::BeamSpot > tokenBeamSpot_
math::Error< dimension >::type Error
covariance error matrix (3x3)
Log< level::Info, false > LogInfo
Log< level::Warning, false > LogWarning
void produce(edm::StreamID streamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
PixelVertexProducerFromSoA(const edm::ParameterSet &iConfig)
#define DEFINE_FWK_MODULE(type)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< reco::TrackCollection > tokenTracks_
~PixelVertexProducerFromSoA() override=default
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
math::XYZPoint Point
point in the space
std::vector< uint16_t > IndToEdm
edm::EDGetTokenT< IndToEdm > tokenIndToEdm_
std::vector< Track > TrackCollection
collection of Tracks