CMS 3D CMS Logo

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 {
17  findingRecord<SiStripHashedDetIdRcd>();
18  edm::LogVerbatim("HashedDetId")
19  << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
20  << " Constructing object...";
21 }
22 
23 // -----------------------------------------------------------------------------
24 //
26  edm::LogVerbatim("HashedDetId")
27  << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
28  << " Destructing object...";
29 }
30 
31 // -----------------------------------------------------------------------------
32 //
34  edm::LogVerbatim("HashedDetId")
35  << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
36  << " Building \"fake\" hashed DetId map from ascii file";
37 
38  typedef std::map<uint32_t,SiStripDetInfoFileReader::DetInfo> Dets;
40  Dets det_info = reader->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:82
sistrip classes
Provides dense hash map in place of DetId.
const std::map< uint32_t, DetInfo > & getAllData() const
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
Abstract base class for producer of SiStripHashedDetId record.
const double infinity
#define LogTrace(id)
SiStripHashedDetId * make(const SiStripHashedDetIdRcd &) override
SiStripHashedDetIdFakeESSource(const edm::ParameterSet &)