CMS 3D CMS Logo

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

#include <MuonStubMakerBase.h>

Inheritance diagram for RpcDigiToStubsConverter:
DigiToStubsConverterBase RpcDigiToStubsConverterOmtf

Public Member Functions

virtual bool acceptDigi (const RPCDetId &rpcDetId, unsigned int iProcessor, l1t::tftype procType)
 
virtual void addRPCstub (MuonStubPtrs2D &muonStubsInLayers, const RPCDetId &roll, const RpcCluster &cluster, unsigned int iProcessor, l1t::tftype procTyp)=0
 
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
 
 RpcDigiToStubsConverter (const ProcConfigurationBase *config, edm::EDGetTokenT< RPCDigiCollection > inputTokenRpc, const RpcClusterization *rpcClusterization)
 
 ~RpcDigiToStubsConverter () override
 
- Public Member Functions inherited from DigiToStubsConverterBase
virtual ~DigiToStubsConverterBase ()
 

Protected Attributes

const ProcConfigurationBaseconfig
 
edm::EDGetTokenT< RPCDigiCollectioninputTokenRpc
 
bool mergePhiAndTheta = true
 
const RpcClusterizationrpcClusterization
 
edm::Handle< RPCDigiCollectionrpcDigis
 

Detailed Description

Definition at line 131 of file MuonStubMakerBase.h.

Constructor & Destructor Documentation

◆ RpcDigiToStubsConverter()

RpcDigiToStubsConverter::RpcDigiToStubsConverter ( const ProcConfigurationBase config,
edm::EDGetTokenT< RPCDigiCollection inputTokenRpc,
const RpcClusterization rpcClusterization 
)
inline

Definition at line 133 of file MuonStubMakerBase.h.

edm::EDGetTokenT< RPCDigiCollection > inputTokenRpc
Definition: config.py:1
const ProcConfigurationBase * config
const RpcClusterization * rpcClusterization

◆ ~RpcDigiToStubsConverter()

RpcDigiToStubsConverter::~RpcDigiToStubsConverter ( )
inlineoverride

Definition at line 138 of file MuonStubMakerBase.h.

138 {}

Member Function Documentation

◆ acceptDigi()

virtual bool RpcDigiToStubsConverter::acceptDigi ( const RPCDetId rpcDetId,
unsigned int  iProcessor,
l1t::tftype  procType 
)
inlinevirtual

Reimplemented in RpcDigiToStubsConverterOmtf.

Definition at line 157 of file MuonStubMakerBase.h.

Referenced by makeStubs().

157 { return true; }

◆ addRPCstub()

virtual void RpcDigiToStubsConverter::addRPCstub ( MuonStubPtrs2D muonStubsInLayers,
const RPCDetId roll,
const RpcCluster cluster,
unsigned int  iProcessor,
l1t::tftype  procTyp 
)
pure virtual

Implemented in RpcDigiToStubsConverterOmtf.

Referenced by makeStubs().

◆ loadDigis()

void RpcDigiToStubsConverter::loadDigis ( const edm::Event event)
inlineoverridevirtual

Implements DigiToStubsConverterBase.

Definition at line 142 of file MuonStubMakerBase.h.

References inputTokenRpc, and rpcDigis.

142 { event.getByToken(inputTokenRpc, rpcDigis); }
edm::EDGetTokenT< RPCDigiCollection > inputTokenRpc
edm::Handle< RPCDigiCollection > rpcDigis

◆ makeStubs()

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

To find the clusters we have to copy the digis in chamber to sort them (not optimal).

Implements DigiToStubsConverterBase.

Definition at line 78 of file MuonStubMakerBase.cc.

References acceptDigi(), addRPCstub(), bsc_activity_cfg::clusters, RpcClusterization::getClusters(), LogTrace, nano_mu_digi_cff::roll, MuonStub::RPC_DROPPED, rpcClusterization, and rpcDigis.

