CMS 3D CMS Logo

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

#include <HLTDisplacedtktktkVtxProducer.h>

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

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

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

Private Attributes

const int chargeOpt_
 
double firstTrackMass
 
double firstTrackMass2
 
double firstTrackPt
 
const double massParticle1_
 
const double massParticle2_
 
const double massParticle3_
 
const double maxEta_
 
const double maxInvMass_
 
const double maxInvMassRes_
 
const double minInvMass_
 
const double minInvMassRes_
 
const double minPtRes_
 
const double minPtTk1_
 
const double minPtTk2_
 
const double minPtTk3_
 
const double minPtTri_
 
const edm::InputTag previousCandTag_
 
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefspreviousCandToken_
 
const int resOpt_
 
double secondTrackMass
 
double secondTrackMass2
 
double secondTrackPt
 
const edm::InputTag srcTag_
 
const edm::EDGetTokenT< reco::RecoChargedCandidateCollectionsrcToken_
 
double thirdTrackMass
 
double thirdTrackMass2
 
double thirdTrackPt
 
const int triggerTypeDaughters_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 33 of file HLTDisplacedtktktkVtxProducer.h.

Constructor & Destructor Documentation

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

Definition at line 35 of file HLTDisplacedtktktkVtxProducer.cc.

References firstTrackMass, firstTrackMass2, firstTrackPt, massParticle1_, massParticle2_, massParticle3_, minPtTk1_, minPtTk2_, minPtTk3_, resOpt_, secondTrackMass, secondTrackMass2, secondTrackPt, std::swap(), thirdTrackMass, thirdTrackMass2, thirdTrackPt, and ~HLTDisplacedtktktkVtxProducer().

36  : srcTag_(iConfig.getParameter<edm::InputTag>("Src")),
37  srcToken_(consumes<reco::RecoChargedCandidateCollection>(srcTag_)),
38  previousCandTag_(iConfig.getParameter<edm::InputTag>("PreviousCandTag")),
39  previousCandToken_(consumes<trigger::TriggerFilterObjectWithRefs>(previousCandTag_)),
40  maxEta_(iConfig.getParameter<double>("MaxEtaTk")),
41  minPtTk1_(iConfig.getParameter<double>("MinPtResTk1")),
42  minPtTk2_(iConfig.getParameter<double>("MinPtResTk2")),
43  minPtTk3_(iConfig.getParameter<double>("MinPtThirdTk")),
44  minPtRes_(iConfig.getParameter<double>("MinPtRes")),
45  minPtTri_(iConfig.getParameter<double>("MinPtTri")),
46  minInvMassRes_(iConfig.getParameter<double>("MinInvMassRes")),
47  maxInvMassRes_(iConfig.getParameter<double>("MaxInvMassRes")),
48  minInvMass_(iConfig.getParameter<double>("MinInvMass")),
49  maxInvMass_(iConfig.getParameter<double>("MaxInvMass")),
50  massParticle1_(iConfig.getParameter<double>("massParticleRes1")),
51  massParticle2_(iConfig.getParameter<double>("massParticleRes2")),
52  massParticle3_(iConfig.getParameter<double>("massParticle3")),
53  chargeOpt_(iConfig.getParameter<int>("ChargeOpt")),
54  resOpt_(iConfig.getParameter<int>("ResOpt")),
55  triggerTypeDaughters_(iConfig.getParameter<int>("triggerTypeDaughters"))
56 
57 {
58  produces<VertexCollection>();
59 
66  if (resOpt_ <= 0 && massParticle1_ != massParticle2_) {
70  }
72  std::swap(firstTrackMass, thirdTrackMass);
74  }
75  }
76  firstTrackMass2 = firstTrackMass * firstTrackMass;
79 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > srcToken_
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
HLTDisplacedtktktkVtxProducer::~HLTDisplacedtktktkVtxProducer ( )
overridedefault

Member Function Documentation

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

Definition at line 276 of file HLTDisplacedtktktkVtxProducer.cc.

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

Referenced by produce().

277  {
278  bool ok = false;
279  for (auto& i : refVect) {
280  if (i->get<TrackRef>() == trackref) {
281  ok = true;
282  break;
283  }
284  }
285  return ok;
286 }
void HLTDisplacedtktktkVtxProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 83 of file HLTDisplacedtktktkVtxProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLT_2018_cff::InputTag.

