#include <DTRecSegment2DProducer.h>
Public Member Functions | |
DTRecSegment2DProducer (const edm::ParameterSet &) | |
Constructor. | |
virtual void | produce (edm::Event &event, const edm::EventSetup &setup) |
The method which produces the 2D-segments. | |
virtual | ~DTRecSegment2DProducer () |
Destructor. | |
Private Attributes | |
bool | debug |
DTRecSegment2DBaseAlgo * | theAlgo |
edm::InputTag | theRecHits1DLabel |
Producer for DT segment in one projection.
Definition at line 33 of file DTRecSegment2DProducer.h.
DTRecSegment2DProducer::DTRecSegment2DProducer | ( | const edm::ParameterSet & | pset | ) |
Constructor.
Definition at line 38 of file DTRecSegment2DProducer.cc.
References gather_cfg::cout, debug, reco::get(), edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().
{ // Set verbose output debug = pset.getUntrackedParameter<bool>("debug"); // the name of the 1D rec hits collection theRecHits1DLabel = pset.getParameter<InputTag>("recHits1DLabel"); if(debug) cout << "[DTRecSegment2DProducer] Constructor called" << endl; produces<DTRecSegment2DCollection>(); // Get the concrete reconstruction algo from the factory string theAlgoName = pset.getParameter<string>("Reco2DAlgoName"); if(debug) cout << "the Reco2D AlgoName is " << theAlgoName << endl; theAlgo = DTRecSegment2DAlgoFactory::get()->create(theAlgoName, pset.getParameter<ParameterSet>("Reco2DAlgoConfig")); }
DTRecSegment2DProducer::~DTRecSegment2DProducer | ( | ) | [virtual] |
Destructor.
Definition at line 58 of file DTRecSegment2DProducer.cc.
References gather_cfg::cout, and debug.
void DTRecSegment2DProducer::produce | ( | edm::Event & | event, |
const edm::EventSetup & | setup | ||
) | [virtual] |
The method which produces the 2D-segments.
Implements edm::EDProducer.
Definition at line 65 of file DTRecSegment2DProducer.cc.
References edm::OwnVector< T, P >::begin(), gather_cfg::cout, debug, edm::OwnVector< T, P >::end(), edm::EventSetup::get(), DTRangeMapAccessor::layersBySuperLayer(), edm::OwnVector< T, P >::size(), and DTLayerId::superlayerId().
{ if(debug) cout << "[DTRecSegment2DProducer] produce called" << endl; // Get the DT Geometry ESHandle<DTGeometry> dtGeom; setup.get<MuonGeometryRecord>().get(dtGeom); theAlgo->setES(setup); // Get the 1D rechits from the event Handle<DTRecHitCollection> allHits; event.getByLabel(theRecHits1DLabel, allHits); // Create the pointer to the collection which will store the rechits auto_ptr<DTRecSegment2DCollection> segments(new DTRecSegment2DCollection()); // Iterate through all hit collections ordered by LayerId DTRecHitCollection::id_iterator dtLayerIt; DTSuperLayerId oldSlId; for (dtLayerIt = allHits->id_begin(); dtLayerIt != allHits->id_end(); ++dtLayerIt){ // The layerId DTLayerId layerId = (*dtLayerIt); const DTSuperLayerId SLId = layerId.superlayerId(); if (SLId==oldSlId) continue; // I'm on the same SL as before oldSlId = SLId; if(debug) cout <<"Reconstructing the 2D segments in "<< SLId << endl; const DTSuperLayer* sl = dtGeom->superLayer(SLId); // Get all the rec hit in the same superLayer in which layerId relies DTRecHitCollection::range range = allHits->get(DTRangeMapAccessor::layersBySuperLayer(SLId)); // Fill the vector with the 1D RecHit vector<DTRecHit1DPair> pairs(range.first,range.second); if(debug) cout << "Number of 1D-RecHit pairs " << pairs.size() << endl; if(debug) cout << "Start the 2D-segments Reco "<< endl; OwnVector<DTSLRecSegment2D> segs = theAlgo->reconstruct(sl, pairs); if(debug) cout << "Number of Reconstructed segments: " << segs.size() << endl; if (segs.size() > 0 ) segments->put(SLId, segs.begin(),segs.end()); } event.put(segments); }
bool DTRecSegment2DProducer::debug [private] |
Definition at line 52 of file DTRecSegment2DProducer.h.
Definition at line 55 of file DTRecSegment2DProducer.h.
Definition at line 58 of file DTRecSegment2DProducer.h.