CMS 3D CMS Logo

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

#include <CSCStubMatcher.h>

Public Member Functions

std::map< unsigned int, CSCALCTDigiContaineralcts () const
 
const CSCALCTDigiContaineralctsInChamber (unsigned int) const
 
const CSCALCTDigiContainerallALCTsInChamber (unsigned int) const
 
const CSCCLCTDigiContainerallCLCTsInChamber (unsigned int) const
 all stubs (not necessarily matching) from a particular crossed chamber More...
 
const CSCCorrelatedLCTDigiContainerallLCTsInChamber (unsigned int) const
 
const CSCCorrelatedLCTDigiContainerallMPLCTsInChamber (unsigned int) const
 
CSCALCTDigi bestAlctInChamber (unsigned int) const
 
CSCCLCTDigi bestClctInChamber (unsigned int) const
 best matching from a particular crossed chamber More...
 
CSCCorrelatedLCTDigi bestLctInChamber (unsigned int) const
 
CSCCorrelatedLCTDigi bestMplctInChamber (unsigned int) const
 
std::set< unsigned int > chamberIdsALCT (int csc_type=MuonHitHelper::CSC_ALL) const
 
std::set< unsigned int > chamberIdsAllALCT (int csc_type=MuonHitHelper::CSC_ALL) const
 
std::set< unsigned int > chamberIdsAllCLCT (int csc_type=MuonHitHelper::CSC_ALL) const
 crossed chamber detIds with not necessarily matching stubs More...
 
std::set< unsigned int > chamberIdsAllLCT (int csc_type=MuonHitHelper::CSC_ALL) const
 
std::set< unsigned int > chamberIdsAllMPLCT (int csc_type=MuonHitHelper::CSC_ALL) const
 
std::set< unsigned int > chamberIdsCLCT (int csc_type=MuonHitHelper::CSC_ALL) const
 chamber detIds with matching stubs More...
 
std::set< unsigned int > chamberIdsLCT (int csc_type=MuonHitHelper::CSC_ALL) const
 
std::set< unsigned int > chamberIdsMPLCT (int csc_type=MuonHitHelper::CSC_ALL) const
 
std::map< unsigned int, CSCCLCTDigiContainerclcts () const
 all matching lcts More...
 
const CSCCLCTDigiContainerclctsInChamber (unsigned int) const
 all matching from a particular crossed chamber More...
 
std::shared_ptr< CSCDigiMatchercscDigiMatcher ()
 
 CSCStubMatcher (edm::ParameterSet const &iPS, edm::ConsumesCollector &&iC)
 
std::shared_ptr< GEMDigiMatchergemDigiMatcher ()
 
GlobalPoint getGlobalPosition (unsigned int rawId, const CSCCorrelatedLCTDigi &lct) const
 
void init (const edm::Event &e, const edm::EventSetup &eventSetup)
 initialize the event More...
 
bool lctInChamber (const CSCDetId &id, const CSCCorrelatedLCTDigi &lct) const
 
std::map< unsigned int, CSCCorrelatedLCTDigiContainerlcts () const
 
const CSCCorrelatedLCTDigiContainerlctsInChamber (unsigned int) const
 
void match (const SimTrack &t, const SimVertex &v)
 do the matching More...
 
std::map< unsigned int, CSCCorrelatedLCTDigiContainermplcts () const
 
const CSCCorrelatedLCTDigiContainermplctsInChamber (unsigned int) const
 
int nChambersWithALCT (int min_quality=0) const
 
int nChambersWithCLCT (int min_quality=0) const
 How many CSC chambers with matching stubs of some minimal quality did this SimTrack hit? More...
 
int nChambersWithLCT (int min_quality=0) const
 
int nChambersWithMPLCT (int min_quality=0) const
 
float zpositionOfLayer (unsigned int detid, int layer) const
 
 ~CSCStubMatcher ()
 

Private Member Functions

void addGhostLCTs (const CSCCorrelatedLCTDigi &lct11, const CSCCorrelatedLCTDigi &lct22, CSCCorrelatedLCTDigiContainer &lctcontainer) const
 
void clear ()
 
void matchALCTsToSimTrack (const CSCALCTDigiCollection &)
 
void matchCLCTsToSimTrack (const CSCCLCTDigiCollection &)
 
void matchLCTsToSimTrack (const CSCCorrelatedLCTDigiCollection &)
 
void matchMPLCTsToSimTrack (const CSCCorrelatedLCTDigiCollection &)
 
template<class D >
std::set< unsigned int > selectDetIds (D &, int) const
 

Private Attributes

bool addGhostLCTs_
 
edm::InputTag alctInputTag_
 
edm::Handle< CSCALCTDigiCollectionalctsH_
 
edm::EDGetTokenT< CSCALCTDigiCollectionalctToken_
 
std::map< unsigned int, CSCALCTDigiContainerchamber_to_alcts_
 
std::map< unsigned int, CSCALCTDigiContainerchamber_to_alcts_all_
 
std::map< unsigned int, CSCCLCTDigiContainerchamber_to_clcts_
 
std::map< unsigned int, CSCCLCTDigiContainerchamber_to_clcts_all_
 
std::map< unsigned int, CSCCorrelatedLCTDigiContainerchamber_to_lcts_
 
std::map< unsigned int, CSCCorrelatedLCTDigiContainerchamber_to_lcts_all_
 
std::map< unsigned int, CSCCorrelatedLCTDigiContainerchamber_to_mplcts_
 
std::map< unsigned int, CSCCorrelatedLCTDigiContainerchamber_to_mplcts_all_
 
edm::InputTag clctInputTag_
 
edm::Handle< CSCCLCTDigiCollectionclctsH_
 
edm::EDGetTokenT< CSCCLCTDigiCollectionclctToken_
 
std::shared_ptr< CSCDigiMatchercscDigiMatcher_
 
const CSCGeometrycscGeometry_
 
std::shared_ptr< GEMDigiMatchergemDigiMatcher_
 
edm::ESGetToken< CSCGeometry, MuonGeometryRecordgeomToken_
 
edm::InputTag lctInputTag_
 
edm::Handle< CSCCorrelatedLCTDigiCollectionlctsH_
 
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollectionlctToken_
 
bool matchTypeTightLCT_
 
int maxBXALCT_
 
int maxBXCLCT_
 
int maxBXLCT_
 
int maxBXMPLCT_
 
int minBXALCT_
 
int minBXCLCT_
 
int minBXLCT_
 
int minBXMPLCT_
 
int minNHitsChamber_
 
int minNHitsChamberALCT_
 
int minNHitsChamberCLCT_
 
int minNHitsChamberLCT_
 
int minNHitsChamberMPLCT_
 
edm::InputTag mplctInputTag_
 
edm::Handle< CSCCorrelatedLCTDigiCollectionmplctsH_
 
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollectionmplctToken_
 
CSCALCTDigiContainer no_alcts_
 
CSCCLCTDigiContainer no_clcts_
 
CSCCorrelatedLCTDigiContainer no_lcts_
 
CSCCorrelatedLCTDigiContainer no_mplcts_
 
bool useGEMs_
 
bool verboseALCT_
 
bool verboseCLCT_
 
bool verboseLCT_
 
bool verboseMPLCT_
 

Detailed Description

Description: Matching of CSC L1 trigger stubs to SimTrack

Author: Sven Dildick (TAMU), Tao Huang (TAMU)

Definition at line 23 of file CSCStubMatcher.h.

Constructor & Destructor Documentation

◆ CSCStubMatcher()

CSCStubMatcher::CSCStubMatcher ( edm::ParameterSet const &  iPS,
edm::ConsumesCollector &&  iC 
)

Definition at line 7 of file CSCStubMatcher.cc.

References muonCSCStubPSet::cscALCT, muonCSCStubPSet::cscCLCT, muonCSCStubPSet::cscLCT, muonCSCStubPSet::cscMPLCT, edm::ParameterSet::getParameter(), and eostools::move().

