CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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,
CSCALCTDigiContainer
alcts () 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
CSCCorrelatedLCTDigiContainer
allLCTsInChamber (unsigned int) const
 
const
CSCCorrelatedLCTDigiContainer
allMPLCTsInChamber (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,
CSCCLCTDigiContainer
clcts () 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,
CSCCorrelatedLCTDigiContainer
lcts () const
 
const
CSCCorrelatedLCTDigiContainer
lctsInChamber (unsigned int) const
 
void match (const SimTrack &t, const SimVertex &v)
 do the matching More...
 
std::map< unsigned int,
CSCCorrelatedLCTDigiContainer
mplcts () const
 
const
CSCCorrelatedLCTDigiContainer
mplctsInChamber (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
< CSCALCTDigiCollection
alctsH_
 
edm::EDGetTokenT
< CSCALCTDigiCollection
alctToken_
 
std::map< unsigned int,
CSCALCTDigiContainer
chamber_to_alcts_
 
std::map< unsigned int,
CSCALCTDigiContainer
chamber_to_alcts_all_
 
std::map< unsigned int,
CSCCLCTDigiContainer
chamber_to_clcts_
 
std::map< unsigned int,
CSCCLCTDigiContainer
chamber_to_clcts_all_
 
std::map< unsigned int,
CSCCorrelatedLCTDigiContainer
chamber_to_lcts_
 
std::map< unsigned int,
CSCCorrelatedLCTDigiContainer
chamber_to_lcts_all_
 
std::map< unsigned int,
CSCCorrelatedLCTDigiContainer
chamber_to_mplcts_
 
std::map< unsigned int,
CSCCorrelatedLCTDigiContainer
chamber_to_mplcts_all_
 
edm::InputTag clctInputTag_
 
edm::Handle
< CSCCLCTDigiCollection
clctsH_
 
edm::EDGetTokenT
< CSCCLCTDigiCollection
clctToken_
 
std::shared_ptr< CSCDigiMatchercscDigiMatcher_
 
const CSCGeometrycscGeometry_
 
std::shared_ptr< GEMDigiMatchergemDigiMatcher_
 
edm::ESGetToken< CSCGeometry,
MuonGeometryRecord
geomToken_
 
edm::InputTag lctInputTag_
 
edm::Handle
< CSCCorrelatedLCTDigiCollection
lctsH_
 
edm::EDGetTokenT
< CSCCorrelatedLCTDigiCollection
lctToken_
 
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
< CSCCorrelatedLCTDigiCollection
mplctsH_
 
edm::EDGetTokenT
< CSCCorrelatedLCTDigiCollection
mplctToken_
 
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 ( edm::ParameterSet const &  iPS,
edm::ConsumesCollector &&  iC 
)

Definition at line 7 of file CSCStubMatcher.cc.

References 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  verboseLCT_ = cscLCT.getParameter<int>("verbose");
26  minNHitsChamberLCT_ = cscLCT.getParameter<int>("minNHitsChamber");
27  addGhostLCTs_ = cscLCT.getParameter<bool>("addGhosts");
28 
29  const auto& cscMPLCT = pSet.getParameter<edm::ParameterSet>("cscMPLCT");
30  minBXMPLCT_ = cscMPLCT.getParameter<int>("minBX");
31  maxBXMPLCT_ = cscMPLCT.getParameter<int>("maxBX");
32  verboseMPLCT_ = cscMPLCT.getParameter<int>("verbose");
33  minNHitsChamberMPLCT_ = cscMPLCT.getParameter<int>("minNHitsChamber");
34 
35  if (useGEMs_)
36  gemDigiMatcher_.reset(new GEMDigiMatcher(pSet, std::move(iC)));
37  cscDigiMatcher_.reset(new CSCDigiMatcher(pSet, std::move(iC)));
38 
39  clctInputTag_ = cscCLCT.getParameter<edm::InputTag>("inputTag");
40  alctInputTag_ = cscALCT.getParameter<edm::InputTag>("inputTag");
41  lctInputTag_ = cscLCT.getParameter<edm::InputTag>("inputTag");
42  mplctInputTag_ = cscMPLCT.getParameter<edm::InputTag>("inputTag");
43 
48 
50 }
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_
def move
Definition: eostools.py:511
edm::EDGetTokenT< CSCALCTDigiCollection > alctToken_
edm::InputTag mplctInputTag_
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > geomToken_
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher_
edm::InputTag alctInputTag_
edm::InputTag lctInputTag_
CSCStubMatcher::~CSCStubMatcher ( )
inline

Definition at line 27 of file CSCStubMatcher.h.

27 {}

Member Function Documentation

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

Definition at line 672 of file CSCStubMatcher.cc.

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

674  {
675  int wg1 = lct11.getKeyWG();
676  int wg2 = lct22.getKeyWG();
677  int hs1 = lct11.getStrip();
678  int hs2 = lct22.getStrip();
679 
680  if (!(wg1 == wg2 || hs1 == hs2)) {
681  // flip the ALCTs
682  CSCCorrelatedLCTDigi lct12 = lct11;
683  lct12.setWireGroup(wg2);
684  lct12.setALCT(lct22.getALCT());
685  lct12.setCLCT(lct11.getCLCT());
686  lcts_tmp.push_back(lct12);
687 
688  CSCCorrelatedLCTDigi lct21 = lct22;
689  lct21.setWireGroup(wg1);
690  lct21.setALCT(lct11.getALCT());
691  lct21.setCLCT(lct22.getCLCT());
692  lcts_tmp.push_back(lct21);
693  }
694 }
const CSCALCTDigi & getALCT() const
void setALCT(const CSCALCTDigi &alct)
const CSCCLCTDigi & getCLCT() const
void setWireGroup(const uint16_t wiregroup)
set wiregroup number
uint16_t getKeyWG() const
return the key wire group. counts from 0.
uint16_t getStrip(uint16_t n=2) const
return the key halfstrip from 0,159
void setCLCT(const CSCCLCTDigi &clct)
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_
const CSCALCTDigiContainer & CSCStubMatcher::alctsInChamber ( unsigned int  detid) const

Definition at line 479 of file CSCStubMatcher.cc.

479  {
480  if (chamber_to_alcts_.find(detid) == chamber_to_alcts_.end())
481  return no_alcts_;
482  return chamber_to_alcts_.at(detid);
483 }
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_
CSCALCTDigiContainer no_alcts_
const CSCALCTDigiContainer & CSCStubMatcher::allALCTsInChamber ( unsigned int  detid) const

Definition at line 455 of file CSCStubMatcher.cc.

455  {
456  if (chamber_to_alcts_all_.find(detid) == chamber_to_alcts_all_.end())
457  return no_alcts_;
458  return chamber_to_alcts_all_.at(detid);
459 }
CSCALCTDigiContainer no_alcts_
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_all_
const CSCCLCTDigiContainer & CSCStubMatcher::allCLCTsInChamber ( unsigned int  detid) const

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

Definition at line 449 of file CSCStubMatcher.cc.

449  {
450  if (chamber_to_clcts_all_.find(detid) == chamber_to_clcts_all_.end())
451  return no_clcts_;
452  return chamber_to_clcts_all_.at(detid);
453 }
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_all_
CSCCLCTDigiContainer no_clcts_
const CSCCorrelatedLCTDigiContainer & CSCStubMatcher::allLCTsInChamber ( unsigned int  detid) const

Definition at line 461 of file CSCStubMatcher.cc.

461  {
462  if (chamber_to_lcts_all_.find(detid) == chamber_to_lcts_all_.end())
463  return no_lcts_;
464  return chamber_to_lcts_all_.at(detid);
465 }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_lcts_all_
CSCCorrelatedLCTDigiContainer no_lcts_
const CSCCorrelatedLCTDigiContainer & CSCStubMatcher::allMPLCTsInChamber ( unsigned int  detid) const

Definition at line 467 of file CSCStubMatcher.cc.

467  {
468  if (chamber_to_mplcts_all_.find(detid) == chamber_to_mplcts_all_.end())
469  return no_mplcts_;
470  return chamber_to_mplcts_all_.at(detid);
471 }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_all_
CSCCorrelatedLCTDigiContainer no_mplcts_
CSCALCTDigi CSCStubMatcher::bestAlctInChamber ( unsigned int  detid) const

Definition at line 514 of file CSCStubMatcher.cc.

References mps_fire::i, input, and quality.

514  {
515  //sort stubs based on quality
516  const auto& input(alctsInChamber(detid));
517  int bestQ = 0;
518  int index = -1;
519  for (unsigned int i = 0; i < input.size(); ++i) {
520  int quality = input[i].getQuality();
521  if (quality > bestQ) {
522  bestQ = quality;
523  index = i;
524  }
525  }
526  if (index != -1)
527  return input[index];
528  return CSCALCTDigi();
529 }
uint32_t const *__restrict__ Quality * quality
static std::string const input
Definition: EdmProvDump.cc:47
const CSCALCTDigiContainer & alctsInChamber(unsigned int) const
CSCCLCTDigi CSCStubMatcher::bestClctInChamber ( unsigned int  detid) const

best matching from a particular crossed chamber

Definition at line 497 of file CSCStubMatcher.cc.

References mps_fire::i, input, and quality.

497  {
498  //sort stubs based on quality
499  const auto& input(clctsInChamber(detid));
500  int bestQ = 0;
501  int index = -1;
502  for (unsigned int i = 0; i < input.size(); ++i) {
503  int quality = input[i].getQuality();
504  if (quality > bestQ) {
505  bestQ = quality;
506  index = i;
507  }
508  }
509  if (index != -1)
510  return input[index];
511  return CSCCLCTDigi();
512 }
uint32_t const *__restrict__ Quality * quality
const CSCCLCTDigiContainer & clctsInChamber(unsigned int) const
all matching from a particular crossed chamber
static std::string const input
Definition: EdmProvDump.cc:47
CSCCorrelatedLCTDigi CSCStubMatcher::bestLctInChamber ( unsigned int  detid) const

Definition at line 531 of file CSCStubMatcher.cc.

References mps_fire::i, input, and quality.

531  {
532  //sort stubs based on quality
533  const auto& input(lctsInChamber(detid));
534  int bestQ = 0;
535  int index = -1;
536  for (unsigned int i = 0; i < input.size(); ++i) {
537  int quality = input[i].getQuality();
538  if (quality > bestQ) {
539  bestQ = quality;
540  index = i;
541  }
542  }
543  if (index != -1)
544  return input[index];
545  return CSCCorrelatedLCTDigi();
546 }
uint32_t const *__restrict__ Quality * quality
static std::string const input
Definition: EdmProvDump.cc:47
const CSCCorrelatedLCTDigiContainer & lctsInChamber(unsigned int) const
CSCCorrelatedLCTDigi CSCStubMatcher::bestMplctInChamber ( unsigned  int) const
std::set< unsigned int > CSCStubMatcher::chamberIdsALCT ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 437 of file CSCStubMatcher.cc.

437  {
438  return selectDetIds(chamber_to_alcts_, csc_type);
439 }
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_
std::set< unsigned int > selectDetIds(D &, int) const
std::set< unsigned int > CSCStubMatcher::chamberIdsAllALCT ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 421 of file CSCStubMatcher.cc.

421  {
422  return selectDetIds(chamber_to_alcts_all_, csc_type);
423 }
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_all_
std::set< unsigned int > selectDetIds(D &, int) const
std::set< unsigned int > CSCStubMatcher::chamberIdsAllCLCT ( int  csc_type = MuonHitHelper::CSC_ALL) const

crossed chamber detIds with not necessarily matching stubs

Definition at line 417 of file CSCStubMatcher.cc.

417  {
418  return selectDetIds(chamber_to_clcts_all_, csc_type);
419 }
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_all_
std::set< unsigned int > selectDetIds(D &, int) const
std::set< unsigned int > CSCStubMatcher::chamberIdsAllLCT ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 425 of file CSCStubMatcher.cc.

425  {
426  return selectDetIds(chamber_to_lcts_all_, csc_type);
427 }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_lcts_all_
std::set< unsigned int > selectDetIds(D &, int) const
std::set< unsigned int > CSCStubMatcher::chamberIdsAllMPLCT ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 429 of file CSCStubMatcher.cc.

429  {
430  return selectDetIds(chamber_to_mplcts_all_, csc_type);
431 }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_all_
std::set< unsigned int > selectDetIds(D &, int) const
std::set< unsigned int > CSCStubMatcher::chamberIdsCLCT ( int  csc_type = MuonHitHelper::CSC_ALL) const

chamber detIds with matching stubs

Definition at line 433 of file CSCStubMatcher.cc.

433  {
434  return selectDetIds(chamber_to_clcts_, csc_type);
435 }
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_
std::set< unsigned int > selectDetIds(D &, int) const
std::set< unsigned int > CSCStubMatcher::chamberIdsLCT ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 441 of file CSCStubMatcher.cc.

441  {
442  return selectDetIds(chamber_to_lcts_, csc_type);
443 }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_lcts_
std::set< unsigned int > selectDetIds(D &, int) const
std::set< unsigned int > CSCStubMatcher::chamberIdsMPLCT ( int  csc_type = MuonHitHelper::CSC_ALL) const

Definition at line 445 of file CSCStubMatcher.cc.

445  {
446  return selectDetIds(chamber_to_mplcts_, csc_type);
447 }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_
std::set< unsigned int > selectDetIds(D &, int) const
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_
const CSCCLCTDigiContainer & CSCStubMatcher::clctsInChamber ( unsigned int  detid) const

all matching from a particular crossed chamber

Definition at line 473 of file CSCStubMatcher.cc.

473  {
474  if (chamber_to_clcts_.find(detid) == chamber_to_clcts_.end())
475  return no_clcts_;
476  return chamber_to_clcts_.at(detid);
477 }
std::map< unsigned int, CSCCLCTDigiContainer > chamber_to_clcts_
CSCCLCTDigiContainer no_clcts_
void CSCStubMatcher::clear ( void  )
private

Definition at line 660 of file CSCStubMatcher.cc.

660  {
661  chamber_to_clcts_all_.clear();
662  chamber_to_alcts_all_.clear();
663  chamber_to_lcts_all_.clear();
664  chamber_to_mplcts_all_.clear();
665 
666  chamber_to_clcts_.clear();
667  chamber_to_alcts_.clear();
668  chamber_to_lcts_.clear();
669  chamber_to_mplcts_.clear();
670 }
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_
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_
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_
GlobalPoint CSCStubMatcher::getGlobalPosition ( unsigned int  rawId,
const CSCCorrelatedLCTDigi lct 
) const

Definition at line 642 of file CSCStubMatcher.cc.

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

642  {
643  CSCDetId cscId(rawId);
644  CSCDetId keyId(cscId.endcap(), cscId.station(), cscId.ring(), cscId.chamber(), CSCConstants::KEY_CLCT_LAYER);
645  float fractional_strip = lct.getFractionalStrip();
646  // case ME1/a
647  if (cscId.station() == 1 and cscId.ring() == 4 and lct.getStrip() > CSCConstants::MAX_HALF_STRIP_ME1B) {
648  fractional_strip -= CSCConstants::NUM_STRIPS_ME1B;
649  }
650  // regular cases
651  const auto& chamber = cscGeometry_->chamber(cscId);
652  const auto& layer_geo = chamber->layer(CSCConstants::KEY_CLCT_LAYER)->geometry();
653  // LCT::getKeyWG() also starts from 0
654  float wire = layer_geo->middleWireOfGroup(lct.getKeyWG() + 1);
655  const LocalPoint& csc_intersect = layer_geo->intersectionOfStripAndWire(fractional_strip, wire);
656  const GlobalPoint& csc_gp = cscGeometry_->idToDet(keyId)->surface().toGlobal(csc_intersect);
657  return csc_gp;
658 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
float getFractionalStrip(uint16_t n=2) const
return the fractional strip
const CSCGeometry * cscGeometry_
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
uint16_t getKeyWG() const
return the key wire group. counts from 0.
float middleWireOfGroup(int wireGroup) const
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
Definition: CSCChamber.cc:30
uint16_t getStrip(uint16_t n=2) const
return the key halfstrip from 0,159
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:100
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:91
void CSCStubMatcher::init ( const edm::Event e,
const edm::EventSetup eventSetup 
)

initialize the event

Definition at line 52 of file CSCStubMatcher.cc.

References edm::Event::getByToken(), and edm::EventSetup::getData().

52  {
53  if (useGEMs_)
54  gemDigiMatcher_->init(iEvent, iSetup);
55  cscDigiMatcher_->init(iEvent, iSetup);
56 
57  iEvent.getByToken(clctToken_, clctsH_);
58  iEvent.getByToken(alctToken_, alctsH_);
59  iEvent.getByToken(lctToken_, lctsH_);
60  iEvent.getByToken(mplctToken_, mplctsH_);
61 
62  cscGeometry_ = &iSetup.getData(geomToken_);
63 }
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_
bool CSCStubMatcher::lctInChamber ( const CSCDetId id,
const CSCCorrelatedLCTDigi lct 
) const

Definition at line 634 of file CSCStubMatcher.cc.

634  {
635  for (const auto& stub : lctsInChamber(id.rawId())) {
636  if (stub == lct)
637  return true;
638  }
639  return false;
640 }
const CSCCorrelatedLCTDigiContainer & lctsInChamber(unsigned int) const
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_
const CSCCorrelatedLCTDigiContainer & CSCStubMatcher::lctsInChamber ( unsigned int  detid) const

Definition at line 485 of file CSCStubMatcher.cc.

485  {
486  if (chamber_to_lcts_.find(detid) == chamber_to_lcts_.end())
487  return no_lcts_;
488  return chamber_to_lcts_.at(detid);
489 }
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_lcts_
CSCCorrelatedLCTDigiContainer no_lcts_
void CSCStubMatcher::match ( const SimTrack t,
const SimVertex v 
)

do the matching

Definition at line 66 of file CSCStubMatcher.cc.

References clear().

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

Definition at line 205 of file CSCStubMatcher.cc.

References a, SplitLinear::begin, CSCDetId::chamber(), filterCSVwithJSON::copy, gather_cfg::cout, dataset::end, CSCDetId::endcap(), spr::find(), gpuClustering::id, CSCDetId::ring(), relativeConstraints::ring, findQualityFiles::size, and CSCDetId::station().

205  {
206  const auto& anode_ids = cscDigiMatcher_->chamberIdsWire(0);
207  int n_minLayers = 0;
208  for (const auto& id : anode_ids) {
209  if (cscDigiMatcher_->nLayersWithWireInChamber(id) >= minNHitsChamberALCT_)
210  ++n_minLayers;
211  CSCDetId ch_id(id);
212 
213  // fill 1 WG wide gaps
214  const auto& digi_wgs = cscDigiMatcher_->wiregroupsInChamber(id, 1);
215  if (verboseALCT_) {
216  cout << "alct: digi_wgs " << ch_id << " ";
217  copy(digi_wgs.begin(), digi_wgs.end(), ostream_iterator<int>(cout, " "));
218  cout << endl;
219  }
220 
221  int ring = ch_id.ring();
222  if (ring == 4)
223  ring = 1; //use ME1b id to get CLCTs
224  CSCDetId ch_id2(ch_id.endcap(), ch_id.station(), ring, ch_id.chamber(), 0);
225 
226  const auto& alcts_in_det = alcts.get(ch_id2);
227  for (auto a = alcts_in_det.first; a != alcts_in_det.second; ++a) {
228  if (!a->isValid())
229  continue;
230 
231  if (verboseALCT_)
232  edm::LogInfo("CSCStubMatcher") << "alct " << ch_id << " " << *a;
233 
234  // check that the BX for stub wasn't too early or too late
235  if (a->getBX() < minBXALCT_ || a->getBX() > maxBXALCT_)
236  continue;
237 
238  int wg = a->getKeyWG() + 1; // as ALCT wiregroups numbers start from 0
239 
240  // store all ALCTs in this chamber
241  chamber_to_alcts_all_[id].push_back(*a);
242 
243  // match by wiregroup with the digis
244  if (digi_wgs.find(wg) == digi_wgs.end()) {
245  continue;
246  }
247  if (verboseALCT_)
248  edm::LogInfo("CSCStubMatcher") << "alctGOOD";
249 
250  // store matching ALCTs in this chamber
252  chamber_to_alcts_[id].push_back(*a);
253  }
254  }
255  if (chamber_to_alcts_[id].size() > 2) {
256  edm::LogInfo("CSCStubMatcher") << "WARNING!!! too many ALCTs " << chamber_to_alcts_[id].size() << " in " << ch_id;
257  for (auto& a : chamber_to_alcts_[id])
258  edm::LogInfo("CSCStubMatcher") << " " << a;
259  }
260  }
261 }
uint16_t *__restrict__ id
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
string end
Definition: dataset.py:937
std::map< unsigned int, CSCALCTDigiContainer > chamber_to_alcts_all_
tuple cout
Definition: gather_cfg.py:144
tuple size
Write out results.
void CSCStubMatcher::matchCLCTsToSimTrack ( const CSCCLCTDigiCollection clcts)
private

Definition at line 105 of file CSCStubMatcher.cc.

References SplitLinear::begin, c, CSCDetId::chamber(), dataset::end, CSCDetId::endcap(), spr::find(), gpuClustering::id, phase1PixelTopology::layer, CSCDetId::maxLayerId(), CSCDetId::minLayerId(), or, AlCaHLTBitMon_ParallelJobs::p, submitPVResolutionJobs::q, CSCDetId::ring(), relativeConstraints::ring, findQualityFiles::size, and CSCDetId::station().

105  {
106  const auto& cathode_ids = cscDigiMatcher_->chamberIdsStrip(0);
107 
108  for (const auto& id : cathode_ids) {
109  CSCDetId ch_id(id);
110  if (verboseCLCT_) {
111  edm::LogInfo("CSCStubMatcher") << "To check CSC chamber " << ch_id;
112  }
113 
114  int ring = ch_id.ring();
115 
116  // do not consider CSCs with too few hits
117  if (cscDigiMatcher_->nLayersWithStripInChamber(ch_id) < minNHitsChamberCLCT_)
118  continue;
119 
120  // get the comparator digis in this chamber
121  std::vector<CSCComparatorDigiContainer> comps;
122  for (int ilayer = CSCDetId::minLayerId(); ilayer <= CSCDetId::maxLayerId(); ilayer++) {
123  CSCDetId layerid(ch_id.endcap(), ch_id.station(), ring, ch_id.chamber(), ilayer);
124  comps.push_back(cscDigiMatcher_->comparatorDigisInDetId(layerid));
125  }
126 
127  // print out the digis
128  if (verboseCLCT_) {
129  edm::LogInfo("CSCStubMatcher") << "clct: comparators " << ch_id;
130  int layer = 0;
131  for (const auto& p : comps) {
132  layer++;
133  for (const auto& q : p) {
134  edm::LogInfo("CSCStubMatcher") << "L" << layer << " " << q << " " << q.getHalfStrip() << " ";
135  }
136  }
137  }
138 
139  //use ME1b id to get CLCTs
140  const bool isME1a(ch_id.station() == 1 and ch_id.ring() == 4);
141  if (isME1a)
142  ring = 1;
143  CSCDetId ch_id2(ch_id.endcap(), ch_id.station(), ring, ch_id.chamber(), 0);
144 
145  const auto& clcts_in_det = clcts.get(ch_id2);
146 
147  for (auto c = clcts_in_det.first; c != clcts_in_det.second; ++c) {
148  if (verboseCLCT_)
149  edm::LogInfo("CSCStubMatcher") << "clct " << ch_id2 << " " << *c;
150 
151  if (!c->isValid())
152  continue;
153 
154  // check that the BX for this stub wasn't too early or too late
155  if (c->getBX() < minBXCLCT_ || c->getBX() > maxBXCLCT_)
156  continue;
157 
158  // store all CLCTs in this chamber
159  chamber_to_clcts_all_[id].push_back(*c);
160 
161  // check that at least 3 comparator digis were matched!
162  int nMatches = 0;
163  int layer = 0;
164  for (const auto& p : comps) {
165  layer++;
166  for (const auto& q : p) {
167  if (verboseCLCT_)
168  edm::LogInfo("CSCStubMatcher") << "L" << layer << " " << q << " " << q.getHalfStrip() << " " << std::endl;
169  for (const auto& clctComp : (*c).getHits()[layer - 1]) {
170  if (clctComp == 65535)
171  continue;
172  if (verboseCLCT_) {
173  edm::LogInfo("CSCStubMatcher") << "\t" << clctComp << " ";
174  }
175  if (q.getHalfStrip() == clctComp or (isME1a and q.getHalfStrip() + 128 == clctComp)) {
176  nMatches++;
177  if (verboseCLCT_) {
178  edm::LogInfo("CSCStubMatcher") << "\t\tnMatches " << nMatches << std::endl;
179  }
180  }
181  }
182  }
183  }
184 
185  // require at least 3 good matches
186  if (nMatches < 3)
187  continue;
188 
189  if (verboseCLCT_)
190  edm::LogInfo("CSCStubMatcher") << "clctGOOD";
191 
192  // store matching CLCTs in this chamber
194  chamber_to_clcts_[id].push_back(*c);
195  }
196  }
197  if (chamber_to_clcts_[id].size() > 2) {
198  edm::LogInfo("CSCStubMatcher") << "WARNING!!! too many CLCTs " << chamber_to_clcts_[id].size() << " in " << ch_id;
199  for (auto& c : chamber_to_clcts_[id])
200  edm::LogInfo("CSCStubMatcher") << " " << c;
201  }
202  }
203 }
const edm::EventSetup & c
uint16_t *__restrict__ id
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
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 > layer
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_
string end
Definition: dataset.py:937
static int maxLayerId()
Definition: CSCDetId.h:243
tuple size
Write out results.
void CSCStubMatcher::matchLCTsToSimTrack ( const CSCCorrelatedLCTDigiCollection lcts)
private

