52 const std::string &outputDirectory,
const bool &
debug)
80 std::vector<std::string>
temp;
103 ConditionMap::const_iterator condIter = map.begin();
104 while (condIter!=map.end())
106 if (condIter->second->condCategory()==category
107 && condIter->second->condType()==type && (condIter->second->objectType())[0]==
object)
109 outputMap[condIter->first]=condIter->second;
123 ConditionMap::iterator condIter = map.begin();
124 while (condIter!=map.end())
126 for (
unsigned int i=0;
i<(condIter->second->objectType()).
size();
i++)
128 if (condIter->second->objectType()[
i]==
object)
144 const unsigned short int &condChip,
145 std::map<std::string,std::string> &muonParameters)
148 std::vector<L1GtConditionType> muonConditionTypes;
150 muonConditionTypes.push_back(
Type1s);
151 muonConditionTypes.push_back(
Type2s);
152 muonConditionTypes.push_back(
Type2wsc);
153 muonConditionTypes.push_back(
Type3s);
154 muonConditionTypes.push_back(
Type4s);
156 for (
unsigned int i = 0;
i<muonConditionTypes.size();
i++)
163 (*conditionMap_).at(condChip-1), MuonConditions1s, condChip);
179 unsigned int counter=0;
181 for (ConditionMap::const_iterator iterCond = MuonConditions1s.begin(); iterCond
182 != MuonConditions1s.end(); iterCond++)
190 const std::vector<L1GtMuonTemplate::ObjectParameter>* op =
193 if (muonConditionTypes.at(
i)==
Type1s)
207 muonParameters[
"phi_l_1_s"]+=(
"--"+iterCond->first+
"\n");
208 muonParameters[
"phi_h_1_s"]+=(
"--"+iterCond->first+
"\n");
209 muonParameters[
"eta_1_s"] +=(
"--"+iterCond->first+
"\n");
214 if (muonConditionTypes.at(
i)==
Type2s)
228 muonParameters[
"phi_l_2_s"]+=(
"--"+iterCond->first+
"\n");
229 muonParameters[
"phi_h_2_s"]+=(
"--"+iterCond->first+
"\n");
230 muonParameters[
"eta_2_s"] +=(
"--"+iterCond->first+
"\n");
236 if (muonConditionTypes.at(
i)==
Type3s)
250 muonParameters[
"phi_l_3"]+=(
"--"+iterCond->first+
"\n");
251 muonParameters[
"phi_h_3"]+=(
"--"+iterCond->first+
"\n");
252 muonParameters[
"eta_3"] +=(
"--"+iterCond->first+
"\n");
257 if (muonConditionTypes.at(
i)==
Type4s)
271 muonParameters[
"phi_l_4"]+=(
"--"+iterCond->first+
"\n");
272 muonParameters[
"phi_h_4"]+=(
"--"+iterCond->first+
"\n");
273 muonParameters[
"eta_4"] +=(
"--"+iterCond->first+
"\n");
284 muonParameters[
"eta_2_wsc"]
294 std::ostringstream dEta;
304 muonParameters[
"eta_2_wsc"]+=(
"--"+iterCond->first+
"\n");
305 muonParameters[
"phi_h_2_wsc"]+=(
"--"+iterCond->first+
"\n");
306 muonParameters[
"phi_l_2_wsc"] +=(
"--"+iterCond->first+
"\n");
307 muonParameters[
"delta_eta"]+=(
"--"+iterCond->first+
"\n");
308 muonParameters[
"delta_phi"] +=(
"--"+iterCond->first+
"\n");
319 const unsigned short int &condChip,
320 std::map<std::string,std::string> &caloParameters,
324 std::vector<L1GtConditionType> caloConditionTypes;
326 caloConditionTypes.push_back(
Type1s);
327 caloConditionTypes.push_back(
Type2s);
328 caloConditionTypes.push_back(
Type2wsc);
329 caloConditionTypes.push_back(
Type4s);
331 for (
unsigned int i = 0;
i<caloConditionTypes.size();
i++)
333 unsigned int counter=0;
339 caloObject, (*conditionMap_).at(condChip-1), caloConditions,
342 for (ConditionMap::const_iterator iterCond = caloConditions.begin(); iterCond
343 != caloConditions.end(); iterCond++)
351 const std::vector<L1GtCaloTemplate::ObjectParameter>* op =
354 if (caloConditionTypes.at(
i)==
Type1s)
366 caloParameters[
"eta_1_s"]+=(
"--"+iterCond->first+
"\n");
367 caloParameters[
"phi_1_s"]+=(
"--"+iterCond->first+
"\n");
370 }
else if (caloConditionTypes.at(
i)==
Type2s)
381 caloParameters[
"eta_2_s"]+=(
"--"+iterCond->first+
"\n");
382 caloParameters[
"phi_2_s"]+=(
"--"+iterCond->first+
"\n");
385 }
else if (caloConditionTypes.at(
i)==
Type4s)
395 caloParameters[
"eta_4"]+=(
"--"+iterCond->first+
"\n");
396 caloParameters[
"phi_4"]+=(
"--"+iterCond->first+
"\n");
399 }
else if (caloConditionTypes.at(
i)==
Type2wsc)
405 caloParameters[
"eta_2_wsc"]
421 caloParameters[
"eta_2_wsc"]+=(
"--"+iterCond->first+
"\n");
422 caloParameters[
"phi_2_wsc"]+=(
"--"+iterCond->first+
"\n");
423 caloParameters[
"delta_eta"]+=(
"--"+iterCond->first+
"\n");
424 caloParameters[
"delta_phi"]+=(
"--"+iterCond->first+
"\n");
439 const unsigned short int &condChip,
const L1GtObject &
object,
440 std::string &energySumParameter)
445 unsigned int counter=0;
449 else if (
object==
ETM)
451 else if (
object==
ETT)
457 (*conditionMap_).at(condChip-1), esumsConditions, condChip);
459 for (ConditionMap::const_iterator iterCond = esumsConditions.begin(); iterCond
460 != esumsConditions.end(); iterCond++)
464 const std::vector<L1GtEnergySumTemplate::ObjectParameter>* op =
472 energySumParameter+=(
"--"+iterCond->first+
"\n");
486 std::string ¶meterStr)
489 std::map<L1GtConditionType,std::string> condType2Strcopy =
condType2Str_;
492 std::map<L1GtConditionType,std::string>::iterator typeIterator =
493 condType2Strcopy.begin();
495 while (typeIterator != condType2Strcopy.end())
513 parameterStr+=(tempStr2+
"\n\n");
518 condType2Strcopy.erase(typeIterator);
531 const unsigned short int &condChip,
532 std::map<std::string, L1GtVhdlTemplateFile> &
templates,
533 std::map<std::string, std::string> &commonParams)
555 std::vector<unsigned int> processedTypes;
563 std::vector<L1GtObject>::iterator caloObjIter =
caloObjects_.begin();
569 commonParams[
"calo_common"]);
575 std::vector<L1GtObject>::iterator esumObjIter =
esumObjects_.begin();
581 commonParams[
"esums_common"]);
589 for (ConditionMap::const_iterator iterCond = (*conditionMap_).at(condChip-1).begin(); iterCond != (*conditionMap_).at(condChip-1).end(); iterCond++)
592 switch ((iterCond->second)->condCategory())
601 msg(
"Panik! Condition "+(iterCond->first)
602 +
" does not have a integer equivalent!");
616 if ((iterCond->second)->condType() ==
Type1s)
620 }
else if ((iterCond->second)->condType() ==
Type2s)
624 }
else if ((iterCond->second)->condType() ==
Type2wsc)
628 }
else if ((iterCond->second)->condType() ==
Type3s)
632 }
else if ((iterCond->second)->condType() ==
Type4s)
649 templates[
"muon"].append(muoncopy);
660 msg(
"Panik! Condition "+(iterCond->first)
661 +
" does not have a integer equivalent!");
678 templates[
"calo"].append(calocopy);
690 msg(
"Panik! Condition "+(iterCond->first)
691 +
" does not have a integer equivalent!");
701 esumscopy.
substitute(
"name", iterCond->first);
704 if (((iterCond->second)->objectType()).
at(0)==
ETM)
705 esumscopy.
substitute(
"if_etm_then_1_else_0",
"1");
707 esumscopy.
substitute(
"if_etm_then_1_else_0",
"0");
712 templates[
"esums"].append(esumscopy);
725 int nObjects = iterCond->second->
nrObjects();
727 const std::vector<L1GtJetCountsTemplate::ObjectParameter>* op =
730 for (
int i = 0;
i < nObjects;
i++)
733 std::vector<unsigned int>::iterator
p =
find(
734 processedTypes.begin(), processedTypes.end(), (*op)[
i].countIndex);
738 if (p==processedTypes.end())
740 std::ostringstream indStr;
741 indStr<<(*op)[
i].countIndex;
751 processedTypes.push_back((*op)[
i].countIndex);
760 msg(
"Panik! Condition "+(iterCond->first)
761 +
" does not have a integer equivalent!");
785 templates[
"jet_cnts"].append(jetcopy);
811 std::map<std::string,std::string>::iterator pIt = commonParams.begin();
813 while (pIt!=commonParams.end())
815 if ((pIt->second)[((pIt->second).length()-1)] ==
'\n')
816 (pIt->second) = (pIt->second).substr(0, (pIt->second).length()-1);
826 std::map<int, std::string> algorithmsChip1;
827 std::map<int, std::string> algorithmsChip2;
829 AlgorithmMap::const_iterator algoIter=(*algorithmMap_).begin();
832 while (algoIter!=(*algorithmMap_).end())
839 std::string logicalExpr = (algoIter->second).algoLogicalExpression();
840 std::vector<std::string> conditions;
844 std::string logicalExprCopy= logicalExpr;
847 for (
unsigned int i=0;
i<conditions.size();
i++)
849 std::ostringstream newExpr;
853 std::vector<ConditionMap> * conditionMapCp =
const_cast< std::vector<ConditionMap>*
>(
conditionMap_);
855 L1GtCondition* cond = (*conditionMapCp).at((algoIter->second).algoChipNumber())[conditions.at(
i)];
868 msg(
"Panik! Didn't find Condition "+conditions.at(
i));
872 std::vector<int> orderConditionChip;
873 orderConditionChip.push_back(2);
874 orderConditionChip.push_back(1);
876 int pin = (algoIter->second).algoOutputPin(2, 96, orderConditionChip);
883 if ((algoIter->second).algoChipNumber()==0)
885 algorithmsChip1[pin]=logicalExpr;
887 algorithmsChip1[pin]+=(
"-- "+logicalExprCopy);
888 }
else if ((algoIter->second).algoChipNumber()==1)
890 algorithmsChip2[pin]=logicalExpr;
892 algorithmsChip2[pin]+=(
"-- "+logicalExprCopy);
899 algoStrings.push_back(algorithmsChip1);
900 algoStrings.push_back(algorithmsChip2);
927 if (!mkdir(subDir1.c_str(), 666));
928 if (!mkdir(subDir2.c_str(), 666));
930 chmod(subDir1.c_str(), 0777);
931 chmod(subDir2.c_str(), 0777);
944 for (
unsigned short int i =1;
i<=2;
i++)
948 std::map<std::string,std::string> muonParameters;
956 std::vector<L1GtObject>::iterator caloObjIter =
caloObjects_.begin();
961 std::map<std::string,std::string> caloParameters;
973 std::vector<L1GtObject>::iterator esumObjIter =
esumObjects_.begin();
977 std::string etmParameter;
994 std::map<std::string, L1GtVhdlTemplateFile>
templates;
995 std::map<std::string, std::string> common;
1023 std::vector< std::map<int, std::string> > algoStrings;
1039 std::ostringstream oss;
1046 std::map<std::string,std::string> &headerParameters,
1047 const std::vector<std::string> &connectedChannels)
1051 std::map<std::string,std::string>::iterator iter = headerParameters.begin();
1055 while (iter != headerParameters.end() )
1068 version_=headerParameters[
"version"];
1070 msg(
"Build Common header and Quartus setup files sucessuflly!");
1075 const std::string &
filename,
const std::string &outputFilename)
1080 commonHeaderCp.
substitute(
"vhdl_file_name", outputFilename);
1083 myTemplate.
insert(
"$(header)", commonHeaderCp);
1089 std::map<std::string,std::string> &muonParameters,
1090 const std::string &particle,
unsigned short int &condChip)
1097 if (particle==
"muon")
1100 internalTemplate.
open(
vhdlDir_+
"InternalTemplates/muonsetup",
true);
1104 internalTemplate.
open(
vhdlDir_+
"InternalTemplates/calosetup",
true);
1111 if (particle!=
"muon")
1120 std::map<std::string,std::string> parameterMap =
1123 std::vector<std::string> substitutionParameters;
1129 internalTemplate.
append(
"");
1131 std::map<std::string, std::string>::iterator iter;
1134 for (
unsigned int i=0;
i<substitutionParameters.size();
i++)
1137 internalTemplateCopy = internalTemplate;
1140 if (particle!=
"muon")
1143 if (substitutionParameters.at(
i).substr(0, 3) ==
"eta")
1144 internalTemplateCopy.
substitute(
"constant", parameterMap[
"eta"]);
1145 else if (substitutionParameters.at(
i).substr(0, 3) ==
"phi")
1146 internalTemplateCopy.
substitute(
"constant", parameterMap[
"phi"]);
1147 else if (substitutionParameters.at(
i).substr(0, 3) ==
"del")
1150 parameterMap[
"delta"]);
1151 while (internalTemplateCopy.
substitute(
"delta",
1152 substitutionParameters[
i]))
1154 substitutionParameters[i]);
1159 if (particle==
"muon")
1162 internalTemplateCopy.
substitute(
"type", substitutionParameters[
i]);
1166 internalTemplateCopy.
substitute(
"type", substitutionParameters[
i].substr(4));
1171 std::string paramCopy = substitutionParameters[
i];
1176 internalTemplateCopy.
substitute(
"type2", paramCopy);
1179 parameterMap[substitutionParameters[
i]]);
1182 while (muonTemplate.
substitute(
"particle", particle))
1183 muonTemplate.
substitute(
"particle", particle);
1186 iter=muonParameters.find(substitutionParameters[i]);
1189 if (iter!=muonParameters.end())
1191 if ((*iter).second[(*iter).second.length()-1]==
'\n')
1192 (*iter).second[(*iter).second.length()-1]=
' ';
1193 internalTemplateCopy.
substitute(
"content", (*iter).second);
1198 muonTemplate.
insert(
"$("+substitutionParameters[i]+
")",
1199 internalTemplateCopy);
1209 std::map<std::string, L1GtVhdlTemplateFile>
templates,
1210 const std::map<std::string, std::string> &common,
1211 const unsigned short int &chip)
1226 std::map<std::string, L1GtVhdlTemplateFile>::iterator iter=
1229 while (iter != templates.end())
1232 myTemplate.
insert(
"$("+(iter->first)+
")", iter->second);
1238 std::map<std::string, std::string>::const_iterator iter2= common.begin();
1240 while (iter2 != common.end())
1243 myTemplate.
substitute((iter2->first), iter2->second);
1256 for (
unsigned int i=1;
i<=2;
i++)
1266 filename, outputFileName);
1268 std::ostringstream buffer;
1270 unsigned int algoPinsPerChip = 96;
1272 for (
unsigned int k=1;
k<=algoPinsPerChip;
k++)
1276 if (algoStrings.at(
i-1)[
k]!=
"")
1277 buffer<<
" <= "<<algoStrings.at(
i-1)[
k]<<
";"<<std::endl;
1279 buffer<<
" <= '0';"<<std::endl;
1290 const int &condChip)
1305 while (myTemplate.
substitute(
"particle",
"etm"))
1306 while (myTemplate.
substitute(
"particle",
"etm"))
1310 if (etmString[etmString.length()-1] ==
'\n')
1311 etmString = etmString.substr(0, etmString.length()-1);
1337 for (
unsigned int i=0;
i<filenames.size();
i++)
1344 std::string tempStr = filenames.at(
i);
1368 const std::string &searchValue,
int &intVal)
1370 std::map<std::string,int>::const_iterator iter = map.find(searchValue);
1371 if (iter == map.end() )
1373 intVal = (*iter).second;
1384 const std::vector<ConditionMap> &conditionMap,
1385 std::map<std::string,int> &conditionToIntegerMap_)
1390 conditionMap.at(chip-1), jetConditions);
1403 unsigned int maxJetsCountsIndex = 11;
1405 for (
unsigned int i= 0;
i<=maxJetsCountsIndex;
i++)
1409 for (ConditionMap::const_iterator iterCond = jetConditions.begin(); iterCond
1410 != jetConditions.end(); iterCond++)
1415 const std::vector<L1GtJetCountsTemplate::ObjectParameter>* op =
1418 conditionToIntegerMap_[iterCond->first]=counter;
1419 if ((*op)[0].countIndex==
i)
1437 for (
unsigned int i=0;
i<=1;
i++)
1439 ConditionMap::const_iterator iterCond =
1456 chmod(filename.c_str(), 0666);
1481 const std::vector<int> &
values)
1485 return "1 => (\"00000000\", \"00000000\")";
1506 for (ConditionMap::const_iterator iterCond =conditions.begin(); iterCond
1507 != conditions.end(); iterCond++)
1511 const std::vector<L1GtCaloTemplate::ObjectParameter>* op =
1514 unsigned int nObjects = iterCond->second->nrObjects();
1516 for (
unsigned int i =0;
i<nObjects;
i++)
1521 result +=
int2str((*op).at(
i).etThreshold);
1532 return "-- 0 => (\"00000000\", \"00000000\" ... )";
1537 const std::vector<ConditionMap> &conditionMap,
const int &chip)
1541 internalTemplate.
open(
vhdlDir_+
"InternalTemplates/defvalpkg",
true);
1551 jetCountsDefValuesBuffer, esumsDefValBuffer;
1554 std::vector<std::string> muonDefValTypes;
1560 int jetCountsMaxIndex = 11;
1563 std::vector<std::string> jetCountsDefValTypes;
1564 for (
int i = 0;
i<=jetCountsMaxIndex;
i++)
1566 jetCountsDefValTypes.push_back(
int2str(
i));
1570 std::vector<std::string> caloDefValTypes;
1571 caloDefValTypes.push_back(
"");
1574 std::vector<std::string> esumsDefValTypes;
1578 std::map<L1GtConditionType,std::string>::iterator typeIter;
1583 std::map<L1GtConditionType,std::string> muonTypes =
condType2Str_;
1586 muonTypes.erase(typeIter);
1587 typeIter=muonTypes.find(
TypeETM);
1588 muonTypes.erase(typeIter);
1589 typeIter=muonTypes.find(
TypeETT);
1590 muonTypes.erase(typeIter);
1591 typeIter=muonTypes.find(
TypeHTT);
1592 muonTypes.erase(typeIter);
1594 muonTypes.erase(typeIter);
1596 std::map<L1GtConditionType,std::string> caloTypes = muonTypes;
1597 typeIter=caloTypes.find(
Type3s);
1598 caloTypes.erase(typeIter);
1602 std::map<L1GtConditionType,std::string> jetCountsTypes;
1641 filename, outputFile);
1668 const std::map<L1GtConditionType,std::string> &typeList,
1669 const std::vector<std::string> &defValuesList,
const L1GtObject &
object)
1672 std::map<L1GtConditionType,std::string>::const_iterator typeIter;
1674 for (typeIter=typeList.begin(); typeIter!=typeList.end(); typeIter++)
1677 for (
unsigned int i = 0;
i<defValuesList.size();
i++)
1682 internalTemplate.
open(
vhdlDir_+
"InternalTemplates/defvalpkg",
true);
1735 std::string othersString;
1763 buffer.
append(internalTemplate);
1783 number=outputMap.size();
1797 for (
unsigned int k=0;
k<=1;
k++)
1820 while (caloObjectsCp.size()>0)
1822 std::vector<L1GtObject>::iterator iter=caloObjectsCp.begin();
1824 caloObjectsCp.erase(iter);
1826 iter=caloObjectsCp.begin();
1827 while (iter!=caloObjectsCp.end())
1847 else if (
object==
ETM ||
object==
HTT ||
object==
ETT)
1868 for (ConditionMap::const_iterator iterCond = map.begin(); iterCond
1869 != map.end(); iterCond++)
1871 msg(iterCond->first);
1907 const std::string &typeStr,
const int &number)
1922 return "$("+name+
")";
static const std::string substParamMuonDefVals_
std::map< std::string, std::string > returnParameterMap()
returns parameter map
static const std::string vhdlTemplateAlgoAndOr_
std::string vhdlDir_
templates directory
void writeConditionChipSetup(std::map< std::string, L1GtVhdlTemplateFile > templates, const std::map< std::string, std::string > &common, const unsigned short int &chip)
builds cond_chip.vhds
std::string sp(const std::string &name)
converts string name to substiution parameter synthax; name –>
static const bool findAndReplaceString(std::string ¶mString, const std::string &searchString, const std::string &replaceString)
replaces searchString with replaceString at it's first occurance in string
std::string buildEtaCalo(const std::vector< L1GtCaloTemplate::ObjectParameter > *op, const unsigned int &num, const unsigned int &counter)
static const std::string substParamCaloDefVals_
const int nrObjects() const
get number of trigger objects
bool substitute(const std::string &searchString, const std::string &replaceString)
replaces searchString with replaceString
static const std::string stringConstantCharge2wsc_
const std::map< L1GtConditionType, std::string > getCond2StrMap()
const CorrelationParameter * correlationParameter() const
static const std::string quartusSetupFileChip2_
static const std::string stringConstantDefValId_
void writeQsfSetupFiles(const std::string &version)
builds the two quartus setup files. This routine is called in buildCommonHeader!
std::vector< L1GtObject > esumObjects_
list of all possible esums objects
bool save(const std::string &fileName)
saves the content of the template file to a local file (the content of parameterMap_ will not be save...
static const std::string stringConstantEsumsLow_
std::map< L1GtObject, std::string > caloType2Int_
converts L1GtObject to calo_nr
void writeDefValPkg(const std::vector< ConditionMap > &conditionMap, const int &chip)
writes def_val_pkg.vhd
std::map< L1GtConditionType, std::string > condType2Str_
converts L1GtConditionType to firmware string
static const std::string substParamJetsDefVals_
bool getCaloSetupContentFromTriggerMenu(const unsigned short int &condChip, std::map< std::string, std::string > &caloParameters, const L1GtObject &caloObject)
L1GtVhdlWriterBitManager bm_
bit manager for bit operations
std::string getDefValsFromTriggerMenu(const L1GtConditionType &type, const L1GtObject &object, const VmeRegister ®)
std::string buildDeltaEtaCalo(const L1GtCaloTemplate::CorrelationParameter *&cp, const unsigned int &counter)
L1GtVhdlWriterCore(const std::string &templatesDirectory, const std::string &outputDirectory, const bool &debug)
constructor
static const std::string substParamDefValType_
std::vector< L1GtObject > caloObjects_
list of all possible calo objects
static const std::string substParamJetCntsCommon_
std::string index4CondChipVhd(int intval)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
static const std::string stringConstantCommon_
std::vector< std::vector< std::string > > numberOfConditions_
vector containing the initialization of all conditions
bool getIntVal(const std::map< std::string, int > &map, const std::string &searchValue, int &intVal)
checks weather value searchValue exists in a <string,int> map, saves it in &intVal if it exists and r...
static std::string int2str(const int &integerValue)
converts a integer into a string
bool returnConditionsOfOneClass(const L1GtConditionType &type, const L1GtConditionCategory &category, const L1GtObject &object, const ConditionMap &map, ConditionMap &outputMap)
bool getEsumsSetupContentFromTriggerMenu(const unsigned short int &condChip, const L1GtObject &object, std::string &energySumParameter)
contains only one subsitution parameter which is stored in reference energySumParameter ...
bool removeLineWithContent(const std::string &str)
removes all lines that contain the str
L1GtConditionCategory getCategoryFromObject(const L1GtObject &object)
gets condition category from object
static const std::string substParamAlgos_
static const std::string vhdlTemplateCondChipPkg2_
std::string buildDeltaPhiCalo(const L1GtCaloTemplate::CorrelationParameter *&cp, const unsigned int &counter)
const AlgorithmMap * algorithmMap_
algorithm map
~L1GtVhdlWriterCore()
destructor
static const std::string stringConstantCharge4s_
std::vector< std::string > getMsgBuf()
returns intern message buffer
static const std::string stringConstantAlgo_
void writeEtmSetup(std::string &etmString, const int &condChip)
builds etm setup files
static const std::string stringConstantEsumsHigh_
bool insert(const std::string &atLine, std::vector< std::string > content)
replaces the whole line containing atLine and inserts content instead of it
bool makeFirmware(const std::vector< ConditionMap > &conditionMap, const AlgorithmMap &algorithmMap)
produces the firmware code
const std::vector< ObjectParameter > * objectParameter() const
std::string buildPhiCalo(const std::vector< L1GtCaloTemplate::ObjectParameter > *op, const unsigned int &num, const unsigned int &counter)
const std::vector< ObjectParameter > * objectParameter() const
static const std::string substParamType_
void writeCond2intMap2File()
produces a control output file for condition to integer conversion
bool getSubstParamCommonFromTriggerMenu(const unsigned short int &condChip, L1GtVhdlTemplateFile &particle, const L1GtObject &object, const L1GtConditionCategory &category, std::string ¶meterStr)
builds the parameters particle_common for the cond_chip.vhd's
void printCommonHeader()
prints the common header
static const std::string vhdlTemplateCaloSetup_
L1GtVhdlTemplateFile commonHeader_
common header for all files
void append(const std::string &str)
adds a line at the end of the the file with the content of str
static const std::string substParamDefValId_
const std::vector< ObjectParameter > * objectParameter() const
L1GtConditionCategory
condition categories
void print()
prints the content of the VHDL File (only lines_)
std::string buildDeltaPhiMuon(const L1GtMuonTemplate::CorrelationParameter *&cp, const unsigned int &counter)
void initializeDeltaConditions()
typedef for correlation parameters
std::string getInternalParameter(const std::string &indentifier)
returns a parameter of a internal template file
void writeCondChipPkg(const int &chip)
static const std::string vhdlTemplateEtmSetup_
static const std::string stringConstantCharge3s_
static const std::string vhdlTemplateMuonSetup_
L1GtVhdlTemplateFile retrunCommonHeader()
returns the common header
static const std::string vhdlTemplateCondChipPkg1_
void countCondsAndAdd2NumberVec(const L1GtConditionType &type, const L1GtConditionCategory &category, const L1GtObject &object, const ConditionMap &map, ConditionMap &outputMap, const int &condChip)
const std::vector< ConditionMap > * conditionMap_
condition map
std::string retNumberOfConditionsString(const std::string &typeStr, const int &number)
std::string gtTemplatesPath()
returns the templates path
std::string buildDeltaEtaMuon(const L1GtMuonTemplate::CorrelationParameter *&cp, const unsigned int &counter)
static const std::string quartusSetupFileChip1_
static const std::string outputSubDir1_
void getMuonSetupContentFromTriggerMenu(const unsigned short int &condChip, std::map< std::string, std::string > &muonParameters)
void msg(const std::string &message)
adds a string to intern message buffer
static const std::string stringConstantCalo_
std::vector< std::string > internMessageBuf_
static const std::string outputSubDir2_
std::string outputDir_
output directory
static const std::string stringConstantPth_
bool getCondChipVhdContentFromTriggerMenu(const unsigned short int &condChip, std::map< std::string, L1GtVhdlTemplateFile > &templates, std::map< std::string, std::string > &commonParams)
void getConditionsFromAlgo(std::string condString, std::vector< std::string > &result)
extracts all conditions from a algorithm
static const std::string substParamContent_
static const std::string substParamParticle_
std::map< std::string, int > getCond2IntMap()
const CorrelationParameter * correlationParameter() const
std::string chip2OutputSubDir(const int &chip)
std::string buildDefValString(const int &conditionIndex, const std::vector< int > &values)
static const std::string stringConstantPtl_
static const std::string substParamOthers_
static const std::string vhdlTemplateDefValPkg_
void addJetCountsToCond2IntMap(const int chip, const std::vector< ConditionMap > &conditionMap, std::map< std::string, int > &conditionToIntegerMap)
static const std::string substParamCaloOrMuon_
L1GtVhdlTemplateFile openVhdlFileWithCommonHeader(const std::string &filename, const std::string &outputFilename)
opens a new template file and inserts the common header
void writeMuonSetupVhdl(std::map< std::string, std::string > &muonParameters, const std::string &particle, unsigned short int &condChip)
builds muon setup files
std::string buildPhiEnergySum(const std::vector< L1GtEnergySumTemplate::ObjectParameter > *op, const unsigned int &num, const unsigned int &counter)
std::map< std::string, int > conditionToIntegerMap_
stores to condition name to integer conversion table
static const std::string stringConstantQuality_
static const std::string substParamMaxNr_
std::string buildEtaMuon(const std::vector< L1GtMuonTemplate::ObjectParameter > *op, const unsigned int &num, const unsigned int &counter)
void printConditionsOfCategory(const L1GtConditionCategory &category, const ConditionMap &map)
for debuggin
bool findObjectType(const L1GtObject &object, ConditionMap &map)
std::string buildPhiMuon(const std::vector< L1GtMuonTemplate::ObjectParameter > *op, const unsigned int &num, const unsigned int &counter, bool high)
static const std::string stringConstantCharge1s_
const std::vector< ObjectParameter > * objectParameter() const
const std::map< L1GtObject, std::string > getObj2StrMap()
void buildCommonHeader(std::map< std::string, std::string > &headerParameters, const std::vector< std::string > &connectedChannels)
builds the common header for all files
void writeAlgoSetup(std::vector< std::map< int, std::string > > &algoStrings)
builds the prealgo_and_or setup
static const std::string substParamCharge_
static const std::string stringConstantConstantNr_
bool processAlgorithmMap(std::vector< std::map< int, std::string > > &algoStrings)
bool removeEmptyLines()
deletes all empty lines in a template file
std::map< L1GtObject, std::string > objType2Str_
converts L1GtObject to string
static const std::string vhdlTemplateCondChip_
bool buildDefValuesBuffer(L1GtVhdlTemplateFile &buffer, const std::map< L1GtConditionType, std::string > &typeList, const std::vector< std::string > &defValuesList, const L1GtObject &object)
tuple size
Write out results.
bool open(const std::string &fileName, bool internal=false)
opens a template file. If the header information shall be parsed intern has to be set to true ...
bool debugMode_
class will produce some additional debugging output if set
static const std::string stringConstantCharge2s_
std::vector< std::string > getSubstitutionParametersFromTemplate()
returns a vector with all substitution parameters that are found in the template file ...
static const std::string substParamEsumsDefVals_
const std::map< L1GtObject, std::string > getCalo2IntMap()