CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ****************************************************************************/
10 
21 
24 
29 
30 #include <xercesc/parsers/XercesDOMParser.hpp>
31 #include <xercesc/dom/DOM.hpp>
32 #include <xercesc/sax/HandlerBase.hpp>
33 #include <xercesc/util/XMLString.hpp>
34 #include <xercesc/util/PlatformUtils.hpp>
35 
36 #include <memory>
37 #include <sstream>
38 
39 //#define DEBUG 1
40 
41 //----------------------------------------------------------------------------------------------------
42 
43 using namespace std;
44 
49 {
50 public:
51  static const std::string tagVFAT;
52  static const std::string tagChannel;
54 
56  static const std::string tagArm;
57 
59  static const std::string tagRPStation;
60  static const std::string tagRPPot;
61  static const std::string tagRPPlane;
62 
64  static const std::string tagChip1;
65  static const std::string tagChip2;
66 
69  static const std::string tagDiamondCh;
70 
73 
74  edm::ESProducts< boost::shared_ptr<TotemDAQMapping>, boost::shared_ptr<TotemAnalysisMask> > produce( const TotemReadoutRcd & );
75 
76 private:
77  unsigned int verbosity;
78 
80  string subSystemName;
81 
82 
84  std::vector<std::string> mappingFileNames;
85 
86  struct ConfigBlock
87  {
90 
92  std::vector<std::string> mappingFileNames;
93 
95  std::vector<std::string> maskFileNames;
96  };
97 
98  vector<ConfigBlock> configuration;
99 
101  unsigned int currentBlock;
102 
105 
107  enum NodeType { nUnknown, nSkip, nTop, nArm, nRPStation, nRPPot, nRPPlane, nDiamondPlane, nChip, nDiamondCh, nChannel };
108 
110  enum ParseType { pMapping, pMask };
111 
113  void ParseXML(ParseType, const string &file, const boost::shared_ptr<TotemDAQMapping>&, const boost::shared_ptr<TotemAnalysisMask>&);
114 
116  void ParseTreeRP(ParseType, xercesc::DOMNode *, NodeType, unsigned int parentID,
117  const boost::shared_ptr<TotemDAQMapping>&, const boost::shared_ptr<TotemAnalysisMask>&);
118 
120  void ParseTreeDiamond(ParseType, xercesc::DOMNode *, NodeType, unsigned int parentID,
121  const boost::shared_ptr<TotemDAQMapping>&, const boost::shared_ptr<TotemAnalysisMask>&);
122 
123 private:
125  string CompleteFileName(const string &fn);
126 
128  bool Test(xercesc::DOMNode *node, const std::string &name)
129  {
130  return !(name.compare(xercesc::XMLString::transcode(node->getNodeName())));
131  }
132 
134  NodeType GetNodeType(xercesc::DOMNode *);
135 
137  string GetNodeContent(xercesc::DOMNode *parent)
138  {
139  return string(xercesc::XMLString::transcode(parent->getTextContent()));
140  }
141 
143  string GetNodeValue(xercesc::DOMNode *node)
144  {
145  return string(xercesc::XMLString::transcode(node->getNodeValue()));
146  }
147 
149  TotemFramePosition ChipFramePosition(xercesc::DOMNode *chipnode);
150 
151  void GetChannels(xercesc::DOMNode *n, std::set<unsigned char> &channels);
152 
154  {
155  return ((type == nArm)||(type == nRPStation)||(type == nRPPot)||(type == nRPPlane)||(type == nChip));
156  }
157 
159  {
160  return ((type == nArm)||(type == nRPStation)||(type == nRPPot)||(type == nDiamondPlane)||(type == nDiamondCh));
161  }
163  {
164  return ((type==nChip)||(type==nArm));
165  }
166 
167 protected:
169  virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&, const edm::IOVSyncValue&, edm::ValidityInterval&);
170 };
171 
172 //----------------------------------------------------------------------------------------------------
173 
174 using namespace std;
175 using namespace edm;
176 using namespace xercesc;
177 
178 const string TotemDAQMappingESSourceXML::tagVFAT="vfat";
179 const string TotemDAQMappingESSourceXML::tagChannel="channel";
180 const string TotemDAQMappingESSourceXML::tagAnalysisMask="analysisMask";
181 
182 // common XML position tags
183 const string TotemDAQMappingESSourceXML::tagArm = "arm";
184 
185 // common XML Chip tags
186 const string TotemDAQMappingESSourceXML::tagChip1 = "vfat";
187 const string TotemDAQMappingESSourceXML::tagChip2 = "test_vfat";
188 
189 // specific RP XML tags
190 const string TotemDAQMappingESSourceXML::tagRPStation = "station";
191 const string TotemDAQMappingESSourceXML::tagRPPot = "rp_detector_set";
192 const string TotemDAQMappingESSourceXML::tagRPPlane = "rp_plane";
193 
194 // specific tags for diamond
195 const string TotemDAQMappingESSourceXML::tagDiamondPlane = "rp_plane_diamond";
196 const string TotemDAQMappingESSourceXML::tagDiamondCh = "diamond_channel";
197 
198 
199 //----------------------------------------------------------------------------------------------------
200 
202  verbosity(conf.getUntrackedParameter<unsigned int>("verbosity", 0)),
203  subSystemName(conf.getUntrackedParameter<string>("subSystem")),
204  currentBlock(0),
205  currentBlockValid(false)
206 {
207  for (const auto it : conf.getParameter<vector<ParameterSet>>("configuration"))
208  {
209  ConfigBlock b;
210  b.validityRange = it.getParameter<EventRange>("validityRange");
211  b.mappingFileNames = it.getParameter< vector<string> >("mappingFileNames");
212  b.maskFileNames = it.getParameter< vector<string> >("maskFileNames");
213  configuration.push_back(b);
214  }
215 
217  findingRecord<TotemReadoutRcd>();
218 }
219 
220 //----------------------------------------------------------------------------------------------------
221 
223  const edm::IOVSyncValue& iosv, edm::ValidityInterval& oValidity)
224 {
225  LogVerbatim("TotemDAQMappingESSourceXML")
226  << ">> TotemDAQMappingESSourceXML::setIntervalFor(" << key.name() << ")";
227 
228  LogVerbatim("TotemDAQMappingESSourceXML")
229  << " run=" << iosv.eventID().run() << ", event=" << iosv.eventID().event();
230 
231  currentBlockValid = false;
232  for (unsigned int idx = 0; idx < configuration.size(); ++idx)
233  {
234  const auto &bl = configuration[idx];
235 
236  // event id "1:min" has a special meaning and is translated to a truly minimal event id (1:0:0)
237  EventID startEventID = bl.validityRange.startEventID();
238  if (startEventID == EventID(1, 0, 1))
239  startEventID = EventID(1, 0, 0);
240 
241  if (startEventID <= iosv.eventID() && iosv.eventID() <= bl.validityRange.endEventID())
242  {
243  currentBlockValid = true;
244  currentBlock = idx;
245 
246  const IOVSyncValue begin(startEventID);
247  const IOVSyncValue end(bl.validityRange.endEventID());
248  oValidity = ValidityInterval(begin, end);
249 
250  LogVerbatim("TotemDAQMappingESSourceXML")
251  << " block found: index=" << currentBlock
252  << ", interval=(" << startEventID << " - " << bl.validityRange.endEventID() << ")";
253 
254  return;
255  }
256  }
257 
258  if (!currentBlockValid)
259  {
260  throw cms::Exception("TotemDAQMappingESSourceXML::setIntervalFor") <<
261  "No configuration for event " << iosv.eventID();
262  }
263 }
264 
265 //----------------------------------------------------------------------------------------------------
266 
268 {
269 }
270 
271 //----------------------------------------------------------------------------------------------------
272 
274 {
275  FileInPath fip(fn);
276  return fip.fullPath();
277 }
278 
279 //----------------------------------------------------------------------------------------------------
280 
281 edm::ESProducts< boost::shared_ptr<TotemDAQMapping>, boost::shared_ptr<TotemAnalysisMask> >
283 {
285 
286  boost::shared_ptr<TotemDAQMapping> mapping(new TotemDAQMapping());
287  boost::shared_ptr<TotemAnalysisMask> mask(new TotemAnalysisMask());
288 
289  // initialize Xerces
290  try
291  {
292  XMLPlatformUtils::Initialize();
293  }
294  catch (const XMLException& toCatch)
295  {
296  char* message = XMLString::transcode(toCatch.getMessage());
297  throw cms::Exception("TotemDAQMappingESSourceXML") << "An XMLException caught with message: " << message << ".\n";
298  XMLString::release(&message);
299  }
300 
301  // load mapping files
302  for (const auto &fn : configuration[currentBlock].mappingFileNames)
303  ParseXML(pMapping, CompleteFileName(fn), mapping, mask);
304 
305  // load mask files
306  for (const auto &fn : configuration[currentBlock].maskFileNames)
307  ParseXML(pMask, CompleteFileName(fn), mapping, mask);
308 
309  // release Xerces
310  XMLPlatformUtils::Terminate();
311 
312  // commit the products
313  return edm::es::products(mapping, mask);
314 }
315 
316 //----------------------------------------------------------------------------------------------------
317 
319  const boost::shared_ptr<TotemDAQMapping> &mapping, const boost::shared_ptr<TotemAnalysisMask> &mask)
320 {
321  unique_ptr<XercesDOMParser> parser(new XercesDOMParser());
322  parser->parse(file.c_str());
323 
324  DOMDocument* domDoc = parser->getDocument();
325 
326  if (!domDoc)
327  throw cms::Exception("TotemDAQMappingESSourceXML::ParseXML") << "Cannot parse file `" << file
328  << "' (domDoc = NULL)." << endl;
329 
330  DOMElement* elementRoot = domDoc->getDocumentElement();
331 
332  if (!elementRoot)
333  throw cms::Exception("TotemDAQMappingESSourceXML::ParseXML") << "File `" <<
334  file << "' is empty." << endl;
335 
336  ParseTreeRP(pType, elementRoot, nTop, 0, mapping, mask);
337 
338  ParseTreeDiamond(pType, elementRoot, nTop, 0, mapping, mask);
339 }
340 
341 //-----------------------------------------------------------------------------------------------------------
342 
343 void TotemDAQMappingESSourceXML::ParseTreeRP(ParseType pType, xercesc::DOMNode * parent, NodeType parentType,
344  unsigned int parentID, const boost::shared_ptr<TotemDAQMapping>& mapping,
345  const boost::shared_ptr<TotemAnalysisMask>& mask)
346 {
347 #ifdef DEBUG
348  printf(">> TotemDAQMappingESSourceXML::ParseTreeRP(%s, %u, %u)\n", XMLString::transcode(parent->getNodeName()),
349  parentType, parentID);
350 #endif
351 
352  DOMNodeList *children = parent->getChildNodes();
353 
354  for (unsigned int i = 0; i < children->getLength(); i++)
355  {
356  DOMNode *n = children->item(i);
357  if (n->getNodeType() != DOMNode::ELEMENT_NODE)
358  continue;
359 
361 
362 #ifdef DEBUG
363  printf("\tname = %s, type = %u\n", XMLString::transcode(n->getNodeName()), type);
364 #endif
365 
366  // structure control
367  if (!RPNode(type))
368  continue;
369 
370  NodeType expectedParentType;
371  switch (type)
372  {
373  case nArm: expectedParentType = nTop; break;
374  case nRPStation: expectedParentType = nArm; break;
375  case nRPPot: expectedParentType = nRPStation; break;
376  case nRPPlane: expectedParentType = nRPPot; break;
377  case nChip: expectedParentType = nRPPlane; break;
378  case nChannel: expectedParentType = nChip; break;
379  default: expectedParentType = nUnknown; break;
380  }
381 
382  if (expectedParentType != parentType)
383  {
384  throw cms::Exception("TotemDAQMappingESSourceXML") << "Node " << XMLString::transcode(n->getNodeName())
385  << " not allowed within " << XMLString::transcode(parent->getNodeName()) << " block.\n";
386  }
387 
388  // parse tag attributes
389  unsigned int id = 0, hw_id = 0;
390  bool id_set = false, hw_id_set = false;
391  bool fullMask = false;
392  DOMNamedNodeMap* attr = n->getAttributes();
393 
394  for (unsigned int j = 0; j < attr->getLength(); j++)
395  {
396  DOMNode *a = attr->item(j);
397 
398  if (!strcmp(XMLString::transcode(a->getNodeName()), "id"))
399  {
400  sscanf(XMLString::transcode(a->getNodeValue()), "%u", &id);
401  id_set = true;
402  }
403 
404  if (!strcmp(XMLString::transcode(a->getNodeName()), "hw_id"))
405  {
406  sscanf(XMLString::transcode(a->getNodeValue()), "%x", &hw_id);
407  hw_id_set = true;
408  }
409 
410  if (!strcmp(XMLString::transcode(a->getNodeName()), "full_mask"))
411  fullMask = (strcmp(XMLString::transcode(a->getNodeValue()), "no") != 0);
412  }
413 
414  // content control
415  if (!id_set)
416  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeRP") << "id not given for element `"
417  << XMLString::transcode(n->getNodeName()) << "'" << endl;
418 
419  if (!hw_id_set && type == nChip && pType == pMapping)
420  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeRP") << "hw_id not given for element `"
421  << XMLString::transcode(n->getNodeName()) << "'" << endl;
422 
423  if (type == nRPPlane && id > 9)
424  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeRP") <<
425  "Plane IDs range from 0 to 9. id = " << id << " is invalid." << endl;
426 
427 #ifdef DEBUG
428  printf("\tID found: 0x%x\n", id);
429 #endif
430 
431  // store mapping data
432  if (pType == pMapping && type == nChip)
433  {
434  const TotemFramePosition &framepos = ChipFramePosition(n);
435  TotemVFATInfo vfatInfo;
436  vfatInfo.hwID = hw_id;
437 
438  const unsigned int armIdx = (parentID / 1000) % 10;
439  const unsigned int stIdx = (parentID / 100) % 10;
440  const unsigned int rpIdx = (parentID / 10) % 10;
441  const unsigned int plIdx = parentID % 10;
442 
443  vfatInfo.symbolicID.symbolicID = TotemRPDetId(armIdx, stIdx, rpIdx, plIdx, id);
444 
445  mapping->insert(framepos, vfatInfo);
446 
447  continue;
448  }
449 
450  // store mask data
451  if (pType == pMask && type == nChip)
452  {
453  const unsigned int armIdx = (parentID / 1000) % 10;
454  const unsigned int stIdx = (parentID / 100) % 10;
455  const unsigned int rpIdx = (parentID / 10) % 10;
456  const unsigned int plIdx = parentID % 10;
457 
458  TotemSymbID symbId;
459  symbId.symbolicID = TotemRPDetId(armIdx, stIdx, rpIdx, plIdx, id);
460 
462  am.fullMask = fullMask;
464 
465  mask->insert(symbId, am);
466 
467  continue;
468  }
469 
470  // recursion (deeper in the tree)
471  ParseTreeRP(pType, n, type, parentID * 10 + id, mapping, mask);
472  }
473 }
474 
475 //----------------------------------------------------------------------------------------------------
476 
477 void TotemDAQMappingESSourceXML::ParseTreeDiamond(ParseType pType, xercesc::DOMNode * parent, NodeType parentType,
478  unsigned int parentID, const boost::shared_ptr<TotemDAQMapping>& mapping,
479  const boost::shared_ptr<TotemAnalysisMask>& mask)
480 {
481 
482 #ifdef DEBUG
483  printf(">> TotemDAQMappingESSourceXML::ParseTreeDiamond(%s, %u, %u)\n", XMLString::transcode(parent->getNodeName()),
484  parentType, parentID);
485 #endif
486 
487  DOMNodeList *children = parent->getChildNodes();
488 
489  for (unsigned int i = 0; i < children->getLength(); i++)
490  {
491  DOMNode *n = children->item(i);
492  if (n->getNodeType() != DOMNode::ELEMENT_NODE)
493  continue;
494 
496 #ifdef DEBUG
497  printf("\tname = %s, type = %u\n", XMLString::transcode(n->getNodeName()), type);
498 #endif
499 
500  // structure control
501  if (!DiamondNode(type))
502  continue;
503 
504  NodeType expectedParentType;
505  switch (type)
506  {
507  case nArm: expectedParentType = nTop; break;
508  case nRPStation: expectedParentType = nArm; break;
509  case nRPPot: expectedParentType = nRPStation; break;
510  case nDiamondPlane: expectedParentType = nRPPot; break;
511  case nDiamondCh: expectedParentType = nDiamondPlane; break;
512  default: expectedParentType = nUnknown; break;
513  }
514 
515  if (expectedParentType != parentType)
516  {
517  throw cms::Exception("TotemDAQMappingESSourceXML") << "Node " << XMLString::transcode(n->getNodeName())
518  << " not allowed within " << XMLString::transcode(parent->getNodeName()) << " block.\n";
519  }
520 
521  // parse tag attributes
522  unsigned int id =0,hw_id = 0;
523  bool id_set = false,hw_id_set = false;
524  DOMNamedNodeMap* attr = n->getAttributes();
525 
526  for (unsigned int j = 0; j < attr->getLength(); j++)
527  {
528  DOMNode *a = attr->item(j);
529 
530  if (!strcmp(XMLString::transcode(a->getNodeName()), "id"))
531  {
532  sscanf(XMLString::transcode(a->getNodeValue()), "%u", &id);
533  id_set = true;
534  }
535 
536  if (!strcmp(XMLString::transcode(a->getNodeName()), "hw_id"))
537  {
538  sscanf(XMLString::transcode(a->getNodeValue()), "%x", &hw_id);
539  hw_id_set = true;
540  }
541 
542  }
543 
544  // content control
545  if (!id_set)
546  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeDiamond") << "id not given for element `"
547  << XMLString::transcode(n->getNodeName()) << "'" << endl;
548 
549 
550  if (!hw_id_set && type == nDiamondCh && pType == pMapping)
551  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeDiamond") << "hw_id not given for element `"
552  << XMLString::transcode(n->getNodeName()) << "'" << endl;
553 
554  if (type == nDiamondPlane && id > 3)
555  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeDiamond") <<
556  "Plane IDs range from 0 to 3. id = " << id << " is invalid." << endl;
557 
558 #ifdef DEBUG
559  printf("\tID found: 0x%x\n", id);
560 #endif
561 
562  // store mapping data
563  if (pType == pMapping &&type == nDiamondCh)
564  {
565 
566  const TotemFramePosition &framepos = ChipFramePosition(n);
567 
568  TotemVFATInfo vfatInfo;
569  vfatInfo.hwID = hw_id;
570 
571  if (type == nDiamondCh)
572  {
573  unsigned int ArmNum = (parentID/ 10000) % 10;
574  unsigned int StationNum = (parentID / 1000) % 10;
575  unsigned int RpNum = (parentID/ 100) % 10;
576  unsigned int PlaneNum = (parentID % 100) ;
577 
578  vfatInfo.symbolicID.symbolicID = CTPPSDiamondDetId(ArmNum, StationNum, RpNum, PlaneNum, id);
579 
580 
581  }
582 
583 
584  mapping->insert(framepos, vfatInfo);
585 
586  continue;
587  }
588 
589  unsigned int childId;
590  if (pType == pMapping &&type == nDiamondPlane)
591  childId = parentID * 100 + id;
592  else
593  childId = parentID * 10 + id;
594 
595  ParseTreeDiamond(pType,n ,type ,childId ,mapping ,mask);
596 
597  }
598 
599 }
600 
601 
602 //----------------------------------------------------------------------------------------------------
603 
605 {
607  unsigned char attributeFlag = 0;
608 
609  DOMNamedNodeMap* attr = chipnode->getAttributes();
610  for (unsigned int j = 0; j < attr->getLength(); j++)
611  {
612  DOMNode *a = attr->item(j);
613  if (fp.setXMLAttribute(XMLString::transcode(a->getNodeName()), XMLString::transcode(a->getNodeValue()), attributeFlag) > 1)
614  {
615  throw cms::Exception("TotemDAQMappingESSourceXML") <<
616  "Unrecognized tag `" << XMLString::transcode(a->getNodeName()) <<
617  "' or incompatible value `" << XMLString::transcode(a->getNodeValue()) <<
618  "'." << endl;
619  }
620  }
621 
622  if (!fp.checkXMLAttributeFlag(attributeFlag))
623  {
624  throw cms::Exception("TotemDAQMappingESSourceXML") <<
625  "Wrong/incomplete DAQ channel specification (attributeFlag = " << attributeFlag << ")." << endl;
626  }
627 
628  return fp;
629 }
630 
631 //----------------------------------------------------------------------------------------------------
632 
634 {
635  // common node types
636  if (Test(n, tagArm)) return nArm;
637  if (Test(n, tagChip1)) return nChip;
638  if (Test(n, tagChip2)) return nChip;
639 
640  // RP node types
641  if (Test(n, tagRPStation)) return nRPStation;
642  if (Test(n, tagRPPot)) return nRPPot;
643  if (Test(n, tagRPPlane)) return nRPPlane;
644 
645  //diamond specifics
646  if (Test(n, tagDiamondCh)) return nDiamondCh;
647  if (Test(n, tagDiamondPlane)) return nDiamondPlane;
648 
649  // for backward compatibility
650  if (Test(n, "trigger_vfat")) return nSkip;
651 
652  throw cms::Exception("TotemDAQMappingESSourceXML::GetNodeType") << "Unknown tag `"
653  << XMLString::transcode(n->getNodeName()) << "'.\n";
654 }
655 
656 //----------------------------------------------------------------------------------------------------
657 
658 void TotemDAQMappingESSourceXML::GetChannels(xercesc::DOMNode *n, set<unsigned char> &channels)
659 {
660  DOMNodeList *children = n->getChildNodes();
661  for (unsigned int i = 0; i < children->getLength(); i++)
662  {
663  DOMNode *n = children->item(i);
664  if (n->getNodeType() != DOMNode::ELEMENT_NODE || !Test(n, "channel"))
665  continue;
666 
667  DOMNamedNodeMap* attr = n->getAttributes();
668  bool idSet = false;
669  for (unsigned int j = 0; j < attr->getLength(); j++)
670  {
671  DOMNode *a = attr->item(j);
672 
673  if (!strcmp(XMLString::transcode(a->getNodeName()), "id"))
674  {
675  unsigned int id = 0;
676  sscanf(XMLString::transcode(a->getNodeValue()), "%u", &id);
677  channels.insert(id);
678  idSet = true;
679  break;
680  }
681  }
682 
683  if (!idSet)
684  {
685  throw cms::Exception("TotemDAQMappingESSourceXML::GetChannels") <<
686  "Channel tags must have an `id' attribute.";
687  }
688  }
689 }
690 
691 //----------------------------------------------------------------------------------------------------
692 
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
int i
Definition: DBlmapReader.cc:9
Channel-mask mapping.
string GetNodeContent(xercesc::DOMNode *parent)
returns the content of the node
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
assert(m_qm.get())
EventSetup record for TOTEM readout-related information.
bool currentBlockValid
flag whether the &#39;currentBlock&#39; index is valid
NodeType
enumeration of XML node types
void ParseTreeDiamond(ParseType, xercesc::DOMNode *, NodeType, unsigned int parentID, const boost::shared_ptr< TotemDAQMapping > &, const boost::shared_ptr< TotemAnalysisMask > &)
recursive method to extract RP-related information from the DOM tree
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
TotemSymbID symbolicID
the symbolic id
void ParseXML(ParseType, const string &file, const boost::shared_ptr< TotemDAQMapping > &, const boost::shared_ptr< TotemAnalysisMask > &)
parses XML file
NodeType GetNodeType(xercesc::DOMNode *)
determines node type
std::vector< std::string > mappingFileNames
the mapping files
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
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:189
static const std::string tagDiamondCh
The mapping between FramePosition and VFATInfo.
static const std::string tagRPStation
RP XML tags.
TotemFramePosition ChipFramePosition(xercesc::DOMNode *chipnode)
extracts VFAT&#39;s DAQ channel from XML attributes
void ParseTreeRP(ParseType, xercesc::DOMNode *, NodeType, unsigned int parentID, const boost::shared_ptr< TotemDAQMapping > &, const boost::shared_ptr< TotemAnalysisMask > &)
recursive method to extract RP-related information from the DOM tree
int j
Definition: DBlmapReader.cc:9
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
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
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
edm::ESProducts< boost::shared_ptr< TotemDAQMapping >, boost::shared_ptr< TotemAnalysisMask > > produce(const TotemReadoutRcd &)
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
#define begin
Definition: vmac.h:30
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...
static const std::string tagRPPlane
std::vector< std::string > mappingFileNames
the mapping files
volatile std::atomic< bool > shutdown_flag false
std::string fullPath() const
Definition: FileInPath.cc:184
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.
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