CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1GtVmeWriterCore Class Reference

#include <L1GtVmeWriterCore.h>

Inheritance diagram for L1GtVmeWriterCore:
L1GtXmlParserTags

Public Member Functions

std::string calculateAddress (const L1GtObject &obj, const L1GtConditionType &type, const std::string &reg, const int &index)
 calculates address More...
 
std::string calculateJetsAddress (const int &countIndex, const int &obj, const int &index)
 calculates addresses for jets counts More...
 
std::string closeTag (const std::string &tag)
 closes xml tag More...
 
int condIndex2reg (const unsigned int &index)
 
 L1GtVmeWriterCore (const std::string &outputDir, const std::string &vmeXmlFile)
 constructor More...
 
std::string openTag (const std::string &tag)
 opens a new xml tag More...
 
std::string spaces (const unsigned int &level)
 returns a string containing spaces dependant on level More...
 
std::string vmeAddrValueBlock (const std::string &addr, const int &val, const int &spaceLevel, const bool setMsb=false)
 builds a address value block More...
 
void writeVME (const std::vector< ConditionMap > &conditionMap, const std::map< std::string, int > &cond2intMap, const L1GtVhdlTemplateFile &header, const int spacesPerLevel=2)
 
 ~L1GtVmeWriterCore () override
 destructor More...
 
- Public Member Functions inherited from L1GtXmlParserTags
 L1GtXmlParserTags ()
 constructor More...
 
virtual ~L1GtXmlParserTags ()
 destructor More...
 

Private Attributes

std::map< int, int > jetObj2reg_
 
std::map< int, int > jetType2reg_
 
std::string m_outputDir
 output directory More...
 
std::string m_vmeXmlFile
 output file More...
 
std::map< L1GtObject, int > object2reg_
 
std::map< std::string, int > reg2hex_
 
int spacesPerLevel_
 
std::map< L1GtConditionType, int > type2reg_
 

Additional Inherited Members

- Static Protected Attributes inherited from L1GtXmlParserTags
static const std::string m_xmlAlgorithmAttrAlias
 
static const std::string m_xmlAttrMax
 
static const std::string m_xmlAttrMode
 
static const std::string m_xmlAttrModeBit
 
static const std::string m_xmlAttrNr
 
static const std::string m_xmlAttrPin
 
static const std::string m_xmlAttrPinA
 
static const std::string m_xmlConditionAttrCondition
 
static const std::string m_xmlConditionAttrConditionBptx
 
static const std::string m_xmlConditionAttrConditionCalo
 
static const std::string m_xmlConditionAttrConditionCastor
 
static const std::string m_xmlConditionAttrConditionCorrelation
 
static const std::string m_xmlConditionAttrConditionEnergySum
 
static const std::string m_xmlConditionAttrConditionExternal
 
static const std::string m_xmlConditionAttrConditionHfBitCounts
 
static const std::string m_xmlConditionAttrConditionHfRingEtSums
 
static const std::string m_xmlConditionAttrConditionJetCounts
 
static const std::string m_xmlConditionAttrConditionMuon
 
static const std::string m_xmlConditionAttrObject
 
static const std::string m_xmlConditionAttrObjectBptx
 
static const std::string m_xmlConditionAttrObjectCastor
 
static const std::string m_xmlConditionAttrObjectCenJet
 
static const std::string m_xmlConditionAttrObjectETM
 
static const std::string m_xmlConditionAttrObjectETT
 
static const std::string m_xmlConditionAttrObjectForJet
 
static const std::string m_xmlConditionAttrObjectGtExternal
 
static const std::string m_xmlConditionAttrObjectHfBitCounts
 
static const std::string m_xmlConditionAttrObjectHfRingEtSums
 
static const std::string m_xmlConditionAttrObjectHTM
 
static const std::string m_xmlConditionAttrObjectHTT
 
static const std::string m_xmlConditionAttrObjectIsoEG
 
static const std::string m_xmlConditionAttrObjectJetCounts
 
static const std::string m_xmlConditionAttrObjectMu
 
static const std::string m_xmlConditionAttrObjectNoIsoEG
 
static const std::string m_xmlConditionAttrObjectTauJet
 
static const std::string m_xmlConditionAttrType
 
static const std::string m_xmlConditionAttrType1s
 
static const std::string m_xmlConditionAttrType2cor
 
static const std::string m_xmlConditionAttrType2s
 
