CMS 3D CMS Logo

Onia2MuMuPAT.cc
Go to the documentation of this file.
2 
3 //Headers for the data items
12 
13 //Headers for services and tools
18 #include "TMath.h"
19 #include "Math/VectorUtil.h"
20 #include "TVector3.h"
22 
28 
30  : muons_(consumes<edm::View<pat::Muon>>(iConfig.getParameter<edm::InputTag>("muons"))),
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")),
35  dimuonSelection_(
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 }
46 
48  // do anything here that needs to be done at desctruction time
49  // (e.g. close files, deallocate resources etc.)
50 }
51 
52 //
53 // member functions
54 //
55 
56 // ------------ method called to produce the data ------------
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 }
425 
426 bool Onia2MuMuPAT::isAbHadron(int pdgID) {
427  if (abs(pdgID) == 511 || abs(pdgID) == 521 || abs(pdgID) == 531 || abs(pdgID) == 5122)
428  return true;
429  return false;
430 }
431 
432 bool Onia2MuMuPAT::isAMixedbHadron(int pdgID, int momPdgID) {
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 }
438 
439 std::pair<int, float> Onia2MuMuPAT::findJpsiMCInfo(reco::GenParticleRef genJpsi) {
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 }
494 
495 // ------------ method called once each job just before starting event loop ------------
497 
498 // ------------ method called once each job just after ending the event loop ------------
500 
501 //define this as a plug-in
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
KalmanVertexFitter::vertex
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
Definition: KalmanVertexFitter.h:49
Measurement1D
Definition: Measurement1D.h:11
AlgebraicSymMatrix33
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
Definition: AlgebraicROOTObjects.h:21
electrons_cff.bool
bool
Definition: electrons_cff.py:372
Muon.h
Onia2MuMuPAT::thebeamspot_
edm::EDGetTokenT< reco::BeamSpot > thebeamspot_
Definition: Onia2MuMuPAT.h:49
TrackCharge
int TrackCharge
Definition: TrackCharge.h:4
KalmanVertexFitter.h
align::BeamSpot
Definition: StructureType.h:89
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
sistrip::View
View
Definition: ConstantsForView.h:26
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 >
Onia2MuMuPAT::~Onia2MuMuPAT
~Onia2MuMuPAT() override
Definition: Onia2MuMuPAT.cc:47
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
Muon.h
IPTools::absoluteImpactParameter3D
std::pair< bool, Measurement1D > absoluteImpactParameter3D(const reco::TransientTrack &transientTrack, const reco::Vertex &vertex)
Definition: IPTools.cc:38
Onia2MuMuPAT::endJob
void endJob() override
Definition: Onia2MuMuPAT.cc:499
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
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
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
Muon
Definition: Muon.py:1
TwoTrackMinimumDistance.h
reco::Muon
Definition: Muon.h:27
edm::Ref< GenParticleCollection >
TwoTrackMinimumDistance::calculate
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
Definition: TwoTrackMinimumDistance.cc:83
GenParticle.h
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
Track.h
ClosestApproachInRPhi.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
TrackFwd.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
VertexDistanceXY.h
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
MuonFwd.h
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
TransientTrackRecord
Definition: TransientTrackRecord.h:11
reco::Track
Definition: Track.h:27
IdealMagneticFieldRecord.h
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
OniaVtxReProducer.h
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
Measurement1D::error
double error() const
Definition: Measurement1D.h:27
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
Onia2MuMuPAT::beginJob
void beginJob() override
Definition: Onia2MuMuPAT.cc:496
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
TransientTrackBuilder.h
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
Onia2MuMuPAT::Onia2MuMuPAT
Onia2MuMuPAT(const edm::ParameterSet &)
Definition: Onia2MuMuPAT.cc:29
edm::ParameterSet
Definition: ParameterSet.h:36
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
Onia2MuMuPAT::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: Onia2MuMuPAT.cc:57
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 >
MagneticField.h
TransientVertex
Definition: TransientVertex.h:18
edm::EventSetup
Definition: EventSetup.h:57
pat
Definition: HeavyIon.h:7
TrajectoryStateClosestToPoint
Definition: TrajectoryStateClosestToPoint.h:18
VertexDistanceXY
Definition: VertexDistanceXY.h:11
TransientTrackRecord.h
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.
Onia2MuMuPAT
Definition: Onia2MuMuPAT.h:33
reco::Candidate
Definition: Candidate.h:27
reco::JetExtendedAssociation::LorentzVector
math::PtEtaPhiELorentzVectorF LorentzVector
Definition: JetExtendedAssociation.h:25
VertexFwd.h
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::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
IPTools.h
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
OniaVtxReProducer::makeVertices
std::vector< TransientVertex > makeVertices(const reco::TrackCollection &tracks, const reco::BeamSpot &bs, const edm::EventSetup &iSetup) const
Make the vertices.
Definition: OniaVtxReProducer.cc:72
Onia2MuMuPAT.h
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
View.h
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
edm::Event
Definition: Event.h:73
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