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

Member Typedef Documentation

Definition at line 45 of file CaloTowerConstituentsMapBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 29 of file CaloTowerConstituentsMapBuilder.cc.

References edm::ESProducer::setWhatProduced().

29  :
30  mapFile_(iConfig.getUntrackedParameter<std::string>("MapFile",""))
31 {
32  //the following line is needed to tell the framework what
33  // data is being produced
34  setWhatProduced(this);
35 
36  //now do what ever other initialization is needed
37 }
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 40 of file CaloTowerConstituentsMapBuilder.cc.

41 {
42 }

Member Function Documentation

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

Definition at line 50 of file CaloTowerConstituentsMapBuilder.cc.

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

51 {
53  desc.addUntracked<std::string>( "MapFile", "" );
54  descriptions.add( "caloTowerConstituents", desc );
55 }
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 81 of file CaloTowerConstituentsMapBuilder.cc.

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

Referenced by produce().

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

Definition at line 59 of file CaloTowerConstituentsMapBuilder.cc.

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

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

Member Data Documentation

std::string CaloTowerConstituentsMapBuilder::mapFile_
private

Definition at line 52 of file CaloTowerConstituentsMapBuilder.h.

Referenced by produce().