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 84 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.

89  {
90  if (!rpcDigis)
91  return;
92  //LogTrace("l1tOmtfEventPrint") << __FUNCTION__ << ":" << __LINE__ <<" RPC HITS, processor : " << iProcessor<<" "<<std::endl;
93 
94  const RPCDigiCollection& rpcDigiCollection = *rpcDigis;
95  for (auto rollDigis : rpcDigiCollection) {
96  RPCDetId roll = rollDigis.first;
97 
98  //debug
99  //if(roll.region() != 0 && abs(roll.station()) >= 3 && roll.ring() == 1 )
100  /* {
101  //iRPC
102  for (auto pDigi=rollDigis.second.first; pDigi != rollDigis.second.second; pDigi++) {
103  LogTrace("l1tOmtfEventPrint")<<__FUNCTION__<<":"<<__LINE__<<" roll "<<roll
104  <<" strip "<<pDigi->strip()
105  <<" hasX "<<pDigi->hasX()<<" coordinateX "<<pDigi->coordinateX()<<" hasY "<<pDigi->hasY()<<" coordinateY "<<pDigi->coordinateY()
106  <<" bx "<<pDigi->bx()<<" time "<<pDigi->time()<<" irpc"<<std::endl;
107  }
108  //continue;
109  }*/
110 
111  //LogTrace("l1tOmtfEventPrint") << __FUNCTION__ << ":" << __LINE__ <<" roll "<<roll<<" "<<std::endl;
112 
113  if (!acceptDigi(roll, iProcessor, procTyp))
114  continue;
115 
117  // 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; }
118  std::vector<RPCDigi> digisCopy;
119 
120  for (auto pDigi = rollDigis.second.first; pDigi != rollDigis.second.second; pDigi++) {
121  if (pDigi->bx() >= bxFrom && pDigi->bx() <= bxTo) {
122  digisCopy.push_back(*pDigi);
123  }
124  }
125 
126  std::vector<RpcCluster> clusters = rpcClusterization->getClusters(roll, digisCopy);
127 
128  for (auto& cluster : clusters) {
129  addRPCstub(muonStubsInLayers, roll, cluster, iProcessor, procTyp);
130  }
131  }
132 
133  //removing the RPC stubs that were mark as dropped in the RpcDigiToStubsConverterOmtf::addRPCstub
134  //10 is the first RPC layer
135  for (unsigned int iLayer = 10; iLayer < muonStubsInLayers.size(); iLayer++) {
136  for (unsigned int iInput = 0; iInput < muonStubsInLayers[iLayer].size(); iInput++) {
137  if (muonStubsInLayers[iLayer][iInput] && muonStubsInLayers[iLayer][iInput]->type == MuonStub::RPC_DROPPED) {
138  LogTrace("l1tOmtfEventPrint") << "RpcDigiToStubsConverter::makeStubs "
139  << " iProcessor " << iProcessor << " procTyp " << procTyp
140  << " dropping a stub iLayer " << iLayer << " iInput "
141  << *(muonStubsInLayers[iLayer][iInput]) << std::endl;
142  muonStubsInLayers[iLayer][iInput].reset();
143  }
144  }
145  }
146 }
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().