CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
DtPhase2DigiToStubsConverter Class Referenceabstract

#include <InputMakerPhase2.h>

Inheritance diagram for DtPhase2DigiToStubsConverter:
DigiToStubsConverterBase DtPhase2DigiToStubsConverterOmtf

Public Member Functions

virtual bool acceptDigi (const DTChamberId &dTChamberId, unsigned int iProcessor, l1t::tftype procType)
 
virtual void addDTetaStubs (MuonStubPtrs2D &muonStubsInLayers, const L1MuDTChambThDigi &thetaDigi, unsigned int iProcessor, l1t::tftype procTyp)=0
 
virtual void addDTphiDigi (MuonStubPtrs2D &muonStubsInLayers, const L1Phase2MuDTPhDigi &digi, const L1MuDTChambThContainer *dtThDigis, unsigned int iProcessor, l1t::tftype procTyp)=0
 
 DtPhase2DigiToStubsConverter (edm::EDGetTokenT< L1Phase2MuDTPhContainer > inputTokenDtPh, edm::EDGetTokenT< L1MuDTChambThContainer > inputTokenDtTh)
 
void loadDigis (const edm::Event &event) override
 
void makeStubs (MuonStubPtrs2D &muonStubsInLayers, unsigned int iProcessor, l1t::tftype procTyp, int bxFrom, int bxTo, std::vector< std::unique_ptr< IOMTFEmulationObserver > > &observers) override
 
 ~DtPhase2DigiToStubsConverter () override
 
- Public Member Functions inherited from DigiToStubsConverterBase
virtual ~DigiToStubsConverterBase ()
 

Protected Attributes

edm::Handle< L1Phase2MuDTPhContainerdtPhDigis
 
edm::Handle< L1MuDTChambThContainerdtThDigis
 
edm::EDGetTokenT< L1Phase2MuDTPhContainerinputTokenDtPh
 
edm::EDGetTokenT< L1MuDTChambThContainerinputTokenDtTh
 
bool mergePhiAndTheta = true
 

Detailed Description

Definition at line 24 of file InputMakerPhase2.h.

Constructor & Destructor Documentation

◆ DtPhase2DigiToStubsConverter()

DtPhase2DigiToStubsConverter::DtPhase2DigiToStubsConverter ( edm::EDGetTokenT< L1Phase2MuDTPhContainer inputTokenDtPh,
edm::EDGetTokenT< L1MuDTChambThContainer inputTokenDtTh 
)
inline

Definition at line 26 of file InputMakerPhase2.h.

edm::EDGetTokenT< L1MuDTChambThContainer > inputTokenDtTh
edm::EDGetTokenT< L1Phase2MuDTPhContainer > inputTokenDtPh

◆ ~DtPhase2DigiToStubsConverter()

DtPhase2DigiToStubsConverter::~DtPhase2DigiToStubsConverter ( )
inlineoverride

Definition at line 30 of file InputMakerPhase2.h.

30 {}

Member Function Documentation

◆ acceptDigi()

virtual bool DtPhase2DigiToStubsConverter::acceptDigi ( const DTChamberId dTChamberId,
unsigned int  iProcessor,
l1t::tftype  procType 
)
inlinevirtual

Reimplemented in DtPhase2DigiToStubsConverterOmtf.

Definition at line 53 of file InputMakerPhase2.h.

Referenced by makeStubs().

53  {
54  return true;
55  }

◆ addDTetaStubs()

virtual void DtPhase2DigiToStubsConverter::addDTetaStubs ( MuonStubPtrs2D muonStubsInLayers,
const L1MuDTChambThDigi thetaDigi,
unsigned int  iProcessor,
l1t::tftype  procTyp 
)
pure virtual

Implemented in DtPhase2DigiToStubsConverterOmtf.

Referenced by makeStubs().

◆ addDTphiDigi()

virtual void DtPhase2DigiToStubsConverter::addDTphiDigi ( MuonStubPtrs2D muonStubsInLayers,
const L1Phase2MuDTPhDigi digi,
const L1MuDTChambThContainer dtThDigis,
unsigned int  iProcessor,
l1t::tftype  procTyp 
)
pure virtual

Implemented in DtPhase2DigiToStubsConverterOmtf.

Referenced by makeStubs().

◆ loadDigis()

void DtPhase2DigiToStubsConverter::loadDigis ( const edm::Event event)
overridevirtual

Implements DigiToStubsConverterBase.

Definition at line 16 of file InputMakerPhase2.cc.

References dtPhDigis, dtThDigis, inputTokenDtPh, and inputTokenDtTh.

16  {
17  event.getByToken(inputTokenDtPh, dtPhDigis);
18  event.getByToken(inputTokenDtTh, dtThDigis);
19 }
edm::Handle< L1Phase2MuDTPhContainer > dtPhDigis
edm::EDGetTokenT< L1MuDTChambThContainer > inputTokenDtTh
edm::Handle< L1MuDTChambThContainer > dtThDigis
edm::EDGetTokenT< L1Phase2MuDTPhContainer > inputTokenDtPh

