CMS 3D CMS Logo

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

#include <HLTDisplacedmumuVtxProducer.h>

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

Public Member Functions

 HLTDisplacedmumuVtxProducer (const edm::ParameterSet &)
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
 ~HLTDisplacedmumuVtxProducer () 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 minPtPair_
 
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 HLTDisplacedmumuVtxProducer.h.

Constructor & Destructor Documentation

◆ HLTDisplacedmumuVtxProducer()

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

Definition at line 35 of file HLTDisplacedmumuVtxProducer.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  chargeOpt_(iConfig.getParameter<int>("ChargeOpt")) {
46  produces<VertexCollection>();
47 }

◆ ~HLTDisplacedmumuVtxProducer()

HLTDisplacedmumuVtxProducer::~HLTDisplacedmumuVtxProducer ( )
overridedefault

Member Function Documentation

◆ checkPreviousCand()

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

Definition at line 179 of file HLTDisplacedmumuVtxProducer.cc.

180  {
181  bool ok = false;
182  for (auto& i : refVect) {
183  if (i->get<TrackRef>() == trackref) {
184  ok = true;
185  break;
186  }
187  }
188  return ok;
189 }

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

Referenced by produce().

◆ fillDescriptions()

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

Definition at line 51 of file HLTDisplacedmumuVtxProducer.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>("MinPtPair", 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("hltDisplacedmumuVtxProducer", desc);
62 }

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

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 65 of file HLTDisplacedmumuVtxProducer.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;
82 
83  RecoChargedCandidateCollection::const_iterator cand1;
84  RecoChargedCandidateCollection::const_iterator cand2;
85 
86  // get the objects passing the previous filter
88  iEvent.getByToken(previousCandToken_, previousCands);
89 
90  vector<RecoChargedCandidateRef> vPrevCands;
91  previousCands->getObjects(TriggerMuon, vPrevCands);
92 
93  for (cand1 = mucands->begin(); cand1 != mucands->end(); cand1++) {
94  TrackRef tk1 = cand1->get<TrackRef>();
95  LogDebug("HLTDisplacedMumuFilter") << " 1st muon in loop: q*pt= " << cand1->charge() * cand1->pt()
96  << ", eta= " << cand1->eta() << ", hits= " << tk1->numberOfValidHits();
97 
98  //first check if this muon passed the previous filter
99  if (!checkPreviousCand(tk1, vPrevCands))
100  continue;
101 
102  // cuts
103  if (fabs(cand1->eta()) > maxEta_)
104  continue;
105  if (cand1->pt() < minPt_)
106  continue;
107 
108  cand2 = cand1;
109  cand2++;
110  for (; cand2 != mucands->end(); cand2++) {
111  TrackRef tk2 = cand2->get<TrackRef>();
112 
113  // eta cut
114  LogDebug("HLTDisplacedmumuVtxProducer")
115  << " 2nd muon in loop: q*pt= " << cand2->charge() * cand2->pt() << ", eta= " << cand2->eta()
116  << ", hits= " << tk2->numberOfValidHits() << ", d0= " << tk2->d0();
117  //first check if this muon passed the previous filter
118  if (!checkPreviousCand(tk2, vPrevCands))
119  continue;
120 
121  // cuts
122  if (fabs(cand2->eta()) > maxEta_)
123  continue;
124  if (cand2->pt() < minPt_)
125  continue;
126 
127  // opposite sign or same sign
128  if (chargeOpt_ < 0) {
129  if (cand1->charge() * cand2->charge() > 0)
130  continue;
131  } else if (chargeOpt_ > 0) {
132  if (cand1->charge() * cand2->charge() < 0)
133  continue;
134  }
135 
136  // Combined dimuon system
137  e1 = sqrt(cand1->momentum().Mag2() + MuMass2);
138  e2 = sqrt(cand2->momentum().Mag2() + MuMass2);
139  p1 = Particle::LorentzVector(cand1->px(), cand1->py(), cand1->pz(), e1);
140  p2 = Particle::LorentzVector(cand2->px(), cand2->py(), cand2->pz(), e2);
141  p = p1 + p2;
142 
143  if (p.pt() < minPtPair_)
144  continue;
145 
146  double invmass = abs(p.mass());
147  LogDebug("HLTDisplacedMumuFilter") << " ... 1-2 invmass= " << invmass;
148 
149  if (invmass < minInvMass_)
150  continue;
151  if (invmass > maxInvMass_)
152  continue;
153 
154  // do the vertex fit
155  vector<TransientTrack> t_tks;
156  TransientTrack ttkp1 = (*theB).build(&tk1);
157  TransientTrack ttkp2 = (*theB).build(&tk2);
158  t_tks.push_back(ttkp1);
159  t_tks.push_back(ttkp2);
160 
161  if (t_tks.size() != 2)
162  continue;
163 
164  KalmanVertexFitter kvf;
165  TransientVertex tv = kvf.vertex(t_tks);
166 
167  if (!tv.isValid())
168  continue;
169 
170  Vertex vertex = tv;
171 
172  // put vertex in the event
173  vertexCollection->push_back(vertex);
174  }
175  }
177 }

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, maxEta_, maxInvMass_, minInvMass_, minPt_, minPtPair_, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, p1, p2, previousCandToken_, mathSSE::sqrt(), srcToken_, trigger::TriggerMuon, bphysicsOniaDQM_cfi::vertex, KalmanVertexFitter::vertex(), and spclusmultinvestigator_cfi::vertexCollection.