7  {
8  useGEMs_ = pSet.getParameter<bool>("useGEMs");
9 
10  const auto& cscCLCT = pSet.getParameter<edm::ParameterSet>("cscCLCT");
11  minBXCLCT_ = cscCLCT.getParameter<int>("minBX");
12  maxBXCLCT_ = cscCLCT.getParameter<int>("maxBX");
13  verboseCLCT_ = cscCLCT.getParameter<int>("verbose");
14  minNHitsChamberCLCT_ = cscCLCT.getParameter<int>("minNHitsChamber");
15 
16  const auto& cscALCT = pSet.getParameter<edm::ParameterSet>("cscALCT");
17  minBXALCT_ = cscALCT.getParameter<int>("minBX");
18  maxBXALCT_ = cscALCT.getParameter<int>("maxBX");
19  verboseALCT_ = cscALCT.getParameter<int>("verbose");
20  minNHitsChamberALCT_ = cscALCT.getParameter<int>("minNHitsChamber");
21 
22  const auto& cscLCT = pSet.getParameter<edm::ParameterSet>("cscLCT");
23  minBXLCT_ = cscLCT.getParameter<int>("minBX");
24  maxBXLCT_ = cscLCT.getParameter<int>("maxBX");
25  matchTypeTightLCT_ = cscLCT.getParameter<bool>("matchTypeTight");
26  verboseLCT_ = cscLCT.getParameter<int>("verbose");
27  minNHitsChamberLCT_ = cscLCT.getParameter<int>("minNHitsChamber");
28  addGhostLCTs_ = cscLCT.getParameter<bool>("addGhosts");
29 
30  const auto& cscMPLCT = pSet.getParameter<edm::ParameterSet>("cscMPLCT");
31  minBXMPLCT_ = cscMPLCT.getParameter<int>("minBX");
32  maxBXMPLCT_ = cscMPLCT.getParameter<int>("maxBX");
33  verboseMPLCT_ = cscMPLCT.getParameter<int>("verbose");
34  minNHitsChamberMPLCT_ = cscMPLCT.getParameter<int>("minNHitsChamber");
35 
36  if (useGEMs_)
37  gemDigiMatcher_.reset(new GEMDigiMatcher(pSet, std::move(iC)));
38  cscDigiMatcher_.reset(new CSCDigiMatcher(pSet, std::move(iC)));
39 
40  clctInputTag_ = cscCLCT.getParameter<edm::InputTag>("inputTag");
41  alctInputTag_ = cscALCT.getParameter<edm::InputTag>("inputTag");
42  lctInputTag_ = cscLCT.getParameter<edm::InputTag>("inputTag");
43  mplctInputTag_ = cscMPLCT.getParameter<edm::InputTag>("inputTag");
44 
49 
51 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::InputTag clctInputTag_
edm::EDGetTokenT< CSCCLCTDigiCollection > clctToken_
std::shared_ptr< CSCDigiMatcher > cscDigiMatcher_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > mplctToken_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > lctToken_
edm::EDGetTokenT< CSCALCTDigiCollection > alctToken_
edm::InputTag mplctInputTag_
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > geomToken_
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher_
edm::InputTag alctInputTag_
edm::InputTag lctInputTag_
def move(src, dest)
Definition: eostools.py:511

◆ ~CSCStubMatcher()

CSCStubMatcher::~CSCStubMatcher ( )
inline

Definition at line 27 of file CSCStubMatcher.h.

27 {}

Member Function Documentation

◆ addGhostLCTs()

void CSCStubMatcher::addGhostLCTs ( const CSCCorrelatedLCTDigi lct11,
const CSCCorrelatedLCTDigi lct22,
CSCCorrelatedLCTDigiContainer lctcontainer 
) const
private

Definition at line 684 of file CSCStubMatcher.cc.

References CSCCorrelatedLCTDigi::getALCT(), CSCCorrelatedLCTDigi::getCLCT(), CSCCorrelatedLCTDigi::getKeyWG(), CSCCorrelatedLCTDigi::getStrip(), CSCCorrelatedLCTDigi::setALCT(), CSCCorrelatedLCTDigi::setCLCT(), and CSCCorrelatedLCTDigi::setWireGroup().

686  {
687  int wg1 = lct11.getKeyWG();
688  int wg2 = lct22.getKeyWG();
689  int hs1 = lct11.getStrip();
690  int hs2 = lct22.getStrip();
691 
692  if (!(wg1 == wg2 || hs1 == hs2)) {
693  // flip the ALCTs
694  CSCCorrelatedLCTDigi lct12 = lct11;
695  lct12.setWireGroup(wg2);
696  lct12.setALCT(lct22.getALCT());
697  lct12.setCLCT(lct11.getCLCT());
698  lcts_tmp.push_back(lct12);
699 
700  CSCCorrelatedLCTDigi lct21 = lct22;
701  lct21.setWireGroup(wg1);
702  lct21.setALCT(lct11.getALCT());
703  lct21.setCLCT(lct22.getCLCT());
704  lcts_tmp.push_back(lct21);
705  }
706 }
void setALCT(const CSCALCTDigi &alct)
void setWireGroup(const uint16_t wiregroup)
set wiregroup number
uint16_t getStrip(uint16_t n=2) const
return the key halfstrip from 0,159
const CSCCLCTDigi & getCLCT() const
uint16_t getKeyWG() const
return the key wire group. counts from 0.
void setCLCT(const CSCCLCTDigi &clct)
const CSCALCTDigi & getALCT() const

◆ alcts()

std::map<unsigned int, CSCALCTDigiContainer> CSCStubMatcher::alcts ( ) const
inline

Definition at line 61 of file CSCStubMatcher.h.

References chamber_to_alcts_.

61 { return chamber_to_alcts_; }
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_

◆ alctsInChamber()

const CSCALCTDigiContainer & CSCStubMatcher::alctsInChamber ( unsigned int  detid) const

Definition at line 485 of file CSCStubMatcher.cc.

485  {
486  if (chamber_to_alcts_.find(detid) == chamber_to_alcts_.end())
487  return no_alcts_;
488  return chamber_to_alcts_.at(detid);
489 }
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_
CSCALCTDigiContainer no_alcts_

◆ allALCTsInChamber()

const CSCALCTDigiContainer & CSCStubMatcher::allALCTsInChamber ( unsigned int  detid) const

Definition at line 461 of file CSCStubMatcher.cc.

461  {
462  if (chamber_to_alcts_all_.find(detid) == chamber_to_alcts_all_.end())
463  return no_alcts_;
464  return chamber_to_alcts_all_.at(detid);
465 }
CSCALCTDigiContainer no_alcts_
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_all_

◆ allCLCTsInChamber()

const CSCCLCTDigiContainer & CSCStubMatcher::allCLCTsInChamber ( unsigned int  detid) const

all stubs (not necessarily matching) from a particular crossed chamber

Definition at line 455 of file CSCStubMatcher.cc.

455  {
456  if (chamber_to_clcts_all_.find(detid) == chamber_to_clcts_all_.end())
457  return no_clcts_;
458  return chamber_to_clcts_all_.at(detid);
459 }
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_all_
CSCCLCTDigiContainer no_clcts_

◆ allLCTsInChamber()

const CSCCorrelatedLCTDigiContainer & CSCStubMatcher::allLCTsInChamber ( unsigned int  detid) const

Definition at line 467 of file CSCStubMatcher.cc.

467  {
468  if (chamber_to_lcts_all_.find(detid) == chamber_to_lcts_all_.end())
469  return no_lcts_;
470  return chamber_to_lcts_all_.at(detid);
471 }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_lcts_all_
CSCCorrelatedLCTDigiContainer no_lcts_

◆ allMPLCTsInChamber()

const CSCCorrelatedLCTDigiContainer & CSCStubMatcher::allMPLCTsInChamber ( unsigned int  detid) const

Definition at line 473 of file CSCStubMatcher.cc.

473  {
474  if (chamber_to_mplcts_all_.find(detid) == chamber_to_mplcts_all_.end())
475  return no_mplcts_;
476  return chamber_to_mplcts_all_.at(detid);
477 }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_all_
CSCCorrelatedLCTDigiContainer no_mplcts_

◆ bestAlctInChamber()

CSCALCTDigi CSCStubMatcher::bestAlctInChamber ( unsigned int  detid) const

Definition at line 520 of file CSCStubMatcher.cc.

References mps_fire::i, input, and quality.

520  {
521  //sort stubs based on quality
522  const auto& input(alctsInChamber(detid));
523  int bestQ = 0;
524  int index = -1;
525  for (unsigned int i = 0; i < input.size(); ++i) {
526  int quality = input[i].getQuality();
527  if (quality > bestQ) {
528  bestQ = quality;
529  index = i;
530  }
531  }
532  if (index != -1)
533  return input[index];
534  return CSCALCTDigi();
535 }
static std::string const input
Definition: EdmProvDump.cc:50
string quality
const CSCALCTDigiContainer & alctsInChamber(unsigned int) const

◆ bestClctInChamber()

CSCCLCTDigi CSCStubMatcher::bestClctInChamber ( unsigned int  detid) const

best matching from a particular crossed chamber

Definition at line 503 of file CSCStubMatcher.cc.

References mps_fire::i, input, and quality.

503  {
504  //sort stubs based on quality
505  const auto& input(clctsInChamber(detid));
506  int bestQ = 0;
507  int index = -1;
508  for (unsigned int i = 0; i < input.size(); ++i) {
509  int quality = input[i].getQuality();
510  if (quality > bestQ) {
511  bestQ = quality;
512  index = i;
513  }
514  }
515  if (index != -1)
516  return input[index];
517  return CSCCLCTDigi();
518 }
static std::string const input
Definition: EdmProvDump.cc:50
string quality
const CSCCLCTDigiContainer & clctsInChamber(unsigned int) const
all matching from a particular crossed chamber

◆ bestLctInChamber()

CSCCorrelatedLCTDigi CSCStubMatcher::bestLctInChamber ( unsigned int  detid) const

Definition at line 537 of file CSCStubMatcher.cc.

References mps_fire::i, input, and quality.

537  {
538  //sort stubs based on quality
539  const auto& input(lctsInChamber(detid));
540  int bestQ = 0;
541  int index = -1;
542  for (unsigned int i = 0; i < input.size(); ++i) {
543  int quality = input[i].getQuality();
544  if (quality > bestQ) {
545  bestQ = quality;
546  index = i;
547  }
548  }
549  if (index != -1)
550  return input[index];
551  return CSCCorrelatedLCTDigi();
552 }
static std::string const input
Definition: EdmProvDump.cc:50
string quality
const CSCCorrelatedLCTDigiContainer & lctsInChamber(unsigned int) const

◆ bestMplctInChamber()

CSCCorrelatedLCTDigi CSCStubMatcher::bestMplctInChamber ( unsigned  int) const

◆ chamberIdsALCT()

std::set< unsigned int > CSCStubMatcher::chamberIdsALCT ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 443 of file CSCStubMatcher.cc.

443  {
444  return selectDetIds(chamber_to_alcts_, csc_type);
445 }
std::set< unsigned int > selectDetIds(D &, int) const
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_

◆ chamberIdsAllALCT()

std::set< unsigned int > CSCStubMatcher::chamberIdsAllALCT ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 427 of file CSCStubMatcher.cc.

427  {
428  return selectDetIds(chamber_to_alcts_all_, csc_type);
429 }
std::set< unsigned int > selectDetIds(D &, int) const
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_all_

◆ chamberIdsAllCLCT()

std::set< unsigned int > CSCStubMatcher::chamberIdsAllCLCT ( int  csc_type = MuonHitHelper::CSC_ALL) const

crossed chamber detIds with not necessarily matching stubs

Definition at line 423 of file CSCStubMatcher.cc.

423  {
424  return selectDetIds(chamber_to_clcts_all_, csc_type);
425 }
std::set< unsigned int > selectDetIds(D &, int) const
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_all_

◆ chamberIdsAllLCT()

std::set< unsigned int > CSCStubMatcher::chamberIdsAllLCT ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 431 of file CSCStubMatcher.cc.

431  {
432  return selectDetIds(chamber_to_lcts_all_, csc_type);
433 }
std::set< unsigned int > selectDetIds(D &, int) const
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_lcts_all_

◆ chamberIdsAllMPLCT()

std::set< unsigned int > CSCStubMatcher::chamberIdsAllMPLCT ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 435 of file CSCStubMatcher.cc.

435  {
436  return selectDetIds(chamber_to_mplcts_all_, csc_type);
437 }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_all_
std::set< unsigned int > selectDetIds(D &, int) const

◆ chamberIdsCLCT()

std::set< unsigned int > CSCStubMatcher::chamberIdsCLCT ( int  csc_type = MuonHitHelper::CSC_ALL) const

chamber detIds with matching stubs

Definition at line 439 of file CSCStubMatcher.cc.

439  {
440  return selectDetIds(chamber_to_clcts_, csc_type);
441 }
std::set< unsigned int > selectDetIds(D &, int) const
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_

◆ chamberIdsLCT()

std::set< unsigned int > CSCStubMatcher::chamberIdsLCT ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 447 of file CSCStubMatcher.cc.

447  {
448  return selectDetIds(chamber_to_lcts_, csc_type);
449 }
std::set< unsigned int > selectDetIds(D &, int) const
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_lcts_

◆ chamberIdsMPLCT()

std::set< unsigned int > CSCStubMatcher::chamberIdsMPLCT ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 451 of file CSCStubMatcher.cc.

451  {
452  return selectDetIds(chamber_to_mplcts_, csc_type);
453 }
std::set< unsigned int > selectDetIds(D &, int) const
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_

◆ clcts()

std::map<unsigned int, CSCCLCTDigiContainer> CSCStubMatcher::clcts ( ) const
inline

all matching lcts

Definition at line 60 of file CSCStubMatcher.h.

References chamber_to_clcts_.

60 { return chamber_to_clcts_; }
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_

◆ clctsInChamber()

const CSCCLCTDigiContainer & CSCStubMatcher::clctsInChamber ( unsigned int  detid) const

all matching from a particular crossed chamber

Definition at line 479 of file CSCStubMatcher.cc.

479  {
480  if (chamber_to_clcts_.find(detid) == chamber_to_clcts_.end())
481  return no_clcts_;
482  return chamber_to_clcts_.at(detid);
483 }
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_
CSCCLCTDigiContainer no_clcts_

◆ clear()

void CSCStubMatcher::clear ( void  )
private

Definition at line 672 of file CSCStubMatcher.cc.

672  {
673  chamber_to_clcts_all_.clear();
674  chamber_to_alcts_all_.clear();
675  chamber_to_lcts_all_.clear();
676  chamber_to_mplcts_all_.clear();
677 
678  chamber_to_clcts_.clear();
679  chamber_to_alcts_.clear();
680  chamber_to_lcts_.clear();
681  chamber_to_mplcts_.clear();
682 }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_all_
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_lcts_
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_lcts_all_
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_all_
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_all_

◆ cscDigiMatcher()

std::shared_ptr<CSCDigiMatcher> CSCStubMatcher::cscDigiMatcher ( )
inline

Definition at line 85 of file CSCStubMatcher.h.

References cscDigiMatcher_.

85 { return cscDigiMatcher_; }
std::shared_ptr< CSCDigiMatcher > cscDigiMatcher_

◆ gemDigiMatcher()

std::shared_ptr<GEMDigiMatcher> CSCStubMatcher::gemDigiMatcher ( )
inline

Definition at line 86 of file CSCStubMatcher.h.

References gemDigiMatcher_.

86 { return gemDigiMatcher_; }
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher_

◆ getGlobalPosition()

GlobalPoint CSCStubMatcher::getGlobalPosition ( unsigned int  rawId,
const CSCCorrelatedLCTDigi lct 
) const

Definition at line 648 of file CSCStubMatcher.cc.

References relativeConstraints::chamber, CSCDetId::chamber(), CSCDetId::endcap(), CSCCorrelatedLCTDigi::getFractionalStrip(), CSCCorrelatedLCTDigi::getKeyWG(), CSCCorrelatedLCTDigi::getStrip(), CSCConstants::KEY_CLCT_LAYER, CSCDetId::layer(), CSCConstants::MAX_HALF_STRIP_ME1B, CSCConstants::NUM_STRIPS_ME1B, relativeConstraints::ring, CSCDetId::ring(), and CSCDetId::station().

648  {
649  CSCDetId cscId(rawId);
650  CSCDetId keyId(cscId.endcap(), cscId.station(), cscId.ring(), cscId.chamber(), CSCConstants::KEY_CLCT_LAYER);
651  float fractional_strip = lct.getFractionalStrip();
652  // case ME1/1
653  if (cscId.station() == 1 and (cscId.ring() == 4 || cscId.ring() == 1)) {
654  int ring = 1; // Default to ME1/b
656  ring = 4; // Change to ME1/a if the HalfStrip Number exceeds the range of ME1/b
657  fractional_strip -= CSCConstants::NUM_STRIPS_ME1B;
658  }
659  CSCDetId cscId_(cscId.endcap(), cscId.station(), ring, cscId.chamber(), cscId.layer());
660  cscId = cscId_;
661  }
662  // regular cases
663  const auto& chamber = cscGeometry_->chamber(cscId);
664  const auto& layer_geo = chamber->layer(CSCConstants::KEY_CLCT_LAYER)->geometry();
665  // LCT::getKeyWG() also starts from 0
666  float wire = layer_geo->middleWireOfGroup(lct.getKeyWG() + 1);
667  const LocalPoint& csc_intersect = layer_geo->intersectionOfStripAndWire(fractional_strip, wire);
668  const GlobalPoint& csc_gp = cscGeometry_->idToDet(keyId)->surface().toGlobal(csc_intersect);
669  return csc_gp;
670 }
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:100
const CSCGeometry * cscGeometry_
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
uint16_t getStrip(uint16_t n=2) const
return the key halfstrip from 0,159
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
float getFractionalStrip(uint16_t n=2) const
return the fractional strip
uint16_t getKeyWG() const
return the key wire group. counts from 0.
const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:91