static const std::string m_xmlConditionAttrType2wsc
 
static const std::string m_xmlConditionAttrType3s
 
static const std::string m_xmlConditionAttrType4s
 
static const std::string m_xmlConditionAttrTypeBptx
 
static const std::string m_xmlConditionAttrTypeCastor
 
static const std::string m_xmlConditionAttrTypeExternal
 
static const std::string m_xmlTagAlgorithms
 
static const std::string m_xmlTagCa
 
static const std::string m_xmlTagChargeCorrelation
 
static const std::string m_xmlTagChip
 
static const std::string m_xmlTagChip1
 
static const std::string m_xmlTagChipDef
 
static const std::string m_xmlTagConditions
 
static const std::string m_xmlTagCountOverflow
 
static const std::string m_xmlTagCountThreshold
 
static const std::string m_xmlTagDef
 
static const std::string m_xmlTagDeltaEta
 
static const std::string m_xmlTagDeltaPhi
 
static const std::string m_xmlTagEnableIso
 
static const std::string m_xmlTagEnableMip
 
static const std::string m_xmlTagEnergyOverflow
 
static const std::string m_xmlTagEta
 
static const std::string m_xmlTagEtThreshold
 
static const std::string m_xmlTagGEq
 
static const std::string m_xmlTagHeader
 
static const std::string m_xmlTagMenuAlgImpl
 
static const std::string m_xmlTagMenuAuthor
 
static const std::string m_xmlTagMenuDate
 
static const std::string m_xmlTagMenuDescription
 
static const std::string m_xmlTagMenuInterface
 
static const std::string m_xmlTagMenuInterfaceAuthor
 
static const std::string m_xmlTagMenuInterfaceDate
 
static const std::string m_xmlTagMenuInterfaceDescription
 
static const std::string m_xmlTagOutput
 
static const std::string m_xmlTagOutputPin
 
static const std::string m_xmlTagPhi
 
static const std::string m_xmlTagPhiHigh
 
static const std::string m_xmlTagPhiLow
 
static const std::string m_xmlTagPtHighThreshold
 
static const std::string m_xmlTagPtLowThreshold
 
static const std::string m_xmlTagQuality
 
static const std::string m_xmlTagRequestIso
 
static const std::string m_xmlTagScaleDbKey
 
static const std::string m_xmlTagTechTriggers
 
static const std::string m_xmlTagValue
 
static const std::string m_xmlTagVme
 
static const std::string m_xmlTagVmeAddress
 

Detailed Description

Description: core class to write the VME xml file.
Implementation: Core class to write the VME xml file: L1GtVmeWriter is an EDM wrapper for this class. L1GtVmeWriterCore can also be used in L1 Trigger Supervisor framework, with another wrapper - it must be therefore EDM-framework free.

Author
: Vasile Mihai Ghete - HEPHY Vienna

Description: core class to write the VME xml file.

Implementation: Core class to write the VME xml file: L1GtVmeWriter is an EDM wrapper for this class. L1GtVmeWriterCore can also be used in L1 Trigger Supervisor framework, with another wrapper - it must be therefore EDM-framework free.

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 34 of file L1GtVmeWriterCore.h.

Constructor & Destructor Documentation

◆ L1GtVmeWriterCore()

L1GtVmeWriterCore::L1GtVmeWriterCore ( const std::string &  outputDir,
const std::string &  vmeXmlFile 
)

constructor

Definition at line 39 of file L1GtVmeWriterCore.cc.

References CenJet, ETM, ETT, ForJet, HTT, IsoEG, jetObj2reg_, jetType2reg_, L1GtXmlParserTags::m_xmlTagChargeCorrelation, L1GtXmlParserTags::m_xmlTagEtThreshold, L1GtXmlParserTags::m_xmlTagPtHighThreshold, L1GtXmlParserTags::m_xmlTagPtLowThreshold, L1GtXmlParserTags::m_xmlTagQuality, Mu, NoIsoEG, object2reg_, reg2hex_, spacesPerLevel_, TauJet, Type1s, type2reg_, Type2s, Type2wsc, Type3s, Type4s, TypeETM, TypeETT, and TypeHTT.