Definition at line 263 of file CSCStubMatcher.cc.

References SplitLinear::begin, makePileupJSON::bx, CSCDetId::chamber(), dataset::end, CSCDetId::endcap(), spr::find(), gpuClustering::id, or, AlCaHLTBitMon_ParallelJobs::p, CSCDetId::ring(), relativeConstraints::ring, findQualityFiles::size, CSCDetId::station(), and CSCDetId::zendcap().

263  {
264  // only look for stubs in chambers that already have CLCT and ALCT
265  const auto& cathode_ids = chamberIdsAllCLCT(0);
266  const auto& anode_ids = chamberIdsAllALCT(0);
267 
268  std::set<int> cathode_and_anode_ids;
269  std::set_union(cathode_ids.begin(),
270  cathode_ids.end(),
271  anode_ids.begin(),
272  anode_ids.end(),
273  std::inserter(cathode_and_anode_ids, cathode_and_anode_ids.end()));
274 
275  for (const auto& id : cathode_and_anode_ids) {
276  int iLct = -1;
277 
278  CSCDetId ch_id(id);
279 
280  //use ME1b id to get LCTs
281  int ring = ch_id.ring();
282  if (ring == 4)
283  ring = 1;
284  CSCDetId ch_id2(ch_id.endcap(), ch_id.station(), ring, ch_id.chamber(), 0);
285 
286  const auto& lcts_in_det = lcts.get(ch_id2);
287 
288  std::map<int, CSCCorrelatedLCTDigiContainer> bx_to_lcts;
289 
290  // collect all valid LCTs in a handy container
292  for (auto lct = lcts_in_det.first; lct != lcts_in_det.second; ++lct) {
293  if (!lct->isValid())
294  continue;
295  lcts_tmp.push_back(*lct);
296  int bx = lct->getBX();
297  bx_to_lcts[bx].push_back(*lct);
298 
299  // Add ghost LCTs when there are two in bx
300  // and the two don't share half-strip or wiregroup
301  if (bx_to_lcts[bx].size() == 2 and addGhostLCTs_) {
302  auto lct11 = bx_to_lcts[bx][0];
303  auto lct22 = bx_to_lcts[bx][1];
304  addGhostLCTs(lct11, lct22, lcts_tmp);
305  }
306  }
307 
308  for (const auto& lct : lcts_tmp) {
309  iLct++;
310 
311  bool lct_clct_match(false);
312  bool lct_alct_match(false);
313  bool lct_gem1_match(false);
314  bool lct_gem2_match(false);
315 
316  if (verboseLCT_) {
317  edm::LogInfo("CSCStubMatcher") << ch_id << " " << ch_id2;
318  edm::LogInfo("CSCStubMatcher") << lct;
319  edm::LogInfo("CSCStubMatcher") << "getCLCT " << lct.getCLCT() << "\ngetALCT " << lct.getALCT() << "\ngetGEM1 "
320  << lct.getGEM1() << "\ngetGEM2 " << lct.getGEM2();
321  }
322  // Check if matched to an CLCT
323  for (const auto& p : clctsInChamber(id)) {
324  if (p == lct.getCLCT()) {
325  lct_clct_match = true;
326  if (verboseLCT_)
327  edm::LogInfo("CSCStubMatcher") << "\t...lct_clct_match";
328  break;
329  }
330  }
331 
332  // Check if matched to an ALCT
333  for (const auto& p : alctsInChamber(id)) {
334  if (p == lct.getALCT()) {
335  lct_alct_match = true;
336  if (verboseLCT_)
337  edm::LogInfo("CSCStubMatcher") << "\t...lct_alct_match";
338  break;
339  }
340  }
341 
342  if (useGEMs_) {
343  // fixME here: double check the timing of GEMPad
344  if (ch_id.ring() == 1 and (ch_id.station() == 1 or ch_id.station() == 2)) {
345  // Check if matched to an GEM pad L1
346  const GEMDetId gemDetIdL1(ch_id.zendcap(), 1, ch_id.station(), 1, ch_id.chamber(), 0);
347  for (const auto& p : gemDigiMatcher_->padsInChamber(gemDetIdL1.rawId())) {
348  if (p == lct.getGEM1()) {
349  lct_gem1_match = true;
350  if (verboseLCT_)
351  edm::LogInfo("CSCStubMatcher") << "\t...lct_gem1_match";
352  break;
353  }
354  }
355 
356  // Check if matched to an GEM pad L2
357  const GEMDetId gemDetIdL2(ch_id.zendcap(), 1, ch_id.station(), 2, ch_id.chamber(), 0);
358  for (const auto& p : gemDigiMatcher_->padsInChamber(gemDetIdL2.rawId())) {
359  if (p == lct.getGEM2()) {
360  lct_gem2_match = true;
361  if (verboseLCT_)
362  edm::LogInfo("CSCStubMatcher") << "\t...lct_gem2_match";
363  break;
364  }
365  }
366  }
367  }
368 
369  const bool alct_clct = lct_clct_match and lct_alct_match;
370  const bool alct_gem = lct_alct_match and lct_gem1_match and lct_gem2_match;
371  const bool clct_gem = lct_clct_match and lct_gem1_match and lct_gem2_match;
372 
373  bool lct_tight_matched = alct_clct or alct_gem or clct_gem;
374  bool lct_loose_matched = lct_clct_match or lct_alct_match;
375  bool lct_matched = lct_loose_matched or lct_tight_matched;
376 
377  if (lct_matched) {
378  if (verboseLCT_)
379  edm::LogInfo("CSCStubMatcher") << "...was matched";
380  if (std::find(chamber_to_lcts_[id].begin(), chamber_to_lcts_[id].end(), lct) == chamber_to_lcts_[id].end()) {
381  chamber_to_lcts_[id].emplace_back(lct);
382  }
383  }
384  } // lct loop over
385  }
386 }
void addGhostLCTs(const CSCCorrelatedLCTDigi &lct11, const CSCCorrelatedLCTDigi &lct22, CSCCorrelatedLCTDigiContainer &lctcontainer) const
uint16_t *__restrict__ id
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
const CSCCLCTDigiContainer & clctsInChamber(unsigned int) const
all matching from a particular crossed chamber
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 CSCALCTDigiContainer & alctsInChamber(unsigned int) const
std::set< unsigned int > chamberIdsAllCLCT(int csc_type=MuonHitHelper::CSC_ALL) const
crossed chamber detIds with not necessarily matching stubs
Log< level::Info, false > LogInfo
std::shared_ptr< GEMDigiMatcher > gemDigiMatcher_
string end
Definition: dataset.py:937
tuple size
Write out results.
std::set< unsigned int > chamberIdsAllALCT(int csc_type=MuonHitHelper::CSC_ALL) const
void CSCStubMatcher::matchMPLCTsToSimTrack ( const CSCCorrelatedLCTDigiCollection mplcts)
private

