CMS 3D CMS Logo

DTFakeT0ESProducer.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * \author S. Bolognesi - INFN Torino
5  */
6 
7 // system include files
8 #include <memory>
9 
10 // user include files
13 
17 
21 
25 
26 using namespace std;
27 
29  //framework
30  auto cc = setWhatProduced(this, &DTFakeT0ESProducer::produce);
31  // setWhatProduced(this,dependsOn(& DTGeometryESModule::parseDDD()));
32  findingRecord<DTT0Rcd>();
33 
34  //read constant value for t0 from cfg
35  t0Mean = pset.getParameter<double>("t0Mean");
36  t0Sigma = pset.getParameter<double>("t0Sigma");
37  cpvTokenDDD_ = cc.consumesFrom<DDCompactView, IdealGeometryRecord>(edm::ESInputTag());
38  mdcToken_ = cc.consumes();
39 }
40 
42 
43 // ------------ method called to produce the data ------------
44 std::unique_ptr<DTT0> DTFakeT0ESProducer::produce(const DTT0Rcd& iRecord) {
45  parseDDD(iRecord);
46  auto t0Map = std::make_unique<DTT0>();
47 
48  //Loop on layerId-nwires map
49  for (map<DTLayerId, pair<unsigned int, unsigned int> >::const_iterator lIdWire = theLayerIdWiresMap.begin();
50  lIdWire != theLayerIdWiresMap.end();
51  ++lIdWire) {
52  int firstWire = ((*lIdWire).second).first;
53  int nWires = ((*lIdWire).second).second;
54  //Loop on wires of each layer
55  for (int wire = 0; wire < nWires; wire++) {
56  t0Map->set(DTWireId((*lIdWire).first, wire + firstWire), t0Mean, t0Sigma, DTTimeUnits::counts);
57  }
58  }
59 
60  return t0Map;
61 }
62 
63 void DTFakeT0ESProducer::parseDDD(const DTT0Rcd& iRecord) {
65  const auto& mdc = iRecord.get(mdcToken_);
66 
67  DTGeometryParserFromDDD parser(&(*cpv), mdc, theLayerIdWiresMap);
68 }
69 
71  const edm::IOVSyncValue&,
72  edm::ValidityInterval& oValidity) {
74 }
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &oValidity) override
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
U second(std::pair< T, U > const &p)
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
void parseDDD(const DTT0Rcd &iRecord)
Definition: DTT0Rcd.h:9
~DTFakeT0ESProducer() override
DTFakeT0ESProducer(const edm::ParameterSet &pset)
std::unique_ptr< DTT0 > produce(const DTT0Rcd &iRecord)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const