CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripHashedDetIdFakeESSource.cc
Go to the documentation of this file.
6 #include <sstream>
7 #include <vector>
8 #include <map>
9 
10 using namespace sistrip;
11 
12 // -----------------------------------------------------------------------------
13 //
16  detIds_( pset.getParameter<edm::FileInPath>("DetIdsFile") )
17 {
18  findingRecord<SiStripHashedDetIdRcd>();
19  edm::LogVerbatim("HashedDetId")
20  << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
21  << " Constructing object...";
22 }
23 
24 // -----------------------------------------------------------------------------
25 //
27  edm::LogVerbatim("HashedDetId")
28  << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
29  << " Destructing object...";
30 }
31 
32 // -----------------------------------------------------------------------------
33 //
35  edm::LogVerbatim("HashedDetId")
36  << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
37  << " Building \"fake\" hashed DetId map from ascii file";
38 
39  typedef std::map<uint32_t,SiStripDetInfoFileReader::DetInfo> Dets;
40  Dets det_info = SiStripDetInfoFileReader( detIds_.fullPath() ).getAllData();
41 
42  std::vector<uint32_t> dets;
43  dets.reserve(16000);
44 
45  Dets::const_iterator idet = det_info.begin();
46  Dets::const_iterator jdet = det_info.end();
47  for ( ; idet != jdet; ++idet ) { dets.push_back( idet->first ); }
48  edm::LogVerbatim("HashedDetId")
49  << "[SiStripHashedDetIdESProducer::" << __func__ << "]"
50  << " Retrieved " << dets.size()
51  << " DetIds from ascii file!";
52 
54  LogTrace("HashedDetId")
55  << "[SiStripHashedDetIdESProducer::" << __func__ << "]"
56  << " DetId hash map: " << std::endl
57  << *hash;
58 
59  return hash;
60 
61 }
62 
63 // -----------------------------------------------------------------------------
64 //
66  const edm::IOVSyncValue& iov_sync,
67  edm::ValidityInterval& iov_validity ) {
68  edm::ValidityInterval infinity( iov_sync.beginOfTime(), iov_sync.endOfTime() );
69  iov_validity = infinity;
70 }
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
Provides dense hash map in place of DetId.
static const IOVSyncValue & beginOfTime()
Abstract base class for producer of SiStripHashedDetId record.
const double infinity
virtual SiStripHashedDetId * make(const SiStripHashedDetIdRcd &)
#define LogTrace(id)
SiStripHashedDetIdFakeESSource(const edm::ParameterSet &)
list key
Definition: combine.py:13
std::string fullPath() const
Definition: FileInPath.cc:165
virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)