◆ init()

void CSCStubMatcher::init ( const edm::Event e,
const edm::EventSetup eventSetup 
)

initialize the event

Definition at line 53 of file CSCStubMatcher.cc.

References edm::EventSetup::getData(), and iEvent.

53  {
54  if (useGEMs_)
55  gemDigiMatcher_->init(iEvent, iSetup);
56  cscDigiMatcher_->init(iEvent, iSetup);
57 
58  iEvent.getByToken(clctToken_, clctsH_);
59  iEvent.getByToken(alctToken_, alctsH_);
60  iEvent.getByToken(lctToken_, lctsH_);
61  iEvent.getByToken(mplctToken_, mplctsH_);
62 
63  cscGeometry_ = &iSetup.getData(geomToken_);
64 }
edm::EDGetTokenT< CSCCLCTDigiCollection > clctToken_
edm::Handle< CSCCorrelatedLCTDigiCollection > lctsH_
std::shared_ptr< CSCDigiMatcher > cscDigiMatcher_
const CSCGeometry * cscGeometry_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > mplctToken_
edm::Handle< CSCCLCTDigiCollection > clctsH_
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > lctToken_
edm::EDGetTokenT< CSCALCTDigiCollection > alctToken_
edm::Handle< CSCALCTDigiCollection > alctsH_
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > geomToken_
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher_
edm::Handle< CSCCorrelatedLCTDigiCollection > mplctsH_

◆ lctInChamber()

bool CSCStubMatcher::lctInChamber ( const CSCDetId id,
const CSCCorrelatedLCTDigi lct 
) const

Definition at line 640 of file CSCStubMatcher.cc.

640  {
641  for (const auto& stub : lctsInChamber(id.rawId())) {
642  if (stub == lct)
643  return true;
644  }
645  return false;
646 }
const CSCCorrelatedLCTDigiContainer & lctsInChamber(unsigned int) const

◆ lcts()

std::map<unsigned int, CSCCorrelatedLCTDigiContainer> CSCStubMatcher::lcts ( ) const
inline

Definition at line 62 of file CSCStubMatcher.h.

References chamber_to_lcts_.

62 { return chamber_to_lcts_; }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_lcts_

◆ lctsInChamber()

const CSCCorrelatedLCTDigiContainer & CSCStubMatcher::lctsInChamber ( unsigned int  detid) const

Definition at line 491 of file CSCStubMatcher.cc.

491  {
492  if (chamber_to_lcts_.find(detid) == chamber_to_lcts_.end())
493  return no_lcts_;
494  return chamber_to_lcts_.at(detid);
495 }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_lcts_
CSCCorrelatedLCTDigiContainer no_lcts_

◆ match()

void CSCStubMatcher::match ( const SimTrack t,
const SimVertex v 
)

do the matching

Definition at line 67 of file CSCStubMatcher.cc.

References l1ct::clear(), submitPVValidationJobs::t, and findQualityFiles::v.

67  {
68  // match simhits first
69  if (useGEMs_)
70  gemDigiMatcher_->match(t, v);
71  cscDigiMatcher_->match(t, v);
72 
77 
78  // clear collections
79  clear();
80 
81  if (!alctsH_.isValid()) {
82  edm::LogError("CSCStubMatcher") << "Cannot get ALCTs with label " << alctInputTag_.encode();
83  } else {
85  }
86 
87  if (!clctsH_.isValid()) {
88  edm::LogError("CSCStubMatcher") << "Cannot get CLCTs with label " << clctInputTag_.encode();
89  } else {
91  }
92 
93  if (!lctsH_.isValid()) {
94  edm::LogError("CSCStubMatcher") << "Cannot get LCTs with label " << lctInputTag_.encode();
95  } else {
97  }
98 
99  if (!mplctsH_.isValid()) {
100  edm::LogError("CSCStubMatcher") << "Cannot get MPLCTs with label " << mplctInputTag_.encode();
101  } else {
103  }
104 }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > mplcts() const
std::map< unsigned int, CSCALCTDigiContainer > alcts() const
edm::InputTag clctInputTag_
std::string encode() const
Definition: InputTag.cc:159
void matchMPLCTsToSimTrack(const CSCCorrelatedLCTDigiCollection &)
T const * product() const
Definition: Handle.h:70
edm::Handle< CSCCorrelatedLCTDigiCollection > lctsH_
std::shared_ptr< CSCDigiMatcher > cscDigiMatcher_
Log< level::Error, false > LogError
std::map< unsigned int, CSCCLCTDigiContainer > clcts() const
all matching lcts
edm::Handle< CSCCLCTDigiCollection > clctsH_
void matchLCTsToSimTrack(const CSCCorrelatedLCTDigiCollection &)
edm::InputTag mplctInputTag_
edm::Handle< CSCALCTDigiCollection > alctsH_
void matchALCTsToSimTrack(const CSCALCTDigiCollection &)
void matchCLCTsToSimTrack(const CSCCLCTDigiCollection &)
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher_
edm::Handle< CSCCorrelatedLCTDigiCollection > mplctsH_
edm::InputTag alctInputTag_
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag lctInputTag_
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > lcts() const

◆ matchALCTsToSimTrack()

void CSCStubMatcher::matchALCTsToSimTrack ( const CSCALCTDigiCollection alcts)
private

