CMS 3D CMS Logo

ME0RecHitProducer.cc
Go to the documentation of this file.
1 
9 
10 
12  // Get the concrete reconstruction algo from the factory
13  theAlgo{ME0RecHitAlgoFactory::get()->create(config.getParameter<std::string>("recAlgo"),
14  config.getParameter<edm::ParameterSet>("recAlgoConfig"))}
15 {
16  produces<ME0RecHitCollection>();
17 
18  m_token = consumes<ME0DigiPreRecoCollection>( config.getParameter<edm::InputTag>("me0DigiLabel") );
19 }
20 
22 
24 
25  // Get the ME0 Geometry
27  setup.get<MuonGeometryRecord>().get(me0Geom);
28 
29  // Get the digis from the event
30 
32  event.getByToken(m_token,digis);
33 
34  // Pass the EventSetup to the algo
35 
36  theAlgo->setES(setup);
37 
38  // Create the pointer to the collection which will store the rechits
39 
40  auto recHitCollection = std::make_unique<ME0RecHitCollection>();
41 
42  // Iterate through all digi collections ordered by LayerId
43 
45  for (me0dgIt = digis->begin(); me0dgIt != digis->end();
46  ++me0dgIt){
47 
48  // The layerId
49  const ME0DetId& me0Id = (*me0dgIt).first;
50 
51 
52  // Get the iterators over the digis associated with this LayerId
53  const ME0DigiPreRecoCollection::Range& range = (*me0dgIt).second;
54 
55  // Call the reconstruction algorithm
56 
58  theAlgo->reconstruct(me0Id, range);
59 
60  if(!recHits.empty())
61  recHitCollection->put(me0Id, recHits.begin(), recHits.end());
62  }
63 
64  event.put(std::move(recHitCollection));
65 
66 }
67 
T getParameter(std::string const &) const
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
Definition: config.py:1
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_token
iterator begin()
Definition: OwnVector.h:244
std::unique_ptr< ME0RecHitBaseAlgo > theAlgo
void produce(edm::Event &event, const edm::EventSetup &setup) override
The method which produces the rechits.
bool empty() const
Definition: OwnVector.h:269
iterator end()
Definition: OwnVector.h:249
~ME0RecHitProducer() override
Destructor.
T get() const
Definition: EventSetup.h:71
std::pair< const_iterator, const_iterator > Range
ME0RecHitProducer(const edm::ParameterSet &config)
Constructor.
def move(src, dest)
Definition: eostools.py:511
T get(const Candidate &c)
Definition: component.h:55
Definition: event.py:1