CMS 3D CMS Logo

TotemT2RecHitProducer.cc
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * This is a part of TOTEM offline software.
4  * Authors:
5  * Laurent Forthomme (laurent.forthomme@cern.ch)
6  *
7  ****************************************************************************/
8 
9 #include <memory>
10 
15 
18 
21 
25 
27 
30 
32 public:
34 
36 
37 private:
38  void produce(edm::Event&, const edm::EventSetup&) override;
39 
43 
44  const bool applyCalib_; //Diamond calibration not used
46 };
47 
49  : digiToken_(consumes<edmNew::DetSetVector<TotemT2Digi> >(iConfig.getParameter<edm::InputTag>("digiTag"))),
50  geometryToken_(esConsumes<TotemGeometry, TotemGeometryRcd>()),
51  applyCalib_(iConfig.getParameter<bool>("applyCalibration")),
52  algo_(iConfig) {
53  produces<edmNew::DetSetVector<TotemT2RecHit> >();
54 }
55 
57  auto pOut = std::make_unique<edmNew::DetSetVector<TotemT2RecHit> >();
58 
59  // get the digi collection
60  const auto& digis = iEvent.get(digiToken_);
61 
62  if (!digis.empty()) {
63  // produce the rechits collection
64  algo_.build(iSetup.getData(geometryToken_), digis, *pOut);
65  }
66 
67  iEvent.put(std::move(pOut));
68 }
69 
72 
73  desc.add<edm::InputTag>("digiTag", edm::InputTag("totemT2Digis", "TotemT2"))
74  ->setComment("input digis collection to retrieve");
75  desc.add<double>("timeSliceNs", 25.0 / 4.0)
76  ->setComment("conversion constant between timing bin size and nanoseconds");
77  desc.add<bool>("applyCalibration", false)->setComment("switch on/off the timing calibration (not in use)");
78 
79  descr.add("totemT2RecHits", desc);
80 }
81 
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
static void fillDescriptions(edm::ConfigurationDescriptions &)
edm::EDGetTokenT< edmNew::DetSetVector< TotemT2Digi > > digiToken_
int iEvent
Definition: GenABIO.cc:224
void build(const TotemGeometry &, const edmNew::DetSetVector< TotemT2Digi > &, edmNew::DetSetVector< TotemT2RecHit > &) override
TotemT2RecHitProducerAlgorithm algo_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ESGetToken< TotemGeometry, TotemGeometryRcd > geometryToken_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Event setup record containing the real (actual) geometry information.
HLT enums.
TotemT2RecHitProducer(const edm::ParameterSet &)
def move(src, dest)
Definition: eostools.py:511
void produce(edm::Event &, const edm::EventSetup &) override
const bool applyCalib_
A watcher to detect timing calibration changes.