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
IsoTracks Class Reference
Inheritance diagram for IsoTracks:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void endJob () override
 
 IsoTracks (const edm::ParameterSet &iConfig)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
virtual ~IsoTracks ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

double coneRadius_
 
double threshold_
 
edm::EDGetTokenT< std::vector
< reco::Track > > 
v_recoTrackToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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::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

Definition at line 21 of file IsoTracks.cc.

Constructor & Destructor Documentation

IsoTracks::IsoTracks ( const edm::ParameterSet iConfig)

Definition at line 46 of file IsoTracks.cc.

Referenced by produce().

47  : coneRadius_ ( iConfig.getParameter<double>( "radius" ) )
48  , threshold_ ( iConfig.getParameter<double>( "SumPtFraction" ) )
49  , v_recoTrackToken_( consumes< std::vector<reco::Track> >( iConfig.getParameter<edm::InputTag>( "src" ) ) )
50 {
51  produces<std::vector<reco::Track> >();
52 }
T getParameter(std::string const &) const
double coneRadius_
Definition: IsoTracks.cc:34
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< std::vector< reco::Track > > v_recoTrackToken_
Definition: IsoTracks.cc:36
double threshold_
Definition: IsoTracks.cc:35
IsoTracks::~IsoTracks ( )
virtual

Definition at line 55 of file IsoTracks.cc.

55 {}

Member Function Documentation

void IsoTracks::endJob ( void  )
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 99 of file IsoTracks.cc.

100 {
101 }
void IsoTracks::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 62 of file IsoTracks.cc.

References coneRadius_, deltaR(), eta(), edm::Event::getByToken(), IsoTracks(), phi, RecoTauCleanerPlugins::pt, edm::Event::put(), reco::return(), threshold_, and v_recoTrackToken_.

63 {
64 
65  std::auto_ptr<std::vector<reco::Track> > IsoTracks(new std::vector<reco::Track >);
66 
68  iEvent.getByToken( v_recoTrackToken_, dirtyTracks );
69 
70  if( dirtyTracks->size() == 0 )
71  {
72  iEvent.put(IsoTracks);
73  return ;
74  }
75 
76  std::vector<reco::Track>::const_iterator dirtyTrackIt ;
77  std::vector<reco::Track>::const_iterator dirtyTrackIt2 ;
78 // typename std::vector<reco::Track>::const_iterator dirtyTrackIt ;
79 // typename std::vector<reco::Track>::const_iterator dirtyTrackIt2 ;
80  double sumPtInCone = 0 ;
81 
82  for ( dirtyTrackIt = dirtyTracks->begin(); dirtyTrackIt != dirtyTracks->end(); ++dirtyTrackIt ) {
83  for ( dirtyTrackIt2 = dirtyTracks->begin(); dirtyTrackIt2 != dirtyTracks->end(); ++dirtyTrackIt2 ) {
84  if ( dirtyTrackIt == dirtyTrackIt2) continue ;
85  if ( deltaR(dirtyTrackIt -> eta() ,
86  dirtyTrackIt -> phi() ,
87  dirtyTrackIt2 -> eta() ,
88  dirtyTrackIt2 -> phi() ) < coneRadius_ ){
89  sumPtInCone = sumPtInCone + dirtyTrackIt2 -> pt() ;
90  }
91  }
92  if ( sumPtInCone <= threshold_*(dirtyTrackIt->pt()) ){
93  IsoTracks -> push_back( *dirtyTrackIt ) ;
94  }
95  }
96  iEvent.put(IsoTracks);
97 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
IsoTracks(const edm::ParameterSet &iConfig)
Definition: IsoTracks.cc:46
double coneRadius_
Definition: IsoTracks.cc:34
T eta() const
edm::EDGetTokenT< std::vector< reco::Track > > v_recoTrackToken_
Definition: IsoTracks.cc:36
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
return(e1-e2)*(e1-e2)+dp *dp
double threshold_
Definition: IsoTracks.cc:35
Definition: DDAxes.h:10

Member Data Documentation

double IsoTracks::coneRadius_
private

Definition at line 34 of file IsoTracks.cc.

Referenced by produce().

double IsoTracks::threshold_
private

Definition at line 35 of file IsoTracks.cc.

Referenced by produce().

edm::EDGetTokenT< std::vector<reco::Track> > IsoTracks::v_recoTrackToken_
private

Definition at line 36 of file IsoTracks.cc.

Referenced by produce().