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 * 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  // If "<run>:min" is specified in python config, it is translated into event <run>:0:1.
240  // However, the truly minimal event id often found in data is <run>:0:0. Therefore the
241  // adjustment below is needed.
242  if (range.startEventID().luminosityBlock() == 0 && range.startEventID().event() == 1)
243  range = edm::EventRange(edm::EventID(range.startEventID().run(), 0, 0), range.endEventID());
244 
245  if (edm::contains(range, iosv.eventID()))
246  {
247  currentBlockValid = true;
248  currentBlock = idx;
249 
250  const IOVSyncValue begin(range.startEventID());
251  const IOVSyncValue end(range.endEventID());
252  oValidity = edm::ValidityInterval(begin, end);
253 
254  LogVerbatim("TotemDAQMappingESSourceXML")
255  << " block found: index=" << currentBlock
256  << ", interval=(" << range.startEventID() << " - " << range.endEventID() << ")";
257 
258  return;
259  }
260  }
261 
262  if (!currentBlockValid)
263  {
264  throw cms::Exception("TotemDAQMappingESSourceXML::setIntervalFor") <<
265  "No configuration for event " << iosv.eventID();
266  }
267 }
268 
269 //----------------------------------------------------------------------------------------------------
270 
272 {
273 }
274 
275 //----------------------------------------------------------------------------------------------------
276 
278 {
279  FileInPath fip(fn);
280  return fip.fullPath();
281 }
282 
283 //----------------------------------------------------------------------------------------------------
284 
285 edm::ESProducts< std::shared_ptr<TotemDAQMapping>, std::shared_ptr<TotemAnalysisMask> >
287 {
289 
290  auto mapping = std::make_shared<TotemDAQMapping>();
291  auto mask = std::make_shared<TotemAnalysisMask>();
292 
293  // initialize Xerces
294  try
295  {
296  XMLPlatformUtils::Initialize();
297  }
298  catch (const XMLException& toCatch)
299  {
300  char* message = XMLString::transcode(toCatch.getMessage());
301  throw cms::Exception("TotemDAQMappingESSourceXML") << "An XMLException caught with message: " << message << ".\n";
302  XMLString::release(&message);
303  }
304 
305  // load mapping files
306  for (const auto &fn : configuration[currentBlock].mappingFileNames)
307  ParseXML(pMapping, CompleteFileName(fn), mapping, mask);
308 
309  // load mask files
310  for (const auto &fn : configuration[currentBlock].maskFileNames)
311  ParseXML(pMask, CompleteFileName(fn), mapping, mask);
312 
313  // release Xerces
314  XMLPlatformUtils::Terminate();
315 
316  // commit the products
317  return edm::es::products(mapping, mask);
318 }
319 
320 //----------------------------------------------------------------------------------------------------
321 
323  const std::shared_ptr<TotemDAQMapping> &mapping, const std::shared_ptr<TotemAnalysisMask> &mask)
324 {
325  unique_ptr<XercesDOMParser> parser(new XercesDOMParser());
326  parser->parse(file.c_str());
327 
328  DOMDocument* domDoc = parser->getDocument();
329 
330  if (!domDoc)
331  throw cms::Exception("TotemDAQMappingESSourceXML::ParseXML") << "Cannot parse file `" << file
332  << "' (domDoc = NULL)." << endl;
333 
334  DOMElement* elementRoot = domDoc->getDocumentElement();
335 
336  if (!elementRoot)
337  throw cms::Exception("TotemDAQMappingESSourceXML::ParseXML") << "File `" <<
338  file << "' is empty." << endl;
339 
340  ParseTreeRP(pType, elementRoot, nTop, 0, mapping, mask);
341 
342  ParseTreeDiamond(pType, elementRoot, nTop, 0, mapping, mask);
343 }
344 
345 //-----------------------------------------------------------------------------------------------------------
346 
347 void TotemDAQMappingESSourceXML::ParseTreeRP(ParseType pType, xercesc::DOMNode * parent, NodeType parentType,
348  unsigned int parentID, const std::shared_ptr<TotemDAQMapping>& mapping,
349  const std::shared_ptr<TotemAnalysisMask>& mask)
350 {
351 #ifdef DEBUG
352  printf(">> TotemDAQMappingESSourceXML::ParseTreeRP(%s, %u, %u)\n", XMLString::transcode(parent->getNodeName()),
353  parentType, parentID);
354 #endif
355 
356  DOMNodeList *children = parent->getChildNodes();
357 
358  for (unsigned int i = 0; i < children->getLength(); i++)
359  {
360  DOMNode *n = children->item(i);
361  if (n->getNodeType() != DOMNode::ELEMENT_NODE)
362  continue;
363 
365 
366 #ifdef DEBUG
367  printf("\tname = %s, type = %u\n", XMLString::transcode(n->getNodeName()), type);
368 #endif
369 
370  // structure control
371  if (!RPNode(type))
372  continue;
373 
374  NodeType expectedParentType;
375  switch (type)
376  {
377  case nArm: expectedParentType = nTop; break;
378  case nRPStation: expectedParentType = nArm; break;
379  case nRPPot: expectedParentType = nRPStation; break;
380  case nRPPlane: expectedParentType = nRPPot; break;
381  case nChip: expectedParentType = nRPPlane; break;
382  case nChannel: expectedParentType = nChip; break;
383  default: expectedParentType = nUnknown; break;
384  }
385 
386  if (expectedParentType != parentType)
387  {
388  throw cms::Exception("TotemDAQMappingESSourceXML") << "Node " << XMLString::transcode(n->getNodeName())
389  << " not allowed within " << XMLString::transcode(parent->getNodeName()) << " block.\n";
390  }
391 
392  // parse tag attributes
393  unsigned int id = 0, hw_id = 0;
394  bool id_set = false, hw_id_set = false;
395  bool fullMask = false;
396  DOMNamedNodeMap* attr = n->getAttributes();
397 
398  for (unsigned int j = 0; j < attr->getLength(); j++)
399  {
400  DOMNode *a = attr->item(j);
401 
402  if (!strcmp(XMLString::transcode(a->getNodeName()), "id"))
403  {
404  sscanf(XMLString::transcode(a->getNodeValue()), "%u", &id);
405  id_set = true;
406  }
407 
408  if (!strcmp(XMLString::transcode(a->getNodeName()), "hw_id"))
409  {
410  sscanf(XMLString::transcode(a->getNodeValue()), "%x", &hw_id);
411  hw_id_set = true;
412  }
413 
414  if (!strcmp(XMLString::transcode(a->getNodeName()), "full_mask"))
415  fullMask = (strcmp(XMLString::transcode(a->getNodeValue()), "no") != 0);
416  }
417 
418  // content control
419  if (!id_set)
420  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeRP") << "id not given for element `"
421  << XMLString::transcode(n->getNodeName()) << "'" << endl;
422 
423  if (!hw_id_set && type == nChip && pType == pMapping)
424  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeRP") << "hw_id not given for element `"
425  << XMLString::transcode(n->getNodeName()) << "'" << endl;
426 
427  if (type == nRPPlane && id > 9)
428  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeRP") <<
429  "Plane IDs range from 0 to 9. id = " << id << " is invalid." << endl;
430 
431 #ifdef DEBUG
432  printf("\tID found: 0x%x\n", id);
433 #endif
434 
435  // store mapping data
436  if (pType == pMapping && type == nChip)
437  {
438  const TotemFramePosition &framepos = ChipFramePosition(n);
439  TotemVFATInfo vfatInfo;
440  vfatInfo.hwID = hw_id;
441 
442  const unsigned int armIdx = (parentID / 1000) % 10;
443  const unsigned int stIdx = (parentID / 100) % 10;
444  const unsigned int rpIdx = (parentID / 10) % 10;
445  const unsigned int plIdx = parentID % 10;
446 
447  vfatInfo.symbolicID.symbolicID = TotemRPDetId(armIdx, stIdx, rpIdx, plIdx, id);
448 
449  mapping->insert(framepos, vfatInfo);
450 
451  continue;
452  }
453 
454  // store mask data
455  if (pType == pMask && type == nChip)
456  {
457  const unsigned int armIdx = (parentID / 1000) % 10;
458  const unsigned int stIdx = (parentID / 100) % 10;
459  const unsigned int rpIdx = (parentID / 10) % 10;
460  const unsigned int plIdx = parentID % 10;
461 
462  TotemSymbID symbId;
463  symbId.symbolicID = TotemRPDetId(armIdx, stIdx, rpIdx, plIdx, id);
464 
466  am.fullMask = fullMask;
468 
469  mask->insert(symbId, am);
470 
471  continue;
472  }
473 
474  // recursion (deeper in the tree)
475  ParseTreeRP(pType, n, type, parentID * 10 + id, mapping, mask);
476  }
477 }
478 
479 //----------------------------------------------------------------------------------------------------
480 
481 void TotemDAQMappingESSourceXML::ParseTreeDiamond(ParseType pType, xercesc::DOMNode * parent, NodeType parentType,
482  unsigned int parentID, const std::shared_ptr<TotemDAQMapping>& mapping,
483  const std::shared_ptr<TotemAnalysisMask>& mask)
484 {
485 
486 #ifdef DEBUG
487  printf(">> TotemDAQMappingESSourceXML::ParseTreeDiamond(%s, %u, %u)\n", XMLString::transcode(parent->getNodeName()),
488  parentType, parentID);
489 #endif
490 
491  DOMNodeList *children = parent->getChildNodes();
492 
493  for (unsigned int i = 0; i < children->getLength(); i++)
494  {
495  DOMNode *n = children->item(i);
496  if (n->getNodeType() != DOMNode::ELEMENT_NODE)
497  continue;
498 
500 #ifdef DEBUG
501  printf("\tname = %s, type = %u\n", XMLString::transcode(n->getNodeName()), type);
502 #endif
503 
504  // structure control
505  if (!DiamondNode(type))
506  continue;
507 
508  NodeType expectedParentType;
509  switch (type)
510  {
511  case nArm: expectedParentType = nTop; break;
512  case nRPStation: expectedParentType = nArm; break;
513  case nRPPot: expectedParentType = nRPStation; break;
514  case nDiamondPlane: expectedParentType = nRPPot; break;
515  case nDiamondCh: expectedParentType = nDiamondPlane; break;
516  default: expectedParentType = nUnknown; break;
517  }
518 
519  if (expectedParentType != parentType)
520  {
521  throw cms::Exception("TotemDAQMappingESSourceXML") << "Node " << XMLString::transcode(n->getNodeName())
522  << " not allowed within " << XMLString::transcode(parent->getNodeName()) << " block.\n";
523  }
524 
525  // parse tag attributes
526  unsigned int id =0,hw_id = 0;
527  bool id_set = false,hw_id_set = false;
528  DOMNamedNodeMap* attr = n->getAttributes();
529 
530  for (unsigned int j = 0; j < attr->getLength(); j++)
531  {
532  DOMNode *a = attr->item(j);
533 
534  if (!strcmp(XMLString::transcode(a->getNodeName()), "id"))
535  {
536  sscanf(XMLString::transcode(a->getNodeValue()), "%u", &id);
537  id_set = true;
538  }
539 
540  if (!strcmp(XMLString::transcode(a->getNodeName()), "hw_id"))
541  {
542  sscanf(XMLString::transcode(a->getNodeValue()), "%x", &hw_id);
543  hw_id_set = true;
544  }
545 
546  }
547 
548  // content control
549  if (!id_set)
550  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeDiamond") << "id not given for element `"
551  << XMLString::transcode(n->getNodeName()) << "'" << endl;
552 
553 
554  if (!hw_id_set && type == nDiamondCh && pType == pMapping)
555  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeDiamond") << "hw_id not given for element `"
556  << XMLString::transcode(n->getNodeName()) << "'" << endl;
557 
558  if (type == nDiamondPlane && id > 3)
559  throw cms::Exception("TotemDAQMappingESSourceXML::ParseTreeDiamond") <<
560  "Plane IDs range from 0 to 3. id = " << id << " is invalid." << endl;
561 
562 #ifdef DEBUG
563  printf("\tID found: 0x%x\n", id);
564 #endif
565 
566  // store mapping data
567  if (pType == pMapping &&type == nDiamondCh)
568  {
569 
570  const TotemFramePosition &framepos = ChipFramePosition(n);
571 
572  TotemVFATInfo vfatInfo;
573  vfatInfo.hwID = hw_id;
574 
575  if (type == nDiamondCh)
576  {
577  unsigned int ArmNum = (parentID/ 10000) % 10;
578  unsigned int StationNum = (parentID / 1000) % 10;
579  unsigned int RpNum = (parentID/ 100) % 10;
580  unsigned int PlaneNum = (parentID % 100) ;
581 
582  vfatInfo.symbolicID.symbolicID = CTPPSDiamondDetId(ArmNum, StationNum, RpNum, PlaneNum, id);
583 
584 
585  }
586 
587 
588  mapping->insert(framepos, vfatInfo);
589 
590  continue;
591  }
592 
593  unsigned int childId;
594  if (pType == pMapping &&type == nDiamondPlane)
595  childId = parentID * 100 + id;
596  else
597  childId = parentID * 10 + id;
598 
599  ParseTreeDiamond(pType,n ,type ,childId ,mapping ,mask);
600 
601  }
602 
603 }
604 
605 
606 //----------------------------------------------------------------------------------------------------
607 
609 {
611  unsigned char attributeFlag = 0;
612 
613  DOMNamedNodeMap* attr = chipnode->getAttributes();
614  for (unsigned int j = 0; j < attr->getLength(); j++)
615  {
616  DOMNode *a = attr->item(j);
617  if (fp.setXMLAttribute(XMLString::transcode(a->getNodeName()), XMLString::transcode(a->getNodeValue()), attributeFlag) > 1)
618  {
619  throw cms::Exception("TotemDAQMappingESSourceXML") <<
620  "Unrecognized tag `" << XMLString::transcode(a->getNodeName()) <<
621  "' or incompatible value `" << XMLString::transcode(a->getNodeValue()) <<
622  "'." << endl;
623  }
624  }
625 
626  if (!fp.checkXMLAttributeFlag(attributeFlag))
627  {
628  throw cms::Exception("TotemDAQMappingESSourceXML") <<
629  "Wrong/incomplete DAQ channel specification (attributeFlag = " << attributeFlag << ")." << endl;
630  }
631 
632  return fp;
633 }
634 
635 //----------------------------------------------------------------------------------------------------
636 
638 {
639  // common node types
640  if (Test(n, tagArm)) return nArm;
641  if (Test(n, tagChip1)) return nChip;
642  if (Test(n, tagChip2)) return nChip;
643 
644  // RP node types
645  if (Test(n, tagRPStation)) return nRPStation;
646  if (Test(n, tagRPPot)) return nRPPot;
647  if (Test(n, tagRPPlane)) return nRPPlane;
648 
649  //diamond specifics
650  if (Test(n, tagDiamondCh)) return nDiamondCh;
651  if (Test(n, tagDiamondPlane)) return nDiamondPlane;
652 
653  // for backward compatibility
654  if (Test(n, "trigger_vfat")) return nSkip;
655 
656  throw cms::Exception("TotemDAQMappingESSourceXML::GetNodeType") << "Unknown tag `"
657  << XMLString::transcode(n->getNodeName()) << "'.\n";
658 }
659 
660 //----------------------------------------------------------------------------------------------------
661 
662 void TotemDAQMappingESSourceXML::GetChannels(xercesc::DOMNode *n, set<unsigned char> &channels)
663 {
664  DOMNodeList *children = n->getChildNodes();
665  for (unsigned int i = 0; i < children->getLength(); i++)
666  {
667  DOMNode *n = children->item(i);
668  if (n->getNodeType() != DOMNode::ELEMENT_NODE || !Test(n, "channel"))
669  continue;
670 
671  DOMNamedNodeMap* attr = n->getAttributes();
672  bool idSet = false;
673  for (unsigned int j = 0; j < attr->getLength(); j++)
674  {
675  DOMNode *a = attr->item(j);
676 
677  if (!strcmp(XMLString::transcode(a->getNodeName()), "id"))
678  {
679  unsigned int id = 0;
680  sscanf(XMLString::transcode(a->getNodeValue()), "%u", &id);
681  channels.insert(id);
682  idSet = true;
683  break;
684  }
685  }
686 
687  if (!idSet)
688  {
689  throw cms::Exception("TotemDAQMappingESSourceXML::GetChannels") <<
690  "Channel tags must have an `id' attribute.";
691  }
692  }
693 }
694 
695 //----------------------------------------------------------------------------------------------------
696 
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
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
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
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
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
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
XMLCh * transcode(const T &fInput)
EventID endEventID() const
Definition: EventRange.h:45
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
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
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.
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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
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.
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