83  {
85  desc.add<edm::InputTag>("Src", edm::InputTag("hltL3MuonCandidates"));
86  desc.add<edm::InputTag>("PreviousCandTag", edm::InputTag(""));
87  desc.add<double>("MaxEtaTk", 2.5);
88  desc.add<double>("MinPtResTk1", 0.0);
89  desc.add<double>("MinPtResTk2", 0.0);
90  desc.add<double>("MinPtThirdTk", 0.0);
91  desc.add<double>("MinPtRes", 0.0);
92  desc.add<double>("MinPtTri", 0.0);
93  desc.add<double>("MinInvMassRes", 1.0);
94  desc.add<double>("MaxInvMassRes", 20.0);
95  desc.add<double>("MinInvMass", 1.0);
96  desc.add<double>("MaxInvMass", 20.0);
97  desc.add<double>("massParticleRes1", 0.4937);
98  desc.add<double>("massParticleRes2", 0.4937);
99  desc.add<double>("massParticle3", 0.1396);
100  desc.add<int>("ChargeOpt", -1);
101  desc.add<int>("ResOpt", 1);
102  desc.add<int>("triggerTypeDaughters", 0);
103 
104  descriptions.add("hltDisplacedtktktkVtxProducer", desc);
105 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HLTDisplacedtktktkVtxProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 108 of file HLTDisplacedtktktkVtxProducer.cc.

References funct::abs(), chargeOpt_, checkPreviousCand(), StorageManager_cfg::e1, SiPixelPhase1Clusters_cfi::e3, firstTrackMass, firstTrackMass2, firstTrackPt, edm::EventSetup::get(), edm::Ref< C, T, F >::get(), edm::Event::getByToken(), trigger::TriggerRefsCollections::getObjects(), TransientVertex::isValid(), LogDebug, maxEta_, maxInvMass_, maxInvMassRes_, minInvMass_, minInvMassRes_, minPtRes_, minPtTri_, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, previousCandToken_, edm::Event::put(), resOpt_, secondTrackMass, secondTrackMass2, secondTrackPt, mathSSE::sqrt(), srcToken_, thirdTrackMass, thirdTrackMass2, thirdTrackPt, triggerTypeDaughters_, bphysicsOniaDQM_cfi::vertex, KalmanVertexFitter::vertex(), and spclusmultinvestigator_cfi::vertexCollection.

108  {
109  // get hold of track trks
111  iEvent.getByToken(srcToken_, trackcands);
112  if (trackcands->size() < 3)
113  return;
114 
115  //get the transient track builder:
117  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", theB);
118 
119  std::unique_ptr<VertexCollection> vertexCollection(new VertexCollection());
120 
121  // look at all trackcands, check cuts and make vertices
122  double e1, e2, e3;
124 
125  RecoChargedCandidateCollection::const_iterator cand1;
126  RecoChargedCandidateCollection::const_iterator cand2;
127  RecoChargedCandidateCollection::const_iterator cand3;
128 
129  // get the objects passing the previous filter
131  iEvent.getByToken(previousCandToken_, previousCands);
132 
133  vector<RecoChargedCandidateRef> vPrevCands;
134  previousCands->getObjects(triggerTypeDaughters_, vPrevCands);
135 
136  std::vector<bool> candComp;
137  for (cand1 = trackcands->begin(); cand1 != trackcands->end(); cand1++)
138  candComp.push_back(checkPreviousCand(cand1->get<TrackRef>(), vPrevCands));
139 
140  for (cand1 = trackcands->begin(); cand1 != trackcands->end(); cand1++) {
141  TrackRef tk1 = cand1->get<TrackRef>();
142  LogDebug("HLTDisplacedtktktkVtxProducer") << " 1st track in loop: q*pt= " << cand1->charge() * cand1->pt()
143  << ", eta= " << cand1->eta() << ", hits= " << tk1->numberOfValidHits();
144 
145  //first check if this track passed the previous filter
146  if (!candComp[cand1 - trackcands->begin()])
147  continue;
148  // if( ! checkPreviousCand( tk1, vPrevCands) ) continue;
149 
150  // cuts
151  if (std::abs(cand1->eta()) > maxEta_)
152  continue;
153  if (cand1->pt() < firstTrackPt)
154  continue;
155 
156  cand2 = trackcands->begin();
158  cand2 = cand1 + 1;
159  }
160 
161  for (; cand2 != trackcands->end(); cand2++) {
162  TrackRef tk2 = cand2->get<TrackRef>();
163  if (tk1 == tk2)
164  continue;
165  LogDebug("HLTDisplacedtktktkVtxProducer")
166  << " 2nd track in loop: q*pt= " << cand2->charge() * cand2->pt() << ", eta= " << cand2->eta()
167  << ", hits= " << tk2->numberOfValidHits() << ", d0= " << tk2->d0();
168 
169  //first check if this track passed the previous filter
170  if (!candComp[cand2 - trackcands->begin()])
171  continue;
172  // if( ! checkPreviousCand( tk2, vPrevCands) ) continue;
173 
174  // cuts
175  if (std::abs(cand2->eta()) > maxEta_)
176  continue;
177  if (cand2->pt() < secondTrackPt)
178  continue;
179 
180  // opposite sign or same sign for resonance
181  if (resOpt_ > 0) {
182  if (chargeOpt_ < 0) {
183  if (cand1->charge() * cand2->charge() > 0)
184  continue;
185  } else if (chargeOpt_ > 0) {
186  if (cand1->charge() * cand2->charge() < 0)
187  continue;
188  }
189  }
190 
191  //
192  // Combined ditrack system
193  e1 = sqrt(cand1->momentum().Mag2() + firstTrackMass2);
194  e2 = sqrt(cand2->momentum().Mag2() + secondTrackMass2);
195  pres = Particle::LorentzVector(cand1->px(), cand1->py(), cand1->pz(), e1) +
196  Particle::LorentzVector(cand2->px(), cand2->py(), cand2->pz(), e2);
197 
198  if (resOpt_ > 0) {
199  if (pres.pt() < minPtRes_)
200  continue;
201  double invmassRes = std::abs(pres.mass());
202  LogDebug("HLTDisplacedtktktkVtxProducer") << " ... 1-2 invmass= " << invmassRes;
203  if (invmassRes < minInvMassRes_)
204  continue;
205  if (invmassRes > maxInvMassRes_)
206  continue;
207  }
208 
209  cand3 = trackcands->begin();
211  cand3 = cand2 + 1;
212  }
213 
214  for (; cand3 != trackcands->end(); cand3++) {
215  TrackRef tk3 = cand3->get<TrackRef>();
216  if (tk1 == tk3 || tk2 == tk3)
217  continue;
218  LogDebug("HLTDisplacedtktktkVtxProducer")
219  << " 3rd track in loop: q*pt= " << cand3->charge() * cand3->pt() << ", eta= " << cand3->eta()
220  << ", hits= " << tk3->numberOfValidHits();
221 
222  //first check if this track passed the previous filter
223  if (!candComp[cand3 - trackcands->begin()])
224  continue;
225  // if( ! checkPreviousCand( tk3, vPrevCands) ) continue;
226 
227  // cuts
228  if (std::abs(cand3->eta()) > maxEta_)
229  continue;
230  if (cand3->pt() < thirdTrackPt)
231  continue;
232 
233  e3 = sqrt(cand3->momentum().Mag2() + thirdTrackMass2);
234  p = Particle::LorentzVector(cand1->px(), cand1->py(), cand1->pz(), e1) +
235  Particle::LorentzVector(cand2->px(), cand2->py(), cand2->pz(), e2) +
236  Particle::LorentzVector(cand3->px(), cand3->py(), cand3->pz(), e3);
237 
238  if (p.pt() < minPtTri_)
239  continue;
240  double invmass = std::abs(p.mass());
241  LogDebug("HLTDisplacedtktktkVtxProducer") << " ... 1-2-3 invmass= " << invmass;
242  if (invmass < minInvMass_)
243  continue;
244  if (invmass > maxInvMass_)
245  continue;
246 
247  // do the vertex fit
248  vector<TransientTrack> t_tks;
249  TransientTrack ttkp1 = (*theB).build(&tk1);
250  TransientTrack ttkp2 = (*theB).build(&tk2);
251  TransientTrack ttkp3 = (*theB).build(&tk3);
252 
253  t_tks.push_back(ttkp1);
254  t_tks.push_back(ttkp2);
255  t_tks.push_back(ttkp3);
256 
257  if (t_tks.size() != 3)
258  continue;
259 
260  KalmanVertexFitter kvf;
261  TransientVertex tv = kvf.vertex(t_tks);
262 
263  if (!tv.isValid())
264  continue;
265 
266  Vertex vertex = tv;
267 
268  // put vertex in the event
269  vertexCollection->push_back(vertex);
270  }
271  }
272  }
273  iEvent.put(std::move(vertexCollection));
274 }
#define LogDebug(id)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > srcToken_
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
T get() const
Definition: EventSetup.h:73
bool checkPreviousCand(const reco::TrackRef &trackref, const std::vector< reco::RecoChargedCandidateRef > &ref2) const
bool isValid() const
def move(src, dest)
Definition: eostools.py:511
math::PtEtaPhiELorentzVectorF LorentzVector

