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 Types | Private Attributes
IsolatedTauJetsSelector Class Reference

#include <IsolatedTauJetsSelector.h>

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

Public Member Functions

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

typedef std::vector
< edm::InputTag
vtag
 

Private Attributes

vtag jetSrc
 
std::vector< edm::EDGetTokenT
< reco::IsolatedTauTagInfoCollection > > 
jetSrcToken
 
double pt_min_leadTrack
 
bool useInHLTOpen
 
bool useIsolationDiscriminator
 

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 17 of file IsolatedTauJetsSelector.h.

Member Typedef Documentation

typedef std::vector<edm::InputTag> IsolatedTauJetsSelector::vtag
private

Definition at line 24 of file IsolatedTauJetsSelector.h.

Constructor & Destructor Documentation

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

Definition at line 10 of file IsolatedTauJetsSelector.cc.

References edm::ParameterSet::getParameter(), jetSrc, jetSrcToken, pt_min_leadTrack, useInHLTOpen, and useIsolationDiscriminator.

11 {
12 
13  jetSrc = iConfig.getParameter<vtag>("JetSrc");
14  for(vtag::const_iterator it = jetSrc.begin(); it != jetSrc.end(); ++it) {
15  edm::EDGetTokenT<reco::IsolatedTauTagInfoCollection> aToken = consumes<reco::IsolatedTauTagInfoCollection>(*it);
16  jetSrcToken.push_back(aToken);
17  }
18  pt_min_leadTrack = iConfig.getParameter<double>("MinimumTransverseMomentumLeadingTrack");
19  useIsolationDiscriminator = iConfig.getParameter<bool>("UseIsolationDiscriminator");
20  useInHLTOpen = iConfig.getParameter<bool>("UseInHLTOpen");
21 
22  produces<reco::CaloJetCollection>();
23  // produces<reco::IsolatedTauTagInfoCollection>();
24 }
T getParameter(std::string const &) const
std::vector< edm::EDGetTokenT< reco::IsolatedTauTagInfoCollection > > jetSrcToken
std::vector< edm::InputTag > vtag
IsolatedTauJetsSelector::~IsolatedTauJetsSelector ( )

Definition at line 26 of file IsolatedTauJetsSelector.cc.

26 { }

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 28 of file IsolatedTauJetsSelector.cc.

References edm::Event::getByToken(), i, jetSrcToken, pt_min_leadTrack, edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, alignCSCRings::s, reco::LeafCandidate::setPdgId(), useInHLTOpen, and useIsolationDiscriminator.

29 {
30 
31  using namespace reco;
32  using namespace edm;
33  using namespace std;
34 
35  CaloJetCollection * jetCollectionTmp = new CaloJetCollection;
36 // IsolatedTauTagInfoCollection * extendedCollection = new IsolatedTauTagInfoCollection;
37 
38  typedef vector<EDGetTokenT<IsolatedTauTagInfoCollection> > vtag_token;
39  for( vtag_token::const_iterator s = jetSrcToken.begin(); s != jetSrcToken.end(); ++ s ) {
41  iEvent.getByToken( * s, tauJets );
42  IsolatedTauTagInfoCollection::const_iterator i = tauJets->begin();
43  for(;i !=tauJets->end(); i++ ) {
44 
45  if(useInHLTOpen) {
46  const CaloJet* pippo = dynamic_cast<const CaloJet*>((i->jet().get()));
47  CaloJet* mioPippo = const_cast<CaloJet*>(pippo);
48  mioPippo->setPdgId(15);
49  if(mioPippo)
50  jetCollectionTmp->push_back(*mioPippo);
51  // extendedCollection->push_back(*(i)); //to be used later
52  // delete pippo;
53  }else{
54  const TrackRef leadTk = i->leadingSignalTrack();
55  if( !leadTk )
56  {}else{
57  if(leadTk->pt() > pt_min_leadTrack) {
58  float discriminator = i->discriminator();
59  const CaloJet* pippo = dynamic_cast<const CaloJet*>((i->jet().get()));
60  CaloJet* mioPippo = const_cast<CaloJet*>(pippo);
61  mioPippo->setPdgId(15);
62  if(useIsolationDiscriminator && (discriminator > 0) ) {
63  if(mioPippo)
64  jetCollectionTmp->push_back(*mioPippo);
65  // delete pippo;
66  }else if(!useIsolationDiscriminator){
67  if(mioPippo)
68  jetCollectionTmp->push_back(*mioPippo);
69  }
70  }
71  }
72  }
73  }
74  }
75 
76 
77 
78  std::auto_ptr<reco::CaloJetCollection> selectedTaus(jetCollectionTmp);
79 
80  iEvent.put(selectedTaus);
81 
82 
83 }
int i
Definition: DBlmapReader.cc:9
std::vector< edm::EDGetTokenT< reco::IsolatedTauTagInfoCollection > > jetSrcToken
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
virtual void setPdgId(int pdgId) GCC11_FINAL
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects

Member Data Documentation

vtag IsolatedTauJetsSelector::jetSrc
private

Definition at line 25 of file IsolatedTauJetsSelector.h.

Referenced by IsolatedTauJetsSelector().

std::vector<edm::EDGetTokenT<reco::IsolatedTauTagInfoCollection> > IsolatedTauJetsSelector::jetSrcToken
private

Definition at line 26 of file IsolatedTauJetsSelector.h.

Referenced by IsolatedTauJetsSelector(), and produce().

double IsolatedTauJetsSelector::pt_min_leadTrack
private

Definition at line 27 of file IsolatedTauJetsSelector.h.

Referenced by IsolatedTauJetsSelector(), and produce().

bool IsolatedTauJetsSelector::useInHLTOpen
private

Definition at line 28 of file IsolatedTauJetsSelector.h.

Referenced by IsolatedTauJetsSelector(), and produce().

bool IsolatedTauJetsSelector::useIsolationDiscriminator
private

Definition at line 29 of file IsolatedTauJetsSelector.h.

Referenced by IsolatedTauJetsSelector(), and produce().