#include <RecoLocalMuon/DTSegment/src/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 |
Definition at line 22 of file DTRecSegment4DProducer.h.
DTRecSegment4DProducer::DTRecSegment4DProducer | ( | const edm::ParameterSet & | pset | ) |
Constructor.
Definition at line 29 of file DTRecSegment4DProducer.cc.
References GenMuonPlsPt100GeV_cfg::cout, debug, lat::endl(), DBSPlugin::get(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), the4DAlgo, theRecHits1DLabel, and theRecHits2DLabel.
00029 { 00030 produces<DTRecSegment4DCollection>(); 00031 00032 // debug parameter 00033 debug = pset.getUntrackedParameter<bool>("debug"); 00034 00035 if(debug) 00036 cout << "[DTRecSegment4DProducer] Constructor called" << endl; 00037 00038 // the name of the 1D rec hits collection 00039 theRecHits1DLabel = pset.getParameter<InputTag>("recHits1DLabel"); 00040 00041 // the name of the 2D rec hits collection 00042 theRecHits2DLabel = pset.getParameter<InputTag>("recHits2DLabel"); 00043 00044 // Get the concrete 4D-segments reconstruction algo from the factory 00045 string theReco4DAlgoName = pset.getParameter<string>("Reco4DAlgoName"); 00046 if(debug) cout << "the Reco4D AlgoName is " << theReco4DAlgoName << endl; 00047 the4DAlgo = DTRecSegment4DAlgoFactory::get()->create(theReco4DAlgoName, 00048 pset.getParameter<ParameterSet>("Reco4DAlgoConfig")); 00049 }
DTRecSegment4DProducer::~DTRecSegment4DProducer | ( | ) | [virtual] |
Destructor.
Definition at line 52 of file DTRecSegment4DProducer.cc.
References GenMuonPlsPt100GeV_cfg::cout, debug, lat::endl(), and the4DAlgo.
00052 { 00053 if(debug) 00054 cout << "[DTRecSegment4DProducer] Destructor called" << endl; 00055 delete the4DAlgo; 00056 }
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(), GenMuonPlsPt100GeV_cfg::cout, debug, edm::OwnVector< T, P >::end(), lat::endl(), edm::EventSetup::get(), edm::Event::getByLabel(), DTRecSegment4DBaseAlgo::reconstruct(), DTRecSegment4DBaseAlgo::setChamber(), DTRecSegment4DBaseAlgo::setDTRecHit1DContainer(), DTRecSegment4DBaseAlgo::setDTRecSegment2DContainer(), DTRecSegment4DBaseAlgo::setES(), edm::OwnVector< T, P >::size(), the4DAlgo, theRecHits1DLabel, theRecHits2DLabel, and DTRecSegment4DBaseAlgo::wants2DSegments().
00058 { 00059 00060 // Get the 1D rechits from the event 00061 Handle<DTRecHitCollection> all1DHits; 00062 event.getByLabel(theRecHits1DLabel,all1DHits); 00063 00064 // Get the 2D rechits from the event 00065 Handle<DTRecSegment2DCollection> all2DSegments; 00066 if(the4DAlgo->wants2DSegments()) 00067 event.getByLabel(theRecHits2DLabel, all2DSegments); 00068 00069 // Create the pointer to the collection which will store the rechits 00070 auto_ptr<DTRecSegment4DCollection> segments4DCollection(new DTRecSegment4DCollection()); 00071 00072 // get the geometry 00073 ESHandle<DTGeometry> theGeom; 00074 setup.get<MuonGeometryRecord>().get(theGeom); 00075 00076 // Percolate the setup 00077 the4DAlgo->setES(setup); 00078 00079 // Iterate over all hit collections ordered by layerId 00080 DTRecHitCollection::id_iterator dtLayerIt; 00081 00082 DTChamberId oldChId; 00083 00084 for (dtLayerIt = all1DHits->id_begin(); dtLayerIt != all1DHits->id_end(); ++dtLayerIt){ 00085 00086 // Check the DTChamberId 00087 const DTChamberId chId = (*dtLayerIt).chamberId(); 00088 if (chId==oldChId) continue; // I'm on the same Chamber as before 00089 oldChId = chId; 00090 if(debug) cout << "ChamberId: "<< chId << endl; 00091 the4DAlgo->setChamber(chId); 00092 00093 if(debug) cout<<"Take the DTRecHits1D and set them in the reconstructor"<<endl; 00094 00095 the4DAlgo->setDTRecHit1DContainer(all1DHits); 00096 00097 if(debug) cout<<"Take the DTRecSegments2D and set them in the reconstructor"<<endl; 00098 00099 the4DAlgo->setDTRecSegment2DContainer(all2DSegments); 00100 00101 if(debug) cout << "Start 4D-Segments Reco " << endl; 00102 00103 OwnVector<DTRecSegment4D> segments4D = the4DAlgo->reconstruct(); 00104 00105 if(debug) cout << "Number of reconstructed 4D-segments " << segments4D.size() << endl; 00106 00107 if (segments4D.size() > 0 ) 00108 // convert the OwnVector into a Collection 00109 segments4DCollection->put(chId, segments4D.begin(),segments4D.end()); 00110 } 00111 // Load the output in the Event 00112 event.put(segments4DCollection); 00113 }
bool DTRecSegment4DProducer::debug [private] |
Definition at line 41 of file DTRecSegment4DProducer.h.
Referenced by DTRecSegment4DProducer(), produce(), and ~DTRecSegment4DProducer().
Definition at line 47 of file DTRecSegment4DProducer.h.
Referenced by DTRecSegment4DProducer(), produce(), and ~DTRecSegment4DProducer().
Definition at line 43 of file DTRecSegment4DProducer.h.
Referenced by DTRecSegment4DProducer(), and produce().
Definition at line 45 of file DTRecSegment4DProducer.h.
Referenced by DTRecSegment4DProducer(), and produce().