23 #include "boost/filesystem.hpp" 49 if (outputDir_[outputDir_.length() - 1] !=
'/')
60 edm::LogInfo(
"L1GtConfigProducers") <<
"\n\nL1 GT VHDL directory: " <<
vhdlDir_ <<
"\n\n" << std::endl;
73 std::vector<ConditionMap> conditionMap = l1GtMenu->
gtConditionMap();
77 int printVerbosity = 0;
83 std::map<std::string, std::string> headerParameters;
84 std::vector<std::string> channelVector;
86 headerParameters[
"vhdl_path"] =
"/vhdllibrarypath";
87 headerParameters[
"designer_date"] =
"20.05.1986";
88 headerParameters[
"designer_name"] =
"Philipp Wagner";
89 headerParameters[
"version"] =
"2.0";
90 headerParameters[
"designer_comments"] =
"produced in CMSSW";
91 headerParameters[
"gtl_setup_name"] =
"L1Menu2007NovGR";
93 channelVector.push_back(
"-- ca1: ieg");
94 channelVector.push_back(
"-- ca2: eg");
95 channelVector.push_back(
"-- ca3: jet");
96 channelVector.push_back(
"-- ca4: fwdjet");
97 channelVector.push_back(
"-- ca5: tau");
98 channelVector.push_back(
"-- ca6: esums");
99 channelVector.push_back(
"-- ca7: jet_cnts");
100 channelVector.push_back(
"-- ca8: free");
101 channelVector.push_back(
"-- ca9: free");
102 channelVector.push_back(
"-- ca10: free");
105 if (boost::filesystem::is_directory(
outputDir_)) {
106 std::cout << std::endl <<
"Ok - Output directory exists!" << std::endl;
109 std::cout << std::endl <<
"Directory: " <<
outputDir_ <<
" has been created!" << std::endl;
111 std::cout << std::endl <<
"Error while creating directory: " <<
outputDir_ <<
" !" << std::endl;
118 if (vhdlWriter.
makeFirmware(conditionMap, algorithmMap)) {
121 <<
"*********************** I'm ready ;-) **************************" << std::endl
123 <<
"You can find the firmware in dircetory: " <<
outputDir_ << std::endl
125 <<
"******************************************************************" << std::endl;
T getParameter(std::string const &) const
L1GtVhdlWriter(const edm::ParameterSet &)
constructor
std::string outputDir_
output directory
std::string vhdlDir_
templates directory
void writeVME(const std::vector< ConditionMap > &conditionMap, const std::map< std::string, int > &cond2intMap, const L1GtVhdlTemplateFile &header, const int spacesPerLevel=2)
bool makeFirmware(const std::vector< ConditionMap > &conditionMap, const AlgorithmMap &algorithmMap)
produces the firmware code
void analyze(const edm::Event &, const edm::EventSetup &) override
L1GtVhdlTemplateFile retrunCommonHeader()
returns the common header
std::map< std::string, int > getCond2IntMap()
void buildCommonHeader(std::map< std::string, std::string > &headerParameters, const std::vector< std::string > &connectedChannels)
builds the common header for all files
~L1GtVhdlWriter() override
destructor