CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Types | Private Member Functions | Private Attributes
CTPPSPixelDAQMappingESSourceXML Class Reference

Loads CTPPSPixelDAQMapping and CTPPSPixelAnalysisMask from two XML files. More...

Inheritance diagram for CTPPSPixelDAQMappingESSourceXML:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Classes

struct  ConfigBlock
 

Public Member Functions

 CTPPSPixelDAQMappingESSourceXML (const edm::ParameterSet &)
 
std::unique_ptr< CTPPSPixelAnalysisMaskproduceCTPPSPixelAnalysisMask (const CTPPSPixelAnalysisMaskRcd &)
 
std::unique_ptr< CTPPSPixelDAQMappingproduceCTPPSPixelDAQMapping (const CTPPSPixelDAQMappingRcd &)
 
 ~CTPPSPixelDAQMappingESSourceXML () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
bool concurrentFinder () const
 
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
 EventSetupRecordIntervalFinder (const EventSetupRecordIntervalFinder &)=delete
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
bool nonconcurrentAndIOVNeedsUpdate (const eventsetup::EventSetupRecordKey &key, const IOVSyncValue &syncValue) const
 
const EventSetupRecordIntervalFinderoperator= (const EventSetupRecordIntervalFinder &)=delete
 
void resetInterval (const eventsetup::EventSetupRecordKey &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 

Static Public Attributes

static const std::string tagAnalysisMask = "analysisMask"
 
static const std::string tagArm = "arm"
 Common position tags. More...
 
static const std::string tagPixel = "pixel"
 
static const std::string tagROC = "roc"
 
static const std::string tagRPixPlane = "rpix_plane"
 
static const std::string tagRPPot = "rp_detector_set"
 
static const std::string tagRPStation = "station"
 RP XML tags. More...
 

Protected Member Functions

void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
 sets infinite validity of this data More...
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Private Types

enum  NodeType {
  nUnknown, nSkip, nTop, nArm,
  nRPStation, nRPPot, nRPixPlane, nROC,
  nPixel
}
 enumeration of XML node types More...
 
enum  ParseType { pMapping, pMask }
 whether to parse a mapping of a mask XML More...
 

Private Member Functions

CTPPSPixelFramePosition ChipFramePosition (xercesc::DOMNode *chipnode)
 extracts VFAT's DAQ channel from XML attributes More...
 
string CompleteFileName (const string &fn)
 adds the path prefix, if needed More...
 
string GetNodeContent (xercesc::DOMNode *parent)
 returns the content of the node More...
 
NodeType GetNodeType (xercesc::DOMNode *)
 determines node type More...
 
string GetNodeValue (xercesc::DOMNode *node)
 returns the value of the node More...
 
void GetPixels (xercesc::DOMNode *n, std::set< std::pair< unsigned char, unsigned char >> &pixels)
 
void ParseTreePixel (ParseType, xercesc::DOMNode *, NodeType, unsigned int parentID, const std::unique_ptr< CTPPSPixelDAQMapping > &, const std::unique_ptr< CTPPSPixelAnalysisMask > &)
 recursive method to extract Pixel-related information from the DOM tree More...
 
void ParseXML (ParseType, const string &file, const std::unique_ptr< CTPPSPixelDAQMapping > &, const std::unique_ptr< CTPPSPixelAnalysisMask > &)
 parses XML file More...
 
bool PixelNode (NodeType type)
 
bool Test (xercesc::DOMNode *node, const std::string &name)
 returns true iff the node is of the given name More...
 

Private Attributes

vector< ConfigBlockconfiguration
 
unsigned int currentBlock
 index of the current block in 'configuration' array More...
 
bool currentBlockValid
 flag whether the 'currentBlock' index is valid More...
 
std::vector< std::string > mappingFileNames
 the mapping files More...
 
string subSystemName
 label of the CTPPS sub-system More...
 
unsigned int verbosity
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 

Detailed Description

Loads CTPPSPixelDAQMapping and CTPPSPixelAnalysisMask from two XML files.

Definition at line 49 of file CTPPSPixelDAQMappingESSourceXML.cc.

Member Enumeration Documentation

◆ NodeType

enumeration of XML node types

Enumerator
nUnknown 
nSkip 
nTop 
nArm 
nRPStation 
nRPPot 
nRPixPlane 
nROC 
nPixel 

Definition at line 97 of file CTPPSPixelDAQMappingESSourceXML.cc.

◆ ParseType

whether to parse a mapping of a mask XML

Enumerator
pMapping 
pMask 

Definition at line 100 of file CTPPSPixelDAQMappingESSourceXML.cc.

100 { pMapping, pMask };

Constructor & Destructor Documentation

◆ CTPPSPixelDAQMappingESSourceXML()

CTPPSPixelDAQMappingESSourceXML::CTPPSPixelDAQMappingESSourceXML ( const edm::ParameterSet conf)

Definition at line 171 of file CTPPSPixelDAQMappingESSourceXML.cc.

172  : verbosity(conf.getUntrackedParameter<unsigned int>("verbosity", 0)),
173  subSystemName(conf.getUntrackedParameter<string>("subSystem")),
174  currentBlock(0),
175  currentBlockValid(false) {
176  for (const auto &it : conf.getParameter<vector<ParameterSet>>("configuration")) {
177  ConfigBlock b;
178  b.validityRange = it.getParameter<EventRange>("validityRange");
179  b.mappingFileNames = it.getParameter<vector<string>>("mappingFileNames");
180  b.maskFileNames = it.getParameter<vector<string>>("maskFileNames");
181  configuration.push_back(b);
182  }
183 
185  findingRecord<CTPPSPixelAnalysisMaskRcd>();
186 
188  findingRecord<CTPPSPixelDAQMappingRcd>();
189 
190  LogVerbatim("CTPPSPixelDAQMappingESSourceXML") << " Inside CTPPSPixelDAQMappingESSourceXML";
191 }

References b, configuration, edm::ParameterSet::getParameter(), produceCTPPSPixelAnalysisMask(), produceCTPPSPixelDAQMapping(), edm::ESProducer::setWhatProduced(), and subSystemName.

◆ ~CTPPSPixelDAQMappingESSourceXML()

CTPPSPixelDAQMappingESSourceXML::~CTPPSPixelDAQMappingESSourceXML ( )
override

Definition at line 231 of file CTPPSPixelDAQMappingESSourceXML.cc.

231 {}

Member Function Documentation

◆ ChipFramePosition()

CTPPSPixelFramePosition CTPPSPixelDAQMappingESSourceXML::ChipFramePosition ( xercesc::DOMNode *  chipnode)
private

extracts VFAT's DAQ channel from XML attributes

Definition at line 453 of file CTPPSPixelDAQMappingESSourceXML.cc.

453  {
455  unsigned char attributeFlag = 0;
456 
457  DOMNamedNodeMap *attr = chipnode->getAttributes();
458  for (unsigned int j = 0; j < attr->getLength(); j++) {
459  DOMNode *a = attr->item(j);
460 
461  if (fp.setXMLAttribute(
462  cms::xerces::toString(a->getNodeName()), cms::xerces::toString(a->getNodeValue()), attributeFlag) > 1) {
463  throw cms::Exception("CTPPSPixelDAQMappingESSourceXML")
464  << "Unrecognized tag `" << cms::xerces::toString(a->getNodeName()) << "' or incompatible value `"
465  << cms::xerces::toString(a->getNodeValue()) << "'." << endl;
466  }
467  }
468 
469  if (!fp.checkXMLAttributeFlag(attributeFlag)) {
470  throw cms::Exception("CTPPSPixelDAQMappingESSourceXML")
471  << "Wrong/incomplete DAQ channel specification (attributeFlag = " << attributeFlag << ")." << endl;
472  }
473 
474  return fp;
475 }

References a, Exception, personalPlayback::fp, dqmiolumiharvest::j, and cms::xerces::toString().

Referenced by ParseTreePixel().

◆ CompleteFileName()

string CTPPSPixelDAQMappingESSourceXML::CompleteFileName ( const string &  fn)
private

adds the path prefix, if needed

Definition at line 233 of file CTPPSPixelDAQMappingESSourceXML.cc.

233  {
234  FileInPath fip(fn);
235  return fip.fullPath();
236 }

References personalPlayback::fn, and edm::FileInPath::fullPath().

Referenced by produceCTPPSPixelAnalysisMask(), and produceCTPPSPixelDAQMapping().

◆ GetNodeContent()

string CTPPSPixelDAQMappingESSourceXML::GetNodeContent ( xercesc::DOMNode *  parent)
inlineprivate

returns the content of the node

Definition at line 129 of file CTPPSPixelDAQMappingESSourceXML.cc.

129 { return cms::xerces::toString(parent->getTextContent()); }

References class-composition::parent, and cms::xerces::toString().

◆ GetNodeType()

CTPPSPixelDAQMappingESSourceXML::NodeType CTPPSPixelDAQMappingESSourceXML::GetNodeType ( xercesc::DOMNode *  n)
private

determines node type

Definition at line 479 of file CTPPSPixelDAQMappingESSourceXML.cc.

479  {
480  // common node types
481  if (Test(n, tagArm))
482  return nArm;
483  if (Test(n, tagROC))
484  return nROC;
485 
486  // RP node types
487  if (Test(n, tagRPStation))
488  return nRPStation;
489  if (Test(n, tagRPPot))
490  return nRPPot;
491  if (Test(n, tagRPixPlane))
492  return nRPixPlane;
493 
494  throw cms::Exception("CTPPSPixelDAQMappingESSourceXML::GetNodeType")
495  << "Unknown tag `" << cms::xerces::toString(n->getNodeName()) << "'.\n";
496 }

References Exception, dqmiodumpmetadata::n, nArm, nROC, nRPixPlane, nRPPot, nRPStation, tagArm, tagROC, tagRPixPlane, tagRPPot, tagRPStation, Test(), and cms::xerces::toString().

Referenced by ParseTreePixel().

◆ GetNodeValue()

string CTPPSPixelDAQMappingESSourceXML::GetNodeValue ( xercesc::DOMNode *  node)
inlineprivate

returns the value of the node

Definition at line 132 of file CTPPSPixelDAQMappingESSourceXML.cc.

132 { return cms::xerces::toString(node->getNodeValue()); }

References cms::xerces::toString().

◆ GetPixels()

void CTPPSPixelDAQMappingESSourceXML::GetPixels ( xercesc::DOMNode *  n,
std::set< std::pair< unsigned char, unsigned char >> &  pixels 
)
private

Definition at line 500 of file CTPPSPixelDAQMappingESSourceXML.cc.

501  {
502  DOMNodeList *children = n->getChildNodes();
503  for (unsigned int i = 0; i < children->getLength(); i++) {
504  DOMNode *n = children->item(i);
505  if (n->getNodeType() != DOMNode::ELEMENT_NODE || !Test(n, "pixel"))
506  continue;
507 
508  DOMNamedNodeMap *attr = n->getAttributes();
509  bool pixelSet = false;
510  bool rowSet = false;
511  bool colSet = false;
512  std::pair<unsigned int, unsigned int> currentPixel;
513  for (unsigned int j = 0; j < attr->getLength(); j++) {
514  DOMNode *a = attr->item(j);
515 
516  if (!strcmp(cms::xerces::toString(a->getNodeName()).c_str(), "row")) {
517  unsigned int row = 0;
518  sscanf(cms::xerces::toString(a->getNodeValue()).c_str(), "%u", &row);
519  currentPixel.first = row;
520  rowSet = true;
521  }
522  if (!strcmp(cms::xerces::toString(a->getNodeName()).c_str(), "col")) {
523  unsigned int col = 0;
524  sscanf(cms::xerces::toString(a->getNodeValue()).c_str(), "%u", &col);
525  currentPixel.second = col;
526  colSet = true;
527  }
528 
529  pixelSet = rowSet & colSet;
530  if (pixelSet) {
531  pixels.insert(currentPixel);
532  break;
533  }
534  }
535 
536  if (!pixelSet) {
537  throw cms::Exception("CTPPSPixelDAQMappingESSourceXML::GetChannels")
538  << "Channel tags must have a row or col attribute.";
539  }
540  }
541 }

References a, class-composition::children, cuy::col, Exception, mps_fire::i, dqmiolumiharvest::j, dqmiodumpmetadata::n, es_hardcode_cfi::pixels, Test(), and cms::xerces::toString().

Referenced by ParseTreePixel().

◆ ParseTreePixel()

void CTPPSPixelDAQMappingESSourceXML::ParseTreePixel ( ParseType  pType,
xercesc::DOMNode *  parent,
NodeType  parentType,
unsigned int  parentID,
const std::unique_ptr< CTPPSPixelDAQMapping > &  mapping,
const std::unique_ptr< CTPPSPixelAnalysisMask > &  mask 
)
private

recursive method to extract Pixel-related information from the DOM tree

Definition at line 316 of file CTPPSPixelDAQMappingESSourceXML.cc.

321  {
322 #ifdef DEBUG
323  printf(">> CTPPSPixelDAQMappingESSourceXML::ParseTreeRP(%s, %u, %u)\n",
324  cms::xerces::toString(parent->getNodeName()),
325  parentType,
326  parentID);
327 #endif
328 
329  DOMNodeList *children = parent->getChildNodes();
330 
331  for (unsigned int i = 0; i < children->getLength(); i++) {
332  DOMNode *n = children->item(i);
333  if (n->getNodeType() != DOMNode::ELEMENT_NODE)
334  continue;
335 
337 
338 #ifdef DEBUG
339  printf("\tname = %s, type = %u\n", cms::xerces::toString(n->getNodeName()), type);
340 #endif
341 
342  // structure control
343  if (!PixelNode(type))
344  continue;
345 
346  NodeType expectedParentType;
347  switch (type) {
348  case nArm:
349  expectedParentType = nTop;
350  break;
351  case nRPStation:
352  expectedParentType = nArm;
353  break;
354  case nRPPot:
355  expectedParentType = nRPStation;
356  break;
357  case nRPixPlane:
358  expectedParentType = nRPPot;
359  break;
360  case nROC:
361  expectedParentType = nRPixPlane;
362  break;
363  case nPixel:
364  expectedParentType = nROC;
365  break;
366  default:
367  expectedParentType = nUnknown;
368  break;
369  }
370 
371  if (expectedParentType != parentType) {
372  throw cms::Exception("CTPPSPixelDAQMappingESSourceXML")
373  << "Node " << cms::xerces::toString(n->getNodeName()) << " not allowed within "
374  << cms::xerces::toString(parent->getNodeName()) << " block.\n";
375  }
376 
377  // parse tag attributes
378  unsigned int id = 0;
379  bool id_set = false;
380  bool fullMask = false;
381  DOMNamedNodeMap *attr = n->getAttributes();
382 
383  for (unsigned int j = 0; j < attr->getLength(); j++) {
384  DOMNode *a = attr->item(j);
385 
386  if (!strcmp(cms::xerces::toString(a->getNodeName()).c_str(), "id")) {
387  sscanf(cms::xerces::toString(a->getNodeValue()).c_str(), "%u", &id);
388  id_set = true;
389  }
390 
391  if (!strcmp(cms::xerces::toString(a->getNodeName()).c_str(), "full_mask"))
392  fullMask = (strcmp(cms::xerces::toString(a->getNodeValue()).c_str(), "no") != 0);
393  }
394 
395  // content control
396  if (!id_set)
397  throw cms::Exception("CTPPSPixelDAQMappingESSourceXML::ParseTreePixel")
398  << "id not given for element `" << cms::xerces::toString(n->getNodeName()) << "'" << endl;
399 
400  if (type == nRPixPlane && id > 5)
401  throw cms::Exception("CTPPSPixelDAQMappingESSourceXML::ParseTreePixel")
402  << "Plane IDs range from 0 to 5. id = " << id << " is invalid." << endl;
403 
404 #ifdef DEBUG
405  printf("\tID found: %u\n", id);
406 #endif
407 
408  // store mapping data
409  if (pType == pMapping && type == nROC) {
410  const CTPPSPixelFramePosition &framepos = ChipFramePosition(n);
411  CTPPSPixelROCInfo rocInfo;
412  rocInfo.roc = id;
413 
414  const unsigned int armIdx = (parentID / 1000) % 10;
415  const unsigned int stIdx = (parentID / 100) % 10;
416  const unsigned int rpIdx = (parentID / 10) % 10;
417  const unsigned int plIdx = parentID % 10;
418 
419  rocInfo.iD = CTPPSPixelDetId(armIdx, stIdx, rpIdx, plIdx);
420 
421  mapping->insert(framepos, rocInfo);
422 
423  continue;
424  }
425 
426  // store mask data
427  if (pType == pMask && type == nROC) {
428  const unsigned int armIdx = (parentID / 1000) % 10;
429  const unsigned int stIdx = (parentID / 100) % 10;
430  const unsigned int rpIdx = (parentID / 10) % 10;
431  const unsigned int plIdx = parentID % 10;
432 
433  uint32_t symbId = (id << offsetROCinDetId);
434 
435  symbId |= CTPPSPixelDetId(armIdx, stIdx, rpIdx, plIdx);
436 
438  am.fullMask = fullMask;
439  GetPixels(n, am.maskedPixels);
440 
441  mask->insert(symbId, am);
442 
443  continue;
444  }
445 
446  // recursion (deeper in the tree)
447  ParseTreePixel(pType, n, type, parentID * 10 + id, mapping, mask);
448  }
449 }

References a, class-composition::children, ChipFramePosition(), Exception, CTPPSPixelROCAnalysisMask::fullMask, GetNodeType(), GetPixels(), mps_fire::i, triggerObjects_cff::id, CTPPSPixelROCInfo::iD, dqmiolumiharvest::j, taus_updatedMVAIds_cff::mapping, CTPPSPixelROCAnalysisMask::maskedPixels, dqmiodumpmetadata::n, nArm, nPixel, nROC, nRPixPlane, nRPPot, nRPStation, nTop, nUnknown, offsetROCinDetId, class-composition::parent, PixelNode(), pMapping, pMask, CTPPSPixelROCInfo::roc, and cms::xerces::toString().

Referenced by ParseXML().

◆ ParseXML()

void CTPPSPixelDAQMappingESSourceXML::ParseXML ( ParseType  pType,
const string &  file,
const std::unique_ptr< CTPPSPixelDAQMapping > &  mapping,
const std::unique_ptr< CTPPSPixelAnalysisMask > &  mask 
)
private

parses XML file

Definition at line 293 of file CTPPSPixelDAQMappingESSourceXML.cc.

296  {
297  unique_ptr<XercesDOMParser> parser(new XercesDOMParser());
298  parser->parse(file.c_str());
299 
300  DOMDocument *domDoc = parser->getDocument();
301 
302  if (!domDoc)
303  throw cms::Exception("CTPPSPixelDAQMappingESSourceXML::ParseXML")
304  << "Cannot parse file `" << file << "' (domDoc = NULL)." << endl;
305 
306  DOMElement *elementRoot = domDoc->getDocumentElement();
307 
308  if (!elementRoot)
309  throw cms::Exception("CTPPSPixelDAQMappingESSourceXML::ParseXML") << "File `" << file << "' is empty." << endl;
310 
311  ParseTreePixel(pType, elementRoot, nTop, 0, mapping, mask);
312 }

References Exception, FrontierConditions_GlobalTag_cff::file, taus_updatedMVAIds_cff::mapping, nTop, writedatasetfile::parser, and ParseTreePixel().

Referenced by produceCTPPSPixelAnalysisMask(), and produceCTPPSPixelDAQMapping().

◆ PixelNode()

bool CTPPSPixelDAQMappingESSourceXML::PixelNode ( NodeType  type)
inlineprivate

Definition at line 139 of file CTPPSPixelDAQMappingESSourceXML.cc.

139  {
140  return ((type == nArm) || (type == nRPStation) || (type == nRPPot) || (type == nRPixPlane) || (type == nROC));
141  }

Referenced by ParseTreePixel().

◆ produceCTPPSPixelAnalysisMask()

std::unique_ptr< CTPPSPixelAnalysisMask > CTPPSPixelDAQMappingESSourceXML::produceCTPPSPixelAnalysisMask ( const CTPPSPixelAnalysisMaskRcd )

Definition at line 264 of file CTPPSPixelDAQMappingESSourceXML.cc.

265  {
267 
268  auto mapping = std::make_unique<CTPPSPixelDAQMapping>();
269  auto mask = std::make_unique<CTPPSPixelAnalysisMask>();
270 
271  // initialize Xerces
272 
274 
275  // load mapping files
276  for (const auto &fn : configuration[currentBlock].mappingFileNames)
278 
279  // load mask files
280  for (const auto &fn : configuration[currentBlock].maskFileNames)
282 
283  // release Xerces
285 
286  // commit the products
287  //return edm::es::products(mapping, mask);
288  return mask;
289 }

References cms::cuda::assert(), CompleteFileName(), configuration, currentBlock, currentBlockValid, personalPlayback::fn, taus_updatedMVAIds_cff::mapping, mappingFileNames, ctppsRawToDigi_cff::maskFileNames, ParseXML(), pMapping, pMask, cms::concurrency::xercesInitialize(), and cms::concurrency::xercesTerminate().

Referenced by CTPPSPixelDAQMappingESSourceXML().

◆ produceCTPPSPixelDAQMapping()

std::unique_ptr< CTPPSPixelDAQMapping > CTPPSPixelDAQMappingESSourceXML::produceCTPPSPixelDAQMapping ( const CTPPSPixelDAQMappingRcd )

Definition at line 238 of file CTPPSPixelDAQMappingESSourceXML.cc.

239  {
241 
242  auto mapping = std::make_unique<CTPPSPixelDAQMapping>();
243  auto mask = std::make_unique<CTPPSPixelAnalysisMask>();
244 
245  // initialize Xerces
246 
248 
249  // load mapping files
250  for (const auto &fn : configuration[currentBlock].mappingFileNames)
252 
253  // load mask files
254  for (const auto &fn : configuration[currentBlock].maskFileNames)
256 
257  // release Xerces
259 
260  // commit the product
261  return mapping;
262 }

References cms::cuda::assert(), CompleteFileName(), configuration, currentBlock, currentBlockValid, personalPlayback::fn, taus_updatedMVAIds_cff::mapping, mappingFileNames, ctppsRawToDigi_cff::maskFileNames, ParseXML(), pMapping, pMask, cms::concurrency::xercesInitialize(), and cms::concurrency::xercesTerminate().

Referenced by CTPPSPixelDAQMappingESSourceXML().

◆ setIntervalFor()

void CTPPSPixelDAQMappingESSourceXML::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey key,
const edm::IOVSyncValue iosv,
edm::ValidityInterval oValidity 
)
overrideprotectedvirtual

