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

Public Member Functions

 TauJetSelectorForHLTTrackSeeding (const edm::ParameterSet &)
 
 ~TauJetSelectorForHLTTrackSeeding ()
 
- 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 Member Functions

virtual void beginJob ()
 
virtual void beginRun (edm::Run &, edm::EventSetup const &)
 
virtual void endJob ()
 
virtual void endRun (edm::Run &, edm::EventSetup const &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 

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
 
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 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::beginRun ( edm::Run ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 157 of file TauJetSelectorForHLTTrackSeeding.cc.

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

Reimplemented from edm::EDProducer.

Definition at line 153 of file TauJetSelectorForHLTTrackSeeding.cc.

153 {}
void TauJetSelectorForHLTTrackSeeding::endRun ( edm::Run ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 161 of file TauJetSelectorForHLTTrackSeeding.cc.

161 {}
void TauJetSelectorForHLTTrackSeeding::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

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:30
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
double p4[4]
Definition: TauolaWrapper.h:92
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
double deltaR2(const Vector1 &v1, const Vector2 &v2)
Definition: VectorUtil.h:78
Jets made out of tracks.
Definition: TrackJet.h:28
tuple tracks
Definition: testEve_cfg.py:39
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
std::vector< TrackJet > TrackJetCollection
collection of TrackJet objects
Definition: DDAxes.h:10

Member Data Documentation

const double TauJetSelectorForHLTTrackSeeding::etaMaxCaloJet_
private

Definition at line 38 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const double TauJetSelectorForHLTTrackSeeding::etaMinCaloJet_
private

Definition at line 37 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const double TauJetSelectorForHLTTrackSeeding::fractionMaxChargedPUInCaloCone_
private

Definition at line 42 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const double TauJetSelectorForHLTTrackSeeding::fractionMinCaloInTauCone_
private

Definition at line 41 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const edm::InputTag TauJetSelectorForHLTTrackSeeding::inputCaloJetTag_
private

Definition at line 34 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const edm::InputTag TauJetSelectorForHLTTrackSeeding::inputTrackJetTag_
private

Definition at line 33 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const edm::InputTag TauJetSelectorForHLTTrackSeeding::inputTrackTag_
private

Definition at line 35 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const double TauJetSelectorForHLTTrackSeeding::isolationConeSize_
private

Definition at line 40 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const int TauJetSelectorForHLTTrackSeeding::nTrkMaxInCaloCone_
private

Definition at line 44 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const double TauJetSelectorForHLTTrackSeeding::ptMinCaloJet_
private

Definition at line 36 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const double TauJetSelectorForHLTTrackSeeding::ptTrkMaxInCaloCone_
private

Definition at line 43 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

const double TauJetSelectorForHLTTrackSeeding::tauConeSize_
private

Definition at line 39 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().