CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
PuppiProducer Class Reference

#include <PuppiProducer.h>

Inheritance diagram for PuppiProducer:
edm::stream::EDProducer<>

Public Types

typedef edm::View< reco::CandidateCandidateView
 
typedef math::XYZTLorentzVector LorentzVector
 
typedef std::vector< LorentzVectorLorentzVectorCollection
 
typedef std::vector< pat::PackedCandidatePackedOutputCollection
 
typedef std::vector< reco::PFCandidatePFInputCollection
 
typedef std::vector< reco::PFCandidatePFOutputCollection
 
typedef edm::View< reco::PFCandidatePFView
 
typedef reco::VertexCollection VertexCollection
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Public Member Functions

 PuppiProducer (const edm::ParameterSet &)
 
 ~PuppiProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void beginJob ()
 
virtual void endJob ()
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

bool fClonePackedCands
 
float fDZCut
 
double fDZCutForChargedFromPUVtxs
 
double fEtaMaxCharged
 
double fEtaMaxPhotons
 
double fEtaMinUseDZ
 
uint fNumOfPUVtxsForCharged
 
std::string fPFName
 
double fPtMaxCharged
 
double fPtMaxPhotons
 
std::unique_ptr< PuppiContainerfPuppiContainer
 
bool fPuppiDiagnostics
 
std::string fPuppiName
 
bool fPuppiNoLep
 
std::string fPVName
 
std::vector< RecoObjfRecoObjCollection
 
bool fUseDZ
 
bool fUseExistingWeights
 
bool fUseFromPVLooseTight
 
bool fUsePUProxyValue
 
int fVtxNdofCut
 
double fVtxZCut
 
edm::EDPutTokenT< std::vector< double > > ptokenAlphas_
 
edm::EDPutTokenT< std::vector< double > > ptokenAlphasMed_
 
edm::EDPutTokenT< std::vector< double > > ptokenAlphasRms_
 
edm::EDPutTokenT< double > ptokenNalgos_
 
edm::EDPutTokenT< edm::ValueMap< LorentzVector > > ptokenP4PupOut_
 
edm::EDPutTokenT< pat::PackedCandidateCollectionptokenPackedPuppiCandidates_
 
edm::EDPutTokenT< edm::ValueMap< float > > ptokenPupOut_
 
edm::EDPutTokenT< reco::PFCandidateCollectionptokenPuppiCandidates_
 
edm::EDPutTokenT< std::vector< double > > ptokenRawAlphas_
 
edm::EDPutTokenT< edm::ValueMap< reco::CandidatePtr > > ptokenValues_
 
edm::EDGetTokenT< double > puProxyValueToken_
 
edm::EDGetTokenT< PackedOutputCollectiontokenPackedPuppiCandidates_
 
edm::EDGetTokenT< CandidateViewtokenPFCandidates_
 
edm::EDGetTokenT< PFOutputCollectiontokenPuppiCandidates_
 
edm::EDGetTokenT< PuppiContainertokenPuppiContainer_
 
edm::EDGetTokenT< VertexCollectiontokenVertices_
 

Detailed Description

Definition at line 23 of file PuppiProducer.h.

Member Typedef Documentation

◆ CandidateView

Definition at line 32 of file PuppiProducer.h.

◆ LorentzVector

Definition at line 29 of file PuppiProducer.h.

◆ LorentzVectorCollection

Definition at line 30 of file PuppiProducer.h.

◆ PackedOutputCollection

Definition at line 35 of file PuppiProducer.h.

◆ PFInputCollection

Definition at line 33 of file PuppiProducer.h.

◆ PFOutputCollection

Definition at line 34 of file PuppiProducer.h.

◆ PFView

Definition at line 36 of file PuppiProducer.h.

◆ VertexCollection

Definition at line 31 of file PuppiProducer.h.

Constructor & Destructor Documentation

◆ PuppiProducer()

PuppiProducer::PuppiProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 23 of file PuppiProducer.cc.

