Skip to content

Commit

Permalink
Merge pull request cms-sw#13768 from cms-l1t-offline/pr-l1t-tsg-v4-81x
Browse files Browse the repository at this point in the history
Bring L1T emulation up to date with l1t-tsg-v4 tag
  • Loading branch information
davidlange6 committed Apr 1, 2016
2 parents 518995a + 65b0bdd commit 6d75c5e
Show file tree
Hide file tree
Showing 186 changed files with 10,611 additions and 2,300 deletions.
52 changes: 26 additions & 26 deletions CondFormats/L1TObjects/interface/L1TMuonOverlapParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,35 +109,35 @@ class L1TMuonOverlapParams {
void setFwVersion(unsigned fwVersion) { fwVersion_ = fwVersion; }

///General definitions
std::vector<int>* generalParams() { return &pnodes_[GENERAL].iparams_; }
const std::vector<int>* generalParams() const { return &pnodes_[GENERAL].iparams_; }
void setGeneralParams (const std::vector<int> & paramsVec) { pnodes_[GENERAL].type_ = "INT"; pnodes_[GENERAL].iparams_ = paramsVec;}

///Access to specific general settings.
int nPdfAddrBits() { return pnodes_[GENERAL].iparams_[GENERAL_ADDRBITS];};
int nPdfAddrBits() const { return pnodes_[GENERAL].iparams_[GENERAL_ADDRBITS];};

int nPdfValBits() { return pnodes_[GENERAL].iparams_[GENERAL_VALBITS];};
int nPdfValBits() const { return pnodes_[GENERAL].iparams_[GENERAL_VALBITS];};

int nHitsPerLayer() { return pnodes_[GENERAL].iparams_[GENERAL_HITSPERLAYER];};
int nHitsPerLayer() const { return pnodes_[GENERAL].iparams_[GENERAL_HITSPERLAYER];};

int nPhiBits() { return pnodes_[GENERAL].iparams_[GENERAL_PHIBITS];};
int nPhiBits() const { return pnodes_[GENERAL].iparams_[GENERAL_PHIBITS];};

int nPhiBins() { return pnodes_[GENERAL].iparams_[GENERAL_PHIBINS];};
int nPhiBins() const { return pnodes_[GENERAL].iparams_[GENERAL_PHIBINS];};

int nRefHits() { return pnodes_[GENERAL].iparams_[GENERAL_NREFHITS];};
int nRefHits() const { return pnodes_[GENERAL].iparams_[GENERAL_NREFHITS];};

int nTestRefHits() { return pnodes_[GENERAL].iparams_[GENERAL_NTESTREFHITS];};
int nTestRefHits() const { return pnodes_[GENERAL].iparams_[GENERAL_NTESTREFHITS];};

int nProcessors() { return pnodes_[GENERAL].iparams_[GENERAL_NPROCESSORS];};
int nProcessors() const { return pnodes_[GENERAL].iparams_[GENERAL_NPROCESSORS];};

int nLogicRegions() { return pnodes_[GENERAL].iparams_[GENERAL_NLOGIC_REGIONS];};
int nLogicRegions() const { return pnodes_[GENERAL].iparams_[GENERAL_NLOGIC_REGIONS];};

int nInputs() { return pnodes_[GENERAL].iparams_[GENERAL_NINPUTS];};
int nInputs() const { return pnodes_[GENERAL].iparams_[GENERAL_NINPUTS];};

int nLayers() { return pnodes_[GENERAL].iparams_[GENERAL_NLAYERS];};
int nLayers() const { return pnodes_[GENERAL].iparams_[GENERAL_NLAYERS];};

int nRefLayers() { return pnodes_[GENERAL].iparams_[GENERAL_NREFLAYERS];};
int nRefLayers() const { return pnodes_[GENERAL].iparams_[GENERAL_NREFLAYERS];};

int nGoldenPatterns() { return pnodes_[GENERAL].iparams_[GENERAL_NGOLDENPATTERNS];};
int nGoldenPatterns() const { return pnodes_[GENERAL].iparams_[GENERAL_NGOLDENPATTERNS];};

///Connections definitions
void setLayerMap(const std::vector<LayerMapNode> &aVector) { layerMap_ = aVector;}
Expand All @@ -154,27 +154,27 @@ class L1TMuonOverlapParams {

void setConnectedSectorsEnd(const std::vector<int> &aVector){pnodes_[SECTORS_END].type_ = "INT"; pnodes_[SECTORS_END].iparams_ = aVector;};

std::vector<LayerMapNode> * layerMap() { return &layerMap_;};
const std::vector<LayerMapNode> * layerMap() const { return &layerMap_;};

std::vector<RefLayerMapNode> * refLayerMap() { return &refLayerMap_;};
const std::vector<RefLayerMapNode> * refLayerMap() const { return &refLayerMap_;};

std::vector<RefHitNode> * refHitMap() {return &refHitMap_;};
const std::vector<RefHitNode> * refHitMap() const {return &refHitMap_;};

std::vector<int> * globalPhiStartMap() { return &globalPhiStart_;};
const std::vector<int> * globalPhiStartMap() const { return &globalPhiStart_;};

std::vector<LayerInputNode> * layerInputMap() { return &layerInputMap_;};
const std::vector<LayerInputNode> * layerInputMap() const { return &layerInputMap_;};

std::vector<int> * connectedSectorsStart() { return &pnodes_[SECTORS_START].iparams_;};
const std::vector<int> * connectedSectorsStart() const { return &pnodes_[SECTORS_START].iparams_;};

std::vector<int> * connectedSectorsEnd() { return &pnodes_[SECTORS_END].iparams_;};
const std::vector<int> * connectedSectorsEnd() const { return &pnodes_[SECTORS_END].iparams_;};


///Golden Patterns definitions
l1t::LUT* chargeLUT() { return &pnodes_[CHARGE].LUT_; }
l1t::LUT* etaLUT() { return &pnodes_[ETA].LUT_; }
l1t::LUT* ptLUT() { return &pnodes_[PT].LUT_; }
l1t::LUT* pdfLUT() { return &pnodes_[PDF].LUT_; }
l1t::LUT* meanDistPhiLUT() { return &pnodes_[MEANDISTPHI].LUT_; }
const l1t::LUT* chargeLUT() const { return &pnodes_[CHARGE].LUT_; }
const l1t::LUT* etaLUT() const { return &pnodes_[ETA].LUT_; }
const l1t::LUT* ptLUT() const { return &pnodes_[PT].LUT_; }
const l1t::LUT* pdfLUT() const { return &pnodes_[PDF].LUT_; }
const l1t::LUT* meanDistPhiLUT() const { return &pnodes_[MEANDISTPHI].LUT_; }

void setChargeLUT (const l1t::LUT & lut) { pnodes_[CHARGE].type_ = "LUT"; pnodes_[CHARGE].LUT_ = lut; }
void setEtaLUT (const l1t::LUT & lut) { pnodes_[ETA].type_ = "LUT"; pnodes_[ETA].LUT_ = lut; }
Expand Down
14 changes: 10 additions & 4 deletions DataFormats/L1TMuon/interface/EMTF/AMC13Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ namespace l1t {

// Empty constructor
AMC13Header() :
orn(-99), lv1_id(-99), bx_id(-99), source_id(-99), evt_ty(-99), fov(-99), ufov(-99), res(-99), namc(-99), h(-99), x(-99), dataword(-99)
orn(-99), lv1_id(-99), bx_id(-99), source_id(-99), evt_ty(-99), fov(-99), ufov(-99),
res(-99), namc(-99), h(-99), x(-99), format_errors(0), dataword(-99)
{};

// Fill constructor
AMC13Header(int int_orn, int int_lv1_id, int int_bx_id, int int_source_id, int int_evt_ty, int int_fov, int int_ufov, int int_res, int int_namc, int int_h, int int_x) :
orn(int_orn), lv1_id(int_lv1_id), bx_id(int_bx_id), source_id(int_source_id), evt_ty(int_evt_ty), fov(int_fov), ufov(int_ufov), res(int_res), namc(int_namc), h(int_h), x(int_x), dataword(-99)
AMC13Header(int int_orn, int int_lv1_id, int int_bx_id, int int_source_id, int int_evt_ty, int int_fov, int int_ufov,
int int_res, int int_namc, int int_h, int int_x) :
orn(int_orn), lv1_id(int_lv1_id), bx_id(int_bx_id), source_id(int_source_id), evt_ty(int_evt_ty), fov(int_fov), ufov(int_ufov),
res(int_res), namc(int_namc), h(int_h), x(int_x), format_errors(0), dataword(-99)
{};

virtual ~AMC13Header() {};
Expand All @@ -36,6 +39,7 @@ namespace l1t {
void set_namc(int bits) { namc = bits; };
void set_h(int bits) { h = bits; };
void set_x(int bits) { x = bits; };
void add_format_error() { format_errors += 1; };
void set_dataword(uint64_t bits) { dataword = bits; };

const int ORN() const { return orn ; };
Expand All @@ -49,7 +53,8 @@ namespace l1t {
const int Namc() const { return namc ; };
const int H() const { return h ; };
const int X() const { return x ; };
const uint64_t Dataword() const { return dataword; };
const int Format_Errors() const { return format_errors; };
const uint64_t Dataword() const { return dataword; };

private:
int orn;
Expand All @@ -63,6 +68,7 @@ namespace l1t {
int namc;
int h;
int x;
int format_errors;
uint64_t dataword;

}; // End class AMC13Header
Expand Down
7 changes: 5 additions & 2 deletions DataFormats/L1TMuon/interface/EMTF/AMC13Trailer.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ namespace l1t {

// Empty constructor
AMC13Trailer() :
evt_lgth(-99), crc16(-99), evt_stat(-99), tts(-99), c(-99), f(-99), t(-99), r(-99), dataword(-99)
evt_lgth(-99), crc16(-99), evt_stat(-99), tts(-99), c(-99), f(-99), t(-99), r(-99), format_errors(0), dataword(-99)
{};

// Fill constructor
AMC13Trailer(int int_evt_lgth, int int_crc16, int int_evt_stat, int int_tts, int int_c, int int_f, int int_t, int int_r) :
evt_lgth(int_evt_lgth), crc16(int_crc16), evt_stat(int_evt_stat), tts(int_tts), c(int_c), f(int_f), t(int_t), r(int_r), dataword(-99)
evt_lgth(int_evt_lgth), crc16(int_crc16), evt_stat(int_evt_stat), tts(int_tts), c(int_c), f(int_f), t(int_t), r(int_r), format_errors(0), dataword(-99)
{};

virtual ~AMC13Trailer() {};
Expand All @@ -33,6 +33,7 @@ namespace l1t {
void set_f(int bits) { f = bits; };
void set_t(int bits) { t = bits; };
void set_r(int bits) { r = bits; };
void add_format_error() { format_errors += 1; };
void set_dataword(uint64_t bits) { dataword = bits; };

const int Evt_lgth() const { return evt_lgth ; };
Expand All @@ -43,6 +44,7 @@ namespace l1t {
const int F() const { return f ; };
const int T() const { return t ; };
const int R() const { return r ; };
const int Format_Errors() const { return format_errors; };
const uint64_t Dataword() const { return dataword; };

private:
Expand All @@ -54,6 +56,7 @@ namespace l1t {
int f;
int t;
int r;
int format_errors;
uint64_t dataword;

}; // End class AMC13Trailer
Expand Down
7 changes: 5 additions & 2 deletions DataFormats/L1TMuon/interface/EMTF/Counters.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,32 @@ namespace l1t {

// rpc_counter not yet implemented in FW - AWB 31.01.16
Counters() :
track_counter(-99), orbit_counter(-99), rpc_counter(-99), dataword(-99)
track_counter(-99), orbit_counter(-99), rpc_counter(-99), format_errors(0), dataword(-99)
{};

Counters(int int_track_counter, int int_orbit_counter, int int_rpc_counter) :
track_counter(int_track_counter), orbit_counter(int_orbit_counter), rpc_counter(int_rpc_counter), dataword(-99)
track_counter(int_track_counter), orbit_counter(int_orbit_counter), rpc_counter(int_rpc_counter), format_errors(0), dataword(-99)
{};

virtual ~Counters() {};

void set_track_counter(int bits) { track_counter = bits; };
void set_orbit_counter(int bits) { orbit_counter = bits; };
void set_rpc_counter(int bits) { rpc_counter = bits; };
void add_format_error() { format_errors += 1; };
void set_dataword(uint64_t bits) { dataword = bits; };

const int Track_counter() const { return track_counter; };
const int Orbit_counter() const { return orbit_counter; };
const int RPC_counter() const { return rpc_counter; };
const int Format_Errors() const { return format_errors; };
const uint64_t Dataword() const { return dataword; };

private:
int track_counter;
int orbit_counter;
int rpc_counter;
int format_errors;
uint64_t dataword;

}; // End of class Counters
Expand Down
21 changes: 18 additions & 3 deletions DataFormats/L1TMuon/interface/EMTF/EventHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,26 @@ namespace l1t {
explicit EventHeader(uint64_t dataword);

EventHeader() :
l1a(-99), l1a_bxn(-99), sp_ts(-99), sp_ersv(-99), sp_addr(-99), tbin(-99), ddm(-99), spa(-99), rpca(-99), skip(-99), rdy(-99), bsy(-99), osy(-99), wof(-99), me1a(-99), me1b(-99), me2(-99), me3(-99), me4(-99), dataword(-99)
l1a(-99), l1a_bxn(-99), sp_ts(-99), endcap(-99), sector(-99), sp_ersv(-99), sp_addr(-99),
tbin(-99), ddm(-99), spa(-99), rpca(-99), skip(-99), rdy(-99), bsy(-99), osy(-99),
wof(-99), me1a(-99), me1b(-99), me2(-99), me3(-99), me4(-99), format_errors(0), dataword(-99)
{};

EventHeader(int int_l1a, int int_l1a_bxn, int int_sp_ts, int int_sp_ersv, int int_sp_addr, int int_tbin, int int_ddm, int int_spa, int int_rpca, int int_skip, int int_rdy, int int_bsy, int int_osy, int int_wof, int int_me1a, int int_me1b, int int_me2, int int_me3, int int_me4) :
l1a(int_l1a), l1a_bxn(int_l1a_bxn), sp_ts(int_sp_ts), sp_ersv(int_sp_ersv), sp_addr(int_sp_addr), tbin(int_tbin), ddm(int_ddm), spa(int_spa), rpca(int_rpca), skip(int_skip), rdy(int_rdy), bsy(int_bsy), osy(int_osy), wof(int_wof), me1a(int_me1a), me1b(int_me1b), me2(int_me2), me3(int_me3), me4(int_me4), dataword(-99)
EventHeader(int int_l1a, int int_l1a_bxn, int int_sp_ts, int int_endcap, int int_sector, int int_sp_ersv, int int_sp_addr,
int int_tbin, int int_ddm, int int_spa, int int_rpca, int int_skip, int int_rdy, int int_bsy, int int_osy,
int int_wof, int int_me1a, int int_me1b, int int_me2, int int_me3, int int_me4) :
l1a(int_l1a), l1a_bxn(int_l1a_bxn), sp_ts(int_sp_ts), endcap(int_endcap), sector(int_sector), sp_ersv(int_sp_ersv), sp_addr(int_sp_addr),
tbin(int_tbin), ddm(int_ddm), spa(int_spa), rpca(int_rpca), skip(int_skip), rdy(int_rdy), bsy(int_bsy), osy(int_osy),
wof(int_wof), me1a(int_me1a), me1b(int_me1b), me2(int_me2), me3(int_me3), me4(int_me4), format_errors(0), dataword(-99)
{};

virtual ~EventHeader() {};

void set_l1a(int bits) { l1a = bits; };
void set_l1a_bxn(int bits) { l1a_bxn = bits; };
void set_sp_ts(int bits) { sp_ts = bits; };
void set_endcap(int bits) { endcap = bits; };
void set_sector(int bits) { sector = bits; };
void set_sp_ersv(int bits) { sp_ersv = bits; };
void set_sp_addr(int bits) { sp_addr = bits; };
void set_tbin(int bits) { tbin = bits; };
Expand All @@ -41,11 +49,14 @@ namespace l1t {
void set_me2(int bits) { me2 = bits; };
void set_me3(int bits) { me3 = bits; };
void set_me4(int bits) { me4 = bits; };
void add_format_error() { format_errors += 1; };
void set_dataword(uint64_t bits) { dataword = bits; };

const int L1A() const { return l1a ; };
const int L1A_BXN() const { return l1a_bxn ; };
const int SP_ts() const { return sp_ts ; };
const int Endcap() const { return endcap ; };
const int Sector() const { return sector ; };
const int SP_ersv() const { return sp_ersv ; };
const int SP_addr() const { return sp_addr ; };
const int Tbin() const { return tbin ; };
Expand All @@ -62,12 +73,15 @@ namespace l1t {
const int ME2() const { return me2 ; };
const int ME3() const { return me3 ; };
const int ME4() const { return me4 ; };
const int Format_Errors() const { return format_errors; };
const uint64_t Dataword() const { return dataword; };

private:
int l1a;
int l1a_bxn;
int sp_ts;
int endcap;
int sector;
int sp_ersv;
int sp_addr;
int tbin;
Expand All @@ -84,6 +98,7 @@ namespace l1t {
int me2;
int me3;
int me4;
int format_errors;
uint64_t dataword;

}; // End of class EventHeader
Expand Down
18 changes: 15 additions & 3 deletions DataFormats/L1TMuon/interface/EMTF/EventTrailer.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,21 @@ namespace l1t {
explicit EventTrailer(uint64_t dataword);

EventTrailer() :
crc22(-99), ddcsr_bid(-99), ddcsr_lf(-99), spcsr_scc(-99), l1a(-99), yy(-99), mm(-99), dd(-99), sp_ladr(-99), sp_ersv(-99), sp_padr(-99), lfff(-99), bb(-99), dataword(-99)
crc22(-99), lp(-99), hp(-99), ddcsr_bid(-99), ddcsr_lf(-99), spcsr_scc(-99), l1a(-99), yy(-99),
mm(-99), dd(-99), sp_ladr(-99), sp_ersv(-99), sp_padr(-99), lfff(-99), bb(-99), format_errors(0), dataword(-99)
{};

EventTrailer(int int_crc22, int int_ddcsr_bid, int int_ddcsr_lf, int int_spcsr_scc, int int_l1a, int int_yy, int int_mm, int int_dd, int int_sp_ladr, int int_sp_ersv, int int_sp_padr, int int_lfff, int int_bb) :
crc22(int_crc22), ddcsr_bid(int_ddcsr_bid), ddcsr_lf(int_ddcsr_lf), spcsr_scc(int_spcsr_scc), l1a(int_l1a), yy(int_yy), mm(int_mm), dd(int_dd), sp_ladr(int_sp_ladr), sp_ersv(int_sp_ersv), sp_padr(int_sp_padr), lfff(int_lfff), bb(int_bb), dataword(-99)
EventTrailer(int int_crc22, int int_lp, int int_hp, int int_ddcsr_bid, int int_ddcsr_lf, int int_spcsr_scc, int int_l1a, int int_yy,
int int_mm, int int_dd, int int_sp_ladr, int int_sp_ersv, int int_sp_padr, int int_lfff, int int_bb) :
crc22(int_crc22), lp(int_lp), hp(int_hp), ddcsr_bid(int_ddcsr_bid), ddcsr_lf(int_ddcsr_lf), spcsr_scc(int_spcsr_scc), l1a(int_l1a), yy(int_yy),
mm(int_mm), dd(int_dd), sp_ladr(int_sp_ladr), sp_ersv(int_sp_ersv), sp_padr(int_sp_padr), lfff(int_lfff), bb(int_bb), format_errors(0), dataword(-99)
{};

virtual ~EventTrailer() {};

void set_crc22(int bits) { crc22 = bits; };
void set_lp(int bits) { lp = bits; };
void set_hp(int bits) { hp = bits; };
void set_ddcsr_bid(int bits) { ddcsr_bid = bits; };
void set_ddcsr_lf(int bits) { ddcsr_lf = bits; };
void set_spcsr_scc(int bits) { spcsr_scc = bits; };
Expand All @@ -35,9 +40,12 @@ namespace l1t {
void set_sp_padr(int bits) { sp_padr = bits; };
void set_lfff(int bits) { lfff = bits; };
void set_bb(int bits) { bb = bits; };
void add_format_error() { format_errors += 1; };
void set_dataword(uint64_t bits) { dataword = bits; };

const int CRC22() const { return crc22 ; };
const int LP() const { return lp ; };
const int HP() const { return hp ; };
const int DDCRC_bid() const { return ddcsr_bid ; };
const int DDCRC_lf() const { return ddcsr_lf ; };
const int SPCSR_scc() const { return spcsr_scc ; };
Expand All @@ -50,10 +58,13 @@ namespace l1t {
const int SP_padr() const { return sp_padr ; };
const int LFFF() const { return lfff ; };
const int BB() const { return bb ; };
const int Format_Errors() const { return format_errors; };
const uint64_t Dataword() const { return dataword; };

private:
int crc22;
int lp;
int hp;
int ddcsr_bid;
int ddcsr_lf;
int spcsr_scc;
Expand All @@ -66,6 +77,7 @@ namespace l1t {
int sp_padr;
int lfff;
int bb;
int format_errors;
uint64_t dataword;

}; // End of class EventTrailer
Expand Down
Loading

0 comments on commit 6d75c5e

Please sign in to comment.