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 Member Functions | Private Attributes
TrackCandidateTopBottomHitFilter Class Reference

#include <Cruzet/TrackCandidateTopBottomHitFilter/src/TrackCandidateTopBottomHitFilter.cc>

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

Public Member Functions

 TrackCandidateTopBottomHitFilter (const edm::ParameterSet &)
 
 ~TrackCandidateTopBottomHitFilter ()
 
- 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 Member Functions

virtual void beginRun (edm::Run &run, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

std::string builderName
 
edm::InputTag label
 
double seedY
 
edm::ESHandle
< TransientTrackingRecHitBuilder
theBuilder
 

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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 43 of file TrackCandidateTopBottomHitFilter.cc.

Constructor & Destructor Documentation

TrackCandidateTopBottomHitFilter::TrackCandidateTopBottomHitFilter ( const edm::ParameterSet iConfig)
explicit

Definition at line 58 of file TrackCandidateTopBottomHitFilter.cc.

References builderName, edm::ParameterSet::getParameter(), label, and seedY.

58  {
59  builderName = iConfig.getParameter<std::string>("TTRHBuilder");
60  label = iConfig.getParameter<edm::InputTag>("Input");
61  seedY = iConfig.getParameter<double>("SeedY");
62 
63  produces<TrackCandidateCollection>();
64 }
T getParameter(std::string const &) const
TrackCandidateTopBottomHitFilter::~TrackCandidateTopBottomHitFilter ( )

Definition at line 67 of file TrackCandidateTopBottomHitFilter.cc.

67 {}

Member Function Documentation

void TrackCandidateTopBottomHitFilter::beginRun ( edm::Run run,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 102 of file TrackCandidateTopBottomHitFilter.cc.

References builderName, edm::EventSetup::get(), and theBuilder.

102  {
104 }
edm::ESHandle< TransientTrackingRecHitBuilder > theBuilder
const T & get() const
Definition: EventSetup.h:55
void TrackCandidateTopBottomHitFilter::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 106 of file TrackCandidateTopBottomHitFilter.cc.

106 {}
void TrackCandidateTopBottomHitFilter::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 75 of file TrackCandidateTopBottomHitFilter.cc.

References edm::Event::getByLabel(), label, edm::OwnVector< T, P >::push_back(), edm::Event::put(), seedY, edm::OwnVector< T, P >::size(), evf::utils::state, and theBuilder.

75  {
76  using namespace edm;
77  using namespace std;
78 
80  iEvent.getByLabel(label,pIn);
81  std::auto_ptr<TrackCandidateCollection> pOut(new TrackCandidateCollection);
82  for (TrackCandidateCollection::const_iterator it=pIn->begin(); it!=pIn->end();++it) {
83  PTrajectoryStateOnDet state = it->trajectoryStateOnDet();
84  TrackCandidate::range oldhits = it->recHits();
85  TrajectorySeed seed = it->seed();
87  for (TrackCandidate::RecHitContainer::const_iterator hit=oldhits.first;hit!=oldhits.second;++hit) {
88  if (hit->isValid()) {
89  double hitY = theBuilder->build(&*hit)->globalPosition().y();
90  if (seedY*hitY>0) hits.push_back(hit->clone());
91  else break;
92  } else hits.push_back(hit->clone());
93  }
94  if (hits.size()>=3) {
95  TrackCandidate newTC(hits,seed,state);
96  pOut->push_back(newTC);
97  }
98  }
99  iEvent.put(pOut);
100 }
std::vector< TrackCandidate > TrackCandidateCollection
size_type size() const
Definition: OwnVector.h:247
std::pair< const_iterator, const_iterator > range
void push_back(D *&d)
Definition: OwnVector.h:273
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
edm::ESHandle< TransientTrackingRecHitBuilder > theBuilder
char state
Definition: procUtils.cc:75

Member Data Documentation

std::string TrackCandidateTopBottomHitFilter::builderName
private
edm::InputTag TrackCandidateTopBottomHitFilter::label
private
double TrackCandidateTopBottomHitFilter::seedY
private
edm::ESHandle<TransientTrackingRecHitBuilder> TrackCandidateTopBottomHitFilter::theBuilder
private

Definition at line 53 of file TrackCandidateTopBottomHitFilter.cc.

Referenced by beginRun(), and produce().