23  {
24  fPuppiDiagnostics = iConfig.getParameter<bool>("puppiDiagnostics");
25  fPuppiNoLep = iConfig.getParameter<bool>("puppiNoLep");
26  fUseFromPVLooseTight = iConfig.getParameter<bool>("UseFromPVLooseTight");
27  fUseDZ = iConfig.getParameter<bool>("UseDeltaZCut");
28  fDZCut = iConfig.getParameter<double>("DeltaZCut");
29  fEtaMinUseDZ = iConfig.getParameter<double>("EtaMinUseDeltaZ");
30  fPtMaxCharged = iConfig.getParameter<double>("PtMaxCharged");
31  fEtaMaxCharged = iConfig.getParameter<double>("EtaMaxCharged");
32  fPtMaxPhotons = iConfig.getParameter<double>("PtMaxPhotons");
33  fEtaMaxPhotons = iConfig.getParameter<double>("EtaMaxPhotons");
34  fNumOfPUVtxsForCharged = iConfig.getParameter<uint>("NumOfPUVtxsForCharged");
35  fDZCutForChargedFromPUVtxs = iConfig.getParameter<double>("DeltaZCutForChargedFromPUVtxs");
36  fUseExistingWeights = iConfig.getParameter<bool>("useExistingWeights");
37  fClonePackedCands = iConfig.getParameter<bool>("clonePackedCands");
38  fVtxNdofCut = iConfig.getParameter<int>("vtxNdofCut");
39  fVtxZCut = iConfig.getParameter<double>("vtxZCut");
40  fPuppiContainer = std::unique_ptr<PuppiContainer>(new PuppiContainer(iConfig));
41 
42  tokenPFCandidates_ = consumes<CandidateView>(iConfig.getParameter<edm::InputTag>("candName"));
43  tokenVertices_ = consumes<VertexCollection>(iConfig.getParameter<edm::InputTag>("vertexName"));
44 
45  fUsePUProxyValue = iConfig.getParameter<bool>("usePUProxyValue");
46 
47  if (fUsePUProxyValue) {
48  puProxyValueToken_ = consumes<double>(iConfig.getParameter<edm::InputTag>("PUProxyValue"));
49  }
50 
51  ptokenPupOut_ = produces<edm::ValueMap<float>>();
52  ptokenP4PupOut_ = produces<edm::ValueMap<LorentzVector>>();
53  ptokenValues_ = produces<edm::ValueMap<reco::CandidatePtr>>();
54 
56  ptokenPackedPuppiCandidates_ = produces<pat::PackedCandidateCollection>();
57  else {
58  ptokenPuppiCandidates_ = produces<reco::PFCandidateCollection>();
59  }
60 
61  if (fPuppiDiagnostics) {
62  ptokenNalgos_ = produces<double>("PuppiNAlgos");
63  ptokenRawAlphas_ = produces<std::vector<double>>("PuppiRawAlphas");
64  ptokenAlphas_ = produces<std::vector<double>>("PuppiAlphas");
65  ptokenAlphasMed_ = produces<std::vector<double>>("PuppiAlphasMed");
66  ptokenAlphasRms_ = produces<std::vector<double>>("PuppiAlphasRms");
67  }
68 }

References fClonePackedCands, fDZCut, fDZCutForChargedFromPUVtxs, fEtaMaxCharged, fEtaMaxPhotons, fEtaMinUseDZ, fNumOfPUVtxsForCharged, fPtMaxCharged, fPtMaxPhotons, fPuppiContainer, fPuppiDiagnostics, fPuppiNoLep, fUseDZ, fUseExistingWeights, fUseFromPVLooseTight, fUsePUProxyValue, fVtxNdofCut, fVtxZCut, edm::ParameterSet::getParameter(), ptokenAlphas_, ptokenAlphasMed_, ptokenAlphasRms_, ptokenNalgos_, ptokenP4PupOut_, ptokenPackedPuppiCandidates_, ptokenPupOut_, ptokenPuppiCandidates_, ptokenRawAlphas_, ptokenValues_, puProxyValueToken_, tokenPFCandidates_, tokenVertices_, and parallelization::uint.

◆ ~PuppiProducer()

PuppiProducer::~PuppiProducer ( )
override

Definition at line 70 of file PuppiProducer.cc.

70 {}

Member Function Documentation

◆ beginJob()

void PuppiProducer::beginJob ( void  )
privatevirtual

Definition at line 378 of file PuppiProducer.cc.

378 {}

◆ endJob()

void PuppiProducer::endJob ( void  )
privatevirtual

Definition at line 380 of file PuppiProducer.cc.

380 {}

Referenced by o2olib.O2ORunMgr::executeJob().

◆ fillDescriptions()

void PuppiProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 382 of file PuppiProducer.cc.

382  {
384  desc.add<bool>("puppiDiagnostics", false);
385  desc.add<bool>("puppiNoLep", false);
386  desc.add<bool>("UseFromPVLooseTight", false);
387  desc.add<bool>("UseDeltaZCut", true);
388  desc.add<double>("DeltaZCut", 0.3);
389  desc.add<double>("EtaMinUseDeltaZ", 0.);
390  desc.add<double>("PtMaxCharged", -1.);
391  desc.add<double>("EtaMaxCharged", 99999.);
392  desc.add<double>("PtMaxPhotons", -1.);
393  desc.add<double>("EtaMaxPhotons", 2.5);
394  desc.add<double>("PtMaxNeutrals", 200.);
395  desc.add<double>("PtMaxNeutralsStartSlope", 0.);
396  desc.add<uint>("NumOfPUVtxsForCharged", 0);
397  desc.add<double>("DeltaZCutForChargedFromPUVtxs", 0.2);
398  desc.add<bool>("useExistingWeights", false);
399  desc.add<bool>("clonePackedCands", false);
400  desc.add<int>("vtxNdofCut", 4);
401  desc.add<double>("vtxZCut", 24);
402  desc.add<edm::InputTag>("candName", edm::InputTag("particleFlow"));
403  desc.add<edm::InputTag>("vertexName", edm::InputTag("offlinePrimaryVertices"));
404  desc.add<bool>("applyCHS", true);
405  desc.add<bool>("invertPuppi", false);
406  desc.add<bool>("useExp", false);
407  desc.add<double>("MinPuppiWeight", .01);
408  desc.add<bool>("usePUProxyValue", false);
409  desc.add<edm::InputTag>("PUProxyValue", edm::InputTag(""));
410 
412 
413  descriptions.add("PuppiProducer", desc);
414 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), PuppiAlgo::fillDescriptionsPuppiAlgo(), HLT_2018_cff::InputTag, and parallelization::uint.

