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;
130 for(
auto it_proc=procRole.begin(); it_proc!=procRole.end(); it_proc++ )
135 std::map<std::string, l1t::Parameter> settings = trgSys.
getParameters(procId.c_str());
138 std::vector<std::string> paths = settings[
"regTable"].getTableColumn<
std::string>(
"register_path");
139 std::vector<unsigned int>
vals = settings[
"regTable"].getTableColumn<
unsigned int>(
"register_value");
140 for(
unsigned int row=0; row<paths.size(); row++)
142 if (paths[row].
find(
"open_lut") != std::string::npos){
146 if (paths[row].
find(
"sel_21") != std::string::npos){
151 if (paths[row].
find(
"dis_newalgo") != std::string::npos){
155 bool disnewalgo = (vals[row]==1);
159 string masks[5] = {
"mask_ctrl_N2",
"mask_ctrl_N1",
"mask_ctrl_0",
"mask_ctrl_P1",
"mask_ctrl_P2"};
161 for(
int m=0;
m<5;
m++)
164 if (paths[row].
find(masks[
m]) != std::string::npos){
166 int mask = 0x1&vals[row];
167 int mask_all = vals[row];
169 if(!( mask_all==0x111111 || mask_all==0x222222 || mask_all==0x333333 || mask_all==0x444444 ||
170 mask_all==0x555555 || mask_all==0x666666 || mask_all==0x777777) )
171 cerr<<
"BMTF: Cannot re-emulate properly. Individual link masking cannot be handled."<<endl;
174 for(
int sec=0; sec<12; sec++){
175 if(masks[m]==
"mask_ctrl_N2"){
179 if(masks[m]==
"mask_ctrl_N1"){
184 if(masks[m]==
"mask_ctrl_0"){
190 if(masks[m]==
"mask_ctrl_P1"){
194 if(masks[m]==
"mask_ctrl_P2"){
203 for(
int sec=0; sec<12; sec++){
204 if(masks[m]==
"mask_ctrl_N2"){
208 if(masks[m]==
"mask_ctrl_N1"){
213 if(masks[m]==
"mask_ctrl_0"){
219 if(masks[m]==
"mask_ctrl_P1"){
223 if(masks[m]==
"mask_ctrl_P2"){
231 for(
int sec=0; sec<12; sec++){
232 if(masks[m]==
"mask_ctrl_N2"){
236 if(masks[m]==
"mask_ctrl_N1"){
241 if(masks[m]==
"mask_ctrl_0"){
247 if(masks[m]==
"mask_ctrl_P1"){
251 if(masks[m]==
"mask_ctrl_P2"){
259 for(
int sec=0; sec<12; sec++){
260 if(masks[m]==
"mask_ctrl_N2"){
263 if(masks[m]==
"mask_ctrl_N1"){
267 if(masks[m]==
"mask_ctrl_0"){
271 if(masks[m]==
"mask_ctrl_P1"){
274 if(masks[m]==
"mask_ctrl_P2"){
287 unsigned short int nbitphi,
294 const int MAX_PTASSMETHA = 12;
299 PB12H, PB13H, PB14H, PB21H, PB23H, PB24H, PB34H,
307 int nbit_phi = nbitphi;
308 int sh_phi = 12 - nbit_phi;
313 case PT12L : { pta_str =
"pta12l";
break; }
314 case PT12H : { pta_str =
"pta12h";
break; }
315 case PT13L : { pta_str =
"pta13l";
break; }
316 case PT13H : { pta_str =
"pta13h";
break; }
317 case PT14L : { pta_str =
"pta14l";
break; }
318 case PT14H : { pta_str =
"pta14h";
break; }
319 case PT23L : { pta_str =
"pta23l";
break; }
320 case PT23H : { pta_str =
"pta23h";
break; }
321 case PT24L : { pta_str =
"pta24l";
break; }
322 case PT24H : { pta_str =
"pta24h";
break; }
323 case PT34L : { pta_str =
"pta34l";
break; }
324 case PT34H : { pta_str =
"pta34h";
break; }
325 case PB12H : { pta_str =
"ptb12h_Feb2016";
break; }
326 case PB13H : { pta_str =
"ptb13h_Feb2016";
break; }
327 case PB14H : { pta_str =
"ptb14h_Feb2016";
break; }
328 case PB21H : { pta_str =
"ptb21h_Feb2016";
break; }
329 case PB23H : { pta_str =
"ptb23h_Feb2016";
break; }
330 case PB24H : { pta_str =
"ptb24h_Feb2016";
break; }
331 case PB34H : { pta_str =
"ptb34h_Feb2016";
break; }
336 const string& lutpath = AssLUTpath;
342 if ( file.
open() != 0 )
return -1;
346 int adr_old = -2048 >>
shift;
347 if (pam >= MAX_PTASSMETHA) adr_old = -512 >>
shift;
360 while ( file.
good() ) {
367 if ( adr != adr_old ) {
369 tmplut.insert(make_pair( adr_old, (sum_pt/number) ));
383 pta_lut.push_back(tmplut);
393 unsigned short int nbit_phi,
394 unsigned short int nbit_phib,
402 int sh_phi = 12 - nbit_phi;
403 int sh_phib = 10 - nbit_phib;
409 case 0 : { phi_str =
"phi12";
break; }
410 case 1 : { phi_str =
"phi42";
break; }
419 if ( file.
open() != 0 )
return -1;
424 int adr_old = -512 >> sh_phib;
428 while ( file.
good() ) {
435 if ( adr != adr_old ) {
437 tmplut.insert(make_pair( adr_old, ((sum_phi/number) >> sh_phi) ));
451 phi_lut.push_back(tmplut);
479 unsigned short int nbit_phi,
480 unsigned short int nbit_phib) {
490 string defaultPath =
"L1Trigger/L1TMuon/data/bmtf_luts/";
491 string ext_dir =
"LUTs_Ext/";
498 int sh_phi = 12 - nbit_phi;
499 int sh_phib = 10 - nbit_phib;
504 case EX12 : ext_str =
"ext12";
break;
505 case EX13 : ext_str =
"ext13";
break;
506 case EX14 : ext_str =
"ext14";
break;
507 case EX21 : ext_str =
"ext21";
break;
508 case EX23 : ext_str =
"ext23";
break;
509 case EX24 : ext_str =
"ext24";
break;
510 case EX34 : ext_str =
"ext34";
break;
511 case EX15 : ext_str =
"ext15";
break;
512 case EX16 : ext_str =
"ext16";
break;
513 case EX25 : ext_str =
"ext25";
break;
514 case EX26 : ext_str =
"ext26";
break;
515 case EX56 : ext_str =
"ext56";
break;
524 if ( file.
open() != 0 )
return -1;
531 int adr_old = -512 >> sh_phib;
536 while ( file.
good() ) {
544 if ( adr != adr_old ) {
546 tmplut.
low[adr_old] = sum_low >> sh_phi;
547 tmplut.
high[adr_old] = sum_high >> sh_phi;
556 if (number == 0) sum_low = low;
557 if (number == 0) sum_high = high;
563 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)
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)
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
std::string fullPath() const
void print(std::ostream &) const
void configFromDB(l1t::TriggerSystem &trgSys)
void set_BX_min(int par1)
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)