40  : m_outputDir(outputDir), m_vmeXmlFile(vmeXmlFile) {
41  object2reg_[Mu] = 0x00A0000;
42  object2reg_[NoIsoEG] = 0x0020000;
43  object2reg_[IsoEG] = 0x0000000;
44  object2reg_[ForJet] = 0x0080000;
45  object2reg_[TauJet] = 0x0060000;
46  object2reg_[CenJet] = 0x0040000;
47  object2reg_[HTT] = 0x0100000;
48  object2reg_[ETT] = 0x0100000;
49  object2reg_[ETM] = 0x0100000;
50 
51  type2reg_[Type1s] = 0x000C000;
52  type2reg_[Type2s] = 0x0004000;
53  type2reg_[Type2wsc] = 0x0008000;
54  type2reg_[Type3s] = 0x0010000;
55  type2reg_[Type4s] = 0x0000000;
56  type2reg_[TypeETM] = 0x0004000;
57  type2reg_[TypeETT] = 0x0000000;
58  type2reg_[TypeHTT] = 0x0008000;
59 
60  reg2hex_[m_xmlTagEtThreshold + "_1"] = 0x0000000;
61  reg2hex_[m_xmlTagEtThreshold + "_2"] = 0x0000002;
62  reg2hex_[m_xmlTagEtThreshold + "_3"] = 0x0000004;
63  reg2hex_[m_xmlTagEtThreshold + "_4"] = 0x0000006;
64  reg2hex_[m_xmlTagPtHighThreshold + "_1"] = 0x0000000;
65  reg2hex_[m_xmlTagPtHighThreshold + "_2"] = 0x0000002;
66  reg2hex_[m_xmlTagPtHighThreshold + "_3"] = 0x0000004;
67  reg2hex_[m_xmlTagPtHighThreshold + "_4"] = 0x0000006;
68  reg2hex_[m_xmlTagQuality + "_1"] = 0x0000050;
69  reg2hex_[m_xmlTagQuality + "_2"] = 0x0000052;
70  reg2hex_[m_xmlTagQuality + "_3"] = 0x0000054;
71  reg2hex_[m_xmlTagQuality + "_4"] = 0x0000056;
72  reg2hex_[m_xmlTagPtLowThreshold + "_1"] = 0x0000058;
73  reg2hex_[m_xmlTagPtLowThreshold + "_2"] = 0x000005A;
74  reg2hex_[m_xmlTagPtLowThreshold + "_3"] = 0x000005C;
75  reg2hex_[m_xmlTagPtLowThreshold + "_4"] = 0x000005E;
77  reg2hex_["jet_cnt_threshold"] = 0x0000000;
78  reg2hex_["threshold_lsb"] = 0x0000000;
79  reg2hex_["threshold_msb"] = 0x0000002;
80 
81  // sepcial maps for jet counts
82  jetType2reg_[0] = 0x0000000;
83  jetType2reg_[1] = 0x0004000;
84  jetType2reg_[2] = 0x0008000;
85  jetType2reg_[3] = 0x000C000;
86  jetType2reg_[4] = 0x0010000;
87  jetType2reg_[5] = 0x0014000;
88 
89  jetObj2reg_[0] = 0x00C0000;
90  jetObj2reg_[1] = 0x00E0000;
91 
92  spacesPerLevel_ = 2;
93 }
std::map< int, int > jetType2reg_
std::string m_outputDir
output directory
Definition: L1GtObject.h:35
static const std::string m_xmlTagEtThreshold
Definition: L1GtObject.h:37
static const std::string m_xmlTagChargeCorrelation
std::map< L1GtObject, int > object2reg_
static const std::string m_xmlTagPtHighThreshold
std::string m_vmeXmlFile
output file
std::map< L1GtConditionType, int > type2reg_
static const std::string m_xmlTagPtLowThreshold
Definition: L1GtObject.h:29
std::map< std::string, int > reg2hex_
Definition: L1GtObject.h:36
static const std::string m_xmlTagQuality
std::map< int, int > jetObj2reg_

◆ ~L1GtVmeWriterCore()

L1GtVmeWriterCore::~L1GtVmeWriterCore ( )
override

destructor

Definition at line 96 of file L1GtVmeWriterCore.cc.

96  {
97  // empty now
98 }

Member Function Documentation

◆ calculateAddress()

std::string L1GtVmeWriterCore::calculateAddress ( const L1GtObject obj,
const L1GtConditionType type,
const std::string &  reg,
const int &  index 
)

calculates address

Definition at line 117 of file L1GtVmeWriterCore.cc.