◆ produce()

void PuppiProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 72 of file PuppiProducer.cc.

72  {
73  // Get PFCandidate Collection
74  edm::Handle<CandidateView> hPFProduct;
75  iEvent.getByToken(tokenPFCandidates_, hPFProduct);
76  const CandidateView* pfCol = hPFProduct.product();
77 
78  // Get vertex collection w/PV as the first entry?
80  iEvent.getByToken(tokenVertices_, hVertexProduct);
81  const reco::VertexCollection* pvCol = hVertexProduct.product();
82 
83  double puProxyValue = 0.;
84  if (fUsePUProxyValue) {
85  puProxyValue = iEvent.get(puProxyValueToken_);
86  } else {
87  for (auto const& vtx : *pvCol) {
88  if (!vtx.isFake() && vtx.ndof() >= fVtxNdofCut && std::abs(vtx.z()) <= fVtxZCut)
89  ++puProxyValue;
90  }
91  }
92 
93  std::vector<double> lWeights;
94  if (!fUseExistingWeights) {
95  //Fill the reco objects
96  fRecoObjCollection.clear();
97  fRecoObjCollection.reserve(pfCol->size());
98  for (auto const& aPF : *pfCol) {
99  RecoObj pReco;
100  pReco.pt = aPF.pt();
101  pReco.eta = aPF.eta();
102  pReco.phi = aPF.phi();
103  pReco.m = aPF.mass();
104  pReco.rapidity = aPF.rapidity();
105  pReco.charge = aPF.charge();
106  pReco.pdgId = aPF.pdgId();
107  const reco::Vertex* closestVtx = nullptr;
108  double pDZ = -9999;
109  double pD0 = -9999;
110  uint pVtxId = 0;
111  bool isLepton = ((std::abs(pReco.pdgId) == 11) || (std::abs(pReco.pdgId) == 13));
112  const pat::PackedCandidate* lPack = dynamic_cast<const pat::PackedCandidate*>(&aPF);
113  if (lPack == nullptr) {
114  const reco::PFCandidate* pPF = dynamic_cast<const reco::PFCandidate*>(&aPF);
115  double curdz = 9999;
116  int closestVtxForUnassociateds = -9999;
117  const reco::TrackRef aTrackRef = pPF->trackRef();
118  bool lFirst = true;
119  for (auto const& aV : *pvCol) {
120  if (lFirst) {
121  if (aTrackRef.isNonnull()) {
122  pDZ = aTrackRef->dz(aV.position());
123  pD0 = aTrackRef->d0();
124  } else if (pPF->gsfTrackRef().isNonnull()) {
125  pDZ = pPF->gsfTrackRef()->dz(aV.position());
126  pD0 = pPF->gsfTrackRef()->d0();
127  }
128  lFirst = false;
129  if (pDZ > -9999)
130  pVtxId = 0;
131  }
132  if (aTrackRef.isNonnull() && aV.trackWeight(pPF->trackRef()) > 0) {
133  closestVtx = &aV;
134  break;
135  }
136  // in case it's unassocciated, keep more info
137  double tmpdz = 99999;
138  if (aTrackRef.isNonnull())
139  tmpdz = aTrackRef->dz(aV.position());
140  else if (pPF->gsfTrackRef().isNonnull())
141  tmpdz = pPF->gsfTrackRef()->dz(aV.position());
142  if (std::abs(tmpdz) < curdz) {
143  curdz = std::abs(tmpdz);
144  closestVtxForUnassociateds = pVtxId;
145  }
146  pVtxId++;
147  }
148  int tmpFromPV = 0;
149  // mocking the miniAOD definitions
150  if (std::abs(pReco.charge) > 0) {
151  if (closestVtx != nullptr && pVtxId > 0)
152  tmpFromPV = 0;
153  if (closestVtx != nullptr && pVtxId == 0)
154  tmpFromPV = 3;
155  if (closestVtx == nullptr && closestVtxForUnassociateds == 0)
156  tmpFromPV = 2;
157  if (closestVtx == nullptr && closestVtxForUnassociateds != 0)
158  tmpFromPV = 1;
159  }
160  pReco.dZ = pDZ;
161  pReco.d0 = pD0;
162  pReco.id = 0;
163  if (std::abs(pReco.charge) == 0) {
164  pReco.id = 0;
165  } else {
166  if (fPuppiNoLep && isLepton)
167  pReco.id = 3;
168  else if (tmpFromPV == 0) {
169  pReco.id = 2;
170  if (fNumOfPUVtxsForCharged > 0 and (pVtxId <= fNumOfPUVtxsForCharged) and
172  pReco.id = 1;
173  } else if (tmpFromPV == 3)
174  pReco.id = 1;
175  else if (tmpFromPV == 1 || tmpFromPV == 2) {
176  pReco.id = 0;
177  if ((fPtMaxCharged > 0) and (pReco.pt > fPtMaxCharged))
178  pReco.id = 1;
179  else if (std::abs(pReco.eta) > fEtaMaxCharged)
180  pReco.id = 1;
181  else if ((fUseDZ) && (std::abs(pReco.eta) >= fEtaMinUseDZ))
182  pReco.id = (std::abs(pDZ) < fDZCut) ? 1 : 2;
183  else if (fUseFromPVLooseTight && tmpFromPV == 1)
184  pReco.id = 2;
185  else if (fUseFromPVLooseTight && tmpFromPV == 2)
186  pReco.id = 1;
187  }
188  }
189  } else if (lPack->vertexRef().isNonnull()) {
190  pDZ = lPack->dz();
191  pD0 = lPack->dxy();
192  pReco.dZ = pDZ;
193  pReco.d0 = pD0;
194 
195  pReco.id = 0;
196  if (std::abs(pReco.charge) == 0) {
197  pReco.id = 0;
198  }
199  if (std::abs(pReco.charge) > 0) {
200  if (fPuppiNoLep && isLepton) {
201  pReco.id = 3;
202  } else if (lPack->fromPV() == 0) {
203  pReco.id = 2;
205  for (size_t puVtx_idx = 1; puVtx_idx <= fNumOfPUVtxsForCharged && puVtx_idx < pvCol->size();
206  ++puVtx_idx) {
207  if (lPack->fromPV(puVtx_idx) >= 2) {
208  pReco.id = 1;
209  break;
210  }
211  }
212  }
213  } else if (lPack->fromPV() == (pat::PackedCandidate::PVUsedInFit)) {
214  pReco.id = 1;
215  } else if (lPack->fromPV() == (pat::PackedCandidate::PVTight) ||
216  lPack->fromPV() == (pat::PackedCandidate::PVLoose)) {
217  pReco.id = 0;
218  if ((fPtMaxCharged > 0) and (pReco.pt > fPtMaxCharged))
219  pReco.id = 1;
220  else if (std::abs(pReco.eta) > fEtaMaxCharged)
221  pReco.id = 1;
222  else if ((fUseDZ) && (std::abs(pReco.eta) >= fEtaMinUseDZ))
223  pReco.id = (std::abs(pDZ) < fDZCut) ? 1 : 2;
225  pReco.id = 2;
227  pReco.id = 1;
228  }
229  }
230  }
231 
232  fRecoObjCollection.push_back(pReco);
233  }
234 
235  fPuppiContainer->initialize(fRecoObjCollection);
236  fPuppiContainer->setPUProxy(puProxyValue);
237 
238  //Compute the weights and get the particles
239  lWeights = fPuppiContainer->puppiWeights();
240  } else {
241  //Use the existing weights
242  int lPackCtr = 0;
243  for (auto const& aPF : *pfCol) {
244  const pat::PackedCandidate* lPack = dynamic_cast<const pat::PackedCandidate*>(&aPF);
245  float curpupweight = -1.;
246  if (lPack == nullptr) {
247  // throw error
249  "PuppiProducer: cannot get weights since inputs are not PackedCandidates");
250  } else {
251  if (fPuppiNoLep) {
252  curpupweight = lPack->puppiWeightNoLep();
253  } else {
254  curpupweight = lPack->puppiWeight();
255  }
256  }
257  // Protect high pT photons (important for gamma to hadronic recoil balance)
258  if ((fPtMaxPhotons > 0) && (lPack->pdgId() == 22) && (std::abs(lPack->eta()) < fEtaMaxPhotons) &&
259  (lPack->pt() > fPtMaxPhotons))
260  curpupweight = 1;
261  lWeights.push_back(curpupweight);
262  lPackCtr++;
263  }
264  }
265 
266  //Fill it into the event
267  edm::ValueMap<float> lPupOut;
268  edm::ValueMap<float>::Filler lPupFiller(lPupOut);
269  lPupFiller.insert(hPFProduct, lWeights.begin(), lWeights.end());
270  lPupFiller.fill();
271 
272  // This is a dummy to access the "translate" method which is a
273  // non-static member function even though it doesn't need to be.
274  // Will fix in the future.
275  static const reco::PFCandidate dummySinceTranslateIsNotStatic;
276 
277  // Fill a new PF/Packed Candidate Collection and write out the ValueMap of the new p4s.
278  // Since the size of the ValueMap must be equal to the input collection, we need
279  // to search the "puppi" particles to find a match for each input. If none is found,
280  // the input is set to have a four-vector of 0,0,0,0
281  PFOutputCollection fPuppiCandidates;
282  PackedOutputCollection fPackedPuppiCandidates;
283 
285  LorentzVectorCollection puppiP4s;
286  std::vector<reco::CandidatePtr> values(hPFProduct->size());
287 
288  int iCand = -1;
289  for (auto const& aCand : *hPFProduct) {
290  ++iCand;
291  std::unique_ptr<pat::PackedCandidate> pCand;
292  std::unique_ptr<reco::PFCandidate> pfCand;
293 
295  const pat::PackedCandidate* cand = dynamic_cast<const pat::PackedCandidate*>(&aCand);
296  if (!cand)
297  throw edm::Exception(edm::errors::LogicError, "PuppiProducer: inputs are not PackedCandidates");
298  pCand.reset(new pat::PackedCandidate(*cand));
299  } else {
300  auto id = dummySinceTranslateIsNotStatic.translatePdgIdToType(aCand.pdgId());
301  const reco::PFCandidate* cand = dynamic_cast<const reco::PFCandidate*>(&aCand);
302  pfCand.reset(new reco::PFCandidate(cand ? *cand : reco::PFCandidate(aCand.charge(), aCand.p4(), id)));
303  }
304 
305  // Here, we are using new weights computed and putting them in the packed candidates.
307  if (fPuppiNoLep)
308  pCand->setPuppiWeight(pCand->puppiWeight(), lWeights[iCand]);
309  else
310  pCand->setPuppiWeight(lWeights[iCand], pCand->puppiWeightNoLep());
311  }
312 
313  puppiP4s.emplace_back(lWeights[iCand] * aCand.px(),
314  lWeights[iCand] * aCand.py(),
315  lWeights[iCand] * aCand.pz(),
316  lWeights[iCand] * aCand.energy());
317 
318  // Here, we are using existing weights, or we're using packed candidates.
319  // That is, whether or not we recomputed the weights, we store the
320  // source candidate appropriately, and set the p4 of the packed candidate.
322  pCand->setP4(puppiP4s.back());
323  pCand->setSourceCandidatePtr(aCand.sourceCandidatePtr(0));
324  fPackedPuppiCandidates.push_back(*pCand);
325  } else {
326  pfCand->setP4(puppiP4s.back());
327  pfCand->setSourceCandidatePtr(aCand.sourceCandidatePtr(0));
328  fPuppiCandidates.push_back(*pfCand);
329  }
330  }
331 
332  //Compute the modified p4s
333  edm::ValueMap<LorentzVector>::Filler p4PupFiller(p4PupOut);
334  p4PupFiller.insert(hPFProduct, puppiP4s.begin(), puppiP4s.end());
335  p4PupFiller.fill();
336 
337  iEvent.emplace(ptokenPupOut_, lPupOut);
338  iEvent.emplace(ptokenP4PupOut_, p4PupOut);
341  iEvent.emplace(ptokenPackedPuppiCandidates_, fPackedPuppiCandidates);
342  for (unsigned int ic = 0, nc = oh->size(); ic < nc; ++ic) {
343  reco::CandidatePtr pkref(oh, ic);
344  values[ic] = pkref;
345  }
346  } else {
348  for (unsigned int ic = 0, nc = oh->size(); ic < nc; ++ic) {
349  reco::CandidatePtr pkref(oh, ic);
350  values[ic] = pkref;
351  }
352  }
355  filler.insert(hPFProduct, values.begin(), values.end());
356  filler.fill();
357  iEvent.emplace(ptokenValues_, pfMap_p);
358 
361  // all the different alphas per particle
362  // THE alpha per particle
363  std::vector<double> theAlphas(fPuppiContainer->puppiAlphas());
364  std::vector<double> theAlphasMed(fPuppiContainer->puppiAlphasMed());
365  std::vector<double> theAlphasRms(fPuppiContainer->puppiAlphasRMS());
366  std::vector<double> alphas(fPuppiContainer->puppiRawAlphas());
367  double nalgos(fPuppiContainer->puppiNAlgos());
368 
369  iEvent.emplace(ptokenRawAlphas_, alphas);
370  iEvent.emplace(ptokenNalgos_, nalgos);
371  iEvent.emplace(ptokenAlphas_, theAlphas);
372  iEvent.emplace(ptokenAlphasMed_, theAlphasMed);
373  iEvent.emplace(ptokenAlphasRms_, theAlphasRms);
374  }
375 }

