CMS 3D CMS Logo

MuonSeedProducer.cc
Go to the documentation of this file.
1 
10 
11 
12 // Data Formats
14 
15 // Magnetic Field
18 
19 // Geometry
22 
25 
26 // Framework
32 // C++
33 #include <vector>
34 
35 
36 
37 /*
38  * Constructor
39  */
41 
42  // Register what this produces
43  produces<TrajectorySeedCollection>();
44 
45  // Local Debug flag
46  debug = pset.getParameter<bool>("DebugMuonSeed");
47 
48 
50 
51  // Builder which returns seed collection
52  muonSeedBuilder_ = new MuonSeedBuilder( pset,iC );
53 
54 }
55 
56 
57 /*
58  * Destructor
59  */
61 
62  delete muonSeedBuilder_;
63 
64 }
65 
66 
67 /*
68  * Producer (the main)
69  */
71 
72  // Muon Geometry
74  eSetup.get<MuonRecoGeometryRecord>().get(muonLayers);
75  const MuonDetLayerGeometry* lgeom = &*muonLayers;
76  muonSeedBuilder_->setGeometry( lgeom );
77 
78  // Magnetic field
80  eSetup.get<IdealMagneticFieldRecord>().get(field);
81  const MagneticField* theField = &*field;
82  muonSeedBuilder_->setBField( theField );
83 
84  // Create pointer to the seed container
85 
86  auto output = std::make_unique<TrajectorySeedCollection>();
87 
88  //UNUED: int nSeeds = 0;
89  //UNUSED: nSeeds =
90  muonSeedBuilder_->build( event, eSetup, *output);
91 
92  // Append muon seed collection to event
93  event.put(std::move(output));
94 
95 }
T getParameter(std::string const &) const
MuonSeedProducer(const edm::ParameterSet &)
Constructor.
int build(edm::Event &event, const edm::EventSetup &eventSetup, TrajectorySeedCollection &seeds)
Build seed collection.
MuonSeedBuilder * muonSeedBuilder_
Builder where seeds are formed.
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void setBField(const MagneticField *theField)
Cache pointer to Magnetic field.
virtual void produce(edm::Event &, const edm::EventSetup &) override
Get event properties to send to builder to fill seed collection.
const T & get() const
Definition: EventSetup.h:55
void setGeometry(const MuonDetLayerGeometry *lgeom)
Cache pointer to geometry.
def move(src, dest)
Definition: eostools.py:510
virtual ~MuonSeedProducer()
Destructor.
Definition: event.py:1