37 <<
"Initializing VertexFromTrackProducer" <<
"\n";
50 produces<reco::VertexCollection>();
71 bool vertexAvailable =
false;
76 if (recoBeamSpotHandle.isValid()){
80 edm::LogError(
"UnusableBeamSpot") <<
"No beam spot found in Event";
88 if ((recoVertexHandle.
isValid()) && (recoVertexHandle->size()>0)){
91 vertexAvailable =
true;
94 <<
"No vertex found in Event, beam spot used instaed" <<
"\n";
103 if ((candidateHandle.
isValid())&&(candidateHandle->size()>0)){
106 for (
unsigned i = 0;
i < candidateHandle->size(); ++
i) {
107 double pt=candidateHandle->ptrAt(
i)->pt();
114 track =
dynamic_cast<const reco::Track*
>(candidateHandle->ptrAt(i_maxpt)->bestTrack());
120 std::vector<reco::ElectronRef> recocandidates;
122 if ((recocandidates.size()>0)){
125 for (
unsigned i = 0;
i < recocandidates.size(); ++
i) {
126 double pt=recocandidates.at(
i)->pt();
132 track =
dynamic_cast<const reco::Track*
>(recocandidates.at(i_maxpt)->bestTrack());
139 std::vector<reco::RecoChargedCandidateRef> recocandidates;
141 if ((recocandidates.size()>0)){
144 for (
unsigned i = 0;
i < recocandidates.size(); ++
i) {
145 double pt=recocandidates.at(
i)->pt();
151 track =
dynamic_cast<const reco::Track*
>(recocandidates.at(i_maxpt)->bestTrack());
158 if ((trackHandle.
isValid())&&(trackHandle->size()>0)){
161 for (
unsigned i = 0;
i < trackHandle->size(); ++
i) {
162 double pt=trackHandle->ptrAt(
i)->pt();
169 track =
dynamic_cast<const reco::Track*
>(&*trackHandle->ptrAt(i_maxpt));
175 vertexPoint.SetZ(vertexPoint.z()+track->dz(vertexPoint));
178 vertexPoint.SetZ(track->vz());
195 for(reco::VertexCollection::const_iterator v=vColl.begin();
196 v!=vColl.end(); ++
v){
198 <<
" x " << std::setw(6) << v->
position().x()
199 <<
" dx " << std::setw(6) << v->
xError()
200 <<
" y " << std::setw(6) << v->
position().y()
201 <<
" dy " << std::setw(6) << v->
yError()
202 <<
" z " << std::setw(6) << v->
position().z()
203 <<
" dz " << std::setw(6) << v->
zError()
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
double zError() const
error on z
std::vector< Vertex > VertexCollection
collection of Vertex objects
edm::InputTag triggerFilterElectronsSrc
const Point & position() const
position
edm::InputTag beamSpotLabel
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double xError() const
error on x
virtual void produce(edm::Event &, const edm::EventSetup &) override
XYZPointD XYZPoint
point in space with cartesian internal representation
edm::InputTag triggerFilterMuonsSrc
const Point & position() const
position
edm::InputTag vertexLabel
VertexFromTrackProducer(const edm::ParameterSet &)
bool fUseTriggerFilterElectrons
~VertexFromTrackProducer()
double yError() const
error on y
bool fUseTriggerFilterMuons