Definition at line 388 of file CSCStubMatcher.cc.

References SplitLinear::begin, dataset::end, spr::find(), and gpuClustering::id.

388  {
389  // match simtrack to MPC LCT by looking only in chambers
390  // that already have LCTs matched to this simtrack
391  const auto& lcts_ids = chamberIdsLCT(0);
392 
393  // loop on the detids
394  for (const auto& id : lcts_ids) {
395  const auto& mplcts_in_det = mplcts.get(id);
396 
397  // loop on the MPC LCTs in this detid
398  for (auto lct = mplcts_in_det.first; lct != mplcts_in_det.second; ++lct) {
399  if (!lct->isValid())
400  continue;
401 
402  chamber_to_mplcts_all_[id].emplace_back(*lct);
403 
404  // check if this stub corresponds with a previously matched stub
405  for (const auto& sim_stub : lctsInChamber(id)) {
406  if (sim_stub == *lct) {
407  if (std::find(chamber_to_mplcts_[id].begin(), chamber_to_mplcts_[id].end(), *lct) ==
408  chamber_to_mplcts_[id].end()) {
409  chamber_to_mplcts_[id].emplace_back(*lct);
410  }
411  }
412  }
413  }
414  }
415 }
std::set< unsigned int > chamberIdsLCT(int csc_type=MuonHitHelper::CSC_ALL) const
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_all_
uint16_t *__restrict__ id
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_
string end
Definition: dataset.py:937
const CSCCorrelatedLCTDigiContainer & lctsInChamber(unsigned int) const
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_
const CSCCorrelatedLCTDigiContainer & CSCStubMatcher::mplctsInChamber ( unsigned int  detid) const

