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 | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
OMTFinputMaker Class Reference

#include <OMTFinputMaker.h>

Inheritance diagram for OMTFinputMaker:
MuonStubMakerBase

Public Member Functions

OMTFinput buildInputForProcessor (const L1MuDTChambPhContainer *dtPhDigis, const L1MuDTChambThContainer *dtThDigis, const CSCCorrelatedLCTDigiCollection *cscDigis, const RPCDigiCollection *rpcDigis, unsigned int iProcessor, l1t::tftype type=l1t::tftype::omtf_pos, int bx=0)
 Method translating trigger digis into input matrix with global phi coordinates. More...
 
int getFlag () const
 
void initialize (const edm::EventSetup &, const OMTFConfiguration *)
 
void initialize (const edm::ParameterSet &edmCfg, const edm::EventSetup &es, const MuonGeometryTokens &muonGeometryTokens) override
 
 OMTFinputMaker (edm::ConsumesCollector &, bool getDuringEvent=true)
 
 OMTFinputMaker (const edm::ParameterSet &edmParameterSet, MuStubsInputTokens &muStubsInputTokens, const OMTFConfiguration *config, std::unique_ptr< OmtfAngleConverter > angleConverter)
 
void setFlag (int aFlag)
 
 ~OMTFinputMaker ()
 
 ~OMTFinputMaker () override
 
- Public Member Functions inherited from MuonStubMakerBase
void buildInputForProcessor (MuonStubPtrs2D &muonStubsInLayers, unsigned int iProcessor, l1t::tftype procTyp, int bxFrom=0, int bxTo=0)
 Method translating trigger digis into input matrix with global phi coordinates, fills the muonStubsInLayers. More...
 
void loadAndFilterDigis (const edm::Event &event)
 
 MuonStubMakerBase (const ProcConfigurationBase *procConf)
 
virtual ~MuonStubMakerBase ()
 

Static Public Member Functions

static bool acceptDtDigi (const OMTFConfiguration *config, const DTChamberId &dTChamberId, unsigned int iProcessor, l1t::tftype procType)
 
static void addStub (const OMTFConfiguration *config, MuonStubPtrs2D &muonStubsInLayers, unsigned int iLayer, unsigned int iInput, MuonStub &stub)
 
static unsigned int getInputNumber (const OMTFConfiguration *config, unsigned int rawId, unsigned int iProcessor, l1t::tftype type)
 
static int getProcessorPhiZero (const OMTFConfiguration *config, unsigned int iProcessor)
 

Protected Attributes

std::unique_ptr
< OmtfAngleConverter
angleConverter
 
const OMTFConfigurationconfig = nullptr
 
- Protected Attributes inherited from MuonStubMakerBase
const ProcConfigurationBaseconfig = nullptr
 
std::vector< std::unique_ptr
< DigiToStubsConverterBase > > 
digiToStubsConverters
 
RpcClusterization rpcClusterization
 

Private Member Functions

bool acceptDigi (uint32_t rawId, unsigned int iProcessor, l1t::tftype type)
 
unsigned int getInputNumber (unsigned int rawId, unsigned int iProcessor, l1t::tftype type)
 
OMTFinput processCSC (const CSCCorrelatedLCTDigiCollection *cscDigis, unsigned int iProcessor, l1t::tftype type, int bx)
 
OMTFinput processDT (const L1MuDTChambPhContainer *dtPhDigis, const L1MuDTChambThContainer *dtThDigis, unsigned int iProcessor, l1t::tftype type, int bx)
 
OMTFinput processRPC (const RPCDigiCollection *rpcDigis, unsigned int iProcessor, l1t::tftype type, int bx)
 

Private Attributes

int flag
 
std::unique_ptr< AngleConvertermyAngleConverter
 
const OMTFConfigurationmyOmtfConfig
 

Detailed Description

Definition at line 19 of file OMTFinputMaker.h.

Constructor & Destructor Documentation

OMTFinputMaker::OMTFinputMaker ( edm::ConsumesCollector iC,
bool  getDuringEvent = true 
)

Definition at line 20 of file OMTFinputMaker.cc.

21  : myAngleConverter(std::make_unique<AngleConverter>(iC, getDuringEvent)) {}
std::unique_ptr< AngleConverter > myAngleConverter
OMTFinputMaker::~OMTFinputMaker ( )

Definition at line 31 of file OMTFinputMaker.cc.

31 {}
OMTFinputMaker::OMTFinputMaker ( const edm::ParameterSet edmParameterSet,
MuStubsInputTokens muStubsInputTokens,
const OMTFConfiguration config,
std::unique_ptr< OmtfAngleConverter angleConverter 
)

Definition at line 279 of file OMTFinputMaker.cc.

References MuonStubMakerBase::digiToStubsConverters, edm::ParameterSet::getParameter(), MuStubsInputTokens::inputTokenCSC, MuStubsInputTokens::inputTokenDtPh, MuStubsInputTokens::inputTokenDtTh, MuStubsInputTokens::inputTokenRPC, and MuonStubMakerBase::rpcClusterization.

