Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-04-12 23:30:29

0001 #include "RecoLocalFastTime/Records/interface/MTDTimeCalibRecord.h"
0002 
0003 #include "Geometry/Records/interface/MTDDigiGeometryRecord.h"
0004 #include "Geometry/Records/interface/MTDTopologyRcd.h"
0005 
0006 #include "Geometry/MTDGeometryBuilder/interface/MTDGeometry.h"
0007 #include "Geometry/MTDNumberingBuilder/interface/MTDTopology.h"
0008 
0009 #include "RecoLocalFastTime/FTLCommonAlgos/interface/MTDTimeCalib.h"
0010 
0011 #include "FWCore/Framework/interface/EventSetup.h"
0012 #include "FWCore/Framework/interface/ESHandle.h"
0013 #include "FWCore/Framework/interface/ModuleFactory.h"
0014 #include "FWCore/Framework/interface/ESProducer.h"
0015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0016 
0017 #include <string>
0018 #include <memory>
0019 
0020 using namespace edm;
0021 
0022 class MTDTimeCalibESProducer : public edm::ESProducer {
0023 public:
0024   MTDTimeCalibESProducer(const edm::ParameterSet& p);
0025   ~MTDTimeCalibESProducer() override = default;
0026 
0027   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0028 
0029   std::unique_ptr<MTDTimeCalib> produce(const MTDTimeCalibRecord&);
0030 
0031 private:
0032   edm::ESGetToken<MTDGeometry, MTDDigiGeometryRecord> ddToken_;
0033   edm::ESGetToken<MTDTopology, MTDTopologyRcd> topoToken_;
0034   edm::ParameterSet pset_;
0035 };
0036 
0037 MTDTimeCalibESProducer::MTDTimeCalibESProducer(const edm::ParameterSet& p) {
0038   pset_ = p;
0039   auto cc = setWhatProduced(this, "MTDTimeCalib");
0040   ddToken_ = cc.consumes();
0041   topoToken_ = cc.consumes();
0042 }
0043 
0044 // Configuration descriptions
0045 void MTDTimeCalibESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0046   edm::ParameterSetDescription desc;
0047   desc.add<double>("BTLTimeOffset", 0.)->setComment("Time offset (additive) to all the BTL RecHits [ns]");
0048   desc.add<double>("ETLTimeOffset", 0.)->setComment("Time offset (additive) to all the ETL RecHits [ns]");
0049   desc.add<double>("BTLLightCollTime", 0.2)->setComment("Light collection time for BTL tile geometry [ns]");
0050   desc.add<double>("BTLLightCollSlope", 0.075)
0051       ->setComment("Light collection slope for bar for BTL bar tile geometry [ns/cm]");
0052   descriptions.add("MTDTimeCalibESProducer", desc);
0053 }
0054 
0055 std::unique_ptr<MTDTimeCalib> MTDTimeCalibESProducer::produce(const MTDTimeCalibRecord& iRecord) {
0056   return std::make_unique<MTDTimeCalib>(pset_, &iRecord.get(ddToken_), &iRecord.get(topoToken_));
0057 }
0058 
0059 #include "FWCore/PluginManager/interface/ModuleDef.h"
0060 #include "FWCore/Framework/interface/MakerMacros.h"
0061 
0062 DEFINE_FWK_EVENTSETUP_MODULE(MTDTimeCalibESProducer);