#include <DTRecSegment4DProducer.h>
Public Member Functions | |
DTRecSegment4DProducer (const edm::ParameterSet &) | |
Constructor. | |
virtual void | produce (edm::Event &event, const edm::EventSetup &setup) |
The method which produces the 4D rec segments. | |
virtual | ~DTRecSegment4DProducer () |
Destructor. | |
Private Attributes | |
bool | debug |
DTRecSegment4DBaseAlgo * | the4DAlgo |
edm::InputTag | theRecHits1DLabel |
edm::InputTag | theRecHits2DLabel |
Builds the segments in the DT chambers.
Builds the segments in the DT chambers.
Definition at line 22 of file DTRecSegment4DProducer.h.
DTRecSegment4DProducer::DTRecSegment4DProducer | ( | const edm::ParameterSet & | pset | ) |
Constructor.
Definition at line 29 of file DTRecSegment4DProducer.cc.
References gather_cfg::cout, debug, reco::get(), edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().
{ produces<DTRecSegment4DCollection>(); // debug parameter debug = pset.getUntrackedParameter<bool>("debug", false); if(debug) cout << "[DTRecSegment4DProducer] Constructor called" << endl; // the name of the 1D rec hits collection theRecHits1DLabel = pset.getParameter<InputTag>("recHits1DLabel"); // the name of the 2D rec hits collection theRecHits2DLabel = pset.getParameter<InputTag>("recHits2DLabel"); // Get the concrete 4D-segments reconstruction algo from the factory string theReco4DAlgoName = pset.getParameter<string>("Reco4DAlgoName"); if(debug) cout << "the Reco4D AlgoName is " << theReco4DAlgoName << endl; the4DAlgo = DTRecSegment4DAlgoFactory::get()->create(theReco4DAlgoName, pset.getParameter<ParameterSet>("Reco4DAlgoConfig")); }
DTRecSegment4DProducer::~DTRecSegment4DProducer | ( | ) | [virtual] |
Destructor.
Definition at line 52 of file DTRecSegment4DProducer.cc.
References gather_cfg::cout, and debug.
void DTRecSegment4DProducer::produce | ( | edm::Event & | event, |
const edm::EventSetup & | setup | ||
) | [virtual] |
The method which produces the 4D rec segments.
Implements edm::EDProducer.
Definition at line 58 of file DTRecSegment4DProducer.cc.
References edm::OwnVector< T, P >::begin(), filterCSVwithJSON::copy, gather_cfg::cout, debug, edm::OwnVector< T, P >::end(), edm::EventSetup::get(), edm::Event::getByLabel(), and edm::OwnVector< T, P >::size().
{ // Get the 1D rechits from the event Handle<DTRecHitCollection> all1DHits; event.getByLabel(theRecHits1DLabel,all1DHits); // Get the 2D rechits from the event Handle<DTRecSegment2DCollection> all2DSegments; if(the4DAlgo->wants2DSegments()) event.getByLabel(theRecHits2DLabel, all2DSegments); // Create the pointer to the collection which will store the rechits auto_ptr<DTRecSegment4DCollection> segments4DCollection(new DTRecSegment4DCollection()); // get the geometry ESHandle<DTGeometry> theGeom; setup.get<MuonGeometryRecord>().get(theGeom); // Percolate the setup the4DAlgo->setES(setup); // Iterate over all hit collections ordered by layerId DTRecHitCollection::id_iterator dtLayerIt; DTChamberId oldChId; for (dtLayerIt = all1DHits->id_begin(); dtLayerIt != all1DHits->id_end(); ++dtLayerIt){ // Check the DTChamberId const DTChamberId chId = (*dtLayerIt).chamberId(); if (chId==oldChId) continue; // I'm on the same Chamber as before oldChId = chId; if(debug) cout << "ChamberId: "<< chId << endl; the4DAlgo->setChamber(chId); if(debug) cout<<"Take the DTRecHits1D and set them in the reconstructor"<<endl; the4DAlgo->setDTRecHit1DContainer(all1DHits); if(debug) cout<<"Take the DTRecSegments2D and set them in the reconstructor"<<endl; the4DAlgo->setDTRecSegment2DContainer(all2DSegments); if(debug) cout << "Start 4D-Segments Reco " << endl; OwnVector<DTRecSegment4D> segments4D = the4DAlgo->reconstruct(); if(debug) { cout << "Number of reconstructed 4D-segments " << segments4D.size() << endl; copy(segments4D.begin(), segments4D.end(), ostream_iterator<DTRecSegment4D>(cout, "\n")); } if (segments4D.size() > 0 ) // convert the OwnVector into a Collection segments4DCollection->put(chId, segments4D.begin(),segments4D.end()); } // Load the output in the Event event.put(segments4DCollection); }
bool DTRecSegment4DProducer::debug [private] |
Definition at line 41 of file DTRecSegment4DProducer.h.
Definition at line 47 of file DTRecSegment4DProducer.h.
Definition at line 43 of file DTRecSegment4DProducer.h.
Definition at line 45 of file DTRecSegment4DProducer.h.