CMS 3D CMS Logo

L1GtVhdlWriterCore Class Reference

writes the actual VHDL code and stores global information like the common header. More...

#include <L1TriggerConfig/L1GtConfigProducers/interface/L1GtVhdlWriterCore.h>

Inheritance diagram for L1GtVhdlWriterCore:

L1GtVhdlDefinitions

List of all members.

Public Member Functions

void 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
void buildCommonHeader (std::map< std::string, std::string > &headerParameters, const std::vector< std::string > &connectedChannels)
 builds the common header for all files
std::string buildDefValString (const int &conditionIndex, const std::vector< int > &values)
 builds the string representing a condition in def_val_pkg.vhd.
bool buildDefValuesBuffer (L1GtVhdlTemplateFile &buffer, const std::map< L1GtConditionType, std::string > &typeList, const std::vector< std::string > &defValuesList, const L1GtObject &object)
 helper, used by writeDefValPkg.
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)
 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.
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
std::map< std::string, intgetCond2IntMap ()
bool 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
std::string getDefValsFromTriggerMenu (const L1GtConditionType &type, const L1GtObject &object, const VmeRegister &reg)
 this routine extracts default values for def_val_pkg.vhd from trigger menu.
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 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
std::vector< std::string > getMsgBuf ()
 returns intern message buffer
void 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
bool 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
std::string gtTemplatesPath ()
 returns the templates path
std::string index4CondChipVhd (int intval)
 builds the index for the cond_chip vhds.
void initializeDeltaConditions ()
 L1GtVhdlWriterCore (const std::string &templatesDirectory, const std::string &outputDirectory, const bool &debug)
 constructor
bool makeFirmware (const std::vector< ConditionMap > &conditionMap, const AlgorithmMap &algorithmMap)
 produces the firmware code
void msg (const std::string &message)
 adds a string to intern message buffer
L1GtVhdlTemplateFile openVhdlFileWithCommonHeader (const std::string &filename, const std::string &outputFilename)
 opens a new template file and inserts the common header
void printCommonHeader ()
 prints the common header
void printConditionsOfCategory (const L1GtConditionCategory &category, const ConditionMap &map)
 for debuggin
bool 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
std::string retNumberOfConditionsString (const std::string &typeStr, const int &number)
L1GtVhdlTemplateFile retrunCommonHeader ()
 returns the common header
bool returnConditionsOfOneClass (const L1GtConditionType &type, const L1GtConditionCategory &category, const L1GtObject &object, const ConditionMap &map, ConditionMap &outputMap)
 returns all condition of the same class.
std::string sp (const std::string &name)
 converts string name to substiution parameter synthax; name -->
void writeAlgoSetup (std::vector< std::map< int, std::string > > &algoStrings)
 builds the prealgo_and_or setup
void writeCond2intMap2File ()
 produces a control output file for condition to integer conversion
void writeCondChipPkg (const int &chip)
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
void writeDefValPkg (const std::vector< ConditionMap > &conditionMap, const int &chip)
 writes def_val_pkg.vhd
void writeEtmSetup (std::string &etmString, const int &condChip)
 builds etm setup files
void writeMuonSetupVhdl (std::map< std::string, std::string > &muonParameters, const std::string &particle, unsigned short int &condChip)
 builds muon setup files
void writeQsfSetupFiles (const std::string &version)
 builds the two quartus setup files. This routine is called in buildCommonHeader!
 ~L1GtVhdlWriterCore ()
 destructor

Static Public Member Functions

static std::string int2str (const int &integerValue)
 converts a integer into a string

Private Attributes

const AlgorithmMapalgorithmMap_
 algorithm map
L1GtVhdlWriterBitManager bm_
 bit manager for bit operations
std::vector< L1GtObjectcaloObjects_
 list of all possible calo objects
std::map< L1GtObject, std::string > caloType2Int_
 converts L1GtObject to calo_nr
L1GtVhdlTemplateFile commonHeader_
 common header for all files
const std::vector< ConditionMap > * conditionMap_
 condition map
std::map< std::string, intconditionToIntegerMap_
 stores to condition name to integer conversion table
std::map< L1GtConditionType,
std::string > 
condType2Str_
 converts L1GtConditionType to firmware string
bool debugMode_
 class will produce some additional debugging output if set
std::vector< L1GtObjectesumObjects_
 list of all possible esums objects
std::vector< std::string > internMessageBuf_
std::vector< std::vector
< std::string > > 
numberOfConditions_
 vector containing the initialization of all conditions
std::map< L1GtObject, std::string > objType2Str_
 converts L1GtObject to string
std::string outputDir_
 output directory
std::string version_
std::string vhdlDir_
 templates directory


Detailed Description

writes the actual VHDL code and stores global information like the common header.

Description: a class to deal with VHDL template files.

This class is using parameter maps containing the substitution parameters and their content.

Implementation: <TODO: enter implementation details>

Author:
Philipp Wagner
$Date$ $Revision$

Implementation: <TODO: enter implementation details>

Author:
: Philipp Wagner
$Date$ $Revision$

Definition at line 44 of file L1GtVhdlWriterCore.h.


Constructor & Destructor Documentation

L1GtVhdlWriterCore::L1GtVhdlWriterCore ( const std::string &  templatesDirectory,
const std::string &  outputDirectory,
const bool debug 
)

constructor

Definition at line 50 of file L1GtVhdlWriterCore.cc.

References caloObjects_, caloType2Int_, CenJet, condType2Str_, debugMode_, esumObjects_, ETM, ETT, ForJet, L1GtVhdlDefinitions::getCalo2IntMap(), L1GtVhdlDefinitions::getCond2StrMap(), L1GtVhdlDefinitions::getObj2StrMap(), HTT, IsoEG, maps, NoIsoEG, numberOfConditions_, objType2Str_, outputDir_, TauJet, pyDBSRunClass::temp, and vhdlDir_.

00052 {
00053 
00054     // set templates directory
00055     vhdlDir_=templatesDirectory;
00056 
00057     // set output directory
00058     outputDir_=outputDirectory;
00059 
00060     // Get maps
00061     L1GtVhdlDefinitions maps;
00062 
00063     objType2Str_=maps.getObj2StrMap();
00064     caloType2Int_=maps.getCalo2IntMap();
00065     condType2Str_=maps.getCond2StrMap();
00066 
00067     // fill calo object vector
00068     caloObjects_.push_back(IsoEG);
00069     caloObjects_.push_back(NoIsoEG);
00070     caloObjects_.push_back(CenJet);
00071     caloObjects_.push_back(ForJet);
00072     caloObjects_.push_back(TauJet);
00073 
00074     esumObjects_.push_back(HTT);
00075     esumObjects_.push_back(ETT);
00076     esumObjects_.push_back(ETM);
00077 
00078     // prepare number of condition vector with two empty string vectors for the two condition chips
00079     std::vector<std::string> temp;
00080     numberOfConditions_.push_back(temp);
00081     numberOfConditions_.push_back(temp);
00082 
00083     // set debug mode
00084     debugMode_= debug;
00085 
00086 }

L1GtVhdlWriterCore::~L1GtVhdlWriterCore (  ) 

destructor

Definition at line 89 of file L1GtVhdlWriterCore.cc.

00090 {
00091     // empty
00092 }


Member Function Documentation

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 1382 of file L1GtVhdlWriterCore.cc.

References CondJetCounts, counter(), i, int2str(), JetCounts, numberOfConditions_, L1GtJetCountsTemplate::objectParameter(), retNumberOfConditionsString(), returnConditionsOfOneClass(), and TypeJetCounts.

Referenced by makeFirmware().

01385 {
01386     ConditionMap jetConditions;
01387 
01388     returnConditionsOfOneClass(TypeJetCounts, CondJetCounts, JetCounts,
01389             conditionMap.at(chip-1), jetConditions);
01390     /*
01391      int counter = 0;
01392 
01393      for (ConditionMap::const_iterator iterCond =  jetConditions.begin(); iterCond !=  jetConditions.end(); iterCond++)
01394      {
01395      conditionToIntegerMap_[iterCond->first]=counter;
01396      counter++;
01397      msg(iterCond->first);
01398      }
01399 
01400      */
01401     
01402     unsigned int maxJetsCountsIndex = 11;
01403     
01404     for (unsigned int i= 0; i<=maxJetsCountsIndex; i++)
01405     {
01406         int counter = 0;
01407 
01408         for (ConditionMap::const_iterator iterCond = jetConditions.begin(); iterCond
01409                 != jetConditions.end(); iterCond++)
01410         {
01411 
01412             L1GtJetCountsTemplate* jetsTemplate =
01413                     static_cast<L1GtJetCountsTemplate*>(iterCond->second);
01414             const std::vector<L1GtJetCountsTemplate::ObjectParameter>* op =
01415                     jetsTemplate->objectParameter();
01416 
01417             conditionToIntegerMap_[iterCond->first]=counter;
01418             if ((*op)[0].countIndex==i)
01419                 counter++;
01420 
01421             //msg(int2str((*op)[0].countIndex));
01422 
01423         }
01424 
01425         numberOfConditions_.at(chip-1).push_back(retNumberOfConditionsString("jet_cnts_"
01426                 +int2str(i)+"_cond", counter));
01427 
01428     }
01429 
01430 }

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 1044 of file L1GtVhdlWriterCore.cc.

References commonHeader_, L1GtVhdlTemplateFile::insert(), iter, msg(), L1GtVhdlTemplateFile::open(), L1GtVhdlTemplateFile::substitute(), version_, and vhdlDir_.

Referenced by L1GtVhdlWriter::analyze().

01047 {
01048     commonHeader_.open(vhdlDir_+"InternalTemplates/header");
01049 
01050     std::map<std::string,std::string>::iterator iter = headerParameters.begin();
01051 
01052     // loop over the header parameter map and replace all subsitution
01053     // parameters with their values
01054     while (iter != headerParameters.end() )
01055     {
01056         commonHeader_.substitute((*iter).first, (*iter).second);
01057         iter++;
01058     }
01059 
01060     commonHeader_.insert("$(connected_channels_1)", connectedChannels);
01061     commonHeader_.insert("$(connected_channels_2)", connectedChannels);
01062 
01063     //---------------------build the Quartus configuration files----------------------------------------
01064 
01065     //writeQsfSetupFiles(headerParameters["version"]);
01066     
01067     version_=headerParameters["version"];
01068 
01069     msg("Build Common header and Quartus setup files sucessuflly!");
01070 
01071 }

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 1479 of file L1GtVhdlWriterCore.cc.

01481 {
01482     // has to produce something like 1 =>  ("00000000", "00000000")
01483 
01484     return "1 =>  (\"00000000\", \"00000000\")";
01485 }

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 1666 of file L1GtVhdlWriterCore.cc.

References L1GtVhdlTemplateFile::append(), condType2Str_, ETM, ETT, L1GtVhdlTemplateFile::findAndReplaceString(), getDefValsFromTriggerMenu(), L1GtVhdlTemplateFile::getInternalParameter(), HTT, i, JetCounts, Mu, objType2Str_, L1GtVhdlTemplateFile::open(), L1GtVhdlDefinitions::RegEtThreshold, sp(), 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().