sets infinite validity of this data

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 193 of file CTPPSPixelDAQMappingESSourceXML.cc.

195  {
196  LogVerbatim("CTPPSPixelDAQMappingESSourceXML")
197  << ">> CTPPSPixelDAQMappingESSourceXML::setIntervalFor(" << key.name() << ")";
198 
199  LogVerbatim("CTPPSPixelDAQMappingESSourceXML")
200  << " run=" << iosv.eventID().run() << ", event=" << iosv.eventID().event();
201 
202  currentBlockValid = false;
203  for (unsigned int idx = 0; idx < configuration.size(); ++idx) {
204  const auto &bl = configuration[idx];
205 
206  EventID startEventID = bl.validityRange.startEventID();
207  if (startEventID == EventID(1, 0, 1))
208  startEventID = EventID(1, 0, 0);
209 
210  if (startEventID <= iosv.eventID() && iosv.eventID() <= bl.validityRange.endEventID()) {
211  currentBlockValid = true;
212  currentBlock = idx;
213 
214  const IOVSyncValue begin(startEventID);
215  const IOVSyncValue end(bl.validityRange.endEventID());
216  oValidity = ValidityInterval(begin, end);
217 
218  LogVerbatim("CTPPSPixelDAQMappingESSourceXML") << " block found: index=" << currentBlock << ", interval=("
219  << startEventID << " - " << bl.validityRange.endEventID() << ")";
220 
221  return;
222  }
223  }
224 
225  if (!currentBlockValid) {
226  throw cms::Exception("CTPPSPixelDAQMappingESSourceXML::setIntervalFor")
227  << "No configuration for event " << iosv.eventID();
228  }
229 }