Definition at line 208 of file CSCStubMatcher.cc.

References a, CSCDetId::chamber(), filterCSVwithJSON::copy, gather_cfg::cout, CSCDetId::endcap(), spr::find(), globals_cff::id2, CSCDetId::ring(), relativeConstraints::ring, findQualityFiles::size, and CSCDetId::station().

208  {
209  const auto& anode_ids = cscDigiMatcher_->chamberIdsWire(0);
210  int n_minLayers = 0;
211  for (const auto& id : anode_ids) {
212  if (cscDigiMatcher_->nLayersWithWireInChamber(id) >= minNHitsChamberALCT_)
213  ++n_minLayers;
214  CSCDetId ch_id(id);
215 
216  // fill 1 WG wide gaps
217  const auto& digi_wgs = cscDigiMatcher_->wiregroupsInChamber(id, 1);
218  if (verboseALCT_) {
219  cout << "alct: digi_wgs " << ch_id << " ";
220  copy(digi_wgs.begin(), digi_wgs.end(), ostream_iterator<int>(cout, " "));
221  cout << endl;
222  }
223 
224  int ring = ch_id.ring();
225  if (ring == 4)
226  ring = 1; //use ME1b id to get ALCTs
227  CSCDetId ch_id2(ch_id.endcap(), ch_id.station(), ring, ch_id.chamber(), 0);
228  auto id2 = ch_id2.rawId(); // ALCTs should be sorted into the det of the ALCTs.
229 
230  const auto& alcts_in_det = alcts.get(ch_id2);
231  for (auto a = alcts_in_det.first; a != alcts_in_det.second; ++a) {
232  if (!a->isValid())
233  continue;
234 
235  if (verboseALCT_)
236  edm::LogInfo("CSCStubMatcher") << "alct " << ch_id << " " << *a;
237 
238  // check that the BX for stub wasn't too early or too late
239  if (a->getBX() < minBXALCT_ || a->getBX() > maxBXALCT_)
240  continue;
241 
242  int wg = a->getKeyWG() + 1; // as ALCT wiregroups numbers start from 0
243 
244  // store all ALCTs in this chamber
245  chamber_to_alcts_all_[id2].push_back(*a);
246 
247  // match by wiregroup with the digis
248  if (digi_wgs.find(wg) == digi_wgs.end()) {
249  continue;
250  }
251  if (verboseALCT_)
252  edm::LogInfo("CSCStubMatcher") << "alctGOOD";
253 
254  // store matching ALCTs in this chamber
256  chamber_to_alcts_[id2].push_back(*a);
257  }
258  }
259  if (chamber_to_alcts_[id2].size() > 2) {
260  edm::LogInfo("CSCStubMatcher") << "WARNING!!! too many ALCTs " << chamber_to_alcts_[id2].size() << " in "
261  << ch_id;
262  for (auto& a : chamber_to_alcts_[id2])
263  edm::LogInfo("CSCStubMatcher") << " " << a;
264  }
265  }
266 }
size
Write out results.
std::map< unsigned int, CSCALCTDigiContainer > alcts() const
std::shared_ptr< CSCDigiMatcher > cscDigiMatcher_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_
Log< level::Info, false > LogInfo
double a
Definition: hdecay.h:119
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_all_

◆ matchCLCTsToSimTrack()

void CSCStubMatcher::matchCLCTsToSimTrack ( const CSCCLCTDigiCollection clcts)
private

Definition at line 106 of file CSCStubMatcher.cc.

References HltBtagPostValidation_cff::c, CSCDetId::chamber(), CSCDetId::endcap(), spr::find(), globals_cff::id2, CSCDetId::maxLayerId(), CSCDetId::minLayerId(), or, AlCaHLTBitMon_ParallelJobs::p, submitPVResolutionJobs::q, relativeConstraints::ring, CSCDetId::ring(), findQualityFiles::size, and CSCDetId::station().

106  {
107  const auto& cathode_ids = cscDigiMatcher_->chamberIdsStrip(0);
108 
109  for (const auto& id : cathode_ids) {
110  CSCDetId ch_id(id);
111  if (verboseCLCT_) {
112  edm::LogInfo("CSCStubMatcher") << "To check CSC chamber " << ch_id;
113  }
114 
115  int ring = ch_id.ring();
116 
117  // do not consider CSCs with too few hits
118  if (cscDigiMatcher_->nLayersWithStripInChamber(ch_id) < minNHitsChamberCLCT_)
119  continue;
120 
121  // get the comparator digis in this chamber
122  std::vector<CSCComparatorDigiContainer> comps;
123  for (int ilayer = CSCDetId::minLayerId(); ilayer <= CSCDetId::maxLayerId(); ilayer++) {
124  CSCDetId layerid(ch_id.endcap(), ch_id.station(), ring, ch_id.chamber(), ilayer);
125  comps.push_back(cscDigiMatcher_->comparatorDigisInDetId(layerid));
126  }
127 
128  // print out the digis
129  if (verboseCLCT_) {
130  edm::LogInfo("CSCStubMatcher") << "clct: comparators " << ch_id;
131  int layer = 0;
132  for (const auto& p : comps) {
133  layer++;
134  for (const auto& q : p) {
135  edm::LogInfo("CSCStubMatcher") << "L" << layer << " " << q << " " << q.getHalfStrip() << " ";
136  }
137  }
138  }
139 
140  //use ME1b id to get CLCTs
141  const bool isME1a(ch_id.station() == 1 and ch_id.ring() == 4);
142  if (isME1a)
143  ring = 1;
144  CSCDetId ch_id2(ch_id.endcap(), ch_id.station(), ring, ch_id.chamber(), 0);
145  auto id2 = ch_id2.rawId(); // CLCTs should be sorted into the det of the CLCTs.
146 
147  const auto& clcts_in_det = clcts.get(ch_id2);
148 
149  for (auto c = clcts_in_det.first; c != clcts_in_det.second; ++c) {
150  if (verboseCLCT_)
151  edm::LogInfo("CSCStubMatcher") << "clct " << ch_id2 << " " << *c;
152 
153  if (!c->isValid())
154  continue;
155 
156  // check that the BX for this stub wasn't too early or too late
157  if (c->getBX() < minBXCLCT_ || c->getBX() > maxBXCLCT_)
158  continue;
159 
160  // store all CLCTs in this chamber
161  chamber_to_clcts_all_[id2].push_back(*c);
162 
163  // check that at least 3 comparator digis were matched!
164  int nMatches = 0;
165  int layer = 0;
166  for (const auto& p : comps) {
167  layer++;
168  for (const auto& q : p) {
169  if (verboseCLCT_)
170  edm::LogInfo("CSCStubMatcher") << "L" << layer << " " << q << " " << q.getHalfStrip() << " " << std::endl;
171  for (const auto& clctComp : (*c).getHits()[layer - 1]) {
172  if (clctComp == 65535)
173  continue;
174  if (verboseCLCT_) {
175  edm::LogInfo("CSCStubMatcher") << "\t" << clctComp << " ";
176  }
177  if (q.getHalfStrip() == clctComp or (isME1a and q.getHalfStrip() + 128 == clctComp)) {
178  nMatches++;
179  if (verboseCLCT_) {
180  edm::LogInfo("CSCStubMatcher") << "\t\tnMatches " << nMatches << std::endl;
181  }
182  }
183  }
184  }
185  }
186 
187  // require at least 3 good matches
188  if (nMatches < 3)
189  continue;
190 
191  if (verboseCLCT_)
192  edm::LogInfo("CSCStubMatcher") << "clctGOOD";
193 
194  // store matching CLCTs in this chamber
196  chamber_to_clcts_[id2].push_back(*c);
197  }
198  }
199  if (chamber_to_clcts_[id2].size() > 2) {
200  edm::LogInfo("CSCStubMatcher") << "WARNING!!! too many CLCTs " << chamber_to_clcts_[id2].size() << " in "
201  << ch_id2;
202  for (auto& c : chamber_to_clcts_[id2])
203  edm::LogInfo("CSCStubMatcher") << " " << c;
204  }
205  }
206 }
size
Write out results.
std::shared_ptr< CSCDigiMatcher > cscDigiMatcher_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
std::map< unsigned int, CSCCLCTDigiContainer > clcts() const
all matching lcts
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_all_
Log< level::Info, false > LogInfo
static int minLayerId()
Definition: CSCDetId.h:242
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_
static int maxLayerId()
Definition: CSCDetId.h:243

