Skip to content

Commit

Permalink
remove unfinished packer attempt in HcalUHTRData
Browse files Browse the repository at this point in the history
  • Loading branch information
kpedro88 committed May 30, 2017
1 parent 4209446 commit eaaa3e3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 63 deletions.
23 changes: 0 additions & 23 deletions EventFilter/HcalRawToDigi/interface/HcalUHTRData.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,29 +77,6 @@ class HcalUHTRData {
const_iterator begin() const;
const_iterator end() const;

class packer {
public:
packer(uint16_t* baseptr);
void addHeader(int flavor, int errf, int cap0, int channelid);
void addSample(int adc, bool soi=false, int retdc=0, int fetdc=0, int tdcstat=0);
void addTP(int tpword, bool soi=false);
private:
uint16_t* m_baseptr;
int m_ptr;
int m_flavor;
int m_ministep;
};

packer pack();


/** \brief pack header and trailer (call _after_ pack)*/
void packHeaderTrailer(int L1Anumber, int bcn, int submodule, int
orbitn, int pipeline, int ndd, int nps, int firmwareRev=0);

/** \brief pack trailer with Mark and Pass bits */
void packUnsuppressed(const bool* mp);

/** \brief Get the HTR event number */
inline uint32_t l1ANumber() const { return uint32_t(m_raw64[0]>>32)&0xFFFFFF; }
/** \brief Get the HTR bunch number */
Expand Down
40 changes: 0 additions & 40 deletions EventFilter/HcalRawToDigi/src/HcalUHTRData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,46 +82,6 @@ HcalUHTRData::const_iterator HcalUHTRData::end() const {
return HcalUHTRData::const_iterator(m_raw16+(m_rawLength64-1)*sizeof(uint64_t)/sizeof(uint16_t),m_raw16+(m_rawLength64-1)*sizeof(uint64_t)/sizeof(uint16_t));
}

HcalUHTRData::packer::packer(uint16_t* baseptr) : m_baseptr(baseptr),m_ptr(0),m_flavor(0),m_ministep(0) {
}

void HcalUHTRData::packer::addHeader(int flavor, int errf, int cap0, int channelid) {
m_baseptr[m_ptr]=0x8000 |
((flavor&0x7)<<12) |
((errf&0x3)<<10) |
((cap0&0x3)<<8) |
(channelid&0xFF);
m_flavor=flavor;
m_ministep=0;
m_ptr++;
}

void HcalUHTRData::packer::addSample(int adc, bool soi, int retdc, int fetdc, int tdcstat) {
if (m_flavor==0x5) {
if (m_ministep==0) m_baseptr[m_ptr]=adc&0x7F;
else m_baseptr[m_ptr]|=((adc&0x7f)<<8);
if (m_ministep==1) m_ptr++;
m_ministep=(m_ministep+1)%2;
} else if ((m_flavor&0x6)==0x0) {
m_baseptr[m_ptr]=(adc&0xFF) | ((retdc&0x3F)<<8);
if (soi) m_baseptr[m_ptr]|=0x4000;
m_ptr++;
} else if ((m_flavor&0x6)==0x1) {
m_baseptr[m_ptr]=(adc&0xFF);
m_baseptr[m_ptr+1]=0x4000| ((tdcstat&0x3)<<10) | ((fetdc&0xF)<<6) | ((retdc)<<8);
if (soi) m_baseptr[m_ptr]|=0x2000;
m_ptr+=2;
}
}

void HcalUHTRData::packer::addTP(int tpword, bool soi) {
if (m_flavor==0x4) {
m_baseptr[m_ptr]=tpword&0xFFF;
if (soi) m_baseptr[m_ptr]|=0x4000;
m_ptr++;
}
}

HcalUHTRData::HcalUHTRData() : m_formatVersion(-2), m_rawLength64(0), m_raw64(0), m_raw16(0), m_ownData(0) { }

HcalUHTRData::HcalUHTRData(const uint64_t* data, int length) : m_rawLength64(length),m_raw64(data),m_raw16((const uint16_t*)(data)),m_ownData(0) {
Expand Down

0 comments on commit eaaa3e3

Please sign in to comment.