CMS 3D CMS Logo

Namespaces | Classes | Functions
l1t::stage2 Namespace Reference

Namespaces

 emtf
 
 layer2
 

Classes

class  BMTFCollections
 
class  BMTFPackerInputs
 
class  BMTFPackerOutput
 
class  BMTFSetup
 
class  BMTFTokens
 
class  BMTFUnpackerInputsNewQual
 
class  BMTFUnpackerInputsOldQual
 
class  BMTFUnpackerOutput
 
class  CaloCollections
 
class  CaloEGammaPacker
 
class  CaloEtSumPacker
 
class  CaloJetPacker
 
class  CaloLayer1Collections
 
class  CaloLayer1Packer
 
class  CaloLayer1Setup
 
class  CaloLayer1Tokens
 
class  CaloLayer1Unpacker
 
class  CaloSetup
 
class  CaloTauPacker
 
class  CaloTokens
 
class  CaloTowerPacker
 
class  CaloTowerUnpacker
 
class  CommonTokens
 
class  EGammaPacker
 
class  EGammaUnpacker
 
class  EMTFCollections
 
class  EMTFSetup
 
class  EMTFTokens
 
class  EtSumPacker
 
class  EtSumUnpacker
 
class  EtSumUnpacker_0x10010057
 
class  GlobalAlgBlkPacker
 
class  GlobalAlgBlkUnpacker
 
class  GlobalExtBlkPacker
 
class  GlobalExtBlkUnpacker
 
class  GMTCollections
 
class  GMTMuonPacker
 
class  GMTSetup
 
class  GMTTokens
 
class  GTCollections
 
class  GTEGammaPacker
 
class  GTEtSumPacker
 
class  GTJetPacker
 
class  GTMuonPacker
 
class  GTSetup
 
class  GTTauPacker
 
class  GTTokens
 
class  IntermediateMuonPacker
 
class  IntermediateMuonUnpacker
 
class  JetPacker
 
class  JetUnpacker
 
class  L1TObjectCollections
 
class  MPUnpacker
 
class  MPUnpacker_0x1001000b
 
class  MPUnpacker_0x10010010
 
class  MPUnpacker_0x10010033
 
class  MuonPacker
 
class  MuonUnpacker
 
struct  qualityHits
 
class  RegionalMuonGMTPacker
 
class  RegionalMuonGMTUnpacker
 
class  TauPacker
 
class  TauUnpacker
 

Functions

bool checkQual_bmtf (const unsigned int &value, const bool &isNewFw)
 
void numWheelSectorTrTag_bmtf (int &wheelNo, int &tagSegID, int linkNo, int amcNo)
 
bool unpacking_bmtf (const Block &block, UnpackerCollections *coll, qualityHits &linkAndQual_, const bool &isNewFw)
 

Function Documentation

bool l1t::stage2::checkQual_bmtf ( const unsigned int &  value,
const bool &  isNewFw 
)

Definition at line 31 of file BMTFUnpackerInputs.cc.

Referenced by unpacking_bmtf().

32  {
33  if (isNewFw)
34  return (value == 7);
35  else
36  return (value == 0);
37  }
Definition: value.py:1
void l1t::stage2::numWheelSectorTrTag_bmtf ( int &  wheelNo,
int &  tagSegID,
int  linkNo,
int  amcNo 
)

Definition at line 12 of file BMTFUnpackerInputs.cc.

Referenced by unpacking_bmtf().

13  {
14  if (linkNo >= 0 && linkNo < 6)
15  wheelNo = -2;
16  else if (linkNo >= 8 && linkNo < 14)
17  wheelNo = -1;
18  else if (linkNo >= 16 && linkNo < 22)
19  wheelNo = 0;
20  else if (linkNo >= 22 && linkNo < 28)
21  wheelNo = 1;
22  else if ( (linkNo >= 28 && linkNo < 30) || (linkNo >= 32 && linkNo < 36))
23  wheelNo = 2;
24 
25  if ( linkNo%2 == 0 )
26  tagSegID = 0;
27  else
28  tagSegID = 1;
29  }
bool l1t::stage2::unpacking_bmtf ( const Block block,
UnpackerCollections coll,
qualityHits linkAndQual_,
const bool &  isNewFw 
)

