CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
EcalTrigTowerConstituentsMapBuilder Class Reference

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

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

Public Types

typedef std::unique_ptr< EcalTrigTowerConstituentsMapReturnType
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 

Public Member Functions

 EcalTrigTowerConstituentsMapBuilder (const edm::ParameterSet &)
 
ReturnType produce (const IdealGeometryRecord &)
 
 ~EcalTrigTowerConstituentsMapBuilder ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()(false)
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer () noexcept(false)
 
- 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 () noexcept(false)
 

Private Member Functions

void parseTextMap (const std::string &filename, EcalTrigTowerConstituentsMap &theMap)
 

Private Attributes

std::string mapFile_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- 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::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_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 36 of file EcalTrigTowerConstituentsMapBuilder.h.

Member Typedef Documentation

Definition at line 41 of file EcalTrigTowerConstituentsMapBuilder.h.

Constructor & Destructor Documentation

EcalTrigTowerConstituentsMapBuilder::EcalTrigTowerConstituentsMapBuilder ( const edm::ParameterSet iConfig)

Definition at line 26 of file EcalTrigTowerConstituentsMapBuilder.cc.

References edm::ESProducer::setWhatProduced().

26  :
27  mapFile_(iConfig.getUntrackedParameter<std::string>("MapFile",""))
28 {
29  setWhatProduced(this);
30 }
T getUntrackedParameter(std::string const &, T const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
EcalTrigTowerConstituentsMapBuilder::~EcalTrigTowerConstituentsMapBuilder ( )

Definition at line 32 of file EcalTrigTowerConstituentsMapBuilder.cc.

33 {
34 }

Member Function Documentation

void EcalTrigTowerConstituentsMapBuilder::parseTextMap ( const std::string &  filename,
EcalTrigTowerConstituentsMap theMap 
)
private

Definition at line 47 of file EcalTrigTowerConstituentsMapBuilder.cc.

References EcalTrigTowerConstituentsMap::assign(), EcalEndcap, f, edm::FileInPath::fullPath(), and geometryCSVtoXML::line.

Referenced by produce().

47  {
49 
50  std::ifstream f(eff.fullPath().c_str());
51  if (!f.good())
52  return;
53 
54  int ietaTower,iphiTower;
55  int ix,iy,iz;
56  char line[80]; // a buffer for the line to read
57  char ch; // a temporary for holding the end of line
58  while ((ch = f.peek()) != '-') {
59  f.get(line,80,'\n'); // read 80 characters to end of line
60  f.get(ch); // eat out the '\n'
61  // extract the numbers
62 
63  int nread = sscanf (line, " %d %d %d %d %d",&ix,&iy,&iz,&ietaTower, &iphiTower);
64  if (nread == 5) {
65  EEDetId eeid(ix,iy,iz,0);
66  EcalTrigTowerDetId etid(iz,EcalEndcap,ietaTower,iphiTower);
67  theMap.assign(DetId(eeid),etid);
68  }
69 
70  }
71  // Pass comment line
72  f.get(line,80,'\n'); // read 80 characters to end of line
73  f.get(ch); // eat out the '\n'
74  // Next info line
75  f.get(line,80,'\n'); // read 80 characters to end of line
76  f.get(ch); // eat out the '\n'
77  f.close();
78  return;
79 }
void assign(const DetId &cell, const EcalTrigTowerDetId &tower)
set the association between a DetId and a tower
double f[11][100]
Definition: DetId.h:18
EcalTrigTowerConstituentsMapBuilder::ReturnType EcalTrigTowerConstituentsMapBuilder::produce ( const IdealGeometryRecord iRecord)

Definition at line 37 of file EcalTrigTowerConstituentsMapBuilder.cc.

References mapFile_, parseTextMap(), and parseEventContent::prod.

38 {
39  auto prod = std::make_unique<EcalTrigTowerConstituentsMap>();
40 
41  if (!mapFile_.empty()) {
43  }
44  return prod;
45 }
void parseTextMap(const std::string &filename, EcalTrigTowerConstituentsMap &theMap)

Member Data Documentation

std::string EcalTrigTowerConstituentsMapBuilder::mapFile_
private

Definition at line 47 of file EcalTrigTowerConstituentsMapBuilder.h.

Referenced by produce().