CMS 3D CMS Logo

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

List of all members.

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_

Detailed Description

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

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

Definition at line 41 of file CaloTowerConstituentsMapBuilder.h.


Member Typedef Documentation

Definition at line 46 of file CaloTowerConstituentsMapBuilder.h.


Constructor & Destructor Documentation

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.

{ 
}

Member Function Documentation

void CaloTowerConstituentsMapBuilder::fillDescriptions ( edm::ConfigurationDescriptions descriptions) [static]
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;
}

Member Data Documentation

Definition at line 53 of file CaloTowerConstituentsMapBuilder.h.

Referenced by produce().