-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JPT_TrackJets seed reco and PAT rereco 11_2_x based #30188
Changes from all commits
d26f82d
64ff2b8
f7ff65e
d8df825
620d7e7
1caafe3
3ebe833
3e4f489
d3fc790
fa5a5cb
4139cd4
6ecfa54
a0b5fa6
84a0c65
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,16 +1,25 @@ | ||||
<export> | ||||
</export> | ||||
<library file="*.cc" name="RecoJetsJetPlusTracks_plugins"> | ||||
<use name="CondFormats/JetMETObjects"/> | ||||
<use name="DataFormats/Common"/> | ||||
<use name="DataFormats/EgammaCandidates"/> | ||||
<use name="DataFormats/JetReco"/> | ||||
<use name="DataFormats/Math"/> | ||||
<use name="DataFormats/MuonReco"/> | ||||
<use name="DataFormats/TrackReco"/> | ||||
<use name="FWCore/Framework"/> | ||||
<use name="FWCore/ParameterSet"/> | ||||
<use name="FWCore/PluginManager"/> | ||||
<use name="boost"/> | ||||
<flags EDM_PLUGIN="1"/> | ||||
<library file="*.cc" name="RecoJetsJetPlusTracks_plugins"> | ||||
<use name="CondFormats/JetMETObjects"/> | ||||
<use name="DataFormats/CaloTowers"/> | ||||
<use name="DataFormats/Candidate"/> | ||||
<use name="DataFormats/Common"/> | ||||
<use name="DataFormats/DetId"/> | ||||
<use name="DataFormats/EgammaReco"/> | ||||
<use name="DataFormats/EgammaCandidates"/> | ||||
<use name="EgammaAnalysis/ElectronTools"/> | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
not used in this PR => should not be needed |
||||
<use name="DataFormats/JetReco"/> | ||||
<use name="DataFormats/Math"/> | ||||
<use name="DataFormats/MuonReco"/> | ||||
<use name="DataFormats/Provenance"/> | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
newly added, but apparently not used in this PR => can drop |
||||
<use name="DataFormats/TrackReco"/> | ||||
<use name="DataFormats/VertexReco"/> | ||||
<use name="FWCore/Framework"/> | ||||
<use name="FWCore/ParameterSet"/> | ||||
<use name="Geometry/Records"/> | ||||
<use name="Geometry/TrackerGeometryBuilder"/> | ||||
<use name="RecoEgamma/EgammaTools"/> | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
newly added, but apparently not used in this PR => can drop |
||||
<use name="FWCore/PluginManager"/> | ||||
<flags EDM_PLUGIN="1"/> | ||||
</library> |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,204 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// -*- C++ -*- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Package: JetPlusTracks | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Class: JetPlusTrackProducer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/**\class JetPlusTrackProducer JetPlusTrackProducer.cc JetPlusTrackProducer.cc | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+4
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this does not match the actual class name; please update |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description: [one line class summary] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Implementation: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[Notes on implementation] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Original Author: Olga Kodolova,40 R-A12,+41227671273, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Created: Fri Feb 19 10:14:02 CET 2010 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// system include files | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <memory> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// user include files | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "FWCore/Framework/interface/MakerMacros.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "RecoJets/JetPlusTracks/plugins/JetPlusTrackAddonSeedProducer.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/JetReco/interface/CaloJetCollection.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/JetReco/interface/CaloJet.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/JetReco/interface/JPTJetCollection.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/JetReco/interface/JPTJet.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/JetReco/interface/TrackJetCollection.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/JetReco/interface/TrackJet.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/TrackReco/interface/TrackFwd.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/TrackReco/interface/Track.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/JetReco/interface/Jet.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/VertexReco/interface/VertexFwd.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/VertexReco/interface/Vertex.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/Math/interface/deltaPhi.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/Math/interface/deltaR.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <string> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
using namespace std; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// constants, enums and typedefs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// static data member definitions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// constructors and destructor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
JetPlusTrackAddonSeedProducer::JetPlusTrackAddonSeedProducer(const edm::ParameterSet& iConfig) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
//register your products | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
srcCaloJets = iConfig.getParameter<edm::InputTag>("srcCaloJets"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
srcTrackJets = iConfig.getParameter<edm::InputTag>("srcTrackJets"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
srcPVs_ = iConfig.getParameter<edm::InputTag>("srcPVs"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ptCUT = iConfig.getParameter<double>("ptCUT"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dRcone = iConfig.getParameter<double>("dRcone"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
usePAT = iConfig.getParameter<bool>("UsePAT"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
produces<reco::CaloJetCollection>("ak4CaloJetsJPTSeed"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
input_jets_token_ = consumes<edm::View<reco::CaloJet> >(srcCaloJets); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
input_trackjets_token_ = consumes<edm::View<reco::TrackJet> >(srcTrackJets); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
input_vertex_token_ = consumes<reco::VertexCollection>(srcPVs_); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
tokenPFCandidates_ = consumes<pat::PackedCandidateCollection>(iConfig.getParameter<edm::InputTag>("PFCandidates")); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
input_ctw_token_ = consumes<CaloTowerCollection>(iConfig.getParameter<edm::InputTag>("towerMaker")); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+58
to
+74
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
JetPlusTrackAddonSeedProducer::~JetPlusTrackAddonSeedProducer() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// do anything here that needs to be done at desctruction time | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// (e.g. close files, deallocate resources etc.) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+76
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
please remove this empty/unnecessary method |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// member functions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// ------------ method called to produce the data ------------ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
void JetPlusTrackAddonSeedProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
using namespace edm; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// get stuff from Event | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
edm::Handle<edm::View<reco::CaloJet> > jets_h; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
iEvent.getByToken(input_jets_token_, jets_h); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+89
to
+90
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
edm::Handle<edm::View<reco::TrackJet> > jetsTrackJets; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
iEvent.getByToken(input_trackjets_token_, jetsTrackJets); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+92
to
+93
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
auto pCaloOut = std::make_unique<reco::CaloJetCollection>(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (jetsTrackJets.isValid()) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (!jetsTrackJets->empty()) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+97
to
+98
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
remove the checks: the reco setup should be configured properly to not need silent skips of unavailable collections. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for (unsigned ijet = 0; ijet < jetsTrackJets->size(); ++ijet) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const reco::TrackJet* jet = &(*(jetsTrackJets->refAt(ijet))); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+99
to
+100
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
then change |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
int iflag = 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for (unsigned i = 0; i < jets_h->size(); ++i) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const reco::CaloJet* oldjet = &(*(jets_h->refAt(i))); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+102
to
+103
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
then use |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
double dr = deltaR(jet->eta(), jet->phi(), oldjet->eta(), oldjet->phi()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (dr < dRcone) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+104
to
+105
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
iflag = 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} // Calojets | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (iflag == 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
continue; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
double caloen = 0.; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
double hadinho = 0.; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
double hadinhb = 0.; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
double hadinhe = 0.; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
double hadinhf = 0.; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
double emineb = 0.; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
double eminee = 0.; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
double eminhf = 0.; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
double eefraction = 0.; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
double hhfraction = 0.; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
int ncand = 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (usePAT) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
edm::Handle<pat::PackedCandidateCollection> pfCandidates; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
iEvent.getByToken(tokenPFCandidates_, pfCandidates); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (!pfCandidates.isValid()) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+124
to
+128
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for (unsigned int i = 0, n = pfCandidates->size(); i < n; ++i) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const pat::PackedCandidate& pf = (*pfCandidates)[i]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+129
to
+130
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
double dr = deltaR(jet->eta(), jet->phi(), pf.eta(), pf.phi()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (dr > dRcone) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+131
to
+132
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
this is faster |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
continue; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// jetconstit | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
caloen = caloen + pf.energy() * pf.caloFraction(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hadinho += 0.; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (fabs(pf.eta()) <= 1.4) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hadinhb += pf.energy() * pf.caloFraction() * pf.hcalFraction(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (fabs(pf.eta()) < 3. && (fabs(pf.eta()) > 3.) > 1.4) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it looks like a bug here |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hadinhe += pf.energy() * pf.caloFraction() * pf.hcalFraction(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (fabs(pf.eta()) >= 3.) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hadinhf += pf.energy() * pf.caloFraction() * pf.hcalFraction(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (fabs(pf.eta()) <= 1.4) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
emineb += pf.energy() * pf.caloFraction() * (1. - pf.hcalFraction()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (fabs(pf.eta()) < 3. && (fabs(pf.eta()) > 3.) > 1.4) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
eminee += pf.energy() * pf.caloFraction() * (1. - pf.hcalFraction()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (fabs(pf.eta()) >= 3.) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
eminhf += pf.energy() * pf.caloFraction() * (1. - pf.hcalFraction()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+137
to
+148
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ncand++; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} // Calojet | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
edm::Handle<CaloTowerCollection> ct; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
iEvent.getByToken(input_ctw_token_, ct); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (ct.isValid()) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for (CaloTowerCollection::const_iterator it = ct->begin(); it != ct->end(); it++) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+153
to
+156
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
and then replace |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
double dr = deltaR(jet->eta(), jet->phi(), (*it).eta(), (*it).phi()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (dr > dRcone) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+157
to
+158
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
continue; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
caloen = caloen + (*it).energy(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hadinho += (*it).energyInHO(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hadinhb += (*it).energyInHB(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hadinhe += (*it).energyInHE(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hadinhf += 0.5 * (*it).energyInHF(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
emineb += (*it).energy() - (*it).energyInHB(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
eminee += (*it).energy() - (*it).energyInHE(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
eminhf += 0.5 * (*it).energyInHF(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ncand++; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
eefraction = (emineb + eminee) / caloen; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hhfraction = (hadinhb + hadinhe + hadinhf + hadinho) / caloen; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
double trackp = sqrt(pow(jet->pt(), 2) + pow(jet->pz(), 2)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (caloen <= 0.) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
caloen = 0.001; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
math::XYZTLorentzVector pcalo4( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
caloen * jet->px() / trackp, caloen * jet->py() / trackp, caloen * jet->pz() / trackp, caloen); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+178
to
+179
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wouldn't this work here:
Suggested change
my version changes the mass linearly from the original trackjet by caloen/trackp, but your version makes a pcalo4 with zero mass, which seems odd for jets. Is this zeroing of the mass intended? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
reco::CaloJet::Specific calospe; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
calospe.mTowersArea = -1 * ncand; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
calospe.mHadEnergyInHO = hadinho; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
calospe.mHadEnergyInHB = hadinhb; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
calospe.mHadEnergyInHE = hadinhe; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
calospe.mHadEnergyInHF = hadinhf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
calospe.mEmEnergyInEB = emineb; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
calospe.mEmEnergyInEE = eminee; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
calospe.mEmEnergyInHF = eminhf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
calospe.mEnergyFractionEm = eefraction / caloen; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
calospe.mEnergyFractionHadronic = hhfraction / caloen; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
reco::CaloJet mycalo(pcalo4, jet->primaryVertex()->position(), calospe); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mycalo.setJetArea(M_PI * dRcone * dRcone); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pCaloOut->push_back(mycalo); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} // trackjets | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} // jets | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} // There is trackjet collection | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
iEvent.put(std::move(pCaloOut), "ak4CaloJetsJPTSeed"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
//define this as a plug-in | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DEFINE_FWK_MODULE(JetPlusTrackAddonSeedProducer); |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,67 @@ | ||||||||||||||||||||||||||||||||||||||||||
// -*- C++ -*- | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please merge contents of this file in RecoJets/JetPlusTracks/plugins/JetPlusTrackAddonSeedProducer.cc |
||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||
// Package: JetPlusTracks | ||||||||||||||||||||||||||||||||||||||||||
// Class: JetPlusTrackProducer | ||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||
/**\class JetPlusTrackProducer JetPlusTrackProducer.cc JetPlusTrackProducer.cc | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
Description: [one line class summary] | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
Implementation: | ||||||||||||||||||||||||||||||||||||||||||
[Notes on implementation] | ||||||||||||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||
// Original Author: Olga Kodolova,40 R-A12,+41227671273, | ||||||||||||||||||||||||||||||||||||||||||
// Created: Fri Feb 19 10:14:02 CET 2010 | ||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
// system include files | ||||||||||||||||||||||||||||||||||||||||||
#include <memory> | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
// user include files | ||||||||||||||||||||||||||||||||||||||||||
#include "FWCore/Framework/interface/Frameworkfwd.h" | ||||||||||||||||||||||||||||||||||||||||||
#include "FWCore/Framework/interface/stream/EDProducer.h" | ||||||||||||||||||||||||||||||||||||||||||
#include "FWCore/Framework/interface/Event.h" | ||||||||||||||||||||||||||||||||||||||||||
#include "FWCore/Framework/interface/MakerMacros.h" | ||||||||||||||||||||||||||||||||||||||||||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/JetReco/interface/CaloJet.h" | ||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/JetReco/interface/TrackJet.h" | ||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/VertexReco/interface/Vertex.h" | ||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/JetReco/interface/TrackExtrapolation.h" | ||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/PatCandidates/interface/Electron.h" | ||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/PatCandidates/interface/Jet.h" | ||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/PatCandidates/interface/PackedCandidate.h" | ||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" | ||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/PatCandidates/interface/VIDCutFlowResult.h" | ||||||||||||||||||||||||||||||||||||||||||
#include "DataFormats/PatCandidates/interface/Muon.h" | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
#include <string> | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||
// class declaration | ||||||||||||||||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
class JetPlusTrackAddonSeedProducer : public edm::stream::EDProducer<> { | ||||||||||||||||||||||||||||||||||||||||||
public: | ||||||||||||||||||||||||||||||||||||||||||
explicit JetPlusTrackAddonSeedProducer(const edm::ParameterSet&); | ||||||||||||||||||||||||||||||||||||||||||
~JetPlusTrackAddonSeedProducer() override; | ||||||||||||||||||||||||||||||||||||||||||
void produce(edm::Event&, const edm::EventSetup&) override; | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. new modules should have a fillDescriptions method defined https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideConfigurationValidationAndHelp |
||||||||||||||||||||||||||||||||||||||||||
// ---------- private data members --------------------------- | ||||||||||||||||||||||||||||||||||||||||||
private: | ||||||||||||||||||||||||||||||||||||||||||
edm::InputTag srcCaloJets; | ||||||||||||||||||||||||||||||||||||||||||
edm::InputTag srcTrackJets; | ||||||||||||||||||||||||||||||||||||||||||
edm::InputTag srcPVs_; | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
std::string alias; | ||||||||||||||||||||||||||||||||||||||||||
double ptCUT; | ||||||||||||||||||||||||||||||||||||||||||
double dRcone; | ||||||||||||||||||||||||||||||||||||||||||
bool usePAT; | ||||||||||||||||||||||||||||||||||||||||||
edm::EDGetTokenT<edm::View<reco::CaloJet> > input_jets_token_; | ||||||||||||||||||||||||||||||||||||||||||
edm::EDGetTokenT<edm::View<reco::TrackJet> > input_trackjets_token_; | ||||||||||||||||||||||||||||||||||||||||||
edm::EDGetTokenT<reco::VertexCollection> input_vertex_token_; | ||||||||||||||||||||||||||||||||||||||||||
edm::EDGetTokenT<std::vector<pat::PackedCandidate> > tokenPFCandidates_; | ||||||||||||||||||||||||||||||||||||||||||
edm::EDGetTokenT<CaloTowerCollection> input_ctw_token_; | ||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+54
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please restore this file formatting as it was in 11_2_X before this PR.