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 hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () 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
 
double 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
 
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< 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::make_unique<PuppiContainer>(iConfig);
41 
42  tokenPFCandidates_ = consumes<CandidateView>(iConfig.getParameter<edm::InputTag>("candName"));
43  tokenVertices_ = consumes<VertexCollection>(iConfig.getParameter<edm::InputTag>("vertexName"));
44 
45  ptokenPupOut_ = produces<edm::ValueMap<float>>();
46  ptokenP4PupOut_ = produces<edm::ValueMap<LorentzVector>>();
47  ptokenValues_ = produces<edm::ValueMap<reco::CandidatePtr>>();
48 
50  ptokenPackedPuppiCandidates_ = produces<pat::PackedCandidateCollection>();
51  else {
52  ptokenPuppiCandidates_ = produces<reco::PFCandidateCollection>();
53  }
54 
55  if (fPuppiDiagnostics) {
56  ptokenNalgos_ = produces<double>("PuppiNAlgos");
57  ptokenRawAlphas_ = produces<std::vector<double>>("PuppiRawAlphas");
58  ptokenAlphas_ = produces<std::vector<double>>("PuppiAlphas");
59  ptokenAlphasMed_ = produces<std::vector<double>>("PuppiAlphasMed");
60  ptokenAlphasRms_ = produces<std::vector<double>>("PuppiAlphasRms");
61  }
62 }

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

◆ ~PuppiProducer()

PuppiProducer::~PuppiProducer ( )
override

Definition at line 64 of file PuppiProducer.cc.

64 {}

Member Function Documentation

◆ beginJob()

void PuppiProducer::beginJob ( void  )
privatevirtual

Definition at line 369 of file PuppiProducer.cc.

369 {}

◆ endJob()

void PuppiProducer::endJob ( void  )
privatevirtual

Definition at line 371 of file PuppiProducer.cc.

371 {}

Referenced by o2olib.O2ORunMgr::executeJob().

◆ fillDescriptions()

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

Definition at line 373 of file PuppiProducer.cc.

