CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
TriggerMatcherToHLTDebug Class Reference

#include <MuonAnalysis/MuonAssociators/plugins/TriggerMatcherToHLTDebug.cc>

Inheritance diagram for TriggerMatcherToHLTDebug:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginRun (const edm::Run &run, const edm::EventSetup &eventSetup) override
 
void produce (edm::Event &event, const edm::EventSetup &eventSetup) override
 
 TriggerMatcherToHLTDebug (const edm::ParameterSet &pset)
 
 ~TriggerMatcherToHLTDebug () override
 Destructor. More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef edm::AssociationMap< edm::OneToMany< std::vector< L2MuonTrajectorySeed >, std::vector< L2MuonTrajectorySeed > > > SeedMap
 

Private Member Functions

template<typename T >
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. More...
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotbeamspotToken_
 
double deltaR_
 
PropagateToMuon l1matcher_
 
edm::EDGetTokenT< l1extra::L1MuonParticleCollectionl1Token_
 
double max_Dr_L2
 
double max_Dr_L3
 
double max_Dz_L2
 
double max_Dz_L3
 
double max_Eta_L2
 
double max_Eta_L3
 
std::string metname
 
int min_N_L2
 
int min_N_L3
 
int min_Nhits_L2
 
int min_Nhits_L3
 
double min_Pt_L2
 
double min_Pt_L3
 
int minL1Quality_
 
double nsigma_Pt_L2
 
double nsigma_Pt_L3
 
edm::EDGetTokenT< SeedMapseedMapToken_
 
edm::EDGetTokenT< edm::View< reco::Muon > > tagToken_
 
edm::EDGetTokenT< reco::RecoChargedCandidateCollectiontheL2MuonsToken_
 
edm::EDGetTokenT< L2MuonTrajectorySeedCollectiontheL2SeedsToken_
 
edm::EDGetTokenT< reco::RecoChargedCandidateCollectiontheL3MuonsToken_
 
edm::EDGetTokenT< L3MuonTrajectorySeedCollectiontheL3SeedsToken_
 
edm::EDGetTokenT< reco::TrackCollectiontheL3TkTracksToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: Matches RECO muons to Trigger ones using HLTDEBUG information. Muon is first matched to L1 using the PropagateToMuon tool from this same package, then all compatible L1s are examined and the corresponding L2 and L3 objects are searched using the references inside those objects.

Definition at line 64 of file TriggerMatcherToHLTDebug.cc.

Member Typedef Documentation

◆ SeedMap

Definition at line 78 of file TriggerMatcherToHLTDebug.cc.

Constructor & Destructor Documentation

◆ TriggerMatcherToHLTDebug()

TriggerMatcherToHLTDebug::TriggerMatcherToHLTDebug ( const edm::ParameterSet pset)
explicit

Definition at line 132 of file TriggerMatcherToHLTDebug.cc.

