CMS 3D CMS Logo

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