31 <<
"Initializing VertexFromTrackProducer" <<
"\n";
46 produces<reco::VertexCollection>();
67 bool vertexAvailable =
false;
72 if (recoBeamSpotHandle.isValid()){
76 edm::LogError(
"UnusableBeamSpot") <<
"No beam spot found in Event";
84 if ((recoVertexHandle.
isValid()) && (recoVertexHandle->size()>0)){
87 vertexAvailable =
true;
90 <<
"No vertex found in Event, beam spot used instaed" <<
"\n";
99 if ((candidateHandle.
isValid())&&(candidateHandle->size()>0)){
102 for (
unsigned i = 0;
i < candidateHandle->size(); ++
i) {
103 double pt=candidateHandle->ptrAt(
i)->pt();
110 track =
dynamic_cast<const reco::Track*
>(candidateHandle->ptrAt(i_maxpt)->bestTrack());
116 std::vector<reco::ElectronRef> recocandidates;
118 if ((recocandidates.size()>0)){
121 for (
unsigned i = 0;
i < recocandidates.size(); ++
i) {
122 double pt=recocandidates.at(
i)->pt();
128 track =
dynamic_cast<const reco::Track*
>(recocandidates.at(i_maxpt)->bestTrack());
135 std::vector<reco::RecoChargedCandidateRef> recocandidates;
137 if ((recocandidates.size()>0)){
140 for (
unsigned i = 0;
i < recocandidates.size(); ++
i) {
141 double pt=recocandidates.at(
i)->pt();
147 track =
dynamic_cast<const reco::Track*
>(recocandidates.at(i_maxpt)->bestTrack());
154 if ((trackHandle.
isValid())&&(trackHandle->size()>0)){
157 for (
unsigned i = 0;
i < trackHandle->size(); ++
i) {
158 double pt=trackHandle->ptrAt(
i)->pt();
165 track =
dynamic_cast<const reco::Track*
>(&*trackHandle->ptrAt(i_maxpt));
171 vertexPoint.SetZ(vertexPoint.z()+track->dz(vertexPoint));
174 vertexPoint.SetZ(track->vz());
191 for(reco::VertexCollection::const_iterator v=vColl.begin();
192 v!=vColl.end(); ++
v){
194 <<
" x " << std::setw(6) << v->
position().x()
195 <<
" dx " << std::setw(6) << v->
xError()
196 <<
" y " << std::setw(6) << v->
position().y()
197 <<
" dy " << std::setw(6) << v->
yError()
198 <<
" z " << std::setw(6) << v->
position().z()
199 <<
" dz " << std::setw(6) << v->
zError()
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double zError() const
error on z
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > triggerFilterElectronsSrc
std::vector< Vertex > VertexCollection
collection of Vertex objects
const Point & position() const
position
edm::EDGetTokenT< reco::BeamSpot > beamSpotLabel
edm::EDGetTokenT< edm::View< reco::Vertex > > vertexLabel
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< edm::View< reco::RecoCandidate > > candidateToken
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::EDGetTokenT< edm::View< reco::Track > > trackToken
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > triggerFilterMuonsSrc
const Point & position() const
position
VertexFromTrackProducer(const edm::ParameterSet &)
bool fUseTriggerFilterElectrons
~VertexFromTrackProducer()
double yError() const
error on y
bool fUseTriggerFilterMuons