64 bool vertexAvailable =
false;
69 if (recoBeamSpotHandle.
isValid()) {
73 edm::LogError(
"UnusableBeamSpot") <<
"No beam spot found in Event";
80 if ((recoVertexHandle.
isValid()) && (!recoVertexHandle->empty())) {
83 vertexAvailable =
true;
85 edm::LogInfo(
"UnusableVertex") <<
"No vertex found in Event, beam spot used instaed" 94 if ((candidateHandle.
isValid()) && (!candidateHandle->empty())) {
97 for (
unsigned i = 0;
i < candidateHandle->size(); ++
i) {
98 double pt = candidateHandle->ptrAt(
i)->pt();
104 track =
dynamic_cast<const reco::Track*
>(candidateHandle->ptrAt(i_maxpt)->bestTrack());
109 std::vector<reco::ElectronRef> recocandidates;
111 if ((!recocandidates.empty())) {
113 unsigned i_maxpt = 0;
114 for (
unsigned i = 0;
i < recocandidates.size(); ++
i) {
115 double pt = recocandidates.at(
i)->pt();
120 track =
dynamic_cast<const reco::Track*
>(recocandidates.at(i_maxpt)->bestTrack());
126 std::vector<reco::RecoChargedCandidateRef> recocandidates;
128 if ((!recocandidates.empty())) {
130 unsigned i_maxpt = 0;
131 for (
unsigned i = 0;
i < recocandidates.size(); ++
i) {
132 double pt = recocandidates.at(
i)->pt();
137 track =
dynamic_cast<const reco::Track*
>(recocandidates.at(i_maxpt)->bestTrack());
143 if ((trackHandle.
isValid()) && (!trackHandle->empty())) {
145 unsigned i_maxpt = 0;
146 for (
unsigned i = 0;
i < trackHandle->size(); ++
i) {
147 double pt = trackHandle->ptrAt(
i)->pt();
153 track =
dynamic_cast<const reco::Track*
>(&*trackHandle->ptrAt(i_maxpt));
159 vertexPoint.SetZ(vertexPoint.z() + track->
dz(vertexPoint));
161 vertexPoint.SetZ(track->
vz());
178 edm::LogInfo(
"PVDebugInfo") <<
"Vertices by VertexFromTrackProducer: \n";
179 for (reco::VertexCollection::const_iterator
v = vColl.begin();
v != vColl.end(); ++
v) {
181 <<
"recvtx " << ivtx++ <<
" x " << std::setw(6) <<
v->position().x() <<
" dx " 182 << std::setw(6) <<
v->xError() <<
" y " << std::setw(6) <<
v->position().y() <<
" dy " 183 << std::setw(6) <<
v->yError() <<
" z " << std::setw(6) <<
v->position().z() <<
" dz " 184 << std::setw(6) <<
v->zError() <<
" \n ";
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< Vertex > VertexCollection
collection of Vertex objects
const Point & position() const
position
const edm::EDGetTokenT< reco::BeamSpot > beamSpotLabel
const edm::EDGetTokenT< edm::View< reco::RecoCandidate > > candidateToken
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > triggerFilterElectronsSrc
const bool fUseTriggerFilterElectrons
const bool fIsRecoCandidate
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
double vz() const
z coordinate of the reference point on track
XYZPointD XYZPoint
point in space with cartesian internal representation
const edm::EDGetTokenT< edm::View< reco::Track > > trackToken
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > triggerFilterMuonsSrc
const Point & position() const
position
const bool fUseTriggerFilterMuons
const edm::EDGetTokenT< edm::View< reco::Vertex > > vertexLabel