CMS 3D CMS Logo

CSCDigiToPattern.cc
Go to the documentation of this file.
5 
7 
8  d_token = consumes<CSCCorrelatedLCTDigiCollection>( conf.getParameter<edm::InputTag>("corrlctDigiTag") );
9 
10 }
11 
13 
14  // These declarations create handles to the types of records that you want
15  // to retrieve from event "e".
16  //
18  e.getByToken( d_token, correlatedlcts);
19 
20  for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator j=correlatedlcts->begin(); j!=correlatedlcts->end(); j++) {
21  CSCDetId id=(*j).first;
22  std::cout<<id<<std::endl;
23  std::vector<CSCCorrelatedLCTDigi>::const_iterator digiIt = (*j).second.first;
24  std::vector<CSCCorrelatedLCTDigi>::const_iterator last = (*j).second.second;
25  for( ; digiIt != last; ++digiIt) {
26  uint16_t wire = digiIt->getKeyWG(); // 7 bits
27  uint16_t pattern = digiIt->getPattern(); // 4 bits
28  uint16_t quality = digiIt->getQuality(); // 4 bits
29  uint16_t valid = digiIt->isValid(); // 1 bit
30  uint16_t strip = digiIt->getStrip(); // 8 bits
31  uint16_t bend = digiIt->getBend(); // 1 bit
32  uint16_t syncErr = digiIt->getSyncErr(); // 1 bit
33  uint16_t bx = digiIt->getBX(); // 1 bit
34  uint16_t bx0 = digiIt->getBX0(); // 1 bit
35  uint16_t cscId = digiIt->getCSCID(); // 4 bits
36  // __
37  // 32 bits in total
38  long unsigned int mpc =
39  ((cscId&0xF)<<28) | ((bx0&0x1)<<27) | ((bx&0x1)<<26) |
40  ((syncErr&0x1)<<25) | ((bend&0x1)<<24) | ((strip&0xFF)<<16) |
41  ((valid&0x1)<<15) | ((quality&0xF)<<11) | ((pattern&0xF)<<7) |
42  (wire&0x7F);
43  std::cout <<"MPC"<<digiIt->getTrknmb()<< " " << std::hex << mpc <<std::dec <<std::endl;
44  }
45  }
46 }
47 
48 
49 
50 
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
CSCDigiToPattern(edm::ParameterSet const &conf)
void analyze(edm::Event const &e, edm::EventSetup const &iSetup) override
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > d_token