References funct::abs(), RecoObj::charge, RecoObj::d0, pat::PackedCandidate::dxy(), RecoObj::dZ, pat::PackedCandidate::dz(), RecoObj::eta, pat::PackedCandidate::eta(), Exception, fClonePackedCands, fDZCut, fDZCutForChargedFromPUVtxs, fEtaMaxCharged, fEtaMaxPhotons, fEtaMinUseDZ, edm::helper::Filler< Map >::fill(), trigObjTnPSource_cfi::filler, fNumOfPUVtxsForCharged, fPtMaxCharged, fPtMaxPhotons, fPuppiContainer, fPuppiDiagnostics, fPuppiNoLep, fRecoObjCollection, pat::PackedCandidate::fromPV(), fUseDZ, fUseExistingWeights, fUseFromPVLooseTight, fUsePUProxyValue, fVtxNdofCut, fVtxZCut, reco::PFCandidate::gsfTrackRef(), RecoObj::id, triggerObjects_cff::id, iEvent, edm::helper::Filler< Map >::insert(), reco::isLepton(), edm::Ref< C, T, F >::isNonnull(), edm::errors::LogicError, RecoObj::m, RecoObj::pdgId, pat::PackedCandidate::pdgId(), RecoObj::phi, edm::Handle< T >::product(), RecoObj::pt, pat::PackedCandidate::pt(), ptokenAlphas_, ptokenAlphasMed_, ptokenAlphasRms_, ptokenNalgos_, ptokenP4PupOut_, ptokenPackedPuppiCandidates_, ptokenPupOut_, ptokenPuppiCandidates_, ptokenRawAlphas_, ptokenValues_, pat::PackedCandidate::puppiWeight(), pat::PackedCandidate::puppiWeightNoLep(), puProxyValueToken_, pat::PackedCandidate::PVLoose, pat::PackedCandidate::PVTight, pat::PackedCandidate::PVUsedInFit, RecoObj::rapidity, edm::View< T >::size(), tokenPFCandidates_, tokenVertices_, reco::PFCandidate::trackRef(), reco::PFCandidate::translatePdgIdToType(), parallelization::uint, contentValuesCheck::values, pat::PackedCandidate::vertexRef(), and badGlobalMuonTaggersAOD_cff::vtx.

