86 std::pair<reco::RecoChargedCandidate,reco::RecoChargedCandidate> ivtxMuPair;
87 std::vector<std::pair<reco::RecoChargedCandidate,reco::RecoChargedCandidate> > vtxMuPair;
93 for(
auto &dispvtx : *displacedvertexCollection){
94 if ( !dispvtx.isValid() )
continue ;
96 if( (dispvtx.chi2()>=0.0) && (dispvtx.ndof()>0) ) vtxProb = TMath::Prob(dispvtx.chi2(), dispvtx.ndof() );
100 auto trackIt = dispvtx.tracks_begin();
107 for (
auto const &
cand : *ChargedCandidateCollection) {
109 if(tkRef == vertextkRef1) {ivtxMuPair.first=
cand; iFoundRefs++ ;}
110 if(tkRef == vertextkRef2) {ivtxMuPair.second=
cand; iFoundRefs++ ;}
112 if (iFoundRefs<2)
continue;
113 vtxMuPair.push_back(ivtxMuPair);
115 dispVertices->emplace_back(
116 dispvtx.x(), dispvtx.y(), dispvtx.z(),
117 dispvtx.zError(), dispvtx.xError(),
118 dispvtx.yError(), dispvtx.tracksSize(),
119 dispvtx.chi2(), dispvtx.ndof(), dispvtx.isValid()
126 std::vector<int> vtxInd;
135 for (
auto &
muon : *ChargedCandidateCollection) {
147 for(
auto const & link : *links){
148 const reco::Track& trackerTrack = *link.trackerTrack();
149 float dR2 =
deltaR2(track->eta(),track->phi(),trackerTrack.
eta(),trackerTrack.
phi());
150 float dPt =
std::abs(track->pt() - trackerTrack.
pt());
151 if (track->pt() != 0) dPt = dPt/track->pt();
153 if (dR2 < 0.02*0.02 and dPt < 0.001) {
155 validmuhit=staTrack->hitPattern().numberOfValidMuonHits() ;
156 matchedsta=staTrack->hitPattern().muonStationsWithValidHits();
165 double ecalisopf=-1.0;
166 if ( EcalPFClusterIsoMap.
isValid()) { ecalisopf = (*EcalPFClusterIsoMap)[muonRef]; }
168 double hcalisopf=-1.0;
169 if ( HcalPFClusterIsoMap.
isValid()) { hcalisopf = (*HcalPFClusterIsoMap)[muonRef]; }
171 vtxInd.reserve(vtxMuPair.size());
172 for (
unsigned int i=0;
i<vtxMuPair.size();
i++) {
175 if ( (dr2_1<minDR2) || (dr2_2<minDR2) ) vtxInd.push_back(
i) ;
179 ecalisopf, hcalisopf,
180 (*TrackIsoMap)[muonRef], track->chi2(), track->ndof(),
181 track->charge(), track->dxy(), track->dz(),
183 track->hitPattern().numberOfValidPixelHits(),
185 track->hitPattern().trackerLayersWithMeasurement(),
187 track->hitPattern().numberOfValidStripHits(),
195 track->qoverpError(),
196 track->lambdaError(),
helper::MatcherGetRef< C >::ref_type getRef(const Handle< C > &c, size_t k)
const double minVtxProbCut
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< Track > TrackCollection
collection of Tracks
const edm::EDGetTokenT< RecoChargedCandMap > EcalPFClusterIsoMap_
const edm::EDGetTokenT< reco::TrackCollection > TrackCollection_
const edm::EDGetTokenT< RecoChargedCandMap > HcalPFClusterIsoMap_
double phi() const
azimuthal angle of momentum vector
U second(std::pair< T, U > const &p)
std::vector< ScoutingVertex > ScoutingVertexCollection
double eta() const
pseudorapidity of momentum vector
const edm::EDGetTokenT< edm::ValueMap< double > > TrackIsoMap_
double pt() const
track transverse momentum
Abs< T >::type abs(const T &t)
std::vector< ScoutingMuon > ScoutingMuonCollection
const edm::EDGetTokenT< reco::VertexCollection > displacedvertexCollection_
bool isNull() const
Checks for null.
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > ChargedCandidateCollection_
const edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkToken_