132 const std::vector<T> &
values,
139 using namespace l1extra;
140 using namespace reco;
144 tagTag_(pset.getParameter<edm::
InputTag>(
"tags")),
145 l1Tag_(pset.getParameter<edm::
InputTag>(
"l1s")),
146 l1matcher_(pset.getParameter<edm::
ParameterSet>(
"l1matcherConfig")),
147 deltaR_(pset.getParameter<double>(
"deltaR")),
148 minL1Quality_(pset.getParameter<int32_t>(
"MinL1Quality")),
149 beamspotTag_(pset.getParameter<edm::
InputTag>(
"BeamSpotTag")),
150 min_N_L2(pset.getParameter<int> (
"MinN_L2")),
151 max_Eta_L2(pset.getParameter<double> (
"MaxEta_L2")),
152 min_Nhits_L2(pset.getParameter<int> (
"MinNhits_L2")),
153 max_Dr_L2(pset.getParameter<double> (
"MaxDr_L2")),
154 max_Dz_L2(pset.getParameter<double> (
"MaxDz_L2")),
155 min_Pt_L2(pset.getParameter<double> (
"MinPt_L2")),
156 nsigma_Pt_L2(pset.getParameter<double> (
"NSigmaPt_L2")),
157 min_N_L3(pset.getParameter<int> (
"MinN_L3")),
158 max_Eta_L3(pset.getParameter<double> (
"MaxEta_L3")),
159 min_Nhits_L3(pset.getParameter<int> (
"MinNhits_L3")),
160 max_Dr_L3(pset.getParameter<double> (
"MaxDr_L3")),
161 max_Dz_L3(pset.getParameter<double> (
"MaxDz_L3")),
162 min_Pt_L3(pset.getParameter<double> (
"MinPt_L3")),
163 nsigma_Pt_L3(pset.getParameter<double> (
"NSigmaPt_L3")),
164 seedMapTag_(pset.getParameter<edm::
InputTag >(
"SeedMapTag"))
175 metname =
"TriggerMatcherToHLTDebug";
177 produces<edm::ValueMap<int> > (
"propagatesToM2");
178 produces<edm::ValueMap<int> > (
"hasL1Particle");
179 produces<edm::ValueMap<int> > (
"hasL1Filtered");
180 produces<edm::ValueMap<int> > (
"hasL2Seed");
181 produces<edm::ValueMap<int> > (
"hasL2Muon");
182 produces<edm::ValueMap<int> > (
"hasL2MuonFiltered");
183 produces<edm::ValueMap<int> > (
"hasL3Seed");
184 produces<edm::ValueMap<int> > (
"hasL3Track");
185 produces<edm::ValueMap<int> > (
"hasL3Muon");
186 produces<edm::ValueMap<int> > (
"hasL3MuonFiltered");
188 produces<edm::ValueMap<reco::CandidatePtr> > (
"l1Candidate");
189 produces<edm::ValueMap<reco::CandidatePtr> > (
"l2Candidate");
190 produces<edm::ValueMap<reco::CandidatePtr> > (
"l3Candidate");
202 event.getByLabel(
tagTag_,muons);
205 event.getByLabel(
l1Tag_,L1Muons);
226 beamSpot = *recoBeamSpotHandle;
233 size_t nmu = muons->size();
234 std::vector<int> propagatesToM2(nmu), hasL1Particle(nmu), hasL1Filtered(nmu);
235 std::vector<int> hasL2Seed(nmu), hasL2Muon(nmu), hasL2MuonFiltered(nmu);
236 std::vector<int> hasL3Seed(nmu), hasL3Track(nmu), hasL3TrackFiltered(nmu), hasL3Muon(nmu), hasL3MuonFiltered(nmu);
237 std::vector<reco::CandidatePtr> l1ptr(nmu), l2ptr(nmu), l3ptr(nmu);
239 for (
size_t i = 0;
i < nmu; ++
i) {
244 if (!stateAtMB2.
isValid())
continue;
245 propagatesToM2[
i] = 1;
249 l1extra::L1MuonParticleCollection::const_iterator it;
250 vector<l1extra::L1MuonParticleRef>::const_iterator itMu3;
251 L2MuonTrajectorySeedCollection::const_iterator iSeed;
252 L3MuonTrajectorySeedCollection::const_iterator iSeedL3;
253 RecoChargedCandidateCollection::const_iterator iL2Muon;
254 reco::TrackCollection::const_iterator tktrackL3;
255 RecoChargedCandidateCollection::const_iterator iL3Muon;
258 for(it = L1Muons->begin(); it != L1Muons->end(); ++it) {
261 unsigned int quality = muonCand.
quality();
263 double L1phi =(*it).phi();
264 double L1eta =(*it).eta();
265 double L1pt =(*it).pt();
266 double dR=
deltaR(etaTk,phiTk,L1eta,L1phi);
271 if (!hasL1Particle[
i]) l1ptr[
i] = thisL1;
274 if ((quality <= 3) || (L1pt<7))
continue;
275 if (!hasL1Filtered[i]) l1ptr[
i] = thisL1;
278 if(!L2Seeds.
isValid())
continue;
280 for( iSeed = L2Seeds->begin(); iSeed != L2Seeds->end(); ++iSeed) {
283 if (l1FromSeed.
id() != L1Muons.
id())
throw cms::Exception(
"CorruptData") <<
"You're using a different L1 collection than the one used by L2 seeds.\n";
284 if (l1FromSeed.
key() != thisL1.
key())
continue;
285 if (!hasL2Seed[i]) l1ptr[
i] = thisL1;
288 if(!L2Muons.
isValid())
continue;
290 for( iL2Muon = L2Muons->begin(); iL2Muon != L2Muons->end(); ++iL2Muon) {
304 for(
size_t jjj=0; jjj<seeds.
size(); jjj++){
306 if(seeds[jjj]->l1Particle()!= l1FromSeed)
continue;
312 if (!hasL2Muon[i]) { l1ptr[
i] = thisL1; l2ptr[
i] = thisL2; }
317 double Eta_L2= L2Track.
eta();
318 double Pt_L2= L2Track.
pt();
320 double BSPos_L2 = L2Track.
dxy(beamSpot.
position());
321 double dz_L2 =L2Track.
dz();
322 double err0_L2 = L2Track.
error(0);
323 double abspar0_L2 = fabs(L2Track.
parameter(0));
324 double ptLx_L2 = Pt_L2;
325 if (abspar0_L2>0) ptLx_L2 +=
nsigma_Pt_L2*err0_L2/abspar0_L2*Pt_L2;
329 if (!passFilter)
continue;
330 if (!hasL2MuonFiltered[i]) { l1ptr[
i] = thisL1; l2ptr[
i] = thisL2; }
331 hasL2MuonFiltered[
i]++;
336 if (!L3Seeds.
isValid())
continue;
337 for (iSeedL3 = L3Seeds->begin(); iSeedL3!= L3Seeds->end(); ++iSeedL3){
339 TrackRef staTrack = iSeedL3->l2Track();
340 if (staTrack!=L2FilteredRef)
continue;
341 if (!hasL3Seed[i]) { l1ptr[
i] = thisL1; l2ptr[
i] = thisL2; }
344 if (!L3TkTracks.
isValid())
continue;
345 for (tktrackL3 = L3TkTracks->begin(); tktrackL3!= L3TkTracks->end(); ++tktrackL3){
348 TrackRef staTrack2 = l3seedRef->l2Track();
350 if (staTrack2!=L2FilteredRef)
continue;
351 if (!hasL3Track[i]) { l1ptr[
i] = thisL1; l2ptr[
i] = thisL2; }
354 if (!L3Muons.
isValid())
continue;
355 for (iL3Muon = L3Muons->begin(); iL3Muon != L3Muons->end(); ++iL3Muon) {
358 TrackRef staTrack3 = l3seedRef2->l2Track();
360 if (staTrack3!=L2FilteredRef)
continue;
363 if (!hasL3Muon[i]) { l1ptr[
i] = thisL1; l2ptr[
i] = thisL2; l3ptr[
i] = thisL3; }
367 double Eta_L3= L3Track.
eta();
368 double Pt_L3= L3Track.
pt();
370 double BSPos_L3 = L3Track.
dxy(beamSpot.
position());
371 double dz_L3 =L3Track.
dz();
372 double err0_L3 = L3Track.
error(0);
373 double abspar0_L3 = fabs(L3Track.
parameter(0));
374 double ptLx_L3 = Pt_L3;
376 if (abspar0_L3>0) ptLx_L3 +=
nsigma_Pt_L3*err0_L3/abspar0_L3*Pt_L3;
380 if (!hasL3MuonFiltered[i]) { l1ptr[
i] = thisL1; l2ptr[
i] = thisL2; l3ptr[
i] = thisL3; }
381 hasL3MuonFiltered[
i]++;
391 storeValueMap<int>(
event,
muons, propagatesToM2,
"propagatesToM2");
392 storeValueMap<int>(
event,
muons, hasL1Particle,
"hasL1Particle");
393 storeValueMap<int>(
event,
muons, hasL1Filtered,
"hasL1Filtered");
394 storeValueMap<int>(
event,
muons, hasL2Seed,
"hasL2Seed");
395 storeValueMap<int>(
event,
muons, hasL2Muon,
"hasL2Muon");
396 storeValueMap<int>(
event,
muons, hasL2MuonFiltered,
"hasL2MuonFiltered");
397 storeValueMap<int>(
event,
muons, hasL3Seed,
"hasL3Seed");
398 storeValueMap<int>(
event,
muons, hasL3Track,
"hasL3Track");
399 storeValueMap<int>(
event,
muons, hasL3Muon,
"hasL3Muon");
400 storeValueMap<int>(
event,
muons, hasL3MuonFiltered,
"hasL3MuonFiltered");
401 storeValueMap<reco::CandidatePtr>(
event,
muons, l1ptr,
"l1Candidate");
402 storeValueMap<reco::CandidatePtr>(
event,
muons, l2ptr,
"l2Candidate");
403 storeValueMap<reco::CandidatePtr>(
event,
muons, l3ptr,
"l3Candidate");
415 const std::vector<T> &
values,
417 using namespace edm;
using namespace std;
422 iEvent.
put(valMap, label);
T getParameter(std::string const &) const
TrajectoryStateOnSurface extrapolate(const reco::Track &tk) const
Extrapolate reco::Track to the muon station 2, return an invalid TSOS if it fails.
edm::InputTag theL2MuonsLabel
edm::InputTag theL3SeedsLabel
#define DEFINE_FWK_MODULE(type)
void storeValueMap(edm::Event &iEvent, const edm::Handle< edm::View< reco::Muon > > &handle, const std::vector< T > &values, const std::string &label) const
Store extra information in a ValueMap.
edm::InputTag beamspotTag_
Geom::Phi< T > phi() const
void insert(const H &h, I begin, I end)
GlobalPoint globalPosition() const
edm::AssociationMap< edm::OneToMany< std::vector< L2MuonTrajectorySeed >, std::vector< L2MuonTrajectorySeed > > > SeedMap
edm::InputTag seedMapTag_
Propagate an object (usually a track) to the second muon station. Support for other muon stations wil...
double eta() const
pseudorapidity of momentum vector
TriggerMatcherToHLTDebug(const edm::ParameterSet &pset)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual ~TriggerMatcherToHLTDebug()
Destructor.
double pt() const
track transverse momentum
edm::InputTag theL3TkTracksLabel
double error(int i) const
error on specified element
unsigned short numberOfValidHits() const
number of valid hits found
edm::InputTag theL2SeedsLabel
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
double parameter(int i) const
i-th parameter ( i = 0, ... 4 )
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 deltaR(double eta1, double eta2, double phi1, double phi2)
unsigned int quality() const
get quality
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
key_type key() const
Accessor for product key.
void init(const edm::EventSetup &iSetup)
Call this method at the beginning of each run, to initialize geometry, magnetic field and propagators...
edm::InputTag theL3MuonsLabel
void beginRun(const edm::Run &run, const edm::EventSetup &eventSetup) override
void produce(edm::Event &event, const edm::EventSetup &eventSetup) override
size_type size() const
Size of the RefVector.
const Point & position() const
position
ProductID id() const
Accessor for product ID.
PropagateToMuon l1matcher_
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...