23 if not os.path.isdir(os.environ[
'LOCALRT'] +
"/src/L1Trigger/L1TCalorimeter/data"):
24 print(os.environ[
'LOCALRT'] +
"/src/L1Trigger/L1TCalorimeter/data/ directory does not exist.\n" 25 "Creating directory now.\n" 26 "Remember to do 'git add " + os.environ[
'LOCALRT'] +
"L1Trigger/L1TCalorimeter/data' when committing the new LUT!")
27 os.makedirs(os.environ[
'LOCALRT'] +
"/src/L1Trigger/L1TCalorimeter/data")
29 print "Creating tower Et threshold LUT with filename " + os.environ[
'LOCALRT'] +
"/src/L1Trigger/L1TCalorimeter/data/lut_towEtThresh_2017v6.txt'" 30 towEtThreshLUTFile = open(os.environ[
'LOCALRT']+
"/src/L1Trigger/L1TCalorimeter/data/lut_towEtThresh_2017v6.txt",
"w")
34 towEtThreshLUTFile.write(
35 "# address to et sum tower Et threshold LUT\n" 36 "# maps 11 bits to 9 bits\n" 37 "# 11 bits = (compressedPileupEstimate << 6) | abs(ieta)\n" 38 "# compressedPileupEstimate is unsigned 5 bits, abs(ieta) is unsigned 6 bits\n" 39 "# data: tower energy threshold returned has 9 bits \n" 40 "# anything after # is ignored with the exception of the header\n" 41 "# the header is first valid line starting with #<header> versionStr nrBitsAddress nrBitsData </header>\n" 42 "#<header> v1 11 9 </header>\n" 49 towerAreas = [0.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,
50 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,
51 1.03,1.15,1.3,1.48,1.72,2.05,1.72,4.02,
52 3.29,2.01,2.02,2.01,2.02,2.0,2.03,1.99,2.02,2.04,2.00,3.47];
54 etaRange = xrange(0,41)
55 compNTT4Range = xrange(0,32)
59 for compNTT4
in compNTT4Range:
62 towEtThresh =
int(round(
pow(
float(towerAreas[ieta]),1.4)*(1/(1+math.exp(-0.07*(ieta))))*(
pow(
float(compNTT4),2)/100)))
64 towEtThresh =
int(round(
pow(
float(towerAreas[ieta]),1.4)*(1/(1+math.exp(-0.07*(ieta))))*(
pow(
float(16),2)/100)))
69 if ieta < 13
or towEtThresh < 0:
72 printBins =
" # nTT4 = " +
str(5*compNTT4) +
"-" +
str((5*compNTT4)+5) +
" ieta = " +
str(ieta)
74 printBins =
" # ieta = " +
str(ieta+1)
76 printBins =
" # ieta = " +
str(ieta)
77 towEtThreshLUTFile.write(
86 while extraCount < 23:
87 towEtThreshLUTFile.write(
96 for addr
in xrange(addr,2047):
97 towEtThreshLUTFile.write(
str(addr) +
" " +
str(0) +
" # dummy\n")
100 print "Done. Closing file..." 102 towEtThreshLUTFile.close()
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Power< A, B >::type pow(const A &a, const B &b)