13 #include "boost/shared_ptr.hpp"
31 typedef std::map<short, short, std::less<short> >
LUT;
39 int load_ext(std::vector<L1TMuonBarrelParams::LUTParams::extLUT>&,
unsigned short int,
unsigned short int );
42 typedef boost::shared_ptr<L1TMuonBarrelParams>
ReturnType;
73 int PT_Assignment_nbits_Phi = iConfig.
getParameter<
int>(
"PT_Assignment_nbits_Phi");
74 int PT_Assignment_nbits_PhiB = iConfig.
getParameter<
int>(
"PT_Assignment_nbits_PhiB");
75 int PHI_Assignment_nbits_Phi = iConfig.
getParameter<
int>(
"PHI_Assignment_nbits_Phi");
76 int PHI_Assignment_nbits_PhiB = iConfig.
getParameter<
int>(
"PHI_Assignment_nbits_PhiB");
77 int Extrapolation_nbits_Phi = iConfig.
getParameter<
int>(
"Extrapolation_nbits_Phi");
78 int Extrapolation_nbits_PhiB = iConfig.
getParameter<
int>(
"Extrapolation_nbits_PhiB");
81 int Extrapolation_Filter = iConfig.
getParameter<
int>(
"Extrapolation_Filter");
82 int OutOfTime_Filter_Window = iConfig.
getParameter<
int>(
"OutOfTime_Filter_Window");
83 bool OutOfTime_Filter = iConfig.
getParameter<
bool>(
"OutOfTime_Filter");
84 bool Open_LUTs = iConfig.
getParameter<
bool>(
"Open_LUTs");
85 bool EtaTrackFinder = iConfig.
getParameter<
bool>(
"EtaTrackFinder");
86 bool Extrapolation_21 = iConfig.
getParameter<
bool>(
"Extrapolation_21");
105 std::vector<LUT> pta_lut; pta_lut.reserve(19);
106 std::vector<int> pta_threshold(10);
107 if (
load_pt(pta_lut,pta_threshold, PT_Assignment_nbits_Phi, AssLUTpath) != 0 ) {
108 cout <<
"Can not open files to load pt-assignment look-up tables for L1TMuonBarrelTrackProducer!" << endl;
114 std::vector<LUT> phi_lut; phi_lut.reserve(2);
115 if (
load_phi(phi_lut, PHI_Assignment_nbits_Phi, PHI_Assignment_nbits_PhiB, AssLUTpath) != 0 ) {
116 cout <<
"Can not open files to load phi-assignment look-up tables for L1TMuonBarrelTrackProducer!" << endl;
129 std::vector <std::string> mask_phtf_st1 = iConfig.
getParameter< std::vector <string> >(
"mask_phtf_st1");
130 std::vector <std::string> mask_phtf_st2 = iConfig.
getParameter< std::vector <string> >(
"mask_phtf_st2");
131 std::vector <std::string> mask_phtf_st3 = iConfig.
getParameter< std::vector <string> >(
"mask_phtf_st3");
132 std::vector <std::string> mask_phtf_st4 = iConfig.
getParameter< std::vector <string> >(
"mask_phtf_st4");
134 std::vector <std::string> mask_ettf_st1 = iConfig.
getParameter< std::vector <string> >(
"mask_ettf_st1");
135 std::vector <std::string> mask_ettf_st2 = iConfig.
getParameter< std::vector <string> >(
"mask_ettf_st2");
136 std::vector <std::string> mask_ettf_st3 = iConfig.
getParameter< std::vector <string> >(
"mask_ettf_st3");
138 for(
int wh=-3; wh<4; wh++ ) {
140 for(
char&
c : mask_phtf_st1[wh+3]) {
146 for(
char&
c : mask_phtf_st2[wh+3]) {
152 for(
char&
c : mask_phtf_st3[wh+3]) {
158 for(
char&
c : mask_phtf_st4[wh+3]) {
164 for(
char&
c : mask_ettf_st1[wh+3]) {
170 for(
char&
c : mask_ettf_st2[wh+3]) {
176 for(
char&
c : mask_ettf_st3[wh+3]) {
215 std::vector<int>& pta_threshold,
216 unsigned short int nbitphi,
223 const int MAX_PTASSMETHA = 12;
228 PB12H, PB13H, PB14H, PB21H, PB23H, PB24H, PB34H,
236 int nbit_phi = nbitphi;
237 int sh_phi = 12 - nbit_phi;
242 case PT12L : { pta_str =
"pta12l";
break; }
243 case PT12H : { pta_str =
"pta12h";
break; }
244 case PT13L : { pta_str =
"pta13l";
break; }
245 case PT13H : { pta_str =
"pta13h";
break; }
246 case PT14L : { pta_str =
"pta14l";
break; }
247 case PT14H : { pta_str =
"pta14h";
break; }
248 case PT23L : { pta_str =
"pta23l";
break; }
249 case PT23H : { pta_str =
"pta23h";
break; }
250 case PT24L : { pta_str =
"pta24l";
break; }
251 case PT24H : { pta_str =
"pta24h";
break; }
252 case PT34L : { pta_str =
"pta34l";
break; }
253 case PT34H : { pta_str =
"pta34h";
break; }
254 case PB12H : { pta_str =
"ptb12h_Feb2016";
break; }
255 case PB13H : { pta_str =
"ptb13h_Feb2016";
break; }
256 case PB14H : { pta_str =
"ptb14h_Feb2016";
break; }
257 case PB21H : { pta_str =
"ptb21h_Feb2016";
break; }
258 case PB23H : { pta_str =
"ptb23h_Feb2016";
break; }
259 case PB24H : { pta_str =
"ptb24h_Feb2016";
break; }
260 case PB34H : { pta_str =
"ptb34h_Feb2016";
break; }
265 string lutpath = AssLUTpath;
271 if ( file.
open() != 0 )
return -1;
275 int adr_old = -2048 >>
shift;
276 if (pam >= MAX_PTASSMETHA) adr_old = -512 >>
shift;
289 while ( file.
good() ) {
296 if ( adr != adr_old ) {
298 tmplut.insert(make_pair( adr_old, (sum_pt/number) ));
312 pta_lut.push_back(tmplut);
322 unsigned short int nbit_phi,
323 unsigned short int nbit_phib,
331 int sh_phi = 12 - nbit_phi;
332 int sh_phib = 10 - nbit_phib;
338 case 0 : { phi_str =
"phi12";
break; }
339 case 1 : { phi_str =
"phi42";
break; }
348 if ( file.
open() != 0 )
return -1;
353 int adr_old = -512 >> sh_phib;
357 while ( file.
good() ) {
364 if ( adr != adr_old ) {
366 tmplut.insert(make_pair( adr_old, ((sum_phi/number) >> sh_phi) ));
380 phi_lut.push_back(tmplut);
388 if ( pta_ind >= 0 && pta_ind < 13/2 ) {
389 return pta_threshold[pta_ind];
392 cerr <<
"PtaLut::getPtLutThreshold : can not find threshold " << pta_ind << endl;
407 unsigned short int nbit_phi,
408 unsigned short int nbit_phib) {
418 string defaultPath =
"L1TriggerConfig/DTTrackFinder/parameters/";
419 string ext_dir =
"L1TriggerData/DTTrackFinder/Ext/";
426 int sh_phi = 12 - nbit_phi;
427 int sh_phib = 10 - nbit_phib;
430 for (
int ext = 0; ext <
MAX_EXT; ext++ ) {
432 case EX12 : ext_str =
"ext12";
break;
433 case EX13 : ext_str =
"ext13";
break;
434 case EX14 : ext_str =
"ext14";
break;
435 case EX21 : ext_str =
"ext21";
break;
436 case EX23 : ext_str =
"ext23";
break;
437 case EX24 : ext_str =
"ext24";
break;
438 case EX34 : ext_str =
"ext34";
break;
439 case EX15 : ext_str =
"ext15";
break;
440 case EX16 : ext_str =
"ext16";
break;
441 case EX25 : ext_str =
"ext25";
break;
442 case EX26 : ext_str =
"ext26";
break;
443 case EX56 : ext_str =
"ext56";
break;
452 if ( file.
open() != 0 )
return -1;
459 int adr_old = -512 >> sh_phib;
464 while ( file.
good() ) {
472 if ( adr != adr_old ) {
474 tmplut.
low[adr_old] = sum_low >> sh_phi;
475 tmplut.
high[adr_old] = sum_high >> sh_phi;
484 if (number == 0) sum_low = low;
485 if (number == 0) sum_high = high;
491 ext_lut.push_back(tmplut);
506 using namespace edm::es;
507 boost::shared_ptr<L1TMuonBarrelParams> pBMTFParams;
~L1TMuonBarrelParamsESProducer()
T getParameter(std::string const &) const
void set_Extrapolation_Filter(int par1)
void set_etsoc_chdis_st1(int wh, int sc, const bool val)
void set_BX_min(int par1)
int getPtLutThreshold(int, std::vector< int > &) const
void set_BX_max(int par1)
int load_phi(std::vector< LUT > &, unsigned short int, unsigned short int, std::string)
void setAssLUTPath(std::string path)
void set_etsoc_chdis_st2(int wh, int sc, const bool val)
void setFwVersion(unsigned fwVersion)
bool good()
return status of file stream
void set_Extrapolation_nbits_Phi(int par1)
void set_EtaTrackFinder(bool par1)
void setpta_threshold(std::vector< int > ptathresh)
void set_Extrapolation_nbits_PhiB(int par1)
void setpta_lut(std::vector< LUT > ptalut)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
void set_Open_LUTs(bool par1)
L1MuDTTFMasks l1mudttfmasks
void set_inrec_chdis_st4(int wh, int sc, const bool val)
L1TMuonBarrelParamsESProducer(const edm::ParameterSet &)
void set_Extrapolation_21(bool par1)
boost::shared_ptr< L1TMuonBarrelParams > ReturnType
int load_pt(std::vector< LUT > &, std::vector< int > &, unsigned short int, std::string)
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
void set_inrec_chdis_st2(int wh, int sc, const bool val)
void set_PT_Assignment_nbits_PhiB(int par1)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
void set_inrec_chdis_st3(int wh, int sc, const bool val)
void set_PT_Assignment_nbits_Phi(int par1)
void set_etsoc_chdis_st3(int wh, int sc, const bool val)
L1TMuonBarrelParams m_params
void set_PHI_Assignment_nbits_Phi(int par1)
int readInteger()
read one integer from file
void setphi_lut(std::vector< LUT > philut)
ReturnType produce(const L1TMuonBarrelParamsRcd &)
static unsigned int const shift
void set_OutOfTime_Filter_Window(int par1)
void set_PHI_Assignment_nbits_PhiB(int par1)
std::string fullPath() const
std::vector< unsigned short int > LUT
void set_OutOfTime_Filter(bool par1)
void set_inrec_chdis_csc(int wh, int sc, const bool val)
int load_ext(std::vector< L1TMuonBarrelParams::LUTParams::extLUT > &, unsigned short int, unsigned short int)
void set_inrec_chdis_st1(int wh, int sc, const bool val)