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