Member Data Documentation

◆ chargeOpt_

const int HLTDisplacedmumuVtxProducer::chargeOpt_
private

Definition at line 49 of file HLTDisplacedmumuVtxProducer.h.

Referenced by produce().

◆ maxEta_

const double HLTDisplacedmumuVtxProducer::maxEta_
private

Definition at line 44 of file HLTDisplacedmumuVtxProducer.h.

Referenced by produce().

◆ maxInvMass_

const double HLTDisplacedmumuVtxProducer::maxInvMass_
private

Definition at line 48 of file HLTDisplacedmumuVtxProducer.h.

Referenced by produce().

◆ minInvMass_

const double HLTDisplacedmumuVtxProducer::minInvMass_
private

Definition at line 47 of file HLTDisplacedmumuVtxProducer.h.

Referenced by produce().

◆ minPt_

const double HLTDisplacedmumuVtxProducer::minPt_
private

Definition at line 45 of file HLTDisplacedmumuVtxProducer.h.

Referenced by produce().

◆ minPtPair_

const double HLTDisplacedmumuVtxProducer::minPtPair_
private

Definition at line 46 of file HLTDisplacedmumuVtxProducer.h.

Referenced by produce().

◆ previousCandTag_

const edm::InputTag HLTDisplacedmumuVtxProducer::previousCandTag_
private

Definition at line 42 of file HLTDisplacedmumuVtxProducer.h.

◆ previousCandToken_

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

Definition at line 43 of file HLTDisplacedmumuVtxProducer.h.

Referenced by produce().

◆ srcTag_

const edm::InputTag HLTDisplacedmumuVtxProducer::srcTag_
private

Definition at line 40 of file HLTDisplacedmumuVtxProducer.h.

◆ srcToken_

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

Definition at line 41 of file HLTDisplacedmumuVtxProducer.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
HLTDisplacedmumuVtxProducer::srcTag_
const edm::InputTag srcTag_
Definition: HLTDisplacedmumuVtxProducer.h:40
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
HLTDisplacedmumuVtxProducer::minPtPair_
const double minPtPair_
Definition: HLTDisplacedmumuVtxProducer.h:46
HLTDisplacedmumuVtxProducer::maxInvMass_
const double maxInvMass_
Definition: HLTDisplacedmumuVtxProducer.h:48
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
edm::Ref< TrackCollection >
HLTDisplacedmumuVtxProducer::srcToken_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > srcToken_
Definition: HLTDisplacedmumuVtxProducer.h:41
HLTDisplacedmumuVtxProducer::previousCandTag_
const edm::InputTag previousCandTag_
Definition: HLTDisplacedmumuVtxProducer.h:42
HLTDisplacedmumuVtxProducer::chargeOpt_
const int chargeOpt_
Definition: HLTDisplacedmumuVtxProducer.h:49
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
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
HLTDisplacedmumuVtxProducer::maxEta_
const double maxEta_
Definition: HLTDisplacedmumuVtxProducer.h:44
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
HLTDisplacedmumuVtxProducer::minInvMass_
const double minInvMass_
Definition: HLTDisplacedmumuVtxProducer.h:47
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::InputTag
Definition: InputTag.h:15
reco::Vertex
Definition: Vertex.h:35
HLTDisplacedmumuVtxProducer::checkPreviousCand
bool checkPreviousCand(const reco::TrackRef &trackref, const std::vector< reco::RecoChargedCandidateRef > &ref2) const
Definition: HLTDisplacedmumuVtxProducer.cc:179
HLTDisplacedmumuVtxProducer::minPt_
const double minPt_
Definition: HLTDisplacedmumuVtxProducer.h:45
KalmanVertexFitter
Definition: KalmanVertexFitter.h:22
HLTDisplacedmumuVtxProducer::previousCandToken_
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
Definition: HLTDisplacedmumuVtxProducer.h:43