References begin, configuration, currentBlock, currentBlockValid, end, edm::EventID::event(), edm::IOVSyncValue::eventID(), Exception, charmTagsComputerCvsB_cfi::idx, crabWrapper::key, and edm::EventID::run().

◆ Test()

bool CTPPSPixelDAQMappingESSourceXML::Test ( xercesc::DOMNode *  node,
const std::string &  name 
)
inlineprivate

returns true iff the node is of the given name

Definition at line 121 of file CTPPSPixelDAQMappingESSourceXML.cc.

121  {
122  return !(name.compare(cms::xerces::toString(node->getNodeName())));
123  }

References Skims_PA_cff::name, and cms::xerces::toString().

Referenced by GetNodeType(), and GetPixels().

Member Data Documentation

◆ configuration

vector<ConfigBlock> CTPPSPixelDAQMappingESSourceXML::configuration
private

◆ currentBlock

unsigned int CTPPSPixelDAQMappingESSourceXML::currentBlock
private

index of the current block in 'configuration' array

Definition at line 91 of file CTPPSPixelDAQMappingESSourceXML.cc.

Referenced by produceCTPPSPixelAnalysisMask(), produceCTPPSPixelDAQMapping(), and setIntervalFor().

◆ currentBlockValid

bool CTPPSPixelDAQMappingESSourceXML::currentBlockValid
private

