CMS 3D CMS Logo

CaloJetSlimmer.cc
Go to the documentation of this file.
1 
4 
9 
12 
13 #include <vector>
14 
16 public:
18  : srcToken_(consumes<edm::View<reco::CaloJet> >(params.getParameter<edm::InputTag>("src"))),
19  cut_(params.getParameter<std::string>("cut")),
20  selector_(cut_) {
21  produces<reco::CaloJetCollection>();
22  }
23 
24  ~CaloJetSlimmer() override {}
25 
26  void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override {
27  auto caloJets = std::make_unique<reco::CaloJetCollection>();
28 
30  iEvent.getByToken(srcToken_, h_jets);
31 
32  for (auto const& ijet : *h_jets) {
33  if (selector_(ijet)) {
34  reco::CaloJet::Specific tmp_specific;
35  const reco::Candidate::Point orivtx(0, 0, 0);
36  tmp_specific.mEnergyFractionEm = ijet.emEnergyFraction();
37  tmp_specific.mEnergyFractionHadronic = ijet.energyFractionHadronic();
38  reco::CaloJet newCaloJet(ijet.p4(), orivtx, tmp_specific);
39  float jetArea = ijet.jetArea();
40  newCaloJet.setJetArea(jetArea);
41  caloJets->push_back(newCaloJet);
42  }
43  }
44  iEvent.put(std::move(caloJets), "");
45  }
46 
47 protected:
51 };
52 
Jets made from CaloTowers.
Definition: CaloJet.h:27
float mEnergyFractionHadronic
Hadronic energy fraction.
Definition: CaloJet.h:66
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
virtual float jetArea() const
get jet area
Definition: Jet.h:103
int iEvent
Definition: GenABIO.cc:224
float mEnergyFractionEm
Em energy fraction.
Definition: CaloJet.h:68
const std::string cut_
~CaloJetSlimmer() override
const StringCutObjectSelector< reco::Jet > selector_
CaloJetSlimmer(edm::ParameterSet const &params)
fixed size matrix
HLT enums.
const edm::EDGetTokenT< edm::View< reco::CaloJet > > srcToken_
math::XYZPoint Point
point in the space
Definition: Candidate.h:40
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
def move(src, dest)
Definition: eostools.py:511