CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
Onia2MuMuPAT Class Reference

#include <Onia2MuMuPAT.h>

Inheritance diagram for Onia2MuMuPAT:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 Onia2MuMuPAT (const edm::ParameterSet &)
 
 ~Onia2MuMuPAT () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void beginJob () override
 
void endJob () override
 
std::pair< int, float > findJpsiMCInfo (reco::GenParticleRef genJpsi)
 
bool isAbHadron (int pdgID)
 
bool isAMixedbHadron (int pdgID, int momPdgID)
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

bool addCommonVertex_
 
bool addMCTruth_
 
bool addMuonlessPrimaryVertex_
 
StringCutObjectSelector< reco::Candidate, true > dimuonSelection_
 
StringCutObjectSelector< pat::MuonhigherPuritySelection_
 
StringCutObjectSelector< pat::MuonlowerPuritySelection_
 
InvariantMassFromVertex massCalculator
 
edm::EDGetTokenT< edm::View< pat::Muon > > muons_
 
bool resolveAmbiguity_
 
edm::EDGetTokenT< reco::BeamSpotrevtxbs_
 
edm::EDGetTokenT< reco::TrackCollectionrevtxtrks_
 
edm::EDGetTokenT< reco::BeamSpotthebeamspot_
 
edm::EDGetTokenT< reco::VertexCollectionthePVs_
 
GreaterByVProb< pat::CompositeCandidatevPComparator_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 33 of file Onia2MuMuPAT.h.

Constructor & Destructor Documentation

◆ Onia2MuMuPAT()

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

Definition at line 29 of file Onia2MuMuPAT.cc.

31  thebeamspot_(consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpotTag"))),
32  thePVs_(consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("primaryVertexTag"))),
33  higherPuritySelection_(iConfig.getParameter<std::string>("higherPuritySelection")),
34  lowerPuritySelection_(iConfig.getParameter<std::string>("lowerPuritySelection")),
36  iConfig.existsAs<std::string>("dimuonSelection") ? iConfig.getParameter<std::string>("dimuonSelection") : ""),
37  addCommonVertex_(iConfig.getParameter<bool>("addCommonVertex")),
38  addMuonlessPrimaryVertex_(iConfig.getParameter<bool>("addMuonlessPrimaryVertex")),
39  resolveAmbiguity_(iConfig.getParameter<bool>("resolvePileUpAmbiguity")),
40  addMCTruth_(iConfig.getParameter<bool>("addMCTruth")) {
41  revtxtrks_ = consumes<reco::TrackCollection>(
42  (edm::InputTag) "generalTracks"); //if that is not true, we will raise an exception
43  revtxbs_ = consumes<reco::BeamSpot>((edm::InputTag) "offlineBeamSpot");
44  produces<pat::CompositeCandidateCollection>();
45 }

References revtxbs_, and revtxtrks_.

◆ ~Onia2MuMuPAT()

Onia2MuMuPAT::~Onia2MuMuPAT ( )
override

Definition at line 47 of file Onia2MuMuPAT.cc.

47  {
48  // do anything here that needs to be done at desctruction time
49  // (e.g. close files, deallocate resources etc.)
50 }

Member Function Documentation

◆ beginJob()

void Onia2MuMuPAT::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 496 of file Onia2MuMuPAT.cc.

496 {}

◆ endJob()

void Onia2MuMuPAT::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 499 of file Onia2MuMuPAT.cc.

499 {}

◆ findJpsiMCInfo()

std::pair< int, float > Onia2MuMuPAT::findJpsiMCInfo ( reco::GenParticleRef  genJpsi)
private

Definition at line 439 of file Onia2MuMuPAT.cc.

439  {
440  int momJpsiID = 0;
441  float trueLife = -99.;
442 
443  if (genJpsi->numberOfMothers() > 0) {
444  TVector3 trueVtx(0.0, 0.0, 0.0);
445  TVector3 trueP(0.0, 0.0, 0.0);
446  TVector3 trueVtxMom(0.0, 0.0, 0.0);
447 
448  trueVtx.SetXYZ(genJpsi->vertex().x(), genJpsi->vertex().y(), genJpsi->vertex().z());
449  trueP.SetXYZ(genJpsi->momentum().x(), genJpsi->momentum().y(), genJpsi->momentum().z());
450 
451  bool aBhadron = false;
452  reco::GenParticleRef Jpsimom = genJpsi->motherRef(); // find mothers
453  if (Jpsimom.isNull()) {
454  std::pair<int, float> result = std::make_pair(momJpsiID, trueLife);
455  return result;
456  } else {
457  reco::GenParticleRef Jpsigrandmom = Jpsimom->motherRef();
458  if (isAbHadron(Jpsimom->pdgId())) {
459  if (Jpsigrandmom.isNonnull() && isAMixedbHadron(Jpsimom->pdgId(), Jpsigrandmom->pdgId())) {
460  momJpsiID = Jpsigrandmom->pdgId();
461  trueVtxMom.SetXYZ(Jpsigrandmom->vertex().x(), Jpsigrandmom->vertex().y(), Jpsigrandmom->vertex().z());
462  } else {
463  momJpsiID = Jpsimom->pdgId();
464  trueVtxMom.SetXYZ(Jpsimom->vertex().x(), Jpsimom->vertex().y(), Jpsimom->vertex().z());
465  }
466  aBhadron = true;
467  } else {
468  if (Jpsigrandmom.isNonnull() && isAbHadron(Jpsigrandmom->pdgId())) {
469  reco::GenParticleRef JpsiGrandgrandmom = Jpsigrandmom->motherRef();
470  if (JpsiGrandgrandmom.isNonnull() && isAMixedbHadron(Jpsigrandmom->pdgId(), JpsiGrandgrandmom->pdgId())) {
471  momJpsiID = JpsiGrandgrandmom->pdgId();
472  trueVtxMom.SetXYZ(
473  JpsiGrandgrandmom->vertex().x(), JpsiGrandgrandmom->vertex().y(), JpsiGrandgrandmom->vertex().z());
474  } else {
475  momJpsiID = Jpsigrandmom->pdgId();
476  trueVtxMom.SetXYZ(Jpsigrandmom->vertex().x(), Jpsigrandmom->vertex().y(), Jpsigrandmom->vertex().z());
477  }
478  aBhadron = true;
479  }
480  }
481  if (!aBhadron) {
482  momJpsiID = Jpsimom->pdgId();
483  trueVtxMom.SetXYZ(Jpsimom->vertex().x(), Jpsimom->vertex().y(), Jpsimom->vertex().z());
484  }
485  }
486 
487  TVector3 vdiff = trueVtx - trueVtxMom;
488  //trueLife = vdiff.Perp()*3.09688/trueP.Perp();
489  trueLife = vdiff.Perp() * genJpsi->mass() / trueP.Perp();
490  }
491  std::pair<int, float> result = std::make_pair(momJpsiID, trueLife);
492  return result;
493 }

