CMS 3D CMS Logo

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

#include <HLTDisplacedtktkVtxProducer.h>

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

Public Member Functions

 HLTDisplacedtktkVtxProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HLTDisplacedtktkVtxProducer () 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_
 
const double massParticle1_
 
const double massParticle2_
 
const double maxEta_
 
const double maxInvMass_
 
const double minInvMass_
 
const double minPt_
 
const double minPtPair_
 
const edm::InputTag previousCandTag_
 
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefspreviousCandToken_
 
const edm::InputTag srcTag_
 
const edm::EDGetTokenT< reco::RecoChargedCandidateCollectionsrcToken_
 
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 HLTDisplacedtktkVtxProducer.h.

Constructor & Destructor Documentation

◆ HLTDisplacedtktkVtxProducer()

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

Definition at line 35 of file HLTDisplacedtktkVtxProducer.cc.

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>("MaxEta")),
41  minPt_(iConfig.getParameter<double>("MinPt")),
42  minPtPair_(iConfig.getParameter<double>("MinPtPair")),
43  minInvMass_(iConfig.getParameter<double>("MinInvMass")),
44  maxInvMass_(iConfig.getParameter<double>("MaxInvMass")),
45  massParticle1_(iConfig.getParameter<double>("massParticle1")),
46  massParticle2_(iConfig.getParameter<double>("massParticle2")),
47  chargeOpt_(iConfig.getParameter<int>("ChargeOpt")),
48  triggerTypeDaughters_(iConfig.getParameter<int>("triggerTypeDaughters"))
49 
50 {
51  produces<VertexCollection>();
52 }

◆ ~HLTDisplacedtktkVtxProducer()

HLTDisplacedtktkVtxProducer::~HLTDisplacedtktkVtxProducer ( )
overridedefault

Member Function Documentation

◆ checkPreviousCand()

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

Definition at line 201 of file HLTDisplacedtktkVtxProducer.cc.

202  {
203  bool ok = false;
204  for (auto& i : refVect) {
205  if (i->get<TrackRef>() == trackref) {
206  ok = true;
207  break;
208  }
209  }
210  return ok;
211 }

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

Referenced by produce().

◆ fillDescriptions()

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

Definition at line 56 of file HLTDisplacedtktkVtxProducer.cc.

56  {
58  desc.add<edm::InputTag>("Src", edm::InputTag("hltL3MuonCandidates"));
59  desc.add<edm::InputTag>("PreviousCandTag", edm::InputTag(""));
60  desc.add<double>("MaxEta", 2.5);
61  desc.add<double>("MinPt", 0.0);
62  desc.add<double>("MinPtPair", 0.0);
63  desc.add<double>("MinInvMass", 1.0);
64  desc.add<double>("MaxInvMass", 20.0);
65  desc.add<double>("massParticle1", 0.1396);
66  desc.add<double>("massParticle2", 0.4937);
67  desc.add<int>("ChargeOpt", -1);
68  desc.add<int>("triggerTypeDaughters", 0);
69 
70  descriptions.add("hltDisplacedtktkVtxProducer", desc);
71 }

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

◆ produce()

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

Definition at line 74 of file HLTDisplacedtktkVtxProducer.cc.

