21 useDBEMap_(pset.getParameter<
bool>(
"useDBEMap")),
22 unPackStatusDigis_(pset.getParameter<
bool>(
"unPackStatusDigis"))
24 produces<GEMDigiCollection>();
26 produces<GEMVfatStatusDigiCollection>(
"vfatStatus");
27 produces<GEMGEBdataCollection>(
"gebStatus");
28 produces<GEMAMCdataCollection>(
"AMCdata");
29 produces<GEMAMC13EventCollection>(
"AMC13Event");
37 desc.
add<
bool>(
"useDBEMap",
false);
38 desc.
add<
bool>(
"unPackStatusDigis",
false);
39 descriptions.
add(
"muonGEMDigisDefault", desc);
44 auto gemROmap = std::make_shared<GEMROMapping>();
48 auto gemEMap = std::make_unique<GEMeMap>(*(gemEMapRcd.
product()));
49 gemEMap->convert(*gemROmap);
54 auto gemEMap = std::make_unique<GEMeMap>();
55 gemEMap->convertDummy(*gemROmap);
63 auto outGEMDigis = std::make_unique<GEMDigiCollection>();
64 auto outVFATStatus = std::make_unique<GEMVfatStatusDigiCollection>();
65 auto outGEBStatus = std::make_unique<GEMGEBdataCollection>();
66 auto outAMCdata = std::make_unique<GEMAMCdataCollection>();
67 auto outAMC13Event = std::make_unique<GEMAMC13EventCollection>();
79 LogDebug(
"GEMRawToDigiModule") <<
" words " << nWords;
81 if (nWords<5)
continue;
82 const unsigned char *
data = fedData.
data();
84 auto amc13Event = std::make_unique<AMC13Event>();
88 amc13Event->setCDFHeader(*word);
89 amc13Event->setAMC13Header(*(++word));
92 for (uint8_t
i = 0;
i < amc13Event->nAMC(); ++
i)
93 amc13Event->addAMCheader(*(++word));
96 for (uint8_t
i = 0;
i < amc13Event->nAMC(); ++
i) {
97 auto amcData = std::make_unique<AMCdata>();
98 amcData->setAMCheader1(*(++word));
99 amcData->setAMCheader2(*(++word));
100 amcData->setGEMeventHeader(*(++word));
101 uint16_t amcBx = amcData->bx();
102 uint8_t amcNum = amcData->amcNum();
105 for (uint8_t j = 0; j < amcData->davCnt(); ++j) {
106 auto gebData = std::make_unique<GEBdata>();
107 gebData->setChamberHeader(*(++word));
109 uint8_t gebId = gebData->inputID();
114 for (uint16_t
k = 0;
k < gebData->vfatWordCnt()/3;
k++) {
115 auto vfatData = std::make_unique<VFATdata>();
116 vfatData->read_fw(*(++word));
117 vfatData->read_sw(*(++word));
118 vfatData->read_tw(*(++word));
120 vfatData->setVersion(geb_dc.
vfatVer);
121 uint16_t vfatId = vfatData->vfatId();
125 if (!gemROMap->isValidChipID(vfat_ec)) {
127 <<
" gebId "<<
int(gebId)
128 <<
" vfatId "<<
int(vfatId)
129 <<
" vfat Pos "<<
int(vfatData->position());
133 if (vfatData->quality()) {
135 <<
" b1010 "<<
int(vfatData->b1010())
136 <<
" b1100 "<<
int(vfatData->b1100())
137 <<
" b1110 "<<
int(vfatData->b1110());
138 if (vfatData->crc() != vfatData->checkCRC() ) {
140 <<vfatData->crc()<<
" "<<vfatData->checkCRC();
148 uint16_t bc=vfatData->bc();
154 if (
chan < 64) chan0xf = ((vfatData->lsData() >>
chan) & 0
x1);
155 else chan0xf = ((vfatData->msData() >> (
chan-64)) & 0x1);
158 if (chan0xf==0)
continue;
169 <<
" amc:" <<
int(amcNum)
170 <<
" geb:" <<
int(gebId)
174 <<
" ch:"<< chMap.
chNum 175 <<
" st:"<< digi.
strip()
176 <<
" bx:"<< digi.
bx();
178 outGEMDigis.get()->insertDigi(gemId,digi);
188 gebData->setChamberTrailer(*(++word));
191 outGEBStatus.get()->insertDigi(gemChId.
chamberId(), (*gebData));
196 amcData->setGEMeventTrailer(*(++word));
197 amcData->setAMCTrailer(*(++word));
200 outAMCdata.get()->insertDigi(amcData->boardId(), (*amcData));
205 amc13Event->setAMC13Trailer(*(++word));
206 amc13Event->setCDFTrailer(*(++word));
209 outAMC13Event.get()->insertDigi(amc13Event->bxId(),
AMC13Event(*amc13Event));
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Run const & getRun() const
static const int maxChan_
size_t size() const
Lenght of the data buffer in bytes.
edm::EDGetTokenT< FEDRawDataCollection > fed_token
GEMDetId chamberId() const
Return the corresponding ChamberId.
std::shared_ptr< GEMROMapping > globalBeginRun(edm::Run const &, edm::EventSetup const &) const override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
GEMRawToDigiModule(const edm::ParameterSet &pset)
Constructor.
unsigned long long uint64_t
void add(std::string const &label, ParameterSetDescription const &psetDescription)
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
char data[epos_bytes_allocation]
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
void produce(edm::StreamID, edm::Event &, edm::EventSetup const &) const override
T const * product() const