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  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 }
38 
40 
41 // ------------ method called to produce the data ------------
42 std::unique_ptr<DTT0> DTFakeT0ESProducer::produce(const DTT0Rcd& iRecord) {
43  parseDDD(iRecord);
44  auto t0Map = std::make_unique<DTT0>();
45 
46  //Loop on layerId-nwires map
47  for (map<DTLayerId, pair<unsigned int, unsigned int> >::const_iterator lIdWire = theLayerIdWiresMap.begin();
48  lIdWire != theLayerIdWiresMap.end();
49  ++lIdWire) {
50  int firstWire = ((*lIdWire).second).first;
51  int nWires = ((*lIdWire).second).second;
52  //Loop on wires of each layer
53  for (int wire = 0; wire < nWires; wire++) {
54  t0Map->set(DTWireId((*lIdWire).first, wire + firstWire), t0Mean, t0Sigma, DTTimeUnits::counts);
55  }
56  }
57 
58  return t0Map;
59 }
60 
61 void DTFakeT0ESProducer::parseDDD(const DTT0Rcd& iRecord) {
64 
65  iRecord.getRecord<IdealGeometryRecord>().get(cpv);
66  iRecord.getRecord<IdealGeometryRecord>().get(mdc);
67 
68  DTGeometryParserFromDDD parser(&(*cpv), *mdc, theLayerIdWiresMap);
69 }
70 
72  const edm::IOVSyncValue&,
73  edm::ValidityInterval& oValidity) {
75 }
DTGeometryParserFromDDD.h
ESTransientHandle.h
ESHandle.h
DTLayerId.h
MuonGeometryConstants.h
DTT0.h
edm::ValidityInterval
Definition: ValidityInterval.h:28
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
DTFakeT0ESProducer::parseDDD
void parseDDD(const DTT0Rcd &iRecord)
Definition: DTFakeT0ESProducer.cc:61
writedatasetfile.parser
parser
Definition: writedatasetfile.py:7
DTT0Rcd
Definition: DTT0Rcd.h:9
dqmdumpme.first
first
Definition: dqmdumpme.py:55
DDCompactView.h
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
DTWireId
Definition: DTWireId.h:12
DTFakeT0ESProducer::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &oValidity) override
Definition: DTFakeT0ESProducer.cc:71
DTFakeT0ESProducer.h
edm::ESHandle
Definition: DTSurvey.h:22
DTFakeT0ESProducer::DTFakeT0ESProducer
DTFakeT0ESProducer(const edm::ParameterSet &pset)
Definition: DTFakeT0ESProducer.cc:28
DTLayerId
Definition: DTLayerId.h:12
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
SourceFactory.h
edm::ParameterSet
Definition: ParameterSet.h:36
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
DTT0Rcd.h
DTFakeT0ESProducer::~DTFakeT0ESProducer
~DTFakeT0ESProducer() override
Definition: DTFakeT0ESProducer.cc:39
get
#define get
DTGeometryParserFromDDD
Definition: DTGeometryParserFromDDD.h:21
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
DTFakeT0ESProducer::produce
std::unique_ptr< DTT0 > produce(const DTT0Rcd &iRecord)
Definition: DTFakeT0ESProducer.cc:42
cond::ValidityInterval
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
std
Definition: JetResolutionObject.h:76
DTTimeUnits::counts
Definition: DTTimeUnits.h:32
edm::IOVSyncValue::beginOfTime
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
EventSetup.h
genParticles_cff.map
map
Definition: genParticles_cff.py:11
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27