References isAbHadron(), isAMixedbHadron(), edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::isNull(), and mps_fire::result.

Referenced by produce().

◆ isAbHadron()

bool Onia2MuMuPAT::isAbHadron ( int  pdgID)
private

Definition at line 426 of file Onia2MuMuPAT.cc.

426  {
427  if (abs(pdgID) == 511 || abs(pdgID) == 521 || abs(pdgID) == 531 || abs(pdgID) == 5122)
428  return true;
429  return false;
430 }

References funct::abs().

Referenced by findJpsiMCInfo().

◆ isAMixedbHadron()

bool Onia2MuMuPAT::isAMixedbHadron ( int  pdgID,
int  momPdgID 
)
private

Definition at line 432 of file Onia2MuMuPAT.cc.

432  {
433  if ((abs(pdgID) == 511 && abs(momPdgID) == 511 && pdgID * momPdgID < 0) ||
434  (abs(pdgID) == 531 && abs(momPdgID) == 531 && pdgID * momPdgID < 0))
435  return true;
436  return false;
437 }

References funct::abs().

Referenced by findJpsiMCInfo().

◆ produce()

void Onia2MuMuPAT::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

DCA

end DCA

Implements edm::EDProducer.

Definition at line 57 of file Onia2MuMuPAT.cc.

