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 | Private Attributes
omtf::CscPacker Class Reference

#include <OmtfCscPacker.h>

Public Member Functions

void init ()
 
void pack (const CSCCorrelatedLCTDigiCollection *prod, FedAmcRawsMap &raws)
 

Private Attributes

MapCscDet2EleIndex theCsc2Omtf
 

Detailed Description

Definition at line 16 of file OmtfCscPacker.h.

Member Function Documentation

void omtf::CscPacker::init ( void  )

Definition at line 9 of file OmtfCscPacker.cc.

References omtf::mapCscDet2EleIndex(), and theCsc2Omtf.

Referenced by omtf::OmtfPacker::beginRun().

MapCscDet2EleIndex mapCscDet2EleIndex()
MapCscDet2EleIndex theCsc2Omtf
Definition: OmtfCscPacker.h:22
void omtf::CscPacker::pack ( const CSCCorrelatedLCTDigiCollection prod,
FedAmcRawsMap raws 
)

Definition at line 11 of file OmtfCscPacker.cc.

References amc, omtf::CscDataWord64::bxNum_, CSCDetId::chamber(), omtf::CscDataWord64::clctPattern_, CSCDetId, omtf::CscDataWord64::cscID_, data, omtf::CscDataWord64::halfStrip_, omtf::CscDataWord64::hitNum_, omtf::CscDataWord64::keyWG_, CSCConstants::LCT_CENTRAL_BX, MainPageGenerator::link, omtf::CscDataWord64::linkNum_, electronStore::links, LogTrace, omtf::CscDataWord64::lr_, omtf::CscDataWord64::quality_, omtf::CscDataWord64::rawData, CSCDetId::station(), omtf::CscDataWord64::station_, theCsc2Omtf, and omtf::CscDataWord64::vp_.

Referenced by omtf::OmtfPacker::produce().

11  {
12  const CSCCorrelatedLCTDigiCollection& cscDigis = *prod;
13  for (const auto& chDigis : cscDigis) {
14  CSCDetId chamberId = CSCDetId(chDigis.first).chamberId();
15  for (auto digi = chDigis.second.first; digi != chDigis.second.second; digi++) {
16  CscDataWord64 data;
17  data.hitNum_ = digi->getTrknmb();
18  data.vp_ = digi->isValid();
19  data.bxNum_ = digi->getBX() - (CSCConstants::LCT_CENTRAL_BX - 3);
20  data.halfStrip_ = digi->getStrip();
21  data.clctPattern_ = digi->getPattern();
22  data.keyWG_ = digi->getKeyWG();
23  data.lr_ = digi->getBend();
24  data.quality_ = digi->getQuality();
25  auto im = theCsc2Omtf.find(chamberId);
26  if (im != theCsc2Omtf.end()) {
27  std::vector<EleIndex> links = {im->second.first, im->second.second};
28  for (const auto& link : links) {
29  unsigned int fed = link.fed();
30  if (fed == 0)
31  continue;
32  data.station_ = chamberId.station() - 1;
33  data.linkNum_ = link.link();
34  data.cscID_ = chamberId.chamber() - (link.amc() - 1) * 6;
35  unsigned int amc = link.amc() * 2 - 1;
36  raws[std::make_pair(fed, amc)].push_back(data.rawData);
37  LogTrace("") << "ADDED RAW: fed: " << fed << " amc: " << amc << " CSC DATA: " << data << std::endl;
38  }
39  }
40  }
41  }
42  }
int chamber() const
Definition: CSCDetId.h:62
#define LogTrace(id)
double amc
Definition: hdecay.h:20
MapCscDet2EleIndex theCsc2Omtf
Definition: OmtfCscPacker.h:22
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
int station() const
Definition: CSCDetId.h:79

Member Data Documentation

MapCscDet2EleIndex omtf::CscPacker::theCsc2Omtf
private

Definition at line 22 of file OmtfCscPacker.h.

Referenced by init(), and pack().