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
DTSegment4DT0Corrector Class Reference

#include <DTSegment4DT0Corrector.h>

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

Public Member Functions

 DTSegment4DT0Corrector (const edm::ParameterSet &)
 Constructor. More...
 
virtual void produce (edm::Event &event, const edm::EventSetup &setup)
 The method which produces the 4D rec segments corrected for t0 offset. More...
 
virtual ~DTSegment4DT0Corrector ()
 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
 
edm::InputTag theRecHits4DLabel
 
DTSegmentUpdatortheUpdator
 

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:
2009/03/10 16:09:13
Revision:
1.2
Author
Mario Pelliccioni - INFN Torino pelli.nosp@m.cci@.nosp@m.cern..nosp@m.ch

Builds the segments in the DT chambers.

Date:
2010/02/16 17:08:20
Revision:
1.2
Author
Mario Pelliccioni - INFN Torino pelli.nosp@m.cci@.nosp@m.cern..nosp@m.ch

Definition at line 22 of file DTSegment4DT0Corrector.h.

Constructor & Destructor Documentation

DTSegment4DT0Corrector::DTSegment4DT0Corrector ( const edm::ParameterSet pset)

Constructor.

Definition at line 24 of file DTSegment4DT0Corrector.cc.

References gather_cfg::cout, debug, edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

24  {
25  produces<DTRecSegment4DCollection>();
26 
27  // debug parameter
28  debug = pset.getUntrackedParameter<bool>("debug");
29 
30  if(debug)
31  cout << "[DTSegment4DT0Corrector] Constructor called" << endl;
32 
33  // the name of the 4D rec hits collection
34  theRecHits4DLabel = pset.getParameter<InputTag>("recHits4DLabel");
35 
36  // the updator
37  theUpdator = new DTSegmentUpdator(pset);
38 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
DTSegmentUpdator * theUpdator
tuple cout
Definition: gather_cfg.py:121
DTSegment4DT0Corrector::~DTSegment4DT0Corrector ( )
virtual

Destructor.

Definition at line 41 of file DTSegment4DT0Corrector.cc.

References gather_cfg::cout, and debug.

41  {
42  if(debug)
43  cout << "[DTSegment4DT0Corrector] Destructor called" << endl;
44  delete theUpdator;
45 }
DTSegmentUpdator * theUpdator
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

void DTSegment4DT0Corrector::produce ( edm::Event event,
const edm::EventSetup setup 
)
virtual

The method which produces the 4D rec segments corrected for t0 offset.

Implements edm::EDProducer.

Definition at line 47 of file DTSegment4DT0Corrector.cc.

References edm::OwnVector< T, P >::begin(), DTRecSegment4D::clone(), gather_cfg::cout, debug, edm::OwnVector< T, P >::end(), edm::EventSetup::get(), edm::OwnVector< T, P >::push_back(), and query::result.

47  {
48 
49  // Get the 4D Segment from the event
51  event.getByLabel(theRecHits4DLabel, all4DSegments);
52 
53  // get the geometry
54  ESHandle<DTGeometry> theGeom;
55  setup.get<MuonGeometryRecord>().get(theGeom);
56 
57  // Percolate the setup
58  theUpdator->setES(setup);
59 
60 
61  // Create the pointer to the collection which will store the rechits
62  auto_ptr<DTRecSegment4DCollection> segments4DCollection(new DTRecSegment4DCollection());
63 
64  // Iterate over the input DTSegment4D
66 
67  if(debug)
68  cout << "[DTSegment4DT0Corrector] Starting to loop over segments" << endl;
69 
70  for (chamberId = all4DSegments->id_begin(); chamberId != all4DSegments->id_end(); ++chamberId){
71 
73 
74  // Get the range for the corresponding ChamerId
75  DTRecSegment4DCollection::range range = all4DSegments->get(*chamberId);
76 
77  // Loop over the rechits of this ChamberId
78  for (DTRecSegment4DCollection::const_iterator segment4D = range.first;
79  segment4D!=range.second; ++segment4D) {
80 
81  DTRecSegment4D tmpseg = *segment4D;
82 
83  DTRecSegment4D *newSeg = tmpseg.clone();
84 
85  if(newSeg == 0) continue;
86 
87  theUpdator->update(newSeg,true);
88  result.push_back(*newSeg);
89 
90  }
91 
92  segments4DCollection->put(*chamberId, result.begin(), result.end());
93 
94  }
95 
96  if(debug)
97  cout << "[DTSegment4DT0Corrector] Saving modified segments into the event" << endl;
98 
99  // Load the output in the Event
100  event.put(segments4DCollection);
101 }
virtual DTRecSegment4D * clone() const
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:52
void update(DTRecSegment4D *seg, const bool calcT0=false) const
recompute hits position and refit the segment4D
DTSegmentUpdator * theUpdator
identifier iterator
Definition: RangeMap.h:138
iterator begin()
Definition: OwnVector.h:227
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:45
void push_back(D *&d)
Definition: OwnVector.h:273
void setES(const edm::EventSetup &setup)
set the setup
tuple result
Definition: query.py:137
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

Member Data Documentation

bool DTSegment4DT0Corrector::debug
private

Definition at line 42 of file DTSegment4DT0Corrector.h.

edm::InputTag DTSegment4DT0Corrector::theRecHits4DLabel
private

Definition at line 44 of file DTSegment4DT0Corrector.h.

DTSegmentUpdator* DTSegment4DT0Corrector::theUpdator
private

Definition at line 47 of file DTSegment4DT0Corrector.h.