01669 {
01670     // type iterator
01671     std::map<L1GtConditionType,std::string>::const_iterator typeIter;
01672 
01673     for (typeIter=typeList.begin(); typeIter!=typeList.end(); typeIter++)
01674     {
01675 
01676         for (unsigned int i = 0; i<defValuesList.size(); i++)
01677         {
01678 
01679             // open a new internale template
01680             L1GtVhdlTemplateFile internalTemplate;
01681             internalTemplate.open(vhdlDir_+"InternalTemplates/defvalpkg", true);
01682 
01683             std::string
01684                     idString =
01685                             internalTemplate.getInternalParameter(stringConstantDefValId_);
01686 
01687             // The following three steps convert "$(particle)_$(type)_$(defvaltype)_def_val"
01688             // to e.g. "muon_1s_et_def_val"
01689 
01690             // replace the substiution parameter particle with muon - thereby parameterString is a
01691             // reference and therefore changed.
01692             L1GtVhdlTemplateFile::findAndReplaceString(idString,
01693                     sp(substParamParticle_), objType2Str_[object]);
01694 
01695             // replace the substiution parameter particle with muon
01696             L1GtVhdlTemplateFile::findAndReplaceString(idString,
01697                     sp(substParamType_), typeIter->second);
01698 
01699             // replace the substiution parameter defvaltype with muon
01700             L1GtVhdlTemplateFile::findAndReplaceString(idString,
01701                     sp(substParamDefValType_), defValuesList.at(i));
01702 
01703             // usage of the subsitute routine:
01704             // first the substitution parameter, then the content
01705             internalTemplate.substitute(substParamDefValId_, idString);
01706 
01707             // !here the body of the internale template is build - almost done!
01708 
01709             // The body looks as follows $(def_val), $(max_nr), $(content) and
01710             // $(others) have to be subsituted 
01711 
01712             /*
01713              * CONSTANT $(def_val) : $(calo_or_muon)_maxnr$(max_nr)vector8_arr := 
01714              * (
01715              * $(content)
01716              * $(others)
01717              * );
01718              */
01719 
01720             // substitute the particle
01721             internalTemplate.substitute(substParamParticle_,
01722                     objType2Str_[object]);
01723 
01724             // go on with max number - get the correct expression for max number from the internal template
01725             internalTemplate.substitute(substParamMaxNr_,
01726                     internalTemplate.getInternalParameter(substParamMaxNr_+"_"
01727                             +condType2Str_[typeIter->first]));
01728 
01729             // now we have to choose the correct OTHERS string for the
01730             // internal template. The identifier for the OTHERS string
01731             // is the condition type (as firmware string) therefore:
01732 
01733             // we get it as follows
01734             std::string othersString;
01735 
01736             // jet_cnts are a special case
01737             if (object==JetCounts || object==HTT || object==ETM || object==ETT )
01738                 othersString
01739                         = internalTemplate.getInternalParameter(objType2Str_[JetCounts]);
01740             else
01741                 othersString
01742                         = internalTemplate.getInternalParameter(typeIter->second);
01743 
01744             internalTemplate.substitute(substParamOthers_, othersString);
01745 
01746             // the actual content, taken from the trigger menu
01747 
01748             std::string content = getDefValsFromTriggerMenu(typeIter->first,
01749                     object, RegEtThreshold);
01750 
01751             internalTemplate.substitute(substParamContent_, content);
01752 
01753             // Finally the parameter $(calo_or_muon) is left open
01754             std::string caloOrMuonStr = stringConstantCalo_;
01755            
01756             if (object == Mu)
01757                 caloOrMuonStr = objType2Str_[Mu];
01758             
01759             internalTemplate.substitute(substParamCaloOrMuon_, caloOrMuonStr);
01760             
01761             // The internal template has been processed and now can be added to the buffer..
01762             buffer.append(internalTemplate);
01763 
01764         }
01765 
01766     }
01767 
01768     return true;
01769 }

std::string L1GtVhdlWriterCore::chip2OutputSubDir ( const int chip  ) 

Definition at line 905 of file L1GtVhdlWriterCore.cc.

References outputDir_, L1GtVhdlDefinitions::outputSubDir1_, and L1GtVhdlDefinitions::outputSubDir2_.

Referenced by writeAlgoSetup(), writeCond2intMap2File(), writeCondChipPkg(), writeConditionChipSetup(), writeDefValPkg(), writeEtmSetup(), writeMuonSetupVhdl(), and writeQsfSetupFiles().

00906 {
00907     if (chip==1)
00908         return outputDir_+"/"+outputSubDir1_+"/";
00909     if (chip==2)
00910         return outputDir_+"/"+outputSubDir2_+"/";
00911     
00912     return "";
00913 }

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 1771 of file L1GtVhdlWriterCore.cc.

References condType2Str_, numberOfConditions_, objType2Str_, retNumberOfConditionsString(), and returnConditionsOfOneClass().

Referenced by getCaloSetupContentFromTriggerMenu(), getEsumsSetupContentFromTriggerMenu(), and getMuonSetupContentFromTriggerMenu().

01775 {
01776 
01777     // Get the absoloute amount of conditions
01778 
01779     int number;
01780 
01781     if (returnConditionsOfOneClass(type, category, object, map, outputMap))
01782         number=outputMap.size();
01783     else
01784         number=0;
01785 
01786     std::string initstr = retNumberOfConditionsString(objType2Str_[object]+"_"
01787             +condType2Str_[type], number);
01788 
01789     numberOfConditions_.at(condChip-1).push_back(initstr);
01790 
01791 }

bool L1GtVhdlWriterCore::findObjectType ( const L1GtObject object,
ConditionMap map 
)

Definition at line 117 of file L1GtVhdlWriterCore.cc.

References i, size, and StDecayID::status.

00119 {
00120     bool status = false;
00121 
00122     ConditionMap::iterator condIter = map.begin();
00123     while (condIter!=map.end())
00124     {
00125         for (unsigned int i=0; i<(condIter->second->objectType()).size(); i++)
00126         {
00127             if (condIter->second->objectType()[i]==object)
00128             {
00129                 status = true;
00130                 break;
00131             }
00132         }
00133 
00134         if (status)
00135             break;
00136         condIter++;
00137     }
00138 
00139     return status;
00140 }

bool L1GtVhdlWriterCore::getCaloSetupContentFromTriggerMenu ( const unsigned short int condChip,
std::map< std::string, std::string > &  caloParameters,
const L1GtObject caloObject 
)

Definition at line 317 of file L1GtVhdlWriterCore.cc.

References bm_, L1GtVhdlWriterBitManager::buildDeltaEtaCalo(), L1GtVhdlWriterBitManager::buildDeltaPhiCalo(), L1GtVhdlWriterBitManager::buildEtaCalo(), L1GtVhdlWriterBitManager::buildPhiCalo(), CondCalo, conditionToIntegerMap_, L1GtCaloTemplate::correlationParameter(), countCondsAndAdd2NumberVec(), counter(), debugMode_, i, L1GtCaloTemplate::objectParameter(), Type1s, Type2s, Type2wsc, and Type4s.

Referenced by makeFirmware().

00321 {
00322     // vector containing all relevant types for calo conditions
00323     std::vector<L1GtConditionType> caloConditionTypes;
00324 
00325     caloConditionTypes.push_back(Type1s);
00326     caloConditionTypes.push_back(Type2s);
00327     caloConditionTypes.push_back(Type2wsc);
00328     caloConditionTypes.push_back(Type4s);
00329 
00330     for (unsigned int i = 0; i<caloConditionTypes.size(); i++)
00331     {
00332         unsigned int counter=0;
00333 
00334         ConditionMap caloConditions;
00335 
00336         // stores all conditions of type given in the first three parameters
00337         countCondsAndAdd2NumberVec(caloConditionTypes.at(i), CondCalo,
00338                 caloObject, (*conditionMap_).at(condChip-1), caloConditions,
00339                 condChip);
00340 
00341         for (ConditionMap::const_iterator iterCond = caloConditions.begin(); iterCond
00342                 != caloConditions.end(); iterCond++)
00343         {
00344 
00345             // add this condition to name -> integer conversion map
00346             conditionToIntegerMap_[iterCond->first]=counter;
00347 
00348             L1GtCaloTemplate* m_gtCaloTemplate =
00349                     static_cast<L1GtCaloTemplate*>(iterCond->second);
00350             const std::vector<L1GtCaloTemplate::ObjectParameter>* op =
00351                     m_gtCaloTemplate->objectParameter();
00352 
00353             if (caloConditionTypes.at(i)==Type1s)
00354             {
00355 
00356                 //= static_cast<std::vector<L1GtCaloTemplate::ObjectPaenergySumParameter+=rameter*> >(op);
00357 
00358                 // build eta
00359                 caloParameters["eta_1_s"] += (bm_.buildEtaCalo(op, 1, counter));
00360 
00361                 caloParameters["phi_1_s"]+= bm_.buildPhiCalo(op, 1, counter);
00362 
00363                 if (debugMode_)
00364                 {
00365                     caloParameters["eta_1_s"]+=("--"+iterCond->first+"\n");
00366                     caloParameters["phi_1_s"]+=("--"+iterCond->first+"\n");
00367                 }
00368 
00369             } else if (caloConditionTypes.at(i)==Type2s)
00370             {
00371 
00372                 // build eta
00373                 caloParameters["eta_2_s"] += (bm_.buildEtaCalo(op, 2, counter));
00374 
00375                 // add the parameters to parameter map
00376                 caloParameters["phi_2_s"]+= bm_.buildPhiCalo(op, 2, counter);
00377 
00378                 if (debugMode_)
00379                 {
00380                     caloParameters["eta_2_s"]+=("--"+iterCond->first+"\n");
00381                     caloParameters["phi_2_s"]+=("--"+iterCond->first+"\n");
00382                 }
00383 
00384             } else if (caloConditionTypes.at(i)==Type4s)
00385             {
00386                 // build eta
00387                 caloParameters["eta_4"] += (bm_.buildEtaCalo(op, 4, counter));
00388 
00389                 // add the parameters to parameter map
00390                 caloParameters["phi_4"]+= bm_.buildPhiCalo(op, 4, counter);
00391 
00392                 if (debugMode_)
00393                 {
00394                     caloParameters["eta_4"]+=("--"+iterCond->first+"\n");
00395                     caloParameters["phi_4"]+=("--"+iterCond->first+"\n");
00396                 }
00397 
00398             } else if (caloConditionTypes.at(i)==Type2wsc)
00399             {
00400                 const L1GtCaloTemplate::CorrelationParameter* cp =
00401                         m_gtCaloTemplate->correlationParameter();
00402 
00403                 // build eta
00404                 caloParameters["eta_2_wsc"]
00405                         += (bm_.buildEtaCalo(op, 2, counter));
00406 
00407                 // build phi
00408                 caloParameters["phi_2_wsc"]+= bm_.buildPhiCalo(op, 2, counter);
00409 
00410                 // build delta_eta
00411                 caloParameters["delta_eta"] += bm_.buildDeltaEtaCalo(cp,
00412                         counter);
00413 
00414                 // build delta_phi
00415                 caloParameters["delta_phi"] += bm_.buildDeltaPhiCalo(cp,
00416                         counter);
00417 
00418                 if (debugMode_)
00419                 {
00420                     caloParameters["eta_2_wsc"]+=("--"+iterCond->first+"\n");
00421                     caloParameters["phi_2_wsc"]+=("--"+iterCond->first+"\n");
00422                     caloParameters["delta_eta"]+=("--"+iterCond->first+"\n");
00423                     caloParameters["delta_phi"]+=("--"+iterCond->first+"\n");
00424                 }
00425 
00426             }
00427 
00428             counter++;
00429 
00430         }
00431 
00432     }
00433 
00434     return true;
00435 }

L1GtConditionCategory L1GtVhdlWriterCore::getCategoryFromObject ( const L1GtObject object  ) 

gets condition category from object

Definition at line 1838 of file L1GtVhdlWriterCore.cc.

References category, CenJet, CondCalo, CondEnergySum, CondJetCounts, CondMuon, CondNull, ETM, ETT, ForJet, HTT, IsoEG, JetCounts, Mu, NoIsoEG, and TauJet.

Referenced by getDefValsFromTriggerMenu().

01840 {
01841 
01842     L1GtConditionCategory category;
01843 
01844     if (object==Mu)
01845         category = CondMuon;
01846     else if (object==ETM || object==HTT || object==ETT)
01847         category = CondEnergySum;
01848     else if (object==IsoEG|| object==NoIsoEG || object==CenJet || object
01849             ==ForJet || object==TauJet)
01850         category = CondCalo;
01851     else if (object==IsoEG|| object==NoIsoEG || object==CenJet || object
01852             ==ForJet || object==TauJet)
01853         category = CondCalo;
01854     else if (object==JetCounts)
01855         category = CondJetCounts;
01856     else 
01857         category=CondNull;
01858 
01859     return category;
01860 
01861 }

