CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
BJetEnergyRegressionVarProducer< T > Class Template Reference

#include <PhysicsTools/NanoAOD/plugins/BJetEnergyRegressionVarProducer.cc>

Inheritance diagram for BJetEnergyRegressionVarProducer< T >:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 BJetEnergyRegressionVarProducer (const edm::ParameterSet &iConfig)
 
 ~BJetEnergyRegressionVarProducer () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

std::tuple< float, float, float > calculatePtRatioRel (edm::Ptr< reco::Candidate > lep, edm::Ptr< pat::Jet > jet) const
 
std::tuple< float, float, float > calculatePtRatioRelSimple (edm::Ptr< reco::Candidate > lep, edm::Ptr< pat::Jet > jet) const
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

edm::EDGetTokenT< std::vector< reco::GenParticle > > srcGP_
 
edm::EDGetTokenT< edm::View< pat::Jet > > srcJet_
 
edm::EDGetTokenT< edm::View< reco::VertexCompositePtrCandidate > > srcSV_
 
edm::EDGetTokenT< std::vector< reco::Vertex > > srcVtx_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

template<typename T>
class BJetEnergyRegressionVarProducer< T >

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 76 of file BJetEnergyRegressionVarProducer.cc.

Constructor & Destructor Documentation

template<typename T >
BJetEnergyRegressionVarProducer< T >::BJetEnergyRegressionVarProducer ( const edm::ParameterSet iConfig)
inlineexplicit

Definition at line 78 of file BJetEnergyRegressionVarProducer.cc.

78  :
80  srcVtx_(consumes<std::vector<reco::Vertex>>(iConfig.getParameter<edm::InputTag>("pvsrc"))),
82  srcGP_(consumes<std::vector<reco::GenParticle>>(iConfig.getParameter<edm::InputTag>("gpsrc")))
83  {
84  //un prodotto da copiare
85  produces<edm::ValueMap<float>>("leptonPtRel");
86  produces<edm::ValueMap<float>>("leptonPtRatio");
87  produces<edm::ValueMap<float>>("leptonPtRelInv");//wrong variable?
88  produces<edm::ValueMap<float>>("leptonPtRelv0");
89  produces<edm::ValueMap<float>>("leptonPtRatiov0");
90  produces<edm::ValueMap<float>>("leptonPtRelInvv0");//v0 ~ heppy?
91  produces<edm::ValueMap<float>>("leptonPt");
92  produces<edm::ValueMap<int>>("leptonPdgId");
93  produces<edm::ValueMap<float>>("leptonDeltaR");
94  produces<edm::ValueMap<float>>("leadTrackPt");
95  produces<edm::ValueMap<float>>("vtxPt");
96  produces<edm::ValueMap<float>>("vtxMass");
97  produces<edm::ValueMap<float>>("vtx3dL");
98  produces<edm::ValueMap<float>>("vtx3deL");
99  produces<edm::ValueMap<int>>("vtxNtrk");
100  produces<edm::ValueMap<float>>("ptD");
101  produces<edm::ValueMap<float>>("genPtwNu");
102 
103 
104  }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< reco::VertexCompositePtrCandidate > > srcSV_
edm::EDGetTokenT< std::vector< reco::GenParticle > > srcGP_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edm::View< pat::Jet > > srcJet_
edm::EDGetTokenT< std::vector< reco::Vertex > > srcVtx_
template<typename T >
BJetEnergyRegressionVarProducer< T >::~BJetEnergyRegressionVarProducer ( )
inlineoverride

Member Function Documentation

template<typename T >
std::tuple< float, float, float > BJetEnergyRegressionVarProducer< T >::calculatePtRatioRel ( edm::Ptr< reco::Candidate lep,
edm::Ptr< pat::Jet jet 
) const
private

Definition at line 372 of file BJetEnergyRegressionVarProducer.cc.

References pat::Jet::correctedP4(), MillePedeFileConverter_cfg::e, pat::Jet::jecFactor(), reco::Candidate::p4(), reco::LeafCandidate::pt(), and dttmaxenums::R.