Definition at line 491 of file CSCStubMatcher.cc.

491  {
492  if (chamber_to_mplcts_.find(detid) == chamber_to_mplcts_.end())
493  return no_mplcts_;
494  return chamber_to_mplcts_.at(detid);
495 }
CSCCorrelatedLCTDigiContainer no_mplcts_
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > chamber_to_mplcts_
int CSCStubMatcher::nChambersWithALCT ( int  min_quality = 0) const

Definition at line 574 of file CSCStubMatcher.cc.

References mps_fire::result.

574  {
575  int result = 0;
576  const auto& chamber_ids = chamberIdsALCT();
577  for (const auto& id : chamber_ids) {
578  int nStubChamber = 0;
579  const auto& alcts = alctsInChamber(id);
580  for (const auto& alct : alcts) {
581  if (!alct.isValid())
582  continue;
583  if (alct.getQuality() >= min_quality) {
584  nStubChamber++;
585  }
586  }
587  if (nStubChamber > 0) {
588  ++result;
589  }
590  }
591  return result;
592 }
tuple result
Definition: mps_fire.py:311
const CSCALCTDigiContainer & alctsInChamber(unsigned int) const
std::set< unsigned int > chamberIdsALCT(int csc_type=MuonHitHelper::CSC_ALL) const
std::map< unsigned int, CSCALCTDigiContainer > alcts() const
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 554 of file CSCStubMatcher.cc.