◆ matchLCTsToSimTrack()

void CSCStubMatcher::matchLCTsToSimTrack ( const CSCCorrelatedLCTDigiCollection lcts)
private

Definition at line 268 of file CSCStubMatcher.cc.

References simKBmtfDigis_cfi::bx, CSCDetId::chamber(), CSCDetId::endcap(), spr::find(), globals_cff::id2, or, AlCaHLTBitMon_ParallelJobs::p, CSCDetId::ring(), relativeConstraints::ring, findQualityFiles::size, CSCDetId::station(), and CSCDetId::zendcap().

268  {
269  // only look for stubs in chambers that already have CLCT and ALCT
270  const auto& cathode_ids = chamberIdsAllCLCT(0);
271  const auto& anode_ids = chamberIdsAllALCT(0);
272 
273  std::set<int> cathode_and_anode_ids;
274  std::set_union(cathode_ids.begin(),
275  cathode_ids.end(),
276  anode_ids.begin(),
277  anode_ids.end(),
278  std::inserter(cathode_and_anode_ids, cathode_and_anode_ids.end()));
279 
280  for (const auto& id : cathode_and_anode_ids) {
281  int iLct = -1;
282 
283  CSCDetId ch_id(id);
284 
285  //use ME1b id to get LCTs
286  int ring = ch_id.ring();
287  if (ring == 4)
288  ring = 1;
289  CSCDetId ch_id2(ch_id.endcap(), ch_id.station(), ring, ch_id.chamber(), 0);
290  auto id2 = ch_id2.rawId(); // LCTs should be sorted into the det of the LCTs.
291 
292  const auto& lcts_in_det = lcts.get(ch_id2);
293 
294  std::map<int, CSCCorrelatedLCTDigiContainer> bx_to_lcts;
295 
296  // collect all valid LCTs in a handy container
298  for (auto lct = lcts_in_det.first; lct != lcts_in_det.second; ++lct) {
299  if (!lct->isValid())
300  continue;
301  lcts_tmp.push_back(*lct);
302  int bx = lct->getBX();
303  bx_to_lcts[bx].push_back(*lct);
304 
305  // Add ghost LCTs when there are two in bx
306  // and the two don't share half-strip or wiregroup
307  if (bx_to_lcts[bx].size() == 2 and addGhostLCTs_) {
308  auto lct11 = bx_to_lcts[bx][0];
309  auto lct22 = bx_to_lcts[bx][1];
310  addGhostLCTs(lct11, lct22, lcts_tmp);
311  }
312  }
313 
314  for (const auto& lct : lcts_tmp) {
315  iLct++;
316 
317  bool lct_clct_match(false);
318  bool lct_alct_match(false);
319  bool lct_gem1_match(false);
320  bool lct_gem2_match(false);
321 
322  if (verboseLCT_) {
323  edm::LogInfo("CSCStubMatcher") << ch_id << " " << ch_id2;
324  edm::LogInfo("CSCStubMatcher") << lct;
325  edm::LogInfo("CSCStubMatcher") << "getCLCT " << lct.getCLCT() << "\ngetALCT " << lct.getALCT() << "\ngetGEM1 "
326  << lct.getGEM1() << "\ngetGEM2 " << lct.getGEM2();
327  }
328  // Check if matched to an CLCT
329  for (const auto& p : clctsInChamber(id)) {
330  if (p == lct.getCLCT()) {
331  lct_clct_match = true;
332  if (verboseLCT_)
333  edm::LogInfo("CSCStubMatcher") << "\t...lct_clct_match";
334  break;
335  }
336  }
337 
338  // Check if matched to an ALCT
339  for (const auto& p : alctsInChamber(id)) {
340  if (p == lct.getALCT()) {
341  lct_alct_match = true;
342  if (verboseLCT_)
343  edm::LogInfo("CSCStubMatcher") << "\t...lct_alct_match";
344  break;
345  }
346  }
347 
348  if (useGEMs_) {
349  // fixME here: double check the timing of GEMPad
350  if (ch_id.ring() == 1 and (ch_id.station() == 1 or ch_id.station() == 2)) {
351  // Check if matched to an GEM pad L1
352  const GEMDetId gemDetIdL1(ch_id.zendcap(), 1, ch_id.station(), 1, ch_id.chamber(), 0);
353  for (const auto& p : gemDigiMatcher_->padsInChamber(gemDetIdL1.rawId())) {
354  if (p == lct.getGEM1()) {
355  lct_gem1_match = true;
356  if (verboseLCT_)
357  edm::LogInfo("CSCStubMatcher") << "\t...lct_gem1_match";
358  break;
359  }
360  }
361 
362  // Check if matched to an GEM pad L2
363  const GEMDetId gemDetIdL2(ch_id.zendcap(), 1, ch_id.station(), 2, ch_id.chamber(), 0);
364  for (const auto& p : gemDigiMatcher_->padsInChamber(gemDetIdL2.rawId())) {
365  if (p == lct.getGEM2()) {
366  lct_gem2_match = true;
367  if (verboseLCT_)
368  edm::LogInfo("CSCStubMatcher") << "\t...lct_gem2_match";
369  break;
370  }
371  }
372  }
373  }
374 
375  const bool alct_clct = lct_clct_match and lct_alct_match;
376  const bool alct_gem = lct_alct_match and lct_gem1_match and lct_gem2_match;
377  const bool clct_gem = lct_clct_match and lct_gem1_match and lct_gem2_match;
378 
379  bool lct_tight_matched = alct_clct or alct_gem or clct_gem;
380  bool lct_loose_matched = lct_clct_match or lct_alct_match;
381  bool lct_matched = matchTypeTightLCT_ ? lct_tight_matched : lct_loose_matched;
382 
383  if (lct_matched) {
384  if (verboseLCT_)
385  edm::LogInfo("CSCStubMatcher") << "...was matched";
387  chamber_to_lcts_[id2].emplace_back(lct);
388  }
389  }
390  } // lct loop over
391  }
392 }
size
Write out results.
std::set< unsigned int > chamberIdsAllALCT(int csc_type=MuonHitHelper::CSC_ALL) const
std::set< unsigned int > chamberIdsAllCLCT(int csc_type=MuonHitHelper::CSC_ALL) const
crossed chamber detIds with not necessarily matching stubs
std::vector< CSCCorrelatedLCTDigi > CSCCorrelatedLCTDigiContainer
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_lcts_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
const CSCCLCTDigiContainer & clctsInChamber(unsigned int) const
all matching from a particular crossed chamber
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
const CSCALCTDigiContainer & alctsInChamber(unsigned int) const
Log< level::Info, false > LogInfo
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher_
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > lcts() const
void addGhostLCTs(const CSCCorrelatedLCTDigi &lct11, const CSCCorrelatedLCTDigi &lct22, CSCCorrelatedLCTDigiContainer &lctcontainer) const

◆ matchMPLCTsToSimTrack()

void CSCStubMatcher::matchMPLCTsToSimTrack ( const CSCCorrelatedLCTDigiCollection mplcts)
private

Definition at line 394 of file CSCStubMatcher.cc.

References spr::find(), and l1ctLayer2EG_cff::id.

