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

Definition at line 34 of file L1GtVmeWriterCore.h.

Constructor & Destructor Documentation

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

destructor

Definition at line 100 of file L1GtVmeWriterCore.cc.

101 {
102 
103  // empty now
104 
105 }

Member Function Documentation

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

calculates address

Definition at line 129 of file L1GtVmeWriterCore.cc.

References edmScanValgrind::buffer, condIndex2reg(), GetRecoTauVFromDQM_MC_cff::obj, object2reg_, reg2hex_, mps_fire::result, and type2reg_.

Referenced by writeVME().

131 {
132 
135 
136  std::bitset<25> bs(result);
137 
138  std::ostringstream buffer;
139  buffer<<bs;
140  return buffer.str();
141 
142 }
type
Definition: HCALResponse.h:21
std::map< L1GtConditionType, int > type2reg_
std::map< std::string, int > reg2hex_
std::map< L1GtObject, int > object2reg_
int condIndex2reg(const unsigned int &index)
std::string L1GtVmeWriterCore::calculateJetsAddress ( const int &  countIndex,
const int &  obj,
const int &  index 
)

calculates addresses for jets counts

Definition at line 115 of file L1GtVmeWriterCore.cc.

References edmScanValgrind::buffer, condIndex2reg(), jetObj2reg_, jetType2reg_, GetRecoTauVFromDQM_MC_cff::obj, reg2hex_, and mps_fire::result.

Referenced by writeVME().

117 {
118  int result = jetType2reg_[countIndex] + jetObj2reg_[obj]
119  + reg2hex_["jet_cnt_threshold"] +condIndex2reg(index);
120 
121  std::bitset<24> bs(result);
122 
123  std::ostringstream buffer;
124  buffer<<bs;
125 
126  return buffer.str();
127 }
std::map< int, int > jetObj2reg_
std::map< int, int > jetType2reg_
std::map< std::string, int > reg2hex_
int condIndex2reg(const unsigned int &index)
std::string L1GtVmeWriterCore::closeTag ( const std::string &  tag)

closes xml tag

Definition at line 150 of file L1GtVmeWriterCore.cc.

Referenced by vmeAddrValueBlock(), and writeVME().

151 {
152  return "</"+tag+">\n";
153 }
int L1GtVmeWriterCore::condIndex2reg ( const unsigned int &  index)

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

Definition at line 107 of file L1GtVmeWriterCore.cc.

Referenced by calculateAddress(), and calculateJetsAddress().

108 {
109  int indexcp = index;
110 
111  return (indexcp << 8);
112 
113 }
std::string L1GtVmeWriterCore::openTag ( const std::string &  tag)

opens a new xml tag

Definition at line 145 of file L1GtVmeWriterCore.cc.

Referenced by vmeAddrValueBlock(), and writeVME().

146 {
147  return "<"+tag+">\n";
148 }
std::string L1GtVmeWriterCore::spaces ( const unsigned int &  level)

returns a string containing spaces dependant on level

Definition at line 176 of file L1GtVmeWriterCore.cc.

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

Referenced by vmeAddrValueBlock(), and writeVME().

177 {
178  std::ostringstream buffer;
179 
180  for (unsigned int i=0; i<(level*spacesPerLevel_); i++)
181  {
182  buffer<<" ";
183  }
184 
185  return buffer.str();
186 
187 }
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 155 of file L1GtVmeWriterCore.cc.

References edmScanValgrind::buffer, closeTag(), L1GtXmlParserTags::m_xmlTagValue, L1GtXmlParserTags::m_xmlTagVmeAddress, openTag(), and spaces().

Referenced by writeVME().

157 {
158  std::ostringstream buffer;
159 
160  std::bitset<8> bsVal(val);
161 
162  if (setMsb)
163  bsVal.set(7);
164 
165  buffer << spaces(spaceLevel) << openTag(m_xmlTagVmeAddress)
166  << spaces(spaceLevel+1) << addr << std::endl
167  << spaces(spaceLevel+1) << openTag(m_xmlTagValue)
168  << spaces(spaceLevel+1) << bsVal <<std::endl
169  << spaces(spaceLevel+1) << closeTag(m_xmlTagValue)
170  << spaces(spaceLevel) << closeTag(m_xmlTagVmeAddress);
171 
172  return buffer.str();
173 
174 }
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
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 189 of file L1GtVmeWriterCore.cc.

References calculateAddress(), calculateJetsAddress(), closeTag(), CondCalo, CondCorrelation, CondEnergySum, CondJetCounts, CondMuon, CondNull, L1GtMuonTemplate::correlationParameter(), gather_cfg::cout, SimDataFormats::CaloAnalysis::cp, 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, GetRecoTauVFromDQM_MC_cff::obj, L1GtVhdlDefinitions::obj2str(), L1GtJetCountsTemplate::objectParameter(), L1GtEnergySumTemplate::objectParameter(), L1GtCaloTemplate::objectParameter(), L1GtMuonTemplate::objectParameter(), openTag(), download_sqlite_cfg::outputFile, L1GtVhdlTemplateFile::removeEmptyLines(), L1GtVhdlTemplateFile::returnLines(), spaces(), spacesPerLevel_, AlCaHLTBitMon_QueryRunRegistry::string, L1GtVhdlTemplateFile::substitute(), L1GtVhdlDefinitions::type2str(), and vmeAddrValueBlock().