References mps_fire::result.

554  {
555  int result = 0;
556  const auto& chamber_ids = chamberIdsCLCT();
557  for (const auto& id : chamber_ids) {
558  int nStubChamber = 0;
559  const auto& clcts = clctsInChamber(id);
560  for (const auto& clct : clcts) {
561  if (!clct.isValid())
562  continue;
563  if (clct.getQuality() >= min_quality) {
564  nStubChamber++;
565  }
566  }
567  if (nStubChamber > 0) {
568  ++result;
569  }
570  }
571  return result;
572 }
const CSCCLCTDigiContainer & clctsInChamber(unsigned int) const
all matching from a particular crossed chamber
tuple result
Definition: mps_fire.py:311
std::set< unsigned int > chamberIdsCLCT(int csc_type=MuonHitHelper::CSC_ALL) const
chamber detIds with matching stubs
std::map< unsigned int, CSCCLCTDigiContainer > clcts() const
all matching lcts
int CSCStubMatcher::nChambersWithLCT ( int  min_quality = 0) const

Definition at line 594 of file CSCStubMatcher.cc.

References mps_fire::result.

594  {
595  int result = 0;
596  const auto& chamber_ids = chamberIdsLCT();
597  for (const auto& id : chamber_ids) {
598  int nStubChamber = 0;
599  const auto& lcts = lctsInChamber(id);
600  for (const auto& lct : lcts) {
601  if (!lct.isValid())
602  continue;
603  if (lct.getQuality() >= min_quality) {
604  nStubChamber++;
605  }
606  }
607  if (nStubChamber > 0) {
608  ++result;
609  }
610  }
611  return result;
612 }
std::set< unsigned int > chamberIdsLCT(int csc_type=MuonHitHelper::CSC_ALL) const
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > lcts() const
tuple result
Definition: mps_fire.py:311
const CSCCorrelatedLCTDigiContainer & lctsInChamber(unsigned int) const
int CSCStubMatcher::nChambersWithMPLCT ( int  min_quality = 0) const

