CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
virtual ~L1GtVmeWriterCore ()
 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
Date:
2013/05/23 16:50:08
Revision:
1.4

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
Date:
2013/05/23 16:50:09
Revision:
1.4

Definition at line 36 of file L1GtVmeWriterCore.h.

Constructor & Destructor Documentation

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

constructor

Definition at line 41 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.

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

destructor

Definition at line 102 of file L1GtVmeWriterCore.cc.

103 {
104 
105  // empty now
106 
107 }

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 131 of file L1GtVmeWriterCore.cc.

References condIndex2reg(), getGTfromDQMFile::obj, object2reg_, reg2hex_, query::result, and type2reg_.

Referenced by writeVME().

133 {
134 
137 
138  std::bitset<25> bs(result);
139 
140  std::ostringstream buffer;
141  buffer<<bs;
142  return buffer.str();
143 
144 }
type
Definition: HCALResponse.h:21
std::map< L1GtConditionType, int > type2reg_
tuple result
Definition: query.py:137
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 117 of file L1GtVmeWriterCore.cc.

References condIndex2reg(), jetObj2reg_, jetType2reg_, getGTfromDQMFile::obj, reg2hex_, and query::result.

Referenced by writeVME().

119 {
120  int result = jetType2reg_[countIndex] + jetObj2reg_[obj]
121  + reg2hex_["jet_cnt_threshold"] +condIndex2reg(index);
122 
123  std::bitset<24> bs(result);
124 
125  std::ostringstream buffer;
126  buffer<<bs;
127 
128  return buffer.str();
129 }
std::map< int, int > jetObj2reg_
tuple result
Definition: query.py:137
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 152 of file L1GtVmeWriterCore.cc.

Referenced by vmeAddrValueBlock(), and writeVME().

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

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

Definition at line 109 of file L1GtVmeWriterCore.cc.

References getHLTprescales::index.

Referenced by calculateAddress(), and calculateJetsAddress().

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

opens a new xml tag

Definition at line 147 of file L1GtVmeWriterCore.cc.

Referenced by vmeAddrValueBlock(), and writeVME().

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

returns a string containing spaces dependant on level

Definition at line 178 of file L1GtVmeWriterCore.cc.

References i, and spacesPerLevel_.

Referenced by vmeAddrValueBlock(), and writeVME().

179 {
180  std::ostringstream buffer;
181 
182  for (unsigned int i=0; i<(level*spacesPerLevel_); i++)
183  {
184  buffer<<" ";
185  }
186 
187  return buffer.str();
188 
189 }
int i
Definition: DBlmapReader.cc:9
tuple level
Definition: testEve_cfg.py:34
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 157 of file L1GtVmeWriterCore.cc.

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

Referenced by writeVME().

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

References asciidump::at, calculateAddress(), calculateJetsAddress(), closeTag(), CondCalo, CondCorrelation, CondEnergySum, CondJetCounts, CondMuon, CondNull, L1GtMuonTemplate::correlationParameter(), gather_cfg::cout, CommonMethods::cp(), convertXMLtoSQLite_cfg::fileName, i, getHLTprescales::index, 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(), openTag(), download_sqlite_cfg::outputFile, L1GtVhdlTemplateFile::removeEmptyLines(), L1GtVhdlTemplateFile::returnLines(), spaces(), spacesPerLevel_, AlCaHLTBitMon_QueryRunRegistry::string, L1GtVhdlTemplateFile::substitute(), L1GtVhdlDefinitions::type2str(), and vmeAddrValueBlock().

Referenced by L1GtVhdlWriter::analyze().

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

Member Data Documentation

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

Definition at line 93 of file L1GtVmeWriterCore.h.

Referenced by calculateJetsAddress(), and L1GtVmeWriterCore().

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

Definition at line 91 of file L1GtVmeWriterCore.h.

Referenced by calculateJetsAddress(), and L1GtVmeWriterCore().

std::string L1GtVmeWriterCore::m_outputDir
private

output directory

Definition at line 80 of file L1GtVmeWriterCore.h.

Referenced by writeVME().

std::string L1GtVmeWriterCore::m_vmeXmlFile
private

output file

Definition at line 83 of file L1GtVmeWriterCore.h.

Referenced by writeVME().

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

Definition at line 85 of file L1GtVmeWriterCore.h.

Referenced by calculateAddress(), and L1GtVmeWriterCore().

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

Definition at line 89 of file L1GtVmeWriterCore.h.

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

int L1GtVmeWriterCore::spacesPerLevel_
private

Definition at line 95 of file L1GtVmeWriterCore.h.

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

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

Definition at line 87 of file L1GtVmeWriterCore.h.

Referenced by calculateAddress(), and L1GtVmeWriterCore().