CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
algo_(conf.existsAs< bool >("Correct")?conf.getParameter< bool >("Correct"):true, conf.getParameter< double >("e9e25Cut"), conf.getParameter< double >("intercept2DCut"), conf.existsAs< bool >("intercept2DSlope")?conf.getParameter< double >("intercept2DSlope"):defaultSlope2D_, conf.getParameter< std::vector< double > >("e1e9Cut"), conf.getParameter< std::vector< double > >("eCOREe9Cut"), conf.getParameter< std::vector< double > >("eSeLCut"), hfvars_)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
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.
int iEvent
Definition: GenABIO.cc:230
void addDefault(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
def move
Definition: eostools.py:510
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > digiToken_
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
ESHandle< TrackerGeometry > geometry
CTPPSDiamondRecHitProducerAlgorithm algo_
A watcher to detect geometry changes.
CTPPSDiamondRecHitProducer(const edm::ParameterSet &)