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, std::map< std::string, int > cond2intMap, 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:
2008/02/27 21:18:53
Revision:
1.3

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:
2008/02/27 21:18:29
Revision:
1.3

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:22
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,
std::map< std::string, int >  cond2intMap,
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_, L1GtVhdlTemplateFile::substitute(), L1GtVhdlDefinitions::type2str(), and vmeAddrValueBlock().

Referenced by L1GtVhdlWriter::analyze().

193 {
194 
195  L1GtVhdlDefinitions maps;
196 
197  // define appearance
198  spacesPerLevel_ = spacesPerLevel;
199 
200  std::string fileName = m_outputDir+m_vmeXmlFile;
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::const_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 
257  std::string opi = L1GtVhdlWriterCore::int2str(i);
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 
317  std::string opi = L1GtVhdlWriterCore::int2str(i);
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 
345  std::string opi = L1GtVhdlWriterCore::int2str(i);
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
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
std::vector< std::string > returnLines()
returns a string vector with the current content of the VHDL File
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::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().