CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
HcalTopologyIdealEP Class Reference

#include <tmp/HcalTopologyIdealEP/interface/HcalTopologyIdealEP.h>

Inheritance diagram for HcalTopologyIdealEP:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Classes

struct  RingSegmentation
 

Public Types

typedef boost::shared_ptr
< HcalTopology
ReturnType
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 

Public Member Functions

 HcalTopologyIdealEP (const edm::ParameterSet &)
 
ReturnType produce (const IdealGeometryRecord &)
 
 ~HcalTopologyIdealEP ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Attributes

const edm::ParameterSet m_pSet
 
std::string m_restrictions
 
std::vector< RingSegmentationm_segmentation
 

Additional Inherited Members

- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

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

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

Definition at line 25 of file HcalTopologyIdealEP.h.

Member Typedef Documentation

typedef boost::shared_ptr<HcalTopology> HcalTopologyIdealEP::ReturnType

Definition at line 31 of file HcalTopologyIdealEP.h.

Constructor & Destructor Documentation

HcalTopologyIdealEP::HcalTopologyIdealEP ( const edm::ParameterSet conf)

Definition at line 37 of file HcalTopologyIdealEP.cc.

References edm::ParameterSet::existsAs(), edm::ParameterSet::getUntrackedParameter(), m_segmentation, mergeVDriftHistosByStation::name, HcalTopologyIdealEP::RingSegmentation::ring, HcalTopologyIdealEP::RingSegmentation::segmentation, and edm::ESProducer::setWhatProduced().

39  m_pSet( conf )
40 {
41  //std::cout << "HcalTopologyIdealEP::HcalTopologyIdealEP" << std::endl;
42  edm::LogInfo("HCAL") << "HcalTopologyIdealEP::HcalTopologyIdealEP";
43 
44  // copied from HcalHitRelabeller, input like {1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,4}
45  m_segmentation.resize(29);
46  std::vector<int> segmentation;
47  for (int iring=1; iring<=29; ++iring) {
48  char name[10];
49  snprintf(name,10,"Eta%d",iring);
50  if(conf.existsAs<std::vector<int> >(name, false)) {
51  RingSegmentation entry;
52  entry.ring = iring;
53  entry.segmentation = conf.getUntrackedParameter<std::vector<int> >(name);
54  m_segmentation.push_back(entry);
55  }
56  }
57  setWhatProduced(this);
58 }
const edm::ParameterSet m_pSet
T getUntrackedParameter(std::string const &, T const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:185
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::vector< RingSegmentation > m_segmentation
HcalTopologyIdealEP::~HcalTopologyIdealEP ( )

Definition at line 61 of file HcalTopologyIdealEP.cc.

62 {
63 }

Member Function Documentation

void HcalTopologyIdealEP::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 66 of file HcalTopologyIdealEP.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addOptional(), edm::ParameterSetDescription::addUntracked(), hcalSLHCTopologyConstants_cfi::hcalTopologyConstants, and AlCaHLTBitMon_QueryRunRegistry::string.

67 {
69  hcalTopologyConstants.add<std::string>( "mode", "HcalTopologyMode::LHC" );
70  hcalTopologyConstants.add<int>( "maxDepthHB", 2 );
71  hcalTopologyConstants.add<int>( "maxDepthHE", 3 );
72 
73  edm::ParameterSetDescription hcalSLHCTopologyConstants;
74  hcalSLHCTopologyConstants.add<std::string>( "mode", "HcalTopologyMode::SLHC" );
75  hcalSLHCTopologyConstants.add<int>( "maxDepthHB", 7 );
76  hcalSLHCTopologyConstants.add<int>( "maxDepthHE", 7 );
77 
79  desc.addUntracked<std::string>( "Exclude", "" );
80  desc.addOptional<edm::ParameterSetDescription>( "hcalTopologyConstants", hcalTopologyConstants );
81  descriptions.add( "hcalTopologyIdeal", desc );
82 
84  descSLHC.addUntracked<std::string>( "Exclude", "" );
85  descSLHC.addOptional<edm::ParameterSetDescription>( "hcalTopologyConstants", hcalSLHCTopologyConstants );
86  descriptions.add( "hcalTopologyIdealSLHC", descSLHC );
87 }
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HcalTopologyIdealEP::ReturnType HcalTopologyIdealEP::produce ( const IdealGeometryRecord iRecord)

Definition at line 95 of file HcalTopologyIdealEP.cc.

References relativeConstraints::error, edm::hlt::Exception, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), HcalTopology::HcalTopology(), HcalTopologyMode::LHC, m_pSet, m_restrictions, m_segmentation, HcalTopology::maxDepthHB(), HcalTopology::maxDepthHE(), alignBH_cfg::mode, HcalTopologyRestrictionParser::parse(), geometryXMLtoCSV::parser, StringToEnumParser< T >::parseString(), and AlCaHLTBitMon_QueryRunRegistry::string.

96 {
97  // std::cout << "HcalTopologyIdealEP::produce(const IdealGeometryRecord& iRecord)" << std::endl;
98  edm::LogInfo("HCAL") << "HcalTopologyIdealEP::produce(const IdealGeometryRecord& iRecord)";
99 
100  using namespace edm::es;
101 
103  int maxDepthHB = 2;
104  int maxDepthHE = 3;
105  if( m_pSet.exists( "hcalTopologyConstants" ))
106  {
107  const edm::ParameterSet hcalTopoConsts( m_pSet.getParameter<edm::ParameterSet>( "hcalTopologyConstants" ));
109  mode = (HcalTopologyMode::Mode) eparser.parseString(hcalTopoConsts.getParameter<std::string>("mode"));
110  maxDepthHB = hcalTopoConsts.getParameter<int>("maxDepthHB");
111  maxDepthHE = hcalTopoConsts.getParameter<int>("maxDepthHE");
112  }
113  // std::cout << "mode = " << mode << ", maxDepthHB = " << maxDepthHB << ", maxDepthHE = " << maxDepthHE << std::endl;
114  edm::LogInfo("HCAL") << "mode = " << mode << ", maxDepthHB = " << maxDepthHB << ", maxDepthHE = " << maxDepthHE;
115 
116  ReturnType myTopo(new HcalTopology( mode, maxDepthHB, maxDepthHE ));
117 
119  if (!m_restrictions.empty()) {
121  if (!error.empty()) {
122  throw cms::Exception("Parse Error","Parse error on Exclude "+error);
123  }
124  }
125 
126  // see if any depth segmentation needs to be added
127  for(std::vector<RingSegmentation>::const_iterator ringSegItr = m_segmentation.begin();
128  ringSegItr != m_segmentation.end(); ++ringSegItr) {
129  myTopo->setDepthSegmentation(ringSegItr->ring, ringSegItr->segmentation);
130  }
131  return myTopo ;
132 }
T getParameter(std::string const &) const
const edm::ParameterSet m_pSet
bool exists(std::string const &parameterName) const
checks if a parameter exists
boost::shared_ptr< HcalTopology > ReturnType
std::vector< RingSegmentation > m_segmentation
T parseString(const std::string &value)

Member Data Documentation

const edm::ParameterSet HcalTopologyIdealEP::m_pSet
private

Definition at line 40 of file HcalTopologyIdealEP.h.

Referenced by produce().

std::string HcalTopologyIdealEP::m_restrictions
private

Definition at line 39 of file HcalTopologyIdealEP.h.

Referenced by produce().

std::vector<RingSegmentation> HcalTopologyIdealEP::m_segmentation
private

Definition at line 47 of file HcalTopologyIdealEP.h.

Referenced by HcalTopologyIdealEP(), and produce().