#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 () | |
Static Public Member Functions | |
static void | fillDescriptions (edm::ConfigurationDescriptions &descriptions) |
Private Member Functions | |
void | parseTextMap (const std::string &filename, CaloTowerConstituentsMap &theMap) |
Private Attributes | |
std::string | mapFile_ |
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 41 of file CaloTowerConstituentsMapBuilder.h.
typedef std::auto_ptr<CaloTowerConstituentsMap> CaloTowerConstituentsMapBuilder::ReturnType |
Definition at line 46 of file CaloTowerConstituentsMapBuilder.h.
CaloTowerConstituentsMapBuilder::CaloTowerConstituentsMapBuilder | ( | const edm::ParameterSet & | iConfig | ) |
Definition at line 33 of file CaloTowerConstituentsMapBuilder.cc.
References gather_cfg::cout, and edm::ESProducer::setWhatProduced().
: mapFile_(iConfig.getUntrackedParameter<std::string>("MapFile","")) { std::cout << "CaloTowerConstituentsMapBuilder::CaloTowerConstituentsMapBuilder" << std::endl; //the following line is needed to tell the framework what // data is being produced setWhatProduced(this); //now do what ever other initialization is needed }
CaloTowerConstituentsMapBuilder::~CaloTowerConstituentsMapBuilder | ( | ) |
Definition at line 46 of file CaloTowerConstituentsMapBuilder.cc.
{ }
void CaloTowerConstituentsMapBuilder::fillDescriptions | ( | edm::ConfigurationDescriptions & | descriptions | ) | [static] |
Definition at line 56 of file CaloTowerConstituentsMapBuilder.cc.
References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addUntracked(), and AlCaHLTBitMon_QueryRunRegistry::string.
{ edm::ParameterSetDescription desc; desc.addUntracked<std::string>( "MapFile", "" ); descriptions.add( "caloTowerConstituents", desc ); }
void CaloTowerConstituentsMapBuilder::parseTextMap | ( | const std::string & | filename, |
CaloTowerConstituentsMap & | theMap | ||
) | [private] |
Definition at line 86 of file CaloTowerConstituentsMapBuilder.cc.
References CaloTowerConstituentsMap::assign(), cond::rpcobgas::detid, edm::FileInPath::fullPath(), getHLTprescales::index, and geometryCSVtoXML::line.
Referenced by produce().
{ edm::FileInPath eff(filename); gzFile gzed=gzopen(eff.fullPath().c_str(),"rb"); while (!gzeof(gzed)) { char line[1024]; int ieta, iphi, rawid; gzgets(gzed,line,1023); if (index(line,'#')!=0) *(index(line,'#'))=0; int ct=sscanf(line,"%i %d %d",&rawid,&ieta,&iphi); if (ct==3) { DetId detid(rawid); CaloTowerDetId tid(ieta,iphi); theMap.assign(detid,tid); } } gzclose(gzed); }
CaloTowerConstituentsMapBuilder::ReturnType CaloTowerConstituentsMapBuilder::produce | ( | const IdealGeometryRecord & | iRecord | ) |
Definition at line 65 of file CaloTowerConstituentsMapBuilder.cc.
References edm::eventsetup::EventSetupRecord::get(), mapFile_, parseTextMap(), and parseEventContent::prod.
{ edm::ESHandle<HcalTopology> topology ; iRecord.get( topology ) ; std::auto_ptr<CaloTowerConstituentsMap> prod( new CaloTowerConstituentsMap( &*topology )); prod->useStandardHB(true); prod->useStandardHE(true); prod->useStandardHF(true); prod->useStandardHO(true); prod->useStandardEB(true); if (!mapFile_.empty()) { parseTextMap(mapFile_,*prod); } prod->sort(); return prod; }
std::string CaloTowerConstituentsMapBuilder::mapFile_ [private] |
Definition at line 53 of file CaloTowerConstituentsMapBuilder.h.
Referenced by produce().