CMS 3D CMS Logo

OmtfCscPacker.cc
Go to the documentation of this file.
2 
6 
7 namespace omtf {
8 
10 {
12 }
13 
15 {
16  const CSCCorrelatedLCTDigiCollection & cscDigis = *prod;
17  for (const auto & chDigis : cscDigis) {
18  CSCDetId chamberId = CSCDetId(chDigis.first).chamberId();
19  for (auto digi = chDigis.second.first; digi != chDigis.second.second; digi++) {
21  data.hitNum_ = digi->getTrknmb();
22  data.vp_ = digi->isValid();
23  data.bxNum_ = digi->getBX()-(CSCConstants::LCT_CENTRAL_BX-3);
24  data.halfStrip_ = digi->getStrip();
25  data.clctPattern_ = digi->getPattern();
26  data.keyWG_ = digi->getKeyWG();
27  data.lr_ = digi->getBend();
28  data.quality_ = digi->getQuality();
29  auto im = theCsc2Omtf.find(chamberId);
30  if (im != theCsc2Omtf.end()) {
31  std::vector<EleIndex> links = {im->second.first, im->second.second};
32  for (const auto & link : links) {
33  unsigned int fed = link.fed();
34  if (fed == 0) continue;
35  data.station_ = chamberId.station()-1;
36  data.linkNum_ = link.link();
37  data.cscID_ = chamberId.chamber()-(link.amc()-1)*6;
38  unsigned int amc = link.amc()*2-1;
39  raws[std::make_pair(fed,amc)].push_back(data.rawData);
40  LogTrace("") <<"ADDED RAW: fed: "<< fed <<" amc: "<<amc <<" CSC DATA: " << data<< std::endl;
41  }
42  }
43  }
44  }
45 
46 }
47 
48 }
int chamber() const
Definition: CSCDetId.h:68
std::map< std::pair< unsigned int, unsigned int >, std::vector< Word64 > > FedAmcRawsMap
MapCscDet2EleIndex mapCscDet2EleIndex()
MapCscDet2EleIndex theCsc2Omtf
Definition: OmtfCscPacker.h:22
CSCDetId chamberId() const
Definition: CSCDetId.h:53
void pack(const CSCCorrelatedLCTDigiCollection *prod, FedAmcRawsMap &raws)
#define LogTrace(id)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int station() const
Definition: CSCDetId.h:86
Definition: AMCSpec.h:8