74  {
75  double const firstTrackMass = massParticle1_;
76  double const firstTrackMass2 = firstTrackMass * firstTrackMass;
77  double const secondTrackMass = massParticle2_;
78  double const secondTrackMass2 = secondTrackMass * secondTrackMass;
79 
80  // get hold of track trks
82  iEvent.getByToken(srcToken_, trackcands);
83 
84  //get the transient track builder:
86  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", theB);
87 
88  std::unique_ptr<VertexCollection> vertexCollection(new VertexCollection());
89 
90  // look at all trackcands, check cuts and make vertices
91  double e1, e2;
93 
94  RecoChargedCandidateCollection::const_iterator cand1;
95  RecoChargedCandidateCollection::const_iterator cand2;
96 
97  // get the objects passing the previous filter
99  iEvent.getByToken(previousCandToken_, previousCands);
100 
101  vector<RecoChargedCandidateRef> vPrevCands;
102  previousCands->getObjects(triggerTypeDaughters_, vPrevCands);
103 
104  std::vector<bool> candComp;
105  for (cand1 = trackcands->begin(); cand1 != trackcands->end(); cand1++)
106  candComp.push_back(checkPreviousCand(cand1->get<TrackRef>(), vPrevCands));
107 
108  for (cand1 = trackcands->begin(); cand1 != trackcands->end(); cand1++) {
109  TrackRef tk1 = cand1->get<TrackRef>();
110  LogDebug("HLTDisplacedtktkVtxProducer") << " 1st track in loop: q*pt= " << cand1->charge() * cand1->pt()
111  << ", eta= " << cand1->eta() << ", hits= " << tk1->numberOfValidHits();
112 
113  //first check if this track passed the previous filter
114  if (!candComp[cand1 - trackcands->begin()])
115  continue;
116  // if( ! checkPreviousCand( tk1, vPrevCands) ) continue;
117 
118  // cuts
119  if (abs(cand1->eta()) > maxEta_)
120  continue;
121  if (cand1->pt() < minPt_)
122  continue;
123 
124  cand2 = trackcands->begin();
126  cand2 = cand1 + 1;
127  }
128 
129  for (; cand2 != trackcands->end(); cand2++) {
130  TrackRef tk2 = cand2->get<TrackRef>();
131  if (tk1 == tk2)
132  continue;
133 
134  // eta cut
135  LogDebug("HLTDisplacedtktkVtxProducer")
136  << " 2nd track in loop: q*pt= " << cand2->charge() * cand2->pt() << ", eta= " << cand2->eta()
137  << ", hits= " << tk2->numberOfValidHits() << ", d0= " << tk2->d0();
138  //first check if this track passed the previous filter
139  if (!candComp[cand2 - trackcands->begin()])
140  continue;
141  // if( ! checkPreviousCand( tk2, vPrevCands) ) continue;
142 
143  // cuts
144  if (abs(cand2->eta()) > maxEta_)
145  continue;
146  if (cand2->pt() < minPt_)
147  continue;
148 
149  // opposite sign or same sign
150  if (chargeOpt_ < 0) {
151  if (cand1->charge() * cand2->charge() > 0)
152  continue;
153  } else if (chargeOpt_ > 0) {
154  if (cand1->charge() * cand2->charge() < 0)
155  continue;
156  }
157 
158  // Combined ditrack system
159  e1 = sqrt(cand1->momentum().Mag2() + firstTrackMass2);
160  e2 = sqrt(cand2->momentum().Mag2() + secondTrackMass2);
161  p1 = Particle::LorentzVector(cand1->px(), cand1->py(), cand1->pz(), e1);
162  p2 = Particle::LorentzVector(cand2->px(), cand2->py(), cand2->pz(), e2);
163  p = p1 + p2;
164 
165  if (p.pt() < minPtPair_)
166  continue;
167 
168  double invmass = abs(p.mass());
169  LogDebug("HLTDisplacedtktkVtxProducer") << " ... 1-2 invmass= " << invmass;
170 
171  if (invmass < minInvMass_)
172  continue;
173  if (invmass > maxInvMass_)
174  continue;
175 
176  // do the vertex fit
177  vector<TransientTrack> t_tks;
178  TransientTrack ttkp1 = (*theB).build(&tk1);
179  TransientTrack ttkp2 = (*theB).build(&tk2);
180  t_tks.push_back(ttkp1);
181  t_tks.push_back(ttkp2);
182 
183  if (t_tks.size() != 2)
184  continue;
185 
186  KalmanVertexFitter kvf;
187  TransientVertex tv = kvf.vertex(t_tks);
188 
189  if (!tv.isValid())
190  continue;
191 
192  Vertex vertex = tv;
193 
194  // put vertex in the event
195  vertexCollection->push_back(vertex);
196  }
197  }
199 }

References funct::abs(), chargeOpt_, checkPreviousCand(), StorageManager_cfg::e1, edm::EventSetup::get(), get, edm::Ref< C, T, F >::get(), trigger::TriggerRefsCollections::getObjects(), iEvent, TransientVertex::isValid(), LogDebug, massParticle1_, massParticle2_, maxEta_, maxInvMass_, minInvMass_, minPt_, minPtPair_, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, p1, p2, previousCandToken_, mathSSE::sqrt(), srcToken_, triggerTypeDaughters_, bphysicsOniaDQM_cfi::vertex, KalmanVertexFitter::vertex(), and spclusmultinvestigator_cfi::vertexCollection.

Member Data Documentation

◆ chargeOpt_

const int HLTDisplacedtktkVtxProducer::chargeOpt_
private

Definition at line 54 of file HLTDisplacedtktkVtxProducer.h.

Referenced by produce().

◆ massParticle1_

const double HLTDisplacedtktkVtxProducer::massParticle1_
private

Definition at line 52 of file HLTDisplacedtktkVtxProducer.h.

Referenced by produce().

◆ massParticle2_

const double HLTDisplacedtktkVtxProducer::massParticle2_
private

Definition at line 53 of file HLTDisplacedtktkVtxProducer.h.

Referenced by produce().

◆ maxEta_

const double HLTDisplacedtktkVtxProducer::maxEta_
private

Definition at line 47 of file HLTDisplacedtktkVtxProducer.h.

Referenced by produce().

◆ maxInvMass_

const double HLTDisplacedtktkVtxProducer::maxInvMass_
private

Definition at line 51 of file HLTDisplacedtktkVtxProducer.h.

Referenced by produce().

◆ minInvMass_

const double HLTDisplacedtktkVtxProducer::minInvMass_
private

Definition at line 50 of file HLTDisplacedtktkVtxProducer.h.

Referenced by produce().

◆ minPt_

