#include <L1GtVhdlWriterCore.h>
Public Member Functions | |
void | addJetCountsToCond2IntMap (const int chip, const std::vector< ConditionMap > &conditionMap, std::map< std::string, int > &conditionToIntegerMap) |
void | buildCommonHeader (std::map< std::string, std::string > &headerParameters, const std::vector< std::string > &connectedChannels) |
builds the common header for all files More... | |
std::string | buildDefValString (const int &conditionIndex, const std::vector< int > &values) |
bool | buildDefValuesBuffer (L1GtVhdlTemplateFile &buffer, const std::map< L1GtConditionType, std::string > &typeList, const std::vector< std::string > &defValuesList, const L1GtObject &object) |
std::string | chip2OutputSubDir (const int &chip) |
void | countCondsAndAdd2NumberVec (const L1GtConditionType &type, const L1GtConditionCategory &category, const L1GtObject &object, const ConditionMap &map, ConditionMap &outputMap, const int &condChip) |
bool | findObjectType (const L1GtObject &object, ConditionMap &map) |
bool | getCaloSetupContentFromTriggerMenu (const unsigned short int &condChip, std::map< std::string, std::string > &caloParameters, const L1GtObject &caloObject) |
L1GtConditionCategory | getCategoryFromObject (const L1GtObject &object) |
gets condition category from object More... | |
std::map< std::string, int > | getCond2IntMap () |
bool | getCondChipVhdContentFromTriggerMenu (const unsigned short int &condChip, std::map< std::string, L1GtVhdlTemplateFile > &templates, std::map< std::string, std::string > &commonParams) |
std::string | getDefValsFromTriggerMenu (const L1GtConditionType &type, const L1GtObject &object, const VmeRegister ®) |
bool | getEsumsSetupContentFromTriggerMenu (const unsigned short int &condChip, const L1GtObject &object, std::string &energySumParameter) |
contains only one subsitution parameter which is stored in reference energySumParameter More... | |
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 returns false if not More... | |
std::vector< std::string > | getMsgBuf () |
returns intern message buffer More... | |
void | getMuonSetupContentFromTriggerMenu (const unsigned short int &condChip, std::map< std::string, std::string > &muonParameters) |
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 More... | |
std::string | gtTemplatesPath () |
returns the templates path More... | |
std::string | index4CondChipVhd (int intval) |
void | initializeDeltaConditions () |
L1GtVhdlWriterCore (const std::string &templatesDirectory, const std::string &outputDirectory, const bool &debug) | |
constructor More... | |
bool | makeFirmware (const std::vector< ConditionMap > &conditionMap, const AlgorithmMap &algorithmMap) |
produces the firmware code More... | |
void | msg (const std::string &message) |
adds a string to intern message buffer More... | |
L1GtVhdlTemplateFile | openVhdlFileWithCommonHeader (const std::string &filename, const std::string &outputFilename) |
opens a new template file and inserts the common header More... | |
void | printCommonHeader () |
prints the common header More... | |
void | printConditionsOfCategory (const L1GtConditionCategory &category, const ConditionMap &map) |
for debuggin More... | |
bool | processAlgorithmMap (std::vector< std::map< int, std::string > > &algoStrings) |
std::string | retNumberOfConditionsString (const std::string &typeStr, const int &number) |
L1GtVhdlTemplateFile | retrunCommonHeader () |
returns the common header More... | |
bool | returnConditionsOfOneClass (const L1GtConditionType &type, const L1GtConditionCategory &category, const L1GtObject &object, const ConditionMap &map, ConditionMap &outputMap) |
std::string | sp (const std::string &name) |
converts string name to substiution parameter synthax; name –> More... | |
void | writeAlgoSetup (std::vector< std::map< int, std::string > > &algoStrings) |
builds the prealgo_and_or setup More... | |
void | writeCond2intMap2File () |
produces a control output file for condition to integer conversion More... | |
void | writeCondChipPkg (const int &chip) |
void | writeConditionChipSetup (const std::map< std::string, L1GtVhdlTemplateFile > &templates, const std::map< std::string, std::string > &common, const unsigned short int &chip) |
builds cond_chip.vhds More... | |
void | writeDefValPkg (const std::vector< ConditionMap > &conditionMap, const int &chip) |
writes def_val_pkg.vhd More... | |
void | writeEtmSetup (std::string &etmString, const int &condChip) |
builds etm setup files More... | |
void | writeMuonSetupVhdl (std::map< std::string, std::string > &muonParameters, const std::string &particle, unsigned short int &condChip) |
builds muon setup files More... | |
void | writeQsfSetupFiles (const std::string &version) |
builds the two quartus setup files. This routine is called in buildCommonHeader! More... | |
~L1GtVhdlWriterCore () override | |
destructor More... | |
Public Member Functions inherited from L1GtVhdlDefinitions | |
const std::map< L1GtObject, std::string > | getCalo2IntMap () |
const std::map< L1GtConditionType, std::string > | getCond2StrMap () |
const std::map< L1GtObject, std::string > | getObj2StrMap () |
L1GtVhdlDefinitions () | |
constructor More... | |
std::string | obj2str (const L1GtObject &type) |
converts object type to firmware string More... | |
std::string | type2str (const L1GtConditionType &type) |
converts a condition type to firmware string More... | |
virtual | ~L1GtVhdlDefinitions () |
destructor More... | |
Static Public Member Functions | |
static std::string | int2str (const int &integerValue) |
converts a integer into a string More... | |
Private Attributes | |
const AlgorithmMap * | algorithmMap_ |
algorithm map More... | |
L1GtVhdlWriterBitManager | bm_ |
bit manager for bit operations More... | |
std::vector< L1GtObject > | caloObjects_ |
list of all possible calo objects More... | |
std::map< L1GtObject, std::string > | caloType2Int_ |
converts L1GtObject to calo_nr More... | |
L1GtVhdlTemplateFile | commonHeader_ |
common header for all files More... | |
const std::vector< ConditionMap > * | conditionMap_ |
condition map More... | |
std::map< std::string, int > | conditionToIntegerMap_ |
stores to condition name to integer conversion table More... | |
std::map< L1GtConditionType, std::string > | condType2Str_ |
converts L1GtConditionType to firmware string More... | |
bool | debugMode_ |
class will produce some additional debugging output if set More... | |
std::vector< L1GtObject > | esumObjects_ |
list of all possible esums objects More... | |
std::vector< std::string > | internMessageBuf_ |
std::vector< std::vector< std::string > > | numberOfConditions_ |
vector containing the initialization of all conditions More... | |
std::map< L1GtObject, std::string > | objType2Str_ |
converts L1GtObject to string More... | |
std::string | outputDir_ |
output directory More... | |
std::string | version_ |
std::string | vhdlDir_ |
templates directory More... | |
Additional Inherited Members | |
Public Types inherited from L1GtVhdlDefinitions | |
enum | VmeRegister { RegPtHighThreshold, RegPtLowThreshold, RegQualityRange, RegChargeCorrelation, RegEtThreshold } |
Static Protected Attributes inherited from L1GtVhdlDefinitions | |
static const std::string | outputSubDir1_ |
static const std::string | outputSubDir2_ |
static const std::string | quartusSetupFileChip1_ |
static const std::string | quartusSetupFileChip2_ |
static const std::string | stringConstantAlgo_ |
static const std::string | stringConstantCalo_ |
static const std::string | stringConstantCharge1s_ |
static const std::string | stringConstantCharge2s_ |
static const std::string | stringConstantCharge2wsc_ |
static const std::string | stringConstantCharge3s_ |
static const std::string | stringConstantCharge4s_ |
static const std::string | stringConstantCommon_ |
static const std::string | stringConstantConstantNr_ |
static const std::string | stringConstantDefValId_ |
static const std::string | stringConstantEsumsHigh_ |
static const std::string | stringConstantEsumsLHighDefVal_ |
static const std::string | stringConstantEsumsLow_ |
static const std::string | stringConstantEsumsLowDefVal_ |
static const std::string | stringConstantJetCountsDefVal_ |
static const std::string | stringConstantPth_ |
static const std::string | stringConstantPtHighDefVal_ |
static const std::string | stringConstantPtl_ |
static const std::string | stringConstantPtLowDefVal_ |
static const std::string | stringConstantQuality_ |
static const std::string | stringConstantQualityDefVal_ |
static const std::string | stringConstantQuargeDefVal_ |
static const std::string | substParamAlgos_ |
static const std::string | substParamCaloDefVals_ |
static const std::string | substParamCaloOrMuon_ |
static const std::string | substParamCharge_ |
static const std::string | substParamContent_ |
static const std::string | substParamDefValId_ |
static const std::string | substParamDefValType_ |
static const std::string | substParamEsumsDefVals_ |
static const std::string | substParamJetCntsCommon_ |
static const std::string | substParamJetsDefVals_ |
static const std::string | substParamMaxNr_ |
static const std::string | substParamMuonDefVals_ |
static const std::string | substParamOthers_ |
static const std::string | substParamParticle_ |
static const std::string | substParamType_ |
static const std::string | vhdlTemplateAlgoAndOr_ |
static const std::string | vhdlTemplateCaloSetup_ |
static const std::string | vhdlTemplateCondChip_ |
static const std::string | vhdlTemplateCondChipPkg1_ |
static const std::string | vhdlTemplateCondChipPkg2_ |
static const std::string | vhdlTemplateDefValPkg_ |
static const std::string | vhdlTemplateEtmSetup_ |
static const std::string | vhdlTemplateMuonSetup_ |
writes the actual VHDL code and stores global information like the common header. This class is using parameter maps containing the substitution parameters and their content.
Implementation: <TODO: enter implementation details>
Description: a class to deal with VHDL template files
Implementation: <TODO: enter implementation details>
Definition at line 42 of file L1GtVhdlWriterCore.h.
L1GtVhdlWriterCore::L1GtVhdlWriterCore | ( | const std::string & | templatesDirectory, |
const std::string & | outputDirectory, | ||
const bool & | debug | ||
) |
constructor
Definition at line 49 of file L1GtVhdlWriterCore.cc.
References caloObjects_, caloType2Int_, CenJet, condType2Str_, debug, debugMode_, esumObjects_, ETM, ETT, ForJet, L1GtVhdlDefinitions::getCalo2IntMap(), L1GtVhdlDefinitions::getCond2StrMap(), L1GtVhdlDefinitions::getObj2StrMap(), HTT, IsoEG, NoIsoEG, numberOfConditions_, objType2Str_, outputDir_, TauJet, groupFilesInBlocks::temp, and vhdlDir_.
|
override |
void L1GtVhdlWriterCore::addJetCountsToCond2IntMap | ( | const int | chip, |
const std::vector< ConditionMap > & | conditionMap, | ||
std::map< std::string, int > & | conditionToIntegerMap | ||
) |
calculates the integer value for jet counts conditions and furthermore counts how many jet counts of one type are in trigger menu
Definition at line 1377 of file L1GtVhdlWriterCore.cc.
References CondJetCounts, counter, mps_fire::i, int2str(), JetCounts, numberOfConditions_, L1GtJetCountsTemplate::objectParameter(), retNumberOfConditionsString(), returnConditionsOfOneClass(), and TypeJetCounts.
Referenced by makeFirmware().
void L1GtVhdlWriterCore::buildCommonHeader | ( | std::map< std::string, std::string > & | headerParameters, |
const std::vector< std::string > & | connectedChannels | ||
) |
builds the common header for all files
Definition at line 1039 of file L1GtVhdlWriterCore.cc.
References commonHeader_, L1GtVhdlTemplateFile::insert(), msg(), L1GtVhdlTemplateFile::open(), L1GtVhdlTemplateFile::substitute(), version_, and vhdlDir_.
Referenced by L1GtVhdlWriter::analyze().
std::string L1GtVhdlWriterCore::buildDefValString | ( | const int & | conditionIndex, |
const std::vector< int > & | values | ||
) |
builds the string representing a condition in def_val_pkg.vhd. Parameters are condition index and a vector containig default values.
Definition at line 1474 of file L1GtVhdlWriterCore.cc.
bool L1GtVhdlWriterCore::buildDefValuesBuffer | ( | L1GtVhdlTemplateFile & | buffer, |
const std::map< L1GtConditionType, std::string > & | typeList, | ||
const std::vector< std::string > & | defValuesList, | ||
const L1GtObject & | object | ||
) |
helper, used by writeDefValPkg. Builds default values buffer for each object type. this buffer finally is inserte in the def_val_pkg.vhd template file
Definition at line 1661 of file L1GtVhdlWriterCore.cc.
References L1GtVhdlTemplateFile::append(), condType2Str_, ws_sso_content_reader::content, ETM, ETT, L1GtVhdlTemplateFile::findAndReplaceString(), getDefValsFromTriggerMenu(), L1GtVhdlTemplateFile::getInternalParameter(), HTT, mps_fire::i, JetCounts, Mu, objType2Str_, L1GtVhdlTemplateFile::open(), L1GtVhdlDefinitions::RegEtThreshold, sp(), AlCaHLTBitMon_QueryRunRegistry::string, L1GtVhdlDefinitions::stringConstantCalo_, L1GtVhdlDefinitions::stringConstantDefValId_, L1GtVhdlTemplateFile::substitute(), L1GtVhdlDefinitions::substParamCaloOrMuon_, L1GtVhdlDefinitions::substParamContent_, L1GtVhdlDefinitions::substParamDefValId_, L1GtVhdlDefinitions::substParamDefValType_, L1GtVhdlDefinitions::substParamMaxNr_, L1GtVhdlDefinitions::substParamOthers_, L1GtVhdlDefinitions::substParamParticle_, L1GtVhdlDefinitions::substParamType_, and vhdlDir_.
Referenced by writeDefValPkg().
std::string L1GtVhdlWriterCore::chip2OutputSubDir | ( | const int & | chip | ) |
Definition at line 900 of file L1GtVhdlWriterCore.cc.
References outputDir_, L1GtVhdlDefinitions::outputSubDir1_, and L1GtVhdlDefinitions::outputSubDir2_.
Referenced by writeAlgoSetup(), writeCond2intMap2File(), writeCondChipPkg(), writeConditionChipSetup(), writeDefValPkg(), writeEtmSetup(), writeMuonSetupVhdl(), and writeQsfSetupFiles().
void L1GtVhdlWriterCore::countCondsAndAdd2NumberVec | ( | const L1GtConditionType & | type, |
const L1GtConditionCategory & | category, | ||
const L1GtObject & | object, | ||
const ConditionMap & | map, | ||
ConditionMap & | outputMap, | ||
const int & | condChip | ||
) |
returns conditions of a class in output map and counts the occurance of all conditions of a certain type at the same time with the result being stored in numberOfConditions_ in the following format: CONSTANT nr_muon_3 : integer := 0; Tis is the format for the cond_chip_pkg files.
Definition at line 1766 of file L1GtVhdlWriterCore.cc.
References condType2Str_, numberOfConditions_, objType2Str_, retNumberOfConditionsString(), returnConditionsOfOneClass(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by getCaloSetupContentFromTriggerMenu(), getEsumsSetupContentFromTriggerMenu(), and getMuonSetupContentFromTriggerMenu().
bool L1GtVhdlWriterCore::findObjectType | ( | const L1GtObject & | object, |
ConditionMap & | map | ||
) |
Definition at line 116 of file L1GtVhdlWriterCore.cc.
References mps_fire::i, resolutioncreator_cfi::object, findQualityFiles::size, and mps_update::status.
bool L1GtVhdlWriterCore::getCaloSetupContentFromTriggerMenu | ( | const unsigned short int & | condChip, |
std::map< std::string, std::string > & | caloParameters, | ||
const L1GtObject & | caloObject | ||
) |
Definition at line 316 of file L1GtVhdlWriterCore.cc.
References bm_, L1GtVhdlWriterBitManager::buildDeltaEtaCalo(), L1GtVhdlWriterBitManager::buildDeltaPhiCalo(), L1GtVhdlWriterBitManager::buildEtaCalo(), L1GtVhdlWriterBitManager::buildPhiCalo(), CondCalo, conditionToIntegerMap_, L1GtCaloTemplate::correlationParameter(), countCondsAndAdd2NumberVec(), counter, SimDataFormats::CaloAnalysis::cp, debugMode_, mps_fire::i, L1GtCaloTemplate::objectParameter(), Type1s, Type2s, Type2wsc, and Type4s.
Referenced by makeFirmware().
L1GtConditionCategory L1GtVhdlWriterCore::getCategoryFromObject | ( | const L1GtObject & | object | ) |
gets condition category from object
Definition at line 1833 of file L1GtVhdlWriterCore.cc.
References python.rootplot.argparse::category, CenJet, CondCalo, CondEnergySum, CondJetCounts, CondMuon, CondNull, ETM, ETT, ForJet, HTT, IsoEG, JetCounts, Mu, NoIsoEG, and TauJet.
Referenced by getDefValsFromTriggerMenu().
std::map< std::string, int > L1GtVhdlWriterCore::getCond2IntMap | ( | ) |
Definition at line 1909 of file L1GtVhdlWriterCore.cc.
References conditionToIntegerMap_.
Referenced by L1GtVhdlWriter::analyze().
bool L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu | ( | const unsigned short int & | condChip, |
std::map< std::string, L1GtVhdlTemplateFile > & | templates, | ||
std::map< std::string, std::string > & | commonParams | ||
) |
builds the substitution parameters for the cond_chip.vhd the condition chip that will be processed
conditionToIntegerMap | this has to be a already FILLED conversion map. therefore this routine has to be called after all those which are adding information to the conditionToIntegerMap map (getMuonSetupContentFromTriggerMenu, buildCaloParameterMap...) |
templates | in this map the final content for the subsitution parameters is stored in VHDL template file format |
Definition at line 528 of file L1GtVhdlWriterCore.cc.
References L1GtVhdlTemplateFile::append(), caloObjects_, caloType2Int_, CondCalo, CondCorrelation, CondEnergySum, conditionToIntegerMap_, CondJetCounts, CondMuon, CondNull, condType2Str_, esumObjects_, ETM, spr::find(), L1GtVhdlTemplateFile::findAndReplaceString(), L1GtVhdlTemplateFile::getInternalParameter(), getIntVal(), getSubstParamCommonFromTriggerMenu(), mps_fire::i, index4CondChipVhd(), int2str(), metsig::jet, JetCounts, msg(), Mu, metsig::muon, L1GtCondition::nrObjects(), L1GtJetCountsTemplate::objectParameter(), objType2Str_, L1GtVhdlTemplateFile::open(), AlCaHLTBitMon_ParallelJobs::p, L1GtVhdlTemplateFile::removeEmptyLines(), L1GtVhdlTemplateFile::returnParameterMap(), sp(), AlCaHLTBitMon_QueryRunRegistry::string, L1GtVhdlDefinitions::stringConstantCharge1s_, L1GtVhdlDefinitions::stringConstantCharge2s_, L1GtVhdlDefinitions::stringConstantCharge2wsc_, L1GtVhdlDefinitions::stringConstantCharge3s_, L1GtVhdlDefinitions::stringConstantCharge4s_, L1GtVhdlDefinitions::stringConstantCommon_, L1GtVhdlTemplateFile::substitute(), L1GtVhdlDefinitions::substParamCharge_, L1GtVhdlDefinitions::substParamJetCntsCommon_, L1GtVhdlDefinitions::substParamParticle_, L1GtVhdlDefinitions::substParamType_, Type1s, Type2s, Type2wsc, Type3s, Type4s, and vhdlDir_.
Referenced by makeFirmware().
std::string L1GtVhdlWriterCore::getDefValsFromTriggerMenu | ( | const L1GtConditionType & | type, |
const L1GtObject & | object, | ||
const VmeRegister & | reg | ||
) |
this routine extracts default values for def_val_pkg.vhd from trigger menu. it is used from buildDefValuesBuffer.
Definition at line 1482 of file L1GtVhdlWriterCore.cc.
References python.rootplot.argparse::category, CondCalo, getCategoryFromObject(), mps_fire::i, int2str(), L1GtCaloTemplate::objectParameter(), mps_fire::result, returnConditionsOfOneClass(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by buildDefValuesBuffer().
bool L1GtVhdlWriterCore::getEsumsSetupContentFromTriggerMenu | ( | const unsigned short int & | condChip, |
const L1GtObject & | object, | ||
std::string & | energySumParameter | ||
) |
contains only one subsitution parameter which is stored in reference energySumParameter
Definition at line 436 of file L1GtVhdlWriterCore.cc.
References bm_, L1GtVhdlWriterBitManager::buildPhiEnergySum(), CondEnergySum, conditionToIntegerMap_, countCondsAndAdd2NumberVec(), debugMode_, ETM, ETT, HTT, L1GtEnergySumTemplate::objectParameter(), TypeETM, TypeETT, and TypeHTT.
Referenced by makeFirmware().
bool L1GtVhdlWriterCore::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 returns false if not
Definition at line 1361 of file L1GtVhdlWriterCore.cc.
Referenced by getCondChipVhdContentFromTriggerMenu().
std::vector< std::string > L1GtVhdlWriterCore::getMsgBuf | ( | ) |
returns intern message buffer
Definition at line 1356 of file L1GtVhdlWriterCore.cc.
References internMessageBuf_.
void L1GtVhdlWriterCore::getMuonSetupContentFromTriggerMenu | ( | const unsigned short int & | condChip, |
std::map< std::string, std::string > & | muonParameters | ||
) |
builds a parameter map that can be used by the L1GtVhdlWriterCore class the output is written into the parameter
conditionToIntegerMap | is the condition is added to this conversion map |
muonParameters | here the routine stores the content of the subsitution parameters |
conditionMap | containing the input |
Definition at line 141 of file L1GtVhdlWriterCore.cc.
References bm_, L1GtVhdlWriterBitManager::buildDeltaEtaMuon(), L1GtVhdlWriterBitManager::buildDeltaPhiMuon(), L1GtVhdlWriterBitManager::buildEtaMuon(), L1GtVhdlWriterBitManager::buildPhiMuon(), conditionToIntegerMap_, CondMuon, L1GtMuonTemplate::correlationParameter(), countCondsAndAdd2NumberVec(), counter, SimDataFormats::CaloAnalysis::cp, debugMode_, mps_fire::i, Mu, L1GtMuonTemplate::objectParameter(), Type1s, Type2s, Type2wsc, Type3s, and Type4s.
Referenced by makeFirmware().
bool L1GtVhdlWriterCore::getSubstParamCommonFromTriggerMenu | ( | const unsigned short int & | condChip, |
L1GtVhdlTemplateFile & | particle, | ||
const L1GtObject & | object, | ||
const L1GtConditionCategory & | category, | ||
std::string & | parameterStr | ||
) |
builds the parameters particle_common for the cond_chip.vhd's
Definition at line 482 of file L1GtVhdlWriterCore.cc.
References condType2Str_, L1GtVhdlTemplateFile::findAndReplaceString(), JetCounts, objType2Str_, returnConditionsOfOneClass(), L1GtVhdlTemplateFile::returnParameterMap(), sp(), AlCaHLTBitMon_QueryRunRegistry::string, L1GtVhdlDefinitions::stringConstantCommon_, L1GtVhdlDefinitions::substParamParticle_, and L1GtVhdlDefinitions::substParamType_.
Referenced by getCondChipVhdContentFromTriggerMenu().
std::string L1GtVhdlWriterCore::gtTemplatesPath | ( | ) |
returns the templates path
Definition at line 1026 of file L1GtVhdlWriterCore.cc.
References vhdlDir_.
std::string L1GtVhdlWriterCore::index4CondChipVhd | ( | int | intval | ) |
builds the index for the cond_chip vhds. (They have to start at 1 so one has to be added to the value in conversion map)
Definition at line 1371 of file L1GtVhdlWriterCore.cc.
References int2str().
Referenced by getCondChipVhdContentFromTriggerMenu().
void L1GtVhdlWriterCore::initializeDeltaConditions | ( | ) |
Definition at line 1788 of file L1GtVhdlWriterCore.cc.
References caloObjects_, ETM, mps_fire::i, gen::k, Mu, numberOfConditions_, objType2Str_, and retNumberOfConditionsString().
Referenced by makeFirmware().
|
static |
converts a integer into a string
Definition at line 1031 of file L1GtVhdlWriterCore.cc.
Referenced by addJetCountsToCond2IntMap(), getCondChipVhdContentFromTriggerMenu(), getDefValsFromTriggerMenu(), index4CondChipVhd(), printConditionsOfCategory(), retNumberOfConditionsString(), writeAlgoSetup(), writeConditionChipSetup(), writeDefValPkg(), writeEtmSetup(), and L1GtVmeWriterCore::writeVME().
bool L1GtVhdlWriterCore::makeFirmware | ( | const std::vector< ConditionMap > & | conditionMap, |
const AlgorithmMap & | algorithmMap | ||
) |
produces the firmware code
Definition at line 911 of file L1GtVhdlWriterCore.cc.
References addJetCountsToCond2IntMap(), algorithmMap_, caloObjects_, eostools::chmod(), trackingPlots::common, conditionMap_, conditionToIntegerMap_, debugMode_, esumObjects_, getCaloSetupContentFromTriggerMenu(), getCondChipVhdContentFromTriggerMenu(), getEsumsSetupContentFromTriggerMenu(), getMuonSetupContentFromTriggerMenu(), mps_fire::i, initializeDeltaConditions(), eostools::mkdir(), objType2Str_, outputDir_, L1GtVhdlDefinitions::outputSubDir1_, L1GtVhdlDefinitions::outputSubDir2_, processAlgorithmMap(), AlCaHLTBitMon_QueryRunRegistry::string, PixelCPETemplateReco_cfi::templates, version_, writeAlgoSetup(), writeCond2intMap2File(), writeCondChipPkg(), writeConditionChipSetup(), writeDefValPkg(), writeEtmSetup(), writeMuonSetupVhdl(), and writeQsfSetupFiles().
Referenced by L1GtVhdlWriter::analyze().
void L1GtVhdlWriterCore::msg | ( | const std::string & | message | ) |
adds a string to intern message buffer
Definition at line 1351 of file L1GtVhdlWriterCore.cc.
References internMessageBuf_.
Referenced by buildCommonHeader(), getCondChipVhdContentFromTriggerMenu(), printConditionsOfCategory(), and processAlgorithmMap().
L1GtVhdlTemplateFile L1GtVhdlWriterCore::openVhdlFileWithCommonHeader | ( | const std::string & | filename, |
const std::string & | outputFilename | ||
) |
opens a new template file and inserts the common header
Definition at line 1068 of file L1GtVhdlWriterCore.cc.
References commonHeader_, L1GtVhdlTemplateFile::insert(), L1GtVhdlTemplateFile::substitute(), and vhdlDir_.
Referenced by writeAlgoSetup(), writeCondChipPkg(), writeConditionChipSetup(), writeDefValPkg(), writeEtmSetup(), and writeMuonSetupVhdl().
void L1GtVhdlWriterCore::printCommonHeader | ( | ) |
prints the common header
Definition at line 1314 of file L1GtVhdlWriterCore.cc.
References commonHeader_, and L1GtVhdlTemplateFile::print().
void L1GtVhdlWriterCore::printConditionsOfCategory | ( | const L1GtConditionCategory & | category, |
const ConditionMap & | map | ||
) |
for debuggin
Definition at line 1858 of file L1GtVhdlWriterCore.cc.
References int2str(), and msg().
bool L1GtVhdlWriterCore::processAlgorithmMap | ( | std::vector< std::map< int, std::string > > & | algoStrings | ) |
processes algorithm map delivered by parser, replaces condition names by types and serial numbers, splits the map in a vector two seperate ones for the two condition chips
Definition at line 822 of file L1GtVhdlWriterCore.cc.
References conditionMap_, conditionToIntegerMap_, L1GtCondition::condType(), condType2Str_, debugMode_, L1GtVhdlTemplateFile::findAndReplaceString(), L1GtVhdlTemplateFile::getConditionsFromAlgo(), mps_fire::i, msg(), L1GtCondition::objectType(), objType2Str_, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by makeFirmware().
std::string L1GtVhdlWriterCore::retNumberOfConditionsString | ( | const std::string & | typeStr, |
const int & | number | ||
) |
Definition at line 1900 of file L1GtVhdlWriterCore.cc.
References int2str(), AlCaHLTBitMon_QueryRunRegistry::string, and L1GtVhdlDefinitions::stringConstantConstantNr_.
Referenced by addJetCountsToCond2IntMap(), countCondsAndAdd2NumberVec(), and initializeDeltaConditions().
L1GtVhdlTemplateFile L1GtVhdlWriterCore::retrunCommonHeader | ( | ) |
returns the common header
Definition at line 1319 of file L1GtVhdlWriterCore.cc.
References commonHeader_.
Referenced by L1GtVhdlWriter::analyze().
bool L1GtVhdlWriterCore::returnConditionsOfOneClass | ( | const L1GtConditionType & | type, |
const L1GtConditionCategory & | category, | ||
const L1GtObject & | object, | ||
const ConditionMap & | map, | ||
ConditionMap & | outputMap | ||
) |
returns all condition of the same class. Conditions belong to one class if they are matching in type (Type1s, Type2s..) category (CondMuon, CondCalo,)and are defined for the same object (Mu, fwdJet..)
map | is the ConditionMap that shall be filtered |
conditionToIntegerMap | is the condition is added to this conversion map |
outputMap | here the conditions matching the requirements are stored |
Definition at line 93 of file L1GtVhdlWriterCore.cc.
References mps_update::status.
Referenced by addJetCountsToCond2IntMap(), countCondsAndAdd2NumberVec(), getDefValsFromTriggerMenu(), and getSubstParamCommonFromTriggerMenu().
std::string L1GtVhdlWriterCore::sp | ( | const std::string & | name | ) |
converts string name to substiution parameter synthax; name –>
Definition at line 1914 of file L1GtVhdlWriterCore.cc.
Referenced by buildDefValuesBuffer(), getCondChipVhdContentFromTriggerMenu(), getSubstParamCommonFromTriggerMenu(), and writeDefValPkg().
void L1GtVhdlWriterCore::writeAlgoSetup | ( | std::vector< std::map< int, std::string > > & | algoStrings | ) |
builds the prealgo_and_or setup
Definition at line 1247 of file L1GtVhdlWriterCore.cc.
References edmScanValgrind::buffer, chip2OutputSubDir(), eostools::chmod(), corrVsCorr::filename, L1GtVhdlTemplateFile::findAndReplaceString(), mps_fire::i, int2str(), gen::k, openVhdlFileWithCommonHeader(), postProcessorL1Gen_cff::outputFileName, L1GtVhdlTemplateFile::save(), AlCaHLTBitMon_QueryRunRegistry::string, L1GtVhdlDefinitions::stringConstantAlgo_, L1GtVhdlTemplateFile::substitute(), L1GtVhdlDefinitions::substParamAlgos_, indexGen::templateFile, and L1GtVhdlDefinitions::vhdlTemplateAlgoAndOr_.
Referenced by makeFirmware().
void L1GtVhdlWriterCore::writeCond2intMap2File | ( | ) |
produces a control output file for condition to integer conversion
Definition at line 1427 of file L1GtVhdlWriterCore.cc.
References chip2OutputSubDir(), eostools::chmod(), conditionMap_, conditionToIntegerMap_, corrVsCorr::filename, mps_fire::i, download_sqlite_cfg::outputFile, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by makeFirmware().
void L1GtVhdlWriterCore::writeCondChipPkg | ( | const int & | chip | ) |
Definition at line 1873 of file L1GtVhdlWriterCore.cc.
References chip2OutputSubDir(), eostools::chmod(), corrVsCorr::filename, L1GtVhdlTemplateFile::findAndReplaceString(), L1GtVhdlTemplateFile::insert(), numberOfConditions_, openVhdlFileWithCommonHeader(), L1GtVhdlTemplateFile::save(), AlCaHLTBitMon_QueryRunRegistry::string, L1GtVhdlTemplateFile::substitute(), version_, L1GtVhdlDefinitions::vhdlTemplateCondChipPkg1_, and L1GtVhdlDefinitions::vhdlTemplateCondChipPkg2_.
Referenced by makeFirmware().
void L1GtVhdlWriterCore::writeConditionChipSetup | ( | const std::map< std::string, L1GtVhdlTemplateFile > & | templates, |
const std::map< std::string, std::string > & | common, | ||
const unsigned short int & | chip | ||
) |
builds cond_chip.vhds
Definition at line 1202 of file L1GtVhdlWriterCore.cc.
References chip2OutputSubDir(), eostools::chmod(), corrVsCorr::filename, L1GtVhdlTemplateFile::findAndReplaceString(), L1GtVhdlTemplateFile::insert(), int2str(), openVhdlFileWithCommonHeader(), postProcessorL1Gen_cff::outputFileName, L1GtVhdlTemplateFile::save(), AlCaHLTBitMon_QueryRunRegistry::string, L1GtVhdlTemplateFile::substitute(), and L1GtVhdlDefinitions::vhdlTemplateCondChip_.
Referenced by makeFirmware().
void L1GtVhdlWriterCore::writeDefValPkg | ( | const std::vector< ConditionMap > & | conditionMap, |
const int & | chip | ||
) |
writes def_val_pkg.vhd
Definition at line 1530 of file L1GtVhdlWriterCore.cc.
References buildDefValuesBuffer(), caloObjects_, chip2OutputSubDir(), eostools::chmod(), condType2Str_, esumObjects_, corrVsCorr::filename, L1GtVhdlTemplateFile::findAndReplaceString(), L1GtVhdlTemplateFile::getInternalParameter(), mps_fire::i, L1GtVhdlTemplateFile::insert(), int2str(), JetCounts, Mu, L1GtVhdlTemplateFile::open(), openVhdlFileWithCommonHeader(), download_sqlite_cfg::outputFile, L1GtVhdlTemplateFile::save(), sp(), AlCaHLTBitMon_QueryRunRegistry::string, L1GtVhdlDefinitions::stringConstantEsumsHigh_, L1GtVhdlDefinitions::stringConstantEsumsLow_, L1GtVhdlDefinitions::stringConstantPth_, L1GtVhdlDefinitions::stringConstantPtl_, L1GtVhdlDefinitions::stringConstantQuality_, L1GtVhdlDefinitions::substParamCaloDefVals_, L1GtVhdlDefinitions::substParamCharge_, L1GtVhdlDefinitions::substParamEsumsDefVals_, L1GtVhdlDefinitions::substParamJetsDefVals_, L1GtVhdlDefinitions::substParamMuonDefVals_, Type2cor, Type3s, TypeETM, TypeETT, TypeHTT, TypeJetCounts, vhdlDir_, and L1GtVhdlDefinitions::vhdlTemplateDefValPkg_.
Referenced by makeFirmware().
void L1GtVhdlWriterCore::writeEtmSetup | ( | std::string & | etmString, |
const int & | condChip | ||
) |
builds etm setup files
Definition at line 1283 of file L1GtVhdlWriterCore.cc.
References chip2OutputSubDir(), eostools::chmod(), corrVsCorr::filename, L1GtVhdlTemplateFile::findAndReplaceString(), int2str(), openVhdlFileWithCommonHeader(), download_sqlite_cfg::outputFile, L1GtVhdlTemplateFile::save(), AlCaHLTBitMon_QueryRunRegistry::string, L1GtVhdlTemplateFile::substitute(), and L1GtVhdlDefinitions::vhdlTemplateEtmSetup_.
Referenced by makeFirmware().
void L1GtVhdlWriterCore::writeMuonSetupVhdl | ( | std::map< std::string, std::string > & | muonParameters, |
const std::string & | particle, | ||
unsigned short int & | condChip | ||
) |
builds muon setup files
Definition at line 1082 of file L1GtVhdlWriterCore.cc.
References L1GtVhdlTemplateFile::append(), chip2OutputSubDir(), eostools::chmod(), corrVsCorr::filename, L1GtVhdlTemplateFile::findAndReplaceString(), L1GtVhdlTemplateFile::getSubstitutionParametersFromTemplate(), mps_fire::i, L1GtVhdlTemplateFile::insert(), L1GtVhdlTemplateFile::open(), openVhdlFileWithCommonHeader(), download_sqlite_cfg::outputFile, L1GtVhdlTemplateFile::removeLineWithContent(), L1GtVhdlTemplateFile::returnParameterMap(), L1GtVhdlTemplateFile::save(), AlCaHLTBitMon_QueryRunRegistry::string, L1GtVhdlTemplateFile::substitute(), vhdlDir_, L1GtVhdlDefinitions::vhdlTemplateCaloSetup_, and L1GtVhdlDefinitions::vhdlTemplateMuonSetup_.
Referenced by makeFirmware().
void L1GtVhdlWriterCore::writeQsfSetupFiles | ( | const std::string & | version | ) |
builds the two quartus setup files. This routine is called in buildCommonHeader!
Definition at line 1324 of file L1GtVhdlWriterCore.cc.
References chip2OutputSubDir(), eostools::chmod(), cmsPerfCommons::filenames, L1GtVhdlTemplateFile::findAndReplaceString(), mps_fire::i, L1GtVhdlTemplateFile::open(), L1GtVhdlDefinitions::quartusSetupFileChip1_, L1GtVhdlDefinitions::quartusSetupFileChip2_, L1GtVhdlTemplateFile::save(), AlCaHLTBitMon_QueryRunRegistry::string, L1GtVhdlTemplateFile::substitute(), and vhdlDir_.
Referenced by makeFirmware().
|
private |
|
private |
bit manager for bit operations
Definition at line 224 of file L1GtVhdlWriterCore.h.
Referenced by getCaloSetupContentFromTriggerMenu(), getEsumsSetupContentFromTriggerMenu(), and getMuonSetupContentFromTriggerMenu().
|
private |
list of all possible calo objects
Definition at line 212 of file L1GtVhdlWriterCore.h.
Referenced by getCondChipVhdContentFromTriggerMenu(), initializeDeltaConditions(), L1GtVhdlWriterCore(), makeFirmware(), and writeDefValPkg().
|
private |
converts L1GtObject to calo_nr
Definition at line 206 of file L1GtVhdlWriterCore.h.
Referenced by getCondChipVhdContentFromTriggerMenu(), and L1GtVhdlWriterCore().
|
private |
common header for all files
Definition at line 229 of file L1GtVhdlWriterCore.h.
Referenced by buildCommonHeader(), openVhdlFileWithCommonHeader(), printCommonHeader(), and retrunCommonHeader().
|
private |
condition map
Definition at line 194 of file L1GtVhdlWriterCore.h.
Referenced by makeFirmware(), processAlgorithmMap(), and writeCond2intMap2File().
|
private |
stores to condition name to integer conversion table
Definition at line 200 of file L1GtVhdlWriterCore.h.
Referenced by getCaloSetupContentFromTriggerMenu(), getCond2IntMap(), getCondChipVhdContentFromTriggerMenu(), getEsumsSetupContentFromTriggerMenu(), getMuonSetupContentFromTriggerMenu(), makeFirmware(), processAlgorithmMap(), and writeCond2intMap2File().
|
private |
converts L1GtConditionType to firmware string
Definition at line 203 of file L1GtVhdlWriterCore.h.
Referenced by buildDefValuesBuffer(), countCondsAndAdd2NumberVec(), getCondChipVhdContentFromTriggerMenu(), getSubstParamCommonFromTriggerMenu(), L1GtVhdlWriterCore(), processAlgorithmMap(), and writeDefValPkg().
|
private |
class will produce some additional debugging output if set
Definition at line 237 of file L1GtVhdlWriterCore.h.
Referenced by getCaloSetupContentFromTriggerMenu(), getEsumsSetupContentFromTriggerMenu(), getMuonSetupContentFromTriggerMenu(), L1GtVhdlWriterCore(), makeFirmware(), and processAlgorithmMap().
|
private |
list of all possible esums objects
Definition at line 215 of file L1GtVhdlWriterCore.h.
Referenced by getCondChipVhdContentFromTriggerMenu(), L1GtVhdlWriterCore(), makeFirmware(), and writeDefValPkg().
|
private |
Definition at line 231 of file L1GtVhdlWriterCore.h.
Referenced by getMsgBuf(), and msg().
|
private |
vector containing the initialization of all conditions
Definition at line 234 of file L1GtVhdlWriterCore.h.
Referenced by addJetCountsToCond2IntMap(), countCondsAndAdd2NumberVec(), initializeDeltaConditions(), L1GtVhdlWriterCore(), and writeCondChipPkg().
|
private |
converts L1GtObject to string
Definition at line 209 of file L1GtVhdlWriterCore.h.
Referenced by buildDefValuesBuffer(), countCondsAndAdd2NumberVec(), getCondChipVhdContentFromTriggerMenu(), getSubstParamCommonFromTriggerMenu(), initializeDeltaConditions(), L1GtVhdlWriterCore(), makeFirmware(), and processAlgorithmMap().
|
private |
output directory
Definition at line 221 of file L1GtVhdlWriterCore.h.
Referenced by chip2OutputSubDir(), L1GtVhdlWriterCore(), makeFirmware(), batchmanager.BatchManager::PrepareJob(), and valtools.webpage::readCaptions().
|
private |
Definition at line 226 of file L1GtVhdlWriterCore.h.
Referenced by buildCommonHeader(), makeFirmware(), and writeCondChipPkg().
|
private |
templates directory
Definition at line 218 of file L1GtVhdlWriterCore.h.
Referenced by buildCommonHeader(), buildDefValuesBuffer(), getCondChipVhdContentFromTriggerMenu(), gtTemplatesPath(), L1GtVhdlWriterCore(), openVhdlFileWithCommonHeader(), writeDefValPkg(), writeMuonSetupVhdl(), and writeQsfSetupFiles().