CMS 3D CMS Logo

TotemDAQMappingESSourceXML.cc
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * This is a part of TOTEM offline software.
4 * Authors:
5 * Maciej Wróbel (wroblisko@gmail.com)
6 * Jan Kašpar (jan.kaspar@cern.ch)
7 * Marcin Borratynski (mborratynski@gmail.com)
8 * Seyed Mohsen Etesami (setesami@cern.ch)
9 * Laurent Forthomme
10 ****************************************************************************/
11 
22 
25 
31 
32 #include <xercesc/parsers/XercesDOMParser.hpp>
33 #include <xercesc/dom/DOM.hpp>
34 #include <xercesc/sax/HandlerBase.hpp>
35 #include <xercesc/util/XMLString.hpp>
36 #include <xercesc/util/PlatformUtils.hpp>
37 
38 #include <memory>
39 #include <sstream>
40 
41 //#define DEBUG 1
42 
43 //----------------------------------------------------------------------------------------------------
44 
45 using namespace std;
46 
51 {
52 public:
53  static const std::string tagVFAT;
54  static const std::string tagChannel;
56 
58  static const std::string tagArm;
59 
61  static const std::string tagRPStation;
62  static const std::string tagRPPot;
63  static const std::string tagRPPlane;
64 
66  static const std::string tagChip1;
67  static const std::string tagChip2;
68 
71  static const std::string tagDiamondCh;
72 
75 
76  edm::ESProducts< std::shared_ptr<TotemDAQMapping>, std::shared_ptr<TotemAnalysisMask> > produce( const TotemReadoutRcd & );
77 
78 private:
79  unsigned int verbosity;
80 
82  string subSystemName;
83 
84 
86  std::vector<std::string> mappingFileNames;
87 
88  struct ConfigBlock
89  {
92 
94  std::vector<std::string> mappingFileNames;
95 
97  std::vector<std::string> maskFileNames;
98  };
99 
100  vector<ConfigBlock> configuration;
101 
103  unsigned int currentBlock;
104 
107 
109  enum NodeType { nUnknown, nSkip, nTop, nArm, nRPStation, nRPPot, nRPPlane, nDiamondPlane, nChip, nDiamondCh, nChannel };
110 
112  enum ParseType { pMapping, pMask };
113 
115  void ParseXML(ParseType, const string &file, const std::shared_ptr<TotemDAQMapping>&, const std::shared_ptr<TotemAnalysisMask>&);
116 
118  void ParseTreeRP(ParseType, xercesc::DOMNode *, NodeType, unsigned int parentID,
119  const std::shared_ptr<TotemDAQMapping>&, const std::shared_ptr<TotemAnalysisMask>&);
120 
122  void ParseTreeDiamond(ParseType, xercesc::DOMNode *, NodeType, unsigned int parentID,
123  const std::shared_ptr<TotemDAQMapping>&, const std::shared_ptr<TotemAnalysisMask>&);
124 
125 private:
127  string CompleteFileName(const string &fn);
128 
130  bool Test(xercesc::DOMNode *node, const std::string &name)
131  {
132  return !(name.compare(cms::xerces::toString(node->getNodeName())));
133  }
134 
136  NodeType GetNodeType(xercesc::DOMNode *);
137 
139  string GetNodeContent(xercesc::DOMNode *parent)
140  {
141  return string(cms::xerces::toString(parent->getTextContent()));
142  }
143 
145  string GetNodeValue(xercesc::DOMNode *node)
146  {
147  return cms::xerces::toString(node->getNodeValue());
148  }
149 
151  TotemFramePosition ChipFramePosition(xercesc::DOMNode *chipnode);
152 
153  void GetChannels(xercesc::DOMNode *n, std::set<unsigned char> &channels);
154 
156  {
157  return ((type == nArm)||(type == nRPStation)||(type == nRPPot)||(type == nRPPlane)||(type == nChip));
158  }
159 
161  {
162  return ((type == nArm)||(type == nRPStation)||(type == nRPPot)||(type == nDiamondPlane)||(type == nDiamondCh));
163  }
165  {
166  return ((type==nChip)||(type==nArm));
167  }
168 
169 protected:
171  virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&, const edm::IOVSyncValue&, edm::ValidityInterval&);
172 };
173 
174 //----------------------------------------------------------------------------------------------------
175 
176 using namespace std;
177 using namespace edm;
178 using namespace xercesc;
179 
180 const string TotemDAQMappingESSourceXML::tagVFAT="vfat";
181 const string TotemDAQMappingESSourceXML::tagChannel="channel";
182 const string TotemDAQMappingESSourceXML::tagAnalysisMask="analysisMask";
183 
184 // common XML position tags
185 const string TotemDAQMappingESSourceXML::tagArm = "arm";
186 
187 // common XML Chip tags
188 const string TotemDAQMappingESSourceXML::tagChip1 = "vfat";
189 const string TotemDAQMappingESSourceXML::tagChip2 = "test_vfat";
190 
191 // specific RP XML tags
192 const string TotemDAQMappingESSourceXML::tagRPStation = "station";
193 const string TotemDAQMappingESSourceXML::tagRPPot = "rp_detector_set";
194 const string TotemDAQMappingESSourceXML::tagRPPlane = "rp_plane";
195 
196 // specific tags for diamond
197 const string TotemDAQMappingESSourceXML::tagDiamondPlane = "rp_plane_diamond";
198 const string TotemDAQMappingESSourceXML::tagDiamondCh = "diamond_channel";
199 
200 
201 //----------------------------------------------------------------------------------------------------
202 
204  verbosity(conf.getUntrackedParameter<unsigned int>("verbosity", 0)),
205  subSystemName(conf.getUntrackedParameter<string>("subSystem")),
206  currentBlock(0),
207  currentBlockValid(false)
208 {
209  for (const auto it : conf.getParameter<vector<ParameterSet>>("configuration"))
210  {
211  ConfigBlock b;
212  b.validityRange = it.getParameter<EventRange>("validityRange");
213  b.mappingFileNames = it.getParameter< vector<string> >("mappingFileNames");
214  b.maskFileNames = it.getParameter< vector<string> >("maskFileNames");
215  configuration.push_back(b);
216  }
217 
219  findingRecord<TotemReadoutRcd>();
220 }
221 
222 //----------------------------------------------------------------------------------------------------
223 
225  const edm::IOVSyncValue& iosv, edm::ValidityInterval& oValidity)
226 {
227  LogVerbatim("TotemDAQMappingESSourceXML")
228  << ">> TotemDAQMappingESSourceXML::setIntervalFor(" << key.name() << ")";
229 
230  LogVerbatim("TotemDAQMappingESSourceXML")
231  << " run=" << iosv.eventID().run() << ", event=" << iosv.eventID().event();
232 
233  currentBlockValid = false;
234  for (unsigned int idx = 0; idx < configuration.size(); ++idx)
235  {
236  const auto &bl = configuration[idx];
237 
238  edm::EventRange range = bl.validityRange;
239 
240  // If "<run>:min" is specified in python config, it is translated into event <run>:0:1.
241  // However, the truly minimal event id often found in data is <run>:0:0. Therefore the
242  // adjustment below is needed.
243  if (range.startEventID().luminosityBlock() == 0 && range.startEventID().event() == 1)
244  range = edm::EventRange(edm::EventID(range.startEventID().run(), 0, 0), range.endEventID());
245 
246  if (edm::contains(range, iosv.eventID()))
247  {
248  currentBlockValid = true;
249  currentBlock = idx;
250 
251  const IOVSyncValue begin(range.startEventID());
252  const IOVSyncValue end(range.endEventID());
253  oValidity = edm::ValidityInterval(begin, end);
254 
255  LogVerbatim("TotemDAQMappingESSourceXML")
256  << " block found: index=" << currentBlock
257  << ", interval=(" << range.startEventID() << " - " << range.endEventID() << ")";
258 
259  return;
260  }
261  }
262 
263  if (!currentBlockValid)
264  {
265  throw cms::Exception("TotemDAQMappingESSourceXML::setIntervalFor") <<
266  "No configuration for event " << iosv.eventID();
267  }
268 }
269 
270 //----------------------------------------------------------------------------------------------------
271 
273 {
274 }
275 
276 //----------------------------------------------------------------------------------------------------
277 
279 {
280  FileInPath fip(fn);
281  return fip.fullPath();
282 }
283 
284 //----------------------------------------------------------------------------------------------------
285 
286 edm::ESProducts< std::shared_ptr<TotemDAQMapping>, std::shared_ptr<TotemAnalysisMask> >
288 {
289  assert(currentBlockValid);
290 
291  auto mapping = std::make_shared<TotemDAQMapping>();
292  auto mask = std::make_shared<TotemAnalysisMask>();
293 
294  // initialize Xerces
295  try
296  {
297  XMLPlatformUtils::Initialize();
298  }
299  catch (const XMLException& toCatch)
300  {
301  throw cms::Exception("TotemDAQMappingESSourceXML") << "An XMLException caught with message: " << cms::xerces::toString(toCatch.getMessage()) << ".\n";
302  }
303 
304  // load mapping files
305  for (const auto &fn : configuration[currentBlock].mappingFileNames)
307 
308  // load mask files
309  for (const auto &fn : configuration[currentBlock].maskFileNames)
310  ParseXML(pMask, CompleteFileName(fn), mapping, mask);
311 
312  // release Xerces
313  XMLPlatformUtils::Terminate();
314 
315  // commit the products
316  return edm::es::products(mapping, mask);
317 }
318 
319 //----------------------------------------------------------------------------------------------------
320 
322  const std::shared_ptr<TotemDAQMapping> &mapping, const std::shared_ptr<TotemAnalysisMask> &mask)
323 {
324  unique_ptr<XercesDOMParser> parser(new XercesDOMParser());
325  parser->parse(file.c_str());
326 
327  DOMDocument* domDoc = parser->getDocument();
328 
329  if (!domDoc)
330  throw cms::Exception("TotemDAQMappingESSourceXML::ParseXML") << "Cannot parse file `" << file
331  << "' (domDoc = NULL)." << endl;
332 
333  DOMElement* elementRoot = domDoc->getDocumentElement();
334 
335  if (!elementRoot)
336  throw cms::Exception("TotemDAQMappingESSourceXML::ParseXML") << "File `" <<
337  file << "' is empty." << endl;
338 
339  ParseTreeRP(pType, elementRoot, nTop, 0, mapping, mask);
340 
341  ParseTreeDiamond(pType, elementRoot, nTop, 0, mapping, mask);
342 }
343 
344 //-----------------------------------------------------------------------------------------------------------
345 
346 void TotemDAQMappingESSourceXML::ParseTreeRP(ParseType pType, xercesc::DOMNode * parent, NodeType parentType,
347  unsigned int parentID, const std::shared_ptr<TotemDAQMapping>& mapping,
348  const std::shared_ptr<TotemAnalysisMask>& mask)
349 {
350 #ifdef DEBUG
351  printf(">> TotemDAQMappingESSourceXML::ParseTreeRP(%s, %u, %u)\n", cms::xerces::toString(parent->getNodeName()),
352  parentType, parentID);
353 #endif
354 
355  DOMNodeList *children = parent->getChildNodes();
356 
357  for (unsigned int i = 0; i < children->getLength(); i++)
358  {
359  DOMNode *n = children->item(i);
360  if (n->getNodeType() != DOMNode::ELEMENT_NODE)
361  continue;
362 
364 
365 #ifdef DEBUG
366  printf("\tname = %s, type = %u\n", cms::xerces::toString(n->getNodeName()), type);
367 #endif
368 
369  // structure control
370  if (!RPNode(type))
371  continue;
372 
373  NodeType expectedParentType;
374  switch (type)
375  {
376  case nArm: expectedParentType = nTop; break;
377  case nRPStation: expectedParentType = nArm; break;
378  case nRPPot: expectedParentType = nRPStation; break;
379  case nRPPlane: expectedParentType = nRPPot; break;
380  case nChip: expectedParentType = nRPPlane; break;
381  case nChannel: expectedParentType = nChip; break;
382  default: expectedParentType = nUnknown; break;
383  }
384 
385  if (expectedParentType != parentType)
386  {
387  throw cms::Exception("TotemDAQMappingESSourceXML") << "Node " << cms::xerces::toString(n->getNodeName())
388  << " not allowed within " << cms::xerces::toString(parent->getNodeName()) << " block.\n";
389  }
390 
391  // parse tag attributes
392  unsigned int id = 0, hw_id = 0;
393  bool id_set = false, hw_id_set = false;
394  bool fullMask = false;
395  DOMNamedNodeMap* attr = n->getAttributes();
396 
397  for (unsigned int j = 0; j < attr->getLength(); j++)
398  {
399  DOMNode *a = attr->item(j);
400 
401  if (!strcmp(cms::xerces::toString(a->getNodeName()).c_str(), "id"))
402  {
403  sscanf(cms::xerces::toString(a->getNodeValue()).c_str(), "%u", &id);
404  id_set = true;
405  }
406 
407  if (!strcmp(cms::xerces::toString(a->getNodeName()).c_str(), "hw_id"))
408  {
409  sscanf(cms::xerces::toString(a->getNodeValue()).c_str(), "%x", &hw_id);
410  hw_id_set = true;
411  }
412 
413  if (!strcmp(cms::xerces::toString(a->getNodeName()).c_str(), "full_mask"))
414  fullMask = (strcmp(cms::xerces::toString(a->getNodeValue()).c_str(), "no") != 0);
415  }
416 
417  // content control
418  if (!id_set)
419  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeRP") << "id not given for element `"
420  << cms::xerces::toString(n->getNodeName()) << "'" << endl;
421 
422  if (!hw_id_set && type == nChip && pType == pMapping)
423  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeRP") << "hw_id not given for element `"
424  << cms::xerces::toString(n->getNodeName()) << "'" << endl;
425 
426  if (type == nRPPlane && id > 9)
427  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeRP") <<
428  "Plane IDs range from 0 to 9. id = " << id << " is invalid." << endl;
429 
430 #ifdef DEBUG
431  printf("\tID found: 0x%x\n", id);
432 #endif
433 
434  // store mapping data
435  if (pType == pMapping && type == nChip)
436  {
437  const TotemFramePosition &framepos = ChipFramePosition(n);
438  TotemVFATInfo vfatInfo;
439  vfatInfo.hwID = hw_id;
440 
441  const unsigned int armIdx = (parentID / 1000) % 10;
442  const unsigned int stIdx = (parentID / 100) % 10;
443  const unsigned int rpIdx = (parentID / 10) % 10;
444  const unsigned int plIdx = parentID % 10;
445 
446  vfatInfo.symbolicID.symbolicID = TotemRPDetId(armIdx, stIdx, rpIdx, plIdx, id);
447 
448  mapping->insert(framepos, vfatInfo);
449 
450  continue;
451  }
452 
453  // store mask data
454  if (pType == pMask && type == nChip)
455  {
456  const unsigned int armIdx = (parentID / 1000) % 10;
457  const unsigned int stIdx = (parentID / 100) % 10;
458  const unsigned int rpIdx = (parentID / 10) % 10;
459  const unsigned int plIdx = parentID % 10;
460 
461  TotemSymbID symbId;
462  symbId.symbolicID = TotemRPDetId(armIdx, stIdx, rpIdx, plIdx, id);
463 
465  am.fullMask = fullMask;
467 
468  mask->insert(symbId, am);
469 
470  continue;
471  }
472 
473  // recursion (deeper in the tree)
474  ParseTreeRP(pType, n, type, parentID * 10 + id, mapping, mask);
475  }
476 }
477 
478 //----------------------------------------------------------------------------------------------------
479 
480 void TotemDAQMappingESSourceXML::ParseTreeDiamond(ParseType pType, xercesc::DOMNode * parent, NodeType parentType,
481  unsigned int parentID, const std::shared_ptr<TotemDAQMapping>& mapping,
482  const std::shared_ptr<TotemAnalysisMask>& mask)
483 {
484 
485 #ifdef DEBUG
486  printf(">> TotemDAQMappingESSourceXML::ParseTreeDiamond(%s, %u, %u)\n", cms::xerces::toString(parent->getNodeName()),
487  parentType, parentID);
488 #endif
489 
490  DOMNodeList *children = parent->getChildNodes();
491 
492  for (unsigned int i = 0; i < children->getLength(); i++)
493  {
494  DOMNode *n = children->item(i);
495  if (n->getNodeType() != DOMNode::ELEMENT_NODE)
496  continue;
497 
499 #ifdef DEBUG
500  printf("\tname = %s, type = %u\n", cms::xerces::toString(n->getNodeName()), type);
501 #endif
502 
503  // structure control
504  if (!DiamondNode(type))
505  continue;
506 
507  NodeType expectedParentType;
508  switch (type)
509  {
510  case nArm: expectedParentType = nTop; break;
511  case nRPStation: expectedParentType = nArm; break;
512  case nRPPot: expectedParentType = nRPStation; break;
513  case nDiamondPlane: expectedParentType = nRPPot; break;
514  case nDiamondCh: expectedParentType = nDiamondPlane; break;
515  default: expectedParentType = nUnknown; break;
516  }
517 
518  if (expectedParentType != parentType)
519  {
520  throw cms::Exception("TotemDAQMappingESSourceXML") << "Node " << cms::xerces::toString(n->getNodeName())
521  << " not allowed within " << cms::xerces::toString(parent->getNodeName()) << " block.\n";
522  }
523 
524  // parse tag attributes
525  unsigned int id =0,hw_id = 0;
526  bool id_set = false,hw_id_set = false;
527  DOMNamedNodeMap* attr = n->getAttributes();
528 
529  for (unsigned int j = 0; j < attr->getLength(); j++)
530  {
531  DOMNode *a = attr->item(j);
532 
533  if (!strcmp(cms::xerces::toString(a->getNodeName()).c_str(), "id"))
534  {
535  sscanf(cms::xerces::toString(a->getNodeValue()).c_str(), "%u", &id);
536  id_set = true;
537  }
538 
539  if (!strcmp(cms::xerces::toString(a->getNodeName()).c_str(), "hw_id"))
540  {
541  sscanf(cms::xerces::toString(a->getNodeValue()).c_str(), "%x", &hw_id);
542  hw_id_set = true;
543  }
544 
545  }
546 
547  // content control
548  if (!id_set)
549  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeDiamond") << "id not given for element `"
550  << cms::xerces::toString(n->getNodeName()) << "'" << endl;
551 
552 
553  if (!hw_id_set && type == nDiamondCh && pType == pMapping)
554  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeDiamond") << "hw_id not given for element `"
555  << cms::xerces::toString(n->getNodeName()) << "'" << endl;
556 
557  if (type == nDiamondPlane && id > 3)
558  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeDiamond") <<
559  "Plane IDs range from 0 to 3. id = " << id << " is invalid." << endl;
560 
561 #ifdef DEBUG
562  printf("\tID found: 0x%x\n", id);
563 #endif
564 
565  // store mapping data
566  if (pType == pMapping &&type == nDiamondCh)
567  {
568 
569  const TotemFramePosition &framepos = ChipFramePosition(n);
570 
571  TotemVFATInfo vfatInfo;
572  vfatInfo.hwID = hw_id;
573 
574  if (type == nDiamondCh)
575  {
576  unsigned int ArmNum = (parentID/ 10000) % 10;
577  unsigned int StationNum = (parentID / 1000) % 10;
578  unsigned int RpNum = (parentID/ 100) % 10;
579  unsigned int PlaneNum = (parentID % 100) ;
580 
581  vfatInfo.symbolicID.symbolicID = CTPPSDiamondDetId(ArmNum, StationNum, RpNum, PlaneNum, id);
582 
583 
584  }
585 
586 
587  mapping->insert(framepos, vfatInfo);
588 
589  continue;
590  }
591 
592  unsigned int childId;
593  if (pType == pMapping &&type == nDiamondPlane)
594  childId = parentID * 100 + id;
595  else
596  childId = parentID * 10 + id;
597 
598  ParseTreeDiamond(pType,n ,type ,childId ,mapping ,mask);
599 
600  }
601 
602 }
603 
604 
605 //----------------------------------------------------------------------------------------------------
606 
608 {
610  unsigned char attributeFlag = 0;
611 
612  DOMNamedNodeMap* attr = chipnode->getAttributes();
613  for (unsigned int j = 0; j < attr->getLength(); j++)
614  {
615  DOMNode *a = attr->item(j);
616  if (fp.setXMLAttribute(cms::xerces::toString(a->getNodeName()), cms::xerces::toString(a->getNodeValue()), attributeFlag) > 1)
617  {
618  throw cms::Exception("TotemDAQMappingESSourceXML") <<
619  "Unrecognized tag `" << cms::xerces::toString(a->getNodeName()) <<
620  "' or incompatible value `" << cms::xerces::toString(a->getNodeValue()) <<
621  "'." << endl;
622  }
623  }
624 
625  if (!fp.checkXMLAttributeFlag(attributeFlag))
626  {
627  throw cms::Exception("TotemDAQMappingESSourceXML") <<
628  "Wrong/incomplete DAQ channel specification (attributeFlag = " << attributeFlag << ")." << endl;
629  }
630 
631  return fp;
632 }
633 
634 //----------------------------------------------------------------------------------------------------
635 
637 {
638  // common node types
639  if (Test(n, tagArm)) return nArm;
640  if (Test(n, tagChip1)) return nChip;
641  if (Test(n, tagChip2)) return nChip;
642 
643  // RP node types
644  if (Test(n, tagRPStation)) return nRPStation;
645  if (Test(n, tagRPPot)) return nRPPot;
646  if (Test(n, tagRPPlane)) return nRPPlane;
647 
648  //diamond specifics
649  if (Test(n, tagDiamondCh)) return nDiamondCh;
650  if (Test(n, tagDiamondPlane)) return nDiamondPlane;
651 
652  // for backward compatibility
653  if (Test(n, "trigger_vfat")) return nSkip;
654 
655  throw cms::Exception("TotemDAQMappingESSourceXML::GetNodeType") << "Unknown tag `"
656  << cms::xerces::toString(n->getNodeName()) << "'.\n";
657 }
658 
659 //----------------------------------------------------------------------------------------------------
660 
661 void TotemDAQMappingESSourceXML::GetChannels(xercesc::DOMNode *n, set<unsigned char> &channels)
662 {
663  DOMNodeList *children = n->getChildNodes();
664  for (unsigned int i = 0; i < children->getLength(); i++)
665  {
666  DOMNode *n = children->item(i);
667  if (n->getNodeType() != DOMNode::ELEMENT_NODE || !Test(n, "channel"))
668  continue;
669 
670  DOMNamedNodeMap* attr = n->getAttributes();
671  bool idSet = false;
672  for (unsigned int j = 0; j < attr->getLength(); j++)
673  {
674  DOMNode *a = attr->item(j);
675 
676  if (!strcmp(cms::xerces::toString(a->getNodeName()).c_str(), "id"))
677  {
678  unsigned int id = 0;
679  sscanf(cms::xerces::toString(a->getNodeValue()).c_str(), "%u", &id);
680  channels.insert(id);
681  idSet = true;
682  break;
683  }
684  }
685 
686  if (!idSet)
687  {
688  throw cms::Exception("TotemDAQMappingESSourceXML::GetChannels") <<
689  "Channel tags must have an `id' attribute.";
690  }
691  }
692 }
693 
694 //----------------------------------------------------------------------------------------------------
695 
RunNumber_t run() const
Definition: EventID.h:39
Detector ID class for TOTEM Si strip detectors.
Definition: TotemRPDetId.h:30
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
Contains data on masked channels of a VFAT.
static const std::string tagChannel
string GetNodeContent(xercesc::DOMNode *parent)
returns the content of the node
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
Loads TotemDAQMapping and TotemAnalysisMask from two XML files.
static const std::string tagDiamondPlane
diamond specific tags
const EventID & eventID() const
Definition: IOVSyncValue.h:42
edm::EventRange validityRange
validity interval
EventSetup record for TOTEM readout-related information.
bool currentBlockValid
flag whether the &#39;currentBlock&#39; index is valid
NodeType
enumeration of XML node types
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
TotemSymbID symbolicID
the symbolic id
void ParseXML(ParseType, const string &file, const std::shared_ptr< TotemDAQMapping > &, const std::shared_ptr< TotemAnalysisMask > &)
parses XML file
NodeType GetNodeType(xercesc::DOMNode *)
determines node type
std::vector< std::string > mappingFileNames
the mapping files
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
static const std::string tagChip1
COMMON Chip XML tags.
string subSystemName
label of the CTPPS sub-system
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::string toString(XMLCh const *toTranscode)
Symbolic ID describing an entity of a TOTEM subdetector.
Definition: TotemSymbId.h:17
ESProducts< T, S > products(const T &i1, const S &i2)
Definition: ESProducts.h:191
static const std::string tagDiamondCh
EventID startEventID() const
Definition: EventRange.h:44
static const std::string tagRPStation
RP XML tags.
TotemFramePosition ChipFramePosition(xercesc::DOMNode *chipnode)
extracts VFAT&#39;s DAQ channel from XML attributes
EventID endEventID() const
Definition: EventRange.h:45
std::vector< std::string > maskFileNames
the mask files
bool fullMask
whether all channels of the VFAT shall be masked
#define end
Definition: vmac.h:37
void ParseTreeRP(ParseType, xercesc::DOMNode *, NodeType, unsigned int parentID, const std::shared_ptr< TotemDAQMapping > &, const std::shared_ptr< TotemAnalysisMask > &)
recursive method to extract RP-related information from the DOM tree
unsigned int symbolicID
chip ID, raw integer representation of DetId class
Definition: TotemSymbId.h:21
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Definition: SourceFactory.h:92
static const std::string tagArm
Common position tags.
unsigned int hwID
the hardware ID (16 bit)
TotemDAQMappingESSourceXML(const edm::ParameterSet &)
double b
Definition: hdecay.h:120
string GetNodeValue(xercesc::DOMNode *node)
returns the value of the node
ParseType
whether to parse a mapping of a mask XML
bool Test(xercesc::DOMNode *node, const std::string &name)
returns true iff the node is of the given name
edm::ESProducts< std::shared_ptr< TotemDAQMapping >, std::shared_ptr< TotemAnalysisMask > > produce(const TotemReadoutRcd &)
#define begin
Definition: vmac.h:30
HLT enums.
static const std::string tagAnalysisMask
double a
Definition: hdecay.h:121
virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
sets infinite validity of this data
std::set< unsigned char > maskedChannels
list of channels to be masked
unsigned int currentBlock
index of the current block in &#39;configuration&#39; array
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
std::string fullPath() const
Definition: FileInPath.cc:184
static const std::string tagRPPlane
std::vector< std::string > mappingFileNames
the mapping files
void GetChannels(xercesc::DOMNode *n, std::set< unsigned char > &channels)
static bool checkXMLAttributeFlag(unsigned char flag)
returns true if all attributes have been set
Contains mappind data related to a VFAT.
void ParseTreeDiamond(ParseType, xercesc::DOMNode *, NodeType, unsigned int parentID, const std::shared_ptr< TotemDAQMapping > &, const std::shared_ptr< TotemAnalysisMask > &)
recursive method to extract RP-related information from the DOM tree
unsigned char setXMLAttribute(const std::string &attribute, const std::string &value, unsigned char &flag)
string CompleteFileName(const string &fn)
adds the path prefix, if needed