const double HLTDisplacedtktkVtxProducer::minPt_
private

Definition at line 48 of file HLTDisplacedtktkVtxProducer.h.

Referenced by produce().

◆ minPtPair_

const double HLTDisplacedtktkVtxProducer::minPtPair_
private

Definition at line 49 of file HLTDisplacedtktkVtxProducer.h.

Referenced by produce().

◆ previousCandTag_

const edm::InputTag HLTDisplacedtktkVtxProducer::previousCandTag_
private

Definition at line 45 of file HLTDisplacedtktkVtxProducer.h.

◆ previousCandToken_

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

Definition at line 46 of file HLTDisplacedtktkVtxProducer.h.

Referenced by produce().

◆ srcTag_

const edm::InputTag HLTDisplacedtktkVtxProducer::srcTag_
private

Definition at line 43 of file HLTDisplacedtktkVtxProducer.h.

◆ srcToken_

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

Definition at line 44 of file HLTDisplacedtktkVtxProducer.h.

Referenced by produce().

◆ triggerTypeDaughters_

const int HLTDisplacedtktkVtxProducer::triggerTypeDaughters_
private

Definition at line 55 of file HLTDisplacedtktkVtxProducer.h.

Referenced by produce().

KalmanVertexFitter::vertex
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
Definition: KalmanVertexFitter.h:49
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
HLTDisplacedtktkVtxProducer::massParticle1_
const double massParticle1_
Definition: HLTDisplacedtktkVtxProducer.h:52
HLTDisplacedtktkVtxProducer::minPt_
const double minPt_
Definition: HLTDisplacedtktkVtxProducer.h:48
TransientVertex::isValid
bool isValid() const
Definition: TransientVertex.h:195
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Ref::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
HLTDisplacedtktkVtxProducer::minInvMass_
const double minInvMass_
Definition: HLTDisplacedtktkVtxProducer.h:50
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
edm::Handle
Definition: AssociativeIterator.h:50
trigger::TriggerRefsCollections::getObjects
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
Definition: TriggerRefsCollections.h:593
edm::Ref< TrackCollection >
HLTDisplacedtktkVtxProducer::previousCandTag_
const edm::InputTag previousCandTag_
Definition: HLTDisplacedtktkVtxProducer.h:45
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HLTDisplacedtktkVtxProducer::srcTag_
const edm::InputTag srcTag_
Definition: HLTDisplacedtktkVtxProducer.h:43
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
TransientTrackRecord
Definition: TransientTrackRecord.h:11
edm::ESHandle< TransientTrackBuilder >
p2
double p2[4]
Definition: TauolaWrapper.h:90
HLTDisplacedtktkVtxProducer::previousCandToken_
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
Definition: HLTDisplacedtktkVtxProducer.h:46
HLTDisplacedtktkVtxProducer::massParticle2_
const double massParticle2_
Definition: HLTDisplacedtktkVtxProducer.h:53
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
StorageManager_cfg.e1
e1
Definition: StorageManager_cfg.py:16
iEvent
int iEvent
Definition: GenABIO.cc:224
p1
double p1[4]
Definition: TauolaWrapper.h:89
TransientVertex
Definition: TransientVertex.h:18
get
#define get
HLTDisplacedtktkVtxProducer::maxEta_
const double maxEta_
Definition: HLTDisplacedtktkVtxProducer.h:47
reco::JetExtendedAssociation::LorentzVector
math::PtEtaPhiELorentzVectorF LorentzVector
Definition: JetExtendedAssociation.h:25
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
reco::TransientTrack
Definition: TransientTrack.h:19
spclusmultinvestigator_cfi.vertexCollection
vertexCollection
Definition: spclusmultinvestigator_cfi.py:4
HLTDisplacedtktkVtxProducer::checkPreviousCand
bool checkPreviousCand(const reco::TrackRef &trackref, const std::vector< reco::RecoChargedCandidateRef > &ref2) const
Definition: HLTDisplacedtktkVtxProducer.cc:201
HLTDisplacedtktkVtxProducer::maxInvMass_
const double maxInvMass_
Definition: HLTDisplacedtktkVtxProducer.h:51
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HLTDisplacedtktkVtxProducer::srcToken_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > srcToken_
Definition: HLTDisplacedtktkVtxProducer.h:44
edm::InputTag
Definition: InputTag.h:15
reco::Vertex
Definition: Vertex.h:35
HLTDisplacedtktkVtxProducer::chargeOpt_
const int chargeOpt_
Definition: HLTDisplacedtktkVtxProducer.h:54
KalmanVertexFitter
Definition: KalmanVertexFitter.h:22
HLTDisplacedtktkVtxProducer::minPtPair_
const double minPtPair_
Definition: HLTDisplacedtktkVtxProducer.h:49
HLTDisplacedtktkVtxProducer::triggerTypeDaughters_
const int triggerTypeDaughters_
Definition: HLTDisplacedtktkVtxProducer.h:55