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 Member Functions | Private Attributes
TauJetSelectorForHLTTrackSeeding Class Reference

#include <TauJetSelectorForHLTTrackSeeding.h>

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

Public Member Functions

 TauJetSelectorForHLTTrackSeeding (const edm::ParameterSet &)
 
 ~TauJetSelectorForHLTTrackSeeding ()
 
- 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void beginJob ()
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

const double etaMaxCaloJet_
 
const double etaMinCaloJet_
 
const double fractionMaxChargedPUInCaloCone_
 
const double fractionMinCaloInTauCone_
 
const edm::InputTag inputCaloJetTag_
 
const edm::InputTag inputTrackJetTag_
 
const edm::InputTag inputTrackTag_
 
const double isolationConeSize_
 
const int nTrkMaxInCaloCone_
 
const double ptMinCaloJet_
 
const double ptTrkMaxInCaloCone_
 
const double tauConeSize_
 

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 TauJetSelectorForHLTTrackSeeding.h.

Constructor & Destructor Documentation

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

Definition at line 12 of file TauJetSelectorForHLTTrackSeeding.cc.

12  :
13  inputTrackJetTag_(iConfig.getParameter< edm::InputTag > ("inputTrackJetTag")),
14  inputCaloJetTag_(iConfig.getParameter< edm::InputTag > ("inputCaloJetTag")),
15  inputTrackTag_(iConfig.getParameter< edm::InputTag > ("inputTrackTag")),
16  ptMinCaloJet_(iConfig.getParameter< double > ("ptMinCaloJet")),
17  etaMinCaloJet_(iConfig.getParameter< double > ("etaMinCaloJet")),
18  etaMaxCaloJet_(iConfig.getParameter< double > ("etaMaxCaloJet")),
19  tauConeSize_(iConfig.getParameter< double > ("tauConeSize")),
20  isolationConeSize_(iConfig.getParameter< double > ("isolationConeSize")),
21  fractionMinCaloInTauCone_(iConfig.getParameter< double > ("fractionMinCaloInTauCone")),
22  fractionMaxChargedPUInCaloCone_(iConfig.getParameter< double > ("fractionMaxChargedPUInCaloCone")),
23  ptTrkMaxInCaloCone_(iConfig.getParameter< double > ("ptTrkMaxInCaloCone")),
24  nTrkMaxInCaloCone_(iConfig.getParameter< int > ("nTrkMaxInCaloCone"))
25 {
26  //now do what ever initialization is needed
27  produces<reco::TrackJetCollection>();
28 }
T getParameter(std::string const &) const
TauJetSelectorForHLTTrackSeeding::~TauJetSelectorForHLTTrackSeeding ( )

Definition at line 31 of file TauJetSelectorForHLTTrackSeeding.cc.

32 {
33 
34  // do anything here that needs to be done at desctruction time
35  // (e.g. close files, deallocate resources etc.)
36 
37 }

Member Function Documentation

void TauJetSelectorForHLTTrackSeeding::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 149 of file TauJetSelectorForHLTTrackSeeding.cc.

149 {}
void TauJetSelectorForHLTTrackSeeding::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 153 of file TauJetSelectorForHLTTrackSeeding.cc.

153 {}
void TauJetSelectorForHLTTrackSeeding::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 46 of file TauJetSelectorForHLTTrackSeeding.cc.

References SiPixelRawToDigiRegional_cfi::deltaPhi, Geom::deltaR2(), etaMaxCaloJet_, etaMinCaloJet_, fractionMaxChargedPUInCaloCone_, fractionMinCaloInTauCone_, edm::Event::getByLabel(), inputCaloJetTag_, inputTrackJetTag_, inputTrackTag_, isolationConeSize_, nTrkMaxInCaloCone_, p4, phi, ptMinCaloJet_, ptTrkMaxInCaloCone_, edm::Event::put(), tauConeSize_, reco::btau::trackEta, reco::btau::trackPhi, and testEve_cfg::tracks.