References cms::cuda::bs, edmScanValgrind::buffer, condIndex2reg(), getGTfromDQMFile::obj, object2reg_, reg2hex_, mps_fire::result, and type2reg_.

Referenced by writeVME().

120  {
122 
123  std::bitset<25> bs(result);
124 
125  std::ostringstream buffer;
126  buffer << bs;
127  return buffer.str();
128 }
std::map< L1GtObject, int > object2reg_
std::map< L1GtConditionType, int > type2reg_
std::map< std::string, int > reg2hex_
int condIndex2reg(const unsigned int &index)

◆ calculateJetsAddress()

std::string L1GtVmeWriterCore::calculateJetsAddress ( const int &  countIndex,
const int &  obj,
const int &  index 
)

calculates addresses for jets counts

Definition at line 106 of file L1GtVmeWriterCore.cc.

References cms::cuda::bs, edmScanValgrind::buffer, condIndex2reg(), jetObj2reg_, jetType2reg_, getGTfromDQMFile::obj, reg2hex_, and mps_fire::result.

Referenced by writeVME().

106  {
107  int result = jetType2reg_[countIndex] + jetObj2reg_[obj] + reg2hex_["jet_cnt_threshold"] + condIndex2reg(index);
108 
109  std::bitset<24> bs(result);
110 
111  std::ostringstream buffer;
112  buffer << bs;
113 
114  return buffer.str();
115 }
std::map< int, int > jetType2reg_
std::map< std::string, int > reg2hex_
int condIndex2reg(const unsigned int &index)
std::map< int, int > jetObj2reg_

◆ closeTag()

std::string L1GtVmeWriterCore::closeTag ( const std::string &  tag)

closes xml tag

Definition at line 133 of file L1GtVmeWriterCore.cc.

References makeGlobalPositionRcd_cfg::tag.

Referenced by vmeAddrValueBlock(), and writeVME().

133 { return "</" + tag + ">\n"; }

◆ condIndex2reg()

int L1GtVmeWriterCore::condIndex2reg ( const unsigned int &  index)

conversion algorithm for condition index to hex value used to calculate address values

Definition at line 100 of file L1GtVmeWriterCore.cc.

Referenced by calculateAddress(), and calculateJetsAddress().

100  {
101  int indexcp = index;
102 
103  return (indexcp << 8);
104 }

◆ openTag()

std::string L1GtVmeWriterCore::openTag ( const std::string &  tag)

opens a new xml tag

Definition at line 131 of file L1GtVmeWriterCore.cc.

References makeGlobalPositionRcd_cfg::tag.

Referenced by vmeAddrValueBlock(), and writeVME().

131 { return "<" + tag + ">\n"; }

◆ spaces()

std::string L1GtVmeWriterCore::spaces ( const unsigned int &  level)

returns a string containing spaces dependant on level

Definition at line 153 of file L1GtVmeWriterCore.cc.

References edmScanValgrind::buffer, mps_fire::i, personalPlayback::level, and spacesPerLevel_.

Referenced by vmeAddrValueBlock(), and writeVME().

153  {
154  std::ostringstream buffer;
155 
156  for (unsigned int i = 0; i < (level * spacesPerLevel_); i++) {
157  buffer << " ";
158  }
159 
160  return buffer.str();
161 }

◆ vmeAddrValueBlock()

std::string L1GtVmeWriterCore::vmeAddrValueBlock ( const std::string &  addr,
const int &  val,
const int &  spaceLevel,
const bool  setMsb = false 
)

builds a address value block

Definition at line 135 of file L1GtVmeWriterCore.cc.

References generateTowerEtThresholdLUT::addr, edmScanValgrind::buffer, closeTag(), L1GtXmlParserTags::m_xmlTagValue, L1GtXmlParserTags::m_xmlTagVmeAddress, openTag(), spaces(), and heppy_batch::val.

Referenced by writeVME().