83  {
84  //LogTrace("l1tOmtfEventPrint") << __FUNCTION__ << ":" << __LINE__ <<" RPC HITS, processor : " << iProcessor<<" "<<std::endl;
85 
86  const RPCDigiCollection& rpcDigiCollection = *rpcDigis;
87  for (auto rollDigis : rpcDigiCollection) {
88  RPCDetId roll = rollDigis.first;
89 
90  //debug
91  //if(roll.region() != 0 && abs(roll.station()) >= 3 && roll.ring() == 1 )
92  /* {
93  //iRPC
94  for (auto pDigi=rollDigis.second.first; pDigi != rollDigis.second.second; pDigi++) {
95  LogTrace("l1tOmtfEventPrint")<<__FUNCTION__<<":"<<__LINE__<<" roll "<<roll
96  <<" strip "<<pDigi->strip()
97  <<" hasX "<<pDigi->hasX()<<" coordinateX "<<pDigi->coordinateX()<<" hasY "<<pDigi->hasY()<<" coordinateY "<<pDigi->coordinateY()
98  <<" bx "<<pDigi->bx()<<" time "<<pDigi->time()<<" irpc"<<std::endl;
99  }
100  //continue;
101  }*/
102 
103  //LogTrace("l1tOmtfEventPrint") << __FUNCTION__ << ":" << __LINE__ <<" roll "<<roll<<" "<<std::endl;
104 
105  if (!acceptDigi(roll, iProcessor, procTyp))
106  continue;
107 
109  // for (auto tdigi = rollDigis.second.first; tdigi != rollDigis.second.second; tdigi++) { std::cout << "RPC DIGIS: " << roll.rawId()<< " "<<roll<<" digi: " << tdigi->strip() <<" bx: " << tdigi->bx() << std::endl; }
110  std::vector<RPCDigi> digisCopy;
111 
112  for (auto pDigi = rollDigis.second.first; pDigi != rollDigis.second.second; pDigi++) {
113  if (pDigi->bx() >= bxFrom && pDigi->bx() <= bxTo) {
114  digisCopy.push_back(*pDigi);
115  }
116  }
117 
118  std::vector<RpcCluster> clusters = rpcClusterization->getClusters(roll, digisCopy);
119 
120  for (auto& cluster : clusters) {
121  addRPCstub(muonStubsInLayers, roll, cluster, iProcessor, procTyp);
122  }
123  }
124 
125  //removing the RPC stubs that were mark as dropped in the RpcDigiToStubsConverterOmtf::addRPCstub
126  //10 is the first RPC layer
127  for (unsigned int iLayer = 10; iLayer < muonStubsInLayers.size(); iLayer++) {
128  for (unsigned int iInput = 0; iInput < muonStubsInLayers[iLayer].size(); iInput++) {
129  if (muonStubsInLayers[iLayer][iInput] && muonStubsInLayers[iLayer][iInput]->type == MuonStub::RPC_DROPPED) {
130  LogTrace("l1tOmtfEventPrint") << "RpcDigiToStubsConverter::makeStubs "
131  << " iProcessor " << iProcessor << " procTyp " << procTyp
132  << " dropping a stub iLayer " << iLayer << " iInput "
133  << *(muonStubsInLayers[iLayer][iInput]) << std::endl;
134  muonStubsInLayers[iLayer][iInput].reset();
135  }
136  }
137  }
138 }
virtual bool acceptDigi(const RPCDetId &rpcDetId, unsigned int iProcessor, l1t::tftype procType)
#define LogTrace(id)
const RpcClusterization * rpcClusterization
edm::Handle< RPCDigiCollection > rpcDigis
virtual void addRPCstub(MuonStubPtrs2D &muonStubsInLayers, const RPCDetId &roll, const RpcCluster &cluster, unsigned int iProcessor, l1t::tftype procTyp)=0
virtual std::vector< RpcCluster > getClusters(const RPCDetId &roll, std::vector< RPCDigi > &digis) const
N.B. digis are sorted inside the function.

Member Data Documentation

◆ config

const ProcConfigurationBase* RpcDigiToStubsConverter::config
protected

Definition at line 160 of file MuonStubMakerBase.h.

◆ inputTokenRpc

edm::EDGetTokenT<RPCDigiCollection> RpcDigiToStubsConverter::inputTokenRpc
protected

Definition at line 164 of file MuonStubMakerBase.h.

Referenced by loadDigis().

◆ mergePhiAndTheta

bool RpcDigiToStubsConverter::mergePhiAndTheta = true
protected

Definition at line 162 of file MuonStubMakerBase.h.

◆ rpcClusterization

const RpcClusterization* RpcDigiToStubsConverter::rpcClusterization
protected

Definition at line 167 of file MuonStubMakerBase.h.

Referenced by makeStubs().

◆ rpcDigis

edm::Handle<RPCDigiCollection> RpcDigiToStubsConverter::rpcDigis
protected

Definition at line 165 of file MuonStubMakerBase.h.

Referenced by loadDigis(), and makeStubs().