CMS 3D CMS Logo

CaloTowerConstituentsMapBuilder Class Reference

Description: <one line="" class="" summary>="">. More...

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

Inheritance diagram for CaloTowerConstituentsMapBuilder:

edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

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_


Detailed Description

Description: <one line="" class="" summary>="">.

Implementation: <Notes on="" implementation>="">

Definition at line 37 of file CaloTowerConstituentsMapBuilder.h.


Member Typedef Documentation

typedef std::auto_ptr<CaloTowerConstituentsMap> CaloTowerConstituentsMapBuilder::ReturnType

Definition at line 42 of file CaloTowerConstituentsMapBuilder.h.


Constructor & Destructor Documentation

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 (  ) 

Definition at line 44 of file CaloTowerConstituentsMapBuilder.cc.

00045 { 
00046 }


Member Function Documentation

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 }


Member Data Documentation

std::string CaloTowerConstituentsMapBuilder::mapFile_ [private]

Definition at line 47 of file CaloTowerConstituentsMapBuilder.h.

Referenced by produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:15:59 2009 for CMSSW by  doxygen 1.5.4