284  if (!edmParameterSet.getParameter<bool>("dropDTPrimitives"))
285  digiToStubsConverters.emplace_back(std::make_unique<DtDigiToStubsConverterOmtf>(
286  config, this->angleConverter.get(), muStubsInputTokens.inputTokenDtPh, muStubsInputTokens.inputTokenDtTh));
287 
288  if (!edmParameterSet.getParameter<bool>("dropCSCPrimitives"))
289  digiToStubsConverters.emplace_back(std::make_unique<CscDigiToStubsConverterOmtf>(
290  config, this->angleConverter.get(), muStubsInputTokens.inputTokenCSC));
291 
292  if (!edmParameterSet.getParameter<bool>("dropRPCPrimitives"))
293  digiToStubsConverters.emplace_back(std::make_unique<RpcDigiToStubsConverterOmtf>(
294  config, this->angleConverter.get(), &rpcClusterization, muStubsInputTokens.inputTokenRPC));
295 }
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > inputTokenCSC
std::unique_ptr< OmtfAngleConverter > angleConverter
edm::EDGetTokenT< RPCDigiCollection > inputTokenRPC
MuonStubMakerBase(const ProcConfigurationBase *procConf)
def move
Definition: eostools.py:511
std::vector< std::unique_ptr< DigiToStubsConverterBase > > digiToStubsConverters
edm::EDGetTokenT< L1MuDTChambThContainer > inputTokenDtTh
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< L1MuDTChambPhContainer > inputTokenDtPh
RpcClusterization rpcClusterization
const OMTFConfiguration * config
OMTFinputMaker::~OMTFinputMaker ( )
override

Member Function Documentation

bool OMTFinputMaker::acceptDigi ( uint32_t  rawId,
unsigned int  iProcessor,
l1t::tftype  type 
)
private

Check if digis are within a give processor input. Simply checks sectors range.

Clean up digis. Remove unconnected detectors

Select RPC chambers connected to OMTF

RPC RE1/2 temporarily not used (aId.region()==1 && aId.station()==1 && aId.ring()<2) ||

Definition at line 34 of file OMTFinputMaker.cc.

References l1t::bmtf, CSCDetId::chamber(), MuonSubdetId::CSC, omtf::DataWord64::csc, DetId::det(), MuonSubdetId::DT, dt, l1t::emtf_neg, l1t::emtf_pos, CSCDetId::endcap(), OMTFConfiguration::getBarrelMax(), OMTFConfiguration::getBarrelMin(), OMTFConfiguration::getEndcap10DegMax(), OMTFConfiguration::getEndcap10DegMin(), OMTFConfiguration::getEndcap20DegMax(), OMTFConfiguration::getEndcap20DegMin(), RPCDetId::layer(), DetId::Muon, myOmtfConfig, l1t::omtf_neg, l1t::omtf_pos, RPCDetId::region(), RPCDetId::ring(), CSCDetId::ring(), RPCDetId::roll(), MuonSubdetId::RPC, DTChamberId::sector(), RPCDetId::sector(), RPCDetId::station(), CSCDetId::station(), DetId::subdetId(), RPCDetId::subsector(), and DTChamberId::wheel().

Referenced by processCSC(), processDT(), and processRPC().

34  {
35  unsigned int aMin = myOmtfConfig->getBarrelMin()[iProcessor];
36  unsigned int aMax = myOmtfConfig->getBarrelMax()[iProcessor];
37  unsigned int aSector = 99;
38 
40  DetId detId(rawId);
41  if (detId.det() != DetId::Muon)
42  edm::LogError("Critical OMTFinputMaker") << "PROBLEM: hit in unknown Det, detID: " << detId.det() << std::endl;
43  switch (detId.subdetId()) {
44  case MuonSubdetId::RPC: {
45  RPCDetId aId(rawId);
46 
48  if (type == l1t::tftype::omtf_pos &&
49  (aId.region() < 0 || (aId.region() == 0 && aId.ring() != 2) || (aId.region() == 0 && aId.station() == 4) ||
50  (aId.region() == 0 && aId.station() == 2 && aId.layer() == 2 && aId.roll() == 1) ||
51  (aId.region() == 0 && aId.station() == 3 && aId.roll() == 1) || (aId.region() == 1 && aId.station() == 4) ||
53  (aId.region() == 1 && aId.station() > 0 && aId.ring() < 3)))
54  return false;
55 
56  if (type == l1t::tftype::omtf_neg &&
57  (aId.region() > 0 || (aId.region() == 0 && aId.ring() != -2) || (aId.region() == 0 && aId.station() == 4) ||
58  (aId.region() == 0 && aId.station() == 2 && aId.layer() == 2 && aId.roll() == 1) ||
59  (aId.region() == 0 && aId.station() == 3 && aId.roll() == 1) || (aId.region() == -1 && aId.station() == 4) ||
60  //RPC RE1/2 temporarily not used (aId.region()==1 && aId.station()==1 && aId.ring()<2) ||
61  (aId.region() == -1 && aId.station() > 0 && aId.ring() < 3)))
62  return false;
63 
64  if (type == l1t::tftype::bmtf && aId.region() != 0)
65  return false;
66 
67  if (type == l1t::tftype::emtf_pos && (aId.region() <= 0 || (aId.station() == 1 && aId.ring() == 3)))
68  return false;
69  if (type == l1t::tftype::emtf_neg && (aId.region() >= 0 || (aId.station() == 1 && aId.ring() == 3)))
70  return false;
72  if (aId.region() == 0)
73  aSector = aId.sector();
74  if (aId.region() != 0) {
75  aSector = (aId.sector() - 1) * 6 + aId.subsector();
76  aMin = myOmtfConfig->getEndcap10DegMin()[iProcessor];
77  aMax = myOmtfConfig->getEndcap10DegMax()[iProcessor];
78  }
79 
80  break;
81  }
82  case MuonSubdetId::DT: {
83  DTChamberId dt(rawId);
84 
85  if (type == l1t::tftype::omtf_pos && dt.wheel() != 2)
86  return false;
87  if (type == l1t::tftype::omtf_neg && dt.wheel() != -2)
88  return false;
90  return false;
91 
92  aSector = dt.sector();
93  break;
94  }
95  case MuonSubdetId::CSC: {
96  CSCDetId csc(rawId);
97  if (type == l1t::tftype::omtf_pos && (csc.endcap() == 2 || csc.ring() == 1 || csc.station() == 4))
98  return false;
99  if (type == l1t::tftype::omtf_neg && (csc.endcap() == 1 || csc.ring() == 1 || csc.station() == 4))
100  return false;
101 
102  if (type == l1t::tftype::emtf_pos && (csc.endcap() == 2 || (csc.station() == 1 && csc.ring() == 3)))
103  return false;
104  if (type == l1t::tftype::emtf_neg && (csc.endcap() == 1 || (csc.station() == 1 && csc.ring() == 3)))
105  return false;
106 
107  aSector = csc.chamber();
108  aMin = myOmtfConfig->getEndcap10DegMin()[iProcessor];
109  aMax = myOmtfConfig->getEndcap10DegMax()[iProcessor];
110 
111  if ((type == l1t::tftype::emtf_pos || type == l1t::tftype::emtf_neg) && csc.station() > 1 && csc.ring() == 1) {
112  aMin = myOmtfConfig->getEndcap20DegMin()[iProcessor];
113  aMax = myOmtfConfig->getEndcap20DegMax()[iProcessor];
114  }
115  break;
116  }
117  }
118 
119  if (aMax > aMin && aSector >= aMin && aSector <= aMax)
120  return true;
121  if (aMax < aMin && (aSector >= aMin || aSector <= aMax))
122  return true;
123 
124  return false;
125 }
float dt
Definition: AMPTWrapper.h:136
const std::vector< unsigned int > & getBarrelMax() const
const std::vector< unsigned int > & getEndcap10DegMin() const
const OMTFConfiguration * myOmtfConfig
const std::vector< unsigned int > & getEndcap20DegMax() const
const std::vector< unsigned int > & getEndcap10DegMax() const
Definition: DetId.h:17
const std::vector< unsigned int > & getBarrelMin() const
static constexpr int RPC
Definition: MuonSubdetId.h:13
const std::vector< unsigned int > & getEndcap20DegMin() const
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12
bool OMTFinputMaker::acceptDtDigi ( const OMTFConfiguration config,
const DTChamberId dTChamberId,
unsigned int  iProcessor,
l1t::tftype  procType 
)
static