57  {
58  using namespace edm;
59  using namespace std;
60  using namespace reco;
62 
63  vector<double> muMasses;
64  muMasses.push_back(0.1056583715);
65  muMasses.push_back(0.1056583715);
66 
67  std::unique_ptr<pat::CompositeCandidateCollection> oniaOutput(new pat::CompositeCandidateCollection);
68 
69  Vertex thePrimaryV;
70  Vertex theBeamSpotV;
71 
74  const MagneticField *field = magneticField.product();
75 
76  Handle<BeamSpot> theBeamSpot;
77  iEvent.getByToken(thebeamspot_, theBeamSpot);
78  BeamSpot bs = *theBeamSpot;
79  theBeamSpotV = Vertex(bs.position(), bs.covariance3D());
80 
82  iEvent.getByToken(thePVs_, priVtxs);
83  if (priVtxs->begin() != priVtxs->end()) {
84  thePrimaryV = Vertex(*(priVtxs->begin()));
85  } else {
86  thePrimaryV = Vertex(bs.position(), bs.covariance3D());
87  }
88 
90  iEvent.getByToken(muons_, muons);
91 
93  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", theTTBuilder);
94  KalmanVertexFitter vtxFitter(true);
95  TrackCollection muonLess;
96 
97  // JPsi candidates only from muons
98  for (View<pat::Muon>::const_iterator it = muons->begin(), itend = muons->end(); it != itend; ++it) {
99  // both must pass low quality
100  if (!lowerPuritySelection_(*it))
101  continue;
102  for (View<pat::Muon>::const_iterator it2 = it + 1; it2 != itend; ++it2) {
103  // both must pass low quality
104  if (!lowerPuritySelection_(*it2))
105  continue;
106  // one must pass tight quality
107  if (!(higherPuritySelection_(*it) || higherPuritySelection_(*it2)))
108  continue;
109 
111  vector<TransientVertex> pvs;
112 
113  // ---- no explicit order defined ----
114  myCand.addDaughter(*it, "muon1");
115  myCand.addDaughter(*it2, "muon2");
116 
117  // ---- define and set candidate's 4momentum ----
118  LorentzVector jpsi = it->p4() + it2->p4();
119  myCand.setP4(jpsi);
120  myCand.setCharge(it->charge() + it2->charge());
121 
122  // ---- apply the dimuon cut ----
123  if (!dimuonSelection_(myCand))
124  continue;
125 
126  // ---- fit vertex using Tracker tracks (if they have tracks) ----
127  if (it->track().isNonnull() && it2->track().isNonnull()) {
128  //build the dimuon secondary vertex
129  vector<TransientTrack> t_tks;
130  t_tks.push_back(theTTBuilder->build(
131  *it->track())); // pass the reco::Track, not the reco::TrackRef (which can be transient)
132  t_tks.push_back(theTTBuilder->build(*it2->track())); // otherwise the vertex will have transient refs inside.
133  TransientVertex myVertex = vtxFitter.vertex(t_tks);
134 
135  CachingVertex<5> VtxForInvMass = vtxFitter.vertex(t_tks);
136 
137  Measurement1D MassWErr(jpsi.M(), -9999.);
138  if (field->nominalValue() > 0) {
139  MassWErr = massCalculator.invariantMass(VtxForInvMass, muMasses);
140  } else {
141  myVertex = TransientVertex(); // with no arguments it is invalid
142  }
143 
144  myCand.addUserFloat("MassErr", MassWErr.error());
145 
146  if (myVertex.isValid()) {
147  float vChi2 = myVertex.totalChiSquared();
148  float vNDF = myVertex.degreesOfFreedom();
149  float vProb(TMath::Prob(vChi2, (int)vNDF));
150 
151  myCand.addUserFloat("vNChi2", vChi2 / vNDF);
152  myCand.addUserFloat("vProb", vProb);
153 
154  TVector3 vtx;
155  TVector3 pvtx;
156  VertexDistanceXY vdistXY;
157 
158  vtx.SetXYZ(myVertex.position().x(), myVertex.position().y(), 0);
159  TVector3 pperp(jpsi.px(), jpsi.py(), 0);
160  AlgebraicVector3 vpperp(pperp.x(), pperp.y(), 0);
161 
162  if (resolveAmbiguity_) {
163  float minDz = 999999.;
165  bool status = ttmd.calculate(
167  GlobalPoint(myVertex.position().x(), myVertex.position().y(), myVertex.position().z()),
168  GlobalVector(myCand.px(), myCand.py(), myCand.pz()),
169  TrackCharge(0),
170  &(*magneticField)),
171  GlobalTrajectoryParameters(GlobalPoint(bs.position().x(), bs.position().y(), bs.position().z()),
172  GlobalVector(bs.dxdz(), bs.dydz(), 1.),
173  TrackCharge(0),
174  &(*magneticField)));
175  float extrapZ = -9E20;
176  if (status)
177  extrapZ = ttmd.points().first.z();
178 
179  for (VertexCollection::const_iterator itv = priVtxs->begin(), itvend = priVtxs->end(); itv != itvend;
180  ++itv) {
181  float deltaZ = fabs(extrapZ - itv->position().z());
182  if (deltaZ < minDz) {
183  minDz = deltaZ;
184  thePrimaryV = Vertex(*itv);
185  }
186  }
187  }
188 
189  Vertex theOriginalPV = thePrimaryV;
190 
191  muonLess.clear();
192  muonLess.reserve(thePrimaryV.tracksSize());
193  if (addMuonlessPrimaryVertex_ && thePrimaryV.tracksSize() > 2) {
194  // Primary vertex matched to the dimuon, now refit it removing the two muons
195  OniaVtxReProducer revertex(priVtxs, iEvent);
197  iEvent.getByToken(revtxtrks_, pvtracks);
198  if (!pvtracks.isValid()) {
199  std::cout << "pvtracks NOT valid " << std::endl;
200  } else {
201  edm::Handle<reco::BeamSpot> pvbeamspot;
202  iEvent.getByToken(revtxbs_, pvbeamspot);
203  if (pvbeamspot.id() != theBeamSpot.id())
204  edm::LogWarning("Inconsistency")
205  << "The BeamSpot used for PV reco is not the same used in this analyzer.";
206  // I need to go back to the reco::Muon object, as the TrackRef in the pat::Muon can be an embedded ref.
207  const reco::Muon *rmu1 = dynamic_cast<const reco::Muon *>(it->originalObject());
208  const reco::Muon *rmu2 = dynamic_cast<const reco::Muon *>(it2->originalObject());
209  // check that muons are truly from reco::Muons (and not, e.g., from PF Muons)
210  // also check that the tracks really come from the track collection used for the BS
211  if (rmu1 != nullptr && rmu2 != nullptr && rmu1->track().id() == pvtracks.id() &&
212  rmu2->track().id() == pvtracks.id()) {
213  // Save the keys of the tracks in the primary vertex
214  // std::vector<size_t> vertexTracksKeys;
215  // vertexTracksKeys.reserve(thePrimaryV.tracksSize());
216  if (thePrimaryV.hasRefittedTracks()) {
217  // Need to go back to the original tracks before taking the key
218  std::vector<reco::Track>::const_iterator itRefittedTrack = thePrimaryV.refittedTracks().begin();
219  std::vector<reco::Track>::const_iterator refittedTracksEnd = thePrimaryV.refittedTracks().end();
220  for (; itRefittedTrack != refittedTracksEnd; ++itRefittedTrack) {
221  if (thePrimaryV.originalTrack(*itRefittedTrack).key() == rmu1->track().key())
222  continue;
223  if (thePrimaryV.originalTrack(*itRefittedTrack).key() == rmu2->track().key())
224  continue;
225  // vertexTracksKeys.push_back(thePrimaryV.originalTrack(*itRefittedTrack).key());
226  muonLess.push_back(*(thePrimaryV.originalTrack(*itRefittedTrack)));
227  }
228  } else {
229  std::vector<reco::TrackBaseRef>::const_iterator itPVtrack = thePrimaryV.tracks_begin();
230  for (; itPVtrack != thePrimaryV.tracks_end(); ++itPVtrack)
231  if (itPVtrack->isNonnull()) {
232  if (itPVtrack->key() == rmu1->track().key())
233  continue;
234  if (itPVtrack->key() == rmu2->track().key())
235  continue;
236  // vertexTracksKeys.push_back(itPVtrack->key());
237  muonLess.push_back(**itPVtrack);
238  }
239  }
240  if (muonLess.size() > 1 && muonLess.size() < thePrimaryV.tracksSize()) {
241  pvs = revertex.makeVertices(muonLess, *pvbeamspot, iSetup);
242  if (!pvs.empty()) {
243  Vertex muonLessPV = Vertex(pvs.front());
244  thePrimaryV = muonLessPV;
245  }
246  }
247  }
248  }
249  }
250 
251  // count the number of high Purity tracks with pT > 900 MeV attached to the chosen vertex
252  double vertexWeight = -1., sumPTPV = -1.;
253  int countTksOfPV = -1;
254  const reco::Muon *rmu1 = dynamic_cast<const reco::Muon *>(it->originalObject());
255  const reco::Muon *rmu2 = dynamic_cast<const reco::Muon *>(it2->originalObject());
256  try {
257  for (reco::Vertex::trackRef_iterator itVtx = theOriginalPV.tracks_begin();
258  itVtx != theOriginalPV.tracks_end();
259  itVtx++)
260  if (itVtx->isNonnull()) {
261  const reco::Track &track = **itVtx;
262  if (!track.quality(reco::TrackBase::highPurity))
263  continue;
264  if (track.pt() < 0.5)
265  continue; //reject all rejects from counting if less than 900 MeV
266  TransientTrack tt = theTTBuilder->build(track);
267  pair<bool, Measurement1D> tkPVdist = IPTools::absoluteImpactParameter3D(tt, thePrimaryV);
268  if (!tkPVdist.first)
269  continue;
270  if (tkPVdist.second.significance() > 3)
271  continue;
272  if (track.ptError() / track.pt() > 0.1)
273  continue;
274  // do not count the two muons
275  if (rmu1 != nullptr && rmu1->innerTrack().key() == itVtx->key())
276  continue;
277  if (rmu2 != nullptr && rmu2->innerTrack().key() == itVtx->key())
278  continue;
279 
280  vertexWeight += theOriginalPV.trackWeight(*itVtx);
281  if (theOriginalPV.trackWeight(*itVtx) > 0.5) {
282  countTksOfPV++;
283  sumPTPV += track.pt();
284  }
285  }
286  } catch (std::exception &err) {
287  std::cout << " muon Selection%G�%@failed " << std::endl;
288  return;
289  }
290 
291  myCand.addUserInt("countTksOfPV", countTksOfPV);
292  myCand.addUserFloat("vertexWeight", (float)vertexWeight);
293  myCand.addUserFloat("sumPTPV", (float)sumPTPV);
294 
296  TrajectoryStateClosestToPoint mu1TS = t_tks[0].impactPointTSCP();
297  TrajectoryStateClosestToPoint mu2TS = t_tks[1].impactPointTSCP();
298  float dca = 1E20;
299  if (mu1TS.isValid() && mu2TS.isValid()) {
301  cApp.calculate(mu1TS.theState(), mu2TS.theState());
302  if (cApp.status())
303  dca = cApp.distance();
304  }
305  myCand.addUserFloat("DCA", dca);
307 
309  myCand.addUserData("muonlessPV", Vertex(thePrimaryV));
310  else
311  myCand.addUserData("PVwithmuons", thePrimaryV);
312 
313  // lifetime using PV
314  pvtx.SetXYZ(thePrimaryV.position().x(), thePrimaryV.position().y(), 0);
315  TVector3 vdiff = vtx - pvtx;
316  double cosAlpha = vdiff.Dot(pperp) / (vdiff.Perp() * pperp.Perp());
317  Measurement1D distXY = vdistXY.distance(Vertex(myVertex), thePrimaryV);
318  //double ctauPV = distXY.value()*cosAlpha*3.09688/pperp.Perp();
319  double ctauPV = distXY.value() * cosAlpha * myCand.mass() / pperp.Perp();
320  GlobalError v1e = (Vertex(myVertex)).error();
321  GlobalError v2e = thePrimaryV.error();
322  AlgebraicSymMatrix33 vXYe = v1e.matrix() + v2e.matrix();
323  //double ctauErrPV = sqrt(vXYe.similarity(vpperp))*3.09688/(pperp.Perp2());
324  double ctauErrPV = sqrt(ROOT::Math::Similarity(vpperp, vXYe)) * myCand.mass() / (pperp.Perp2());
325 
326  myCand.addUserFloat("ppdlPV", ctauPV);
327  myCand.addUserFloat("ppdlErrPV", ctauErrPV);
328  myCand.addUserFloat("cosAlpha", cosAlpha);
329 
330  // lifetime using BS
331  pvtx.SetXYZ(theBeamSpotV.position().x(), theBeamSpotV.position().y(), 0);
332  vdiff = vtx - pvtx;
333  cosAlpha = vdiff.Dot(pperp) / (vdiff.Perp() * pperp.Perp());
334  distXY = vdistXY.distance(Vertex(myVertex), theBeamSpotV);
335  //double ctauBS = distXY.value()*cosAlpha*3.09688/pperp.Perp();
336  double ctauBS = distXY.value() * cosAlpha * myCand.mass() / pperp.Perp();
337  GlobalError v1eB = (Vertex(myVertex)).error();
338  GlobalError v2eB = theBeamSpotV.error();
339  AlgebraicSymMatrix33 vXYeB = v1eB.matrix() + v2eB.matrix();
340  //double ctauErrBS = sqrt(vXYeB.similarity(vpperp))*3.09688/(pperp.Perp2());
341  double ctauErrBS = sqrt(ROOT::Math::Similarity(vpperp, vXYeB)) * myCand.mass() / (pperp.Perp2());
342 
343  myCand.addUserFloat("ppdlBS", ctauBS);
344  myCand.addUserFloat("ppdlErrBS", ctauErrBS);
345 
346  if (addCommonVertex_) {
347  myCand.addUserData("commonVertex", Vertex(myVertex));
348  }
349  } else {
350  myCand.addUserFloat("vNChi2", -1);
351  myCand.addUserFloat("vProb", -1);
352  myCand.addUserFloat("ppdlPV", -100);
353  myCand.addUserFloat("ppdlErrPV", -100);
354  myCand.addUserFloat("cosAlpha", -100);
355  myCand.addUserFloat("ppdlBS", -100);
356  myCand.addUserFloat("ppdlErrBS", -100);
357  myCand.addUserFloat("DCA", -1);
358  if (addCommonVertex_) {
359  myCand.addUserData("commonVertex", Vertex());
360  }
362  myCand.addUserData("muonlessPV", Vertex());
363  } else {
364  myCand.addUserData("PVwithmuons", Vertex());
365  }
366  }
367  }
368 
369  // ---- MC Truth, if enabled ----
370  if (addMCTruth_) {
371  reco::GenParticleRef genMu1 = it->genParticleRef();
372  reco::GenParticleRef genMu2 = it2->genParticleRef();
373  if (genMu1.isNonnull() && genMu2.isNonnull()) {
374  if (genMu1->numberOfMothers() > 0 && genMu2->numberOfMothers() > 0) {
375  reco::GenParticleRef mom1 = genMu1->motherRef();
376  reco::GenParticleRef mom2 = genMu2->motherRef();
377  if (mom1.isNonnull() && (mom1 == mom2)) {
378  myCand.setGenParticleRef(mom1); // set
379  myCand.embedGenParticle(); // and embed
380  std::pair<int, float> MCinfo = findJpsiMCInfo(mom1);
381  myCand.addUserInt("momPDGId", MCinfo.first);
382  myCand.addUserFloat("ppdlTrue", MCinfo.second);
383  } else {
384  myCand.addUserInt("momPDGId", 0);
385  myCand.addUserFloat("ppdlTrue", -99.);
386  }
387  } else {
390  consumes<reco::GenParticleCollection>((edm::InputTag) "genParticles");
391  iEvent.getByToken(genCands_, theGenParticles);
392  if (theGenParticles.isValid()) {
393  for (size_t iGenParticle = 0; iGenParticle < theGenParticles->size(); ++iGenParticle) {
394  const Candidate &genCand = (*theGenParticles)[iGenParticle];
395  if (genCand.pdgId() == 443 || genCand.pdgId() == 100443 || genCand.pdgId() == 553 ||
396  genCand.pdgId() == 100553 || genCand.pdgId() == 200553) {
397  reco::GenParticleRef mom1(theGenParticles, iGenParticle);
398  myCand.setGenParticleRef(mom1);
399  myCand.embedGenParticle();
400  std::pair<int, float> MCinfo = findJpsiMCInfo(mom1);
401  myCand.addUserInt("momPDGId", MCinfo.first);
402  myCand.addUserFloat("ppdlTrue", MCinfo.second);
403  }
404  }
405  } else {
406  myCand.addUserInt("momPDGId", 0);
407  myCand.addUserFloat("ppdlTrue", -99.);
408  }
409  }
410  } else {
411  myCand.addUserInt("momPDGId", 0);
412  myCand.addUserFloat("ppdlTrue", -99.);
413  }
414  }
415 
416  // ---- Push back output ----
417  oniaOutput->push_back(myCand);
418  }
419  }
420 
421  std::sort(oniaOutput->begin(), oniaOutput->end(), vPComparator_);
422 
423  iEvent.put(std::move(oniaOutput));
424 }