Member Data Documentation

const int HLTDisplacedtktktkVtxProducer::chargeOpt_
private

Definition at line 60 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by produce().

double HLTDisplacedtktktkVtxProducer::firstTrackMass
private

Definition at line 64 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by HLTDisplacedtktktkVtxProducer(), and produce().

double HLTDisplacedtktktkVtxProducer::firstTrackMass2
private

Definition at line 70 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by HLTDisplacedtktktkVtxProducer(), and produce().

double HLTDisplacedtktktkVtxProducer::firstTrackPt
private

Definition at line 67 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by HLTDisplacedtktktkVtxProducer(), and produce().

const double HLTDisplacedtktktkVtxProducer::massParticle1_
private

Definition at line 57 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by HLTDisplacedtktktkVtxProducer().

const double HLTDisplacedtktktkVtxProducer::massParticle2_
private

Definition at line 58 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by HLTDisplacedtktktkVtxProducer().

const double HLTDisplacedtktktkVtxProducer::massParticle3_
private

Definition at line 59 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by HLTDisplacedtktktkVtxProducer().

const double HLTDisplacedtktktkVtxProducer::maxEta_
private

Definition at line 47 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by produce().

const double HLTDisplacedtktktkVtxProducer::maxInvMass_
private

Definition at line 56 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by produce().

