CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

SiStripHashedDetIdFakeESSource Class Reference

Builds hashed DetId map based on list of DetIds read from ascii file. More...

#include <SiStripHashedDetIdFakeESSource.h>

Inheritance diagram for SiStripHashedDetIdFakeESSource:
SiStripHashedDetIdESProducer edm::EventSetupRecordIntervalFinder edm::ESProducer edm::ESProducer edm::ESProxyFactoryProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider edm::eventsetup::DataProxyProvider

List of all members.

Public Member Functions

 SiStripHashedDetIdFakeESSource (const edm::ParameterSet &)
virtual ~SiStripHashedDetIdFakeESSource ()

Protected Member Functions

virtual void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)

Private Member Functions

virtual SiStripHashedDetIdmake (const SiStripHashedDetIdRcd &)

Private Attributes

edm::FileInPath detIds_

Detailed Description

Builds hashed DetId map based on list of DetIds read from ascii file.

Author:
R.Bainbridge

Definition at line 17 of file SiStripHashedDetIdFakeESSource.h.


Constructor & Destructor Documentation

SiStripHashedDetIdFakeESSource::SiStripHashedDetIdFakeESSource ( const edm::ParameterSet pset) [explicit]

Definition at line 14 of file SiStripHashedDetIdFakeESSource.cc.

  : SiStripHashedDetIdESProducer( pset ),
    detIds_( pset.getParameter<edm::FileInPath>("DetIdsFile") )
{
  findingRecord<SiStripHashedDetIdRcd>();
  edm::LogVerbatim("HashedDetId") 
    << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
    << " Constructing object...";
}
SiStripHashedDetIdFakeESSource::~SiStripHashedDetIdFakeESSource ( ) [virtual]

Definition at line 26 of file SiStripHashedDetIdFakeESSource.cc.

                                                                {
  edm::LogVerbatim("HashedDetId")
    << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
    << " Destructing object...";
}

Member Function Documentation

SiStripHashedDetId * SiStripHashedDetIdFakeESSource::make ( const SiStripHashedDetIdRcd ) [private, virtual]

Builds hashed DetId map based on ascii file.

Implements SiStripHashedDetIdESProducer.

Definition at line 34 of file SiStripHashedDetIdFakeESSource.cc.

References detIds_, edm::FileInPath::fullPath(), cond::hash, LogTrace, and OfflineSiStripConfigDb_cff::SiStripDetInfoFileReader.

                                                                                       {
  edm::LogVerbatim("HashedDetId")
    << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
    << " Building \"fake\" hashed DetId map from ascii file";
  
  typedef std::map<uint32_t,SiStripDetInfoFileReader::DetInfo>  Dets;
  Dets det_info = SiStripDetInfoFileReader( detIds_.fullPath() ).getAllData();
  
  std::vector<uint32_t> dets;
  dets.reserve(16000);

  Dets::const_iterator idet = det_info.begin();
  Dets::const_iterator jdet = det_info.end();
  for ( ; idet != jdet; ++idet ) { dets.push_back( idet->first ); }
  edm::LogVerbatim("HashedDetId")
    << "[SiStripHashedDetIdESProducer::" << __func__ << "]"
    << " Retrieved " << dets.size()
    << " DetIds from ascii file!";
  
  SiStripHashedDetId* hash = new SiStripHashedDetId( dets );
  LogTrace("HashedDetId")
    << "[SiStripHashedDetIdESProducer::" << __func__ << "]"
    << " DetId hash map: " << std::endl
    << *hash;
  
  return hash;
  
}
void SiStripHashedDetIdFakeESSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey key,
const edm::IOVSyncValue iov_sync,
edm::ValidityInterval iov_validity 
) [protected, virtual]

Member Data Documentation

Location of ascii file containing DetIds.

Definition at line 36 of file SiStripHashedDetIdFakeESSource.h.

Referenced by make().