5 out <<
"L1 BMTF Parameters" << std::endl;
7 out <<
"Firmware version: " <<
fwVersion_ << std::endl;
38 std::vector<LUT>
pta_lut(0); pta_lut.reserve(19);
40 if (
load_pt(pta_lut,pta_threshold, allInts[
"PT_Assignment_nbits_Phi"], AssLUTpath) != 0 ) {
41 cout <<
"Can not open files to load pt-assignment look-up tables for L1TMuonBarrelTrackProducer!" << endl;
47 std::vector<LUT>
phi_lut(0); phi_lut.reserve(2);
48 if (
load_phi(phi_lut, allInts[
"PHI_Assignment_nbits_Phi"], allInts[
"PHI_Assignment_nbits_PhiB"], AssLUTpath) != 0 ) {
49 cout <<
"Can not open files to load phi-assignment look-up tables for L1TMuonBarrelTrackProducer!" << endl;
64 for(
int wh=-3; wh<4; wh++ ) {
66 for(
char&
c : allMasks[
"mask_phtf_st1"].at(wh+3) ) {
72 for(
char&
c : allMasks[
"mask_phtf_st2"].at(wh+3) ) {
78 for(
char&
c : allMasks[
"mask_phtf_st3"].at(wh+3) ) {
84 for(
char&
c : allMasks[
"mask_phtf_st4"].at(wh+3) ) {
90 for(
char&
c : allMasks[
"mask_ettf_st1"].at(wh+3) ) {
96 for(
char&
c : allMasks[
"mask_ettf_st2"].at(wh+3) ) {
102 for(
char&
c : allMasks[
"mask_ettf_st3"].at(wh+3) ) {
114 std::vector<L1TMuonBarrelParams::LUTParams::extLUT>
ext_lut(0); ext_lut.reserve(12);
115 if (
load_ext(ext_lut, allInts[
"PHI_Assignment_nbits_Phi"], allInts[
"PHI_Assignment_nbits_PhiB"]) != 0 ) {
116 cout <<
"Can not open files to load extrapolation look-up tables for L1TMuonBarrelTrackProducer!" << endl;
127 for(
auto it_proc=procRole.begin(); it_proc!=procRole.end(); it_proc++ )
132 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++)
139 if (paths[row].
find(
"open_lut") != std::string::npos){
143 if (paths[row].
find(
"sel_21") != std::string::npos){
148 if (paths[row].
find(
"dis_newalgo") != std::string::npos){
152 bool disnewalgo = (vals[row]==1);
156 string masks[5] = {
"mask_ctrl_N2",
"mask_ctrl_N1",
"mask_ctrl_0",
"mask_ctrl_P1",
"mask_ctrl_P2"};
158 for(
int m=0;
m<5;
m++)
161 if (paths[row].
find(masks[
m]) != std::string::npos){
163 int mask = 0x1&vals[row];
164 int mask_all = vals[row];
166 if(!( mask_all==0x111111 || mask_all==0x222222 || mask_all==0x333333 || mask_all==0x444444 ||
167 mask_all==0x555555 || mask_all==0x666666 || mask_all==0x777777) )
168 cerr<<
"BMTF: Cannot re-emulate properly. Individual link masking cannot be handled."<<endl;
171 for(
int sec=0; sec<12; sec++){
172 if(masks[m]==
"mask_ctrl_N2"){
176 if(masks[m]==
"mask_ctrl_N1"){
181 if(masks[m]==
"mask_ctrl_0"){
187 if(masks[m]==
"mask_ctrl_P1"){
191 if(masks[m]==
"mask_ctrl_P2"){
200 for(
int sec=0; sec<12; sec++){
201 if(masks[m]==
"mask_ctrl_N2"){
205 if(masks[m]==
"mask_ctrl_N1"){
210 if(masks[m]==
"mask_ctrl_0"){
216 if(masks[m]==
"mask_ctrl_P1"){
220 if(masks[m]==
"mask_ctrl_P2"){
228 for(
int sec=0; sec<12; sec++){
229 if(masks[m]==
"mask_ctrl_N2"){
233 if(masks[m]==
"mask_ctrl_N1"){
238 if(masks[m]==
"mask_ctrl_0"){
244 if(masks[m]==
"mask_ctrl_P1"){
248 if(masks[m]==
"mask_ctrl_P2"){
256 for(
int sec=0; sec<12; sec++){
257 if(masks[m]==
"mask_ctrl_N2"){
260 if(masks[m]==
"mask_ctrl_N1"){
264 if(masks[m]==
"mask_ctrl_0"){
268 if(masks[m]==
"mask_ctrl_P1"){
271 if(masks[m]==
"mask_ctrl_P2"){
284 unsigned short int nbitphi,
291 const int MAX_PTASSMETHA = 12;
296 PB12H, PB13H, PB14H, PB21H, PB23H, PB24H, PB34H,
304 int nbit_phi = nbitphi;
305 int sh_phi = 12 - nbit_phi;
310 case PT12L : { pta_str =
"pta12l";
break; }
311 case PT12H : { pta_str =
"pta12h";
break; }
312 case PT13L : { pta_str =
"pta13l";
break; }
313 case PT13H : { pta_str =
"pta13h";
break; }
314 case PT14L : { pta_str =
"pta14l";
break; }
315 case PT14H : { pta_str =
"pta14h";
break; }
316 case PT23L : { pta_str =
"pta23l";
break; }
317 case PT23H : { pta_str =
"pta23h";
break; }
318 case PT24L : { pta_str =
"pta24l";
break; }
319 case PT24H : { pta_str =
"pta24h";
break; }
320 case PT34L : { pta_str =
"pta34l";
break; }
321 case PT34H : { pta_str =
"pta34h";
break; }
322 case PB12H : { pta_str =
"ptb12h_Feb2016";
break; }
323 case PB13H : { pta_str =
"ptb13h_Feb2016";
break; }
324 case PB14H : { pta_str =
"ptb14h_Feb2016";
break; }
325 case PB21H : { pta_str =
"ptb21h_Feb2016";
break; }
326 case PB23H : { pta_str =
"ptb23h_Feb2016";
break; }
327 case PB24H : { pta_str =
"ptb24h_Feb2016";
break; }
328 case PB34H : { pta_str =
"ptb34h_Feb2016";
break; }
333 string lutpath = AssLUTpath;
339 if ( file.
open() != 0 )
return -1;
343 int adr_old = -2048 >>
shift;
344 if (pam >= MAX_PTASSMETHA) adr_old = -512 >>
shift;
357 while ( file.
good() ) {
364 if ( adr != adr_old ) {
366 tmplut.insert(make_pair( adr_old, (sum_pt/number) ));
380 pta_lut.push_back(tmplut);
390 unsigned short int nbit_phi,
391 unsigned short int nbit_phib,
399 int sh_phi = 12 - nbit_phi;
400 int sh_phib = 10 - nbit_phib;
406 case 0 : { phi_str =
"phi12";
break; }
407 case 1 : { phi_str =
"phi42";
break; }
416 if ( file.
open() != 0 )
return -1;
421 int adr_old = -512 >> sh_phib;
425 while ( file.
good() ) {
432 if ( adr != adr_old ) {
434 tmplut.insert(make_pair( adr_old, ((sum_phi/number) >> sh_phi) ));
448 phi_lut.push_back(tmplut);
476 unsigned short int nbit_phi,
477 unsigned short int nbit_phib) {
487 string defaultPath =
"L1Trigger/L1TMuon/data/bmtf_luts/";
488 string ext_dir =
"LUTs_Ext/";
495 int sh_phi = 12 - nbit_phi;
496 int sh_phib = 10 - nbit_phib;
501 case EX12 : ext_str =
"ext12";
break;
502 case EX13 : ext_str =
"ext13";
break;
503 case EX14 : ext_str =
"ext14";
break;
504 case EX21 : ext_str =
"ext21";
break;
505 case EX23 : ext_str =
"ext23";
break;
506 case EX24 : ext_str =
"ext24";
break;
507 case EX34 : ext_str =
"ext34";
break;
508 case EX15 : ext_str =
"ext15";
break;
509 case EX16 : ext_str =
"ext16";
break;
510 case EX25 : ext_str =
"ext25";
break;
511 case EX26 : ext_str =
"ext26";
break;
512 case EX56 : ext_str =
"ext56";
break;
521 if ( file.
open() != 0 )
return -1;
528 int adr_old = -512 >> sh_phib;
533 while ( file.
good() ) {
541 if ( adr != adr_old ) {
543 tmplut.
low[adr_old] = sum_low >> sh_phi;
544 tmplut.
high[adr_old] = sum_high >> sh_phi;
553 if (number == 0) sum_low = low;
554 if (number == 0) sum_high = high;
560 ext_lut.push_back(tmplut);
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)
int load()
load pattern look-up table
std::vector< LUT > phi_lut() const
void set_Extrapolation_nbits_PhiB(int par1)
void set_etsoc_chdis_st2(int wh, int sc, const bool val)
bool good()
return status of file stream
void set_OutOfTime_Filter(bool par1)
void set_Extrapolation_nbits_Phi(int par1)
std::vector< LUT > pta_lut() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< int > pta_threshold() const
void set_DisableNewAlgo(bool par1)
void set_Open_LUTs(bool par1)
std::vector< LUTParams::extLUT > ext_lut() const
unsigned fwVersion() const
const std::map< std::string, std::string > & getProcToRoleAssignment(void) const noexcept
void setphi_lut(std::vector< LUT > philut)
int load_ext(std::vector< L1TMuonBarrelParams::LUTParams::extLUT > &, unsigned short int, unsigned short int)
L1MuDTTFMasks l1mudttfmasks
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)
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)
void set_Extrapolation_Filter(int par1)
void set_inrec_chdis_st2(int wh, int sc, const bool val)
void set_EtaTrackFinder(bool par1)
std::map< short, short, std::less< short > > LUT
L1MuBMPtaLut.
void set_inrec_chdis_st3(int wh, int sc, const bool val)
const std::map< std::string, Parameter > & getParameters(const char *processor) const
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)
int readInteger()
read one integer from file
void set_BX_max(int par1)
constexpr uint32_t masks[]
void set_PT_Assignment_nbits_PhiB(int par1)
static unsigned int const shift
void print(std::ostream &) const
void configFromDB(l1t::TriggerSystem &trgSys)
void set_BX_min(int par1)
std::string fullPath() const
L1TMuonBarrelParamsHelper()
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)