References IPTools::absoluteImpactParameter3D(), addCommonVertex_, reco::CompositeCandidate::addDaughter(), addMCTruth_, addMuonlessPrimaryVertex_, pat::PATObject< ObjectType >::addUserData(), pat::PATObject< ObjectType >::addUserFloat(), pat::PATObject< ObjectType >::addUserInt(), align::BeamSpot, cms::cuda::bs, TransientTrackBuilder::build(), TwoTrackMinimumDistance::calculate(), ClosestApproachInRPhi::calculate(), gather_cfg::cout, dimuonSelection_, VertexDistanceXY::distance(), ClosestApproachInRPhi::distance(), pat::PATObject< ObjectType >::embedGenParticle(), runTheMatrix::err, Measurement1D::error(), relativeConstraints::error, reco::Vertex::error(), cppFunctionSkipper::exception, findJpsiMCInfo(), edm::EventSetup::get(), get, reco::Vertex::hasRefittedTracks(), higherPuritySelection_, reco::TrackBase::highPurity, edm::ProductID::id(), edm::HandleBase::id(), edm::Ref< C, T, F >::id(), iEvent, reco::Muon::innerTrack(), InvariantMassFromVertex::invariantMass(), edm::Ref< C, T, F >::isNonnull(), edm::HandleBase::isValid(), TrajectoryStateClosestToPoint::isValid(), TransientVertex::isValid(), jpsi, edm::RefToBase< T >::key(), edm::Ref< C, T, F >::key(), lowerPuritySelection_, HLT_2018_cff::magneticField, OniaVtxReProducer::makeVertices(), reco::LeafCandidate::mass(), massCalculator, GlobalErrorBase< T, ErrorWeightType >::matrix(), pfMETCorrectionType0_cfi::minDz, eostools::move(), PDWG_BPHSkim_cff::muons, muons_, MagneticField::nominalValue(), reco::Vertex::originalTrack(), reco::Candidate::pdgId(), TwoTrackMinimumDistance::points(), reco::Vertex::position(), TransientVertex::position(), FSQDQM_cfi::pvs, reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::LeafCandidate::pz(), reco::Vertex::refittedTracks(), resolveAmbiguity_, revtxbs_, revtxtrks_, reco::LeafCandidate::setCharge(), pat::PATObject< ObjectType >::setGenParticleRef(), reco::LeafCandidate::setP4(), mathSSE::sqrt(), ClosestApproachInRPhi::status(), mps_update::status, thebeamspot_, thePVs_, TrajectoryStateClosestToPoint::theState(), reco::Muon::track(), HLT_2018_cff::track, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), reco::Vertex::tracksSize(), reco::Vertex::trackWeight(), groupFilesInBlocks::tt, Measurement1D::value(), HltBtagValidation_cff::Vertex, KalmanVertexFitter::vertex(), vPComparator_, badGlobalMuonTaggersAOD_cff::vtx, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Member Data Documentation