std::map< std::string, int > L1GtVhdlWriterCore::getCond2IntMap (  ) 

Definition at line 1914 of file L1GtVhdlWriterCore.cc.

References conditionToIntegerMap_.

Referenced by L1GtVhdlWriter::analyze().

01915 {
01916     return conditionToIntegerMap_;
01917 }

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

Parameters:
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 529 of file L1GtVhdlWriterCore.cc.

References L1GtVhdlTemplateFile::append(), asciidump::at, caloObjects_, caloType2Int_, CondCalo, CondCorrelation, CondEnergySum, conditionToIntegerMap_, CondJetCounts, CondMuon, CondNull, condType2Str_, esumObjects_, ETM, find(), L1GtVhdlTemplateFile::findAndReplaceString(), L1GtVhdlTemplateFile::getInternalParameter(), getIntVal(), getSubstParamCommonFromTriggerMenu(), i, index4CondChipVhd(), int2str(), metsig::jet, JetCounts, msg(), Mu, metsig::muon, L1GtJetCountsTemplate::objectParameter(), objType2Str_, L1GtVhdlTemplateFile::open(), p, L1GtVhdlTemplateFile::removeEmptyLines(), L1GtVhdlTemplateFile::returnParameterMap(), sp(), 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().

00533 {
00534 
00535     // open the necessary internal templates
00536     L1GtVhdlTemplateFile muon, calo, esums, jet;
00537 
00538     muon.open(vhdlDir_+"InternalTemplates/muon", true);
00539     muon.substitute("particle", "muon");
00540 
00541     calo.open(vhdlDir_+"InternalTemplates/calo", true);
00542     esums.open(vhdlDir_+"InternalTemplates/esums", true);
00543     jet.open(vhdlDir_+"InternalTemplates/jet_cnts", true);
00544 
00545     /*
00546      charge1s.open(vhdlDir_+"InternalTemplates/charge_1s",false);
00547      charge2s.open(vhdlDir_+"InternalTemplates/charge_2s",false);
00548      charge2wsc.open(vhdlDir_+"InternalTemplates/charge_2_wsc",false);
00549      charge3s.open(vhdlDir_+"InternalTemplates/charge_3",false);
00550      charge4s.open(vhdlDir_+"InternalTemplates/charge_4",false);
00551      */
00552 
00553     // only for jet_cnts common parameter relevant since common parameter is build in this routine
00554     std::vector<unsigned int> processedTypes;
00555 
00556     //-------------------------------------build the common parameters-------------------------------------------
00557 
00558     // build $(muon_common)
00559     getSubstParamCommonFromTriggerMenu(condChip,muon, Mu, CondMuon, commonParams["muon_common"]);
00560 
00561     // build $(calo_common) - loop over all calo objects
00562     std::vector<L1GtObject>::iterator caloObjIter = caloObjects_.begin();
00563 
00564     while (caloObjIter != caloObjects_.end())
00565     {
00566 
00567         getSubstParamCommonFromTriggerMenu(condChip, muon, (*caloObjIter), CondCalo,
00568                 commonParams["calo_common"]);
00569         caloObjIter++;
00570 
00571     }
00572 
00573     // build $(esums_common) - loop over all esums objects
00574     std::vector<L1GtObject>::iterator esumObjIter = esumObjects_.begin();
00575 
00576     while (esumObjIter != esumObjects_.end())
00577     {
00578 
00579         getSubstParamCommonFromTriggerMenu(condChip, esums, (*esumObjIter), CondEnergySum,
00580                 commonParams["esums_common"]);
00581         esumObjIter++;
00582 
00583     }
00584 
00585     //--------------------------------------build the parameter maps----------------------------------------------
00586 
00587     // loop over condition map
00588     for (ConditionMap::const_iterator iterCond = (*conditionMap_).at(condChip-1).begin(); iterCond != (*conditionMap_).at(condChip-1).end(); iterCond++)
00589     {
00590 
00591         switch ((iterCond->second)->condCategory())
00592         {
00593 
00594         case CondMuon:
00595         {
00596 
00597             int cond2int;
00598             if (!getIntVal(conditionToIntegerMap_, (iterCond->first), cond2int))
00599             {
00600                 msg("Panik! Condition "+(iterCond->first)
00601                         +" does not have a integer equivalent!");
00602                 break;
00603             }
00604 
00605             std::string intVal = index4CondChipVhd(cond2int);
00606 
00607             L1GtVhdlTemplateFile muoncopy = muon;
00608 
00609             muoncopy.substitute("type", condType2Str_[(iterCond->second)->condType()]);
00610 
00611             muoncopy.substitute("ser_no", intVal);
00612 
00613             muoncopy.substitute("name", iterCond->first);
00614 
00615             if ((iterCond->second)->condType() == Type1s)
00616             {
00617                 muoncopy.substitute(substParamCharge_,
00618                         muon.getInternalParameter(stringConstantCharge1s_));
00619             } else if ((iterCond->second)->condType() == Type2s)
00620             {
00621                 muoncopy.substitute(substParamCharge_,
00622                         muon.getInternalParameter(stringConstantCharge2s_));
00623             } else if ((iterCond->second)->condType() == Type2wsc)
00624             {
00625                 muoncopy.substitute(substParamCharge_,
00626                         muon.getInternalParameter(stringConstantCharge2wsc_));
00627             } else if ((iterCond->second)->condType() == Type3s)
00628             {
00629                 muoncopy.substitute(substParamCharge_,
00630                         muon.getInternalParameter(stringConstantCharge3s_));
00631             } else if ((iterCond->second)->condType() == Type4s)
00632             {
00633                 muoncopy.substitute(substParamCharge_,
00634                         muon.getInternalParameter(stringConstantCharge4s_));
00635             }
00636 
00637             std::string tempStr = muoncopy.returnParameterMap()["PREALGO"];
00638 
00639             muoncopy.findAndReplaceString(tempStr, "$(particle)", "muon");
00640             muoncopy.findAndReplaceString(tempStr, "$(ser_no)", intVal);
00641             muoncopy.findAndReplaceString(tempStr, "$(type)", condType2Str_[(iterCond->second)->condType()]);
00642 
00643             muoncopy.append(tempStr);
00644 
00645             muoncopy.removeEmptyLines();
00646 
00647             // add the processed internal template to parameter map
00648             templates["muon"].append(muoncopy);
00649 
00650         }
00651             break;
00652 
00653         case CondCalo:
00654         {
00655             int cond2int;
00656 
00657             if (!getIntVal(conditionToIntegerMap_, (iterCond->first), cond2int))
00658             {
00659                 msg("Panik! Condition "+(iterCond->first)
00660                         +" does not have a integer equivalent!");
00661                 break;
00662             }
00663 
00664             std::string intVal = index4CondChipVhd(cond2int);
00665 
00666             L1GtVhdlTemplateFile calocopy = calo;
00667 
00668             calocopy.substitute("type", condType2Str_[(iterCond->second)->condType()]);
00669             calocopy.substitute("particle", objType2Str_[((iterCond->second)->objectType()).at(0)]);
00670             calocopy.substitute("name", iterCond->first);
00671             calocopy.substitute("ser_no", intVal);
00672             calocopy.substitute("calo_nr", caloType2Int_[((iterCond->second)->objectType()).at(0)]);
00673 
00674             // builds something like tau_1_s(20));
00675             calocopy.append(objType2Str_[((iterCond->second)->objectType()).at(0)] +"_"+condType2Str_[(iterCond->second)->condType()]+"("+intVal+"));");
00676 
00677             templates["calo"].append(calocopy);
00678 
00679         }
00680             break;
00681 
00682         case CondEnergySum:
00683         {
00684 
00685             int cond2int;
00686 
00687             if (!getIntVal(conditionToIntegerMap_, (iterCond->first), cond2int))
00688             {
00689                 msg("Panik! Condition "+(iterCond->first)
00690                         +" does not have a integer equivalent!");
00691                 break;
00692             }
00693 
00694             std::string intVal = index4CondChipVhd(cond2int);
00695 
00696             L1GtVhdlTemplateFile esumscopy = esums;
00697 
00698             esumscopy.substitute("type", condType2Str_[(iterCond->second)->condType()]);
00699             esumscopy.substitute("particle", objType2Str_[((iterCond->second)->objectType()).at(0)]);
00700             esumscopy.substitute("name", iterCond->first);
00701             esumscopy.substitute("ser_no", intVal);
00702 
00703             if (((iterCond->second)->objectType()).at(0)==ETM)
00704                 esumscopy.substitute("if_etm_then_1_else_0", "1");
00705             else
00706                 esumscopy.substitute("if_etm_then_1_else_0", "0");
00707 
00708             // builds something like htt_cond(4));
00709             esumscopy.append(objType2Str_[((iterCond->second)->objectType()).at(0)] +"_"+condType2Str_[(iterCond->second)->condType()]+"("+ intVal+"));");
00710 
00711             templates["esums"].append(esumscopy);
00712         }
00713 
00714             break;
00715 
00716         case CondJetCounts:
00717         {
00718 
00719             // build the common parameter for the jet counts
00720 
00721             L1GtJetCountsTemplate* jetsTemplate =
00722                     static_cast<L1GtJetCountsTemplate*>(iterCond->second);
00723 
00724             int nObjects = iterCond->second->nrObjects();
00725 
00726             const std::vector<L1GtJetCountsTemplate::ObjectParameter>* op =
00727                     jetsTemplate->objectParameter();
00728 
00729             for (int i = 0; i < nObjects; i++)
00730             {
00731 
00732                 std::vector<unsigned int>::iterator p = find(
00733                         processedTypes.begin(), processedTypes.end(), (*op)[i].countIndex);
00734 
00735                 // check, weather this count index was already processed
00736                 // and process it if not
00737                 if (p==processedTypes.end())
00738                 {
00739                     std::ostringstream indStr;
00740                     indStr<<(*op)[i].countIndex;
00741 
00742                     std::string tempStr2 = jet.returnParameterMap()[stringConstantCommon_];
00743                     while (jet.findAndReplaceString(tempStr2,
00744                             sp(substParamParticle_), objType2Str_[JetCounts]))
00745                         ;
00746                     while (jet.findAndReplaceString(tempStr2,
00747                             sp(substParamType_), indStr.str()))
00748                         ;
00749                     commonParams[substParamJetCntsCommon_]+=tempStr2+"\n"; // +"<= '0';\n");
00750                     processedTypes.push_back((*op)[i].countIndex);
00751                 }
00752 
00753             }
00754 
00755             int cond2int;
00756 
00757             if (!getIntVal(conditionToIntegerMap_, (iterCond->first), cond2int))
00758             {
00759                 msg("Panik! Condition "+(iterCond->first)
00760                         +" does not have a integer equivalent!");
00761                 break;
00762             }
00763 
00764             std::string intVal = index4CondChipVhd(cond2int);
00765 
00766             L1GtVhdlTemplateFile jetcopy = jet;
00767 
00768             jetcopy.substitute("particle", condType2Str_[(iterCond->second)->condType()]);
00769             jetcopy.substitute("type", int2str((*op)[0].countIndex));
00770             jetcopy.substitute("name", iterCond->first);
00771 
00772             jetcopy.substitute("ser_no", intVal);
00773 
00774             // builds the final string
00775             std::string tempStr = jetcopy.returnParameterMap()["PREALGO"];
00776 
00777             jetcopy.findAndReplaceString(tempStr, "$(particle)", "jet_cnt");
00778             jetcopy.findAndReplaceString(tempStr, "$(ser_no)", intVal);
00779             jetcopy.findAndReplaceString(tempStr, "$(type)", int2str((*op)[0].countIndex));
00780 
00781             jetcopy.append(tempStr);
00782             jetcopy.removeEmptyLines();
00783 
00784             templates["jet_cnts"].append(jetcopy);
00785         }
00786 
00787             break;
00788 
00789         case CondCorrelation:
00790         {
00791             //empty
00792         }
00793             break;
00794 
00795         case CondNull:
00796         {
00797             //empty
00798         }
00799             break;
00800 
00801         default:
00802         {
00803             //empty
00804         }
00805             break;
00806         }
00807     }
00808 
00809     // delete superfluous newlines at the end of common parameters
00810     std::map<std::string,std::string>::iterator pIt = commonParams.begin();
00811 
00812     while (pIt!=commonParams.end())
00813     {
00814         if ((pIt->second)[((pIt->second).length()-1)] == '\n')
00815             (pIt->second) = (pIt->second).substr(0, (pIt->second).length()-1);
00816         pIt++;
00817     }
00818 
00819     return true;
00820 
00821 }

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 1487 of file L1GtVhdlWriterCore.cc.