138  {
139  std::ostringstream buffer;
140 
141  std::bitset<8> bsVal(val);
142 
143  if (setMsb)
144  bsVal.set(7);
145 
146  buffer << spaces(spaceLevel) << openTag(m_xmlTagVmeAddress) << spaces(spaceLevel + 1) << addr << std::endl
147  << spaces(spaceLevel + 1) << openTag(m_xmlTagValue) << spaces(spaceLevel + 1) << bsVal << std::endl
148  << spaces(spaceLevel + 1) << closeTag(m_xmlTagValue) << spaces(spaceLevel) << closeTag(m_xmlTagVmeAddress);
149 
150  return buffer.str();
151 }
static const std::string m_xmlTagVmeAddress
std::string closeTag(const std::string &tag)
closes xml tag
std::string openTag(const std::string &tag)
opens a new xml tag
std::string spaces(const unsigned int &level)
returns a string containing spaces dependant on level
static const std::string m_xmlTagValue

◆ writeVME()

void L1GtVmeWriterCore::writeVME ( const std::vector< ConditionMap > &  conditionMap,
const std::map< std::string, int > &  cond2intMap,
const L1GtVhdlTemplateFile header,
const int  spacesPerLevel = 2 
)

Definition at line 163 of file L1GtVmeWriterCore.cc.

References calculateAddress(), calculateJetsAddress(), closeTag(), CondCalo, CondCorrelation, CondEnergySum, CondJetCounts, CondMuon, CondNull, L1GtMuonTemplate::correlationParameter(), gather_cfg::cout, MillePedeFileConverter_cfg::fileName, RecoTauValidation_cfi::header, mps_fire::i, L1GtVhdlWriterCore::int2str(), groupFilesInBlocks::lines, m_outputDir, m_vmeXmlFile, L1GtXmlParserTags::m_xmlConditionAttrObject, L1GtXmlParserTags::m_xmlConditionAttrType, L1GtXmlParserTags::m_xmlTagChargeCorrelation, L1GtXmlParserTags::m_xmlTagChip, L1GtXmlParserTags::m_xmlTagHeader, L1GtXmlParserTags::m_xmlTagPtHighThreshold, L1GtXmlParserTags::m_xmlTagPtLowThreshold, L1GtXmlParserTags::m_xmlTagQuality, L1GtXmlParserTags::m_xmlTagVme, Mu, getGTfromDQMFile::obj, L1GtVhdlDefinitions::obj2str(), L1GtJetCountsTemplate::objectParameter(), L1GtEnergySumTemplate::objectParameter(), L1GtCaloTemplate::objectParameter(), L1GtMuonTemplate::objectParameter(), findAndChange::op, openTag(), download_sqlite_cfg::outputFile, spaces(), spacesPerLevel_, AlCaHLTBitMon_QueryRunRegistry::string, L1GtVhdlDefinitions::type2str(), and vmeAddrValueBlock().

Referenced by L1GtVhdlWriter::analyze().

