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 
17 
20 
23 
27 
29 
32 
34 {
35  public:
37  ~TotemTimingRecHitProducer() override;
38 
40 
41  private:
42  void produce( edm::Event&, const edm::EventSetup& ) override;
43 
45 
47 };
48 
50  digiToken_( consumes<edm::DetSetVector<TotemTimingDigi> >( iConfig.getParameter<edm::InputTag>( "digiTag" ) ) ),
51  algo_( iConfig )
52 {
53  produces<edm::DetSetVector<TotemTimingRecHit> >();
54 }
55 
57 {}
58 
59 void
61 {
62  std::unique_ptr<edm::DetSetVector<TotemTimingRecHit> > pOut( new edm::DetSetVector<TotemTimingRecHit> );
63 
64  // get the digi collection
66  iEvent.getByToken( digiToken_, digis );
67 
68  // get the geometry
70  iSetup.get<VeryForwardRealGeometryRecord>().get( geometry );
71 
72  // produce the rechits collection
73  algo_.build( geometry.product(), *( digis ), *( pOut ) );
74 
75  iEvent.put( std::move( pOut ) );
76 }
77 
78 void
80 {
82 
83  desc.add<edm::InputTag>( "digiTag", edm::InputTag( "totemTimingRawToDigi", "TotemTiming" ) )
84  ->setComment( "input digis collection to retrieve" );
85  desc.add<std::string>( "calibrationFile", "/dev/null" )
86  ->setComment( "file with SAMPIC calibrations, ADC and INL; if /dev/null or corrupted, no calibration will be applied" );
87  desc.add<int>( "baselinePoints", 8 )
88  ->setComment( "number of points to be used for the baseline" );
89  desc.add<double>( "saturationLimit", 0.85 )
90  ->setComment( "all signals with max > saturationLimit will be considered as saturated" );
91  desc.add<double>( "cfdFraction", 0.5 )
92  ->setComment( "fraction of the CFD" );
93  desc.add<int>( "smoothingPoints", 20 )
94  ->setComment( "number of points to be used for the smoothing using sinc (lowpass)" );
95  desc.add<double>( "lowPassFrequency", 0 )
96  ->setComment( "Frequency (in GHz) for CFD smoothing, 0 for disabling the filter" );
97  desc.add<double>( "hysteresis", 5e-3 )
98  ->setComment( "hysteresis of the discriminator" );
99 
100 
101  descr.add( "totemTimingRecHits", desc );
102 }
103 
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
TotemTimingRecHitProducer(const edm::ParameterSet &)
Event setup record containing the real (actual) geometry information.
int iEvent
Definition: GenABIO.cc:230
void produce(edm::Event &, const edm::EventSetup &) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
ESHandle< TrackerGeometry > geometry
TotemTimingRecHitProducerAlgorithm algo_
static void fillDescriptions(edm::ConfigurationDescriptions &)
HLT enums.
T get() const
Definition: EventSetup.h:63
void build(const CTPPSGeometry *, const edm::DetSetVector< TotemTimingDigi > &, edm::DetSetVector< TotemTimingRecHit > &)
edm::EDGetTokenT< edm::DetSetVector< TotemTimingDigi > > digiToken_
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510