47 {
48  std::auto_ptr< reco::TrackJetCollection > augmentedTrackJets (new reco::TrackJetCollection);
49 
51  iEvent.getByLabel(inputTrackJetTag_, trackjets);
52 
53  for (reco::TrackJetCollection::const_iterator trackjet = trackjets->begin();
54  trackjet != trackjets->end(); trackjet++) {
55  augmentedTrackJets->push_back(*trackjet);
56  }
57 
59  iEvent.getByLabel(inputTrackTag_,tracks);
60 
62  iEvent.getByLabel(inputCaloJetTag_,calojets);
63 
64  const double tauConeSize2 = tauConeSize_ * tauConeSize_;
65  const double isolationConeSize2 = isolationConeSize_ * isolationConeSize_;
66 
67  for (reco::CaloJetCollection::const_iterator calojet = calojets->begin();
68  calojet != calojets->end(); calojet++) {
69 
70  if ( calojet->pt() < ptMinCaloJet_ ) continue;
71  double etaJet = calojet->eta();
72  double phiJet = calojet->phi();
73  if ( etaJet < etaMinCaloJet_ ) continue;
74  if ( etaJet > etaMaxCaloJet_ ) continue;
75 
76  std::vector <CaloTowerPtr> const & theTowers = calojet->getCaloConstituents();
77  double ptIn = 0.;
78  double ptOut = 0.;
79  for ( unsigned int itwr = 0; itwr < theTowers.size(); ++itwr ) {
80  double etaTwr = theTowers[itwr]->eta() - etaJet;
81  double phiTwr = deltaPhi(theTowers[itwr]->phi(), phiJet);
82  double deltaR2 = etaTwr*etaTwr + phiTwr*phiTwr;
83  //std::cout << "Tower eta/phi/et : " << etaTwr << " " << phiTwr << " " << theTowers[itwr]->pt() << std::endl;
84  if ( deltaR2 < tauConeSize2 ) {
85  ptIn += theTowers[itwr]->pt();
86  } else if ( deltaR2 < isolationConeSize2 ) {
87  ptOut += theTowers[itwr]->pt();
88  }
89  }
90  double ptTot = ptIn+ptOut;
91  double fracIn = ptIn/ptTot;
92 
93  // We are looking for isolated tracks
94  if ( fracIn < fractionMinCaloInTauCone_) continue;
95 
96  int ntrk = 0;
97  double ptTrk = 0.;
98 
99  for (reco::TrackJetCollection::const_iterator trackjet = trackjets->begin();
100  trackjet != trackjets->end(); trackjet++) {
101  for (unsigned itr=0; itr<trackjet->numberOfTracks(); ++itr) {
102  edm::Ptr<reco::Track> track = trackjet->track(itr);
103  double trackEta = track->eta() - etaJet;
104  double trackPhi = deltaPhi(track->phi(), phiJet);
105  double deltaR2 = trackEta*trackEta + trackPhi*trackPhi;
106  if ( deltaR2 < isolationConeSize2 ) {
107  ntrk++;
108  ptTrk += track->pt();
109  }
110  }
111  }
112  // We are looking for calojets without signal tracks already in
113  if ( ntrk > nTrkMaxInCaloCone_ ) continue;
114  if ( ptTrk > ptTrkMaxInCaloCone_ ) continue;
115 
116  int ntrk2 = 0;
117  double ptTrk2 = 0.;
118 
119  for (reco::TrackCollection::const_iterator track = tracks->begin();
120  track != tracks->end(); track++) {
121  double trackEta = track->eta() - etaJet;
122  double trackPhi = deltaPhi(track->phi(), phiJet);
123  double deltaR2 = trackEta*trackEta + trackPhi*trackPhi;
124  if ( deltaR2 < isolationConeSize2 ) {
125  ntrk2++;
126  ptTrk2 += track->pt();
127  }
128  }
129  // We are looking for signal jets, not PU jets
130  double fractionChargedPU = ptTrk2/calojet->pt();
131  if ( fractionChargedPU > fractionMaxChargedPUInCaloCone_ ) continue;
132  /*
133  std::cout << "Calo Jet " << calojet->pt() << " " << calojet->eta()
134  << " " << ptIn << " " << ptOut << " " << fracIn
135  << " " << ptTrk << " " << ntrk
136  << " " << fractionChargedPU
137  << std::endl;
138  */
139  math::XYZTLorentzVector p4(calojet->p4());
140  math::XYZPoint vertex(calojet->vertex());
141  augmentedTrackJets->push_back(reco::TrackJet(p4,vertex));
142  }
143 
144  iEvent.put(augmentedTrackJets);
145 }
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
double p4[4]
Definition: TauolaWrapper.h:92
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
double deltaR2(const Vector1 &v1, const Vector2 &v2)
Definition: VectorUtil.h:78
Jets made out of tracks.
Definition: TrackJet.h:27
tuple tracks
Definition: testEve_cfg.py:39
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::vector< TrackJet > TrackJetCollection
collection of TrackJet objects
Definition: DDAxes.h:10

Member Data Documentation

const double TauJetSelectorForHLTTrackSeeding::etaMaxCaloJet_
private

Definition at line 35 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const double TauJetSelectorForHLTTrackSeeding::etaMinCaloJet_
private

Definition at line 34 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const double TauJetSelectorForHLTTrackSeeding::fractionMaxChargedPUInCaloCone_
private

Definition at line 39 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const double TauJetSelectorForHLTTrackSeeding::fractionMinCaloInTauCone_
private

Definition at line 38 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const edm::InputTag TauJetSelectorForHLTTrackSeeding::inputCaloJetTag_
private

Definition at line 31 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const edm::InputTag TauJetSelectorForHLTTrackSeeding::inputTrackJetTag_
private

Definition at line 30 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const edm::InputTag TauJetSelectorForHLTTrackSeeding::inputTrackTag_
private

Definition at line 32 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const double TauJetSelectorForHLTTrackSeeding::isolationConeSize_
private

Definition at line 37 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const int TauJetSelectorForHLTTrackSeeding::nTrkMaxInCaloCone_
private

Definition at line 41 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const double TauJetSelectorForHLTTrackSeeding::ptMinCaloJet_
private

Definition at line 33 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const double TauJetSelectorForHLTTrackSeeding::ptTrkMaxInCaloCone_
private

Definition at line 40 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const double TauJetSelectorForHLTTrackSeeding::tauConeSize_
private

Definition at line 36 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().