Definition at line 253 of file OMTFinputMaker.cc.

References l1t::emtf_neg, l1t::emtf_pos, OMTFConfiguration::getBarrelMax(), OMTFConfiguration::getBarrelMin(), l1t::omtf_neg, l1t::omtf_pos, DTChamberId::sector(), and DTChamberId::wheel().

Referenced by DtDigiToStubsConverterOmtf::acceptDigi().

256  {
257  unsigned int aMin = config->getBarrelMin()[iProcessor];
258  unsigned int aMax = config->getBarrelMax()[iProcessor];
259 
260  if (procType == l1t::tftype::omtf_pos && dTChamberId.wheel() != 2)
261  return false;
262  if (procType == l1t::tftype::omtf_neg && dTChamberId.wheel() != -2)
263  return false;
264  if (procType == l1t::tftype::emtf_pos || procType == l1t::tftype::emtf_neg)
265  return false;
266 
267  unsigned int aSector = dTChamberId.sector();
268 
269  if (aMax > aMin && aSector >= aMin && aSector <= aMax)
270  return true;
271  if (aMax < aMin && (aSector >= aMin || aSector <= aMax))
272  return true;
273 
274  return false;
275 }
const std::vector< unsigned int > & getBarrelMax() const
const std::vector< unsigned int > & getBarrelMin() const
int sector() const
Definition: DTChamberId.h:49
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
void OMTFinputMaker::addStub ( const OMTFConfiguration config,
MuonStubPtrs2D muonStubsInLayers,
unsigned int  iLayer,
unsigned int  iInput,
MuonStub stub 
)
static

Definition at line 408 of file OMTFinputMaker.cc.

References MuonStub::etaHw, LogTrace, OMTFConfiguration::nPhiBins(), MuonStub::phiBHw, and MuonStub::phiHw.

Referenced by CscDigiToStubsConverterOmtf::addCSCstubs(), DtDigiToStubsConverterOmtf::addDTphiDigi(), and RpcDigiToStubsConverterOmtf::addRPCstub().

