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::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

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
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Private Attributes

std::string m_patternsDir
 
int m_ppt
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *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 TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
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::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
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.

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

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 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
T getUntrackedParameter(std::string const &, T const &) const
std::string m_patternsDir

◆ ~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.

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

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 }
std::vector< RPCPattern > RPCPatVec
Definition: RPCPattern.h:36
static const int m_TOWER_COUNT
Only half of the detector.
Definition: RPCConst.h:40
std::vector< TQuality > TQualityVec
Definition: RPCPattern.h:49
std::string m_patternsDir
string fname
main script
#define LogDebug(id)

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().