31 : theAlgo(conf), theConfig(conf)
34 <<
"Initializing PV producer " <<
"\n";
39 produces<reco::VertexCollection>();
63 if (recoBeamSpotHandle.isValid()){
64 vertexBeamSpot = *recoBeamSpotHandle;
66 edm::LogError(
"UnusableBeamSpot") <<
"No beam spot available from EventSetup";
80 std::vector<reco::TransientTrack> t_tks = (*theB).build(tks, vertexBeamSpot);
82 <<
"Found: " << t_tks.size() <<
" reconstructed tracks" <<
"\n";
87 std::vector<TransientVertex> t_vts =
theAlgo.
vertices(t_tks, vertexBeamSpot);
89 std::cout <<
"RecoVertex/PrimaryVertexProducer: "
90 <<
" found " << t_vts.size() <<
" reconstructed vertices" <<
"\n";
94 for (std::vector<TransientVertex>::const_iterator iv = t_vts.begin();
95 iv != t_vts.end(); iv++) {
101 GlobalError bse(vertexBeamSpot.rotatedCovariance3D());
102 if ( (bse.cxx() <= 0.) ||
104 (bse.czz() <= 0.) ) {
106 we(0,0)=10000; we(1,1)=10000; we(2,2)=10000;
107 vColl.push_back(
reco::Vertex(vertexBeamSpot.position(), we,0.,0.,0));
109 std::cout <<
"RecoVertex/PrimaryVertexProducer: "
110 <<
"Beamspot with invalid errors "<<bse.matrix()<<std::endl;
111 std::cout <<
"Will put Vertex derived from dummy-fake BeamSpot into Event.\n";
115 vertexBeamSpot.rotatedCovariance3D(),0.,0.,0));
117 std::cout <<
"RecoVertex/PrimaryVertexProducer: "
118 <<
" will put Vertex derived from BeamSpot into Event.\n";
125 for(reco::VertexCollection::const_iterator
v=vColl.begin();
126 v!=vColl.end(); ++
v){
128 <<
"#trk " << std::setw(3) <<
v->tracksSize()
129 <<
" chi2 " << std::setw(4) <<
v->chi2()
130 <<
" ndof " << std::setw(3) <<
v->ndof()
131 <<
" x " << std::setw(6) <<
v->position().x()
132 <<
" dx " << std::setw(6) <<
v->xError()
133 <<
" y " << std::setw(6) <<
v->position().y()
134 <<
" dy " << std::setw(6) <<
v->yError()
135 <<
" z " << std::setw(6) <<
v->position().z()
136 <<
" dz " << std::setw(6) <<
v->zError()
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
std::vector< Vertex > VertexCollection
collection of Vertex objects
virtual std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &tracks) const
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::InputTag beamSpotLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual void produce(edm::Event &, const edm::EventSetup &)
PrimaryVertexProducerAlgorithm theAlgo
PrimaryVertexProducer(const edm::ParameterSet &)