flag whether the 'currentBlock' index is valid

Definition at line 94 of file CTPPSPixelDAQMappingESSourceXML.cc.

Referenced by produceCTPPSPixelAnalysisMask(), produceCTPPSPixelDAQMapping(), and setIntervalFor().

◆ mappingFileNames

std::vector<std::string> CTPPSPixelDAQMappingESSourceXML::mappingFileNames
private

the mapping files

Definition at line 75 of file CTPPSPixelDAQMappingESSourceXML.cc.

Referenced by produceCTPPSPixelAnalysisMask(), and produceCTPPSPixelDAQMapping().

◆ subSystemName

string CTPPSPixelDAQMappingESSourceXML::subSystemName
private

label of the CTPPS sub-system

Definition at line 72 of file CTPPSPixelDAQMappingESSourceXML.cc.

Referenced by CTPPSPixelDAQMappingESSourceXML().

◆ tagAnalysisMask

const string CTPPSPixelDAQMappingESSourceXML::tagAnalysisMask = "analysisMask"
static

Definition at line 51 of file CTPPSPixelDAQMappingESSourceXML.cc.

◆ tagArm

const string CTPPSPixelDAQMappingESSourceXML::tagArm = "arm"
static

Common position tags.

Definition at line 56 of file CTPPSPixelDAQMappingESSourceXML.cc.

