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"))
41 produces<ScoutingMuonCollection>();
42 produces<ScoutingVertexCollection>(
"displacedVtx");
85 std::pair<reco::RecoChargedCandidate,reco::RecoChargedCandidate> ivtxMuPair;
86 std::vector<std::pair<reco::RecoChargedCandidate,reco::RecoChargedCandidate> > vtxMuPair;
92 for(
auto &dispvtx : *displacedvertexCollection){
93 if ( !dispvtx.isValid() )
continue ;
95 if( (dispvtx.chi2()>=0.0) && (dispvtx.ndof()>0) ) vtxProb = TMath::Prob(dispvtx.chi2(), dispvtx.ndof() );
99 auto trackIt = dispvtx.tracks_begin();
106 for (
auto const &
cand : *ChargedCandidateCollection) {
108 if(tkRef == vertextkRef1) {ivtxMuPair.first=
cand; iFoundRefs++ ;}
109 if(tkRef == vertextkRef2) {ivtxMuPair.second=
cand; iFoundRefs++ ;}
111 if (iFoundRefs<2)
continue;
112 vtxMuPair.push_back(ivtxMuPair);
114 dispVertices->emplace_back(
115 dispvtx.x(), dispvtx.y(), dispvtx.z(),
116 dispvtx.zError(), dispvtx.xError(),
117 dispvtx.yError(), dispvtx.tracksSize(),
118 dispvtx.chi2(), dispvtx.ndof(), dispvtx.isValid()
125 std::vector<int> vtxInd;
128 for (
auto &
muon : *ChargedCandidateCollection) {
143 double ecalisopf=-1.0;
144 if ( EcalPFClusterIsoMap.
isValid()) { ecalisopf = (*EcalPFClusterIsoMap)[muonRef]; }
146 double hcalisopf=-1.0;
147 if ( HcalPFClusterIsoMap.
isValid()) { hcalisopf = (*HcalPFClusterIsoMap)[muonRef]; }
149 for (
unsigned int i=0;
i<vtxMuPair.size();
i++) {
152 if ( (dr2_1<minDR2) || (dr2_2<minDR2) ) vtxInd.push_back(i) ;
156 ecalisopf, hcalisopf,
157 (*TrackIsoMap)[muonRef], track->chi2(), track->ndof(),
158 track->charge(), track->dxy(), track->dz(),
159 track->hitPattern().numberOfValidMuonHits(),
160 track->hitPattern().numberOfValidPixelHits(),
162 track->hitPattern().trackerLayersWithMeasurement(),
164 track->hitPattern().numberOfValidStripHits(),
172 track->qoverpError(),
173 track->lambdaError(),
194 "hltMuonTkRelIsolationCut0p09Map:combinedRelativeIsoDeposits"));
196 desc.
add<
double>(
"muonPtCut", 4.0);
197 desc.
add<
double>(
"muonEtaCut", 2.4);
198 desc.
add<
double>(
"minVtxProbCut", 0.001);
199 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.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< Track > TrackCollection
collection of Tracks
const edm::EDGetTokenT< RecoChargedCandMap > EcalPFClusterIsoMap_
~HLTScoutingMuonProducer()
const edm::EDGetTokenT< reco::TrackCollection > TrackCollection_
const edm::EDGetTokenT< RecoChargedCandMap > HcalPFClusterIsoMap_
def setup(process, global_tag, zero_tesla=False)
std::vector< Vertex > VertexCollection
collection of Vertex objects
U second(std::pair< T, U > const &p)
std::vector< ScoutingVertex > ScoutingVertexCollection
const edm::EDGetTokenT< edm::ValueMap< double > > TrackIsoMap_
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
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > ChargedCandidateCollection_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual void produce(edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const override final
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
HLTScoutingMuonProducer(const edm::ParameterSet &)