#include <tmp/CaloTowerConstituentsMapBuilder/interface/CaloTowerConstituentsMapBuilder.h>
Public Types | |
typedef std::auto_ptr < CaloTowerConstituentsMap > | ReturnType |
Public Member Functions | |
CaloTowerConstituentsMapBuilder (const edm::ParameterSet &) | |
ReturnType | produce (const IdealGeometryRecord &) |
~CaloTowerConstituentsMapBuilder () | |
Private Member Functions | |
void | parseTextMap (const std::string &filename, CaloTowerConstituentsMap &theMap) |
Private Attributes | |
std::string | mapFile_ |
Implementation: <Notes on="" implementation>="">
Definition at line 37 of file CaloTowerConstituentsMapBuilder.h.
typedef std::auto_ptr<CaloTowerConstituentsMap> CaloTowerConstituentsMapBuilder::ReturnType |
Definition at line 42 of file CaloTowerConstituentsMapBuilder.h.
CaloTowerConstituentsMapBuilder::CaloTowerConstituentsMapBuilder | ( | const edm::ParameterSet & | iConfig | ) |
Definition at line 28 of file CaloTowerConstituentsMapBuilder.cc.
References edm::ESProducer::setWhatProduced().
00028 : 00029 mapFile_(iConfig.getUntrackedParameter<std::string>("MapFile","")) 00030 /* 00031 doStandardHBHE_(iConfig.getParameter<bool>("standardHBHE","true")), 00032 doStandardHF_(iConfig.getParameter<bool>("standardHF","true")), 00033 doStandardEB_(iConfig.getParameter<bool>("standardEB","true")) 00034 */ 00035 { 00036 //the following line is needed to tell the framework what 00037 // data is being produced 00038 setWhatProduced(this); 00039 00040 //now do what ever other initialization is needed 00041 }
CaloTowerConstituentsMapBuilder::~CaloTowerConstituentsMapBuilder | ( | ) |
void CaloTowerConstituentsMapBuilder::parseTextMap | ( | const std::string & | filename, | |
CaloTowerConstituentsMap & | theMap | |||
) | [private] |
Definition at line 73 of file CaloTowerConstituentsMapBuilder.cc.
References CaloTowerConstituentsMap::assign(), ct, edm::FileInPath::fullPath(), index, parsecf::pyparsing::line(), and muonGeometry::rawid.
Referenced by produce().
00073 { 00074 edm::FileInPath eff(filename); 00075 00076 gzFile gzed=gzopen(eff.fullPath().c_str(),"rb"); 00077 00078 while (!gzeof(gzed)) { 00079 char line[1024]; 00080 int ieta, iphi, rawid; 00081 gzgets(gzed,line,1023); 00082 if (index(line,'#')!=0) *(index(line,'#'))=0; 00083 int ct=sscanf(line,"%i %d %d",&rawid,&ieta,&iphi); 00084 if (ct==3) { 00085 DetId detid(rawid); 00086 CaloTowerDetId tid(ieta,iphi); 00087 theMap.assign(detid,tid); 00088 } 00089 } 00090 gzclose(gzed); 00091 00092 }
CaloTowerConstituentsMapBuilder::ReturnType CaloTowerConstituentsMapBuilder::produce | ( | const IdealGeometryRecord & | iRecord | ) |
Definition at line 55 of file CaloTowerConstituentsMapBuilder.cc.
References mapFile_, and parseTextMap().
00056 { 00057 using namespace edm::es; 00058 std::auto_ptr<CaloTowerConstituentsMap> prod(new CaloTowerConstituentsMap()); 00059 prod->useStandardHB(true); 00060 prod->useStandardHE(true); 00061 prod->useStandardHF(true); 00062 prod->useStandardHO(true); 00063 prod->useStandardEB(true); 00064 00065 if (!mapFile_.empty()) { 00066 parseTextMap(mapFile_,*prod); 00067 } 00068 prod->sort(); 00069 00070 return prod; 00071 }
std::string CaloTowerConstituentsMapBuilder::mapFile_ [private] |