Referenced by GetNodeType().

◆ tagPixel

const string CTPPSPixelDAQMappingESSourceXML::tagPixel = "pixel"
static

Definition at line 54 of file CTPPSPixelDAQMappingESSourceXML.cc.

◆ tagROC

const string CTPPSPixelDAQMappingESSourceXML::tagROC = "roc"
static

Definition at line 53 of file CTPPSPixelDAQMappingESSourceXML.cc.

Referenced by GetNodeType().

◆ tagRPixPlane

const string CTPPSPixelDAQMappingESSourceXML::tagRPixPlane = "rpix_plane"
static

Definition at line 52 of file CTPPSPixelDAQMappingESSourceXML.cc.

Referenced by GetNodeType().

◆ tagRPPot

const string CTPPSPixelDAQMappingESSourceXML::tagRPPot = "rp_detector_set"
static

Definition at line 60 of file CTPPSPixelDAQMappingESSourceXML.cc.

Referenced by GetNodeType().

◆ tagRPStation

const string CTPPSPixelDAQMappingESSourceXML::tagRPStation = "station"
static

RP XML tags.

Definition at line 59 of file CTPPSPixelDAQMappingESSourceXML.cc.

Referenced by GetNodeType().

◆ verbosity

unsigned int CTPPSPixelDAQMappingESSourceXML::verbosity
private

