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
EMIsolatedTauJetsSelector Class Reference

#include <EMIsolatedTauJetsSelector.h>

Inheritance diagram for EMIsolatedTauJetsSelector:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EMIsolatedTauJetsSelector (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 ~EMIsolatedTauJetsSelector ()
 
- 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
 
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

std::vector< edm::InputTagtauSrc
 
std::vector< edm::EDGetTokenT
< reco::EMIsolatedTauTagInfoCollection > > 
tauSrc_token
 

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 18 of file EMIsolatedTauJetsSelector.h.

Constructor & Destructor Documentation

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

Definition at line 10 of file EMIsolatedTauJetsSelector.cc.

References edm::ParameterSet::getParameter(), tauSrc, and tauSrc_token.

11 {
12  tauSrc = iConfig.getParameter<std::vector< edm::InputTag > >("TauSrc");
13  typedef std::vector<edm::InputTag> vtag;
14  for(vtag::const_iterator it = tauSrc.begin(); it != tauSrc.end(); ++it) {
15  edm::EDGetTokenT<reco::EMIsolatedTauTagInfoCollection> aToken = consumes<reco::EMIsolatedTauTagInfoCollection>(*it);
16  tauSrc_token.push_back(aToken);
17  }
18 
19  produces<reco::CaloJetCollection>("Isolated");
20  produces<reco::CaloJetCollection>("NotIsolated");
21 }
T getParameter(std::string const &) const
std::vector< edm::EDGetTokenT< reco::EMIsolatedTauTagInfoCollection > > tauSrc_token
std::vector< edm::InputTag > tauSrc
EMIsolatedTauJetsSelector::~EMIsolatedTauJetsSelector ( )

Definition at line 23 of file EMIsolatedTauJetsSelector.cc.

23 { }

Member Function Documentation

void EMIsolatedTauJetsSelector::produce ( edm::Event iEvent,
const edm::EventSetup iES 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 25 of file EMIsolatedTauJetsSelector.cc.

References edm::Event::getByToken(), i, edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, alignCSCRings::s, and tauSrc_token.

26 {
27 
28  using namespace reco;
29  using namespace edm;
30  using namespace std;
31 
32  std::auto_ptr<reco::CaloJetCollection> isolatedTaus(new CaloJetCollection);
33  std::auto_ptr<reco::CaloJetCollection> notIsolatedTaus(new CaloJetCollection);
34 
35  typedef std::vector<edm::EDGetTokenT<reco::EMIsolatedTauTagInfoCollection> > vtag_token;
36  for( vtag_token::const_iterator s = tauSrc_token.begin(); s != tauSrc_token.end(); ++ s ) {
38  iEvent.getByToken( * s, tauJets );
39  EMIsolatedTauTagInfoCollection::const_iterator i = tauJets->begin();
40  for(;i !=tauJets->end(); i++ ) {
41  double discriminator = (*i).discriminator();
42  if(discriminator > 0) {
43  const CaloJet* pippo = dynamic_cast<const CaloJet*>(i->jet().get());
44  isolatedTaus->push_back(*pippo );
45  }else{
46  const CaloJet* notPippo =dynamic_cast<const CaloJet*>(i->jet().get());
47 
48  notIsolatedTaus->push_back(*notPippo );
49  }
50  }
51  }
52 
53 
54 
55  iEvent.put(isolatedTaus, "Isolated");
56  iEvent.put(notIsolatedTaus,"NotIsolated");
57 
58 }
int i
Definition: DBlmapReader.cc:9
Jets made from CaloTowers.
Definition: CaloJet.h:29
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
std::vector< edm::EDGetTokenT< reco::EMIsolatedTauTagInfoCollection > > tauSrc_token
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects

Member Data Documentation

std::vector<edm::InputTag> EMIsolatedTauJetsSelector::tauSrc
private

Definition at line 25 of file EMIsolatedTauJetsSelector.h.

Referenced by EMIsolatedTauJetsSelector().

std::vector<edm::EDGetTokenT<reco::EMIsolatedTauTagInfoCollection> > EMIsolatedTauJetsSelector::tauSrc_token
private

Definition at line 26 of file EMIsolatedTauJetsSelector.h.

Referenced by EMIsolatedTauJetsSelector(), and produce().