394  {
395  // match simtrack to MPC LCT by looking only in chambers
396  // that already have LCTs matched to this simtrack
397  const auto& lcts_ids = chamberIdsLCT(0);
398 
399  // loop on the detids
400  for (const auto& id : lcts_ids) {
401  const auto& mplcts_in_det = mplcts.get(id);
402 
403  // loop on the MPC LCTs in this detid
404  for (auto lct = mplcts_in_det.first; lct != mplcts_in_det.second; ++lct) {
405  if (!lct->isValid())
406  continue;
407 
408  chamber_to_mplcts_all_[id].emplace_back(*lct);
409 
410  // check if this stub corresponds with a previously matched stub
411  for (const auto& sim_stub : lctsInChamber(id)) {
412  if (sim_stub == *lct) {
413  if (std::find(chamber_to_mplcts_[id].begin(), chamber_to_mplcts_[id].end(), *lct) ==
414  chamber_to_mplcts_[id].end()) {
415  chamber_to_mplcts_[id].emplace_back(*lct);
416  }
417  }
418  }
419  }
420  }
421 }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > mplcts() const
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_all_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_
std::set< unsigned int > chamberIdsLCT(int csc_type=MuonHitHelper::CSC_ALL) const
const CSCCorrelatedLCTDigiContainer & lctsInChamber(unsigned int) const

◆ mplcts()

std::map<unsigned int, CSCCorrelatedLCTDigiContainer> CSCStubMatcher::mplcts ( ) const
inline

Definition at line 63 of file CSCStubMatcher.h.

References chamber_to_mplcts_.

63 { return chamber_to_mplcts_; }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_

◆ mplctsInChamber()

const CSCCorrelatedLCTDigiContainer & CSCStubMatcher::mplctsInChamber ( unsigned int  detid) const

Definition at line 497 of file CSCStubMatcher.cc.

497  {
498  if (chamber_to_mplcts_.find(detid) == chamber_to_mplcts_.end())
499  return no_mplcts_;
500  return chamber_to_mplcts_.at(detid);
501 }
CSCCorrelatedLCTDigiContainer no_mplcts_
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_

◆ nChambersWithALCT()

int CSCStubMatcher::nChambersWithALCT ( int  min_quality = 0) const

Definition at line 580 of file CSCStubMatcher.cc.

References mps_fire::result.

580  {
581  int result = 0;
582  const auto& chamber_ids = chamberIdsALCT();
583  for (const auto& id : chamber_ids) {
584  int nStubChamber = 0;
585  const auto& alcts = alctsInChamber(id);
586  for (const auto& alct : alcts) {
587  if (!alct.isValid())
588  continue;
589  if (alct.getQuality() >= min_quality) {
590  nStubChamber++;
591  }
592  }
593  if (nStubChamber > 0) {
594  ++result;
595  }
596  }
597  return result;
598 }
std::map< unsigned int, CSCALCTDigiContainer > alcts() const
std::set< unsigned int > chamberIdsALCT(int csc_type=MuonHitHelper::CSC_ALL) const
const CSCALCTDigiContainer & alctsInChamber(unsigned int) const

◆ nChambersWithCLCT()

int CSCStubMatcher::nChambersWithCLCT ( int  min_quality = 0) const

How many CSC chambers with matching stubs of some minimal quality did this SimTrack hit?

Definition at line 560 of file CSCStubMatcher.cc.

References mps_fire::result.

560  {
561  int result = 0;
562  const auto& chamber_ids = chamberIdsCLCT();
563  for (const auto& id : chamber_ids) {
564  int nStubChamber = 0;
565  const auto& clcts = clctsInChamber(id);
566  for (const auto& clct : clcts) {
567  if (!clct.isValid())
568  continue;
569  if (clct.getQuality() >= min_quality) {
570  nStubChamber++;
571  }
572  }
573  if (nStubChamber > 0) {
574  ++result;
575  }
576  }
577  return result;
578 }
std::map< unsigned int, CSCCLCTDigiContainer > clcts() const
all matching lcts
const CSCCLCTDigiContainer & clctsInChamber(unsigned int) const
all matching from a particular crossed chamber
std::set< unsigned int > chamberIdsCLCT(int csc_type=MuonHitHelper::CSC_ALL) const
chamber detIds with matching stubs

◆ nChambersWithLCT()

int CSCStubMatcher::nChambersWithLCT ( int  min_quality = 0) const

Definition at line 600 of file CSCStubMatcher.cc.

References mps_fire::result.

600  {
601  int result = 0;
602  const auto& chamber_ids = chamberIdsLCT();
603  for (const auto& id : chamber_ids) {
604  int nStubChamber = 0;
605  const auto& lcts = lctsInChamber(id);
606  for (const auto& lct : lcts) {
607  if (!lct.isValid())
608  continue;
609  if (lct.getQuality() >= min_quality) {
610  nStubChamber++;
611  }
612  }
613  if (nStubChamber > 0) {
614  ++result;
615  }
616  }
617  return result;
618 }
std::set< unsigned int > chamberIdsLCT(int csc_type=MuonHitHelper::CSC_ALL) const
const CSCCorrelatedLCTDigiContainer & lctsInChamber(unsigned int) const
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > lcts() const

◆ nChambersWithMPLCT()

int CSCStubMatcher::nChambersWithMPLCT ( int  min_quality = 0) const

Definition at line 620 of file CSCStubMatcher.cc.

References mps_fire::result.

620  {
621  int result = 0;
622  const auto& chamber_ids = chamberIdsMPLCT();
623  for (const auto& id : chamber_ids) {
624  int nStubChamber = 0;
625  const auto& mplcts = mplctsInChamber(id);
626  for (const auto& mplct : mplcts) {
627  if (!mplct.isValid())
628  continue;
629  if (mplct.getQuality() >= min_quality) {
630  nStubChamber++;
631  }
632  }
633  if (nStubChamber > 0) {
634  ++result;
635  }
636  }
637  return result;
638 }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > mplcts() const
std::set< unsigned int > chamberIdsMPLCT(int csc_type=MuonHitHelper::CSC_ALL) const
const CSCCorrelatedLCTDigiContainer & mplctsInChamber(unsigned int) const

◆ selectDetIds()

template<class D >
std::set< unsigned int > CSCStubMatcher::selectDetIds ( D &  digis,
int  csc_type 
) const
private

Definition at line 164 of file CSCStubMatcher.h.

References AlCaHLTBitMon_ParallelJobs::p, mps_fire::result, CSCDetId::ring(), CSCDetId::station(), and MuonHitHelper::toCSCType().

164  {
165  std::set<unsigned int> result;
166  for (auto& p : digis) {
167  auto id = p.first;
168  if (csc_type > 0) {
169  CSCDetId detId(id);
170  if (MuonHitHelper::toCSCType(detId.station(), detId.ring()) != csc_type)
171  continue;
172  }
173  result.insert(p.first);
174  }
175  return result;
176 }
static int toCSCType(int st, int ri)

◆ zpositionOfLayer()

float CSCStubMatcher::zpositionOfLayer ( unsigned int  detid,
int  layer 
) const

Definition at line 554 of file CSCStubMatcher.cc.

References relativeConstraints::chamber.

554  {
555  const auto& id = CSCDetId(detid);
556  const auto& chamber(cscGeometry_->chamber(id));
557  return fabs(chamber->layer(layer)->centerOfStrip(20).z());
558 }
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:100
const CSCGeometry * cscGeometry_
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer

Member Data Documentation

◆ addGhostLCTs_

bool CSCStubMatcher::addGhostLCTs_
private

Definition at line 136 of file CSCStubMatcher.h.

◆ alctInputTag_

edm::InputTag CSCStubMatcher::alctInputTag_
private

Definition at line 101 of file CSCStubMatcher.h.

◆ alctsH_

edm::Handle<CSCALCTDigiCollection> CSCStubMatcher::alctsH_
private

Definition at line 111 of file CSCStubMatcher.h.

◆ alctToken_

edm::EDGetTokenT<CSCALCTDigiCollection> CSCStubMatcher::alctToken_
private