412  {
413  //LogTrace("l1tOmtfEventPrint") << __FUNCTION__ << ":" << __LINE__ << " iInput " << iInput << " " << stub << endl;
414  //there is a small rate of duplicated digis in the real data in the DT and CSC, the reason for this duplicates is not understood
415  //in case of RPC the duplicated digis appear in data only for the layer 17 (RE3), where the rolls 2 and 3 has the same eta = 115 assigned, and the muon can hit both rolls
416  //the reason of the duplicates cannot be the fact that the same data (links) goes to neighboring boards, because this is removed in the OMTF unpacker
417  //the duplicates cannot be dropped, because if they appear in data, are also duplicated on the input of the algorithm, and both can be used as the reference hits
418  if (muonStubsInLayers[iLayer][iInput] && muonStubsInLayers[iLayer][iInput]->phiHw == stub.phiHw &&
419  muonStubsInLayers[iLayer][iInput]->phiBHw == stub.phiBHw &&
420  muonStubsInLayers[iLayer][iInput]->etaHw == stub.etaHw) {
421  LogTrace("OMTFReconstruction") << "addStub: the stub with exactly the same phi, phiB and eta was already added:\n"
422  << "incomnig stub " << stub << "\n"
423  << "existing stub " << *(muonStubsInLayers[iLayer][iInput]) << std::endl;
424  //return;
425  }
426 
427  if (muonStubsInLayers[iLayer][iInput] && muonStubsInLayers[iLayer][iInput]->phiHw != (int)config->nPhiBins())
428  ++iInput;
429 
430  if (muonStubsInLayers[iLayer][iInput] && muonStubsInLayers[iLayer][iInput]->phiHw != (int)config->nPhiBins())
431  return;
432  //in this implementation only two first stubs are added for a given iInput
433 
434  muonStubsInLayers.at(iLayer).at(iInput) = std::make_shared<const MuonStub>(stub);
435 }
unsigned int nPhiBins() const
#define LogTrace(id)
int phiBHw
Definition: MuonStub.h:40
int etaHw
Definition: MuonStub.h:44
int phiHw
Definition: MuonStub.h:39
OMTFinput OMTFinputMaker::buildInputForProcessor ( const L1MuDTChambPhContainer dtPhDigis,
const L1MuDTChambThContainer dtThDigis,
const CSCCorrelatedLCTDigiCollection cscDigis,
const RPCDigiCollection rpcDigis,
unsigned int  iProcessor,
l1t::tftype  type = l1t::tftype::omtf_pos,
int  bx = 0 
)

Method translating trigger digis into input matrix with global phi coordinates.

Definition at line 383 of file OMTFinputMaker.cc.

References myOmtfConfig, processCSC(), processDT(), processRPC(), and mps_fire::result.

Referenced by OMTFPatternMaker::analyze(), OMTFReconstruction::getProcessorCandidates(), and OMTFProcessor< GoldenPatternType >::run().

389  {
391  result += processDT(dtPhDigis, dtThDigis, iProcessor, type, bx);
392  result += processCSC(cscDigis, iProcessor, type, bx);
393  result += processRPC(rpcDigis, iProcessor, type, bx);
394  return result;
395 }
OMTFinput processRPC(const RPCDigiCollection *rpcDigis, unsigned int iProcessor, l1t::tftype type, int bx)
const OMTFConfiguration * myOmtfConfig
tuple result
Definition: mps_fire.py:311
OMTFinput processCSC(const CSCCorrelatedLCTDigiCollection *cscDigis, unsigned int iProcessor, l1t::tftype type, int bx)
OMTFinput processDT(const L1MuDTChambPhContainer *dtPhDigis, const L1MuDTChambThContainer *dtThDigis, unsigned int iProcessor, l1t::tftype type, int bx)
int OMTFinputMaker::getFlag ( ) const
inline

Definition at line 37 of file OMTFinputMaker.h.

References flag.

Referenced by OMTFReconstruction::getProcessorCandidates().

37 { return flag; }
unsigned int OMTFinputMaker::getInputNumber ( unsigned int  rawId,
unsigned int  iProcessor,
l1t::tftype  type 
)
private

Give input number for givedn processor, using the chamber sector number. Result is modulo allowed number of hits per chamber

on the 0-2pi border we need to add 1 30 deg sector to get the correct index

Set roll number by hand to keep common input number shift formula for all stations

Only one roll from station 3 is connected.

At the moment do not use RPC chambers splitting into rolls for bmtf part

on the 0-2pi border we need to add 4 10 deg sectors to get the correct index

on the 0-2pi border we need to add 1 30 deg sector to get the correct index

on the 0-2pi border we need to add 4 10deg sectors to get the correct index

Endcap region covers algo 10 deg sectors on the 0-2pi border we need to add 2 20deg sectors to get the correct index

Assume 2 hits per chamber

Chambers divided into two rolls have rolls number 1 and 3

Definition at line 128 of file OMTFinputMaker.cc.

References l1t::bmtf, CSCDetId::chamber(), MuonSubdetId::CSC, omtf::DataWord64::csc, DetId::det(), MuonSubdetId::DT, dt, l1t::emtf_neg, l1t::emtf_pos, OMTFConfiguration::getBarrelMin(), OMTFConfiguration::getEndcap10DegMin(), OMTFConfiguration::getEndcap20DegMin(), RPCDetId::layer(), DetId::Muon, myOmtfConfig, RPCDetId::region(), CSCDetId::ring(), RPCDetId::roll(), MuonSubdetId::RPC, omtf::DataWord64::rpc, DTChamberId::sector(), RPCDetId::sector(), RPCDetId::station(), CSCDetId::station(), DetId::subdetId(), and RPCDetId::subsector().

Referenced by RpcDigiToStubsConverterOmtf::acceptDigi(), CscDigiToStubsConverterOmtf::addCSCstubs(), DtDigiToStubsConverterOmtf::addDTphiDigi(), RpcDigiToStubsConverterOmtf::addRPCstub(), processCSC(), processDT(), and processRPC().

