CMS 3D CMS Logo

TotemTimingRecHitProducer.cc
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * This is a part of CTPPS offline software.
4  * Authors:
5  * Laurent Forthomme (laurent.forthomme@cern.ch)
6  * Nicola Minafra (nicola.minafra@cern.ch)
7  *
8  ****************************************************************************/
9 
10 #include <memory>
11 
18 
21 
24 
28 
30 
34 
37 public:
39 
41 
42 private:
43  void produce(edm::Event&, const edm::EventSetup&) override;
44 
53 };
54 
56  : digiToken_(consumes<edm::DetSetVector<TotemTimingDigi> >(iConfig.getParameter<edm::InputTag>("digiTag"))),
57  timingCalibrationTag_(iConfig.getParameter<std::string>("timingCalibrationTag")),
58  algo_(iConfig) {
59  produces<edm::DetSetVector<TotemTimingRecHit> >();
60 }
61 
63  std::unique_ptr<edm::DetSetVector<TotemTimingRecHit> > pOut(new edm::DetSetVector<TotemTimingRecHit>);
64 
65  // get the digi collection
67  iEvent.getByToken(digiToken_, digis);
68 
69  // do not retrieve the calibration parameters if no digis were found
70  if (!digis->empty()) {
71  // check for timing calibration parameters update
72  if (calibWatcher_.check(iSetup)) {
74  iSetup.get<PPSTimingCalibrationRcd>().get(timingCalibrationTag_, hTimingCalib);
75  algo_.setCalibration(*hTimingCalib);
76  }
77 
78  // get the geometry
80  iSetup.get<VeryForwardRealGeometryRecord>().get(geometry);
81 
82  // produce the rechits collection
83  algo_.build(*geometry, *digis, *pOut);
84  }
85 
86  iEvent.put(std::move(pOut));
87 }
88 
91 
92  desc.add<edm::InputTag>("digiTag", edm::InputTag("totemTimingRawToDigi", "TotemTiming"))
93  ->setComment("input digis collection to retrieve");
94  desc.add<std::string>("timingCalibrationTag", "GlobalTag:TotemTimingCalibration")
95  ->setComment("input tag for timing calibrations retrieval");
96  desc.add<int>("baselinePoints", 8)->setComment("number of points to be used for the baseline");
97  desc.add<double>("saturationLimit", 0.85)
98  ->setComment("all signals with max > saturationLimit will be considered as saturated");
99  desc.add<double>("cfdFraction", 0.3)->setComment("fraction of the CFD");
100  desc.add<int>("smoothingPoints", 20)
101  ->setComment("number of points to be used for the smoothing using sinc (lowpass)");
102  desc.add<double>("lowPassFrequency", 0.7)
103  ->setComment("Frequency (in GHz) for CFD smoothing, 0 for disabling the filter");
104  desc.add<double>("hysteresis", 5.e-3)->setComment("hysteresis of the discriminator");
105  desc.add<bool>("mergeTimePeaks", true)->setComment("if time peaks schould be merged");
106 
107  descr.add("totemTimingRecHits", desc);
108 }
109 
void setComment(std::string const &value)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
TotemTimingRecHitProducer(const edm::ParameterSet &)
edm::ESInputTag timingCalibrationTag_
Label to timing calibration tag.
Event setup record containing the real (actual) geometry information.
EventSetup record for TOTEM/PPS timing calibration information.
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void produce(edm::Event &, const edm::EventSetup &) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void build(const CTPPSGeometry &, const edm::DetSetVector< TotemTimingDigi > &, edm::DetSetVector< TotemTimingRecHit > &)
TOTEM/PPS timing detectors digi-to-rechits conversion module.
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
edm::ESWatcher< PPSTimingCalibrationRcd > calibWatcher_
Timing calibration parameters watcher.
ESHandle< TrackerGeometry > geometry
void setCalibration(const PPSTimingCalibration &)
TotemTimingRecHitProducerAlgorithm algo_
Digi-to-rechits transformation algorithm.
static void fillDescriptions(edm::ConfigurationDescriptions &)
HLT enums.
T get() const
Definition: EventSetup.h:73
edm::EDGetTokenT< edm::DetSetVector< TotemTimingDigi > > digiToken_
Input digi collection.
def move(src, dest)
Definition: eostools.py:511