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 Referencefinal

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

Inheritance diagram for TrackCandidateTopBottomHitFilter:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

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

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

Private Attributes

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

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

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

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

Definition at line 42 of file TrackCandidateTopBottomHitFilter.cc.

Constructor & Destructor Documentation

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

Definition at line 56 of file TrackCandidateTopBottomHitFilter.cc.

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

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

Definition at line 65 of file TrackCandidateTopBottomHitFilter.cc.

65 {}

Member Function Documentation

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

Reimplemented from edm::stream::EDProducerBase.

Definition at line 100 of file TrackCandidateTopBottomHitFilter.cc.

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

100  {
102 }
edm::ESHandle< TransientTrackingRecHitBuilder > theBuilder
const T & get() const
Definition: EventSetup.h:56
void TrackCandidateTopBottomHitFilter::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 73 of file TrackCandidateTopBottomHitFilter.cc.

References edm::Event::getByToken(), label, edm::OwnVector< T, P >::push_back(), edm::Event::put(), fileCollector::seed, seedY, edm::OwnVector< T, P >::size(), and theBuilder.

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

Member Data Documentation

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

Definition at line 51 of file TrackCandidateTopBottomHitFilter.cc.

Referenced by beginRun(), and produce().