128  {
129  unsigned int iInput = 99;
130  unsigned int aSector = 99;
131  int aMin = myOmtfConfig->getBarrelMin()[iProcessor];
132  int iRoll = 1;
133  int nInputsPerSector = 2;
134 
135  DetId detId(rawId);
136  if (detId.det() != DetId::Muon)
137  edm::LogError("Critical OMTFinputMaker") << "PROBLEM: hit in unknown Det, detID: " << detId.det() << std::endl;
138  switch (detId.subdetId()) {
139  case MuonSubdetId::RPC: {
140  RPCDetId rpc(rawId);
141  if (rpc.region() == 0) {
142  nInputsPerSector = 4;
143  aSector = rpc.sector();
146  if (iProcessor == 5 && aSector < 3)
147  aMin = -1;
148  //Use division into rolls
149  iRoll = rpc.roll();
152  if (rpc.station() == 2 && rpc.layer() == 2 && rpc.roll() == 2)
153  iRoll = 1;
155  if (rpc.station() == 3) {
156  iRoll = 1;
157  nInputsPerSector = 2;
158  }
160  if (type == l1t::tftype::bmtf)
161  iRoll = 1;
162  }
163  if (rpc.region() != 0) {
164  aSector = (rpc.sector() - 1) * 6 + rpc.subsector();
165  aMin = myOmtfConfig->getEndcap10DegMin()[iProcessor];
168  if (iProcessor == 5 && aSector < 5)
169  aMin = -4;
170  }
171  break;
172  }
173  case MuonSubdetId::DT: {
174  DTChamberId dt(rawId);
175  aSector = dt.sector();
178  if (iProcessor == 5 && aSector < 3)
179  aMin = -1;
180  break;
181  }
182  case MuonSubdetId::CSC: {
183  CSCDetId csc(rawId);
184  aSector = csc.chamber();
185  aMin = myOmtfConfig->getEndcap10DegMin()[iProcessor];
188  if (iProcessor == 5 && aSector < 5)
189  aMin = -4;
193  if ((type == l1t::tftype::emtf_pos || type == l1t::tftype::emtf_neg) && csc.station() > 1 && csc.ring() == 1) {
194  aMin = myOmtfConfig->getEndcap20DegMin()[iProcessor];
195  if (iProcessor == 5 && aSector < 3)
196  aMin = -2;
197  }
198  break;
199  }
200  }
201 
203  iInput = (aSector - aMin) * nInputsPerSector;
205  iInput += iRoll - 1;
206 
207  return iInput;
208 }
float dt
Definition: AMPTWrapper.h:136
const std::vector< unsigned int > & getEndcap10DegMin() const
const OMTFConfiguration * myOmtfConfig
Definition: DetId.h:17
const std::vector< unsigned int > & getBarrelMin() const
static constexpr int RPC
Definition: MuonSubdetId.h:13
const std::vector< unsigned int > & getEndcap20DegMin() const
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12
unsigned int OMTFinputMaker::getInputNumber ( const OMTFConfiguration config,
unsigned int  rawId,
unsigned int  iProcessor,
l1t::tftype  type 
)
static

Give input number for given processor, using the chamber sector number. Result is modulo allowed number of hits per chamber

on the 0-2pi border we need to add 1 30 deg sector to get the correct index

Set roll number by hand to keep common input number shift formula for all stations

Only one roll from station 3 is connected.

At the moment do not use RPC chambers splitting into rolls for bmtf part

on the 0-2pi border we need to add 4 10 deg sectors to get the correct index

on the 0-2pi border we need to add 1 30 deg sector to get the correct index

on the 0-2pi border we need to add 4 10deg sectors to get the correct index

Endcap region covers algo 10 deg sectors on the 0-2pi border we need to add 2 20deg sectors to get the correct index

Assume 2 hits per chamber

Chambers divided into two rolls have rolls number 1 and 3

Definition at line 309 of file OMTFinputMaker.cc.

References l1t::bmtf, CSCDetId::chamber(), MuonSubdetId::CSC, omtf::DataWord64::csc, DetId::det(), MuonSubdetId::DT, dt, l1t::emtf_neg, l1t::emtf_pos, OMTFConfiguration::getBarrelMin(), OMTFConfiguration::getEndcap10DegMin(), OMTFConfiguration::getEndcap20DegMin(), RPCDetId::layer(), DetId::Muon, RPCDetId::region(), CSCDetId::ring(), RPCDetId::roll(), MuonSubdetId::RPC, omtf::DataWord64::rpc, DTChamberId::sector(), RPCDetId::sector(), RPCDetId::station(), CSCDetId::station(), DetId::subdetId(), and RPCDetId::subsector().

312  {
313  unsigned int iInput = 99;
314  unsigned int aSector = 99;
315  int aMin = config->getBarrelMin()[iProcessor];
316  int iRoll = 1;
317  int nInputsPerSector = 2;
318 
319  DetId detId(rawId);
320  if (detId.det() != DetId::Muon)
321  edm::LogError("Critical OMTFinputMaker") << "PROBLEM: hit in unknown Det, detID: " << detId.det() << std::endl;
322  switch (detId.subdetId()) {
323  case MuonSubdetId::RPC: {
324  RPCDetId rpc(rawId);
325  if (rpc.region() == 0) {
326  nInputsPerSector = 4;
327  aSector = rpc.sector();
330  if (iProcessor == 5 && aSector < 3)
331  aMin = -1;
332  //Use division into rolls
333  iRoll = rpc.roll();
336  if (rpc.station() == 2 && rpc.layer() == 2 && rpc.roll() == 2)
337  iRoll = 1;
339  if (rpc.station() == 3) {
340  iRoll = 1;
341  nInputsPerSector = 2;
342  }
344  if (type == l1t::tftype::bmtf)
345  iRoll = 1;
346  }
347  if (rpc.region() != 0) {
348  aSector = (rpc.sector() - 1) * 6 + rpc.subsector();
349  aMin = config->getEndcap10DegMin()[iProcessor];
352  if (iProcessor == 5 && aSector < 5)
353  aMin = -4;
354  }
355  break;
356  }
357  case MuonSubdetId::DT: {
358  DTChamberId dt(rawId);
359  aSector = dt.sector();
362  if (iProcessor == 5 && aSector < 3)
363  aMin = -1;
364  break;
365  }
366  case MuonSubdetId::CSC: {
367  CSCDetId csc(rawId);
368  aSector = csc.chamber();
369  aMin = config->getEndcap10DegMin()[iProcessor];
372  if (iProcessor == 5 && aSector < 5)
373  aMin = -4;
377  if ((type == l1t::tftype::emtf_pos || type == l1t::tftype::emtf_neg) && csc.station() > 1 && csc.ring() == 1) {
378  aMin = config->getEndcap20DegMin()[iProcessor];
379  if (iProcessor == 5 && aSector < 3)
380  aMin = -2;
381  }
382  break;
383  }
384  }
385 
387  iInput = (aSector - aMin) * nInputsPerSector;
389  iInput += iRoll - 1;
390 
391  return iInput;
392 }
float dt
Definition: AMPTWrapper.h:136
const std::vector< unsigned int > & getEndcap10DegMin() const
Definition: DetId.h:17
const std::vector< unsigned int > & getBarrelMin() const
static constexpr int RPC
Definition: MuonSubdetId.h:13
const std::vector< unsigned int > & getEndcap20DegMin() const
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12
int OMTFinputMaker::getProcessorPhiZero ( const OMTFConfiguration config,
unsigned int  iProcessor 
)
static

