CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
DTRecSegment4DProducer Class Reference

#include <DTRecSegment4DProducer.h>

Inheritance diagram for DTRecSegment4DProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 DTRecSegment4DProducer (const edm::ParameterSet &)
 Constructor. More...
 
virtual void produce (edm::Event &event, const edm::EventSetup &setup)
 The method which produces the 4D rec segments. More...
 
virtual ~DTRecSegment4DProducer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

bool debug
 
DTRecSegment4DBaseAlgothe4DAlgo
 
edm::InputTag theRecHits1DLabel
 
edm::InputTag theRecHits2DLabel
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Builds the segments in the DT chambers.

Date:
2012/01/06 12:31:46
Revision:
1.12
Author
Riccardo Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Builds the segments in the DT chambers.

Date:
2010/02/16 17:08:19
Revision:
1.5
Author
Riccardo Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Definition at line 22 of file DTRecSegment4DProducer.h.

Constructor & Destructor Documentation

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().

29  {
30  produces<DTRecSegment4DCollection>();
31 
32  // debug parameter
33  debug = pset.getUntrackedParameter<bool>("debug", false);
34 
35  if(debug)
36  cout << "[DTRecSegment4DProducer] Constructor called" << endl;
37 
38  // the name of the 1D rec hits collection
39  theRecHits1DLabel = pset.getParameter<InputTag>("recHits1DLabel");
40 
41  // the name of the 2D rec hits collection
42  theRecHits2DLabel = pset.getParameter<InputTag>("recHits2DLabel");
43 
44  // Get the concrete 4D-segments reconstruction algo from the factory
45  string theReco4DAlgoName = pset.getParameter<string>("Reco4DAlgoName");
46  if(debug) cout << "the Reco4D AlgoName is " << theReco4DAlgoName << endl;
47  the4DAlgo = DTRecSegment4DAlgoFactory::get()->create(theReco4DAlgoName,
48  pset.getParameter<ParameterSet>("Reco4DAlgoConfig"));
49 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
DTRecSegment4DBaseAlgo * the4DAlgo
tuple cout
Definition: gather_cfg.py:121
T get(const Candidate &c)
Definition: component.h:56
DTRecSegment4DProducer::~DTRecSegment4DProducer ( )
virtual

Destructor.

Definition at line 52 of file DTRecSegment4DProducer.cc.

References gather_cfg::cout, and debug.

52  {
53  if(debug)
54  cout << "[DTRecSegment4DProducer] Destructor called" << endl;
55  delete the4DAlgo;
56 }
DTRecSegment4DBaseAlgo * the4DAlgo
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

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().

58  {
59 
60  // Get the 1D rechits from the event
61  Handle<DTRecHitCollection> all1DHits;
62  event.getByLabel(theRecHits1DLabel,all1DHits);
63 
64  // Get the 2D rechits from the event
67  event.getByLabel(theRecHits2DLabel, all2DSegments);
68 
69  // Create the pointer to the collection which will store the rechits
70  auto_ptr<DTRecSegment4DCollection> segments4DCollection(new DTRecSegment4DCollection());
71 
72  // get the geometry
73  ESHandle<DTGeometry> theGeom;
74  setup.get<MuonGeometryRecord>().get(theGeom);
75 
76  // Percolate the setup
77  the4DAlgo->setES(setup);
78 
79  // Iterate over all hit collections ordered by layerId
81 
82  DTChamberId oldChId;
83 
84  for (dtLayerIt = all1DHits->id_begin(); dtLayerIt != all1DHits->id_end(); ++dtLayerIt){
85 
86  // Check the DTChamberId
87  const DTChamberId chId = (*dtLayerIt).chamberId();
88  if (chId==oldChId) continue; // I'm on the same Chamber as before
89  oldChId = chId;
90  if(debug) cout << "ChamberId: "<< chId << endl;
91  the4DAlgo->setChamber(chId);
92 
93  if(debug) cout<<"Take the DTRecHits1D and set them in the reconstructor"<<endl;
94 
96 
97  if(debug) cout<<"Take the DTRecSegments2D and set them in the reconstructor"<<endl;
98 
99  the4DAlgo->setDTRecSegment2DContainer(all2DSegments);
100 
101  if(debug) cout << "Start 4D-Segments Reco " << endl;
102 
104 
105  if(debug) {
106  cout << "Number of reconstructed 4D-segments " << segments4D.size() << endl;
107  copy(segments4D.begin(), segments4D.end(),
108  ostream_iterator<DTRecSegment4D>(cout, "\n"));
109  }
110 
111  if (segments4D.size() > 0 )
112  // convert the OwnVector into a Collection
113  segments4DCollection->put(chId, segments4D.begin(),segments4D.end());
114  }
115  // Load the output in the Event
116  event.put(segments4DCollection);
117 }
virtual void setES(const edm::EventSetup &setup)=0
virtual edm::OwnVector< DTRecSegment4D > reconstruct()=0
size_type size() const
Definition: OwnVector.h:247
identifier iterator
Definition: RangeMap.h:138
virtual void setChamber(const DTChamberId &chId)=0
iterator begin()
Definition: OwnVector.h:227
virtual void setDTRecHit1DContainer(edm::Handle< DTRecHitCollection > all1DHits)=0
DTRecSegment4DBaseAlgo * the4DAlgo
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
virtual bool wants2DSegments()=0
iterator end()
Definition: OwnVector.h:232
const T & get() const
Definition: EventSetup.h:55
edm::RangeMap< DTChamberId, edm::OwnVector< DTRecSegment4D > > DTRecSegment4DCollection
tuple cout
Definition: gather_cfg.py:121
virtual void setDTRecSegment2DContainer(edm::Handle< DTRecSegment2DCollection > all2DSegments)=0

Member Data Documentation

bool DTRecSegment4DProducer::debug
private

Definition at line 41 of file DTRecSegment4DProducer.h.

DTRecSegment4DBaseAlgo* DTRecSegment4DProducer::the4DAlgo
private

Definition at line 47 of file DTRecSegment4DProducer.h.

edm::InputTag DTRecSegment4DProducer::theRecHits1DLabel
private

Definition at line 43 of file DTRecSegment4DProducer.h.

edm::InputTag DTRecSegment4DProducer::theRecHits2DLabel
private

Definition at line 45 of file DTRecSegment4DProducer.h.