◆ makeStubs()

void DtPhase2DigiToStubsConverter::makeStubs ( MuonStubPtrs2D muonStubsInLayers,
unsigned int  iProcessor,
l1t::tftype  procTyp,
int  bxFrom,
int  bxTo,
std::vector< std::unique_ptr< IOMTFEmulationObserver > > &  observers 
)
overridevirtual

Check it the data fits into given processor input range

Implements DigiToStubsConverterBase.

Definition at line 21 of file InputMakerPhase2.cc.

References acceptDigi(), addDTetaStubs(), addDTphiDigi(), ALCARECOPPSCalTrackBasedSel_cff::detid, dtPhDigis, dtThDigis, L1Phase2MuDTPhContainer::getContainer(), L1MuDTChambThContainer::getContainer(), mergePhiAndTheta, and edm::Handle< T >::product().

26  {
27  if (!dtPhDigis)
28  return;
29 
30  boost::property_tree::ptree procDataTree;
31 
32  for (const auto& digiIt : *dtPhDigis->getContainer()) {
33  DTChamberId detid(digiIt.whNum(), digiIt.stNum(), digiIt.scNum() + 1);
34 
36  if (!acceptDigi(detid, iProcessor, procTyp))
37  continue;
38 
39  // HACK for Phase-2 (DT TPs are centered in bX=20)
40  if (digiIt.bxNum() - 20 >= bxFrom && digiIt.bxNum() - 20 <= bxTo) {
41  addDTphiDigi(muonStubsInLayers, digiIt, dtThDigis.product(), iProcessor, procTyp);
42 
43  auto& dtP2Digi = procDataTree.add_child("dtP2Digi", boost::property_tree::ptree());
44  dtP2Digi.add("<xmlattr>.whNum", digiIt.whNum());
45  dtP2Digi.add("<xmlattr>.scNum", digiIt.scNum());
46  dtP2Digi.add("<xmlattr>.stNum", digiIt.stNum());
47  dtP2Digi.add("<xmlattr>.slNum", digiIt.slNum());
48  dtP2Digi.add("<xmlattr>.quality", digiIt.quality());
49  dtP2Digi.add("<xmlattr>.rpcFlag", digiIt.rpcFlag());
50  dtP2Digi.add("<xmlattr>.phi", digiIt.phi());
51  dtP2Digi.add("<xmlattr>.phiBend", digiIt.phiBend());
52  }
53  }
54 
55  if (!mergePhiAndTheta) {
56  for (auto& thetaDigi : (*(dtThDigis->getContainer()))) {
57  if (thetaDigi.bxNum() >= bxFrom && thetaDigi.bxNum() <= bxTo) {
58  addDTetaStubs(muonStubsInLayers, thetaDigi, iProcessor, procTyp);
59  }
60  }
61  }
62 
63  for (auto& obs : observers)
64  obs->addProcesorData("linkData", procDataTree);
65 }
virtual bool acceptDigi(const DTChamberId &dTChamberId, unsigned int iProcessor, l1t::tftype procType)
T const * product() const
Definition: Handle.h:70
The_Container const * getContainer() const
edm::Handle< L1Phase2MuDTPhContainer > dtPhDigis
virtual void addDTphiDigi(MuonStubPtrs2D &muonStubsInLayers, const L1Phase2MuDTPhDigi &digi, const L1MuDTChambThContainer *dtThDigis, unsigned int iProcessor, l1t::tftype procTyp)=0
edm::Handle< L1MuDTChambThContainer > dtThDigis
Segment_Container const * getContainer() const
virtual void addDTetaStubs(MuonStubPtrs2D &muonStubsInLayers, const L1MuDTChambThDigi &thetaDigi, unsigned int iProcessor, l1t::tftype procTyp)=0

Member Data Documentation

◆ dtPhDigis

edm::Handle<L1Phase2MuDTPhContainer> DtPhase2DigiToStubsConverter::dtPhDigis
protected

Definition at line 63 of file InputMakerPhase2.h.

Referenced by loadDigis(), and makeStubs().

◆ dtThDigis

edm::Handle<L1MuDTChambThContainer> DtPhase2DigiToStubsConverter::dtThDigis
protected

Definition at line 64 of file InputMakerPhase2.h.

Referenced by loadDigis(), and makeStubs().

◆ inputTokenDtPh

edm::EDGetTokenT<L1Phase2MuDTPhContainer> DtPhase2DigiToStubsConverter::inputTokenDtPh
protected

Definition at line 60 of file InputMakerPhase2.h.

Referenced by loadDigis().

◆ inputTokenDtTh

edm::EDGetTokenT<L1MuDTChambThContainer> DtPhase2DigiToStubsConverter::inputTokenDtTh
protected

Definition at line 61 of file InputMakerPhase2.h.

Referenced by loadDigis().

◆ mergePhiAndTheta

bool DtPhase2DigiToStubsConverter::mergePhiAndTheta = true
protected

Definition at line 58 of file InputMakerPhase2.h.

Referenced by makeStubs().