Member Data Documentation

◆ fClonePackedCands

bool PuppiProducer::fClonePackedCands
private

Definition at line 75 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fDZCut

float PuppiProducer::fDZCut
private

Definition at line 66 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fDZCutForChargedFromPUVtxs

double PuppiProducer::fDZCutForChargedFromPUVtxs
private

Definition at line 73 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fEtaMaxCharged

double PuppiProducer::fEtaMaxCharged
private

Definition at line 69 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fEtaMaxPhotons

double PuppiProducer::fEtaMaxPhotons
private

Definition at line 71 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fEtaMinUseDZ

double PuppiProducer::fEtaMinUseDZ
private

Definition at line 67 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fNumOfPUVtxsForCharged

uint PuppiProducer::fNumOfPUVtxsForCharged
private

Definition at line 72 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fPFName

std::string PuppiProducer::fPFName
private

Definition at line 60 of file PuppiProducer.h.

◆ fPtMaxCharged

double PuppiProducer::fPtMaxCharged
private

Definition at line 68 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fPtMaxPhotons

double PuppiProducer::fPtMaxPhotons
private

Definition at line 70 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fPuppiContainer

std::unique_ptr<PuppiContainer> PuppiProducer::fPuppiContainer
private

Definition at line 79 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fPuppiDiagnostics

