CMS 3D CMS Logo

CTPPSDiamondRecHitProducer.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  ~CTPPSDiamondRecHitProducer() override;
38 
40 
41  private:
42  void produce( edm::Event&, const edm::EventSetup& ) override;
43 
45 
47  //edm::ESWatcher<VeryForwardRealGeometryRecord> geometryWatcher_;
48 
50 };
51 
53  digiToken_( consumes< edm::DetSetVector<CTPPSDiamondDigi> >( iConfig.getParameter<edm::InputTag>( "digiTag" ) ) ),
54  algo_( iConfig )
55 {
56  produces< edm::DetSetVector<CTPPSDiamondRecHit> >();
57 }
58 
60 {}
61 
62 void
64 {
65  std::unique_ptr< edm::DetSetVector<CTPPSDiamondRecHit> > pOut( new edm::DetSetVector<CTPPSDiamondRecHit> );
66 
67  // get the digi collection
69  iEvent.getByToken( digiToken_, digis );
70 
71  // get the geometry
73  iSetup.get<VeryForwardRealGeometryRecord>().get( geometry );
74 
75  // produce the rechits collection
76  algo_.build( geometry.product(), *( digis ), *( pOut ) );
77 
78  iEvent.put( std::move( pOut ) );
79 }
80 
81 void
83 {
85 
86  desc.add<edm::InputTag>( "digiTag", edm::InputTag( "ctppsDiamondRawToDigi", "TimingDiamond" ) )
87  ->setComment( "input digis collection to retrieve" );
88  desc.add<double>( "timeSliceNs", 25.0/1024.0 )
89  ->setComment( "conversion constant between HPTDC timing bin size and nanoseconds" );
90  desc.add<int>( "timeShift", 0 ) // to be determined at calibration level, will be replaced by a map channel id -> time shift
91  ->setComment( "overall time offset to apply on all hits in all channels" );
92 
93  descr.add( "ctppsDiamondRecHits", desc );
94 }
95 
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
static void fillDescriptions(edm::ConfigurationDescriptions &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void produce(edm::Event &, const edm::EventSetup &) override
Event setup record containing the real (actual) geometry information.
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
int iEvent
Definition: GenABIO.cc:230
void build(const CTPPSGeometry *, const edm::DetSetVector< CTPPSDiamondDigi > &, edm::DetSetVector< CTPPSDiamondRecHit > &)
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > digiToken_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const T & get() const
Definition: EventSetup.h:55
void add(std::string const &label, ParameterSetDescription const &psetDescription)
ESHandle< TrackerGeometry > geometry
HLT enums.
CTPPSDiamondRecHitProducerAlgorithm algo_
A watcher to detect geometry changes.
CTPPSDiamondRecHitProducer(const edm::ParameterSet &)
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510