CMS 3D CMS Logo

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

#include <HLTDisplacedmumumuVtxProducer.h>

Inheritance diagram for HLTDisplacedmumumuVtxProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTDisplacedmumumuVtxProducer (const edm::ParameterSet &)
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
 ~HLTDisplacedmumumuVtxProducer () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () 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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (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 maxEta_
 
const double maxInvMass_
 
const double minInvMass_
 
const double minPt_
 
const double minPtTriplet_
 
const edm::InputTag previousCandTag_
 
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefspreviousCandToken_
 
const edm::InputTag srcTag_
 
const edm::EDGetTokenT< reco::RecoChargedCandidateCollectionsrcToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase 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
 
- 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 30 of file HLTDisplacedmumumuVtxProducer.h.

Constructor & Destructor Documentation

◆ HLTDisplacedmumumuVtxProducer()

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

Definition at line 35 of file HLTDisplacedmumumuVtxProducer.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  minPtTriplet_(iConfig.getParameter<double>("MinPtTriplet")),
43  minInvMass_(iConfig.getParameter<double>("MinInvMass")),
44  maxInvMass_(iConfig.getParameter<double>("MaxInvMass")),
45  chargeOpt_(iConfig.getParameter<int>("ChargeOpt")) {
46  produces<VertexCollection>();
47 }

◆ ~HLTDisplacedmumumuVtxProducer()

HLTDisplacedmumumuVtxProducer::~HLTDisplacedmumumuVtxProducer ( )
overridedefault

Member Function Documentation

◆ checkPreviousCand()

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

Definition at line 201 of file HLTDisplacedmumumuVtxProducer.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 HLTDisplacedmumumuVtxProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 51 of file HLTDisplacedmumumuVtxProducer.cc.

51  {
53  desc.add<edm::InputTag>("Src", edm::InputTag("hltL3MuonCandidates"));
54  desc.add<edm::InputTag>("PreviousCandTag", edm::InputTag(""));
55  desc.add<double>("MaxEta", 2.5);
56  desc.add<double>("MinPt", 0.0);
57  desc.add<double>("MinPtTriplet", 0.0);
58  desc.add<double>("MinInvMass", 1.0);
59  desc.add<double>("MaxInvMass", 20.0);
60  desc.add<int>("ChargeOpt", -1);
61  descriptions.add("hltDisplacedmumumuVtxProducer", desc);
62 }

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

◆ produce()

void HLTDisplacedmumumuVtxProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 65 of file HLTDisplacedmumumuVtxProducer.cc.

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

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

Member Data Documentation

◆ chargeOpt_

const int HLTDisplacedmumumuVtxProducer::chargeOpt_
private

Definition at line 49 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

◆ maxEta_

const double HLTDisplacedmumumuVtxProducer::maxEta_
private

Definition at line 44 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

◆ maxInvMass_

const double HLTDisplacedmumumuVtxProducer::maxInvMass_
private

Definition at line 48 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

◆ minInvMass_

const double HLTDisplacedmumumuVtxProducer::minInvMass_
private

Definition at line 47 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

◆ minPt_

const double HLTDisplacedmumumuVtxProducer::minPt_
private

Definition at line 45 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

◆ minPtTriplet_

const double HLTDisplacedmumumuVtxProducer::minPtTriplet_
private

Definition at line 46 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

◆ previousCandTag_

const edm::InputTag HLTDisplacedmumumuVtxProducer::previousCandTag_
private

Definition at line 42 of file HLTDisplacedmumumuVtxProducer.h.

◆ previousCandToken_

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

Definition at line 43 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

◆ srcTag_

const edm::InputTag HLTDisplacedmumumuVtxProducer::srcTag_
private

Definition at line 40 of file HLTDisplacedmumumuVtxProducer.h.

◆ srcToken_

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

Definition at line 41 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

KalmanVertexFitter::vertex
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
Definition: KalmanVertexFitter.h:49
HLTDisplacedmumumuVtxProducer::maxInvMass_
const double maxInvMass_
Definition: HLTDisplacedmumumuVtxProducer.h:48
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
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
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:452
HLTDisplacedmumumuVtxProducer::maxEta_
const double maxEta_
Definition: HLTDisplacedmumumuVtxProducer.h:44
edm::Ref< TrackCollection >
HLTDisplacedmumumuVtxProducer::srcToken_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > srcToken_
Definition: HLTDisplacedmumumuVtxProducer.h:41
HLTDisplacedmumumuVtxProducer::previousCandTag_
const edm::InputTag previousCandTag_
Definition: HLTDisplacedmumumuVtxProducer.h:42
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
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
TransientTrackRecord
Definition: TransientTrackRecord.h:11
trigger::TriggerMuon
Definition: TriggerTypeDefs.h:68
edm::ESHandle< TransientTrackBuilder >
p2
double p2[4]
Definition: TauolaWrapper.h:90
HLTDisplacedmumumuVtxProducer::chargeOpt_
const int chargeOpt_
Definition: HLTDisplacedmumumuVtxProducer.h:49
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
HLTDisplacedmumumuVtxProducer::minPtTriplet_
const double minPtTriplet_
Definition: HLTDisplacedmumumuVtxProducer.h:46
HLTDisplacedmumumuVtxProducer::srcTag_
const edm::InputTag srcTag_
Definition: HLTDisplacedmumumuVtxProducer.h:40
SiPixelPhase1Clusters_cfi.e3
e3
Definition: SiPixelPhase1Clusters_cfi.py:9
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
HLTDisplacedmumumuVtxProducer::minPt_
const double minPt_
Definition: HLTDisplacedmumumuVtxProducer.h:45
reco::TransientTrack
Definition: TransientTrack.h:19
spclusmultinvestigator_cfi.vertexCollection
vertexCollection
Definition: spclusmultinvestigator_cfi.py:4
HLTDisplacedmumumuVtxProducer::minInvMass_
const double minInvMass_
Definition: HLTDisplacedmumumuVtxProducer.h:47
p3
double p3[4]
Definition: TauolaWrapper.h:91
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HLTDisplacedmumumuVtxProducer::checkPreviousCand
bool checkPreviousCand(const reco::TrackRef &trackref, const std::vector< reco::RecoChargedCandidateRef > &ref2) const
Definition: HLTDisplacedmumumuVtxProducer.cc:201
edm::InputTag
Definition: InputTag.h:15
reco::Vertex
Definition: Vertex.h:35
HLTDisplacedmumumuVtxProducer::previousCandToken_
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
Definition: HLTDisplacedmumumuVtxProducer.h:43
KalmanVertexFitter
Definition: KalmanVertexFitter.h:22