bool PuppiProducer::fPuppiDiagnostics
private

Definition at line 62 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fPuppiName

std::string PuppiProducer::fPuppiName
private

Definition at line 59 of file PuppiProducer.h.

◆ fPuppiNoLep

bool PuppiProducer::fPuppiNoLep
private

Definition at line 63 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fPVName

std::string PuppiProducer::fPVName
private

Definition at line 61 of file PuppiProducer.h.

◆ fRecoObjCollection

std::vector<RecoObj> PuppiProducer::fRecoObjCollection
private

Definition at line 80 of file PuppiProducer.h.

Referenced by produce().

◆ fUseDZ

bool PuppiProducer::fUseDZ
private

Definition at line 65 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fUseExistingWeights

bool PuppiProducer::fUseExistingWeights
private

Definition at line 74 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fUseFromPVLooseTight

bool PuppiProducer::fUseFromPVLooseTight
private

Definition at line 64 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fUsePUProxyValue

bool PuppiProducer::fUsePUProxyValue
private

Definition at line 78 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fVtxNdofCut

int PuppiProducer::fVtxNdofCut
private

Definition at line 76 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fVtxZCut

double PuppiProducer::fVtxZCut
private

Definition at line 77 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenAlphas_

edm::EDPutTokenT<std::vector<double> > PuppiProducer::ptokenAlphas_
private

Definition at line 56 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenAlphasMed_

edm::EDPutTokenT<std::vector<double> > PuppiProducer::ptokenAlphasMed_
private

Definition at line 57 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenAlphasRms_

edm::EDPutTokenT<std::vector<double> > PuppiProducer::ptokenAlphasRms_
private

Definition at line 58 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenNalgos_

edm::EDPutTokenT<double> PuppiProducer::ptokenNalgos_
private

Definition at line 54 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenP4PupOut_

edm::EDPutTokenT<edm::ValueMap<LorentzVector> > PuppiProducer::ptokenP4PupOut_
private

Definition at line 50 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenPackedPuppiCandidates_

edm::EDPutTokenT<pat::PackedCandidateCollection> PuppiProducer::ptokenPackedPuppiCandidates_
private

Definition at line 52 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenPupOut_

edm::EDPutTokenT<edm::ValueMap<float> > PuppiProducer::ptokenPupOut_
private

Definition at line 49 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenPuppiCandidates_

edm::EDPutTokenT<reco::PFCandidateCollection> PuppiProducer::ptokenPuppiCandidates_
private

