26 (iConfig.getParameter<
edm::InputTag>(
"ChargedCandidates"))),
28 (iConfig.getParameter<
edm::InputTag>(
"Tracks"))),
30 "EcalPFClusterIsoMap"))),
32 "HcalPFClusterIsoMap"))),
33 TrackIsoMap_(consumes<
edm::ValueMap<double>>(iConfig.getParameter<
edm::InputTag>(
35 displacedvertexCollection_(consumes<
reco::
VertexCollection>(iConfig.getParameter<
edm::InputTag>(
"displacedvertexCollection"))),
36 muonPtCut(iConfig.getParameter<double>(
"muonPtCut")),
37 muonEtaCut(iConfig.getParameter<double>(
"muonEtaCut")),
38 minVtxProbCut(iConfig.getParameter<double>(
"minVtxProbCut")),
42 produces<ScoutingMuonCollection>();
43 produces<ScoutingVertexCollection>(
"displacedVtx");
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(),
218 "hltMuonTkRelIsolationCut0p09Map:combinedRelativeIsoDeposits"));
220 desc.
add<
double>(
"muonPtCut", 4.0);
221 desc.
add<
double>(
"muonEtaCut", 2.4);
222 desc.
add<
double>(
"minVtxProbCut", 0.001);
225 descriptions.
add(
"hltScoutingMuonProducer", desc);
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.
void produce(edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const final
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< Track > TrackCollection
collection of Tracks
const edm::EDGetTokenT< RecoChargedCandMap > EcalPFClusterIsoMap_
const edm::EDGetTokenT< reco::TrackCollection > TrackCollection_
const edm::EDGetTokenT< RecoChargedCandMap > HcalPFClusterIsoMap_
def setup(process, global_tag, zero_tesla=False)
double phi() const
azimuthal angle of momentum vector
std::vector< Vertex > VertexCollection
collection of Vertex objects
std::vector< MuonTrackLinks > MuonTrackLinksCollection
collection of MuonTrackLinks
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)
~HLTScoutingMuonProducer() override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< ScoutingMuon > ScoutingMuonCollection
const edm::EDGetTokenT< reco::VertexCollection > displacedvertexCollection_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool isNull() const
Checks for null.
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > ChargedCandidateCollection_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< reco::MuonTrackLinksCollection > linkToken_
HLTScoutingMuonProducer(const edm::ParameterSet &)