const double HLTDisplacedtktktkVtxProducer::maxInvMassRes_
private

Definition at line 54 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by produce().

const double HLTDisplacedtktktkVtxProducer::minInvMass_
private

Definition at line 55 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by produce().

const double HLTDisplacedtktktkVtxProducer::minInvMassRes_
private

Definition at line 53 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by produce().

const double HLTDisplacedtktktkVtxProducer::minPtRes_
private

Definition at line 51 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by produce().

const double HLTDisplacedtktktkVtxProducer::minPtTk1_
private

Definition at line 48 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by HLTDisplacedtktktkVtxProducer().

const double HLTDisplacedtktktkVtxProducer::minPtTk2_
private

Definition at line 49 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by HLTDisplacedtktktkVtxProducer().

const double HLTDisplacedtktktkVtxProducer::minPtTk3_
private

Definition at line 50 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by HLTDisplacedtktktkVtxProducer().

const double HLTDisplacedtktktkVtxProducer::minPtTri_
private

Definition at line 52 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by produce().

const edm::InputTag HLTDisplacedtktktkVtxProducer::previousCandTag_
private

Definition at line 45 of file HLTDisplacedtktktkVtxProducer.h.

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

Definition at line 46 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by produce().

const int HLTDisplacedtktktkVtxProducer::resOpt_
private

Definition at line 61 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by HLTDisplacedtktktkVtxProducer(), and produce().

double HLTDisplacedtktktkVtxProducer::secondTrackMass
private

Definition at line 65 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by HLTDisplacedtktktkVtxProducer(), and produce().

double HLTDisplacedtktktkVtxProducer::secondTrackMass2
private

Definition at line 71 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by HLTDisplacedtktktkVtxProducer(), and produce().

double HLTDisplacedtktktkVtxProducer::secondTrackPt
private

Definition at line 68 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by HLTDisplacedtktktkVtxProducer(), and produce().

const edm::InputTag HLTDisplacedtktktkVtxProducer::srcTag_
private

Definition at line 43 of file HLTDisplacedtktktkVtxProducer.h.

const edm::EDGetTokenT<reco::RecoChargedCandidateCollection> HLTDisplacedtktktkVtxProducer::srcToken_
private

Definition at line 44 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by produce().

double HLTDisplacedtktktkVtxProducer::thirdTrackMass
private

Definition at line 66 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by HLTDisplacedtktktkVtxProducer(), and produce().

double HLTDisplacedtktktkVtxProducer::thirdTrackMass2
private

Definition at line 72 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by HLTDisplacedtktktkVtxProducer(), and produce().

double HLTDisplacedtktktkVtxProducer::thirdTrackPt
private

Definition at line 69 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by HLTDisplacedtktktkVtxProducer(), and produce().

const int HLTDisplacedtktktkVtxProducer::triggerTypeDaughters_
private

Definition at line 62 of file HLTDisplacedtktktkVtxProducer.h.

Referenced by produce().