Definition at line 53 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenRawAlphas_

edm::EDPutTokenT<std::vector<double> > PuppiProducer::ptokenRawAlphas_
private

Definition at line 55 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenValues_

edm::EDPutTokenT<edm::ValueMap<reco::CandidatePtr> > PuppiProducer::ptokenValues_
private

Definition at line 51 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ puProxyValueToken_

edm::EDGetTokenT<double> PuppiProducer::puProxyValueToken_
private

Definition at line 48 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ tokenPackedPuppiCandidates_

edm::EDGetTokenT<PackedOutputCollection> PuppiProducer::tokenPackedPuppiCandidates_
private

Definition at line 47 of file PuppiProducer.h.

◆ tokenPFCandidates_

edm::EDGetTokenT<CandidateView> PuppiProducer::tokenPFCandidates_
private

Definition at line 43 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ tokenPuppiCandidates_

edm::EDGetTokenT<PFOutputCollection> PuppiProducer::tokenPuppiCandidates_
private

Definition at line 46 of file PuppiProducer.h.

◆ tokenPuppiContainer_

edm::EDGetTokenT<PuppiContainer> PuppiProducer::tokenPuppiContainer_
private

Definition at line 45 of file PuppiProducer.h.

◆ tokenVertices_

edm::EDGetTokenT<VertexCollection> PuppiProducer::tokenVertices_
private

Definition at line 44 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

