CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DQMTauProducer.cc
Go to the documentation of this file.
3 //
4 // class decleration
5 //
6 
9  consumes<reco::IsolatedTauTagInfoCollection>(iConfig.getParameter<edm::InputTag>("TrackIsoJets"));
10  matchingCone_ = iConfig.getParameter<double>("MatchingCone");
11  signalCone_ = iConfig.getParameter<double>("SignalCone");
12  ptMin_ = iConfig.getParameter<double>("MinPtTracks");
13 
14  isolationCone_ = iConfig.getParameter<double>("IsolationCone");
15  produces<reco::HLTTauCollection>();
16 }
17 
19 
21  using namespace reco;
22  using namespace edm;
23  using namespace std;
24 
25  HLTTauCollection* jetCollection = new HLTTauCollection;
26 
28  iEvent.getByToken(trackIsolatedJets_, tauL25Jets);
29 
30  IsolatedTauTagInfoCollection tau = *(tauL25Jets.product());
31 
32  float eta_, phi_, pt_;
33  float ptLeadTk = 0.;
34  int trackIsolation = 1000.;
35  int nTracks = 1000.;
36 
37  for (unsigned int i = 0; i < tau.size(); i++) {
39  math::XYZVector jetDir(jetTracks->first->px(), jetTracks->first->py(), jetTracks->first->pz());
40  eta_ = jetDir.eta();
41  phi_ = jetDir.phi();
42  pt_ = jetTracks->first->pt();
43 
44  const TrackRef leadTk = tau[i].leadingSignalTrack(jetDir, matchingCone_, 1.);
45  if (!leadTk) {
46  } else {
47  trackIsolation = (int)tau[i].discriminator(jetDir, matchingCone_, signalCone_, isolationCone_, 1., 1., 0);
48  ptLeadTk = (*leadTk).pt();
49  nTracks = (tau[i].tracksInCone((*leadTk).momentum(), isolationCone_, ptMin_)).size() -
50  (tau[i].tracksInCone((*leadTk).momentum(), signalCone_, ptMin_)).size();
51  }
52  HLTTau pippo(eta_, phi_, pt_, -1, trackIsolation, ptLeadTk, trackIsolation, ptLeadTk);
55  jetCollection->push_back(pippo);
56  }
57 
58  std::unique_ptr<reco::HLTTauCollection> selectedTaus(jetCollection);
59 
60  iEvent.put(std::move(selectedTaus));
61 }
DQMTauProducer(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< reco::IsolatedTauTagInfoCollection > trackIsolatedJets_
tuple discriminator
double isolationCone_
int iEvent
Definition: GenABIO.cc:224
double matchingCone_
void setNL25TrackIsolation(int nTracks)
Definition: HLTTau.h:67
std::vector< IsolatedTauTagInfo > IsolatedTauTagInfoCollection
def move
Definition: eostools.py:511
std::vector< HLTTau > HLTTauCollection
collection of HLTTau objects
Definition: HLTTauFwd.h:9
void produce(edm::Event &, const edm::EventSetup &) override
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
~DQMTauProducer() override
void setNL3TrackIsolation(int nTracks)
Definition: HLTTau.h:68