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::ProductRegistryHelper

Public Member Functions

 IsolatedTauJetsSelector (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~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 &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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 
)
virtual

Implements edm::EDProducer.

Definition at line 24 of file IsolatedTauJetsSelector.cc.

References edm::Event::getByLabel(), i, jetSrc, pt_min_leadTrack, edm::Event::put(), dt_dqm_sourceclient_common_cff::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:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
virtual void setPdgId(int pdgId)
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().