Definition at line 614 of file CSCStubMatcher.cc.

References mps_fire::result.

614  {
615  int result = 0;
616  const auto& chamber_ids = chamberIdsMPLCT();
617  for (const auto& id : chamber_ids) {
618  int nStubChamber = 0;
619  const auto& mplcts = mplctsInChamber(id);
620  for (const auto& mplct : mplcts) {
621  if (!mplct.isValid())
622  continue;
623  if (mplct.getQuality() >= min_quality) {
624  nStubChamber++;
625  }
626  }
627  if (nStubChamber > 0) {
628  ++result;
629  }
630  }
631  return result;
632 }
const CSCCorrelatedLCTDigiContainer & mplctsInChamber(unsigned int) const
tuple result
Definition: mps_fire.py:311
std::set< unsigned int > chamberIdsMPLCT(int csc_type=MuonHitHelper::CSC_ALL) const
std::map< unsigned int, CSCCorrelatedLCTDigiContainer > mplcts() const
template<class D >
std::set< unsigned int > CSCStubMatcher::selectDetIds ( D &  digis,
int  csc_type 
) const
private

Definition at line 162 of file CSCStubMatcher.h.

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

162  {
163  std::set<unsigned int> result;
164  for (auto& p : digis) {
165  auto id = p.first;
166  if (csc_type > 0) {
167  CSCDetId detId(id);
168  if (MuonHitHelper::toCSCType(detId.station(), detId.ring()) != csc_type)
169  continue;
170  }
171  result.insert(p.first);
172  }
173  return result;
174 }
static int toCSCType(int st, int ri)
tuple result
Definition: mps_fire.py:311
float CSCStubMatcher::zpositionOfLayer ( unsigned int  detid,
int  layer 
) const

