CMS 3D CMS Logo

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

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

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

Public Types

typedef std::auto_ptr
< CaloTowerConstituentsMap
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

 CaloTowerConstituentsMapBuilder (const edm::ParameterSet &)
 
ReturnType produce (const IdealGeometryRecord &)
 
 ~CaloTowerConstituentsMapBuilder ()
 
- 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 Member Functions

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

Private Attributes

std::string mapFile_
 

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 41 of file CaloTowerConstituentsMapBuilder.h.

Member Typedef Documentation

Definition at line 46 of file CaloTowerConstituentsMapBuilder.h.

Constructor & Destructor Documentation

CaloTowerConstituentsMapBuilder::CaloTowerConstituentsMapBuilder ( const edm::ParameterSet iConfig)

Definition at line 30 of file CaloTowerConstituentsMapBuilder.cc.

References edm::ESProducer::setWhatProduced().

30  :
31  mapFile_(iConfig.getUntrackedParameter<std::string>("MapFile",""))
32 {
33  //the following line is needed to tell the framework what
34  // data is being produced
35  setWhatProduced(this);
36 
37  //now do what ever other initialization is needed
38 }
T getUntrackedParameter(std::string const &, T const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
CaloTowerConstituentsMapBuilder::~CaloTowerConstituentsMapBuilder ( )

Definition at line 41 of file CaloTowerConstituentsMapBuilder.cc.

42 {
43 }

Member Function Documentation

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

Definition at line 51 of file CaloTowerConstituentsMapBuilder.cc.

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

52 {
54  desc.addUntracked<std::string>( "MapFile", "" );
55  descriptions.add( "caloTowerConstituents", desc );
56 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void CaloTowerConstituentsMapBuilder::parseTextMap ( const std::string &  filename,
CaloTowerConstituentsMap theMap 
)
private

Definition at line 82 of file CaloTowerConstituentsMapBuilder.cc.

References CaloTowerConstituentsMap::assign(), cond::rpcobgas::detid, edm::FileInPath::fullPath(), getHLTprescales::index, and geometryCSVtoXML::line.

Referenced by produce().

83 {
85 
86  gzFile gzed = gzopen( eff.fullPath().c_str(), "rb" );
87 
88  while( !gzeof( gzed ))
89  {
90  char line[1024];
91  int ieta, iphi, rawid;
92  if( 0 != gzgets( gzed, line, 1023 ))
93  {
94  if( index( line, '#' ) != 0 )*( index( line, '#' )) = 0;
95  int ct = sscanf( line, "%i %d %d", &rawid, &ieta, &iphi );
96  if( ct == 3 )
97  {
98  DetId detid( rawid );
99  CaloTowerDetId tid( ieta, iphi );
100  theMap.assign( detid, tid );
101  }
102  }
103  }
104  gzclose( gzed );
105 }
void assign(const DetId &cell, const CaloTowerDetId &tower)
set the association between a DetId and a tower
Definition: DetId.h:20
tuple filename
Definition: lut2db_cfg.py:20
CaloTowerConstituentsMapBuilder::ReturnType CaloTowerConstituentsMapBuilder::produce ( const IdealGeometryRecord iRecord)

Definition at line 60 of file CaloTowerConstituentsMapBuilder.cc.

References edm::eventsetup::EventSetupRecord::get(), mapFile_, parseTextMap(), and parseEventContent::prod.

61 {
63  iRecord.get( topology ) ;
64 
65  std::auto_ptr<CaloTowerConstituentsMap> prod( new CaloTowerConstituentsMap( &*topology ));
66 
67  prod->useStandardHB(true);
68  prod->useStandardHE(true);
69  prod->useStandardHF(true);
70  prod->useStandardHO(true);
71  prod->useStandardEB(true);
72 
73  if (!mapFile_.empty()) {
75  }
76  prod->sort();
77 
78  return prod;
79 }
void get(HolderT &iHolder) const
void parseTextMap(const std::string &filename, CaloTowerConstituentsMap &theMap)

Member Data Documentation

std::string CaloTowerConstituentsMapBuilder::mapFile_
private

Definition at line 53 of file CaloTowerConstituentsMapBuilder.h.

Referenced by produce().