CMS 3D CMS Logo

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 14 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().

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

Definition at line 14 of file OmtfCscPacker.cc.

References omtf::CscDataWord64::bxNum_, CSCDetId::chamber(), CSCDetId::chamberId(), omtf::CscDataWord64::clctPattern_, omtf::CscDataWord64::cscID_, data, omtf::CscDataWord64::halfStrip_, omtf::CscDataWord64::hitNum_, omtf::CscDataWord64::keyWG_, CSCConstants::LCT_CENTRAL_BX, omtf::CscDataWord64::linkNum_, LogTrace, omtf::CscDataWord64::lr_, parseEventContent::prod, omtf::CscDataWord64::quality_, omtf::CscDataWord64::rawData, CSCDetId::station(), omtf::CscDataWord64::station_, theCsc2Omtf, and omtf::CscDataWord64::vp_.

Referenced by pyrootRender.interactiveRender::draw(), and omtf::OmtfPacker::produce().

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++) {
20  CscDataWord64 data;
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 }
int chamber() const
Definition: CSCDetId.h:68
MapCscDet2EleIndex theCsc2Omtf
Definition: OmtfCscPacker.h:22
CSCDetId chamberId() const
Definition: CSCDetId.h:53
#define LogTrace(id)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int station() const
Definition: CSCDetId.h:86
Definition: AMCSpec.h:8

Member Data Documentation

MapCscDet2EleIndex omtf::CscPacker::theCsc2Omtf
private

Definition at line 22 of file OmtfCscPacker.h.

Referenced by init(), and pack().