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

#include <HLTTauProducer.h>

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

Public Member Functions

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

edm::InputTag emIsolatedJetsL2_
 
double isolationCone_
 
double matchingCone_
 
double ptMin_
 
double ptMinLeadTk_
 
double rmax_
 
double rmin_
 
double signalCone_
 
edm::InputTag trackIsolatedJetsL25_
 
edm::InputTag trackIsolatedJetsL3_
 

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

Constructor & Destructor Documentation

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

Definition at line 8 of file HLTTauProducer.cc.

References emIsolatedJetsL2_, edm::ParameterSet::getParameter(), isolationCone_, matchingCone_, ptMin_, signalCone_, trackIsolatedJetsL25_, and trackIsolatedJetsL3_.

9 {
10  emIsolatedJetsL2_ = iConfig.getParameter<edm::InputTag>("L2EcalIsoJets");
11  trackIsolatedJetsL25_ = iConfig.getParameter<edm::InputTag>("L25TrackIsoJets");
12  trackIsolatedJetsL3_ = iConfig.getParameter<edm::InputTag>("L3TrackIsoJets");
13  matchingCone_ = iConfig.getParameter<double>("MatchingCone");
14  signalCone_ = iConfig.getParameter<double>("SignalCone");
15  isolationCone_ = iConfig.getParameter<double>("IsolationCone");
16  ptMin_ = iConfig.getParameter<double>("MinPtTracks");
17  produces<reco::HLTTauCollection>();
18 }
T getParameter(std::string const &) const
double isolationCone_
edm::InputTag trackIsolatedJetsL3_
double matchingCone_
edm::InputTag trackIsolatedJetsL25_
edm::InputTag emIsolatedJetsL2_
HLTTauProducer::~HLTTauProducer ( )

Definition at line 20 of file HLTTauProducer.cc.

20 { }

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 22 of file HLTTauProducer.cc.

References reco::L2TauIsolationInfo::ecalClusterShape(), reco::L2TauIsolationInfo::ecalIsolEt(), emIsolatedJetsL2_, edm::Event::getByLabel(), reco::L2TauIsolationInfo::hcalClusterShape(), reco::L2TauIsolationInfo::hcalIsolEt(), i, isolationCone_, j, matchingCone_, reco::L2TauIsolationInfo::nEcalHits(), reco::L2TauIsolationInfo::nHcalHits(), AlCaHLTBitMon_ParallelJobs::p, ptMin_, edm::Event::put(), L1Trigger_dataformats::reco, reco::L2TauIsolationInfo::seedEcalHitEt(), reco::L2TauIsolationInfo::seedHcalHitEt(), reco::HLTTau::setEcalClusterShape(), reco::HLTTau::setHcalClusterShape(), reco::HLTTau::setHcalIsolEt(), reco::HLTTau::setNEcalHits(), reco::HLTTau::setNHcalHits(), reco::HLTTau::setNL25TrackIsolation(), reco::HLTTau::setNL3TrackIsolation(), reco::HLTTau::setSeedEcalHitEt(), reco::HLTTau::setSeedHcalHitEt(), reco::HLTTau::setSumPtTracksL25(), reco::HLTTau::setSumPtTracksL3(), signalCone_, edm::RefVector< C, T, F >::size(), trackIsolatedJetsL25_, and trackIsolatedJetsL3_.

