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 ()
 
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 ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

typedef std::vector
< edm::InputTag
vtag
 

Private Attributes

vtag jetSrc
 
double pt_min_leadTrack
 
bool useInHLTOpen
 
bool useIsolationDiscriminator
 

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
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, pt_min_leadTrack, useInHLTOpen, and useIsolationDiscriminator.

11 {
12 
13  jetSrc = iConfig.getParameter<vtag>("JetSrc");
14  pt_min_leadTrack = iConfig.getParameter<double>("MinimumTransverseMomentumLeadingTrack");
15 useIsolationDiscriminator = iConfig.getParameter<bool>("UseIsolationDiscriminator");
16  useInHLTOpen = iConfig.getParameter<bool>("UseInHLTOpen");
17 
18  produces<reco::CaloJetCollection>();
19  // produces<reco::IsolatedTauTagInfoCollection>();
20 }
T getParameter(std::string const &) const
std::vector< edm::InputTag > vtag
IsolatedTauJetsSelector::~IsolatedTauJetsSelector ( )

Definition at line 22 of file IsolatedTauJetsSelector.cc.

22 { }

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 24 of file IsolatedTauJetsSelector.cc.

References edm::Event::getByLabel(), i, jetSrc, pt_min_leadTrack, edm::Event::put(), L1Trigger_dataformats::reco, alignCSCRings::s, reco::LeafCandidate::setPdgId(), useInHLTOpen, and useIsolationDiscriminator.

25 {
26 
27  using namespace reco;
28  using namespace edm;
29  using namespace std;
30 
31  CaloJetCollection * jetCollectionTmp = new CaloJetCollection;
32 // IsolatedTauTagInfoCollection * extendedCollection = new IsolatedTauTagInfoCollection;
33 
34  for( vtag::const_iterator s = jetSrc.begin(); s != jetSrc.end(); ++ s ) {
36  iEvent.getByLabel( * s, tauJets );
37  IsolatedTauTagInfoCollection::const_iterator i = tauJets->begin();
38  for(;i !=tauJets->end(); i++ ) {
39 
40  if(useInHLTOpen) {
41  const CaloJet* pippo = dynamic_cast<const CaloJet*>((i->jet().get()));
42  CaloJet* mioPippo = const_cast<CaloJet*>(pippo);
43  mioPippo->setPdgId(15);
44  if(mioPippo)
45  jetCollectionTmp->push_back(*mioPippo);
46  // extendedCollection->push_back(*(i)); //to be used later
47  // delete pippo;
48  }else{
49  const TrackRef leadTk = i->leadingSignalTrack();
50  if( !leadTk )
51  {}else{
52  if(leadTk->pt() > pt_min_leadTrack) {
53  float discriminator = i->discriminator();
54  const CaloJet* pippo = dynamic_cast<const CaloJet*>((i->jet().get()));
55  CaloJet* mioPippo = const_cast<CaloJet*>(pippo);
56  mioPippo->setPdgId(15);
57  if(useIsolationDiscriminator && (discriminator > 0) ) {
58  if(mioPippo)
59  jetCollectionTmp->push_back(*mioPippo);
60  // delete pippo;
61  }else if(!useIsolationDiscriminator){
62  if(mioPippo)
63  jetCollectionTmp->push_back(*mioPippo);
64  }
65  }
66  }
67  }
68  }
69  }
70 
71 
72 
73  std::auto_ptr<reco::CaloJetCollection> selectedTaus(jetCollectionTmp);
74 
75  iEvent.put(selectedTaus);
76 
77 
78 }
int i
Definition: DBlmapReader.cc:9
Jets made from CaloTowers.
Definition: CaloJet.h:30
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
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(), and produce().

double IsolatedTauJetsSelector::pt_min_leadTrack
private

Definition at line 26 of file IsolatedTauJetsSelector.h.

Referenced by IsolatedTauJetsSelector(), and produce().

bool IsolatedTauJetsSelector::useInHLTOpen
private

Definition at line 27 of file IsolatedTauJetsSelector.h.

Referenced by IsolatedTauJetsSelector(), and produce().

bool IsolatedTauJetsSelector::useIsolationDiscriminator
private

Definition at line 28 of file IsolatedTauJetsSelector.h.

Referenced by IsolatedTauJetsSelector(), and produce().