Definition at line 106 of file CSCStubMatcher.h.

◆ chamber_to_alcts_

std::map<unsigned int, CSCALCTDigiContainer> CSCStubMatcher::chamber_to_alcts_
private

Definition at line 129 of file CSCStubMatcher.h.

Referenced by alcts().

◆ chamber_to_alcts_all_

std::map<unsigned int, CSCALCTDigiContainer> CSCStubMatcher::chamber_to_alcts_all_
private

Definition at line 123 of file CSCStubMatcher.h.

◆ chamber_to_clcts_

std::map<unsigned int, CSCCLCTDigiContainer> CSCStubMatcher::chamber_to_clcts_
private

Definition at line 128 of file CSCStubMatcher.h.

Referenced by clcts().

◆ chamber_to_clcts_all_

std::map<unsigned int, CSCCLCTDigiContainer> CSCStubMatcher::chamber_to_clcts_all_
private

Definition at line 122 of file CSCStubMatcher.h.

◆ chamber_to_lcts_

std::map<unsigned int, CSCCorrelatedLCTDigiContainer> CSCStubMatcher::chamber_to_lcts_
private

Definition at line 130 of file CSCStubMatcher.h.

Referenced by lcts().

◆ chamber_to_lcts_all_

std::map<unsigned int, CSCCorrelatedLCTDigiContainer> CSCStubMatcher::chamber_to_lcts_all_
private

Definition at line 124 of file CSCStubMatcher.h.

◆ chamber_to_mplcts_

std::map<unsigned int, CSCCorrelatedLCTDigiContainer> CSCStubMatcher::chamber_to_mplcts_
private

Definition at line 131 of file CSCStubMatcher.h.

Referenced by mplcts().

◆ chamber_to_mplcts_all_

std::map<unsigned int, CSCCorrelatedLCTDigiContainer> CSCStubMatcher::chamber_to_mplcts_all_
private

Definition at line 125 of file CSCStubMatcher.h.

◆ clctInputTag_

edm::InputTag CSCStubMatcher::clctInputTag_
private

Definition at line 100 of file CSCStubMatcher.h.

◆ clctsH_

edm::Handle<CSCCLCTDigiCollection> CSCStubMatcher::clctsH_
private

Definition at line 110 of file CSCStubMatcher.h.

◆ clctToken_

edm::EDGetTokenT<CSCCLCTDigiCollection> CSCStubMatcher::clctToken_
private

Definition at line 105 of file CSCStubMatcher.h.

◆ cscDigiMatcher_

std::shared_ptr<CSCDigiMatcher> CSCStubMatcher::cscDigiMatcher_
private

Definition at line 115 of file CSCStubMatcher.h.

Referenced by cscDigiMatcher().

◆ cscGeometry_

const CSCGeometry* CSCStubMatcher::cscGeometry_
private

Definition at line 119 of file CSCStubMatcher.h.

◆ gemDigiMatcher_

std::shared_ptr<GEMDigiMatcher> CSCStubMatcher::gemDigiMatcher_
private

Definition at line 116 of file CSCStubMatcher.h.

Referenced by gemDigiMatcher().

◆ geomToken_

edm::ESGetToken<CSCGeometry, MuonGeometryRecord> CSCStubMatcher::geomToken_
private

Definition at line 118 of file CSCStubMatcher.h.

◆ lctInputTag_

edm::InputTag CSCStubMatcher::lctInputTag_
private

Definition at line 102 of file CSCStubMatcher.h.

◆ lctsH_

edm::Handle<CSCCorrelatedLCTDigiCollection> CSCStubMatcher::lctsH_
private

Definition at line 112 of file CSCStubMatcher.h.

◆ lctToken_

edm::EDGetTokenT<CSCCorrelatedLCTDigiCollection> CSCStubMatcher::lctToken_
private

Definition at line 107 of file CSCStubMatcher.h.

◆ matchTypeTightLCT_

bool CSCStubMatcher::matchTypeTightLCT_
private

Definition at line 139 of file CSCStubMatcher.h.

◆ maxBXALCT_

int CSCStubMatcher::maxBXALCT_
private

Definition at line 153 of file CSCStubMatcher.h.

◆ maxBXCLCT_

int CSCStubMatcher::maxBXCLCT_
private

Definition at line 152 of file CSCStubMatcher.h.

◆ maxBXLCT_

int CSCStubMatcher::maxBXLCT_
private

Definition at line 154 of file CSCStubMatcher.h.

◆ maxBXMPLCT_

int CSCStubMatcher::maxBXMPLCT_
private

Definition at line 155 of file CSCStubMatcher.h.

◆ minBXALCT_

int CSCStubMatcher::minBXALCT_
private

Definition at line 153 of file CSCStubMatcher.h.

◆ minBXCLCT_

int CSCStubMatcher::minBXCLCT_
private

Definition at line 152 of file CSCStubMatcher.h.

◆ minBXLCT_

int CSCStubMatcher::minBXLCT_
private

Definition at line 154 of file CSCStubMatcher.h.

◆ minBXMPLCT_

int CSCStubMatcher::minBXMPLCT_
private

Definition at line 155 of file CSCStubMatcher.h.

◆ minNHitsChamber_

int CSCStubMatcher::minNHitsChamber_
private

Definition at line 141 of file CSCStubMatcher.h.

◆ minNHitsChamberALCT_

int CSCStubMatcher::minNHitsChamberALCT_
private

Definition at line 142 of file CSCStubMatcher.h.

◆ minNHitsChamberCLCT_

int CSCStubMatcher::minNHitsChamberCLCT_
private

Definition at line 143 of file CSCStubMatcher.h.

◆ minNHitsChamberLCT_

int CSCStubMatcher::minNHitsChamberLCT_
private

Definition at line 144 of file CSCStubMatcher.h.

◆ minNHitsChamberMPLCT_

int CSCStubMatcher::minNHitsChamberMPLCT_
private

Definition at line 145 of file CSCStubMatcher.h.

◆ mplctInputTag_

edm::InputTag CSCStubMatcher::mplctInputTag_
private

Definition at line 103 of file CSCStubMatcher.h.

◆ mplctsH_

edm::Handle<CSCCorrelatedLCTDigiCollection> CSCStubMatcher::mplctsH_
private

Definition at line 113 of file CSCStubMatcher.h.

◆ mplctToken_

edm::EDGetTokenT<CSCCorrelatedLCTDigiCollection> CSCStubMatcher::mplctToken_
private

Definition at line 108 of file CSCStubMatcher.h.

◆ no_alcts_

CSCALCTDigiContainer CSCStubMatcher::no_alcts_
private

Definition at line 158 of file CSCStubMatcher.h.

◆ no_clcts_

CSCCLCTDigiContainer CSCStubMatcher::no_clcts_
private

Definition at line 157 of file CSCStubMatcher.h.

◆ no_lcts_

CSCCorrelatedLCTDigiContainer CSCStubMatcher::no_lcts_
private

Definition at line 159 of file CSCStubMatcher.h.

◆ no_mplcts_

CSCCorrelatedLCTDigiContainer CSCStubMatcher::no_mplcts_
private

Definition at line 160 of file CSCStubMatcher.h.

◆ useGEMs_

bool CSCStubMatcher::useGEMs_
private

Definition at line 137 of file CSCStubMatcher.h.

◆ verboseALCT_

bool CSCStubMatcher::verboseALCT_
private

Definition at line 147 of file CSCStubMatcher.h.

◆ verboseCLCT_

bool CSCStubMatcher::verboseCLCT_
private

Definition at line 148 of file CSCStubMatcher.h.

◆ verboseLCT_

bool CSCStubMatcher::verboseLCT_
private

Definition at line 149 of file CSCStubMatcher.h.

◆ verboseMPLCT_

bool CSCStubMatcher::verboseMPLCT_
private

Definition at line 150 of file CSCStubMatcher.h.