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:
38 
40 
41  private:
42  virtual 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 {
84  // The following says we do not know what parameters are allowed so do no validation
85  // Please change this to state exactly what you do use, even if it is no parameters
87  desc.setUnknown();
88  descr.addDefault( desc );
89 }
90 
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 build(const TotemRPGeometry *, const edm::DetSetVector< CTPPSDiamondDigi > &, edm::DetSetVector< CTPPSDiamondRecHit > &)
virtual 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 addDefault(ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > digiToken_
const T & get() const
Definition: EventSetup.h:56
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