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 | 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
< RPCDigiCollection
inputTokenRpc
 
bool mergePhiAndTheta = true
 
const RpcClusterizationrpcClusterization
 
edm::Handle< RPCDigiCollectionrpcDigis
 

Detailed Description

Definition at line 118 of file MuonStubMakerBase.h.

Constructor & Destructor Documentation

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

Definition at line 120 of file MuonStubMakerBase.h.

123  : config(config), inputTokenRpc(inputTokenRpc), rpcClusterization(rpcClusterization){};
edm::EDGetTokenT< RPCDigiCollection > inputTokenRpc
const ProcConfigurationBase * config
const RpcClusterization * rpcClusterization
RpcDigiToStubsConverter::~RpcDigiToStubsConverter ( )
inlineoverride

Definition at line 125 of file MuonStubMakerBase.h.

125 {};

Member Function Documentation

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; }
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().

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
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(), HLT_FULL_cff::clusters, RpcClusterization::getClusters(), 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  // std::copy_if(rollDigis.second.first, rollDigis.second.second, std::back_inserter(digisCopy), [](const RPCDigi & aDigi){return (aDigi.bx()==0);} );
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  //LogTrace("l1tOmtfEventPrint")<<__FUNCTION__<<":"<<155<<" roll "<<roll<<" cluster: firstStrip "<<cluster.firstStrip<<" lastStrip "<<cluster.lastStrip<<" halfStrip "<<cluster.halfStrip()<<std::endl;
118  addRPCstub(muonStubsInLayers, roll, cluster, iProcessor, procTyp);
119  }
120  }
121 }
virtual bool acceptDigi(const RPCDetId &rpcDetId, unsigned int iProcessor, l1t::tftype procType)
virtual std::vector< RpcCluster > getClusters(const RPCDetId &roll, std::vector< RPCDigi > &digis) const
N.B. digis are sorted inside the function.
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

Member Data Documentation

const ProcConfigurationBase* RpcDigiToStubsConverter::config
protected
edm::EDGetTokenT<RPCDigiCollection> RpcDigiToStubsConverter::inputTokenRpc
protected

Definition at line 147 of file MuonStubMakerBase.h.

Referenced by loadDigis().

bool RpcDigiToStubsConverter::mergePhiAndTheta = true
protected

Definition at line 145 of file MuonStubMakerBase.h.

const RpcClusterization* RpcDigiToStubsConverter::rpcClusterization
protected

Definition at line 150 of file MuonStubMakerBase.h.

Referenced by makeStubs().

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

Definition at line 148 of file MuonStubMakerBase.h.

Referenced by loadDigis(), and makeStubs().