iProcessor - from 0 to 5 returns the global phi in hardware scale (myOmtfConfig->nPhiBins() ) at which the scale starts for give processor

Definition at line 397 of file OMTFinputMaker.cc.

References ProcConfigurationBase::foldPhi(), ecaldqm::binning::nPhiBins, and OMTFConfiguration::nPhiBins().

Referenced by CscDigiToStubsConverterOmtf::addCSCstubs(), DtDigiToStubsConverterOmtf::addDTphiDigi(), RpcDigiToStubsConverterOmtf::addRPCstub(), StubsSimHitsMatcher::match(), and EventCapture::observeEventEnd().

397  {
398  unsigned int nPhiBins = config->nPhiBins();
399 
400  int phiZero = nPhiBins / 6. * (iProcessor) + nPhiBins / 24;
401  // "0" is 15degree moved cyclically to each processor, note [0,2pi]
402 
403  return config->foldPhi(phiZero);
404 }
unsigned int nPhiBins() const
virtual int foldPhi(int phi) const
void OMTFinputMaker::initialize ( const edm::EventSetup es,
const OMTFConfiguration omtfConfig 
)

Definition at line 24 of file OMTFinputMaker.cc.

References myAngleConverter, myOmtfConfig, OMTFConfiguration::nPhiBins(), and omtfConfig().

Referenced by OMTFPatternMaker::analyze(), and OMTFReconstruction::beginRun().

24  {
25  myAngleConverter->checkAndUpdateGeometry(es, omtfConfig->nPhiBins());
26 
28 }
unsigned int nPhiBins() const
omtfConfig(omtfConfig)
const OMTFConfiguration * myOmtfConfig
std::unique_ptr< AngleConverter > myAngleConverter
void OMTFinputMaker::initialize ( const edm::ParameterSet edmCfg,
const edm::EventSetup es,
const MuonGeometryTokens muonGeometryTokens 
)
overridevirtual

Reimplemented from MuonStubMakerBase.

Definition at line 297 of file OMTFinputMaker.cc.

References angleConverter, config, and MuonStubMakerBase::initialize().

299  {
300  MuonStubMakerBase::initialize(edmCfg, es, muonGeometryTokens);
301  angleConverter->checkAndUpdateGeometry(es, config, muonGeometryTokens);
302 }
std::unique_ptr< OmtfAngleConverter > angleConverter
virtual void initialize(const edm::ParameterSet &edmCfg, const edm::EventSetup &es, const MuonGeometryTokens &muonGeometryTokens)
const OMTFConfiguration * config
OMTFinput OMTFinputMaker::processCSC ( const CSCCorrelatedLCTDigiCollection cscDigis,
unsigned int  iProcessor,
l1t::tftype  type,
int  bx 
)
private

Take the CSC digis, select chambers connected to given processor, convers logal angles to global scale. For CSC do NOT take the bending angle.

Check it the data fits into given processor input range

Check if LCT trigger primitive has the right BX.

Accept CSC digis only up to eta=1.26. The nominal OMTF range is up to 1.24, but cutting at 1.24 kill efficnency at the edge. 1.26 is one eta bin above nominal.

Definition at line 263 of file OMTFinputMaker.cc.

References acceptDigi(), OMTFinput::addLayerHit(), CSCDetId, OMTFConfiguration::getHwToLogicLayer(), getInputNumber(), OMTFConfiguration::getLayerNumber(), CSCConstants::LCT_CENTRAL_BX, myAngleConverter, myOmtfConfig, and mps_fire::result.

Referenced by buildInputForProcessor().