References category, CondCalo, getCategoryFromObject(), i, int2str(), L1GtCaloTemplate::objectParameter(), HLT_VtxMuL3::result, and returnConditionsOfOneClass().

Referenced by buildDefValuesBuffer().

01490 {
01491     L1GtConditionCategory category;
01492 
01493     // get condition category from object
01494 
01495     category = getCategoryFromObject(object);
01496 
01497     ConditionMap conditions;
01498     returnConditionsOfOneClass(type, category, object, (*conditionMap_).at(0),
01499             conditions);
01500 
01501     std::string result;
01502 
01503     if (category==CondCalo)
01504     {
01505         for (ConditionMap::const_iterator iterCond =conditions.begin(); iterCond
01506                 != conditions.end(); iterCond++)
01507         {
01508             L1GtCaloTemplate* caloTemplate =
01509                     static_cast<L1GtCaloTemplate*>(iterCond->second);
01510             const std::vector<L1GtCaloTemplate::ObjectParameter>* op =
01511                     caloTemplate->objectParameter();
01512 
01513             unsigned int nObjects = iterCond->second->nrObjects();
01514 
01515             for (unsigned int i =0; i<nObjects; i++)
01516             {
01517                 if (i==0)
01518                     result+="(";
01519                 result +="\"";
01520                 result += int2str((*op).at(i).etThreshold);
01521                 result +="\"";
01522                 if (i!=nObjects-1)
01523                     result +=",";
01524                 else
01525                     result+=")\n";
01526 
01527             }
01528         }
01529     }
01530 
01531     return "-- 0 => (\"00000000\", \"00000000\" ... )";
01532     return result;
01533 }

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 437 of file L1GtVhdlWriterCore.cc.

References bm_, L1GtVhdlWriterBitManager::buildPhiEnergySum(), CondEnergySum, conditionToIntegerMap_, countCondsAndAdd2NumberVec(), counter(), debugMode_, ETM, ETT, HTT, L1GtEnergySumTemplate::objectParameter(), TypeETM, TypeETT, and TypeHTT.

Referenced by makeFirmware().

00440 {
00441 
00442     L1GtConditionType type;
00443 
00444     unsigned int counter=0;
00445 
00446     if (object==HTT)
00447         type= TypeHTT;
00448     else if (object==ETM)
00449         type= TypeETM;
00450     else if (object==ETT)
00451         type= TypeETT;
00452 
00453     ConditionMap esumsConditions;
00454     // stores all conditions of type given in the first three parameters
00455     countCondsAndAdd2NumberVec(type, CondEnergySum, object,
00456             (*conditionMap_).at(condChip-1), esumsConditions, condChip);
00457 
00458     for (ConditionMap::const_iterator iterCond = esumsConditions.begin(); iterCond
00459             != esumsConditions.end(); iterCond++)
00460     {
00461         L1GtEnergySumTemplate* energySumTempl =
00462                 static_cast<L1GtEnergySumTemplate*>(iterCond->second);
00463         const std::vector<L1GtEnergySumTemplate::ObjectParameter>* op =
00464                 energySumTempl->objectParameter();
00465 
00466         if (bm_.buildPhiEnergySum(op, 1, counter)!="")
00467             energySumParameter+=bm_.buildPhiEnergySum(op, 1, counter);
00468 
00469         if (debugMode_)
00470         {
00471             energySumParameter+=("--"+iterCond->first+"\n");
00472         }
00473 
00474         conditionToIntegerMap_[(iterCond->first)]=counter;
00475 
00476         counter++;
00477     }
00478 
00479     return true;
00480 
00481 }

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 1366 of file L1GtVhdlWriterCore.cc.

References iter.

Referenced by getCondChipVhdContentFromTriggerMenu().

01368 {
01369     std::map<std::string,int>::const_iterator iter = map.find(searchValue);
01370     if (iter == map.end() )
01371         return false;
01372     intVal = (*iter).second;
01373     return true;
01374 }

std::vector< std::string > L1GtVhdlWriterCore::getMsgBuf (  ) 

returns intern message buffer

Definition at line 1361 of file L1GtVhdlWriterCore.cc.

References internMessageBuf_.

01362 {
01363     return internMessageBuf_;
01364 }

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

Parameters:
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 142 of file L1GtVhdlWriterCore.cc.

References bm_, L1GtVhdlWriterBitManager::buildDeltaEtaMuon(), L1GtVhdlWriterBitManager::buildDeltaPhiMuon(), L1GtVhdlWriterBitManager::buildEtaMuon(), L1GtVhdlWriterBitManager::buildPhiMuon(), conditionToIntegerMap_, CondMuon, L1GtMuonTemplate::correlationParameter(), countCondsAndAdd2NumberVec(), counter(), debugMode_, i, Mu, L1GtMuonTemplate::objectParameter(), Type1s, Type2s, Type2wsc, Type3s, and Type4s.

Referenced by makeFirmware().

00145 {
00146     // vector containing all relevant types for muon conditions
00147     std::vector<L1GtConditionType> muonConditionTypes;
00148 
00149     muonConditionTypes.push_back(Type1s);
00150     muonConditionTypes.push_back(Type2s);
00151     muonConditionTypes.push_back(Type2wsc);
00152     muonConditionTypes.push_back(Type3s);
00153     muonConditionTypes.push_back(Type4s);
00154 
00155     for (unsigned int i = 0; i<muonConditionTypes.size(); i++)
00156     {
00157         //std::cout<<i<<std::endl;
00158 
00159         ConditionMap MuonConditions1s;
00160 
00161         countCondsAndAdd2NumberVec(muonConditionTypes.at(i), CondMuon, Mu,
00162                 (*conditionMap_).at(condChip-1), MuonConditions1s, condChip);
00163 
00164         /*
00165          // Get the absoloute amount of conditions
00166          std::string initstr="CONSTANT nr_"+objType2Str_[Mu]+"_"+condType2Str_[muonConditionTypes.at(i)]+" : integer := ";
00167 
00168          if (returnConditionsOfOneClass(muonConditionTypes.at(i),CondMuon,Mu,conditionMap_.at(condChip-1), MuonConditions1s))
00169          initstr+=(int2str(MuonConditions1s.size())+";");
00170          else
00171          initstr+=("0;");
00172 
00173          numberOfConditions_.at(condChip-1).push_back(initstr);
00174 
00175          */
00176 
00177         //std::cout<< std::hex << (*myObjectParameter).at(0).etThreshold << std::endl;
00178         unsigned int counter=0;
00179 
00180         for (ConditionMap::const_iterator iterCond = MuonConditions1s.begin(); iterCond
00181                 != MuonConditions1s.end(); iterCond++)
00182         {
00183 
00184             // add this condition to name -> integer conversion map
00185             conditionToIntegerMap_[iterCond->first]=counter;
00186 
00187             L1GtMuonTemplate* m_gtMuonTemplate =
00188                     static_cast<L1GtMuonTemplate*>(iterCond->second);
00189             const std::vector<L1GtMuonTemplate::ObjectParameter>* op =
00190                     m_gtMuonTemplate->objectParameter();
00191 
00192             if (muonConditionTypes.at(i)==Type1s)
00193             {
00194 
00195                 // build eta
00196                 muonParameters["eta_1_s"] += (bm_.buildEtaMuon(op, 1, counter));
00197 
00198                 // add the parameters to parameter map
00199                 muonParameters["phi_h_1_s"]+= bm_.buildPhiMuon(op, 1, counter,
00200                         true);
00201                 muonParameters["phi_l_1_s"]+=bm_.buildPhiMuon(op, 1, counter,
00202                         false);
00203 
00204                 if (debugMode_)
00205                 {
00206                     muonParameters["phi_l_1_s"]+=("--"+iterCond->first+"\n");
00207                     muonParameters["phi_h_1_s"]+=("--"+iterCond->first+"\n");
00208                     muonParameters["eta_1_s"] +=("--"+iterCond->first+"\n");
00209                 }
00210 
00211             } else
00212 
00213             if (muonConditionTypes.at(i)==Type2s)
00214             {
00215 
00216                 // build eta
00217                 muonParameters["eta_2_s"] += (bm_.buildEtaMuon(op, 2, counter));
00218 
00219                 // add the parameters to parameter map
00220                 muonParameters["phi_h_2_s"]+= bm_.buildPhiMuon(op, 2, counter,
00221                         true);
00222                 muonParameters["phi_l_2_s"]+=bm_.buildPhiMuon(op, 2, counter,
00223                         false);
00224 
00225                 if (debugMode_)
00226                 {
00227                     muonParameters["phi_l_2_s"]+=("--"+iterCond->first+"\n");
00228                     muonParameters["phi_h_2_s"]+=("--"+iterCond->first+"\n");
00229                     muonParameters["eta_2_s"] +=("--"+iterCond->first+"\n");
00230                 }
00231 
00232             } else
00233             //m_gtMuonTemplate->print(std::cout);
00234 
00235             if (muonConditionTypes.at(i)==Type3s)
00236             {
00237 
00238                 // build eta
00239                 muonParameters["eta_3"] += (bm_.buildEtaMuon(op, 3, counter));
00240 
00241                 // add the parameters to parameter map
00242                 muonParameters["phi_h_3"]+= bm_.buildPhiMuon(op, 3, counter,
00243                         true);
00244                 muonParameters["phi_l_3"]+=bm_.buildPhiMuon(op, 3, counter,
00245                         false);
00246 
00247                 if (debugMode_)
00248                 {
00249                     muonParameters["phi_l_3"]+=("--"+iterCond->first+"\n");
00250                     muonParameters["phi_h_3"]+=("--"+iterCond->first+"\n");
00251                     muonParameters["eta_3"] +=("--"+iterCond->first+"\n");
00252                 }
00253 
00254             }
00255 
00256             if (muonConditionTypes.at(i)==Type4s)
00257             {
00258 
00259                 // build eta
00260                 muonParameters["eta_4"] += (bm_.buildEtaMuon(op, 4, counter));
00261 
00262                 // add the parameters to parameter map
00263                 muonParameters["phi_h_4"]+= bm_.buildPhiMuon(op, 4, counter,
00264                         true);
00265                 muonParameters["phi_l_4"]+=bm_.buildPhiMuon(op, 4, counter,
00266                         false);
00267 
00268                 if (debugMode_)
00269                 {
00270                     muonParameters["phi_l_4"]+=("--"+iterCond->first+"\n");
00271                     muonParameters["phi_h_4"]+=("--"+iterCond->first+"\n");
00272                     muonParameters["eta_4"] +=("--"+iterCond->first+"\n");
00273                 }
00274 
00275             }
00276 
00277             if (muonConditionTypes.at(i)==Type2wsc)
00278             {
00279                 const L1GtMuonTemplate::CorrelationParameter* cp =
00280                         m_gtMuonTemplate->correlationParameter();
00281 
00282                 // build eta
00283                 muonParameters["eta_2_wsc"]
00284                         += (bm_.buildEtaMuon(op, 2, counter));
00285 
00286                 // build phi
00287                 muonParameters["phi_h_2_wsc"]+= bm_.buildPhiMuon(op, 2,
00288                         counter, true);
00289                 muonParameters["phi_l_2_wsc"]+=bm_.buildPhiMuon(op, 2, counter,
00290                         false);
00291 
00292                 // build delta_eta
00293                 std::ostringstream dEta;
00294                 muonParameters["delta_eta"] += bm_.buildDeltaEtaMuon(cp,
00295                         counter);
00296 
00297                 // build delta_phi
00298                 muonParameters["delta_phi"] += bm_.buildDeltaPhiMuon(cp,
00299                         counter);
00300 
00301                 if (debugMode_)
00302                 {
00303                     muonParameters["eta_2_wsc"]+=("--"+iterCond->first+"\n");
00304                     muonParameters["phi_h_2_wsc"]+=("--"+iterCond->first+"\n");
00305                     muonParameters["phi_l_2_wsc"] +=("--"+iterCond->first+"\n");
00306                     muonParameters["delta_eta"]+=("--"+iterCond->first+"\n");
00307                     muonParameters["delta_phi"] +=("--"+iterCond->first+"\n");
00308                 }
00309 
00310             }
00311             counter++;
00312         }
00313     }
00314 
00315 }

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 483 of file L1GtVhdlWriterCore.cc.