Definition at line 548 of file CSCStubMatcher.cc.

References CSCDetId.

548  {
549  const auto& id = CSCDetId(detid);
550  const auto& chamber(cscGeometry_->chamber(id));
551  return fabs(chamber->layer(layer)->centerOfStrip(20).z());
552 }
const CSCGeometry * cscGeometry_
constexpr std::array< uint8_t, layerIndexSize > layer
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:100

Member Data Documentation

bool CSCStubMatcher::addGhostLCTs_
private

Definition at line 136 of file CSCStubMatcher.h.

edm::InputTag CSCStubMatcher::alctInputTag_
private

Definition at line 101 of file CSCStubMatcher.h.

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

Definition at line 111 of file CSCStubMatcher.h.

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

Definition at line 106 of file CSCStubMatcher.h.

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

Definition at line 129 of file CSCStubMatcher.h.

Referenced by alcts().

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

Definition at line 123 of file CSCStubMatcher.h.

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

Definition at line 128 of file CSCStubMatcher.h.

Referenced by clcts().

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

Definition at line 122 of file CSCStubMatcher.h.

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

Definition at line 130 of file CSCStubMatcher.h.

Referenced by lcts().

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

Definition at line 124 of file CSCStubMatcher.h.

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

Definition at line 131 of file CSCStubMatcher.h.