266  {
268  if (!cscDigis)
269  return result;
270 
271  auto chamber = cscDigis->begin();
272  auto chend = cscDigis->end();
273  for (; chamber != chend; ++chamber) {
274  unsigned int rawid = (*chamber).first;
276  if (!acceptDigi(rawid, iProcessor, type))
277  continue;
278  auto digi = (*chamber).second.first;
279  auto dend = (*chamber).second.second;
280  for (; digi != dend; ++digi) {
282  if (digi->getBX() - CSCConstants::LCT_CENTRAL_BX != bxTrg)
283  continue;
284 
285  unsigned int hwNumber = myOmtfConfig->getLayerNumber(rawid);
286  if (myOmtfConfig->getHwToLogicLayer().find(hwNumber) == myOmtfConfig->getHwToLogicLayer().end())
287  continue;
288 
289  unsigned int iLayer = myOmtfConfig->getHwToLogicLayer().at(hwNumber);
290  int iPhi = myAngleConverter->getProcessorPhi(iProcessor, type, CSCDetId(rawid), *digi);
291  int iEta = myAngleConverter->getGlobalEta(rawid, *digi);
295  //if(abs(iEta)>1.26/2.61*240) continue;
296  //if (abs(iEta) > 115) continue;
297  unsigned int iInput = getInputNumber(rawid, iProcessor, type);
298  // std::cout <<" ADDING CSC hit, proc: "<<iProcessor<<" iPhi : " << iPhi <<" iEta: "<< iEta << std::endl;
299  bool allowOverwrite = false;
300  result.addLayerHit(iLayer, iInput, iPhi, iEta, allowOverwrite);
301  }
302  }
303  return result;
304 }
const OMTFConfiguration * myOmtfConfig
tuple result
Definition: mps_fire.py:311
const std::map< int, int > & getHwToLogicLayer() const
bool acceptDigi(uint32_t rawId, unsigned int iProcessor, l1t::tftype type)
uint32_t getLayerNumber(uint32_t rawId) const
std::unique_ptr< AngleConverter > myAngleConverter
unsigned int getInputNumber(unsigned int rawId, unsigned int iProcessor, l1t::tftype type)
OMTFinput OMTFinputMaker::processDT ( const L1MuDTChambPhContainer dtPhDigis,
const L1MuDTChambThContainer dtThDigis,
unsigned int  iProcessor,
l1t::tftype  type,
int  bx 
)
private

Take the DT digis, select chambers connected to given processor, convers logal angles to global scale. For DT take also the bending angle.

Check it the data fits into given processor input range

Check Trigger primitive quality Ts2Tag() == 0 - take only first track from DT Trigger Server BxCnt() == 0 - ?? code()>=3 - take only double layer hits, HH, HL and LL

Definition at line 211 of file OMTFinputMaker.cc.

References acceptDigi(), OMTFinput::addLayerHit(), OMTFConfiguration::fwVersion(), L1MuDTChambPhContainer::getContainer(), OMTFConfiguration::getHwToLogicLayer(), getInputNumber(), OMTFConfiguration::getLayerNumber(), myAngleConverter, myOmtfConfig, and mps_fire::result.

Referenced by buildInputForProcessor().

215  {
217  if (!dtPhDigis)
218  return result;
219 
220  for (const auto &digiIt : *dtPhDigis->getContainer()) {
221  DTChamberId detid(digiIt.whNum(), digiIt.stNum(), digiIt.scNum() + 1);
222 
224  if (!acceptDigi(detid.rawId(), iProcessor, type))
225  continue;
226 
231  // FIXME (MK): at least Ts2Tag selection is not correct! Check it
232  // if (digiIt.bxNum()!= 0 || digiIt.BxCnt()!= 0 || digiIt.Ts2Tag()!= 0 || digiIt.code()<4) continue;
233 
234  if (digiIt.bxNum() != bxTrg)
235  continue;
236 
237  if (myOmtfConfig->fwVersion() <= 4) {
238  if (digiIt.code() != 4 && digiIt.code() != 5 && digiIt.code() != 6)
239  continue;
240  } else {
241  if (digiIt.code() != 2 && digiIt.code() != 3 && digiIt.code() != 4 && digiIt.code() != 5 && digiIt.code() != 6)
242  continue;
243  }
244 
245  unsigned int hwNumber = myOmtfConfig->getLayerNumber(detid.rawId());
246  if (myOmtfConfig->getHwToLogicLayer().find(hwNumber) == myOmtfConfig->getHwToLogicLayer().end())
247  continue;
248 
249  auto iter = myOmtfConfig->getHwToLogicLayer().find(hwNumber);
250  unsigned int iLayer = iter->second;
251  int iPhi = myAngleConverter->getProcessorPhi(iProcessor, type, digiIt);
252  int iEta = myAngleConverter->getGlobalEta(detid.rawId(), digiIt, dtThDigis);
253  unsigned int iInput = getInputNumber(detid.rawId(), iProcessor, type);
254  bool allowOverwrite = false;
255  result.addLayerHit(iLayer, iInput, iPhi, iEta, allowOverwrite);
256  result.addLayerHit(iLayer + 1, iInput, digiIt.phiB(), iEta, allowOverwrite);
257  }
258 
259  return result;
260 }
unsigned int fwVersion() const
const OMTFConfiguration * myOmtfConfig
tuple result
Definition: mps_fire.py:311
const std::map< int, int > & getHwToLogicLayer() const
bool acceptDigi(uint32_t rawId, unsigned int iProcessor, l1t::tftype type)
uint32_t getLayerNumber(uint32_t rawId) const
std::unique_ptr< AngleConverter > myAngleConverter
unsigned int getInputNumber(unsigned int rawId, unsigned int iProcessor, l1t::tftype type)
Phi_Container const * getContainer() const
OMTFinput OMTFinputMaker::processRPC ( const RPCDigiCollection rpcDigis,
unsigned int  iProcessor,
l1t::tftype  type,
int  bx 
)
private

Decluster nearby hits in single chamber, by taking average cluster position, expressed in half RPC strip: pos = (cluster_begin + cluster_end)

Find clusters of consecutive fired strips. Have to copy the digis in chamber to sort them (not optimal). NOTE: when copying I select only digis with bx== //FIXME: find a better place/way to filtering digi against quality/BX etc.

Definition at line 310 of file OMTFinputMaker.cc.