Definition at line 39 of file BMTFUnpackerInputs.cc.

References l1t::Block::amc(), electrons_cff::bool, checkQual_bmtf(), coll, popcon2dropbox::copy(), l1t::Block::getBxBlocks(), L1MuDTChambThContainer::getContainer(), L1MuDTChambPhContainer::getContainer(), l1t::BlockHeader::getFlags(), l1t::BlockHeader::getID(), l1t::BlockHeader::getSize(), l1t::Block::header(), l1t::stage2::qualityHits::hits, mps_fire::i, l1t::stage2::qualityHits::linkNo, LogDebug, numWheelSectorTrTag_bmtf(), L1MuDTChambPhContainer::setContainer(), L1MuDTChambThContainer::setContainer(), makeMuonMisalignmentScenario::wheel, and globals_cff::x1.

Referenced by l1t::stage2::BMTFUnpackerInputsOldQual::unpack(), and l1t::stage2::BMTFUnpackerInputsNewQual::unpack().

40  {
41 
42  unsigned int ownLinks[] = {4,5,12,13,20,21,22,23,28,29};
43  bool ownFlag(false);
44 
45  //Checks if the given block coresponds to 1 of the OWN links
46  for (int i = 0; i < 10; i++)
47  {
48  if (block.header().getID()/2 == ownLinks[i])
49  ownFlag = true;
50  }
51  if ( !ownFlag )//if not returns that the "job here done"
52  return true;
53 
54 
55  //Get header ID and payload from the given Block
56  unsigned int blockId = block.header().getID();
57  LogDebug("L1T") << "Block ID: " << blockId << " size: " << block.header().getSize();
58 
59  //Make output CMSSW collections
60  L1MuDTChambPhContainer *resPhi = static_cast<BMTFCollections*>(coll)->getInMuonsPh();
61  L1MuDTChambThContainer *resThe = static_cast<BMTFCollections*>(coll)->getInMuonsTh();
62 
63  //Get input phi & eta Containers
66 
67  //ZeroSuppresion Handler
68  BxBlocks bxBlocks;
69  bool ZS_enabled = (bool)((block.header().getFlags() >> 1) & 0x01);//getFlags() returns first 8-bits from the amc header
70  if (ZS_enabled)
71  bxBlocks = block.getBxBlocks((unsigned int)6, true);//it returnes 7-32bit bxBlocks originated from the amc13 Block
72  else
73  bxBlocks = block.getBxBlocks((unsigned int)6, false);//it returnes 6-32bit bxBlocks originated from the amc13 Block
74 
75 
76  for(auto ibx : bxBlocks)//Bx iteration
77  {
78 
79  int bxNum = ibx.header().getBx();
80  uint32_t inputWords[ibx.getSize()]; //array of 6 uint32_t payload-words (size of the payload in the BxBlock)
81 
82  //Note
83  /*In the non-ZS fashion, the expression "block.header().getSize()/nBX" was 6 in any case
84  the reason is that the size is 6 or 30, and these numbers are divided by 1 or 5 respectively.*/
85 
86  //Fill the above uint32_t array
87  for(unsigned int iw = 0; iw < ibx.getSize(); iw++)
88  inputWords[iw] = (ibx.payload())[iw];
89 
90 
91  int wheel, sector, trTag;//Container information
92  numWheelSectorTrTag_bmtf(wheel, trTag, blockId/2, block.amc().getAMCNumber());//this returns wheel & tsTag
93  sector = block.amc().getBoardID() - 1;
94 
95  //Check if the sector is "out of range" - (trys then to use AMC13 information?)
96  if ( sector < 0 || sector > 11 )
97  {
98  edm::LogInfo ("l1t:stage2::BMTFUnpackerInputs::unpack") << "Sector found out of range so it will be calculated by the slot number";
99  if ( block.amc().getAMCNumber()%2 != 0 )
100  sector = block.amc().getAMCNumber()/2 ;
101  else
102  sector = 6 + (block.amc().getAMCNumber()/2 -1);
103  }
104 
105  int mbPhi[4], mbPhiB[4], mbQual[4], mbBxC[4], mbRPC[4];//Container information
106  //mbPhiB[2] = 0;
107 
108  for (int iw = 0; iw < 4; iw++)// 4 phi (32-bit) words
109  {
110  if ( ((inputWords[iw] & 0xfffffff) == 0) || (inputWords[iw] == 0x505050bc) )
111  continue;
112  else if ( (inputWords[iw] != 0x505050bc) && (inputWords[iw+2] == 0x505050bc) )
113  continue;
114 
115 
116  if ( ((inputWords[iw] >> 11) & 0x1) == 1 )
117  mbPhi[iw] = (inputWords[iw] & 0x7FF ) - 2048;
118  else
119  mbPhi[iw] = (inputWords[iw] & 0xFFF );
120 
121 
122  if ( ((inputWords[iw] >> 21) & 0x1) == 1 )
123  mbPhiB[iw] = ( (inputWords[iw] >> 12) & 0x1FF ) - 512;
124  else
125  mbPhiB[iw] = (inputWords[iw] >> 12) & 0x3FF;
126 
127  mbQual[iw] = (inputWords[iw] >> 22) & 0x7;
128  mbRPC[iw] = (inputWords[iw] >> 26) & 0x1;
129  mbBxC[iw] = (inputWords[iw] >> 30) & 0x3;
130 
131  //if (mbQual[iw] == 0)
132  if (checkQual_bmtf(mbQual[iw], isNewFw))
133  continue;
134 
135  phiData.push_back( L1MuDTChambPhDigi( bxNum, wheel, sector, iw+1, mbPhi[iw], mbPhiB[iw], mbQual[iw], trTag, mbBxC[iw], mbRPC[iw] ) );
136 
137  }//4 phi words
138 
139 
140  int etaHits[3][7];//Container information
141  bool zeroFlag[3];
142  for (int i = 0; i < 3; i++)// 3 eta (7-bit) words
143  {
144  zeroFlag[i] = false;
145  for(int j=0; j<7; j++)
146  {
147  etaHits[i][j] = (inputWords[4] >> (i*7 + j)) & 0x1;
148  if ( etaHits[i][j]!=0 )
149  zeroFlag[i] = true;
150  }
151  }//3 eta words
152 
153 
154  if ( trTag == 1 )
155  {
156  for (int i = 0; i < 3; i++)
157  {
158  if (zeroFlag[i])
159  theData.push_back(L1MuDTChambThDigi( bxNum, wheel, sector, i+1, etaHits[i], linkAndQual_.hits[i]) );
160  }
161 
162  }
163  else
164  {
165  /*
166  qualityHits temp;
167  temp.linkNo = blockId/2;
168  std::copy(&etaHits[0][0], &etaHits[0][0]+3*7,&temp.hits[0][0]);
169  linkAndQual_[blockId/2] = temp;
170  */
171  linkAndQual_.linkNo = blockId/2;
172  std::copy(&etaHits[0][0], &etaHits[0][0]+3*7,&linkAndQual_.hits[0][0]);
173  }
174 
175 
176  }//iBxBlock
177 
178  //Fill Containers
179  resThe->setContainer(theData);
180  resPhi->setContainer(phiData);
181 
182  return true;
183 
184  }
#define LogDebug(id)
The_Container const * getContainer() const
bool checkQual_bmtf(const unsigned int &value, const bool &isNewFw)
def copy(args, dbName)
void setContainer(Phi_Container inputSegments)
std::vector< L1MuDTChambPhDigi > Phi_Container
std::vector< L1MuDTChambThDigi > The_Container
JetCorrectorParametersCollection coll
Definition: classes.h:10
std::vector< BxBlock > BxBlocks
Definition: BxBlock.h:68
void setContainer(The_Container inputSegments)
Phi_Container const * getContainer() const
void numWheelSectorTrTag_bmtf(int &wheelNo, int &tagSegID, int linkNo, int amcNo)