Referenced by mplcts().

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

Definition at line 125 of file CSCStubMatcher.h.

edm::InputTag CSCStubMatcher::clctInputTag_
private

Definition at line 100 of file CSCStubMatcher.h.

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

Definition at line 110 of file CSCStubMatcher.h.

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

Definition at line 105 of file CSCStubMatcher.h.

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

Definition at line 115 of file CSCStubMatcher.h.

Referenced by cscDigiMatcher().

const CSCGeometry* CSCStubMatcher::cscGeometry_
private

Definition at line 119 of file CSCStubMatcher.h.

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

Definition at line 116 of file CSCStubMatcher.h.

Referenced by gemDigiMatcher().

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

Definition at line 118 of file CSCStubMatcher.h.

edm::InputTag CSCStubMatcher::lctInputTag_
private

Definition at line 102 of file CSCStubMatcher.h.

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

Definition at line 112 of file CSCStubMatcher.h.

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

Definition at line 107 of file CSCStubMatcher.h.

int CSCStubMatcher::maxBXALCT_
private

Definition at line 151 of file CSCStubMatcher.h.

int CSCStubMatcher::maxBXCLCT_
private

Definition at line 150 of file CSCStubMatcher.h.

int CSCStubMatcher::maxBXLCT_
private

Definition at line 152 of file CSCStubMatcher.h.

int CSCStubMatcher::maxBXMPLCT_
private

Definition at line 153 of file CSCStubMatcher.h.

int CSCStubMatcher::minBXALCT_
private

Definition at line 151 of file CSCStubMatcher.h.

int CSCStubMatcher::minBXCLCT_
private

Definition at line 150 of file CSCStubMatcher.h.

int CSCStubMatcher::minBXLCT_
private

Definition at line 152 of file CSCStubMatcher.h.

int CSCStubMatcher::minBXMPLCT_
private

Definition at line 153 of file CSCStubMatcher.h.

int CSCStubMatcher::minNHitsChamber_
private

Definition at line 139 of file CSCStubMatcher.h.

int CSCStubMatcher::minNHitsChamberALCT_
private

Definition at line 140 of file CSCStubMatcher.h.

int CSCStubMatcher::minNHitsChamberCLCT_
private

Definition at line 141 of file CSCStubMatcher.h.

int CSCStubMatcher::minNHitsChamberLCT_
private

Definition at line 142 of file CSCStubMatcher.h.

int CSCStubMatcher::minNHitsChamberMPLCT_
private

Definition at line 143 of file CSCStubMatcher.h.

edm::InputTag CSCStubMatcher::mplctInputTag_
private

Definition at line 103 of file CSCStubMatcher.h.

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

Definition at line 113 of file CSCStubMatcher.h.

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

Definition at line 108 of file CSCStubMatcher.h.

CSCALCTDigiContainer CSCStubMatcher::no_alcts_
private

Definition at line 156 of file CSCStubMatcher.h.

CSCCLCTDigiContainer CSCStubMatcher::no_clcts_
private

Definition at line 155 of file CSCStubMatcher.h.

CSCCorrelatedLCTDigiContainer CSCStubMatcher::no_lcts_
private

Definition at line 157 of file CSCStubMatcher.h.

CSCCorrelatedLCTDigiContainer CSCStubMatcher::no_mplcts_
private

Definition at line 158 of file CSCStubMatcher.h.

bool CSCStubMatcher::useGEMs_
private

Definition at line 137 of file CSCStubMatcher.h.

bool CSCStubMatcher::verboseALCT_
private

Definition at line 145 of file CSCStubMatcher.h.

bool CSCStubMatcher::verboseCLCT_
private

Definition at line 146 of file CSCStubMatcher.h.

bool CSCStubMatcher::verboseLCT_
private

Definition at line 147 of file CSCStubMatcher.h.

bool CSCStubMatcher::verboseMPLCT_
private

Definition at line 148 of file CSCStubMatcher.h.