58 auto newVertexCollection = std::make_unique<reco::VertexCollection>();
65 if (vertices1->empty())
66 LogError(
"HeavyIonVertexing") <<
"adaptive vertex collection is empty!" << endl;
69 const double maxZError = 3.0;
70 bool hasFinalVertex =
false;
75 if (vertices0->empty())
76 LogInfo(
"HeavyIonVertexing") <<
"final adaptive vertex collection is empty!" << endl;
79 if (vertices0->begin()->zError() < maxZError) {
80 hasFinalVertex =
true;
81 auto const& vertex0 = vertices0->front();
82 newVertexCollection->push_back(vertex0);
83 LogInfo(
"HeavyIonVertexing") <<
"adaptive vertex:\n vz = (" << vertex0.x() <<
", " << vertex0.y() <<
", " 85 <<
"\n error = (" << vertex0.xError() <<
", " << vertex0.yError() <<
", " 86 << vertex0.zError() <<
")" << endl;
91 if (!hasFinalVertex) {
92 if (vertices1->begin()->zError() < maxZError) {
93 reco::VertexCollection::const_iterator vertex1 = vertices1->begin();
94 newVertexCollection->push_back(*vertex1);
96 LogInfo(
"HeavyIonVertexing") <<
"adaptive vertex:\n vz = (" << vertex1->x() <<
", " << vertex1->y() <<
", " 97 << vertex1->z() <<
")" 98 <<
"\n error = (" << vertex1->xError() <<
", " << vertex1->yError() <<
", " 99 << vertex1->zError() <<
")" << endl;
112 beamSpot = *beamSpotHandle;
114 LogError(
"HeavyIonVertexing") <<
"no beamspot found " << endl;
116 if (!vertices2->empty()) {
117 reco::VertexCollection::const_iterator vertex2 = vertices2->begin();
121 err(2, 2) =
pow(vertex2->zError(), 2);
123 newVertexCollection->push_back(newVertex);
125 LogInfo(
"HeavyIonVertexing") <<
"median vertex + beamspot: \n position = (" << newVertex.x() <<
", " 126 << newVertex.y() <<
", " << newVertex.z() <<
")" 127 <<
"\n error = (" << newVertex.xError() <<
", " << newVertex.yError() <<
", " 128 << newVertex.zError() <<
")" << endl;
136 newVertexCollection->push_back(newVertex);
138 LogInfo(
"HeavyIonVertexing") <<
"beam spot: \n position = (" << newVertex.x() <<
", " << newVertex.y() <<
", " 139 << newVertex.z() <<
")" 140 <<
"\n error = (" << newVertex.xError() <<
", " << newVertex.yError() <<
", " 141 << newVertex.zError() <<
")" << endl;
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool theUseFinalAdaptiveVertexCollection
math::Error< dimension >::type Error
covariance error matrix (3x3)
std::vector< Vertex > VertexCollection
collection of Vertex objects
edm::EDGetTokenT< reco::VertexCollection > theAdaptiveVertexCollection
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotTag
edm::EDGetTokenT< reco::VertexCollection > theFinalAdaptiveVertexCollection
math::XYZPoint Point
point in the space
double BeamWidthX() const
beam width X
edm::EDGetTokenT< reco::VertexCollection > theMedianVertexCollection
T const * product() const
double sigmaZ() const
sigma z
double BeamWidthY() const
beam width Y
double y0() const
y coordinate
const Point & position() const
position
Power< A, B >::type pow(const A &a, const B &b)
double x0() const
x coordinate