ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/IPHCalignment2/TrackingTools/PatternTools/plugins/TSCBLBuilderWithPropagatorESProducer.cc
Revision: 1.1
Committed: Fri Nov 25 16:38:24 2011 UTC (13 years, 5 months ago) by econte
Content type: text/plain
Branch: MAIN
CVS Tags: TBD2011, TBD_2011, HEAD
Log Message:
new IPHC alignment

File Contents

# User Rev Content
1 econte 1.1 //
2     // Original Author: Matt Rudolph
3     // Created: Sat Mar 28 20:13:08 CET 2009
4     //
5     //
6    
7    
8     // system include files
9     #include <memory>
10     #include "boost/shared_ptr.hpp"
11    
12     // user include files
13     #include "FWCore/Framework/interface/ModuleFactory.h"
14     #include "FWCore/Framework/interface/ESProducer.h"
15     #include "FWCore/Framework/interface/ESHandle.h"
16    
17     #include "TrackingTools/PatternTools/interface/TrajectoryStateClosestToBeamLineBuilder.h"
18     #include "TrackingTools/PatternTools/interface/TSCBLBuilderWithPropagator.h"
19     #include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
20    
21    
22     //
23     // class decleration
24     //
25    
26     class TSCBLBuilderWithPropagatorESProducer : public edm::ESProducer {
27     public:
28     TSCBLBuilderWithPropagatorESProducer(const edm::ParameterSet&);
29     ~TSCBLBuilderWithPropagatorESProducer();
30    
31     typedef boost::shared_ptr<TrajectoryStateClosestToBeamLineBuilder> ReturnType;
32    
33     ReturnType produce(const TrackingComponentsRecord&);
34     private:
35     // ----------member data ---------------------------
36     edm::ParameterSet pset_;
37     };
38    
39     //
40     // constants, enums and typedefs
41     //
42    
43     //
44     // static data member definitions
45     //
46    
47     //
48     // constructors and destructor
49     //
50     TSCBLBuilderWithPropagatorESProducer::TSCBLBuilderWithPropagatorESProducer(const edm::ParameterSet& p)
51     {
52     //the following line is needed to tell the framework what
53     // data is being produced
54     std::string myName = p.getParameter<std::string>("ComponentName");
55     pset_ = p;
56     setWhatProduced(this,myName);
57    
58     //now do what ever other initialization is needed
59     }
60    
61    
62     TSCBLBuilderWithPropagatorESProducer::~TSCBLBuilderWithPropagatorESProducer()
63     {
64    
65     // do anything here that needs to be done at desctruction time
66     // (e.g. close files, deallocate resources etc.)
67    
68     }
69    
70    
71     //
72     // member functions
73     //
74    
75     // ------------ method called to produce the data ------------
76     TSCBLBuilderWithPropagatorESProducer::ReturnType
77     TSCBLBuilderWithPropagatorESProducer::produce(const TrackingComponentsRecord& iRecord)
78     {
79     using namespace edm::es;
80     std::string propname = pset_.getParameter<std::string>("Propagator");
81    
82     edm::ESHandle<Propagator> theProp;
83     iRecord.get(propname, theProp);
84    
85     const Propagator * pro = theProp.product();
86    
87     TSCBLBuilderWithPropagatorESProducer::ReturnType pTSCBLBuilderWithPropagator(new TSCBLBuilderWithPropagator(*pro)) ;
88    
89    
90     return pTSCBLBuilderWithPropagator ;
91     }
92    
93     //define this as a plug-in
94     DEFINE_FWK_EVENTSETUP_MODULE(TSCBLBuilderWithPropagatorESProducer);