References condType2Str_, L1GtVhdlTemplateFile::findAndReplaceString(), JetCounts, objType2Str_, returnConditionsOfOneClass(), L1GtVhdlTemplateFile::returnParameterMap(), sp(), L1GtVhdlDefinitions::stringConstantCommon_, L1GtVhdlDefinitions::substParamParticle_, and L1GtVhdlDefinitions::substParamType_.

Referenced by getCondChipVhdContentFromTriggerMenu().

00486 {
00487 
00488     std::map<L1GtConditionType,std::string> condType2Strcopy = condType2Str_;
00489 
00490     // make a copy since types will deleted later after they are processed
00491     std::map<L1GtConditionType,std::string>::iterator typeIterator =
00492             condType2Strcopy.begin();
00493 
00494     while (typeIterator != condType2Strcopy.end())
00495     {
00496 
00497         ConditionMap outputMap;
00498         
00499         if (returnConditionsOfOneClass((*typeIterator).first, category, object, (*conditionMap_).at(condChip-1), outputMap))
00500         {
00501 
00502             // special treatment for jet counts in buildCodChipParameters
00503             if (object !=JetCounts)
00504             {
00505                 std::string tempStr2 = particle.returnParameterMap()[stringConstantCommon_];
00506                 while (particle.findAndReplaceString(tempStr2,
00507                         sp(substParamParticle_), objType2Str_[object]))
00508                     ;
00509                 while (particle.findAndReplaceString(tempStr2,
00510                         sp(substParamType_), condType2Str_[(*typeIterator).first]))
00511                     ;
00512                 parameterStr+=(tempStr2+"\n\n");
00513 
00514                 //parameterStr+=(tempStr2+"<= '0';\n");
00515 
00516                 // remove this type since it was already processed
00517                 condType2Strcopy.erase(typeIterator);
00518             }
00519 
00520         }
00521 
00522         typeIterator++;
00523 
00524     }
00525 
00526     return true;
00527 }

std::string L1GtVhdlWriterCore::gtTemplatesPath (  ) 

returns the templates path

Definition at line 1031 of file L1GtVhdlWriterCore.cc.

References vhdlDir_.

01032 {
01033     return vhdlDir_;
01034 }

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 1376 of file L1GtVhdlWriterCore.cc.

References int2str().

Referenced by getCondChipVhdContentFromTriggerMenu().

01377 {
01378     intval++;
01379     return int2str(intval);
01380 }

void L1GtVhdlWriterCore::initializeDeltaConditions (  ) 

Definition at line 1793 of file L1GtVhdlWriterCore.cc.

References caloObjects_, ETM, i, iter, k, Mu, numberOfConditions_, objType2Str_, and retNumberOfConditionsString().

Referenced by makeFirmware().

01794 {
01795 
01796     for (unsigned int k=0; k<=1; k++)
01797     {
01798 
01799         // combine muon with calo particles
01800         for (unsigned int i=0; i<caloObjects_.size(); i++)
01801         {
01802             numberOfConditions_.at(k).push_back(retNumberOfConditionsString(objType2Str_[Mu]
01803                     +"_"+objType2Str_[caloObjects_.at(i)], 0));
01804         }
01805 
01806         // combine etm with muon
01807         numberOfConditions_.at(k).push_back(retNumberOfConditionsString(objType2Str_[ETM]+"_"
01808                 +objType2Str_[Mu], 0));
01809 
01810         // combine etm with calo particles
01811         for (unsigned int i=0; i<caloObjects_.size(); i++)
01812         {
01813             numberOfConditions_.at(k).push_back(retNumberOfConditionsString(objType2Str_[ETM]
01814                     +"_"+objType2Str_[caloObjects_.at(i)], 0));
01815         }
01816 
01817         std::vector<L1GtObject> caloObjectsCp = caloObjects_;
01818 
01819         while (caloObjectsCp.size()>0)
01820         {
01821             std::vector<L1GtObject>::iterator iter=caloObjectsCp.begin();
01822             L1GtObject firstPartner = (*iter);
01823             caloObjectsCp.erase(iter);
01824 
01825             iter=caloObjectsCp.begin();
01826             while (iter!=caloObjectsCp.end())
01827             {
01828                 numberOfConditions_.at(k).push_back(retNumberOfConditionsString(
01829                         objType2Str_[firstPartner]+"_"+objType2Str_[(*iter)], 0));
01830                 iter++;
01831             }
01832 
01833         }
01834 
01835     }
01836 }

std::string L1GtVhdlWriterCore::int2str ( const int integerValue  )  [static]

converts a integer into a string

Definition at line 1036 of file L1GtVhdlWriterCore.cc.

Referenced by addJetCountsToCond2IntMap(), getCondChipVhdContentFromTriggerMenu(), getDefValsFromTriggerMenu(), index4CondChipVhd(), printConditionsOfCategory(), retNumberOfConditionsString(), writeAlgoSetup(), writeConditionChipSetup(), writeDefValPkg(), writeEtmSetup(), and L1GtVmeWriterCore::writeVME().

01037 {
01038     std::ostringstream oss;
01039     oss<<integerValue;
01040     return oss.str();
01041 
01042 }

bool L1GtVhdlWriterCore::makeFirmware ( const std::vector< ConditionMap > &  conditionMap,
const AlgorithmMap algorithmMap 
)

produces the firmware code

Definition at line 916 of file L1GtVhdlWriterCore.cc.

References addJetCountsToCond2IntMap(), algorithmMap_, caloObjects_, conditionMap_, conditionToIntegerMap_, debugMode_, esumObjects_, getCaloSetupContentFromTriggerMenu(), getCondChipVhdContentFromTriggerMenu(), getEsumsSetupContentFromTriggerMenu(), getMuonSetupContentFromTriggerMenu(), i, initializeDeltaConditions(), objType2Str_, outputDir_, L1GtVhdlDefinitions::outputSubDir1_, L1GtVhdlDefinitions::outputSubDir2_, processAlgorithmMap(), indexGen::templates, version_, writeAlgoSetup(), writeCond2intMap2File(), writeCondChipPkg(), writeConditionChipSetup(), writeDefValPkg(), writeEtmSetup(), writeMuonSetupVhdl(), and writeQsfSetupFiles().

Referenced by L1GtVhdlWriter::analyze().

00918 {
00919     conditionMap_ = &conditionMap;
00920 
00921     algorithmMap_ = &algorithmMap;
00922     
00923     std::string subDir1 = outputDir_+outputSubDir1_;
00924     std::string subDir2  = outputDir_+outputSubDir2_;
00925     
00926     if (!mkdir(subDir1.c_str(), 666));
00927     if (!mkdir(subDir2.c_str(), 666));
00928     
00929     chmod(subDir1.c_str(), 0777);
00930     chmod(subDir2.c_str(), 0777);
00931     
00932     /*
00933     subDirs_.push_back(subDir1);
00934     subDirs_.push_back(subDir2);
00935     */
00936     
00937     writeQsfSetupFiles(version_);
00938     
00939     
00940     //--------------------------------------build setups-------------------------------------------------------
00941 
00942     // loop over the two condition chips
00943     for (unsigned short int i =1; i<=2; i++)
00944     {
00945         // ----------------------- muon setup -------------------------------------------------------
00946 
00947         std::map<std::string,std::string> muonParameters;
00948         getMuonSetupContentFromTriggerMenu(i, muonParameters);
00949         writeMuonSetupVhdl(muonParameters, "muon", i);
00950 
00951         // ----------------------- calo setup -------------------------------------------------------
00952 
00953         // map containing all calo object types correlated with the strings
00954         // under which they appear in the firmware
00955         std::vector<L1GtObject>::iterator caloObjIter = caloObjects_.begin();
00956 
00957         // loop over all calo objectsbuildMuonSetupVhdl
00958         while (caloObjIter != caloObjects_.end())
00959         {
00960             std::map<std::string,std::string> caloParameters;
00961             getCaloSetupContentFromTriggerMenu(i, caloParameters,
00962                     (*caloObjIter));
00963             writeMuonSetupVhdl(caloParameters, objType2Str_[(*caloObjIter)], i);
00964 
00965             caloObjIter++;
00966         }
00967 
00968         // ----------------------- etm setup ---------------------------------------------------------
00969 
00970         // map containing all calo object types correlated with the strings
00971         // under which they appear in the firmware
00972         std::vector<L1GtObject>::iterator esumObjIter = esumObjects_.begin();
00973 
00974         while (esumObjIter != esumObjects_.end())
00975         {
00976             std::string etmParameter;
00977 
00978             getEsumsSetupContentFromTriggerMenu(i, (*esumObjIter),
00979                     etmParameter);
00980             writeEtmSetup(etmParameter, i);
00981 
00982             esumObjIter++;
00983 
00984         }
00985 
00986         // add jet counts to condition 2 integer map
00987         addJetCountsToCond2IntMap(i, (*conditionMap_), conditionToIntegerMap_);
00988 
00989         // --------------------cond chip setup---------------------------------------------------------
00990         // Important: all other setups have to be build BEFORE this one because it needs a
00991         // complete condition2integer map !!!
00992 
00993         std::map<std::string, L1GtVhdlTemplateFile> templates;
00994         std::map<std::string, std::string> common;
00995         getCondChipVhdContentFromTriggerMenu(i, templates, common);
00996         writeConditionChipSetup(templates, common, i);
00997 
00998         // despite yet not existing they have to appear in cond_chip_pkg vhds
00999         initializeDeltaConditions();
01000 
01001         // --------------------cond chip pkg------------------------------------------------------------
01002 
01003         writeCondChipPkg(i);
01004 
01005         // -----------------------def val pkg -------------------------------------------------
01006 
01007         writeDefValPkg((*conditionMap_), i);
01008 
01009         // debug
01010         if (debugMode_)
01011         {
01012             //printConditionsOfCategory(CondEnergySum, (*conditionMap_).at(i-1));
01013         }
01014 
01015     }
01016 
01017     if (debugMode_)
01018         writeCond2intMap2File();
01019 
01020     //-------------------------------process algorithms----------------------------------------------------------
01021 
01022     std::vector< std::map<int, std::string> > algoStrings;
01023 
01024     processAlgorithmMap(algoStrings);
01025     
01026     writeAlgoSetup(algoStrings);
01027 
01028     return true;
01029 }

void L1GtVhdlWriterCore::msg ( const std::string &  message  ) 

adds a string to intern message buffer

Definition at line 1356 of file L1GtVhdlWriterCore.cc.

References internMessageBuf_.

Referenced by buildCommonHeader(), getCondChipVhdContentFromTriggerMenu(), printConditionsOfCategory(), and processAlgorithmMap().

01357 {
01358     internMessageBuf_.push_back(message);
01359 }

L1GtVhdlTemplateFile L1GtVhdlWriterCore::openVhdlFileWithCommonHeader ( const std::string &  filename,
const std::string &  outputFilename 
)

opens a new template file and inserts the common header

Definition at line 1073 of file L1GtVhdlWriterCore.cc.

