Skip to content

Commit

Permalink
Merge pull request #39154 from Michael-Krohn/modify-hcal-lut-generation
Browse files Browse the repository at this point in the history
 HCAL: Modifications to the LUT and trigger key generation script
  • Loading branch information
cmsbuild authored Aug 24, 2022
2 parents 3a7a1f7 + 66ffd3b commit 61b097d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
2 changes: 0 additions & 2 deletions CaloOnlineTools/HcalOnlineDb/src/HcalLutManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1703,8 +1703,6 @@ int HcalLutManager::createLutXmlFiles_HBEFFromCoder_HOFromAscii_ZDC(std::string
addLutMap(xml, masks);
}
//
const std::map<int, std::shared_ptr<LutXml>> _zdc_lut_xml = getZdcLutXml(_tag, split_by_crate);
addLutMap(xml, _zdc_lut_xml);

writeLutXmlFiles(xml, _tag, split_by_crate);

Expand Down
27 changes: 23 additions & 4 deletions CaloOnlineTools/HcalOnlineDb/test/genLUT.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ BaseDir=${FullPath#${CMSSW_BASE}/src/}
CondDir=conditions
templatefile=template.py

inputConditions=(ElectronicsMap LutMetadata LUTCorrs QIETypes QIEData SiPMParameters TPParameters TPChannelParameters ChannelQuality Gains Pedestals RespCorrs L1TriggerObjects)
inputConditions=(ElectronicsMap LutMetadata LUTCorrs QIETypes QIEData SiPMParameters TPParameters TPChannelParameters ChannelQuality Gains Pedestals PedestalWidths RespCorrs L1TriggerObjects)



Expand Down Expand Up @@ -173,17 +173,36 @@ then
HcalInput=( "${inputConditions[@]/#/Hcal}" )
declare -A tagMap
eval $(conddb list $GlobalTag | grep -E "$(export IFS="|"; echo "${HcalInput[*]}")" | \
awk '{if($2=="-" || $2=="effective") if(!($1~/^HcalPed/ && $2=="-")) print "tagMap["$1"]="$3}')
awk '{if($1~/^HcalPed/ && $2=="effective") print "tagMap["$1"+"$2"]="$3; else print "tagMap["$1"]="$3}')

PedSTR='Pedestal'
individualInputTags=""
for i in ${inputConditions[@]}; do
t=$i
v=${!t}
if [[ -z $v ]]; then
v=${tagMap[Hcal${i}Rcd]}
if [[ ${i} == *"$PedSTR"* ]]; then
v=${tagMap[Hcal${i}Rcd]}
l=""
individualInputTags="""$individualInputTags
<Parameter type=\"string\" name=\"$t\" label=\"$l\">$v</Parameter>"""
v=${tagMap[Hcal${i}Rcd+effective]}
l="effective"
else
v=${tagMap[Hcal${i}Rcd]}
l=""
fi
else
if [[ ${i} == *"$PedSTR"* ]]; then
l=""
individualInputTags="""$individualInputTags
<Parameter type=\"string\" name=\"$t\" label=\"$l\">$v</Parameter>"""
v="${v}_effective"
l="effective"
fi
fi
individualInputTags="""$individualInputTags
<Parameter type=\"string\" name=\"$t\">$v</Parameter>"""
<Parameter type=\"string\" name=\"$t\" label=\"$l\">$v</Parameter>"""
done

dd=$(date +"%Y-%m-%d %H:%M:%S")
Expand Down

0 comments on commit 61b097d

Please sign in to comment.