166  {
167  std::vector<ConditionMap> conditionMap = _conditionMap;
168  std::map<std::string, int> cond2intMap = _cond2intMap;
169  L1GtVhdlTemplateFile header = _header;
170  L1GtVhdlDefinitions maps;
171 
172  // define appearance
173  spacesPerLevel_ = spacesPerLevel;
174 
176 
177  // open output file
178  std::ofstream outputFile(fileName.c_str());
179 
180  // begin of VME XML
181  outputFile << "<" << m_xmlTagVme << ">" << std::endl;
182 
183  // insert header
185  header.substitute("vhdl_file_name", m_vmeXmlFile);
186  header.removeEmptyLines();
187 
188  std::vector<std::string> lines = header.returnLines();
189 
190  for (unsigned int i = 0; i < lines.size(); i++) {
191  outputFile << spaces(2) << lines.at(i);
192  //if (i!=lines.size()-1)
193  outputFile << std::endl;
194  }
195 
197 
198  // loop over chips
199  for (unsigned int index = 1; index <= 2; index++) {
200  outputFile << spaces(1) << "<" << m_xmlTagChip << index << ">" << std::endl;
201 
202  // loop over condition map
203  for (ConditionMap::iterator iterCond = conditionMap.at(index - 1).begin();
204  iterCond != conditionMap.at(index - 1).end();
205  iterCond++) {
206  // open a condition
207  outputFile << spaces(2) << "<" << iterCond->first << " " << m_xmlConditionAttrObject << "=\""
208  << maps.obj2str((iterCond->second->objectType())[0]) << "\" " << m_xmlConditionAttrType << "=\""
209  << maps.type2str(iterCond->second->condType()) << "\">" << std::endl;
210 
211  switch ((iterCond->second)->condCategory()) {
212  case CondMuon: {
213  L1GtMuonTemplate *muonTemplate = static_cast<L1GtMuonTemplate *>(iterCond->second);
214  const std::vector<L1GtMuonTemplate::ObjectParameter> *op = muonTemplate->objectParameter();
215 
216  // get the number of objects
217  unsigned int nObjects = iterCond->second->nrObjects();
218 
219  for (unsigned int i = 0; i < nObjects; i++) {
221 
222  // ptHighTreshold
223  std::string address = calculateAddress(Mu,
224  (iterCond->second)->condType(),
225  (m_xmlTagPtHighThreshold + "_" + opi),
226  cond2intMap[iterCond->first]);
227 
229  << vmeAddrValueBlock(address, (*op).at(i).ptHighThreshold, 4, iterCond->second->condGEq())
231 
232  // ptLow Threshold
233  address = calculateAddress(
234  Mu, (iterCond->second)->condType(), (m_xmlTagPtLowThreshold + "_" + opi), cond2intMap[iterCond->first]);
235 
237  << vmeAddrValueBlock(address, (*op).at(i).ptLowThreshold, 4, iterCond->second->condGEq())
239 
240  // Quality
241  address = calculateAddress(
242  Mu, (iterCond->second)->condType(), (m_xmlTagQuality + "_" + opi), cond2intMap[iterCond->first]);
243 
245  << vmeAddrValueBlock(address, (*op).at(i).qualityRange, 4) << spaces(3)
247  }
248 
250 
251  // Charage correlation - occurs only one time
253 
254  std::string address = calculateAddress(
255  Mu, (iterCond->second)->condType(), (m_xmlTagChargeCorrelation), cond2intMap[iterCond->first]);
256 
257  outputFile << vmeAddrValueBlock(address, (*cp).chargeCorrelation, 4) << spaces(3)
259 
260  } break;
261 
262  case CondCalo: {
263  L1GtCaloTemplate *m_gtCaloTemplate = static_cast<L1GtCaloTemplate *>(iterCond->second);
264  const std::vector<L1GtCaloTemplate::ObjectParameter> *op = m_gtCaloTemplate->objectParameter();
265 
266  // get the number of objects
267  unsigned int nObjects = iterCond->second->nrObjects();
268 
269  for (unsigned int i = 0; i < nObjects; i++) {
271  std::string address = calculateAddress((iterCond->second->objectType()).at(0),
272  (iterCond->second)->condType(),
273  (m_xmlTagPtHighThreshold + "_" + opi),
274  cond2intMap[iterCond->first]);
275 
276  // insert Address/Value Tag
277  outputFile << vmeAddrValueBlock(address, (*op).at(i).etThreshold, 3, iterCond->second->condGEq());
278  }
279 
280  } break;
281 
282  case CondEnergySum: {
283  L1GtEnergySumTemplate *energySumTempl = static_cast<L1GtEnergySumTemplate *>(iterCond->second);
284 
285  const std::vector<L1GtEnergySumTemplate::ObjectParameter> *op = energySumTempl->objectParameter();
286 
287  // get the number of objects
288  unsigned int nObjects = iterCond->second->nrObjects();
289 
290  for (unsigned int i = 0; i < nObjects; i++) {
292 
293  std::string address = calculateAddress((iterCond->second->objectType()).at(0),
294  (iterCond->second)->condType(),
295  (m_xmlTagPtHighThreshold + "_" + opi),
296  cond2intMap[iterCond->first]);
297 
298  // insert Address/Value Tag
299  outputFile << vmeAddrValueBlock(address, (*op).at(i).etThreshold, 3, iterCond->second->condGEq());
300  }
301 
302  }
303 
304  break;
305 
306  case CondJetCounts: {
307  L1GtJetCountsTemplate *jetsTemplate = static_cast<L1GtJetCountsTemplate *>(iterCond->second);
308  const std::vector<L1GtJetCountsTemplate::ObjectParameter> *op = jetsTemplate->objectParameter();
309 
310  // get the number of objects
311  // unsigned int nObjects = iterCond->second->nrObjects();
312 
313  // count index
314  int ci = (*op)[0].countIndex;
315 
316  // 0 for count index 0-5 and 1 for count index 6 - 11
317  int obj;
318 
319  if (ci <= 5)
320  obj = 0;
321  else
322  obj = 1;
323 
324  std::string address = calculateJetsAddress(ci, obj, cond2intMap[iterCond->first]);
325 
326  outputFile << vmeAddrValueBlock(address, (*op).at(0).countThreshold, 3, iterCond->second->condGEq());
327 
328  } break;
329  case CondCorrelation: {
330  // empty
331  } break;
332 
333  case CondNull: {
334  // empty
335  } break;
336 
337  default: {
338  // empty
339  } break;
340  }
341 
342  // close the condition
343  outputFile << spaces(2) << closeTag(iterCond->first);
344  }
345 
346  outputFile << spaces(1) << "</" << m_xmlTagChip << index << ">" << std::endl;
347  }
348 
349  // end of vme XML
351 
352  // close output file
353  outputFile.close();
354 
355  std::cout << std::endl
356  << "******* VME XML File: " << m_outputDir << m_vmeXmlFile << " written sucessfully! *******"
357  << std::endl;
358 }
std::string obj2str(const L1GtObject &type)
converts object type to firmware string
std::string type2str(const L1GtConditionType &type)
converts a condition type to firmware string
std::string m_outputDir
output directory
const std::vector< ObjectParameter > * objectParameter() const
static const std::string m_xmlTagHeader
static const std::string m_xmlConditionAttrObject
static const std::string m_xmlConditionAttrType
static const std::string m_xmlTagVme
static std::string int2str(const int &integerValue)
converts a integer into a string
static const std::string m_xmlTagChargeCorrelation
const std::vector< ObjectParameter > * objectParameter() const
const CorrelationParameter * correlationParameter() const
static const std::string m_xmlTagPtHighThreshold
std::string m_vmeXmlFile
output file
std::string closeTag(const std::string &tag)
closes xml tag
std::string calculateJetsAddress(const int &countIndex, const int &obj, const int &index)
calculates addresses for jets counts
std::string openTag(const std::string &tag)
opens a new xml tag
const std::vector< ObjectParameter > * objectParameter() const
static const std::string m_xmlTagPtLowThreshold
Definition: L1GtObject.h:29
std::string spaces(const unsigned int &level)
returns a string containing spaces dependant on level
static const std::string m_xmlTagChip
static const std::string m_xmlTagQuality
const std::vector< ObjectParameter > * objectParameter() const
std::string vmeAddrValueBlock(const std::string &addr, const int &val, const int &spaceLevel, const bool setMsb=false)
builds a address value block
std::string calculateAddress(const L1GtObject &obj, const L1GtConditionType &type, const std::string &reg, const int &index)
calculates address