References commonHeader_, L1GtVhdlTemplateFile::insert(), L1GtVhdlTemplateFile::substitute(), and vhdlDir_.

Referenced by writeAlgoSetup(), writeCondChipPkg(), writeConditionChipSetup(), writeDefValPkg(), writeEtmSetup(), and writeMuonSetupVhdl().

01075 {
01076     L1GtVhdlTemplateFile commonHeaderCp;
01077     commonHeaderCp = commonHeader_;
01078 
01079     commonHeaderCp.substitute("vhdl_file_name", outputFilename);
01080 
01081     L1GtVhdlTemplateFile myTemplate(vhdlDir_+"Templates/"+filename);
01082     myTemplate.insert("$(header)", commonHeaderCp);
01083 
01084     return myTemplate;
01085 }

void L1GtVhdlWriterCore::printCommonHeader (  ) 

prints the common header

Definition at line 1319 of file L1GtVhdlWriterCore.cc.

References commonHeader_, and L1GtVhdlTemplateFile::print().

01320 {
01321     commonHeader_.print();
01322 }

void L1GtVhdlWriterCore::printConditionsOfCategory ( const L1GtConditionCategory category,
const ConditionMap map 
)

for debuggin

Definition at line 1863 of file L1GtVhdlWriterCore.cc.

References counter(), int2str(), and msg().

01865 {
01866     int counter =0;
01867     for (ConditionMap::const_iterator iterCond = map.begin(); iterCond
01868             != map.end(); iterCond++)
01869     {
01870         msg(iterCond->first);
01871         counter++;
01872     }
01873 
01874     msg("Total Occurances: "+int2str(counter));
01875 
01876 }

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 823 of file L1GtVhdlWriterCore.cc.

References asciidump::at, conditionMap_, conditionToIntegerMap_, condType2Str_, debugMode_, dummy, L1GtVhdlTemplateFile::findAndReplaceString(), L1GtVhdlTemplateFile::getConditionsFromAlgo(), i, msg(), NULL, and objType2Str_.

Referenced by makeFirmware().

00824 {
00825     std::map<int, std::string> algorithmsChip1;
00826     std::map<int, std::string> algorithmsChip2;
00827     
00828     AlgorithmMap::const_iterator algoIter=(*algorithmMap_).begin();
00829 
00830     // loop over algorithm map
00831     while (algoIter!=(*algorithmMap_).end())
00832     {
00833         // msg(algoIter->first);
00834 
00835         L1GtVhdlTemplateFile dummy;
00836 
00837         // get the logical expression
00838         std::string logicalExpr = (algoIter->second).algoLogicalExpression();
00839         std::vector<std::string> conditions;
00840 
00841         dummy.getConditionsFromAlgo(logicalExpr, conditions);
00842 
00843         std::string logicalExprCopy= logicalExpr;
00844 
00845         // loop over all condition names appearing in algorithm and replace them by type and integer value
00846         for (unsigned int i=0; i<conditions.size(); i++)
00847         {
00848             std::ostringstream newExpr;
00849             
00850             // look for the condition on correct chip
00851            
00852             std::vector<ConditionMap> * conditionMapCp = const_cast< std::vector<ConditionMap>* >(conditionMap_);
00853             
00854             L1GtCondition* cond = (*conditionMapCp).at((algoIter->second).algoChipNumber())[conditions.at(i)];
00855 
00856             // check weather condition exists
00857             if (cond!=NULL)
00858             {
00859                 newExpr<<objType2Str_[(cond->objectType()).at(0)];
00860 
00861                 newExpr <<"_" << condType2Str_[cond->condType()] << "(";
00862 
00863                 newExpr << conditionToIntegerMap_[conditions.at(i)] << ")";
00864                 dummy.findAndReplaceString(logicalExpr, conditions.at(i),
00865                         newExpr.str());
00866             } else
00867                 msg("Panik! Didn't find Condition "+conditions.at(i));
00868         }
00869 
00870         // has to be checked!
00871         std::vector<int> orderConditionChip;
00872         orderConditionChip.push_back(2);
00873         orderConditionChip.push_back(1);
00874 
00875         int pin = (algoIter->second).algoOutputPin(2, 96, orderConditionChip);
00876 
00877         //msg(int2str(pin));
00878 
00879         if (pin<0)
00880             pin*=-1;
00881 
00882         if ((algoIter->second).algoChipNumber()==0)
00883         {
00884             algorithmsChip1[pin]=logicalExpr;
00885             if (debugMode_)
00886                 algorithmsChip1[pin]+=("-- "+logicalExprCopy);
00887         } else if ((algoIter->second).algoChipNumber()==1)
00888         {
00889             algorithmsChip2[pin]=logicalExpr;
00890             if (debugMode_)
00891                 algorithmsChip2[pin]+=("-- "+logicalExprCopy);
00892         } else
00893             ;
00894 
00895         algoIter++;
00896     }
00897 
00898     algoStrings.push_back(algorithmsChip1);
00899     algoStrings.push_back(algorithmsChip2);
00900     
00901     return true;
00902 
00903 }

std::string L1GtVhdlWriterCore::retNumberOfConditionsString ( const std::string &  typeStr,
const int number 
)

Definition at line 1905 of file L1GtVhdlWriterCore.cc.

References int2str(), and L1GtVhdlDefinitions::stringConstantConstantNr_.

Referenced by addJetCountsToCond2IntMap(), countCondsAndAdd2NumberVec(), and initializeDeltaConditions().

01907 {
01908     std::string initstr=stringConstantConstantNr_+typeStr+" : integer := "+int2str(number)
01909             +";";
01910 
01911     return initstr;
01912 }

L1GtVhdlTemplateFile L1GtVhdlWriterCore::retrunCommonHeader (  ) 

returns the common header

Definition at line 1324 of file L1GtVhdlWriterCore.cc.

References commonHeader_.

Referenced by L1GtVhdlWriter::analyze().

01325 {
01326     return commonHeader_;
01327 }

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..)

Parameters:
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 94 of file L1GtVhdlWriterCore.cc.

References StDecayID::status.

Referenced by addJetCountsToCond2IntMap(), countCondsAndAdd2NumberVec(), getDefValsFromTriggerMenu(), and getSubstParamCommonFromTriggerMenu().

00099 {
00100     bool status = false;
00101 
00102     ConditionMap::const_iterator condIter = map.begin();
00103     while (condIter!=map.end())
00104     {
00105         if (condIter->second->condCategory()==category
00106                 && condIter->second->condType()==type && (condIter->second->objectType())[0]==object)
00107         {
00108             outputMap[condIter->first]=condIter->second;
00109             status = true;
00110         }
00111         condIter++;
00112     }
00113 
00114     return status;
00115 }

std::string L1GtVhdlWriterCore::sp ( const std::string &  name  ) 

converts string name to substiution parameter synthax; name -->

Definition at line 1919 of file L1GtVhdlWriterCore.cc.

Referenced by buildDefValuesBuffer(), getCondChipVhdContentFromTriggerMenu(), getSubstParamCommonFromTriggerMenu(), and writeDefValPkg().

01920 {
01921     return "$("+name+")";
01922 }

void L1GtVhdlWriterCore::writeAlgoSetup ( std::vector< std::map< int, std::string > > &  algoStrings  ) 

builds the prealgo_and_or setup

Definition at line 1252 of file L1GtVhdlWriterCore.cc.

References chip2OutputSubDir(), lat::endl(), EgammaValidation_cff::filename, L1GtVhdlTemplateFile::findAndReplaceString(), i, int2str(), k, openVhdlFileWithCommonHeader(), iggi_31X_cfg::outputFileName, L1GtVhdlTemplateFile::save(), L1GtVhdlDefinitions::stringConstantAlgo_, L1GtVhdlTemplateFile::substitute(), L1GtVhdlDefinitions::substParamAlgos_, and L1GtVhdlDefinitions::vhdlTemplateAlgoAndOr_.

Referenced by makeFirmware().

01253 {
01254     // loop over the two condition chips
01255     for (unsigned int i=1; i<=2; i++)
01256     {
01257         std::string filename=vhdlTemplateAlgoAndOr_;
01258 
01259         // output file name
01260         std::string outputFileName = filename;
01261         L1GtVhdlTemplateFile::findAndReplaceString(outputFileName, ".",
01262                 int2str(i)+".");
01263 
01264         L1GtVhdlTemplateFile templateFile = openVhdlFileWithCommonHeader(
01265                 filename, outputFileName);
01266 
01267         std::ostringstream buffer;
01268         
01269         unsigned int algoPinsPerChip = 96;
01270 
01271         for (unsigned int k=1; k<=algoPinsPerChip; k++)
01272         {
01273 
01274             buffer<< stringConstantAlgo_<<"("<<k<<")";
01275             if (algoStrings.at(i-1)[k]!="")
01276                 buffer<<" <= "<<algoStrings.at(i-1)[k]<<";"<<std::endl;
01277             else
01278                 buffer<<" <= '0';"<<std::endl;
01279         }
01280 
01281         templateFile.substitute(substParamAlgos_, buffer.str());
01282         templateFile.save(chip2OutputSubDir(i)+filename);
01283         chmod((chip2OutputSubDir(i)+filename).c_str(), 0666);
01284     }
01285 
01286 }

void L1GtVhdlWriterCore::writeCond2intMap2File (  ) 

produces a control output file for condition to integer conversion

Definition at line 1432 of file L1GtVhdlWriterCore.cc.

References chip2OutputSubDir(), conditionMap_, conditionToIntegerMap_, lat::endl(), EgammaValidation_cff::filename, and i.

Referenced by makeFirmware().

01433 {
01434    
01435     
01436     for (unsigned int i=0; i<=1;i++)
01437     {
01438         ConditionMap::const_iterator iterCond =
01439             conditionMap_->at(i).begin();
01440        
01441         std::string filename=chip2OutputSubDir(i+1)+"cond_names_integer.txt";
01442         
01443         std::ofstream outputFile(filename.c_str());
01444         
01445         while (iterCond!=conditionMap_->at(i).end())
01446         {
01447             conditionToIntegerMap_[(*iterCond).first];
01448             
01449             outputFile<<(iterCond->first)<<": "<<conditionToIntegerMap_[(*iterCond).first]<<std::endl;
01450             iterCond++;
01451         }
01452         
01453         outputFile.close();
01454         
01455         chmod(filename.c_str(), 0666);
01456           
01457         
01458     }
01459    
01460     /*
01461     
01462     
01463     const std::vector<ConditionMap> * conditionMap_;
01464     
01465     std::string filename=outputDir_+"cond_names_integer.txt";
01466     std::ofstream outputFile(filename.c_str());
01467 
01468     for (std::map<std::string,int>::const_iterator iterCond =
01469             conditionToIntegerMap_.begin(); iterCond
01470             != conditionToIntegerMap_.end(); iterCond++)
01471     {
01472         outputFile<<(iterCond->first)<<": "<<(iterCond->second)<<std::endl;
01473     }
01474     
01475     */
01476 
01477 }

void L1GtVhdlWriterCore::writeCondChipPkg ( const int chip  ) 

Definition at line 1878 of file L1GtVhdlWriterCore.cc.

References chip2OutputSubDir(), EgammaValidation_cff::filename, L1GtVhdlTemplateFile::findAndReplaceString(), L1GtVhdlTemplateFile::insert(), numberOfConditions_, openVhdlFileWithCommonHeader(), L1GtVhdlTemplateFile::save(), L1GtVhdlTemplateFile::substitute(), version_, L1GtVhdlDefinitions::vhdlTemplateCondChipPkg1_, and L1GtVhdlDefinitions::vhdlTemplateCondChipPkg2_.

Referenced by makeFirmware().