RecoObj::d0
float d0
Definition: RecoObj.h:37
reco::PFCandidate::trackRef
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:408
PuppiProducer::fPtMaxCharged
double fPtMaxCharged
Definition: PuppiProducer.h:68
PuppiProducer::fPuppiNoLep
bool fPuppiNoLep
Definition: PuppiProducer.h:63
RecoObj::dZ
float dZ
Definition: RecoObj.h:36
RecoObj::eta
float eta
Definition: RecoObj.h:26
RecoObj::charge
int charge
Definition: RecoObj.h:38
pat::PackedCandidate::vertexRef
const reco::VertexRef vertexRef() const
Definition: PackedCandidate.h:737
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
edm::Handle::product
T const * product() const
Definition: Handle.h:70
PuppiProducer::fVtxZCut
double fVtxZCut
Definition: PuppiProducer.h:77
PuppiProducer::ptokenRawAlphas_
edm::EDPutTokenT< std::vector< double > > ptokenRawAlphas_
Definition: PuppiProducer.h:55
edm::errors::LogicError
Definition: EDMException.h:37
pat::PackedCandidate::pdgId
int pdgId() const override
PDG identifier.
Definition: PackedCandidate.h:832
RecoObj::phi
float phi
Definition: RecoObj.h:26
PuppiProducer::fUseFromPVLooseTight
bool fUseFromPVLooseTight
Definition: PuppiProducer.h:64
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
RecoObj::m
float m
Definition: RecoObj.h:26
PuppiProducer::fClonePackedCands
bool fClonePackedCands
Definition: PuppiProducer.h:75
PuppiProducer::fUseDZ
bool fUseDZ
Definition: PuppiProducer.h:65
RecoObj::pdgId
int pdgId
Definition: RecoObj.h:28
PuppiProducer::ptokenValues_
edm::EDPutTokenT< edm::ValueMap< reco::CandidatePtr > > ptokenValues_
Definition: PuppiProducer.h:51
pat::PackedCandidate::PVTight
Definition: PackedCandidate.h:703
edm::Handle
Definition: AssociativeIterator.h:50
parallelization.uint
uint
Definition: parallelization.py:124
RecoObj::pt
float pt
Definition: RecoObj.h:26
reco::isLepton
bool isLepton(const Candidate &part)
Definition: pdgIdUtils.h:13
edm::Ref< TrackCollection >
pat::PackedCandidate::PVUsedInFit
Definition: PackedCandidate.h:703
PuppiProducer::ptokenAlphasRms_
edm::EDPutTokenT< std::vector< double > > ptokenAlphasRms_
Definition: PuppiProducer.h:58
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
PuppiProducer::ptokenNalgos_
edm::EDPutTokenT< double > ptokenNalgos_
Definition: PuppiProducer.h:54
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
pat::PackedCandidate::dz
virtual float dz(size_t ipv=0) const
dz with respect to the PV[ipv]
Definition: PackedCandidate.h:745
RecoObj::rapidity
float rapidity
Definition: RecoObj.h:26
PuppiProducer::ptokenP4PupOut_
edm::EDPutTokenT< edm::ValueMap< LorentzVector > > ptokenP4PupOut_
Definition: PuppiProducer.h:50
PuppiContainer
Definition: PuppiContainer.h:8
PuppiProducer::fUseExistingWeights
bool fUseExistingWeights
Definition: PuppiProducer.h:74
pat::PackedCandidate::fromPV
const PVAssoc fromPV(size_t ipv=0) const
Definition: PackedCandidate.h:704
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
edm::View::size
size_type size() const
pat::PackedCandidate::pt
double pt() const override
transverse momentum
Definition: PackedCandidate.h:523
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
reco::PFCandidate::gsfTrackRef
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:440
pat::PackedCandidate::puppiWeight
float puppiWeight() const
Definition: PackedCandidate.cc:380
PuppiProducer::ptokenPackedPuppiCandidates_
edm::EDPutTokenT< pat::PackedCandidateCollection > ptokenPackedPuppiCandidates_
Definition: PuppiProducer.h:52
PuppiProducer::ptokenAlphasMed_
edm::EDPutTokenT< std::vector< double > > ptokenAlphasMed_
Definition: PuppiProducer.h:57
pat::PackedCandidate
Definition: PackedCandidate.h:22
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
cand
Definition: decayParser.h:34
PuppiProducer::fDZCutForChargedFromPUVtxs
double fDZCutForChargedFromPUVtxs
Definition: PuppiProducer.h:73
iEvent
int iEvent
Definition: GenABIO.cc:224
PuppiProducer::fEtaMaxCharged
double fEtaMaxCharged
Definition: PuppiProducer.h:69
LorentzVectorCollection
std::vector< LorentzVector > LorentzVectorCollection
Definition: HLTTauMCProducer.h:31
PuppiProducer::fUsePUProxyValue
bool fUsePUProxyValue
Definition: PuppiProducer.h:78
PuppiProducer::PackedOutputCollection
std::vector< pat::PackedCandidate > PackedOutputCollection
Definition: PuppiProducer.h:35
PuppiAlgo::fillDescriptionsPuppiAlgo
static void fillDescriptionsPuppiAlgo(edm::ParameterSetDescription &desc)
Definition: PuppiAlgo.cc:218
RecoObj
Definition: RecoObj.h:4
PuppiProducer::fPuppiDiagnostics
bool fPuppiDiagnostics
Definition: PuppiProducer.h:62
edm::Ptr< Candidate >
PuppiProducer::ptokenPupOut_
edm::EDPutTokenT< edm::ValueMap< float > > ptokenPupOut_
Definition: PuppiProducer.h:49
PuppiProducer::fRecoObjCollection
std::vector< RecoObj > fRecoObjCollection
Definition: PuppiProducer.h:80
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
PuppiProducer::ptokenAlphas_
edm::EDPutTokenT< std::vector< double > > ptokenAlphas_
Definition: PuppiProducer.h:56
RecoObj::id
int id
Definition: RecoObj.h:27
PuppiProducer::fVtxNdofCut
int fVtxNdofCut
Definition: PuppiProducer.h:76
pat::PackedCandidate::dxy
virtual float dxy() const
dxy with respect to the PV ref
Definition: PackedCandidate.h:740
PuppiProducer::tokenPFCandidates_
edm::EDGetTokenT< CandidateView > tokenPFCandidates_
Definition: PuppiProducer.h:43
edm::OrphanHandle
Definition: EDProductfwd.h:39
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
PuppiProducer::ptokenPuppiCandidates_
edm::EDPutTokenT< reco::PFCandidateCollection > ptokenPuppiCandidates_
Definition: PuppiProducer.h:53
edm::ValueMap< float >
PuppiProducer::fDZCut
float fDZCut
Definition: PuppiProducer.h:66
pat::PackedCandidate::PVLoose
Definition: PackedCandidate.h:703
Exception
Definition: hltDiff.cc:246
PuppiProducer::fPuppiContainer
std::unique_ptr< PuppiContainer > fPuppiContainer
Definition: PuppiProducer.h:79
PuppiProducer::fPtMaxPhotons
double fPtMaxPhotons
Definition: PuppiProducer.h:70
reco::PFCandidate::translatePdgIdToType
ParticleType translatePdgIdToType(int pdgid) const
Definition: PFCandidate.cc:209
PuppiProducer::CandidateView
edm::View< reco::Candidate > CandidateView
Definition: PuppiProducer.h:32
PuppiProducer::fEtaMinUseDZ
double fEtaMinUseDZ
Definition: PuppiProducer.h:67
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
PuppiProducer::fNumOfPUVtxsForCharged
uint fNumOfPUVtxsForCharged
Definition: PuppiProducer.h:72
edm::helper::Filler
Definition: ValueMap.h:22
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
PuppiProducer::puProxyValueToken_
edm::EDGetTokenT< double > puProxyValueToken_
Definition: PuppiProducer.h:48
PuppiProducer::tokenVertices_
edm::EDGetTokenT< VertexCollection > tokenVertices_
Definition: PuppiProducer.h:44
edm::InputTag
Definition: InputTag.h:15
PuppiProducer::PFOutputCollection
std::vector< reco::PFCandidate > PFOutputCollection
Definition: PuppiProducer.h:34
reco::Vertex
Definition: Vertex.h:35
pat::PackedCandidate::eta
double eta() const override
momentum pseudorapidity
Definition: PackedCandidate.h:563
pat::PackedCandidate::puppiWeightNoLep
float puppiWeightNoLep() const
Weight from full PUPPI.
Definition: PackedCandidate.cc:384
PuppiProducer::fEtaMaxPhotons
double fEtaMaxPhotons
Definition: PuppiProducer.h:71