65 auto newVertexCollection = std::make_unique<reco::VertexCollection>();
72 if(vertices1->empty())
73 LogError(
"HeavyIonVertexing") <<
"adaptive vertex collection is empty!" << endl;
76 const double maxZError = 3.0;
77 bool hasFinalVertex =
false;
82 if(vertices0->empty())
83 LogInfo(
"HeavyIonVertexing") <<
"final adaptive vertex collection is empty!" << endl;
86 if(vertices0->begin()->zError() < maxZError){
87 hasFinalVertex =
true;
88 auto const& vertex0 = vertices0->front();
89 newVertexCollection->push_back(vertex0);
90 LogInfo(
"HeavyIonVertexing") <<
"adaptive vertex:\n vz = (" 91 << vertex0.x() <<
", " << vertex0.y() <<
", " << vertex0.z() <<
")" 93 << vertex0.xError() <<
", " << vertex0.yError() <<
", " 94 << vertex0.zError() <<
")" << endl;
100 if(vertices1->begin()->zError() < maxZError) {
102 reco::VertexCollection::const_iterator vertex1 = vertices1->begin();
103 newVertexCollection->push_back(*vertex1);
105 LogInfo(
"HeavyIonVertexing") <<
"adaptive vertex:\n vz = (" 106 << vertex1->x() <<
", " << vertex1->y() <<
", " << vertex1->z() <<
")" 108 << vertex1->xError() <<
", " << vertex1->yError() <<
", " 109 << vertex1->zError() <<
")" << endl;
123 beamSpot = *beamSpotHandle;
125 LogError(
"HeavyIonVertexing") <<
"no beamspot found " << endl;
127 if(!vertices2->empty()) {
129 reco::VertexCollection::const_iterator vertex2 = vertices2->begin();
133 err(2,2)=
pow(vertex2->zError(),2);
136 newVertexCollection->push_back(newVertex);
138 LogInfo(
"HeavyIonVertexing") <<
"median vertex + beamspot: \n position = (" 139 << newVertex.x() <<
", " << newVertex.y() <<
", " << newVertex.z() <<
")" 141 << newVertex.xError() <<
", " << newVertex.yError() <<
", " 142 << newVertex.zError() <<
")" << endl;
152 newVertexCollection->push_back(newVertex);
154 LogInfo(
"HeavyIonVertexing") <<
"beam spot: \n position = (" 155 << newVertex.x() <<
", " << newVertex.y() <<
", " << newVertex.z() <<
")" 157 << newVertex.xError() <<
", " << newVertex.yError() <<
", " 158 << 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