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::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase 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::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

bool debug
 
edm::EDGetTokenT
< DTRecSegment4DCollection
recHits4DToken_
 
DTSegmentUpdatortheUpdator
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Builds the segments in the DT chambers.

Author
Mario Pelliccioni - INFN Torino pelli.nosp@m.cci@.nosp@m.cern..nosp@m.ch

Definition at line 20 of file DTSegment4DT0Corrector.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 22 of file DTSegment4DT0Corrector.cc.

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

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

Destructor.

Definition at line 39 of file DTSegment4DT0Corrector.cc.

References gather_cfg::cout, and debug.

39  {
40  if(debug)
41  cout << "[DTSegment4DT0Corrector] Destructor called" << endl;
42  delete theUpdator;
43 }
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::stream::EDProducerBase.

Definition at line 45 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.

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

Member Data Documentation

bool DTSegment4DT0Corrector::debug
private

Definition at line 40 of file DTSegment4DT0Corrector.h.

edm::EDGetTokenT<DTRecSegment4DCollection> DTSegment4DT0Corrector::recHits4DToken_
private

Definition at line 42 of file DTSegment4DT0Corrector.h.

DTSegmentUpdator* DTSegment4DT0Corrector::theUpdator
private

Definition at line 45 of file DTSegment4DT0Corrector.h.