Definition at line 69 of file CTPPSPixelDAQMappingESSourceXML.cc.

CTPPSPixelDAQMappingESSourceXML::tagRPStation
static const std::string tagRPStation
RP XML tags.
Definition: CTPPSPixelDAQMappingESSourceXML.cc:59
CTPPSPixelDAQMappingESSourceXML::nPixel
Definition: CTPPSPixelDAQMappingESSourceXML.cc:97
mps_fire.i
i
Definition: mps_fire.py:355
CTPPSPixelDAQMappingESSourceXML::GetPixels
void GetPixels(xercesc::DOMNode *n, std::set< std::pair< unsigned char, unsigned char >> &pixels)
Definition: CTPPSPixelDAQMappingESSourceXML.cc:500
CTPPSPixelDAQMappingESSourceXML::configuration
vector< ConfigBlock > configuration
Definition: CTPPSPixelDAQMappingESSourceXML.cc:88
CTPPSPixelDAQMappingESSourceXML::mappingFileNames
std::vector< std::string > mappingFileNames
the mapping files
Definition: CTPPSPixelDAQMappingESSourceXML.cc:75
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
CTPPSPixelDAQMappingESSourceXML::nRPixPlane
Definition: CTPPSPixelDAQMappingESSourceXML.cc:97
CTPPSPixelDAQMappingESSourceXML::NodeType
NodeType
enumeration of XML node types
Definition: CTPPSPixelDAQMappingESSourceXML.cc:97
CTPPSPixelDAQMappingESSourceXML::GetNodeType
NodeType GetNodeType(xercesc::DOMNode *)
determines node type
Definition: CTPPSPixelDAQMappingESSourceXML.cc:479
class-composition.children
children
Definition: class-composition.py:88
cuy.col
col
Definition: cuy.py:1010
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
CTPPSPixelFramePosition
Definition: CTPPSPixelFramePosition.h:27
cms::cuda::assert
assert(be >=bs)
CTPPSPixelDAQMappingESSourceXML::pMask
Definition: CTPPSPixelDAQMappingESSourceXML.cc:100
charmTagsComputerCvsB_cfi.idx
idx
Definition: charmTagsComputerCvsB_cfi.py:108
CTPPSPixelROCInfo::iD
uint32_t iD
the symbolic id
Definition: CTPPSPixelDAQMapping.h:31
writedatasetfile.parser
parser
Definition: writedatasetfile.py:7
personalPlayback.fp
fp
Definition: personalPlayback.py:523
CTPPSPixelDAQMappingESSourceXML::nTop
Definition: CTPPSPixelDAQMappingESSourceXML.cc:97
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
CTPPSPixelDAQMappingESSourceXML::pMapping
Definition: CTPPSPixelDAQMappingESSourceXML.cc:100
CTPPSPixelDAQMappingESSourceXML::ParseXML
void ParseXML(ParseType, const string &file, const std::unique_ptr< CTPPSPixelDAQMapping > &, const std::unique_ptr< CTPPSPixelAnalysisMask > &)
parses XML file
Definition: CTPPSPixelDAQMappingESSourceXML.cc:293
CTPPSPixelDAQMappingESSourceXML::nRPStation
Definition: CTPPSPixelDAQMappingESSourceXML.cc:97
CTPPSPixelDAQMappingESSourceXML::Test
bool Test(xercesc::DOMNode *node, const std::string &name)
returns true iff the node is of the given name
Definition: CTPPSPixelDAQMappingESSourceXML.cc:121
end
#define end
Definition: vmac.h:39
edm::FileInPath
Definition: FileInPath.h:64
cms::xerces::toString
std::string toString(XMLCh const *toTranscode)
Definition: XercesStrUtils.h:34
ctppsRawToDigi_cff.maskFileNames
maskFileNames
Definition: ctppsRawToDigi_cff.py:16
CTPPSPixelDAQMappingESSourceXML::currentBlock
unsigned int currentBlock
index of the current block in 'configuration' array
Definition: CTPPSPixelDAQMappingESSourceXML.cc:91
CTPPSPixelROCInfo::roc
unsigned int roc
Definition: CTPPSPixelDAQMapping.h:33
edm::es::Label
Definition: es_Label.h:54
CTPPSPixelDAQMappingESSourceXML::nUnknown
Definition: CTPPSPixelDAQMappingESSourceXML.cc:97
b
double b
Definition: hdecay.h:118
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
edm::IOVSyncValue::eventID
const EventID & eventID() const
Definition: IOVSyncValue.h:40
CTPPSPixelDAQMappingESSourceXML::nArm
Definition: CTPPSPixelDAQMappingESSourceXML.cc:97
a
double a
Definition: hdecay.h:119
CTPPSPixelDAQMappingESSourceXML::produceCTPPSPixelDAQMapping
std::unique_ptr< CTPPSPixelDAQMapping > produceCTPPSPixelDAQMapping(const CTPPSPixelDAQMappingRcd &)
Definition: CTPPSPixelDAQMappingESSourceXML.cc:238
CTPPSPixelDAQMappingESSourceXML::subSystemName
string subSystemName
label of the CTPPS sub-system
Definition: CTPPSPixelDAQMappingESSourceXML.cc:72
CTPPSPixelROCAnalysisMask::fullMask
bool fullMask
whether all channels of the ROC shall be masked
Definition: CTPPSPixelAnalysisMask.h:26
edm::EventID::event
EventNumber_t event() const
Definition: EventID.h:40
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
CTPPSPixelDAQMappingESSourceXML::PixelNode
bool PixelNode(NodeType type)
Definition: CTPPSPixelDAQMappingESSourceXML.cc:139
cms::concurrency::xercesTerminate
void xercesTerminate()
Definition: Xerces.cc:23
CTPPSPixelDAQMappingESSourceXML::nRPPot
Definition: CTPPSPixelDAQMappingESSourceXML.cc:97
edm::LogVerbatim
Definition: MessageLogger.h:297
CTPPSPixelDetId
Definition: CTPPSPixelDetId.h:16
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
cond::ValidityInterval
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
type
type
Definition: HCALResponse.h:21
CTPPSPixelDAQMappingESSourceXML::tagRPPot
static const std::string tagRPPot
Definition: CTPPSPixelDAQMappingESSourceXML.cc:60
CTPPSPixelDAQMappingESSourceXML::ParseTreePixel
void ParseTreePixel(ParseType, xercesc::DOMNode *, NodeType, unsigned int parentID, const std::unique_ptr< CTPPSPixelDAQMapping > &, const std::unique_ptr< CTPPSPixelAnalysisMask > &)
recursive method to extract Pixel-related information from the DOM tree
Definition: CTPPSPixelDAQMappingESSourceXML.cc:316
es_hardcode_cfi.pixels
pixels
Definition: es_hardcode_cfi.py:40
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
Exception
Definition: hltDiff.cc:246
CTPPSPixelDAQMappingESSourceXML::tagArm
static const std::string tagArm
Common position tags.
Definition: CTPPSPixelDAQMappingESSourceXML.cc:56
CTPPSPixelDAQMappingESSourceXML::tagROC
static const std::string tagROC
Definition: CTPPSPixelDAQMappingESSourceXML.cc:53
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
offsetROCinDetId
static const unsigned int offsetROCinDetId
Definition: CTPPSPixelDAQMappingESSourceXML.cc:168
personalPlayback.fn
fn
Definition: personalPlayback.py:515
CTPPSPixelDAQMappingESSourceXML::currentBlockValid
bool currentBlockValid
flag whether the 'currentBlock' index is valid
Definition: CTPPSPixelDAQMappingESSourceXML.cc:94
CTPPSPixelDAQMappingESSourceXML::produceCTPPSPixelAnalysisMask
std::unique_ptr< CTPPSPixelAnalysisMask > produceCTPPSPixelAnalysisMask(const CTPPSPixelAnalysisMaskRcd &)
Definition: CTPPSPixelDAQMappingESSourceXML.cc:264
CTPPSPixelROCAnalysisMask
Contains data on masked channels of a ROC.
Definition: CTPPSPixelAnalysisMask.h:18
CTPPSPixelROCAnalysisMask::maskedPixels
std::set< std::pair< unsigned char, unsigned char > > maskedPixels
list of channels to be masked
Definition: CTPPSPixelAnalysisMask.h:29
CTPPSPixelDAQMappingESSourceXML::tagRPixPlane
static const std::string tagRPixPlane
Definition: CTPPSPixelDAQMappingESSourceXML.cc:52
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::EventID
Definition: EventID.h:31
CTPPSPixelDAQMappingESSourceXML::verbosity
unsigned int verbosity
Definition: CTPPSPixelDAQMappingESSourceXML.cc:69
CTPPSPixelDAQMappingESSourceXML::nROC
Definition: CTPPSPixelDAQMappingESSourceXML.cc:97
edm::EventRange
Definition: EventRange.h:31
crabWrapper.key
key
Definition: crabWrapper.py:19
cms::concurrency::xercesInitialize
void xercesInitialize()
Definition: Xerces.cc:18
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:28
CTPPSPixelROCInfo
Contains mappind data related to a ROC.
Definition: CTPPSPixelDAQMapping.h:23
class-composition.parent
parent
Definition: class-composition.py:88
CTPPSPixelDAQMappingESSourceXML::CompleteFileName
string CompleteFileName(const string &fn)
adds the path prefix, if needed
Definition: CTPPSPixelDAQMappingESSourceXML.cc:233
begin
#define begin
Definition: vmac.h:32
CTPPSPixelDAQMappingESSourceXML::ChipFramePosition
CTPPSPixelFramePosition ChipFramePosition(xercesc::DOMNode *chipnode)
extracts VFAT's DAQ channel from XML attributes
Definition: CTPPSPixelDAQMappingESSourceXML.cc:453
CTPPSPixelDAQMappingESSourceXML::nSkip
Definition: CTPPSPixelDAQMappingESSourceXML.cc:97