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 | 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::auto_ptr
< EcalTrigTowerConstituentsMap
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

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

Private Member Functions

void parseTextMap (const std::string &filename, EcalTrigTowerConstituentsMap &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 38 of file EcalTrigTowerConstituentsMapBuilder.h.

Member Typedef Documentation

Definition at line 43 of file EcalTrigTowerConstituentsMapBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 34 of file EcalTrigTowerConstituentsMapBuilder.cc.

References edm::ESProducer::setWhatProduced().

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

46 {
47 }

Member Function Documentation

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

Definition at line 65 of file EcalTrigTowerConstituentsMapBuilder.cc.

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

Referenced by produce().

65  {
67 
68  std::ifstream f(eff.fullPath().c_str());
69  if (!f.good())
70  return;
71 
72  int ietaTower,iphiTower;
73  int ix,iy,iz;
74  char line[80]; // a buffer for the line to read
75  char ch; // a temporary for holding the end of line
76  while ((ch = f.peek()) != '-') {
77  f.get(line,80,'\n'); // read 80 characters to end of line
78  f.get(ch); // eat out the '\n'
79  // extract the numbers
80 /*
81  int mod,cry;
82  int nread = sscanf (line, " %d %d %d %d",&mod,&cry,&ietaTower,&iphiTower);
83  if (nread == 4 )
84  {
85  EEDetId eeid(mod,cry,1,EEDetId::SCCRYSTALMODE);
86  EcalTrigTowerDetId etid(1,EcalEndcap,ietaTower-45+17,iphiTower);
87  // std::cout << eeid << "\n->" << etid << std::endl;
88  theMap.assign(DetId(eeid),etid);
89  }
90 */
91  int nread = sscanf (line, " %d %d %d %d %d",&ix,&iy,&iz,&ietaTower, &iphiTower);
92  if (nread == 5) {
93  EEDetId eeid(ix,iy,iz,0);
94  // std::cout << "-- manu ix eta phi " << DetId(eeid).rawId() << " " << iz << " " << ietaTower << " " << iphiTower << std::endl;
95  EcalTrigTowerDetId etid(iz,EcalEndcap,ietaTower,iphiTower);
96  theMap.assign(DetId(eeid),etid);
97  }
98 
99  }
100  // Pass comment line
101  f.get(line,80,'\n'); // read 80 characters to end of line
102  f.get(ch); // eat out the '\n'
103  // Next info line
104  f.get(line,80,'\n'); // read 80 characters to end of line
105  f.get(ch); // eat out the '\n'
106  // extract the numbers
107  // int nTE;
108  // sscanf (line, " %d",&nTE);
109  // nTowEta_e=nTE;
110  // while ((ch = f.peek()) != EOF) {
111  // f.get(line,80,'\n'); // read 80 characters to end of line
112  // f.get(ch); // eat out the '\n'
113  // // extract the numbers
114  // float bound;
115  // sscanf (line, " %f", &bound);
116  // eta_boundaries.push_back(bound);
117  // }
118 
119  f.close();
120  return;
121 }
void assign(const DetId &cell, const EcalTrigTowerDetId &tower)
set the association between a DetId and a tower
double f[11][100]
Definition: DetId.h:20
tuple filename
Definition: lut2db_cfg.py:20
EcalTrigTowerConstituentsMapBuilder::ReturnType EcalTrigTowerConstituentsMapBuilder::produce ( const IdealGeometryRecord iRecord)

Definition at line 55 of file EcalTrigTowerConstituentsMapBuilder.cc.

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

56 {
57  std::auto_ptr<EcalTrigTowerConstituentsMap> prod(new EcalTrigTowerConstituentsMap());
58 
59  if (!mapFile_.empty()) {
61  }
62  return prod;
63 }
tuple prod
Definition: CrabTask.py:87
void parseTextMap(const std::string &filename, EcalTrigTowerConstituentsMap &theMap)

Member Data Documentation

std::string EcalTrigTowerConstituentsMapBuilder::mapFile_
private

Definition at line 49 of file EcalTrigTowerConstituentsMapBuilder.h.

Referenced by produce().