CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
RPCTriggerConfig Class Reference
Inheritance diagram for RPCTriggerConfig:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef std::unique_ptr< L1RPCConfigReturnType
 

Public Member Functions

ReturnType produce (const L1RPCConfigRcd &)
 
 RPCTriggerConfig (const edm::ParameterSet &)
 
 ~RPCTriggerConfig () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
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)
 

Private Attributes

std::string m_patternsDir
 
int m_ppt
 

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 > >>
 
- 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={})
 
void usesResources (std::vector< std::string > const &)
 
- 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)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 39 of file RPCTriggerConfig.cc.

Member Typedef Documentation

◆ ReturnType

typedef std::unique_ptr<L1RPCConfig> RPCTriggerConfig::ReturnType

Definition at line 44 of file RPCTriggerConfig.cc.

Constructor & Destructor Documentation

◆ RPCTriggerConfig()

RPCTriggerConfig::RPCTriggerConfig ( const edm::ParameterSet iConfig)

Definition at line 66 of file RPCTriggerConfig.cc.

66  {
67  //the following line is needed to tell the framework what
68  // data is being produced
69  setWhatProduced(this);
70 
71  //now do what ever other initialization is needed
72 
73  m_ppt = iConfig.getUntrackedParameter<int>("PACsPerTower");
74  std::string dataDir = iConfig.getUntrackedParameter<std::string>("filedir");
75 
76  edm::FileInPath fp(dataDir + "pacPat_t0sc0sg0.xml");
77  std::string patternsDirNameUnstriped = fp.fullPath();
78  m_patternsDir = patternsDirNameUnstriped.substr(0, patternsDirNameUnstriped.find_last_of('/') + 1);
79 }

References personalPlayback::fp, edm::ParameterSet::getUntrackedParameter(), m_patternsDir, m_ppt, edm::ESProducer::setWhatProduced(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~RPCTriggerConfig()

RPCTriggerConfig::~RPCTriggerConfig ( )
override

Definition at line 81 of file RPCTriggerConfig.cc.

81  {
82  // do anything here that needs to be done at desctruction time
83  // (e.g. close files, deallocate resources etc.)
84 }

Member Function Documentation

◆ produce()

RPCTriggerConfig::ReturnType RPCTriggerConfig::produce ( const L1RPCConfigRcd iRecord)

Definition at line 91 of file RPCTriggerConfig.cc.

91  {
92  auto pL1RPCConfig = std::make_unique<L1RPCConfig>();
93 
94  pL1RPCConfig->setPPT(m_ppt);
95 
96  // parse and isert patterns
97  int scCnt = 0, sgCnt = 0;
98  if (m_ppt == 1) {
99  scCnt = 1;
100  sgCnt = 1;
101  } else if (m_ppt == 12) {
102  scCnt = 1;
103  sgCnt = 12;
104  } else if (m_ppt == 144) {
105  scCnt = 12;
106  sgCnt = 12;
107  } else {
108  throw cms::Exception("BadConfig") << "Bad number of ppt requested: " << m_ppt << "\n";
109  }
110 
111  for (int tower = 0; tower < RPCConst::m_TOWER_COUNT; ++tower) {
112  for (int logSector = 0; logSector < scCnt; ++logSector) {
113  for (int logSegment = 0; logSegment < sgCnt; ++logSegment) {
114  std::stringstream fname;
115  fname << m_patternsDir << "pacPat_t" << tower << "sc" << logSector << "sg" << logSegment << ".xml";
116 
117  // TODO: this should go to logSth
118  LogDebug("RPCTriggerConfig") << "Parsing: " << fname.str() << std::endl;
119 
121  parser.parse(fname.str());
122 
123  RPCPattern::RPCPatVec npats = parser.getPatternsVec(tower, logSector, logSegment);
124  for (unsigned int ip = 0; ip < npats.size(); ip++) {
125  npats[ip].setCoords(tower, logSector, logSegment);
126  pL1RPCConfig->m_pats.push_back(npats[ip]);
127  }
128 
129  RPCPattern::TQualityVec nquals = parser.getQualityVec();
130  for (unsigned int iq = 0; iq < nquals.size(); iq++) {
131  nquals[iq].m_tower = tower;
132  nquals[iq].m_logsector = logSector;
133  nquals[iq].m_logsegment = logSegment;
134  pL1RPCConfig->m_quals.push_back(nquals[iq]);
135  }
136 
137  LogDebug("RPCTriggerConfig") << " RPCPatterns: " << npats.size() << " qualities: " << nquals.size()
138  << std::endl;
139 
140  } // segments
141  } // sectors
142  } // towers
143 
144  return pL1RPCConfig;
145 }

References Exception, alignmentValidation::fname, LogDebug, m_patternsDir, m_ppt, RPCConst::m_TOWER_COUNT, writedatasetfile::parser, and hgcalTowerProducer_cfi::tower.

Member Data Documentation

◆ m_patternsDir

std::string RPCTriggerConfig::m_patternsDir
private

Definition at line 52 of file RPCTriggerConfig.cc.

Referenced by produce(), and RPCTriggerConfig().

◆ m_ppt

int RPCTriggerConfig::m_ppt
private

Definition at line 51 of file RPCTriggerConfig.cc.

Referenced by produce(), and RPCTriggerConfig().

RPCPattern::TQualityVec
std::vector< TQuality > TQualityVec
Definition: RPCPattern.h:49
RPCConst::m_TOWER_COUNT
static const int m_TOWER_COUNT
Only half of the detector.
Definition: RPCConst.h:41
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:4
writedatasetfile.parser
parser
Definition: writedatasetfile.py:7
personalPlayback.fp
fp
Definition: personalPlayback.py:523
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::FileInPath
Definition: FileInPath.h:61
RPCTriggerConfig::m_ppt
int m_ppt
Definition: RPCTriggerConfig.cc:51
RPCPatternsParser
Definition: RPCPatternsParser.h:19
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
RPCPattern::RPCPatVec
std::vector< RPCPattern > RPCPatVec
Definition: RPCPattern.h:36
Exception
Definition: hltDiff.cc:245
RPCTriggerConfig::m_patternsDir
std::string m_patternsDir
Definition: RPCTriggerConfig.cc:52