110 map<int,unique_ptr<HCalFED> > fedMap;
119 for (
unsigned int j=0; j < qie10dc.
size(); j++){
123 int crateId =
eid.crateId();
124 int slotId =
eid.slot();
125 int uhtrIndex = ((slotId&0xF)<<8) | (crateId&0xFF);
133 if( ! uhtrs.
exist( uhtrIndex ) ){
134 uhtrs.
newUHTR( uhtrIndex , presamples );
146 for (
unsigned int j=0; j < qie11dc.
size(); j++){
150 int crateId =
eid.crateId();
151 int slotId =
eid.slot();
152 int uhtrIndex = ((slotId&0xF)<<8) | (crateId&0xFF);
155 if( ! uhtrs.
exist(uhtrIndex) ){
156 uhtrs.
newUHTR( uhtrIndex , presamples );
171 int crateId =
eid.crateId();
172 int slotId =
eid.slot();
173 int uhtrIndex = (crateId&0xFF) | ((slotId&0xF)<<8) ;
176 if( ! uhtrs.
exist(uhtrIndex) ){
177 uhtrs.
newUHTR( uhtrIndex , presamples );
192 int crateId =
eid.crateId();
193 int slotId =
eid.slot();
194 int uhtrIndex = (crateId&0xFF) | ((slotId&0xF)<<8) ;
197 if( ! uhtrs.
exist(uhtrIndex) ){
198 uhtrs.
newUHTR( uhtrIndex , presamples );
213 int crateId =
eid.crateId();
214 int slotId =
eid.slot();
215 int uhtrIndex = (crateId&0xFF) | ((slotId&0xF)<<8);
216 int ilink =
eid.fiberIndex();
217 int itower =
eid.fiberChanId();
218 int channelid = (itower&0xF) | ((ilink&0xF)<<4);
221 if( ! uhtrs.
exist(uhtrIndex) ){
222 uhtrs.
newUHTR( uhtrIndex , presamples );
234 for( UHTRpacker::UHTRMap::iterator uhtr = uhtrs.
uhtrs.begin() ; uhtr != uhtrs.
uhtrs.end() ; ++uhtr){
238 uint64_t crateId = (uhtr->first)&0xFF;
239 uint64_t slotId = (uhtr->first&0xF00)>>8;
243 if( fedMap.find(fedId) == fedMap.end() ){
247 fedMap[
fedId]->addUHTR(uhtr->second,crateId,slotId);
255 for(
map<
int,unique_ptr<HCalFED> >::iterator fed = fedMap.begin() ; fed != fedMap.end() ; ++fed ){
257 int fedId = fed->first;
259 auto & rawData = fed_buffers->FEDData(fedId);
260 fed->second->formatFEDdata(rawData);
264 FEDTrailer hcalFEDTrailer(rawData.data()+(rawData.size()-8));
265 hcalFEDTrailer.set(rawData.data()+(rawData.size()-8), rawData.size()/8,
evf::compute_crc(rawData.data(),rawData.size()), 0, 0);
DetId detid() const
Get the detector id.
EventNumber_t event() const
edm::EDGetTokenT< HBHEDigiCollection > tok_HBHEDigiCollection_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void finalizeHeadTail(uhtrData *uhtr, bool verbosity)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
int presamples() const
for backward compatibility
uhtrData * newUHTR(int uhtrIndex, int ps=0, int orn=0, int bcn=0, uint64_t evt=0)
std::vector< HFDataFrame >::const_iterator const_iterator
int bunchCrossing() const
edm::Handle< HcalTrigPrimDigiCollection > tpDigiCollection
edm::EDGetTokenT< HcalDataFrameContainer< QIE10DataFrame > > tok_QIE10DigiCollection_
std::string electronicsMapLabel_
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
edm::EDGetTokenT< HFDigiCollection > tok_HFDigiCollection_
edm::DataFrame::id_type id() const
DetId detid() const
Get the detector id.
edm::Handle< HFDigiCollection > hfDigiCollection
edm::Handle< QIE10DigiCollection > qie10DigiCollection
const_iterator end() const
unsigned long long uint64_t
void addChannel(int uhtrIndex, edm::SortedCollection< HFDataFrame >::const_iterator &qiedf, const HcalElectronicsMap *readoutMap, bool premix, int verbosity=0)
int presamples() const
for backward compatibility
bool exist(int uhtrIndex)
edm::Handle< QIE11DigiCollection > qie11DigiCollection
edm::Handle< HBHEDigiCollection > hbheDigiCollection
const DetId lookupTrigger(HcalElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
T const * product() const
Readout chain identification for Hcal.
edm::EDGetTokenT< HcalTrigPrimDigiCollection > tok_TPDigiCollection_
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
const_iterator begin() const
edm::EDGetTokenT< HcalDataFrameContainer< QIE11DataFrame > > tok_QIE11DigiCollection_