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::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase 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::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
 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
 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
 
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
< DTRecHitCollection
recHits1DToken_
 
edm::EDGetTokenT
< DTRecSegment2DCollection
recHits2DToken_
 
DTRecSegment4DBaseAlgothe4DAlgo
 

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
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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
Riccardo Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Definition at line 21 of file DTRecSegment4DProducer.h.

Constructor & Destructor Documentation

DTRecSegment4DProducer::DTRecSegment4DProducer ( const edm::ParameterSet pset)

Constructor.

Definition at line 26 of file DTRecSegment4DProducer.cc.

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

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

Destructor.

Definition at line 49 of file DTRecSegment4DProducer.cc.

References gather_cfg::cout, and debug.

49  {
50  if(debug)
51  cout << "[DTRecSegment4DProducer] Destructor called" << endl;
52  delete the4DAlgo;
53 }
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::stream::EDProducerBase.

Definition at line 55 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::getByToken(), and edm::OwnVector< T, P >::size().

55  {
56 
57  // Get the 1D rechits from the event
58  Handle<DTRecHitCollection> all1DHits;
59  event.getByToken(recHits1DToken_, all1DHits);
60 
61  // Get the 2D rechits from the event
64  event.getByToken(recHits2DToken_, all2DSegments);
65 
66  // Create the pointer to the collection which will store the rechits
67  auto_ptr<DTRecSegment4DCollection> segments4DCollection(new DTRecSegment4DCollection());
68 
69  // get the geometry
70  ESHandle<DTGeometry> theGeom;
71  setup.get<MuonGeometryRecord>().get(theGeom);
72 
73  // Percolate the setup
74  the4DAlgo->setES(setup);
75 
76  // Iterate over all hit collections ordered by layerId
77  DTRecHitCollection::id_iterator dtLayerIt;
78 
79  DTChamberId oldChId;
80 
81  for (dtLayerIt = all1DHits->id_begin(); dtLayerIt != all1DHits->id_end(); ++dtLayerIt){
82 
83  // Check the DTChamberId
84  const DTChamberId chId = (*dtLayerIt).chamberId();
85  if (chId==oldChId) continue; // I'm on the same Chamber as before
86  oldChId = chId;
87  if(debug) cout << "ChamberId: "<< chId << endl;
88  the4DAlgo->setChamber(chId);
89 
90  if(debug) cout<<"Take the DTRecHits1D and set them in the reconstructor"<<endl;
91 
93 
94  if(debug) cout<<"Take the DTRecSegments2D and set them in the reconstructor"<<endl;
95 
96  the4DAlgo->setDTRecSegment2DContainer(all2DSegments);
97 
98  if(debug) cout << "Start 4D-Segments Reco " << endl;
99 
101 
102  if(debug) {
103  cout << "Number of reconstructed 4D-segments " << segments4D.size() << endl;
104  copy(segments4D.begin(), segments4D.end(),
105  ostream_iterator<DTRecSegment4D>(cout, "\n"));
106  }
107 
108  if (segments4D.size() > 0 )
109  // convert the OwnVector into a Collection
110  segments4DCollection->put(chId, segments4D.begin(),segments4D.end());
111  }
112  // Load the output in the Event
113  event.put(segments4DCollection);
114 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
virtual void setES(const edm::EventSetup &setup)=0
virtual edm::OwnVector< DTRecSegment4D > reconstruct()=0
size_type size() const
Definition: OwnVector.h:248
virtual void setChamber(const DTChamberId &chId)=0
iterator begin()
Definition: OwnVector.h:228
virtual void setDTRecHit1DContainer(edm::Handle< DTRecHitCollection > all1DHits)=0
DTRecSegment4DBaseAlgo * the4DAlgo
edm::EDGetTokenT< DTRecSegment2DCollection > recHits2DToken_
virtual bool wants2DSegments()=0
iterator end()
Definition: OwnVector.h:233
const T & get() const
Definition: EventSetup.h:55
edm::EDGetTokenT< DTRecHitCollection > recHits1DToken_
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 40 of file DTRecSegment4DProducer.h.

edm::EDGetTokenT<DTRecHitCollection> DTRecSegment4DProducer::recHits1DToken_
private

Definition at line 42 of file DTRecSegment4DProducer.h.

edm::EDGetTokenT<DTRecSegment2DCollection> DTRecSegment4DProducer::recHits2DToken_
private

Definition at line 44 of file DTRecSegment4DProducer.h.

DTRecSegment4DBaseAlgo* DTRecSegment4DProducer::the4DAlgo
private

Definition at line 46 of file DTRecSegment4DProducer.h.