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  virtual ~CaloJetSlimmer() {}
28 
29  virtual 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:122
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:460
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
int iEvent
Definition: GenABIO.cc:230
float mEnergyFractionEm
Em energy fraction.
Definition: CaloJet.h:73
const std::string cut_
const StringCutObjectSelector< reco::Jet > selector_
CaloJetSlimmer(edm::ParameterSet const &params)
fixed size matrix
virtual ~CaloJetSlimmer()
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
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
def move(src, dest)
Definition: eostools.py:510