133  : tagToken_(consumes<View<reco::Muon> >(pset.getParameter<edm::InputTag>("tags"))),
134  l1Token_(consumes<L1MuonParticleCollection>(pset.getParameter<edm::InputTag>("l1s"))),
135  l1matcher_(pset.getParameter<edm::ParameterSet>("l1matcherConfig")),
136  deltaR_(pset.getParameter<double>("deltaR")),
137  minL1Quality_(pset.getParameter<int32_t>("MinL1Quality")),
138  beamspotToken_(consumes<BeamSpot>(pset.getParameter<edm::InputTag>("BeamSpotTag"))),
139  min_N_L2(pset.getParameter<int>("MinN_L2")),
140  max_Eta_L2(pset.getParameter<double>("MaxEta_L2")),
141  min_Nhits_L2(pset.getParameter<int>("MinNhits_L2")),
142  max_Dr_L2(pset.getParameter<double>("MaxDr_L2")),
143  max_Dz_L2(pset.getParameter<double>("MaxDz_L2")),
144  min_Pt_L2(pset.getParameter<double>("MinPt_L2")),
145  nsigma_Pt_L2(pset.getParameter<double>("NSigmaPt_L2")),
146  min_N_L3(pset.getParameter<int>("MinN_L3")),
147  max_Eta_L3(pset.getParameter<double>("MaxEta_L3")),
148  min_Nhits_L3(pset.getParameter<int>("MinNhits_L3")),
149  max_Dr_L3(pset.getParameter<double>("MaxDr_L3")),
150  max_Dz_L3(pset.getParameter<double>("MaxDz_L3")),
151  min_Pt_L3(pset.getParameter<double>("MinPt_L3")),
152  nsigma_Pt_L3(pset.getParameter<double>("NSigmaPt_L3")),
153  seedMapToken_(consumes<SeedMap>(pset.getParameter<edm::InputTag>("SeedMapTag"))) {
154  theL2SeedsToken_ = consumes<L2MuonTrajectorySeedCollection>(pset.getParameter<InputTag>("L2Seeds_Collection"));
155  theL2MuonsToken_ = consumes<RecoChargedCandidateCollection>(pset.getParameter<InputTag>("L2Muons_Collection"));
156  theL3SeedsToken_ = consumes<L3MuonTrajectorySeedCollection>(pset.getParameter<InputTag>("L3Seeds_Collection"));
157  theL3TkTracksToken_ = consumes<TrackCollection>(pset.getParameter<InputTag>("L3TkTracks_Collection"));
158  theL3MuonsToken_ = consumes<RecoChargedCandidateCollection>(pset.getParameter<InputTag>("L3Muons_Collection"));
159 
160  metname = "TriggerMatcherToHLTDebug";
161 
162  produces<edm::ValueMap<int> >("propagatesToM2");
163  produces<edm::ValueMap<int> >("hasL1Particle");
164  produces<edm::ValueMap<int> >("hasL1Filtered");
165  produces<edm::ValueMap<int> >("hasL2Seed");
166  produces<edm::ValueMap<int> >("hasL2Muon");
167  produces<edm::ValueMap<int> >("hasL2MuonFiltered");
168  produces<edm::ValueMap<int> >("hasL3Seed");
169  produces<edm::ValueMap<int> >("hasL3Track");
170  produces<edm::ValueMap<int> >("hasL3Muon");
171  produces<edm::ValueMap<int> >("hasL3MuonFiltered");
172 
173  produces<edm::ValueMap<reco::CandidatePtr> >("l1Candidate");
174  produces<edm::ValueMap<reco::CandidatePtr> >("l2Candidate");
175  produces<edm::ValueMap<reco::CandidatePtr> >("l3Candidate");
176 }

References metname, muonDTDigis_cfi::pset, theL2MuonsToken_, theL2SeedsToken_, theL3MuonsToken_, theL3SeedsToken_, and theL3TkTracksToken_.

◆ ~TriggerMatcherToHLTDebug()

TriggerMatcherToHLTDebug::~TriggerMatcherToHLTDebug ( )
override

Destructor.

Definition at line 179 of file TriggerMatcherToHLTDebug.cc.

179 {}

Member Function Documentation

◆ beginRun()

void TriggerMatcherToHLTDebug::beginRun ( const edm::Run run,
const edm::EventSetup eventSetup 
)
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 421 of file TriggerMatcherToHLTDebug.cc.

421  {
422  l1matcher_.init(iSetup);
423 }

References PropagateToMuon::init(), and l1matcher_.

◆ produce()