Referenced by BJetEnergyRegressionVarProducer< T >::produce(), and BJetEnergyRegressionVarProducer< T >::~BJetEnergyRegressionVarProducer().

372  {
373 
374  auto rawp4 = jet->correctedP4("Uncorrected");
375  auto lepp4 = lep->p4();
376 
377  if ((rawp4-lepp4).R()<1e-4) return std::tuple<float,float,float>(1.0,0.0,0.0);
378 
379  auto jetp4 = (rawp4 - lepp4*(1.0/jet->jecFactor("L1FastJet")))*(jet->pt()/rawp4.pt())+lepp4;
380  auto ptratio = lepp4.pt()/jetp4.pt();
381  auto ptrel = lepp4.Vect().Cross((jetp4-lepp4).Vect().Unit()).R();
382  auto ptrelinv = (jetp4-lepp4).Vect().Cross((lepp4).Vect().Unit()).R();
383 
384  return std::tuple<float,float,float>(ptratio,ptrel,ptrelinv);
385 }
const LorentzVector correctedP4(const std::string &level, const std::string &flavor="none", const std::string &set="") const
Definition: Jet.h:158
double pt() const final
transverse momentum
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
float jecFactor(const std::string &level, const std::string &flavor="none", const std::string &set="") const
template<typename T >
std::tuple< float, float, float > BJetEnergyRegressionVarProducer< T >::calculatePtRatioRelSimple ( edm::Ptr< reco::Candidate lep,
edm::Ptr< pat::Jet jet 
) const
private

Definition at line 390 of file BJetEnergyRegressionVarProducer.cc.

References pat::Jet::correctedP4(), MillePedeFileConverter_cfg::e, reco::Candidate::p4(), reco::LeafCandidate::p4(), and dttmaxenums::R.

Referenced by BJetEnergyRegressionVarProducer< T >::produce(), and BJetEnergyRegressionVarProducer< T >::~BJetEnergyRegressionVarProducer().

390  {
391 
392  auto lepp4 = lep->p4();
393  auto rawp4 = jet->correctedP4("Uncorrected");
394 
395  if ((rawp4-lepp4).R()<1e-4) return std::tuple<float,float,float>(1.0,0.0,0.0);
396 
397  auto jetp4 = jet->p4();//(rawp4 - lepp4*(1.0/jet->jecFactor("L1FastJet")))*(jet->pt()/rawp4.pt())+lepp4;
398  auto ptratio = lepp4.pt()/jetp4.pt();
399  auto ptrel = lepp4.Vect().Cross((jetp4).Vect().Unit()).R();
400  auto ptrelinv = jetp4.Vect().Cross((lepp4).Vect().Unit()).R();
401 
402  return std::tuple<float,float,float>(ptratio,ptrel,ptrelinv);
403 
404 
405 }
const LorentzVector correctedP4(const std::string &level, const std::string &flavor="none", const std::string &set="") const
Definition: Jet.h:158
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
template<typename T >
void BJetEnergyRegressionVarProducer< T >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 411 of file BJetEnergyRegressionVarProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by BJetEnergyRegressionVarProducer< T >::~BJetEnergyRegressionVarProducer().