References funct::abs(), acceptDigi(), OMTFinput::addLayerHit(), HLT_FULL_cff::clusters, OMTFConfiguration::getHwToLogicLayer(), getInputNumber(), OMTFConfiguration::getLayerNumber(), myAngleConverter, myOmtfConfig, DetId::rawId(), mps_fire::result, rpcPrimitiveCmp(), and str.

Referenced by buildInputForProcessor().

313  {
315  if (!rpcDigis)
316  return result;
317  std::stringstream str;
318 
319  // std::cout <<" RPC HITS, processor : " << iProcessor << std::endl;
320 
321  const RPCDigiCollection &rpcDigiCollection = *rpcDigis;
322  for (auto rollDigis : rpcDigiCollection) {
323  RPCDetId roll = rollDigis.first;
324  unsigned int rawid = roll.rawId();
325  int nClusters = 0;
326  if (!acceptDigi(rawid, iProcessor, type))
327  continue;
331  // 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; }
332  std::vector<RPCDigi> digisCopy;
333  // std::copy_if(rollDigis.second.first, rollDigis.second.second, std::back_inserter(digisCopy), [](const RPCDigi & aDigi){return (aDigi.bx()==0);} );
334  for (auto pDigi = rollDigis.second.first; pDigi != rollDigis.second.second; pDigi++) {
335  if (pDigi->bx() == bxTrg)
336  digisCopy.push_back(*pDigi);
337  }
338  std::sort(digisCopy.begin(), digisCopy.end(), rpcPrimitiveCmp);
339  typedef std::pair<unsigned int, unsigned int> Cluster;
340  std::vector<Cluster> clusters;
341  for (auto &digi : digisCopy) {
342  if (clusters.empty())
343  clusters.push_back(Cluster(digi.strip(), digi.strip()));
344  else if (digi.strip() - clusters.back().second == 1)
345  clusters.back().second = digi.strip();
346  else if (digi.strip() - clusters.back().second > 1)
347  clusters.push_back(Cluster(digi.strip(), digi.strip()));
348  }
349 
350  for (auto &cluster : clusters) {
351  // int iPhiHalfStrip1 = myAngleConverter->getProcessorPhi(iProcessor, type, roll, cluster.first);
352  // int iPhiHalfStrip2 = myAngleConverter->getProcessorPhi(iProcessor, type, roll, cluster.second);
353  int iPhi = myAngleConverter->getProcessorPhi(iProcessor, type, roll, cluster.first, cluster.second);
354  int cSize = abs(int(cluster.first) - int(cluster.second)) + 1;
355  // std::cout << " HStrip_1: " << iPhiHalfStrip1 <<" HStrip_2: "<<iPhiHalfStrip2<<" iPhi: " << iPhi << " cluster: ["<< cluster.first << ", "<< cluster.second <<"]"<< std::endl;
356  if (cSize > 3)
357  continue;
358  int iEta = myAngleConverter->getGlobalEta(rawid, cluster.first);
359  unsigned int hwNumber = myOmtfConfig->getLayerNumber(rawid);
360  unsigned int iLayer = myOmtfConfig->getHwToLogicLayer().at(hwNumber);
361  unsigned int iInput = getInputNumber(rawid, iProcessor, type);
362  // std::cout <<"ADDING HIT: iLayer = " << iLayer << " iInput: " << iInput << " iPhi: " << iPhi << std::endl;
363  if (iLayer == 17 && (iInput == 0 || iInput == 1))
364  continue; // FIXME (MK) there is no RPC link for that input, because it is taken by DAQ link
365  bool outres = result.addLayerHit(iLayer, iInput, iPhi, iEta);
366  // if (cSize>2) flag |= 2;
367  // if (!outres) flag |= 1;
368  nClusters++;
369 
370  str << " RPC halfDigi "
371  << " begin: " << cluster.first << " end: " << cluster.second << " iPhi: " << iPhi << " iEta: " << iEta
372  << " hwNumber: " << hwNumber << " iInput: " << iInput << " iLayer: " << iLayer << " out: " << outres
373  << std::endl;
374  }
375  // if (nClusters > 2) flag=1;
376  }
377 
378  edm::LogInfo("OMTFInputMaker") << str.str();
379  return result;
380 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const OMTFConfiguration * myOmtfConfig
tuple result
Definition: mps_fire.py:311
bool rpcPrimitiveCmp(const RPCDigi &a, const RPCDigi &b)
const std::map< int, int > & getHwToLogicLayer() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Log< level::Info, false > LogInfo
bool acceptDigi(uint32_t rawId, unsigned int iProcessor, l1t::tftype type)
uint32_t getLayerNumber(uint32_t rawId) const
std::unique_ptr< AngleConverter > myAngleConverter
unsigned int getInputNumber(unsigned int rawId, unsigned int iProcessor, l1t::tftype type)
#define str(s)
void OMTFinputMaker::setFlag ( int  aFlag)
inline

Definition at line 36 of file OMTFinputMaker.h.

References flag.

Referenced by OMTFReconstruction::getProcessorCandidates().

36 { flag = aFlag; }

Member Data Documentation

std::unique_ptr<OmtfAngleConverter> OMTFinputMaker::angleConverter
protected

Definition at line 138 of file OMTFinputMaker.h.

Referenced by initialize().

const OMTFConfiguration* OMTFinputMaker::config = nullptr
protected
int OMTFinputMaker::flag
private

Definition at line 75 of file OMTFinputMaker.h.

Referenced by getFlag(), and setFlag().

std::unique_ptr<AngleConverter> OMTFinputMaker::myAngleConverter
private

Definition at line 71 of file OMTFinputMaker.h.

Referenced by initialize(), processCSC(), processDT(), and processRPC().

const OMTFConfiguration* OMTFinputMaker::myOmtfConfig
private