373  {
375  desc.add<bool>("puppiDiagnostics", false);
376  desc.add<bool>("puppiNoLep", false);
377  desc.add<bool>("UseFromPVLooseTight", false);
378  desc.add<bool>("UseDeltaZCut", true);
379  desc.add<double>("DeltaZCut", 0.3);
380  desc.add<double>("EtaMinUseDeltaZ", 0.);
381  desc.add<double>("PtMaxCharged", -1.);
382  desc.add<double>("EtaMaxCharged", 99999.);
383  desc.add<double>("PtMaxPhotons", -1.);
384  desc.add<double>("EtaMaxPhotons", 2.5);
385  desc.add<double>("PtMaxNeutrals", 200.);
386  desc.add<double>("PtMaxNeutralsStartSlope", 0.);
387  desc.add<uint>("NumOfPUVtxsForCharged", 0);
388  desc.add<double>("DeltaZCutForChargedFromPUVtxs", 0.2);
389  desc.add<bool>("useExistingWeights", false);
390  desc.add<bool>("clonePackedCands", false);
391  desc.add<int>("vtxNdofCut", 4);
392  desc.add<double>("vtxZCut", 24);
393  desc.add<edm::InputTag>("candName", edm::InputTag("particleFlow"));
394  desc.add<edm::InputTag>("vertexName", edm::InputTag("offlinePrimaryVertices"));
395  desc.add<bool>("applyCHS", true);
396  desc.add<bool>("invertPuppi", false);
397  desc.add<bool>("useExp", false);
398  desc.add<double>("MinPuppiWeight", .01);
399 
401 
402  descriptions.add("PuppiProducer", desc);
403 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, PuppiAlgo::fillDescriptionsPuppiAlgo(), HLT_FULL_cff::InputTag, and parallelization::uint.

◆ produce()

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

Definition at line 66 of file PuppiProducer.cc.

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

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, 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(), 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, and pat::PackedCandidate::vertexRef().

Member Data Documentation

◆ fClonePackedCands

bool PuppiProducer::fClonePackedCands
private

Definition at line 74 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fDZCut

double PuppiProducer::fDZCut
private

Definition at line 65 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fDZCutForChargedFromPUVtxs

double PuppiProducer::fDZCutForChargedFromPUVtxs
private

Definition at line 72 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fEtaMaxCharged

double PuppiProducer::fEtaMaxCharged
private

Definition at line 68 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fEtaMaxPhotons

double PuppiProducer::fEtaMaxPhotons
private

Definition at line 70 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fEtaMinUseDZ

double PuppiProducer::fEtaMinUseDZ
private

Definition at line 66 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fNumOfPUVtxsForCharged

uint PuppiProducer::fNumOfPUVtxsForCharged
private

Definition at line 71 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fPFName

std::string PuppiProducer::fPFName
private

Definition at line 59 of file PuppiProducer.h.

◆ fPtMaxCharged

double PuppiProducer::fPtMaxCharged
private

Definition at line 67 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fPtMaxPhotons

double PuppiProducer::fPtMaxPhotons
private

Definition at line 69 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fPuppiContainer

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

Definition at line 77 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fPuppiDiagnostics

bool PuppiProducer::fPuppiDiagnostics
private

Definition at line 61 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fPuppiName

std::string PuppiProducer::fPuppiName
private

Definition at line 58 of file PuppiProducer.h.

◆ fPuppiNoLep

bool PuppiProducer::fPuppiNoLep
private

Definition at line 62 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fPVName

std::string PuppiProducer::fPVName
private

Definition at line 60 of file PuppiProducer.h.

◆ fRecoObjCollection

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

Definition at line 78 of file PuppiProducer.h.

Referenced by produce().

◆ fUseDZ

bool PuppiProducer::fUseDZ
private

Definition at line 64 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fUseExistingWeights

bool PuppiProducer::fUseExistingWeights
private

Definition at line 73 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fUseFromPVLooseTight

bool PuppiProducer::fUseFromPVLooseTight
private

Definition at line 63 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fVtxNdofCut

int PuppiProducer::fVtxNdofCut
private

Definition at line 75 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ fVtxZCut

double PuppiProducer::fVtxZCut
private

Definition at line 76 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenAlphas_

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

Definition at line 55 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenAlphasMed_

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

Definition at line 56 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenAlphasRms_

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

Definition at line 57 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenNalgos_

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

Definition at line 53 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenP4PupOut_

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

Definition at line 49 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenPackedPuppiCandidates_

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

Definition at line 51 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenPupOut_

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

Definition at line 48 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenPuppiCandidates_

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

Definition at line 52 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenRawAlphas_

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

Definition at line 54 of file PuppiProducer.h.

Referenced by produce(), and PuppiProducer().

◆ ptokenValues_

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

Definition at line 50 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:67
PuppiProducer::fPuppiNoLep
bool fPuppiNoLep
Definition: PuppiProducer.h:62
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::Handle::product
T const * product() const
Definition: Handle.h:70
PuppiProducer::fVtxZCut
double fVtxZCut
Definition: PuppiProducer.h:76
PuppiProducer::ptokenRawAlphas_
edm::EDPutTokenT< std::vector< double > > ptokenRawAlphas_
Definition: PuppiProducer.h:54
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:63
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
RecoObj::m
float m
Definition: RecoObj.h:26
PuppiProducer::fClonePackedCands
bool fClonePackedCands
Definition: PuppiProducer.h:74
PuppiProducer::fUseDZ
bool fUseDZ
Definition: PuppiProducer.h:64
RecoObj::pdgId
int pdgId
Definition: RecoObj.h:28
PuppiProducer::ptokenValues_
edm::EDPutTokenT< edm::ValueMap< reco::CandidatePtr > > ptokenValues_
Definition: PuppiProducer.h:50
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:57
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:53
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:49
PuppiProducer::fDZCut
double fDZCut
Definition: PuppiProducer.h:65
PuppiProducer::fUseExistingWeights
bool fUseExistingWeights
Definition: PuppiProducer.h:73
pat::PackedCandidate::fromPV
const PVAssoc fromPV(size_t ipv=0) const
Definition: PackedCandidate.h:704
edm::View::size
size_type size() const
pat::PackedCandidate::pt
double pt() const override
transverse momentum
Definition: PackedCandidate.h:523
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:51
PuppiProducer::ptokenAlphasMed_
edm::EDPutTokenT< std::vector< double > > ptokenAlphasMed_
Definition: PuppiProducer.h:56
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:32
PuppiProducer::fDZCutForChargedFromPUVtxs
double fDZCutForChargedFromPUVtxs
Definition: PuppiProducer.h:72
iEvent
int iEvent
Definition: GenABIO.cc:224
PuppiProducer::fEtaMaxCharged
double fEtaMaxCharged
Definition: PuppiProducer.h:68
LorentzVectorCollection
std::vector< LorentzVector > LorentzVectorCollection
Definition: HLTTauMCProducer.h:31
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:61
edm::Ptr< Candidate >
PuppiProducer::ptokenPupOut_
edm::EDPutTokenT< edm::ValueMap< float > > ptokenPupOut_
Definition: PuppiProducer.h:48
PuppiProducer::fRecoObjCollection
std::vector< RecoObj > fRecoObjCollection
Definition: PuppiProducer.h:78
PuppiProducer::ptokenAlphas_
edm::EDPutTokenT< std::vector< double > > ptokenAlphas_
Definition: PuppiProducer.h:55
RecoObj::id
int id
Definition: RecoObj.h:27
PuppiProducer::fVtxNdofCut
int fVtxNdofCut
Definition: PuppiProducer.h:75
pat::PackedCandidate::dxy
virtual float dxy() const
dxy with respect to the PV ref
Definition: PackedCandidate.h:740
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
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:52
edm::ValueMap< float >
pat::PackedCandidate::PVLoose
Definition: PackedCandidate.h:703
Exception
Definition: hltDiff.cc:246
PuppiProducer::fPuppiContainer
std::unique_ptr< PuppiContainer > fPuppiContainer
Definition: PuppiProducer.h:77
PuppiProducer::fPtMaxPhotons
double fPtMaxPhotons
Definition: PuppiProducer.h:69
reco::PFCandidate::translatePdgIdToType
ParticleType translatePdgIdToType(int pdgid) const
Definition: PFCandidate.cc:209
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PuppiProducer::CandidateView
edm::View< reco::Candidate > CandidateView
Definition: PuppiProducer.h:32
PuppiProducer::fEtaMinUseDZ
double fEtaMinUseDZ
Definition: PuppiProducer.h:66
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
PuppiProducer::fNumOfPUVtxsForCharged
uint fNumOfPUVtxsForCharged
Definition: PuppiProducer.h:71
edm::helper::Filler
Definition: ValueMap.h:22
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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:70