CMS 3D CMS Logo

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

#include <HLTmumutkVtxProducer.h>

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

Public Member Functions

 HLTmumutkVtxProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HLTmumutkVtxProducer () override=default
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

bool checkPreviousCand (const reco::TrackRef &trackref, const std::vector< reco::RecoChargedCandidateRef > &ref2) const
 
bool overlap (const reco::TrackRef &trackref1, const reco::TrackRef &trackref2)
 

Static Private Member Functions

static FreeTrajectoryState initialFreeState (const reco::Track &, const MagneticField *)
 

Private Attributes

const edm::InputTag beamSpotTag_
 
const edm::EDGetTokenT< reco::BeamSpotbeamSpotToken_
 
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecordidealMagneticFieldRecordToken_
 
const double maxEta_
 
const double maxInvMass_
 
const std::string mfName_
 
const double minD0Significance_
 
const double minInvMass_
 
const double minPt_
 
const edm::InputTag muCandTag_
 
const edm::EDGetTokenT< reco::RecoChargedCandidateCollectionmuCandToken_
 
const double overlapDR2_
 
const edm::InputTag previousCandTag_
 
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefspreviousCandToken_
 
const double thirdTrackMass_
 
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecordtransientTrackRecordToken_
 
const edm::InputTag trkCandTag_
 
const edm::EDGetTokenT< reco::RecoChargedCandidateCollectiontrkCandToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

HLT Filter for b to (mumu) + X

Implementation: <Notes on="" implementation>="">

Definition at line 46 of file HLTmumutkVtxProducer.h.

Constructor & Destructor Documentation

◆ HLTmumutkVtxProducer()

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

Definition at line 25 of file HLTmumutkVtxProducer.cc.

26  : transientTrackRecordToken_(esConsumes(edm::ESInputTag("", "TransientTrackBuilder"))),
27  muCandTag_(iConfig.getParameter<edm::InputTag>("MuCand")),
28  muCandToken_(consumes<reco::RecoChargedCandidateCollection>(muCandTag_)),
29  trkCandTag_(iConfig.getParameter<edm::InputTag>("TrackCand")),
30  trkCandToken_(consumes<reco::RecoChargedCandidateCollection>(trkCandTag_)),
31  previousCandTag_(iConfig.getParameter<edm::InputTag>("PreviousCandTag")),
32  previousCandToken_(consumes<trigger::TriggerFilterObjectWithRefs>(previousCandTag_)),
33  mfName_(iConfig.getParameter<std::string>("SimpleMagneticField")),
35  thirdTrackMass_(iConfig.getParameter<double>("ThirdTrackMass")),
36  maxEta_(iConfig.getParameter<double>("MaxEta")),
37  minPt_(iConfig.getParameter<double>("MinPt")),
38  minInvMass_(iConfig.getParameter<double>("MinInvMass")),
39  maxInvMass_(iConfig.getParameter<double>("MaxInvMass")),
40  minD0Significance_(iConfig.getParameter<double>("MinD0Significance")),
41  // minimum delta-R^2 threshold (with sign) for non-overlapping tracks
42  overlapDR2_(iConfig.getParameter<double>("OverlapDR") * std::abs(iConfig.getParameter<double>("OverlapDR"))),
43  beamSpotTag_(iConfig.getParameter<edm::InputTag>("BeamSpotTag")),
44  beamSpotToken_(consumes<reco::BeamSpot>(beamSpotTag_)) {
45  produces<VertexCollection>();
46 }
const std::string mfName_
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > idealMagneticFieldRecordToken_
const edm::InputTag beamSpotTag_
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transientTrackRecordToken_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > trkCandToken_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const edm::InputTag previousCandTag_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > muCandToken_
const edm::InputTag trkCandTag_
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
const edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
const edm::InputTag muCandTag_

◆ ~HLTmumutkVtxProducer()

HLTmumutkVtxProducer::~HLTmumutkVtxProducer ( )
overridedefault

Member Function Documentation

◆ checkPreviousCand()

bool HLTmumutkVtxProducer::checkPreviousCand ( const reco::TrackRef trackref,
const std::vector< reco::RecoChargedCandidateRef > &  ref2 
) const
private

Definition at line 226 of file HLTmumutkVtxProducer.cc.

References mps_fire::i, and convertSQLiteXML::ok.

Referenced by produce().

227  {
228  bool ok = false;
229  for (auto& i : refVect) {
230  if (i->get<TrackRef>() == trackref) {
231  ok = true;
232  break;
233  }
234  }
235  return ok;
236 }

◆ fillDescriptions()

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