◆ addCommonVertex_

bool Onia2MuMuPAT::addCommonVertex_
private

Definition at line 56 of file Onia2MuMuPAT.h.

Referenced by produce().

◆ addMCTruth_

bool Onia2MuMuPAT::addMCTruth_
private

Definition at line 58 of file Onia2MuMuPAT.h.

Referenced by produce().

◆ addMuonlessPrimaryVertex_

bool Onia2MuMuPAT::addMuonlessPrimaryVertex_
private

Definition at line 56 of file Onia2MuMuPAT.h.

Referenced by produce().

◆ dimuonSelection_

StringCutObjectSelector<reco::Candidate, true> Onia2MuMuPAT::dimuonSelection_
private

Definition at line 55 of file Onia2MuMuPAT.h.

Referenced by produce().

◆ higherPuritySelection_

StringCutObjectSelector<pat::Muon> Onia2MuMuPAT::higherPuritySelection_
private

Definition at line 53 of file Onia2MuMuPAT.h.

Referenced by produce().

◆ lowerPuritySelection_

StringCutObjectSelector<pat::Muon> Onia2MuMuPAT::lowerPuritySelection_
private

Definition at line 54 of file Onia2MuMuPAT.h.

Referenced by produce().

◆ massCalculator

InvariantMassFromVertex Onia2MuMuPAT::massCalculator
private