Referenced by L1GtVhdlWriter::analyze().

191 {
192  std::vector<ConditionMap> conditionMap = _conditionMap;
193  std::map<std::string,int> cond2intMap = _cond2intMap;
194  L1GtVhdlTemplateFile header = _header;
195  L1GtVhdlDefinitions maps;
196 
197  // define appearance
198  spacesPerLevel_ = spacesPerLevel;
199 
201 
202  // open output file
203  std::ofstream outputFile(fileName.c_str());
204 
205  // begin of VME XML
206  outputFile << "<" << m_xmlTagVme << ">" << std::endl;
207 
208  // insert header
210  header.substitute("vhdl_file_name", m_vmeXmlFile);
211  header.removeEmptyLines();
212 
213  std::vector<std::string> lines = header.returnLines();
214 
215  for (unsigned int i = 0; i< lines.size(); i++)
216  {
217  outputFile << spaces(2)<<lines.at(i);
218  //if (i!=lines.size()-1)
219  outputFile<<std::endl;
220  }
221 
223 
224  // loop over chips
225  for (unsigned int index=1; index<=2; index++)
226  {
227  outputFile << spaces(1) <<"<" << m_xmlTagChip << index <<">"
228  << std::endl;
229 
230  // loop over condition map
231  for (ConditionMap::iterator iterCond = conditionMap.at(index-1).begin(); iterCond != conditionMap.at(index-1).end(); iterCond++)
232  {
233 
234  // open a condition
235  outputFile << spaces(2) << "<" << iterCond->first << " "
236  << m_xmlConditionAttrObject <<"=\"" << maps.obj2str((iterCond->second->objectType())[0])<<"\" " <<m_xmlConditionAttrType <<"=\""
237  << maps.type2str(iterCond->second->condType())<< "\">"
238  <<std::endl;
239 
240  switch ((iterCond->second)->condCategory())
241  {
242 
243  case CondMuon:
244  {
245 
246  L1GtMuonTemplate* muonTemplate =
247  static_cast<L1GtMuonTemplate*>(iterCond->second);
248  const std::vector<L1GtMuonTemplate::ObjectParameter>* op =
249  muonTemplate->objectParameter();
250 
251  // get the number of objects
252  unsigned int nObjects = iterCond->second->nrObjects();
253 
254  for (unsigned int i =0; i<nObjects; i++)
255  {
256 
258 
259  // ptHighTreshold
260  std::string address = calculateAddress(Mu, (iterCond->second)->condType(),
261  (m_xmlTagPtHighThreshold+"_"+opi),
262  cond2intMap[iterCond->first]);
263 
265  <<vmeAddrValueBlock(address, (*op).at(i).ptHighThreshold, 4,iterCond->second->condGEq()) << spaces(3)
267 
268  // ptLow Threshold
269  address = calculateAddress(Mu, (iterCond->second)->condType(),
270  (m_xmlTagPtLowThreshold+"_"+opi),
271  cond2intMap[iterCond->first]);
272 
274  <<vmeAddrValueBlock(address, (*op).at(i).ptLowThreshold, 4, iterCond->second->condGEq()) << spaces(3)
276 
277  // Quality
278  address = calculateAddress(Mu, (iterCond->second)->condType(), (m_xmlTagQuality+"_"
279  +opi), cond2intMap[iterCond->first]);
280 
282  << vmeAddrValueBlock(address, (*op).at(i).qualityRange, 4) << spaces(3)
284 
285  }
286 
288  muonTemplate->correlationParameter();
289 
290  // Charage correlation - occurs only one time
292 
293  std::string address = calculateAddress(Mu, (iterCond->second)->condType(),
295  cond2intMap[iterCond->first]);
296 
297  outputFile << vmeAddrValueBlock(address, (*cp).chargeCorrelation, 4) << spaces(3)
299 
300  }
301  break;
302 
303  case CondCalo:
304  {
305 
306  L1GtCaloTemplate* m_gtCaloTemplate =
307  static_cast<L1GtCaloTemplate*>(iterCond->second);
308  const std::vector<L1GtCaloTemplate::ObjectParameter>* op =
309  m_gtCaloTemplate->objectParameter();
310 
311  // get the number of objects
312  unsigned int nObjects = iterCond->second->nrObjects();
313 
314  for (unsigned int i =0; i<nObjects; i++)
315  {
316 
318  std::string address = calculateAddress((iterCond->second->objectType()).at(0), (iterCond->second)->condType(),
319  (m_xmlTagPtHighThreshold+"_"+opi),
320  cond2intMap[iterCond->first]);
321 
322  // insert Address/Value Tag
323  outputFile<<vmeAddrValueBlock(address, (*op).at(i).etThreshold, 3, iterCond->second->condGEq());
324 
325  }
326 
327  }
328  break;
329 
330  case CondEnergySum:
331  {
332 
333  L1GtEnergySumTemplate* energySumTempl =
334  static_cast<L1GtEnergySumTemplate*>(iterCond->second);
335 
336  const std::vector<L1GtEnergySumTemplate::ObjectParameter>* op =
337  energySumTempl->objectParameter();
338 
339  // get the number of objects
340  unsigned int nObjects = iterCond->second->nrObjects();
341 
342  for (unsigned int i =0; i<nObjects; i++)
343  {
344 
346 
347  std::string address = calculateAddress((iterCond->second->objectType()).at(0), (iterCond->second)->condType(),
348  (m_xmlTagPtHighThreshold+"_"+opi),
349  cond2intMap[iterCond->first]);
350 
351  // insert Address/Value Tag
352  outputFile<<vmeAddrValueBlock(address, (*op).at(i).etThreshold, 3,iterCond->second->condGEq());
353 
354  }
355 
356  }
357 
358  break;
359 
360  case CondJetCounts:
361  {
362 
363  L1GtJetCountsTemplate* jetsTemplate =
364  static_cast<L1GtJetCountsTemplate*>(iterCond->second);
365  const std::vector<L1GtJetCountsTemplate::ObjectParameter>* op =
366  jetsTemplate->objectParameter();
367 
368  // get the number of objects
369  // unsigned int nObjects = iterCond->second->nrObjects();
370 
371  // count index
372  int ci = (*op)[0].countIndex;
373 
374  // 0 for count index 0-5 and 1 for count index 6 - 11
375  int obj;
376 
377  if (ci<=5)
378  obj=0;
379  else
380  obj=1;
381 
382  std::string address = calculateJetsAddress(ci, obj,
383  cond2intMap[iterCond->first]);
384 
385  outputFile<<vmeAddrValueBlock(address, (*op).at(0).countThreshold, 3, iterCond->second->condGEq());
386 
387  }
388  break;
389  case CondCorrelation:
390  {
391  // empty
392  }
393  break;
394 
395  case CondNull:
396  {
397  // empty
398  }
399  break;
400 
401  default:
402  {
403  // empty
404  }
405  break;
406 
407  }
408 
409  // close the condition
410  outputFile << spaces(2)<< closeTag(iterCond->first);
411 
412  }
413 
414  outputFile << spaces(1) << "</" << m_xmlTagChip << index<<">"
415  <<std::endl;
416 
417  }
418 
419  // end of vme XML
421 
422  // close output file
423  outputFile.close();
424 
425  std::cout << std::endl <<"******* VME XML File: "<< m_outputDir
426  << m_vmeXmlFile << " written sucessfully! *******"<<std::endl;
427 
428 }
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
bool substitute(const std::string &searchString, const std::string &replaceString)
replaces searchString with replaceString
const CorrelationParameter * correlationParameter() const
std::string m_outputDir
output directory
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 std::vector< ObjectParameter > * objectParameter() const
const std::vector< ObjectParameter > * objectParameter() 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
static const std::string m_xmlTagPtLowThreshold
Definition: L1GtObject.h:30
std::vector< std::string > returnLines() const
returns a string vector with the current content of the VHDL File
std::string spaces(const unsigned int &level)
returns a string containing spaces dependant on level
static const std::string m_xmlTagChip
const std::vector< ObjectParameter > * objectParameter() const
static const std::string m_xmlTagQuality
std::string vmeAddrValueBlock(const std::string &addr, const int &val, const int &spaceLevel, const bool setMsb=false)
builds a address value block
bool removeEmptyLines()
deletes all empty lines in a template file
std::string calculateAddress(const L1GtObject &obj, const L1GtConditionType &type, const std::string &reg, const int &index)
calculates address

Member Data Documentation

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

Definition at line 91 of file L1GtVmeWriterCore.h.

Referenced by calculateJetsAddress(), and L1GtVmeWriterCore().

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

Definition at line 89 of file L1GtVmeWriterCore.h.

Referenced by calculateJetsAddress(), and L1GtVmeWriterCore().

std::string L1GtVmeWriterCore::m_outputDir
private

output directory

Definition at line 78 of file L1GtVmeWriterCore.h.

Referenced by writeVME().

std::string L1GtVmeWriterCore::m_vmeXmlFile
private

output file

Definition at line 81 of file L1GtVmeWriterCore.h.

Referenced by writeVME().

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

Definition at line 83 of file L1GtVmeWriterCore.h.

Referenced by calculateAddress(), and L1GtVmeWriterCore().

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

Definition at line 87 of file L1GtVmeWriterCore.h.

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

int L1GtVmeWriterCore::spacesPerLevel_
private

Definition at line 93 of file L1GtVmeWriterCore.h.

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

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

Definition at line 85 of file L1GtVmeWriterCore.h.

Referenced by calculateAddress(), and L1GtVmeWriterCore().