Definition at line 48 of file HLTmumutkVtxProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

48  {
50  desc.add<edm::InputTag>("MuCand", edm::InputTag("hltMuTracks"));
51  desc.add<edm::InputTag>("TrackCand", edm::InputTag("hltMumukAllConeTracks"));
52  desc.add<edm::InputTag>("PreviousCandTag", edm::InputTag("hltDisplacedmumuFilterDoubleMu4Jpsi"));
53  desc.add<std::string>("SimpleMagneticField", "");
54  desc.add<double>("ThirdTrackMass", 0.493677);
55  desc.add<double>("MaxEta", 2.5);
56  desc.add<double>("MinPt", 3.0);
57  desc.add<double>("MinInvMass", 0.0);
58  desc.add<double>("MaxInvMass", 99999.);
59  desc.add<double>("MinD0Significance", 0.0);
60  desc.add<double>("OverlapDR", 1.44e-4);
61  desc.add<edm::InputTag>("BeamSpotTag", edm::InputTag("hltOfflineBeamSpot"));
62  descriptions.add("HLTmumutkVtxProducer", desc);
63 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ initialFreeState()

FreeTrajectoryState HLTmumutkVtxProducer::initialFreeState ( const reco::Track tk,
const MagneticField field 
)
staticprivate

Definition at line 212 of file HLTmumutkVtxProducer.cc.

References reco::TrackBase::charge(), reco::TrackBase::covariance(), submitPVResolutionJobs::err, reco::TrackBase::momentum(), and reco::TrackBase::vertex().

Referenced by produce().

212  {
214  GlobalPoint gpos(pos);
215  Basic3DVector<float> mom(tk.momentum());
216  GlobalVector gmom(mom);
217  GlobalTrajectoryParameters par(gpos, gmom, tk.charge(), field);
219  return FreeTrajectoryState(par, err);
220 }
int charge() const
track electric charge
Definition: TrackBase.h:596
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:716
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition: TrackBase.h:676
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664

◆ overlap()

bool HLTmumutkVtxProducer::overlap ( const reco::TrackRef trackref1,
const reco::TrackRef trackref2 
)
private

Definition at line 222 of file HLTmumutkVtxProducer.cc.

References reco::deltaR2(), and overlapDR2_.

Referenced by produce().

222  {
223  return (reco::deltaR2(trackref1->eta(), trackref1->phi(), trackref2->eta(), trackref2->phi()) < overlapDR2_);
224 }
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16

◆ produce()

void HLTmumutkVtxProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 65 of file HLTmumutkVtxProducer.cc.

References funct::abs(), beamSpotToken_, checkPreviousCand(), StorageManager_cfg::e1, SiPixelPhase1Clusters_cfi::e3, edm::Ref< C, T, F >::get(), edm::EventSetup::getHandle(), trigger::TriggerRefsCollections::getObjects(), idealMagneticFieldRecordToken_, iEvent, initialFreeState(), TransientVertex::isValid(), LogDebug, maxEta_, maxInvMass_, minD0Significance_, minInvMass_, minPt_, eostools::move(), muCandToken_, overlap(), AlCaHLTBitMon_ParallelJobs::p, LaserDQM_cfg::p1, SiStripOfflineCRack_cfg::p2, chargedHadronTrackResolutionFilter_cfi::p3, previousCandToken_, Measurement1D::significance(), mathSSE::sqrt(), thirdTrackMass_, transientTrackRecordToken_, TrajectoryStateClosestToBeamLine::transverseImpactParameter(), trigger::TriggerMuon, trkCandToken_, bphysicsOniaDQM_cfi::vertex, KalmanVertexFitter::vertex(), and spclusmultinvestigator_cfi::vertexCollection.

65  {
66  const double MuMass(0.106);
67  const double MuMass2(MuMass * MuMass);
68  const double thirdTrackMass2(thirdTrackMass_ * thirdTrackMass_);
69 
70  // get hold of muon trks
72  iEvent.getByToken(muCandToken_, mucands);
73 
74  // get the transient track builder
75  auto const& theB = iSetup.getHandle(transientTrackRecordToken_);
76 
77  //get the beamspot position
78  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
79  iEvent.getByToken(beamSpotToken_, recoBeamSpotHandle);
80 
81  //get the b field
82  auto const& bFieldHandle = iSetup.getHandle(idealMagneticFieldRecordToken_);
83  const MagneticField* magField = bFieldHandle.product();
84  TSCBLBuilderNoMaterial blsBuilder;
85 
86  // get track candidates around displaced muons
88  iEvent.getByToken(trkCandToken_, trkcands);
89 
90  unique_ptr<VertexCollection> vertexCollection(new VertexCollection());
91 
92  // Ref to Candidate object to be recorded in filter object
96 
97  double e1, e2, e3;
99 
100  if (mucands->size() < 2)
101  return;
102  if (trkcands->empty())
103  return;
104 
105  RecoChargedCandidateCollection::const_iterator mucand1;
106  RecoChargedCandidateCollection::const_iterator mucand2;
107  RecoChargedCandidateCollection::const_iterator trkcand;
108 
109  // get the objects passing the previous filter
111  iEvent.getByToken(previousCandToken_, previousCands);
112 
113  vector<RecoChargedCandidateRef> vPrevCands;
114  previousCands->getObjects(TriggerMuon, vPrevCands);
115 
116  for (mucand1 = mucands->begin(); mucand1 != mucands->end(); ++mucand1) {
117  TrackRef trk1 = mucand1->get<TrackRef>();
118  LogDebug("HLTmumutkVtxProducer") << " 1st muon: q*pt= " << trk1->charge() * trk1->pt() << ", eta= " << trk1->eta()
119  << ", hits= " << trk1->numberOfValidHits();
120 
121  //first check if this muon passed the previous filter
122  if (!checkPreviousCand(trk1, vPrevCands))
123  continue;
124 
125  // eta and pt cut
126  if (fabs(trk1->eta()) > maxEta_)
127  continue;
128  if (trk1->pt() < minPt_)
129  continue;
130 
131  mucand2 = mucand1;
132  ++mucand2;
133  for (; mucand2 != mucands->end(); mucand2++) {
134  TrackRef trk2 = mucand2->get<TrackRef>();
135 
136  LogDebug("HLTDisplacedMumukFilter") << " 2nd muon: q*pt= " << trk2->charge() * trk2->pt()
137  << ", eta= " << trk2->eta() << ", hits= " << trk2->numberOfValidHits();
138 
139  //first check if this muon passed the previous filter
140  if (!checkPreviousCand(trk2, vPrevCands))
141  continue;
142  // eta and pt cut
143  if (fabs(trk2->eta()) > maxEta_)
144  continue;
145  if (trk2->pt() < minPt_)
146  continue;
147 
148  //loop on track collection
149  for (trkcand = trkcands->begin(); trkcand != trkcands->end(); ++trkcand) {
150  TrackRef trk3 = trkcand->get<TrackRef>();
151  if (overlap(trk1, trk3))
152  continue;
153  if (overlap(trk2, trk3))
154  continue;
155 
156  LogDebug("HLTDisplacedMumukFilter") << " 3rd track: q*pt= " << trk3->charge() * trk3->pt()
157  << ", eta= " << trk3->eta() << ", hits= " << trk3->numberOfValidHits();
158 
159  // eta and pt cut
160  if (fabs(trk3->eta()) > maxEta_)
161  continue;
162  if (trk3->pt() < minPt_)
163  continue;
164 
165  // Combined system
166  e1 = sqrt(trk1->momentum().Mag2() + MuMass2);
167  e2 = sqrt(trk2->momentum().Mag2() + MuMass2);
168  e3 = sqrt(trk3->momentum().Mag2() + thirdTrackMass2);
169 
170  p1 = Particle::LorentzVector(trk1->px(), trk1->py(), trk1->pz(), e1);
171  p2 = Particle::LorentzVector(trk2->px(), trk2->py(), trk2->pz(), e2);
172  p3 = Particle::LorentzVector(trk3->px(), trk3->py(), trk3->pz(), e3);
173 
174  p = p1 + p2 + p3;
175 
176  //invariant mass cut
177  double invmass = abs(p.mass());
178  LogDebug("HLTDisplacedMumukFilter") << " Invmass= " << invmass;
179  if (invmass < minInvMass_)
180  continue;
181  if (invmass > maxInvMass_)
182  continue;
183 
184  // do the vertex fit
185  vector<TransientTrack> t_tks;
186  t_tks.push_back((*theB).build(&trk1));
187  t_tks.push_back((*theB).build(&trk2));
188  t_tks.push_back((*theB).build(&trk3));
189  if (t_tks.size() != 3)
190  continue;
191 
192  FreeTrajectoryState InitialFTS = initialFreeState(*trk3, magField);
193  TrajectoryStateClosestToBeamLine tscb(blsBuilder(InitialFTS, *recoBeamSpotHandle));
194  double d0sig = tscb.transverseImpactParameter().significance();
195  if (d0sig < minD0Significance_)
196  continue;
197 
198  KalmanVertexFitter kvf;
199  TransientVertex tv = kvf.vertex(t_tks);
200  if (!tv.isValid())
201  continue;
202  Vertex vertex = tv;
203 
204  // put vertex in the event
205  vertexCollection->push_back(vertex);
206  }
207  }
208  }
210 }
static FreeTrajectoryState initialFreeState(const reco::Track &, const MagneticField *)
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > idealMagneticFieldRecordToken_
std::vector< Vertex > VertexCollection
Definition: Vertex.h:31
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
bool overlap(const reco::TrackRef &trackref1, const reco::TrackRef &trackref2)
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transientTrackRecordToken_
int iEvent
Definition: GenABIO.cc:224
bool isValid() const
T sqrt(T t)
Definition: SSEVec.h:23
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > trkCandToken_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > muCandToken_
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
const edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
def move(src, dest)
Definition: eostools.py:511
math::PtEtaPhiELorentzVectorF LorentzVector
bool checkPreviousCand(const reco::TrackRef &trackref, const std::vector< reco::RecoChargedCandidateRef > &ref2) const
#define LogDebug(id)

Member Data Documentation

◆ beamSpotTag_

const edm::InputTag HLTmumutkVtxProducer::beamSpotTag_
private

Definition at line 80 of file HLTmumutkVtxProducer.h.

◆ beamSpotToken_

const edm::EDGetTokenT<reco::BeamSpot> HLTmumutkVtxProducer::beamSpotToken_
private

Definition at line 81 of file HLTmumutkVtxProducer.h.

Referenced by produce().

◆ idealMagneticFieldRecordToken_

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> HLTmumutkVtxProducer::idealMagneticFieldRecordToken_
private

Definition at line 70 of file HLTmumutkVtxProducer.h.

Referenced by produce().

◆ maxEta_

const double HLTmumutkVtxProducer::maxEta_
private

Definition at line 73 of file HLTmumutkVtxProducer.h.

Referenced by produce().

◆ maxInvMass_

const double HLTmumutkVtxProducer::maxInvMass_
private

Definition at line 76 of file HLTmumutkVtxProducer.h.

Referenced by produce().

◆ mfName_

const std::string HLTmumutkVtxProducer::mfName_
private

Definition at line 69 of file HLTmumutkVtxProducer.h.

◆ minD0Significance_

const double HLTmumutkVtxProducer::minD0Significance_
private

Definition at line 77 of file HLTmumutkVtxProducer.h.

Referenced by produce().

◆ minInvMass_

const double HLTmumutkVtxProducer::minInvMass_
private

Definition at line 75 of file HLTmumutkVtxProducer.h.

Referenced by produce().

◆ minPt_

const double HLTmumutkVtxProducer::minPt_
private

Definition at line 74 of file HLTmumutkVtxProducer.h.

Referenced by produce().

◆ muCandTag_

const edm::InputTag HLTmumutkVtxProducer::muCandTag_
private

Definition at line 62 of file HLTmumutkVtxProducer.h.

◆ muCandToken_

const edm::EDGetTokenT<reco::RecoChargedCandidateCollection> HLTmumutkVtxProducer::muCandToken_
private

Definition at line 63 of file HLTmumutkVtxProducer.h.

Referenced by produce().

◆ overlapDR2_

const double HLTmumutkVtxProducer::overlapDR2_
private

Definition at line 78 of file HLTmumutkVtxProducer.h.

Referenced by overlap().

◆ previousCandTag_

const edm::InputTag HLTmumutkVtxProducer::previousCandTag_
private

Definition at line 66 of file HLTmumutkVtxProducer.h.

◆ previousCandToken_

const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLTmumutkVtxProducer::previousCandToken_
private

Definition at line 67 of file HLTmumutkVtxProducer.h.

Referenced by produce().

◆ thirdTrackMass_

const double HLTmumutkVtxProducer::thirdTrackMass_
private

Definition at line 72 of file HLTmumutkVtxProducer.h.

Referenced by produce().

◆ transientTrackRecordToken_

const edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> HLTmumutkVtxProducer::transientTrackRecordToken_
private

Definition at line 60 of file HLTmumutkVtxProducer.h.

Referenced by produce().

◆ trkCandTag_

const edm::InputTag HLTmumutkVtxProducer::trkCandTag_
private

Definition at line 64 of file HLTmumutkVtxProducer.h.

◆ trkCandToken_

const edm::EDGetTokenT<reco::RecoChargedCandidateCollection> HLTmumutkVtxProducer::trkCandToken_
private

Definition at line 65 of file HLTmumutkVtxProducer.h.

Referenced by produce().