Definition at line 61 of file Onia2MuMuPAT.h.

Referenced by produce().

◆ muons_

edm::EDGetTokenT<edm::View<pat::Muon> > Onia2MuMuPAT::muons_
private

Definition at line 48 of file Onia2MuMuPAT.h.

Referenced by produce().

◆ resolveAmbiguity_

bool Onia2MuMuPAT::resolveAmbiguity_
private

Definition at line 57 of file Onia2MuMuPAT.h.

Referenced by produce().

◆ revtxbs_

edm::EDGetTokenT<reco::BeamSpot> Onia2MuMuPAT::revtxbs_
private

Definition at line 52 of file Onia2MuMuPAT.h.

Referenced by Onia2MuMuPAT(), and produce().

◆ revtxtrks_

edm::EDGetTokenT<reco::TrackCollection> Onia2MuMuPAT::revtxtrks_
private

Definition at line 51 of file Onia2MuMuPAT.h.

Referenced by Onia2MuMuPAT(), and produce().

◆ thebeamspot_

edm::EDGetTokenT<reco::BeamSpot> Onia2MuMuPAT::thebeamspot_
private

Definition at line 49 of file Onia2MuMuPAT.h.

Referenced by produce().

◆ thePVs_

edm::EDGetTokenT<reco::VertexCollection> Onia2MuMuPAT::thePVs_
private

Definition at line 50 of file Onia2MuMuPAT.h.

Referenced by produce().

◆ vPComparator_

GreaterByVProb<pat::CompositeCandidate> Onia2MuMuPAT::vPComparator_
private

Definition at line 59 of file Onia2MuMuPAT.h.

Referenced by produce().

