diff --git a/CondFormats/CTPPSReadoutObjects/plugins/TotemDAQMappingESSourceXML.cc b/CondFormats/CTPPSReadoutObjects/plugins/TotemDAQMappingESSourceXML.cc index 7509d85acdb3d..e8e19f86b3a0a 100644 --- a/CondFormats/CTPPSReadoutObjects/plugins/TotemDAQMappingESSourceXML.cc +++ b/CondFormats/CTPPSReadoutObjects/plugins/TotemDAQMappingESSourceXML.cc @@ -6,6 +6,7 @@ * Jan Kašpar (jan.kaspar@cern.ch) * Marcin Borratynski (mborratynski@gmail.com) * Seyed Mohsen Etesami (setesami@cern.ch) +* Laurent Forthomme ****************************************************************************/ #include "FWCore/Framework/interface/MakerMacros.h" @@ -71,7 +72,7 @@ class TotemDAQMappingESSourceXML: public edm::ESProducer, public edm::EventSetup TotemDAQMappingESSourceXML(const edm::ParameterSet &); ~TotemDAQMappingESSourceXML(); - edm::ESProducts< boost::shared_ptr, boost::shared_ptr > produce( const TotemReadoutRcd & ); + edm::ESProducts< std::shared_ptr, std::shared_ptr > produce( const TotemReadoutRcd & ); private: unsigned int verbosity; @@ -110,15 +111,15 @@ class TotemDAQMappingESSourceXML: public edm::ESProducer, public edm::EventSetup enum ParseType { pMapping, pMask }; /// parses XML file - void ParseXML(ParseType, const string &file, const boost::shared_ptr&, const boost::shared_ptr&); + void ParseXML(ParseType, const string &file, const std::shared_ptr&, const std::shared_ptr&); /// recursive method to extract RP-related information from the DOM tree void ParseTreeRP(ParseType, xercesc::DOMNode *, NodeType, unsigned int parentID, - const boost::shared_ptr&, const boost::shared_ptr&); + const std::shared_ptr&, const std::shared_ptr&); /// recursive method to extract RP-related information from the DOM tree void ParseTreeDiamond(ParseType, xercesc::DOMNode *, NodeType, unsigned int parentID, - const boost::shared_ptr&, const boost::shared_ptr&); + const std::shared_ptr&, const std::shared_ptr&); private: /// adds the path prefix, if needed @@ -233,23 +234,24 @@ void TotemDAQMappingESSourceXML::setIntervalFor(const edm::eventsetup::EventSetu { const auto &bl = configuration[idx]; + edm::EventRange range = bl.validityRange; + // event id "1:min" has a special meaning and is translated to a truly minimal event id (1:0:0) - EventID startEventID = bl.validityRange.startEventID(); - if (startEventID.event() == 1) - startEventID = EventID(startEventID.run(), startEventID.luminosityBlock(), 0); + if (range.startEventID()==edm::EventID(1, 0, 1)) + range = edm::EventRange(edm::EventID(1, 0, 0), range.endEventID()); - if (startEventID <= iosv.eventID() && iosv.eventID() <= bl.validityRange.endEventID()) + if (edm::contains(range, iosv.eventID())) { currentBlockValid = true; currentBlock = idx; - const IOVSyncValue begin(startEventID); - const IOVSyncValue end(bl.validityRange.endEventID()); - oValidity = ValidityInterval(begin, end); + const IOVSyncValue begin(range.startEventID()); + const IOVSyncValue end(range.endEventID()); + oValidity = edm::ValidityInterval(begin, end); LogVerbatim("TotemDAQMappingESSourceXML") << " block found: index=" << currentBlock - << ", interval=(" << startEventID << " - " << bl.validityRange.endEventID() << ")"; + << ", interval=(" << range.startEventID() << " - " << range.endEventID() << ")"; return; } @@ -278,13 +280,13 @@ string TotemDAQMappingESSourceXML::CompleteFileName(const string &fn) //---------------------------------------------------------------------------------------------------- -edm::ESProducts< boost::shared_ptr, boost::shared_ptr > +edm::ESProducts< std::shared_ptr, std::shared_ptr > TotemDAQMappingESSourceXML::produce( const TotemReadoutRcd & ) { assert(currentBlockValid); - boost::shared_ptr mapping(new TotemDAQMapping()); - boost::shared_ptr mask(new TotemAnalysisMask()); + auto mapping = std::make_shared(); + auto mask = std::make_shared(); // initialize Xerces try @@ -316,7 +318,7 @@ edm::ESProducts< boost::shared_ptr, boost::shared_ptr &mapping, const boost::shared_ptr &mask) + const std::shared_ptr &mapping, const std::shared_ptr &mask) { unique_ptr parser(new XercesDOMParser()); parser->parse(file.c_str()); @@ -341,8 +343,8 @@ void TotemDAQMappingESSourceXML::ParseXML(ParseType pType, const string &file, //----------------------------------------------------------------------------------------------------------- void TotemDAQMappingESSourceXML::ParseTreeRP(ParseType pType, xercesc::DOMNode * parent, NodeType parentType, - unsigned int parentID, const boost::shared_ptr& mapping, - const boost::shared_ptr& mask) + unsigned int parentID, const std::shared_ptr& mapping, + const std::shared_ptr& mask) { #ifdef DEBUG printf(">> TotemDAQMappingESSourceXML::ParseTreeRP(%s, %u, %u)\n", XMLString::transcode(parent->getNodeName()), @@ -475,8 +477,8 @@ void TotemDAQMappingESSourceXML::ParseTreeRP(ParseType pType, xercesc::DOMNode * //---------------------------------------------------------------------------------------------------- void TotemDAQMappingESSourceXML::ParseTreeDiamond(ParseType pType, xercesc::DOMNode * parent, NodeType parentType, - unsigned int parentID, const boost::shared_ptr& mapping, - const boost::shared_ptr& mask) + unsigned int parentID, const std::shared_ptr& mapping, + const std::shared_ptr& mask) { #ifdef DEBUG