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) 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 118 of file MuonStubMakerBase.h.

Constructor & Destructor Documentation

◆ RpcDigiToStubsConverter()

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

Definition at line 120 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 125 of file MuonStubMakerBase.h.

125 {};

Member Function Documentation

◆ acceptDigi()

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

Reimplemented in RpcDigiToStubsConverterOmtf.

Definition at line 140 of file MuonStubMakerBase.h.

Referenced by makeStubs().

140 { 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 129 of file MuonStubMakerBase.h.

References inputTokenRpc, and rpcDigis.

129 { 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 
)
overridevirtual

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

Implements DigiToStubsConverterBase.

Definition at line 76 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.

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

◆ inputTokenRpc

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

Definition at line 147 of file MuonStubMakerBase.h.

Referenced by loadDigis().

◆ mergePhiAndTheta

bool RpcDigiToStubsConverter::mergePhiAndTheta = true
protected

Definition at line 145 of file MuonStubMakerBase.h.

◆ rpcClusterization

const RpcClusterization* RpcDigiToStubsConverter::rpcClusterization
protected

Definition at line 150 of file MuonStubMakerBase.h.

Referenced by makeStubs().

◆ rpcDigis

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

Definition at line 148 of file MuonStubMakerBase.h.

Referenced by loadDigis(), and makeStubs().