void TriggerMatcherToHLTDebug::produce ( edm::Event event,
const edm::EventSetup eventSetup 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 182 of file TriggerMatcherToHLTDebug.cc.

182  {
184  event.getByToken(tagToken_, muons);
185 
187  event.getByToken(l1Token_, L1Muons);
188 
190  event.getByToken(theL2SeedsToken_, L2Seeds);
191 
193  event.getByToken(theL2MuonsToken_, L2Muons);
194 
196  event.getByToken(theL3SeedsToken_, L3Seeds);
197 
199  event.getByToken(theL3TkTracksToken_, L3TkTracks);
200 
202  event.getByToken(theL3MuonsToken_, L3Muons);
203 
204  //beam spot
206  Handle<BeamSpot> recoBeamSpotHandle;
207  event.getByToken(beamspotToken_, recoBeamSpotHandle);
208  beamSpot = *recoBeamSpotHandle;
209 
210  //new for the MAP!!!!
211  edm::Handle<SeedMap> seedMapHandle;
212  event.getByToken(seedMapToken_, seedMapHandle);
213 
214  size_t nmu = muons->size();
215  std::vector<int> propagatesToM2(nmu), hasL1Particle(nmu), hasL1Filtered(nmu);
216  std::vector<int> hasL2Seed(nmu), hasL2Muon(nmu), hasL2MuonFiltered(nmu);
217  std::vector<int> hasL3Seed(nmu), hasL3Track(nmu), hasL3TrackFiltered(nmu), hasL3Muon(nmu), hasL3MuonFiltered(nmu);
218  std::vector<reco::CandidatePtr> l1ptr(nmu), l2ptr(nmu), l3ptr(nmu);
219 
220  for (size_t i = 0; i < nmu; ++i) {
221  const reco::Muon &mu = (*muons)[i];
222 
223  // Propagate to muon station (using the L1 tool)
225  if (!stateAtMB2.isValid())
226  continue;
227  propagatesToM2[i] = 1;
228 
229  double etaTk = stateAtMB2.globalPosition().eta();
230  double phiTk = stateAtMB2.globalPosition().phi();
231  l1extra::L1MuonParticleCollection::const_iterator it;
232  L2MuonTrajectorySeedCollection::const_iterator iSeed;
233  L3MuonTrajectorySeedCollection::const_iterator iSeedL3;
234  RecoChargedCandidateCollection::const_iterator iL2Muon;
235  reco::TrackCollection::const_iterator tktrackL3;
236  RecoChargedCandidateCollection::const_iterator iL3Muon;
237 
238  reco::CandidatePtr thisL1, thisL2, thisL3;
239  for (it = L1Muons->begin(); it != L1Muons->end(); ++it) {
240  const L1MuGMTExtendedCand muonCand = (*it).gmtMuonCand();
241  unsigned int quality = muonCand.quality();
242 
243  double L1phi = (*it).phi();
244  double L1eta = (*it).eta();
245  double L1pt = (*it).pt();
246  double dR = deltaR(etaTk, phiTk, L1eta, L1phi);
247 
248  //CONDIZIONE-> CE NE E' UNA ASSOCIATA?
249  if (dR >= deltaR_)
250  continue;
251  thisL1 = reco::CandidatePtr(L1Muons, it - L1Muons->begin());
252  if (!hasL1Particle[i])
253  l1ptr[i] = thisL1; // if nobody reached L1 before, then we're the best L1 found up to now.
254  hasL1Particle[i]++;
255 
256  if ((quality <= 3) || (L1pt < 7))
257  continue;
258  if (!hasL1Filtered[i])
259  l1ptr[i] = thisL1; // if nobody reached L1 before, then we're the best L1 found up to now.
260  hasL1Filtered[i]++;
261 
262  if (!L2Seeds.isValid())
263  continue;
264  //LOOP SULLA COLLEZIONE DEI SEED
265  for (iSeed = L2Seeds->begin(); iSeed != L2Seeds->end(); ++iSeed) {
266  l1extra::L1MuonParticleRef l1FromSeed = iSeed->l1Particle();
267  if (l1FromSeed.id() != L1Muons.id())
268  throw cms::Exception("CorruptData")
269  << "You're using a different L1 collection than the one used by L2 seeds.\n";
270  if (l1FromSeed.key() != thisL1.key())
271  continue;
272  if (!hasL2Seed[i])
273  l1ptr[i] = thisL1; // if nobody reached here before, we're the best L1
274  hasL2Seed[i]++;
275 
276  if (!L2Muons.isValid())
277  continue;
278  //LOOP SULLA COLLEZIONE L2MUON
279  for (iL2Muon = L2Muons->begin(); iL2Muon != L2Muons->end(); ++iL2Muon) {
280  //MI FACCIO DARE REF E GUARDO SE E' UGUALE AL L2SEED ASSOCIATO
281  //BEFORE THE ASSOCIATION MAP!!!!!
282  //edm::Ref<L2MuonTrajectorySeedCollection> l2seedRef = iL2Muon->track()->seedRef().castTo<edm::Ref<L2MuonTrajectorySeedCollection> >();
283  //l1extra::L1MuonParticleRef l1FromL2 = l2seedRef->l1Particle();
284 
285  //if (l1FromL2.id() != l1FromSeed.id()) throw cms::Exception("CorruptData") << "You're using L2s with a different L1 collection than the one used by L2 seeds.\n";
286  //if (l1FromL2 != l1FromSeed) continue;
287 
288  //AFTER THE ASSOCIATION MAP
290  (*seedMapHandle)[iL2Muon->track()->seedRef().castTo<edm::Ref<L2MuonTrajectorySeedCollection> >()];
291  // bool isTriggered = false;
292  for (size_t jjj = 0; jjj < seeds.size(); jjj++) {
293  if (seeds[jjj]->l1Particle() != l1FromSeed)
294  continue;
295  }
296 
297  thisL2 = reco::CandidatePtr(L2Muons, iL2Muon - L2Muons->begin());
298  if (!hasL2Muon[i]) {
299  l1ptr[i] = thisL1;
300  l2ptr[i] = thisL2;
301  } // if nobody reached here before, we're the best L1 and L2)
302  hasL2Muon[i]++;
303 
304  LogTrace(metname) << "L2MUON TROVATO!" << endl;
305  const reco::Track &L2Track = *iL2Muon->track();
306  double Eta_L2 = L2Track.eta();
307  double Pt_L2 = L2Track.pt();
308  int nValidHits_L2 = L2Track.numberOfValidHits();
309  double BSPos_L2 = L2Track.dxy(beamSpot.position());
310  double dz_L2 = L2Track.dz();
311  double err0_L2 = L2Track.error(0);
312  double abspar0_L2 = fabs(L2Track.parameter(0));
313  double ptLx_L2 = Pt_L2;
314  if (abspar0_L2 > 0)
315  ptLx_L2 += nsigma_Pt_L2 * err0_L2 / abspar0_L2 * Pt_L2;
316 
317  //GUARDO SE L2MUON ASSOCIATO AVREBBE PASSATO IL FILTRO
318  bool passFilter = (((fabs(Eta_L2)) <= max_Eta_L2) && (nValidHits_L2 >= min_Nhits_L2) &&
319  ((fabs(BSPos_L2)) <= max_Dr_L2) && ((fabs(dz_L2)) <= max_Dz_L2) && (ptLx_L2 >= min_Pt_L2));
320  if (!passFilter)
321  continue;
322  if (!hasL2MuonFiltered[i]) {
323  l1ptr[i] = thisL1;
324  l2ptr[i] = thisL2;
325  } // if nobody reached here before, we're the best L1 and L2)
326  hasL2MuonFiltered[i]++;
327 
328  const reco::TrackRef L2FilteredRef = iL2Muon->track();
329 
330  //########L3 PART##############
331  if (!L3Seeds.isValid())
332  continue;
333  for (iSeedL3 = L3Seeds->begin(); iSeedL3 != L3Seeds->end(); ++iSeedL3) {
334  TrackRef staTrack = iSeedL3->l2Track();
335  if (staTrack != L2FilteredRef)
336  continue;
337  if (!hasL3Seed[i]) {
338  l1ptr[i] = thisL1;
339  l2ptr[i] = thisL2;
340  } // if nobody reached here before, we're the best L1 and L2)
341  hasL3Seed[i]++;
342 
343  if (!L3TkTracks.isValid())
344  continue;
345  for (tktrackL3 = L3TkTracks->begin(); tktrackL3 != L3TkTracks->end(); ++tktrackL3) {
347  tktrackL3->seedRef().castTo<edm::Ref<L3MuonTrajectorySeedCollection> >();
348  TrackRef staTrack2 = l3seedRef->l2Track();
349 
350  if (staTrack2 != L2FilteredRef)
351  continue;
352  if (!hasL3Track[i]) {
353  l1ptr[i] = thisL1;
354  l2ptr[i] = thisL2;
355  } // if nobody reached here before, we're the best L1 and L2)
356  hasL3Track[i]++;
357 
358  if (!L3Muons.isValid())
359  continue;
360  for (iL3Muon = L3Muons->begin(); iL3Muon != L3Muons->end(); ++iL3Muon) {
362  iL3Muon->track()->seedRef().castTo<edm::Ref<L3MuonTrajectorySeedCollection> >();
363  TrackRef staTrack3 = l3seedRef2->l2Track();
364 
365  if (staTrack3 != L2FilteredRef)
366  continue;
367  thisL3 = reco::CandidatePtr(L3Muons, iL3Muon - L3Muons->begin());
368 
369  if (!hasL3Muon[i]) {
370  l1ptr[i] = thisL1;
371  l2ptr[i] = thisL2;
372  l3ptr[i] = thisL3;
373  } // if nobody reached here before, we're the best L1, L2, L3
374  hasL3Muon[i]++;
375 
376  const reco::Track &L3Track = *iL3Muon->track();
377  double Eta_L3 = L3Track.eta();
378  double Pt_L3 = L3Track.pt();
379  int nValidHits_L3 = L3Track.numberOfValidHits();
380  double BSPos_L3 = L3Track.dxy(beamSpot.position());
381  double dz_L3 = L3Track.dz();
382  double err0_L3 = L3Track.error(0);
383  double abspar0_L3 = fabs(L3Track.parameter(0));
384  double ptLx_L3 = Pt_L3;
385 
386  if (abspar0_L3 > 0)
387  ptLx_L3 += nsigma_Pt_L3 * err0_L3 / abspar0_L3 * Pt_L3;
388 
389  if (((fabs(Eta_L3)) <= max_Eta_L3) && (nValidHits_L3 >= min_Nhits_L3) &&
390  ((fabs(BSPos_L3)) <= max_Dr_L3) && ((fabs(dz_L3)) <= max_Dz_L3) && (ptLx_L3 >= min_Pt_L3)) {
391  if (!hasL3MuonFiltered[i]) {
392  l1ptr[i] = thisL1;
393  l2ptr[i] = thisL2;
394  l3ptr[i] = thisL3;
395  } // if nobody reached here before, we're the best L1, L2, L3
396  hasL3MuonFiltered[i]++;
397 
398  } //L3MUON FILTERED ASSOCIATO TROVATO
399  } //L3MUON LOOP
400  } // L3 TRACKS
401  } // L3 SEEDS
402  } //T L2 MUONS
403  } // L2 SEEDS
404  } //L1 MUONS
405  } // RECO MUONS
406  storeValueMap<int>(event, muons, propagatesToM2, "propagatesToM2");
407  storeValueMap<int>(event, muons, hasL1Particle, "hasL1Particle");
408  storeValueMap<int>(event, muons, hasL1Filtered, "hasL1Filtered");
409  storeValueMap<int>(event, muons, hasL2Seed, "hasL2Seed");
410  storeValueMap<int>(event, muons, hasL2Muon, "hasL2Muon");
411  storeValueMap<int>(event, muons, hasL2MuonFiltered, "hasL2MuonFiltered");
412  storeValueMap<int>(event, muons, hasL3Seed, "hasL3Seed");
413  storeValueMap<int>(event, muons, hasL3Track, "hasL3Track");
414  storeValueMap<int>(event, muons, hasL3Muon, "hasL3Muon");
415  storeValueMap<int>(event, muons, hasL3MuonFiltered, "hasL3MuonFiltered");
416  storeValueMap<reco::CandidatePtr>(event, muons, l1ptr, "l1Candidate");
417  storeValueMap<reco::CandidatePtr>(event, muons, l2ptr, "l2Candidate");
418  storeValueMap<reco::CandidatePtr>(event, muons, l3ptr, "l3Candidate");
419 } // METHOD

References pwdgSkimBPark_cfi::beamSpot, beamspotToken_, PbPb_ZMuSkimMuonDPG_cff::deltaR, deltaR_, HGC3DClusterGenMatchSelector_cfi::dR, reco::TrackBase::dxy(), reco::TrackBase::dz(), reco::TrackBase::error(), PV3DBase< T, PVType, FrameType >::eta(), reco::TrackBase::eta(), PropagateToMuon::extrapolate(), TrajectoryStateOnSurface::globalPosition(), mps_fire::i, edm::Ref< C, T, F >::id(), TrajectoryStateOnSurface::isValid(), edm::HandleBase::isValid(), edm::Ptr< T >::key(), edm::Ref< C, T, F >::key(), l1matcher_, HLTMonTau_cfi::L1Muons, l1Token_, L2Muons_cfi::L2Muons, L3Muons_cfi::L3Muons, LogTrace, max_Dr_L2, max_Dr_L3, max_Dz_L2, max_Dz_L3, max_Eta_L2, max_Eta_L3, metname, min_Nhits_L2, min_Nhits_L3, min_Pt_L2, min_Pt_L3, amptDefaultParameters_cff::mu, PDWG_BPHSkim_cff::muons, nsigma_Pt_L2, nsigma_Pt_L3, reco::TrackBase::numberOfValidHits(), reco::TrackBase::parameter(), PV3DBase< T, PVType, FrameType >::phi(), reco::TrackBase::pt(), L1MuGMTCand::quality(), quality, seedMapToken_, DetachedQuadStep_cff::seeds, tagToken_, theL2MuonsToken_, theL2SeedsToken_, theL3MuonsToken_, theL3SeedsToken_, and theL3TkTracksToken_.

◆ storeValueMap()

template<typename T >
void TriggerMatcherToHLTDebug::storeValueMap ( edm::Event iEvent,
const edm::Handle< edm::View< reco::Muon > > &  handle,
const std::vector< T > &  values,
const std::string &  label 
) const
private

Store extra information in a ValueMap.

Definition at line 426 of file TriggerMatcherToHLTDebug.cc.

429  {
430  using namespace edm;
431  using namespace std;
432  unique_ptr<ValueMap<T> > valMap(new ValueMap<T>());
433  typename edm::ValueMap<T>::Filler filler(*valMap);
434  filler.insert(handle, values.begin(), values.end());
435  filler.fill();
436  iEvent.put(std::move(valMap), label);
437 }

References trigObjTnPSource_cfi::filler, patZpeak::handle, iEvent, label, eostools::move(), and contentValuesCheck::values.

Member Data Documentation

◆ beamspotToken_

edm::EDGetTokenT<reco::BeamSpot> TriggerMatcherToHLTDebug::beamspotToken_
private

Definition at line 93 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ deltaR_

double TriggerMatcherToHLTDebug::deltaR_
private

Definition at line 87 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ l1matcher_

PropagateToMuon TriggerMatcherToHLTDebug::l1matcher_
private

Definition at line 82 of file TriggerMatcherToHLTDebug.cc.

Referenced by beginRun(), and produce().

◆ l1Token_

edm::EDGetTokenT<l1extra::L1MuonParticleCollection> TriggerMatcherToHLTDebug::l1Token_
private

Definition at line 81 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ max_Dr_L2

double TriggerMatcherToHLTDebug::max_Dr_L2
private

Definition at line 97 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ max_Dr_L3

double TriggerMatcherToHLTDebug::max_Dr_L3
private

Definition at line 106 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ max_Dz_L2

double TriggerMatcherToHLTDebug::max_Dz_L2
private

Definition at line 98 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ max_Dz_L3

double TriggerMatcherToHLTDebug::max_Dz_L3
private

Definition at line 107 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ max_Eta_L2

double TriggerMatcherToHLTDebug::max_Eta_L2
private

Definition at line 95 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ max_Eta_L3

double TriggerMatcherToHLTDebug::max_Eta_L3
private

Definition at line 104 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ metname

std::string TriggerMatcherToHLTDebug::metname
private

Definition at line 84 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce(), and TriggerMatcherToHLTDebug().

◆ min_N_L2

int TriggerMatcherToHLTDebug::min_N_L2
private

Definition at line 94 of file TriggerMatcherToHLTDebug.cc.

◆ min_N_L3

int TriggerMatcherToHLTDebug::min_N_L3
private

Definition at line 103 of file TriggerMatcherToHLTDebug.cc.

◆ min_Nhits_L2

int TriggerMatcherToHLTDebug::min_Nhits_L2
private

Definition at line 96 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ min_Nhits_L3

int TriggerMatcherToHLTDebug::min_Nhits_L3
private

Definition at line 105 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ min_Pt_L2

double TriggerMatcherToHLTDebug::min_Pt_L2
private

Definition at line 99 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ min_Pt_L3

double TriggerMatcherToHLTDebug::min_Pt_L3
private

Definition at line 108 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ minL1Quality_

int TriggerMatcherToHLTDebug::minL1Quality_
private

Definition at line 90 of file TriggerMatcherToHLTDebug.cc.

◆ nsigma_Pt_L2

double TriggerMatcherToHLTDebug::nsigma_Pt_L2
private

Definition at line 100 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ nsigma_Pt_L3

double TriggerMatcherToHLTDebug::nsigma_Pt_L3
private

Definition at line 109 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ seedMapToken_

edm::EDGetTokenT<SeedMap> TriggerMatcherToHLTDebug::seedMapToken_
private

Definition at line 116 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ tagToken_

edm::EDGetTokenT<edm::View<reco::Muon> > TriggerMatcherToHLTDebug::tagToken_
private

Definition at line 80 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce().

◆ theL2MuonsToken_

edm::EDGetTokenT<reco::RecoChargedCandidateCollection> TriggerMatcherToHLTDebug::theL2MuonsToken_
private

Definition at line 112 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce(), and TriggerMatcherToHLTDebug().

◆ theL2SeedsToken_

edm::EDGetTokenT<L2MuonTrajectorySeedCollection> TriggerMatcherToHLTDebug::theL2SeedsToken_
private

Definition at line 111 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce(), and TriggerMatcherToHLTDebug().

◆ theL3MuonsToken_

edm::EDGetTokenT<reco::RecoChargedCandidateCollection> TriggerMatcherToHLTDebug::theL3MuonsToken_
private

Definition at line 115 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce(), and TriggerMatcherToHLTDebug().

◆ theL3SeedsToken_

edm::EDGetTokenT<L3MuonTrajectorySeedCollection> TriggerMatcherToHLTDebug::theL3SeedsToken_
private

Definition at line 113 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce(), and TriggerMatcherToHLTDebug().

◆ theL3TkTracksToken_

edm::EDGetTokenT<reco::TrackCollection> TriggerMatcherToHLTDebug::theL3TkTracksToken_
private

Definition at line 114 of file TriggerMatcherToHLTDebug.cc.

Referenced by produce(), and TriggerMatcherToHLTDebug().

PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
TriggerMatcherToHLTDebug::seedMapToken_
edm::EDGetTokenT< SeedMap > seedMapToken_
Definition: TriggerMatcherToHLTDebug.cc:116
TriggerMatcherToHLTDebug::max_Dr_L2
double max_Dr_L2
Definition: TriggerMatcherToHLTDebug.cc:97
mps_fire.i
i
Definition: mps_fire.py:428
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
L1MuGMTExtendedCand
Definition: L1MuGMTExtendedCand.h:46
TriggerMatcherToHLTDebug::beamspotToken_
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
Definition: TriggerMatcherToHLTDebug.cc:93
TriggerMatcherToHLTDebug::nsigma_Pt_L3
double nsigma_Pt_L3
Definition: TriggerMatcherToHLTDebug.cc:109
amptDefaultParameters_cff.mu
mu
Definition: amptDefaultParameters_cff.py:16
TriggerMatcherToHLTDebug::minL1Quality_
int minL1Quality_
Definition: TriggerMatcherToHLTDebug.cc:90
patZpeak.handle
handle
Definition: patZpeak.py:23
PropagateToMuon::init
void init(const edm::EventSetup &iSetup)
Definition: PropagateToMuon.cc:56
edm
HLT enums.
Definition: AlignableModifier.h:19
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
TriggerMatcherToHLTDebug::min_Pt_L2
double min_Pt_L2
Definition: TriggerMatcherToHLTDebug.cc:99
TriggerMatcherToHLTDebug::theL2MuonsToken_
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > theL2MuonsToken_
Definition: TriggerMatcherToHLTDebug.cc:112
TriggerMatcherToHLTDebug::min_Nhits_L3
int min_Nhits_L3
Definition: TriggerMatcherToHLTDebug.cc:105
edm::RefVector
Definition: EDProductfwd.h:27
edm::Ptr::key
key_type key() const
Definition: Ptr.h:163
L3Muons_cfi.L3Muons
L3Muons
Definition: L3Muons_cfi.py:8
edm::Handle
Definition: AssociativeIterator.h:50
reco::TrackBase::numberOfValidHits
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:798
reco::Muon
Definition: Muon.h:27
edm::Ref< L1MuonParticleCollection >
quality
const uint32_t *__restrict__ Quality * quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:122
TriggerMatcherToHLTDebug::min_Pt_L3
double min_Pt_L3
Definition: TriggerMatcherToHLTDebug.cc:108
HLTMonTau_cfi.L1Muons
L1Muons
Definition: HLTMonTau_cfi.py:44
reco::TrackBase::pt
double pt() const
track transverse momentum
Definition: TrackBase.h:637
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
reco::TrackBase::parameter
double parameter(int i) const
i-th parameter ( i = 0, ... 4 )
Definition: TrackBase.h:723
TriggerMatcherToHLTDebug::metname
std::string metname
Definition: TriggerMatcherToHLTDebug.cc:84
TriggerMatcherToHLTDebug::l1Token_
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > l1Token_
Definition: TriggerMatcherToHLTDebug.cc:81
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
L1MuGMTCand::quality
unsigned int quality() const
get quality
Definition: L1MuGMTCand.h:90
reco::BeamSpot
Definition: BeamSpot.h:21
reco::Track
Definition: Track.h:27
TriggerMatcherToHLTDebug::max_Eta_L3
double max_Eta_L3
Definition: TriggerMatcherToHLTDebug.cc:104
reco::TrackBase::dz
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...
Definition: TrackBase.h:622
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
edm::View
Definition: CaloClusterFwd.h:14
TriggerMatcherToHLTDebug::min_N_L3
int min_N_L3
Definition: TriggerMatcherToHLTDebug.cc:103
edm::ParameterSet
Definition: ParameterSet.h:47
TriggerMatcherToHLTDebug::max_Dr_L3
double max_Dr_L3
Definition: TriggerMatcherToHLTDebug.cc:106
TriggerMatcherToHLTDebug::theL3SeedsToken_
edm::EDGetTokenT< L3MuonTrajectorySeedCollection > theL3SeedsToken_
Definition: TriggerMatcherToHLTDebug.cc:113
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
reco::TrackBase::eta
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
TriggerMatcherToHLTDebug::nsigma_Pt_L2
double nsigma_Pt_L2
Definition: TriggerMatcherToHLTDebug.cc:100
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
iEvent
int iEvent
Definition: GenABIO.cc:224
TriggerMatcherToHLTDebug::min_N_L2
int min_N_L2
Definition: TriggerMatcherToHLTDebug.cc:94
TriggerMatcherToHLTDebug::theL3MuonsToken_
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > theL3MuonsToken_
Definition: TriggerMatcherToHLTDebug.cc:115
reco::TrackBase::error
double error(int i) const
error on specified element
Definition: TrackBase.h:729
edm::Ptr< Candidate >
TriggerMatcherToHLTDebug::deltaR_
double deltaR_
Definition: TriggerMatcherToHLTDebug.cc:87
edm::Ref::id
ProductID id() const
Accessor for product ID.
Definition: Ref.h:244
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
DetachedQuadStep_cff.seeds
seeds
Definition: DetachedQuadStep_cff.py:195
edm::ValueMap
Definition: ValueMap.h:107
TriggerMatcherToHLTDebug::min_Nhits_L2
int min_Nhits_L2
Definition: TriggerMatcherToHLTDebug.cc:96
TriggerMatcherToHLTDebug::theL3TkTracksToken_
edm::EDGetTokenT< reco::TrackCollection > theL3TkTracksToken_
Definition: TriggerMatcherToHLTDebug.cc:114
TriggerMatcherToHLTDebug::max_Dz_L2
double max_Dz_L2
Definition: TriggerMatcherToHLTDebug.cc:98
TriggerMatcherToHLTDebug::theL2SeedsToken_
edm::EDGetTokenT< L2MuonTrajectorySeedCollection > theL2SeedsToken_
Definition: TriggerMatcherToHLTDebug.cc:111
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
PropagateToMuon::extrapolate
TrajectoryStateOnSurface extrapolate(const reco::Track &tk) const
Definition: PropagateToMuon.h:40
cms::Exception
Definition: Exception.h:70
reco::CandidatePtr
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Definition: CandidateFwd.h:25
edm::helper::Filler
Definition: ValueMap.h:22
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
L2Muons_cfi.L2Muons
L2Muons
Definition: L2Muons_cfi.py:7
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:159
TriggerMatcherToHLTDebug::tagToken_
edm::EDGetTokenT< edm::View< reco::Muon > > tagToken_
Definition: TriggerMatcherToHLTDebug.cc:80
TriggerMatcherToHLTDebug::max_Dz_L3
double max_Dz_L3
Definition: TriggerMatcherToHLTDebug.cc:107
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
event
Definition: event.py:1
reco::TrackBase::dxy
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:608
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
TriggerMatcherToHLTDebug::l1matcher_
PropagateToMuon l1matcher_
Definition: TriggerMatcherToHLTDebug.cc:82
TriggerMatcherToHLTDebug::max_Eta_L2
double max_Eta_L2
Definition: TriggerMatcherToHLTDebug.cc:95
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27