01879 {
01880 
01881     // build filename
01882 
01883     std::string filename;
01884 
01885     if (chip==1)
01886         filename = vhdlTemplateCondChipPkg1_;
01887     else if (chip==2)
01888         filename = vhdlTemplateCondChipPkg2_;
01889 
01890     // write the output
01891     L1GtVhdlTemplateFile myTemplate = openVhdlFileWithCommonHeader(filename,
01892             filename);
01893     
01894     myTemplate.substitute("version",version_);
01895     
01896     myTemplate.insert("$(conditions_nr)", numberOfConditions_.at(chip-1));
01897    
01898     L1GtVhdlTemplateFile::findAndReplaceString(filename, "1","");
01899     L1GtVhdlTemplateFile::findAndReplaceString(filename, "2","");
01900     
01901     myTemplate.save(chip2OutputSubDir(chip)+filename);
01902     chmod((chip2OutputSubDir(chip)+filename).c_str(), 0666);
01903 }

void L1GtVhdlWriterCore::writeConditionChipSetup ( 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 1207 of file L1GtVhdlWriterCore.cc.

References chip2OutputSubDir(), EgammaValidation_cff::filename, L1GtVhdlTemplateFile::findAndReplaceString(), L1GtVhdlTemplateFile::insert(), int2str(), iter, openVhdlFileWithCommonHeader(), iggi_31X_cfg::outputFileName, L1GtVhdlTemplateFile::save(), L1GtVhdlTemplateFile::substitute(), and L1GtVhdlDefinitions::vhdlTemplateCondChip_.

Referenced by makeFirmware().

01211 {
01212 
01213     // get filename 
01214     std::string filename = vhdlTemplateCondChip_;
01215 
01216     // build output filename
01217     std::string outputFileName = filename;
01218     L1GtVhdlTemplateFile::findAndReplaceString(outputFileName, ".",
01219             int2str(chip)+".");
01220 
01221     L1GtVhdlTemplateFile myTemplate = openVhdlFileWithCommonHeader(filename,
01222             outputFileName);
01223 
01224     // map containing the subsitution parameters with their content (as L1GtVhdlTemplateFile file object)
01225     std::map<std::string, L1GtVhdlTemplateFile>::iterator iter=
01226             templates.begin();
01227 
01228     while (iter != templates.end())
01229     {
01230 
01231         myTemplate.insert("$("+(iter->first)+")", iter->second);
01232 
01233         iter++;
01234     }
01235 
01236     // subsitutes common parameters
01237     std::map<std::string, std::string>::const_iterator iter2= common.begin();
01238 
01239     while (iter2 != common.end())
01240     {
01241 
01242         myTemplate.substitute((iter2->first), iter2->second);
01243 
01244         iter2++;
01245     }
01246 
01247     myTemplate.save(chip2OutputSubDir(chip)+filename);
01248     chmod((chip2OutputSubDir(chip)+filename).c_str(), 0666);
01249 
01250 }

void L1GtVhdlWriterCore::writeDefValPkg ( const std::vector< ConditionMap > &  conditionMap,
const int chip 
)

writes def_val_pkg.vhd

Definition at line 1535 of file L1GtVhdlWriterCore.cc.

References buildDefValuesBuffer(), caloObjects_, chip2OutputSubDir(), condType2Str_, esumObjects_, EgammaValidation_cff::filename, L1GtVhdlTemplateFile::findAndReplaceString(), L1GtVhdlTemplateFile::getInternalParameter(), i, L1GtVhdlTemplateFile::insert(), int2str(), JetCounts, Mu, L1GtVhdlTemplateFile::open(), openVhdlFileWithCommonHeader(), L1GtVhdlTemplateFile::save(), sp(), 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().

01537 {
01538     // open internal template file
01539     L1GtVhdlTemplateFile internalTemplate;
01540     internalTemplate.open(vhdlDir_+"InternalTemplates/defvalpkg", true);
01541 
01542     // to write the def_value_pkg file it has to be looped over all POSSIBLE types of conditions
01543     // POSSIBLE: calo_3 eg. does not exist and therefore makes no sense..
01544 
01545     // Process muon conditions first
01546 
01547     // temporary buffers for the default value blocks (see internal templates) of the different types.
01548     // in the end those buffers are simply appended to the actual template!
01549     L1GtVhdlTemplateFile muonDefValuesBuffer, caloDefValuesBuffer,
01550             jetCountsDefValuesBuffer, esumsDefValBuffer;
01551 
01552     // Get the default value type strings from internal template
01553     std::vector<std::string> muonDefValTypes;
01554     muonDefValTypes.push_back(internalTemplate.getInternalParameter(stringConstantPtl_));
01555     muonDefValTypes.push_back(internalTemplate.getInternalParameter(stringConstantPth_));
01556     muonDefValTypes.push_back(internalTemplate.getInternalParameter(stringConstantQuality_));
01557     muonDefValTypes.push_back(internalTemplate.getInternalParameter(substParamCharge_));
01558 
01559     int jetCountsMaxIndex = 11;
01560 
01561     // fill jet counts vector (from 1 to 11)
01562     std::vector<std::string> jetCountsDefValTypes;
01563     for (int i = 0; i<=jetCountsMaxIndex; i++)
01564     {
01565         jetCountsDefValTypes.push_back(int2str(i));
01566     }
01567 
01568     // only one default value for calo objects therefore only a empty string
01569     std::vector<std::string> caloDefValTypes;
01570     caloDefValTypes.push_back("");
01571 
01572     // get types of esums defvalues (as firmware strings) from the internal templates
01573     std::vector<std::string> esumsDefValTypes;
01574     esumsDefValTypes.push_back(internalTemplate.getInternalParameter(stringConstantEsumsLow_));
01575     esumsDefValTypes.push_back(internalTemplate.getInternalParameter(stringConstantEsumsHigh_));
01576 
01577     std::map<L1GtConditionType,std::string>::iterator typeIter;
01578 
01579     // prepare a map with all muon relevant types by removing 
01580     // obsolete types from a copy of condType2Str_ map
01581     // should be improved
01582     std::map<L1GtConditionType,std::string> muonTypes = condType2Str_;
01583 
01584     typeIter=muonTypes.find(Type2cor);
01585     muonTypes.erase(typeIter);
01586     typeIter=muonTypes.find(TypeETM);
01587     muonTypes.erase(typeIter);
01588     typeIter=muonTypes.find(TypeETT);
01589     muonTypes.erase(typeIter);
01590     typeIter=muonTypes.find(TypeHTT);
01591     muonTypes.erase(typeIter);
01592     typeIter=muonTypes.find(TypeJetCounts);
01593     muonTypes.erase(typeIter);
01594 
01595     std::map<L1GtConditionType,std::string> caloTypes = muonTypes;
01596     typeIter=caloTypes.find(Type3s);
01597     caloTypes.erase(typeIter);
01598 
01599     // dummy type in order to be able to use the same code as for calo and muon
01600     // this map is also used for esums since there is no difference in treatment 
01601     std::map<L1GtConditionType,std::string> jetCountsTypes;
01602     jetCountsTypes[TypeJetCounts] = "";
01603 
01604     // here the DefValuesBuffer are build (=objects of the class L1GtVhdlTemplateFile
01605     // that are containing all default values and finally can be inserted into the
01606     // def_val_pkg.vhd template
01607 
01608     buildDefValuesBuffer(muonDefValuesBuffer, muonTypes, muonDefValTypes, Mu);
01609 
01610     // loop over all possible calo objects here
01611     for (unsigned int i=0; i<caloObjects_.size(); i++)
01612     {
01613         buildDefValuesBuffer(caloDefValuesBuffer, caloTypes, caloDefValTypes,
01614                 caloObjects_.at(i));
01615     }
01616 
01617     // loop over all possible esums objects here
01618     for (unsigned int i=0; i<esumObjects_.size(); i++)
01619     {
01620         buildDefValuesBuffer(esumsDefValBuffer, jetCountsTypes,
01621                 esumsDefValTypes, esumObjects_.at(i));
01622     }
01623 
01624     // same procedure for jet counts
01625     buildDefValuesBuffer(esumsDefValBuffer, jetCountsTypes,
01626             jetCountsDefValTypes, JetCounts);
01627 
01628     //----------------------In this section the actual output file is written----------------
01629 
01630     // now open the actual template file:
01631 
01632     std::string filename = vhdlTemplateDefValPkg_;
01633 
01634     std::string outputFile = filename;
01635 
01636     // modify output filename
01637     L1GtVhdlTemplateFile::findAndReplaceString(outputFile, ".", int2str(chip)
01638             +".");
01639     L1GtVhdlTemplateFile defValTemplate = openVhdlFileWithCommonHeader(
01640             filename, outputFile);
01641 
01642     // insert the temporary buffers to the template
01643 
01644     // muon default values
01645     defValTemplate.insert(sp(substParamMuonDefVals_), muonDefValuesBuffer);
01646 
01647     // calo default values
01648     defValTemplate.insert(sp(substParamCaloDefVals_), caloDefValuesBuffer);
01649 
01650     // esums default values
01651     defValTemplate.insert(sp(substParamEsumsDefVals_), esumsDefValBuffer);
01652 
01653     // jet counts default values
01654     defValTemplate.insert(sp(substParamJetsDefVals_), jetCountsDefValuesBuffer);
01655 
01656     // close and save the file
01657     
01658     L1GtVhdlTemplateFile::findAndReplaceString(outputFile, "1","");
01659     L1GtVhdlTemplateFile::findAndReplaceString(outputFile, "2","");
01660     
01661     defValTemplate.save(chip2OutputSubDir(chip)+outputFile);
01662     chmod((chip2OutputSubDir(chip)+outputFile).c_str(), 0666);
01663 
01664 }

void L1GtVhdlWriterCore::writeEtmSetup ( std::string &  etmString,
const int condChip 
)

builds etm setup files

Definition at line 1288 of file L1GtVhdlWriterCore.cc.

References chip2OutputSubDir(), EgammaValidation_cff::filename, L1GtVhdlTemplateFile::findAndReplaceString(), int2str(), openVhdlFileWithCommonHeader(), L1GtVhdlTemplateFile::save(), L1GtVhdlTemplateFile::substitute(), and L1GtVhdlDefinitions::vhdlTemplateEtmSetup_.

Referenced by makeFirmware().

01290 {
01291 
01292     // get filename
01293     std::string filename= vhdlTemplateEtmSetup_;
01294     std::string outputFile = filename;
01295 
01296     L1GtVhdlTemplateFile myTemplate;
01297 
01298     // modify output filename
01299     myTemplate.findAndReplaceString(outputFile, ".", int2str(condChip)+".");
01300 
01301     myTemplate = openVhdlFileWithCommonHeader(filename, filename);
01302 
01303     // replace all occurances of $(particle)
01304     while (myTemplate.substitute("particle", "etm"))
01305         while (myTemplate.substitute("particle", "etm"))
01306             ;
01307 
01308     // delete last char if it is \n
01309     if (etmString[etmString.length()-1] == '\n')
01310         etmString = etmString.substr(0, etmString.length()-1);
01311 
01312     myTemplate.substitute("phi", etmString);
01313 
01314     myTemplate.save(chip2OutputSubDir(condChip)+filename);
01315     chmod((chip2OutputSubDir(condChip)+filename).c_str(), 0666);
01316 
01317 }

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 1087 of file L1GtVhdlWriterCore.cc.

References L1GtVhdlTemplateFile::append(), chip2OutputSubDir(), EgammaValidation_cff::filename, L1GtVhdlTemplateFile::findAndReplaceString(), L1GtVhdlTemplateFile::getSubstitutionParametersFromTemplate(), i, L1GtVhdlTemplateFile::insert(), iter, L1GtVhdlTemplateFile::open(), openVhdlFileWithCommonHeader(), L1GtVhdlTemplateFile::removeLineWithContent(), L1GtVhdlTemplateFile::returnParameterMap(), L1GtVhdlTemplateFile::save(), L1GtVhdlTemplateFile::substitute(), vhdlDir_, L1GtVhdlDefinitions::vhdlTemplateCaloSetup_, and L1GtVhdlDefinitions::vhdlTemplateMuonSetup_.

Referenced by makeFirmware().

01090 {
01091     std::string filename;
01092 
01093     L1GtVhdlTemplateFile muonTemplate, internalTemplate, internalTemplateCopy;
01094 
01095     // choose the correct template file name
01096     if (particle=="muon")
01097     {
01098         filename = vhdlTemplateMuonSetup_;
01099         internalTemplate.open(vhdlDir_+"InternalTemplates/muonsetup", true);
01100     } else
01101     {
01102         filename = vhdlTemplateCaloSetup_;
01103         internalTemplate.open(vhdlDir_+"InternalTemplates/calosetup", true);
01104     }
01105 
01106     std::string outputFile;
01107     outputFile = filename;
01108 
01109     // modify filename
01110     if (particle!="muon")
01111         muonTemplate.findAndReplaceString(outputFile, "calo", particle);
01112 
01113     // add condition chip index to output filename
01114     //muonTemplate.findAndReplaceString(outputFile, ".", int2str(condChip)+".");
01115 
01116     // open the template file and insert header
01117     muonTemplate = openVhdlFileWithCommonHeader(filename, outputFile);
01118 
01119     std::map<std::string,std::string> parameterMap =
01120             internalTemplate.returnParameterMap();
01121 
01122     std::vector<std::string> substitutionParameters;
01123 
01124     // fills the map with all substitution parameters of the template file
01125     substitutionParameters=muonTemplate.getSubstitutionParametersFromTemplate();
01126 
01127     // insert a emty line at the end of each block
01128     internalTemplate.append("");
01129 
01130     std::map<std::string, std::string>::iterator iter;
01131 
01132     // loop over all substitution parameters that have been extracted from the template file
01133     for (unsigned int i=0; i<substitutionParameters.size(); i++)
01134     {
01135         // make a working copy of the template file
01136         internalTemplateCopy = internalTemplate;
01137 
01138         // choose which of the three constant template strings to take - only for calo!
01139         if (particle!="muon")
01140         {
01141 
01142             if (substitutionParameters.at(i).substr(0, 3) == "eta")
01143                 internalTemplateCopy.substitute("constant", parameterMap["eta"]);
01144             else if (substitutionParameters.at(i).substr(0, 3) == "phi")
01145                 internalTemplateCopy.substitute("constant", parameterMap["phi"]);
01146             else if (substitutionParameters.at(i).substr(0, 3) == "del"/*ta*/)
01147             {
01148                 internalTemplateCopy.substitute("constant",
01149                         parameterMap["delta"]);
01150                 while (internalTemplateCopy.substitute("delta",
01151                         substitutionParameters[i]))
01152                     internalTemplateCopy.substitute("delta",
01153                             substitutionParameters[i]);
01154 
01155             }
01156         }
01157 
01158         if (particle=="muon")
01159         {
01160         // final preparation of the internal template before it is inserted in the actual template file
01161         internalTemplateCopy.substitute("type", substitutionParameters[i]);
01162         } else
01163             
01164         {
01165             internalTemplateCopy.substitute("type", substitutionParameters[i].substr(4)); 
01166         }
01167 
01168         // subsitute the second occurance of type without "_l" and "_h"
01169 
01170         std::string paramCopy = substitutionParameters[i];
01171 
01172         internalTemplateCopy.findAndReplaceString(paramCopy, "_l", "");
01173         internalTemplateCopy.findAndReplaceString(paramCopy, "_h", "");
01174 
01175         internalTemplateCopy.substitute("type2", paramCopy);
01176 
01177         internalTemplateCopy.substitute("others",
01178                 parameterMap[substitutionParameters[i]]);
01179 
01180         // replace all the occurances of "particle"
01181         while (muonTemplate.substitute("particle", particle))
01182             muonTemplate.substitute("particle", particle);
01183 
01184         // remove the the parameter $(content) if its empty
01185         iter=muonParameters.find(substitutionParameters[i]);
01186 
01187         // check weather this parameter exists
01188         if (iter!=muonParameters.end())
01189         {
01190             if ((*iter).second[(*iter).second.length()-1]=='\n')
01191                 (*iter).second[(*iter).second.length()-1]=' ';
01192             internalTemplateCopy.substitute("content", (*iter).second);
01193         } else
01194             internalTemplateCopy.removeLineWithContent("$(content)");
01195 
01196         // insert the processed internal template in the muon template file
01197         muonTemplate.insert("$("+substitutionParameters[i]+")",
01198                 internalTemplateCopy);
01199     }
01200 
01201     // save the muon template file
01202     muonTemplate.save(chip2OutputSubDir(condChip)+outputFile);
01203     chmod((chip2OutputSubDir(condChip)+outputFile).c_str(), 0666);
01204 
01205 }

void L1GtVhdlWriterCore::writeQsfSetupFiles ( const std::string &  version  ) 

builds the two quartus setup files. This routine is called in buildCommonHeader!

Definition at line 1329 of file L1GtVhdlWriterCore.cc.

References chip2OutputSubDir(), cmsPerfCommons::filenames, L1GtVhdlTemplateFile::findAndReplaceString(), i, L1GtVhdlTemplateFile::open(), L1GtVhdlDefinitions::quartusSetupFileChip1_, L1GtVhdlDefinitions::quartusSetupFileChip2_, L1GtVhdlTemplateFile::save(), L1GtVhdlTemplateFile::substitute(), and vhdlDir_.

Referenced by makeFirmware().

01330 {
01331 
01332     std::vector<std::string> filenames;
01333     filenames.push_back(quartusSetupFileChip1_);
01334     filenames.push_back(quartusSetupFileChip2_);
01335 
01336     for (unsigned int i=0; i<filenames.size(); i++)
01337     {
01338         L1GtVhdlTemplateFile myTemplate;
01339 
01340         myTemplate.open(vhdlDir_+"Templates/"+filenames.at(i));
01341         myTemplate.substitute("version", version);
01342 
01343         std::string tempStr = filenames.at(i);
01344         
01345         if (i==0)
01346             L1GtVhdlTemplateFile::findAndReplaceString(tempStr , "cond1","cond");
01347         if (i==1)
01348             L1GtVhdlTemplateFile::findAndReplaceString(tempStr , "cond2","cond");
01349         
01350         myTemplate.save(chip2OutputSubDir(i+1)+tempStr);
01351         chmod((chip2OutputSubDir(i+1)+tempStr).c_str(), 0666);
01352     }
01353 
01354 }


Member Data Documentation

const AlgorithmMap* L1GtVhdlWriterCore::algorithmMap_ [private]

algorithm map

Definition at line 199 of file L1GtVhdlWriterCore.h.

Referenced by makeFirmware().

L1GtVhdlWriterBitManager L1GtVhdlWriterCore::bm_ [private]

bit manager for bit operations

Definition at line 226 of file L1GtVhdlWriterCore.h.

Referenced by getCaloSetupContentFromTriggerMenu(), getEsumsSetupContentFromTriggerMenu(), and getMuonSetupContentFromTriggerMenu().

std::vector<L1GtObject> L1GtVhdlWriterCore::caloObjects_ [private]

list of all possible calo objects

Definition at line 214 of file L1GtVhdlWriterCore.h.

Referenced by getCondChipVhdContentFromTriggerMenu(), initializeDeltaConditions(), L1GtVhdlWriterCore(), makeFirmware(), and writeDefValPkg().

std::map<L1GtObject,std::string> L1GtVhdlWriterCore::caloType2Int_ [private]

converts L1GtObject to calo_nr

Reimplemented from L1GtVhdlDefinitions.

Definition at line 208 of file L1GtVhdlWriterCore.h.

Referenced by getCondChipVhdContentFromTriggerMenu(), and L1GtVhdlWriterCore().

L1GtVhdlTemplateFile L1GtVhdlWriterCore::commonHeader_ [private]

common header for all files

Definition at line 231 of file L1GtVhdlWriterCore.h.

Referenced by buildCommonHeader(), openVhdlFileWithCommonHeader(), printCommonHeader(), and retrunCommonHeader().

const std::vector<ConditionMap>* L1GtVhdlWriterCore::conditionMap_ [private]

condition map

Definition at line 196 of file L1GtVhdlWriterCore.h.

Referenced by makeFirmware(), processAlgorithmMap(), and writeCond2intMap2File().

std::map<std::string,int> L1GtVhdlWriterCore::conditionToIntegerMap_ [private]

stores to condition name to integer conversion table

Definition at line 202 of file L1GtVhdlWriterCore.h.

Referenced by getCaloSetupContentFromTriggerMenu(), getCond2IntMap(), getCondChipVhdContentFromTriggerMenu(), getEsumsSetupContentFromTriggerMenu(), getMuonSetupContentFromTriggerMenu(), makeFirmware(), processAlgorithmMap(), and writeCond2intMap2File().

std::map<L1GtConditionType,std::string> L1GtVhdlWriterCore::condType2Str_ [private]

converts L1GtConditionType to firmware string

Reimplemented from L1GtVhdlDefinitions.

Definition at line 205 of file L1GtVhdlWriterCore.h.

Referenced by buildDefValuesBuffer(), countCondsAndAdd2NumberVec(), getCondChipVhdContentFromTriggerMenu(), getSubstParamCommonFromTriggerMenu(), L1GtVhdlWriterCore(), processAlgorithmMap(), and writeDefValPkg().

bool L1GtVhdlWriterCore::debugMode_ [private]

class will produce some additional debugging output if set

Definition at line 239 of file L1GtVhdlWriterCore.h.

Referenced by getCaloSetupContentFromTriggerMenu(), getEsumsSetupContentFromTriggerMenu(), getMuonSetupContentFromTriggerMenu(), L1GtVhdlWriterCore(), makeFirmware(), and processAlgorithmMap().

std::vector<L1GtObject> L1GtVhdlWriterCore::esumObjects_ [private]

list of all possible esums objects

Definition at line 217 of file L1GtVhdlWriterCore.h.

Referenced by getCondChipVhdContentFromTriggerMenu(), L1GtVhdlWriterCore(), makeFirmware(), and writeDefValPkg().

std::vector<std::string> L1GtVhdlWriterCore::internMessageBuf_ [private]

Definition at line 233 of file L1GtVhdlWriterCore.h.

Referenced by getMsgBuf(), and msg().

std::vector<std::vector<std::string> > L1GtVhdlWriterCore::numberOfConditions_ [private]

vector containing the initialization of all conditions

Definition at line 236 of file L1GtVhdlWriterCore.h.

Referenced by addJetCountsToCond2IntMap(), countCondsAndAdd2NumberVec(), initializeDeltaConditions(), L1GtVhdlWriterCore(), and writeCondChipPkg().

std::map<L1GtObject,std::string> L1GtVhdlWriterCore::objType2Str_ [private]

converts L1GtObject to string

Reimplemented from L1GtVhdlDefinitions.

Definition at line 211 of file L1GtVhdlWriterCore.h.

Referenced by buildDefValuesBuffer(), countCondsAndAdd2NumberVec(), getCondChipVhdContentFromTriggerMenu(), getSubstParamCommonFromTriggerMenu(), initializeDeltaConditions(), L1GtVhdlWriterCore(), makeFirmware(), and processAlgorithmMap().

std::string L1GtVhdlWriterCore::outputDir_ [private]

output directory

Definition at line 223 of file L1GtVhdlWriterCore.h.

Referenced by chip2OutputSubDir(), L1GtVhdlWriterCore(), and makeFirmware().

std::string L1GtVhdlWriterCore::version_ [private]

Definition at line 228 of file L1GtVhdlWriterCore.h.

Referenced by buildCommonHeader(), makeFirmware(), and writeCondChipPkg().

std::string L1GtVhdlWriterCore::vhdlDir_ [private]

templates directory

Definition at line 220 of file L1GtVhdlWriterCore.h.

Referenced by buildCommonHeader(), buildDefValuesBuffer(), getCondChipVhdContentFromTriggerMenu(), gtTemplatesPath(), L1GtVhdlWriterCore(), openVhdlFileWithCommonHeader(), writeDefValPkg(), writeMuonSetupVhdl(), and writeQsfSetupFiles().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:26:47 2009 for CMSSW by  doxygen 1.5.4