reco::Vertex::trackRef_iterator
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:38
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
reco::Vertex::originalTrack
TrackBaseRef originalTrack(const Track &refTrack) const
Definition: Vertex.cc:96
AlgebraicVector3
ROOT::Math::SVector< double, 3 > AlgebraicVector3
Definition: AlgebraicROOTObjects.h:12
Measurement1D
Definition: Measurement1D.h:11
AlgebraicSymMatrix33
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
Definition: AlgebraicROOTObjects.h:21
Onia2MuMuPAT::thebeamspot_
edm::EDGetTokenT< reco::BeamSpot > thebeamspot_
Definition: Onia2MuMuPAT.h:49
TrackCharge
int TrackCharge
Definition: TrackCharge.h:4
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
ClosestApproachInRPhi::status
bool status() const override
Definition: ClosestApproachInRPhi.h:37
edm::RefToBase::key
size_t key() const
Definition: RefToBase.h:219
TransientVertex::isValid
bool isValid() const
Definition: TransientVertex.h:195
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
HLT_2018_cff.magneticField
magneticField
Definition: HLT_2018_cff.py:348
mps_update.status
status
Definition: mps_update.py:69
CachingVertex< 5 >
edm::EDGetTokenT< reco::GenParticleCollection >
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
pat::CompositeCandidate
Analysis-level particle class.
Definition: CompositeCandidate.h:31
edm
HLT enums.
Definition: AlignableModifier.h:19
Measurement1D::value
double value() const
Definition: Measurement1D.h:25
IPTools::absoluteImpactParameter3D
std::pair< bool, Measurement1D > absoluteImpactParameter3D(const reco::TransientTrack &transientTrack, const reco::Vertex &vertex)
Definition: IPTools.cc:38
gather_cfg.cout
cout
Definition: gather_cfg.py:144
TwoTrackMinimumDistance
Definition: TwoTrackMinimumDistance.h:20
pat::CompositeCandidateCollection
std::vector< CompositeCandidate > CompositeCandidateCollection
Definition: CompositeCandidate.h:22
TransientVertex::position
GlobalPoint position() const
Definition: TransientVertex.h:169
reco::Vertex::position
const Point & position() const
position
Definition: Vertex.h:114
Onia2MuMuPAT::findJpsiMCInfo
std::pair< int, float > findJpsiMCInfo(reco::GenParticleRef genJpsi)
Definition: Onia2MuMuPAT.cc:439
pat::PATObject::addUserInt
void addUserInt(const std::string &label, int32_t data, const bool overwrite=false)
Set user-defined int.
Definition: PATObject.h:934
GlobalErrorBase::matrix
const AlgebraicSymMatrix33 matrix() const
Definition: GlobalErrorBase.h:121
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:160
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
edm::Handle
Definition: AssociativeIterator.h:50
relativeConstraints.error
error
Definition: relativeConstraints.py:53
reco::Muon
Definition: Muon.h:27
edm::Ref< GenParticleCollection >
TwoTrackMinimumDistance::calculate
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
Definition: TwoTrackMinimumDistance.cc:83
Onia2MuMuPAT::vPComparator_
GreaterByVProb< pat::CompositeCandidate > vPComparator_
Definition: Onia2MuMuPAT.h:59
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
Onia2MuMuPAT::isAbHadron
bool isAbHadron(int pdgID)
Definition: Onia2MuMuPAT.cc:426
Onia2MuMuPAT::isAMixedbHadron
bool isAMixedbHadron(int pdgID, int momPdgID)
Definition: Onia2MuMuPAT.cc:432
cms::cuda::bs
bs
Definition: HistoContainer.h:127
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
ClosestApproachInRPhi::calculate
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
Definition: ClosestApproachInRPhi.cc:8
reco::LeafCandidate::py
double py() const final
y coordinate of momentum vector
Definition: LeafCandidate.h:142
pat::PATObject::addUserData
void addUserData(const std::string &label, const T &data, bool transientOnly=false, bool overwrite=false)
Definition: PATObject.h:353
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::Vertex::tracks_end
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:73
reco::BeamSpot
Definition: BeamSpot.h:21
TransientTrackRecord
Definition: TransientTrackRecord.h:11
reco::Track
Definition: Track.h:27
edm::ESHandle< MagneticField >
MagneticField::nominalValue
int nominalValue() const
The nominal field value for this map in kGauss.
Definition: MagneticField.h:49
ClosestApproachInRPhi
Definition: ClosestApproachInRPhi.h:26
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
InvariantMassFromVertex::invariantMass
Measurement1D invariantMass(const CachingVertex< 5 > &vertex, const std::vector< double > &masses) const
Definition: InvariantMassFromVertex.cc:57
reco::CompositeCandidate::addDaughter
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
Definition: CompositeCandidate.cc:108
reco::Vertex::refittedTracks
const std::vector< Track > & refittedTracks() const
Returns the container of refitted tracks.
Definition: Vertex.h:183
Onia2MuMuPAT::revtxbs_
edm::EDGetTokenT< reco::BeamSpot > revtxbs_
Definition: Onia2MuMuPAT.h:52
reco::Vertex::hasRefittedTracks
bool hasRefittedTracks() const
Checks whether refitted tracks are stored.
Definition: Vertex.h:168
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TwoTrackMinimumDistance::points
std::pair< GlobalPoint, GlobalPoint > points() const override
Definition: TwoTrackMinimumDistance.cc:75
edm::LogWarning
Definition: MessageLogger.h:141
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
edm::View
Definition: CaloClusterFwd.h:14
reco::LeafCandidate::mass
double mass() const final
mass
Definition: LeafCandidate.h:131
Onia2MuMuPAT::muons_
edm::EDGetTokenT< edm::View< pat::Muon > > muons_
Definition: Onia2MuMuPAT.h:48
Onia2MuMuPAT::revtxtrks_
edm::EDGetTokenT< reco::TrackCollection > revtxtrks_
Definition: Onia2MuMuPAT.h:51
Onia2MuMuPAT::higherPuritySelection_
StringCutObjectSelector< pat::Muon > higherPuritySelection_
Definition: Onia2MuMuPAT.h:53
reco::Vertex::tracks_begin
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:71
runTheMatrix.err
err
Definition: runTheMatrix.py:288
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
Onia2MuMuPAT::lowerPuritySelection_
StringCutObjectSelector< pat::Muon > lowerPuritySelection_
Definition: Onia2MuMuPAT.h:54
reco::Vertex::tracksSize
size_t tracksSize() const
number of tracks
Definition: Vertex.cc:69
iEvent
int iEvent
Definition: GenABIO.cc:224
jpsi
#define jpsi
Definition: CascadeWrapper.h:46
pat::PATObject::addUserFloat
void addUserFloat(const std::string &label, float data, const bool overwrite=false)
Set user-defined float.
Definition: PATObject.h:897
reco::Vertex::error
Error error() const
return SMatrix
Definition: Vertex.h:150
GlobalErrorBase< double, ErrorMatrixTag >
TransientVertex
Definition: TransientVertex.h:18
TrajectoryStateClosestToPoint
Definition: TrajectoryStateClosestToPoint.h:18
VertexDistanceXY
Definition: VertexDistanceXY.h:11
pat::PATObject::setGenParticleRef
void setGenParticleRef(const reco::GenParticleRef &ref, bool embed=false)
Set the generator level particle reference.
Definition: PATObject.h:748
get
#define get
FSQDQM_cfi.pvs
pvs
Definition: FSQDQM_cfi.py:12
reco::Candidate::pdgId
virtual int pdgId() const =0
PDG identifier.
reco::Candidate
Definition: Candidate.h:27
reco::JetExtendedAssociation::LorentzVector
math::PtEtaPhiELorentzVectorF LorentzVector
Definition: JetExtendedAssociation.h:25
reco::Muon::track
TrackRef track() const override
reference to a Track
Definition: Muon.h:46
reco::Vertex::trackWeight
float trackWeight(const TREF &r) const
returns the weight with which a Track has contributed to the vertex-fit.
Definition: Vertex.h:85
reco::Muon::innerTrack
virtual TrackRef innerTrack() const
Definition: Muon.h:45
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
edm::Ref::id
ProductID id() const
Accessor for product ID.
Definition: Ref.h:244
reco::LeafCandidate::setP4
void setP4(const LorentzVector &p4) final
set 4-momentum
Definition: LeafCandidate.h:158
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
HltBtagValidation_cff.Vertex
Vertex
Definition: HltBtagValidation_cff.py:32
reco::TransientTrack
Definition: TransientTrack.h:19
VertexDistanceXY::distance
Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const override
Definition: VertexDistanceXY.cc:19
Onia2MuMuPAT::resolveAmbiguity_
bool resolveAmbiguity_
Definition: Onia2MuMuPAT.h:57
LorentzVector
math::XYZTLorentzVector LorentzVector
Definition: HLTMuonMatchAndPlot.h:49
reco::LeafCandidate::setCharge
void setCharge(Charge q) final
set electric charge
Definition: LeafCandidate.h:108
Onia2MuMuPAT::dimuonSelection_
StringCutObjectSelector< reco::Candidate, true > dimuonSelection_
Definition: Onia2MuMuPAT.h:55
OniaVtxReProducer
Definition: OniaVtxReProducer.h:15
TrajectoryStateClosestToPoint::isValid
bool isValid() const
Definition: TrajectoryStateClosestToPoint.h:111
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
TransientTrackBuilder::build
reco::TransientTrack build(const reco::Track *p) const
Definition: TransientTrackBuilder.cc:20
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
Onia2MuMuPAT::addMuonlessPrimaryVertex_
bool addMuonlessPrimaryVertex_
Definition: Onia2MuMuPAT.h:56
mps_fire.result
result
Definition: mps_fire.py:303
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:126
Onia2MuMuPAT::thePVs_
edm::EDGetTokenT< reco::VertexCollection > thePVs_
Definition: Onia2MuMuPAT.h:50
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
TrajectoryStateClosestToPoint::theState
const FreeTrajectoryState & theState() const
Definition: TrajectoryStateClosestToPoint.h:96
pat::PATObject::embedGenParticle
void embedGenParticle()
Definition: PATObject.h:773
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
MagneticField
Definition: MagneticField.h:19
ClosestApproachInRPhi::distance
float distance() const override
Definition: ClosestApproachInRPhi.cc:54
reco::LeafCandidate::px
double px() const final
x coordinate of momentum vector
Definition: LeafCandidate.h:140
edm::HandleBase::id
ProductID id() const
Definition: HandleBase.cc:13
reco::LeafCandidate::pz
double pz() const final
z coordinate of momentum vector
Definition: LeafCandidate.h:144
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
reco::Vertex
Definition: Vertex.h:35
Onia2MuMuPAT::massCalculator
InvariantMassFromVertex massCalculator
Definition: Onia2MuMuPAT.h:61
Onia2MuMuPAT::addCommonVertex_
bool addCommonVertex_
Definition: Onia2MuMuPAT.h:56
pfMETCorrectionType0_cfi.minDz
minDz
Definition: pfMETCorrectionType0_cfi.py:52
Onia2MuMuPAT::addMCTruth_
bool addMCTruth_
Definition: Onia2MuMuPAT.h:58
KalmanVertexFitter
Definition: KalmanVertexFitter.h:22
edm::ProductID::id
ProductIndex id() const
Definition: ProductID.h:35
reco::TrackBase::highPurity
Definition: TrackBase.h:154