Member Data Documentation

◆ jetObj2reg_

std::map<int, int> L1GtVmeWriterCore::jetObj2reg_
private

Definition at line 90 of file L1GtVmeWriterCore.h.

Referenced by calculateJetsAddress(), and L1GtVmeWriterCore().

◆ jetType2reg_

std::map<int, int> L1GtVmeWriterCore::jetType2reg_
private

Definition at line 88 of file L1GtVmeWriterCore.h.

Referenced by calculateJetsAddress(), and L1GtVmeWriterCore().

◆ m_outputDir

std::string L1GtVmeWriterCore::m_outputDir
private

output directory

Definition at line 77 of file L1GtVmeWriterCore.h.

Referenced by writeVME().

◆ m_vmeXmlFile

std::string L1GtVmeWriterCore::m_vmeXmlFile
private

output file

Definition at line 80 of file L1GtVmeWriterCore.h.

Referenced by writeVME().

◆ object2reg_

std::map<L1GtObject, int> L1GtVmeWriterCore::object2reg_
private

Definition at line 82 of file L1GtVmeWriterCore.h.

Referenced by calculateAddress(), and L1GtVmeWriterCore().

◆ reg2hex_

std::map<std::string, int> L1GtVmeWriterCore::reg2hex_
private

Definition at line 86 of file L1GtVmeWriterCore.h.

Referenced by calculateAddress(), calculateJetsAddress(), and L1GtVmeWriterCore().

◆ spacesPerLevel_

int L1GtVmeWriterCore::spacesPerLevel_
private

Definition at line 92 of file L1GtVmeWriterCore.h.

Referenced by L1GtVmeWriterCore(), spaces(), and writeVME().

◆ type2reg_

std::map<L1GtConditionType, int> L1GtVmeWriterCore::type2reg_
private

Definition at line 84 of file L1GtVmeWriterCore.h.

Referenced by calculateAddress(), and L1GtVmeWriterCore().