23 {
24 
25  using namespace reco;
26  using namespace edm;
27  using namespace std;
28 
29 
30  HLTTauCollection * jetCollection = new HLTTauCollection;
31 
33  iEvent.getByLabel(emIsolatedJetsL2_ , tauL2Jets );
34 
36  iEvent.getByLabel(trackIsolatedJetsL25_, tauL25Jets );
37 
39  iEvent.getByLabel(trackIsolatedJetsL3_, tauL3Jets );
40 
41  IsolatedTauTagInfoCollection tauL25 = *(tauL25Jets.product());
42  IsolatedTauTagInfoCollection tauL3 = *(tauL3Jets.product());
43 
44  int i=0;
45  float eta_, phi_, pt_;
46  int nTracksL25, nTracksL3;
47  float sumPtTracksL25 = 1000.;
48  float sumPtTracksL3 = 1000.;
49  double ptLeadTkL25=0.;
50  double ptLeadTkL3=0.;
51  for(L2TauInfoAssociation::const_iterator p = tauL2Jets->begin();p!=tauL2Jets->end();++p)
52  {
53  //Retrieve The L2TauIsolationInfo Class from the AssociationMap
54  const L2TauIsolationInfo l2info = p->val;
55  //Retrieve the Jet
56  // const CaloJet& jet =*(p->key);
57 
58 
59  double emIsol = l2info.ecalIsolEt();
60 
61  JetTracksAssociationRef jetTracks = tauL25[i].jtaRef();
62  math::XYZVector jetDirL25(jetTracks->first->px(),jetTracks->first->py(),jetTracks->first->pz());
63  eta_ = jetDirL25.eta();
64  phi_ = jetDirL25.phi();
65  pt_ = jetTracks->first->pt();
66 
67  int trackIsolationL25 = (int)tauL25[i].discriminator(jetDirL25,matchingCone_, signalCone_, isolationCone_,1.,ptMin_,0);
68  const TrackRef leadTkL25 = tauL25[i].leadingSignalTrack(jetDirL25,matchingCone_, 1.);
69  ptLeadTkL25 = 0.;
70  nTracksL25 = 1000;
71  if(!leadTkL25)
72  {}else{
73  ptLeadTkL25 = (*leadTkL25).pt();
74  const TrackRefVector signalTracks = tauL25[i].tracksInCone((*leadTkL25).momentum(), signalCone_, ptMin_ );
75  const TrackRefVector isolationTracks = tauL25[i].tracksInCone((*leadTkL25).momentum(), isolationCone_, ptMin_ );
76  nTracksL25 = isolationTracks.size() - signalTracks.size();
77 
78  for(unsigned int j=0;j<isolationTracks.size();j++)
79  sumPtTracksL25 = sumPtTracksL25 + isolationTracks[j]->pt();
80  for(unsigned int j=0;j<signalTracks.size();j++)
81  sumPtTracksL25 = sumPtTracksL25 - signalTracks[j]->pt();
82 
83  }
84  jetTracks = tauL3[i].jtaRef();
85  math::XYZVector jetDirL3(jetTracks->first->px(),jetTracks->first->py(),jetTracks->first->pz());
86  int trackIsolationL3 = (int)tauL3[i].discriminator(jetDirL3,matchingCone_, signalCone_, isolationCone_,1.,ptMin_,0);
87 
88  const TrackRef leadTkL3 = tauL3[i].leadingSignalTrack(jetDirL3,matchingCone_,1.);
89  ptLeadTkL3=0.;
90  nTracksL3 = 1000;
91  if(!leadTkL3)
92  {}else{
93  ptLeadTkL3 = (*leadTkL3).pt();
94  const TrackRefVector signalTracks = tauL3[i].tracksInCone((*leadTkL25).momentum(), signalCone_, ptMin_ );
95  const TrackRefVector isolationTracks = tauL3[i].tracksInCone((*leadTkL25).momentum(), isolationCone_, ptMin_ );
96  nTracksL3 = isolationTracks.size() - signalTracks.size();
97  float sumPtTracksL3 = 0.;
98  for(unsigned int j=0;j<isolationTracks.size();j++)
99  sumPtTracksL3 = sumPtTracksL3 + isolationTracks[j]->pt();
100  for(unsigned int j=0;j<signalTracks.size();j++)
101  sumPtTracksL3 = sumPtTracksL3 - signalTracks[j]->pt();
102  }
103 
104  HLTTau pippo(eta_,phi_,pt_,emIsol,trackIsolationL25,ptLeadTkL25,trackIsolationL3,ptLeadTkL3);
105  pippo.setNL25TrackIsolation(nTracksL25);
106  pippo.setNL3TrackIsolation(nTracksL3);
107  pippo.setSumPtTracksL25(sumPtTracksL25);
108  pippo.setSumPtTracksL3(sumPtTracksL3);
109  pippo.setSeedEcalHitEt(l2info.seedEcalHitEt());
110  pippo.setEcalClusterShape(l2info.ecalClusterShape());
111  pippo.setNEcalHits(l2info.nEcalHits());
112  pippo.setHcalIsolEt(l2info.hcalIsolEt());
113  pippo.setSeedHcalHitEt(l2info.seedHcalHitEt());
114  pippo.setHcalClusterShape(l2info.hcalClusterShape());
115  pippo.setNHcalHits(l2info.nHcalHits());
116  jetCollection->push_back(pippo);
117  i++;
118  }
119 
120  std::auto_ptr<reco::HLTTauCollection> selectedTaus(jetCollection);
121 
122  iEvent.put(selectedTaus);
123 
124 
125 
126 
127 }
int i
Definition: DBlmapReader.cc:9
double isolationCone_
std::vector< double > hcalClusterShape() const
edm::InputTag trackIsolatedJetsL3_
double matchingCone_
edm::InputTag trackIsolatedJetsL25_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
edm::InputTag emIsolatedJetsL2_
int j
Definition: DBlmapReader.cc:9
std::vector< HLTTau > HLTTauCollection
collection of HLTTau objects
Definition: HLTTauFwd.h:9
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
size_type size() const
Size of the RefVector.
Definition: RefVector.h:89
std::vector< double > ecalClusterShape() const

Member Data Documentation

edm::InputTag HLTTauProducer::emIsolatedJetsL2_
private

Definition at line 25 of file HLTTauProducer.h.

Referenced by HLTTauProducer(), and produce().

double HLTTauProducer::isolationCone_
private

Definition at line 28 of file HLTTauProducer.h.

Referenced by HLTTauProducer(), and produce().

double HLTTauProducer::matchingCone_
private

Definition at line 28 of file HLTTauProducer.h.

Referenced by HLTTauProducer(), and produce().

double HLTTauProducer::ptMin_
private

Definition at line 28 of file HLTTauProducer.h.

Referenced by HLTTauProducer(), and produce().

double HLTTauProducer::ptMinLeadTk_
private

Definition at line 28 of file HLTTauProducer.h.

double HLTTauProducer::rmax_
private

Definition at line 28 of file HLTTauProducer.h.

double HLTTauProducer::rmin_
private

Definition at line 28 of file HLTTauProducer.h.

double HLTTauProducer::signalCone_
private

Definition at line 28 of file HLTTauProducer.h.

Referenced by HLTTauProducer(), and produce().

edm::InputTag HLTTauProducer::trackIsolatedJetsL25_
private

Definition at line 26 of file HLTTauProducer.h.

Referenced by HLTTauProducer(), and produce().

edm::InputTag HLTTauProducer::trackIsolatedJetsL3_
private

Definition at line 27 of file HLTTauProducer.h.

Referenced by HLTTauProducer(), and produce().