4 out <<
"L1 BMTF Parameters" << std::endl;
18 std::map<std::string, bool>& allBools,
45 cout <<
"Can not open files to load pt-assignment look-up tables for L1TMuonBarrelTrackProducer!" << endl;
53 if (
load_phi(
phi_lut, allInts[
"PHI_Assignment_nbits_Phi"], allInts[
"PHI_Assignment_nbits_PhiB"], AssLUTpath) != 0) {
54 cout <<
"Can not open files to load phi-assignment look-up tables for L1TMuonBarrelTrackProducer!" << endl;
66 for (
int wh = -3; wh < 4; wh++) {
68 for (
char&
c : allMasks[
"mask_phtf_st1"].at(wh + 3)) {
74 for (
char&
c : allMasks[
"mask_phtf_st2"].at(wh + 3)) {
80 for (
char&
c : allMasks[
"mask_phtf_st3"].at(wh + 3)) {
86 for (
char&
c : allMasks[
"mask_phtf_st4"].at(wh + 3)) {
92 for (
char&
c : allMasks[
"mask_ettf_st1"].at(wh + 3)) {
98 for (
char&
c : allMasks[
"mask_ettf_st2"].at(wh + 3)) {
104 for (
char&
c : allMasks[
"mask_ettf_st3"].at(wh + 3)) {
114 std::vector<L1TMuonBarrelParams::LUTParams::extLUT>
ext_lut(0);
116 if (
load_ext(
ext_lut, allInts[
"PHI_Assignment_nbits_Phi"], allInts[
"PHI_Assignment_nbits_PhiB"]) != 0) {
117 cout <<
"Can not open files to load extrapolation look-up tables for L1TMuonBarrelTrackProducer!" << endl;
130 for (
auto it_proc = procRole.begin(); it_proc != procRole.end(); it_proc++) {
133 std::map<std::string, l1t::Parameter> settings = trgSys.
getParameters(procId.c_str());
135 std::vector<std::string>
paths = settings[
"regTable"].getTableColumn<
std::string>(
"register_path");
136 std::vector<unsigned int> vals = settings[
"regTable"].getTableColumn<
unsigned int>(
"register_value");
137 for (
unsigned int row = 0; row <
paths.size(); row++) {
138 if (
paths[row].
find(
"open_lut") != std::string::npos) {
142 if (
paths[row].
find(
"sel_21") != std::string::npos) {
147 if (
paths[row].
find(
"dis_newalgo") != std::string::npos) {
151 bool disnewalgo = (vals[row] == 1);
155 string masks[5] = {
"mask_ctrl_N2",
"mask_ctrl_N1",
"mask_ctrl_0",
"mask_ctrl_P1",
"mask_ctrl_P2"};
157 for (
int m = 0;
m < 5;
m++) {
158 if (
paths[row].
find(masks[
m]) != std::string::npos) {
160 int mask = 0x1 & vals[row];
161 int mask_all = vals[row];
163 if (!(mask_all == 0x111111 || mask_all == 0x222222 || mask_all == 0x333333 || mask_all == 0x444444 ||
164 mask_all == 0x555555 || mask_all == 0x666666 || mask_all == 0x777777))
165 cerr <<
"BMTF: Cannot re-emulate properly. Individual link masking cannot be handled." << endl;
167 if ((
mask & 1) > 0) {
169 if (masks[
m] ==
"mask_ctrl_N2") {
173 if (masks[
m] ==
"mask_ctrl_N1") {
178 if (masks[
m] ==
"mask_ctrl_0") {
184 if (masks[
m] ==
"mask_ctrl_P1") {
188 if (masks[
m] ==
"mask_ctrl_P2") {
195 if ((
mask & 2) > 0) {
197 if (masks[
m] ==
"mask_ctrl_N2") {
201 if (masks[
m] ==
"mask_ctrl_N1") {
206 if (masks[
m] ==
"mask_ctrl_0") {
212 if (masks[
m] ==
"mask_ctrl_P1") {
216 if (masks[
m] ==
"mask_ctrl_P2") {
223 if ((
mask & 4) > 0) {
225 if (masks[
m] ==
"mask_ctrl_N2") {
229 if (masks[
m] ==
"mask_ctrl_N1") {
234 if (masks[
m] ==
"mask_ctrl_0") {
240 if (masks[
m] ==
"mask_ctrl_P1") {
244 if (masks[
m] ==
"mask_ctrl_P2") {
251 if ((
mask & 8) > 0) {
253 if (masks[
m] ==
"mask_ctrl_N2") {
256 if (masks[
m] ==
"mask_ctrl_N1") {
260 if (masks[
m] ==
"mask_ctrl_0") {
264 if (masks[
m] ==
"mask_ctrl_P1") {
267 if (masks[
m] ==
"mask_ctrl_P2") {
279 std::vector<int>& pta_threshold,
280 unsigned short int nbitphi,
284 const int MAX_PTASSMETHA = 12;
315 int nbit_phi = nbitphi;
316 int sh_phi = 12 - nbit_phi;
370 pta_str =
"ptb12h_Feb2016";
374 pta_str =
"ptb13h_Feb2016";
378 pta_str =
"ptb14h_Feb2016";
382 pta_str =
"ptb21h_Feb2016";
386 pta_str =
"ptb23h_Feb2016";
390 pta_str =
"ptb24h_Feb2016";
394 pta_str =
"ptb34h_Feb2016";
400 const string& lutpath = AssLUTpath;
406 if (
file.open() != 0)
411 int adr_old = -2048 >>
shift;
412 if (pam >= MAX_PTASSMETHA)
413 adr_old = -512 >>
shift;
426 while (
file.good()) {
428 int pt =
file.readInteger();
432 if (adr != adr_old) {
434 tmplut.insert(make_pair(adr_old, (sum_pt /
number)));
454 unsigned short int nbit_phi,
455 unsigned short int nbit_phib,
460 int sh_phi = 12 - nbit_phi;
461 int sh_phib = 10 - nbit_phib;
483 if (
file.open() != 0)
489 int adr_old = -512 >> sh_phib;
493 while (
file.good()) {
494 int adr = (
file.readInteger()) >> sh_phib;
499 if (adr != adr_old) {
501 tmplut.insert(make_pair(adr_old, ((sum_phi /
number) >> sh_phi)));
539 unsigned short int nbit_phi,
540 unsigned short int nbit_phib) {
545 enum Extrapolation {
EX12,
EX13,
EX14,
EX21,
EX23,
EX24,
EX34,
EX15,
EX16,
EX25,
EX26,
EX56 };
548 string defaultPath =
"L1Trigger/L1TMuon/data/bmtf_luts/";
549 string ext_dir =
"LUTs_Ext/";
556 int sh_phi = 12 - nbit_phi;
557 int sh_phib = 10 - nbit_phib;
606 if (
file.open() != 0)
614 int adr_old = -512 >> sh_phib;
619 while (
file.good()) {
620 int adr = (
file.readInteger()) >> sh_phib;
621 int low = (
file.readInteger());
626 if (adr != adr_old) {
627 tmplut.
low[adr_old] = sum_low >> sh_phi;
628 tmplut.
high[adr_old] = sum_high >> sh_phi;
L1MuBMTQualPatternLut l1mudttfqualplut
friend std::ostream& operator<<(std::ostream& o, const L1TMuonBarrelParams & p) { p...
L1MuDTTFParameters l1mudttfparams
void set_Extrapolation_21(bool par1)
void set_PHI_Assignment_nbits_PhiB(int par1)
void set_PT_Assignment_nbits_Phi(int par1)
void set_etsoc_chdis_st1(int wh, int sc, const bool val)
L1MuBMTEtaPatternLut l1mudttfetaplut
int load()
load look-up tables
int load_phi(std::vector< LUT > &, unsigned short int, unsigned short int, std::string)
std::vector< LUT > phi_lut() const
int load()
load pattern look-up table
void set_Extrapolation_nbits_PhiB(int par1)
void set_etsoc_chdis_st2(int wh, int sc, const bool val)
void set_OutOfTime_Filter(bool par1)
void print(std::ostream &) const
void set_Extrapolation_nbits_Phi(int par1)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void set_DisableNewAlgo(bool par1)
const std::map< std::string, std::string > & getProcToRoleAssignment(void) const noexcept
void set_Open_LUTs(bool par1)
void setphi_lut(std::vector< LUT > philut)
int load_ext(std::vector< L1TMuonBarrelParams::LUTParams::extLUT > &, unsigned short int, unsigned short int)
L1MuDTTFMasks l1mudttfmasks
const std::map< std::string, Parameter > & getParameters(const char *processor) const
void set_OutOfTime_Filter_Window(int par1)
void setpta_lut(std::vector< LUT > ptalut)
void set_inrec_chdis_st4(int wh, int sc, const bool val)
void reset()
reset parameters to zero
int load_pt(std::vector< LUT > &, std::vector< int > &, unsigned short int, std::string)
if configDB
void reset()
reset parameters to zero
void set_PHI_Assignment_nbits_Phi(int par1)
void setAssLUTPath(std::string path)
std::vector< int > pta_threshold() const
void set_Extrapolation_Filter(int par1)
void set_inrec_chdis_st2(int wh, int sc, const bool val)
void set_EtaTrackFinder(bool par1)
std::vector< LUT > pta_lut() const
std::map< short, short, std::less< short > > LUT
L1MuBMPtaLut.
unsigned fwVersion() const
void set_inrec_chdis_st3(int wh, int sc, const bool val)
void setFwVersion(unsigned fwVersion)
void set_etsoc_chdis_st3(int wh, int sc, const bool val)
void setext_lut(std::vector< LUTParams::extLUT > extlut)
void configFromPy(std::map< std::string, int > &allInts, std::map< std::string, bool > &allBools, std::map< std::string, std::vector< std::string > > allMasks, unsigned int fwVersion, const std::string &AssLUTpath)
void set_BX_max(int par1)
void set_PT_Assignment_nbits_PhiB(int par1)
static unsigned int const shift
void configFromDB(l1t::TriggerSystem &trgSys)
const std::string & fullPath() const
void set_BX_min(int par1)
L1TMuonBarrelParamsHelper()
std::vector< LUTParams::extLUT > ext_lut() const
void setpta_threshold(std::vector< int > ptathresh)
void set_inrec_chdis_csc(int wh, int sc, const bool val)
void set_inrec_chdis_st1(int wh, int sc, const bool val)