CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ME0RecHitProducer.cc
Go to the documentation of this file.
1 
8 #include "ME0RecHitProducer.h"
9 
10 
12 
13  produces<ME0RecHitCollection>();
14 
15  m_token = consumes<ME0DigiPreRecoCollection>( config.getParameter<edm::InputTag>("me0DigiLabel") );
16 
17 
18  // Get the concrete reconstruction algo from the factory
19 
20  std::string theAlgoName = config.getParameter<std::string>("recAlgo");
21  theAlgo = ME0RecHitAlgoFactory::get()->create(theAlgoName,
22  config.getParameter<edm::ParameterSet>("recAlgoConfig"));
23 }
24 
25 
27  delete theAlgo;
28 }
29 
30 
31 
33 }
34 
35 
36 
38 
39  // Get the ME0 Geometry
41  setup.get<MuonGeometryRecord>().get(me0Geom);
42 
43  // Get the digis from the event
44 
46  event.getByToken(m_token,digis);
47 
48  // Pass the EventSetup to the algo
49 
50  theAlgo->setES(setup);
51 
52  // Create the pointer to the collection which will store the rechits
53 
54  std::auto_ptr<ME0RecHitCollection> recHitCollection(new ME0RecHitCollection());
55 
56  // Iterate through all digi collections ordered by LayerId
57 
59  for (me0dgIt = digis->begin(); me0dgIt != digis->end();
60  ++me0dgIt){
61 
62  // The layerId
63  const ME0DetId& me0Id = (*me0dgIt).first;
64 
65 
66  // Get the iterators over the digis associated with this LayerId
67  const ME0DigiPreRecoCollection::Range& range = (*me0dgIt).second;
68 
69  // Call the reconstruction algorithm
70 
72  theAlgo->reconstruct(me0Id, range);
73 
74  if(recHits.size() > 0)
75  recHitCollection->put(me0Id, recHits.begin(), recHits.end());
76  }
77 
78  event.put(recHitCollection);
79 
80 }
81 
T getParameter(std::string const &) const
edm::RangeMap< ME0DetId, edm::OwnVector< ME0RecHit, edm::ClonePolicy< ME0RecHit > >, edm::ClonePolicy< ME0RecHit > > ME0RecHitCollection
size_type size() const
Definition: OwnVector.h:254
virtual void setES(const edm::EventSetup &setup)=0
Pass the Event Setup to the algo at each event.
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_token
iterator begin()
Definition: OwnVector.h:234
virtual void produce(edm::Event &event, const edm::EventSetup &setup) override
The method which produces the rechits.
ME0RecHitBaseAlgo * theAlgo
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual edm::OwnVector< ME0RecHit > reconstruct(const ME0DetId &me0Id, const ME0DigiPreRecoCollection::Range &digiRange)
Build all hits in the range associated to the me0Id, at the 1st step.
iterator end()
Definition: OwnVector.h:239
const T & get() const
Definition: EventSetup.h:56
std::pair< const_iterator, const_iterator > Range
ME0RecHitProducer(const edm::ParameterSet &config)
Constructor.
virtual ~ME0RecHitProducer()
Destructor.
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
T get(const Candidate &c)
Definition: component.h:55
Definition: Run.h:43