411  {
412  //The following says we do not know what parameters are allowed so do no validation
413  // Please change this to state exactly what you do use, even if it is no parameters
415  desc.add<edm::InputTag>("src")->setComment("jet input collection");
416 // desc.add<edm::InputTag>("musrc")->setComment("muons input collection");
417 // desc.add<edm::InputTag>("elesrc")->setComment("electrons input collection");
418  desc.add<edm::InputTag>("pvsrc")->setComment("primary vertex input collection");
419  desc.add<edm::InputTag>("svsrc")->setComment("secondary vertex input collection");
420  desc.add<edm::InputTag>("gpsrc")->setComment("genparticles for nu recovery");
421  std::string modname;
422  if (typeid(T) == typeid(pat::Jet)) modname+="Jet";
423  modname+="RegressionVarProducer";
424  descriptions.add(modname,desc);
425 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Analysis-level calorimeter jet class.
Definition: Jet.h:80
void add(std::string const &label, ParameterSetDescription const &psetDescription)
long double T
template<typename T >
void BJetEnergyRegressionVarProducer< T >::produce ( edm::StreamID  streamID,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivate

Definition at line 139 of file BJetEnergyRegressionVarProducer.cc.

References funct::abs(), BJetEnergyRegressionVarProducer< T >::calculatePtRatioRel(), BJetEnergyRegressionVarProducer< T >::calculatePtRatioRelSimple(), RecoVertex::convertError(), RecoVertex::convertPos(), edmIntegrityCheck::d, reco::deltaR(), reco::deltaR2(), VertexDistance3D::distance(), Measurement1D::error(), edm::helper::Filler< Map >::fill(), jets_cff::genPtwNu, edm::Event::getByToken(), runTauDisplay::gp, edm::helper::Filler< Map >::insert(), metsig::jet, jets_cff::leadTrackPt, reco::btau::leptonDeltaR, jets_cff::leptonPdgId, jets_cff::leptonPt, jets_cff::leptonPtRatio, reco::btau::leptonPtRel, jets_cff::leptonPtRelInv, eostools::move(), jets_cff::ptD, AlignmentTrackSelector_cfi::ptMax, edm::Event::put(), MetAnalyzer::pv(), Measurement1D::significance(), mathSSE::sqrt(), BJetEnergyRegressionVarProducer< T >::srcGP_, electrons_cff::srcJet, BJetEnergyRegressionVarProducer< T >::srcJet_, BJetEnergyRegressionVarProducer< T >::srcSV_, electrons_cff::srcVtx, BJetEnergyRegressionVarProducer< T >::srcVtx_, TtFullHadEvtBuilder_cfi::sumPt, pfDeepBoostedJetPreprocessParams_cfi::sv, Measurement1D::value(), jets_cff::vtx3deL, jets_cff::vtx3dL, jets_cff::vtxMass, jets_cff::vtxNtrk, and jets_cff::vtxPt.

Referenced by BJetEnergyRegressionVarProducer< T >::~BJetEnergyRegressionVarProducer().

139  {
140 
142  iEvent.getByToken(srcJet_, srcJet);
144  iEvent.getByToken(srcVtx_, srcVtx);
146  iEvent.getByToken(srcSV_, srcSV);
148  iEvent.getByToken(srcGP_, srcGP);
149 
150  unsigned int nJet = srcJet->size();
151 // unsigned int nLep = srcLep->size();
152 
153  std::vector<float> leptonPtRel(nJet,0);
154  std::vector<float> leptonPtRatio(nJet,0);
155  std::vector<float> leptonPtRelInv(nJet,0);
156  std::vector<float> leptonPtRel_v0(nJet,0);
157  std::vector<float> leptonPtRatio_v0(nJet,0);
158  std::vector<float> leptonPtRelInv_v0(nJet,0);
159  std::vector<int> leptonPdgId(nJet,0);
160  std::vector<float> leptonPt(nJet,0);
161  std::vector<float> leptonDeltaR(nJet,0);
162  std::vector<float> leadTrackPt(nJet,0);
163  std::vector<float> vtxPt(nJet,0);
164  std::vector<float> vtxMass(nJet,0);
165  std::vector<float> vtx3dL(nJet,0);
166  std::vector<float> vtx3deL(nJet,0);
167  std::vector<int> vtxNtrk(nJet,0);
168  std::vector<float> ptD(nJet,0);
169  std::vector<float> genPtwNu(nJet,0);
170 
171 
172  const auto & pv = (*srcVtx)[0];
173  for (unsigned int ij = 0; ij<nJet; ij++){
174 
175  auto jet = srcJet->ptrAt(ij);
176 
177  if (jet->genJet()!=nullptr){
178  auto genp4 = jet->genJet()->p4();
179  auto gep4wNu = genp4;
180  for(const auto & gp : *srcGP){
181  if((abs(gp.pdgId())==12 || abs(gp.pdgId())==14 || abs(gp.pdgId())==16) && gp.status()==1){
182  if (reco::deltaR( genp4, gp.p4() )<0.4) {
183 // std::cout<<" from "<<gep4wNu.pt()<<std::endl;
184  gep4wNu=gep4wNu+gp.p4();
185 // std::cout<<" to "<<gep4wNu.pt()<<std::endl;
186  }
187  }
188  }
189 
190  genPtwNu[ij]=gep4wNu.pt();
191 
192  }
193 
194 
195  float ptMax=0;
196  float sumWeight=0;
197  float sumPt=0;
198 
199  for(const auto & d : jet->daughterPtrVector()){
200  sumWeight+=(d->pt())*(d->pt());
201  sumPt+=d->pt();
202  if(d->pt()>ptMax) ptMax=d->pt();}
203  leadTrackPt[ij]=ptMax;
204  ptD[ij] = (sumWeight > 0 ? sqrt(sumWeight)/sumPt : 0);
205 
206  //lepton properties
207  float maxLepPt = 0;
208  leptonPtRel[ij]=0;
209 
210  for(const auto & d : jet->daughterPtrVector()){
211 
212  if(abs(d->pdgId())==11 || abs(d->pdgId())==13){
213  if(d->pt()<maxLepPt) continue;
214  auto res = calculatePtRatioRel(d,jet);
215  leptonPtRatio[ij] = std::get<0>(res);
216  leptonPtRel[ij] = std::get<1>(res);
217  leptonPtRelInv[ij] = std::get<2>(res);
218  auto res2 = calculatePtRatioRelSimple(d,jet);
219  leptonPtRatio_v0[ij] = std::get<0>(res2);
220  leptonPtRel_v0[ij] = std::get<1>(res2);
221  leptonPtRelInv_v0[ij] = std::get<2>(res2);
222  leptonPdgId[ij] = d->pdgId();
223  leptonDeltaR[ij]=reco::deltaR( jet->p4(), d->p4() );
224  leptonPt[ij] = d->pt();
225  maxLepPt = d->pt();
226 
227  }
228 
229  }
230 
231 
232  //Fill vertex properties
233  VertexDistance3D vdist;
234  float maxFoundSignificance=0;
235 
236  vtxPt[ij]=0;
237  vtxMass[ij]=0;
238  vtx3dL[ij]=0;
239  vtx3deL[ij]=0;
240  vtxNtrk[ij]=0;
241 
242  for(const auto &sv: *srcSV){
243  GlobalVector flightDir(sv.vertex().x() - pv.x(), sv.vertex().y() - pv.y(),sv.vertex().z() - pv.z());
244  GlobalVector jetDir(jet->px(),jet->py(),jet->pz());
245  if( reco::deltaR2( flightDir, jetDir ) < 0.09 ){
247  if(dl.significance() > maxFoundSignificance){
248  maxFoundSignificance=dl.significance();
249  vtxPt[ij]=sv.pt();
250  vtxMass[ij]=sv.p4().M();
251  vtx3dL[ij]=dl.value();
252  vtx3deL[ij]=dl.error();
253  vtxNtrk[ij]=sv.numberOfSourceCandidatePtrs();
254 
255  }
256  }
257  }
258 
259 
260 
261 }
262 
263 
264 
265  std::unique_ptr<edm::ValueMap<float>> leptonPtRelV(new edm::ValueMap<float>());
266  edm::ValueMap<float>::Filler fillerRel(*leptonPtRelV);
267  fillerRel.insert(srcJet,leptonPtRel.begin(),leptonPtRel.end());
268  fillerRel.fill();
269  iEvent.put(std::move(leptonPtRelV),"leptonPtRel");
270 
271  std::unique_ptr<edm::ValueMap<float>> leptonPtRatioV(new edm::ValueMap<float>());
272  edm::ValueMap<float>::Filler fillerRatio(*leptonPtRatioV);
273  fillerRatio.insert(srcJet,leptonPtRatio.begin(),leptonPtRatio.end());
274  fillerRatio.fill();
275  iEvent.put(std::move(leptonPtRatioV),"leptonPtRatio");
276 
277  std::unique_ptr<edm::ValueMap<float>> leptonPtRelInvV(new edm::ValueMap<float>());
278  edm::ValueMap<float>::Filler fillerRelInv(*leptonPtRelInvV);
279  fillerRelInv.insert(srcJet,leptonPtRelInv.begin(),leptonPtRelInv.end());
280  fillerRelInv.fill();
281  iEvent.put(std::move(leptonPtRelInvV),"leptonPtRelInv");
282 
283  std::unique_ptr<edm::ValueMap<float>> leptonPtRelV_v0(new edm::ValueMap<float>());
284  edm::ValueMap<float>::Filler fillerRel_v0(*leptonPtRelV_v0);
285  fillerRel_v0.insert(srcJet,leptonPtRel_v0.begin(),leptonPtRel_v0.end());
286  fillerRel_v0.fill();
287  iEvent.put(std::move(leptonPtRelV_v0),"leptonPtRelv0");
288 
289  std::unique_ptr<edm::ValueMap<float>> leptonPtRatioV_v0(new edm::ValueMap<float>());
290  edm::ValueMap<float>::Filler fillerRatio_v0(*leptonPtRatioV_v0);
291  fillerRatio_v0.insert(srcJet,leptonPtRatio_v0.begin(),leptonPtRatio_v0.end());
292  fillerRatio_v0.fill();
293  iEvent.put(std::move(leptonPtRatioV_v0),"leptonPtRatiov0");
294 
295  std::unique_ptr<edm::ValueMap<float>> leptonPtRelInvV_v0(new edm::ValueMap<float>());
296  edm::ValueMap<float>::Filler fillerRelInv_v0(*leptonPtRelInvV_v0);
297  fillerRelInv_v0.insert(srcJet,leptonPtRelInv_v0.begin(),leptonPtRelInv_v0.end());
298  fillerRelInv_v0.fill();
299  iEvent.put(std::move(leptonPtRelInvV_v0),"leptonPtRelInvv0");
300 
301  std::unique_ptr<edm::ValueMap<float>> leptonPtV(new edm::ValueMap<float>());
302  edm::ValueMap<float>::Filler fillerLpt(*leptonPtV);
303  fillerLpt.insert(srcJet,leptonPt.begin(),leptonPt.end());
304  fillerLpt.fill();
305  iEvent.put(std::move(leptonPtV),"leptonPt");
306 
307  std::unique_ptr<edm::ValueMap<float>> leptonDeltaRV(new edm::ValueMap<float>());
308  edm::ValueMap<float>::Filler fillerLdR(*leptonDeltaRV);
309  fillerLdR.insert(srcJet,leptonDeltaR.begin(),leptonDeltaR.end());
310  fillerLdR.fill();
311  iEvent.put(std::move(leptonDeltaRV),"leptonDeltaR");
312 
313  std::unique_ptr<edm::ValueMap<int>> leptonPtPdgIdV(new edm::ValueMap<int>());
314  edm::ValueMap<int>::Filler fillerId(*leptonPtPdgIdV);
315  fillerId.insert(srcJet,leptonPdgId.begin(),leptonPdgId.end());
316  fillerId.fill();
317  iEvent.put(std::move(leptonPtPdgIdV),"leptonPdgId");
318 
319  std::unique_ptr<edm::ValueMap<float>> leadTrackPtV(new edm::ValueMap<float>());
320  edm::ValueMap<float>::Filler fillerLT(*leadTrackPtV);
321  fillerLT.insert(srcJet,leadTrackPt.begin(),leadTrackPt.end());
322  fillerLT.fill();
323  iEvent.put(std::move(leadTrackPtV),"leadTrackPt");
324 
325  std::unique_ptr<edm::ValueMap<float>> vtxPtV(new edm::ValueMap<float>());
326  edm::ValueMap<float>::Filler fillerVtxPt(*vtxPtV);
327  fillerVtxPt.insert(srcJet,vtxPt.begin(),vtxPt.end());
328  fillerVtxPt.fill();
329  iEvent.put(std::move(vtxPtV),"vtxPt");
330 
331  std::unique_ptr<edm::ValueMap<float>> vtxMassV(new edm::ValueMap<float>());
332  edm::ValueMap<float>::Filler fillerVtxMass(*vtxMassV);
333  fillerVtxMass.insert(srcJet,vtxMass.begin(),vtxMass.end());
334  fillerVtxMass.fill();
335  iEvent.put(std::move(vtxMassV),"vtxMass");
336 
337  std::unique_ptr<edm::ValueMap<float>> vtx3dLV(new edm::ValueMap<float>());
338  edm::ValueMap<float>::Filler fillerVtx3dL(*vtx3dLV);
339  fillerVtx3dL.insert(srcJet,vtx3dL.begin(),vtx3dL.end());
340  fillerVtx3dL.fill();
341  iEvent.put(std::move(vtx3dLV),"vtx3dL");
342 
343  std::unique_ptr<edm::ValueMap<float>> vtx3deLV(new edm::ValueMap<float>());
344  edm::ValueMap<float>::Filler fillerVtx3deL(*vtx3deLV);
345  fillerVtx3deL.insert(srcJet,vtx3deL.begin(),vtx3deL.end());
346  fillerVtx3deL.fill();
347  iEvent.put(std::move(vtx3deLV),"vtx3deL");
348 
349  std::unique_ptr<edm::ValueMap<int>> vtxNtrkV(new edm::ValueMap<int>());
350  edm::ValueMap<int>::Filler fillerVtxNT(*vtxNtrkV);
351  fillerVtxNT.insert(srcJet,vtxNtrk.begin(),vtxNtrk.end());
352  fillerVtxNT.fill();
353  iEvent.put(std::move(vtxNtrkV),"vtxNtrk");
354 
355  std::unique_ptr<edm::ValueMap<float>> ptDV(new edm::ValueMap<float>());
356  edm::ValueMap<float>::Filler fillerPtD(*ptDV);
357  fillerPtD.insert(srcJet,ptD.begin(),ptD.end());
358  fillerPtD.fill();
359  iEvent.put(std::move(ptDV),"ptD");
360 
361  std::unique_ptr<edm::ValueMap<float>> genptV(new edm::ValueMap<float>());
362  edm::ValueMap<float>::Filler fillergenpt(*genptV);
363  fillergenpt.insert(srcJet,genPtwNu.begin(),genPtwNu.end());
364  fillergenpt.fill();
365  iEvent.put(std::move(genptV),"genPtwNu");
366 
367 }
reco::Vertex::Point convertPos(const GlobalPoint &p)
leptonPtRatio
Definition: jets_cff.py:81
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
edm::EDGetTokenT< edm::View< reco::VertexCompositePtrCandidate > > srcSV_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::EDGetTokenT< std::vector< reco::GenParticle > > srcGP_
std::tuple< float, float, float > calculatePtRatioRel(edm::Ptr< reco::Candidate > lep, edm::Ptr< pat::Jet > jet) const
reco::Vertex::Error convertError(const GlobalError &ge)
Definition: ConvertError.h:8
double error() const
Definition: Measurement1D.h:30
Definition: Electron.h:6
edm::EDGetTokenT< edm::View< pat::Jet > > srcJet_
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
T sqrt(T t)
Definition: SSEVec.h:18
def pv(vc)
Definition: MetAnalyzer.py:7
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:28
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
double significance() const
Definition: Measurement1D.h:32
edm::EDGetTokenT< std::vector< reco::Vertex > > srcVtx_
double value() const
Definition: Measurement1D.h:28
std::tuple< float, float, float > calculatePtRatioRelSimple(edm::Ptr< reco::Candidate > lep, edm::Ptr< pat::Jet > jet) const
leptonPtRelInv
Definition: jets_cff.py:82
leadTrackPt
Definition: jets_cff.py:79
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

template<typename T >
edm::EDGetTokenT<std::vector<reco::GenParticle> > BJetEnergyRegressionVarProducer< T >::srcGP_
private
template<typename T >
edm::EDGetTokenT<edm::View<pat::Jet> > BJetEnergyRegressionVarProducer< T >::srcJet_
private
template<typename T >
edm::EDGetTokenT<std::vector<reco::Vertex> > BJetEnergyRegressionVarProducer< T >::srcVtx_
private