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
 
 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
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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 bool matchToPrevious_
 
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 = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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  matchToPrevious_(iConfig.getParameter<bool>("matchToPrevious")),
41  maxEta_(iConfig.getParameter<double>("MaxEta")),
42  minPt_(iConfig.getParameter<double>("MinPt")),
43  minPtPair_(iConfig.getParameter<double>("MinPtPair")),
44  minInvMass_(iConfig.getParameter<double>("MinInvMass")),
45  maxInvMass_(iConfig.getParameter<double>("MaxInvMass")),
46  chargeOpt_(iConfig.getParameter<int>("ChargeOpt")) {
47  produces<VertexCollection>();
48 }

◆ ~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 183 of file HLTDisplacedmumuVtxProducer.cc.

184  {
185  bool ok = false;
186  for (auto& i : refVect) {
187  if (i->get<TrackRef>() == trackref) {
188  ok = true;
189  break;
190  }
191  }
192  return ok;
193 }

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

Referenced by produce().

◆ fillDescriptions()

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

Definition at line 52 of file HLTDisplacedmumuVtxProducer.cc.

52  {
54  desc.add<edm::InputTag>("Src", edm::InputTag("hltL3MuonCandidates"));
55  desc.add<edm::InputTag>("PreviousCandTag", edm::InputTag(""));
56  desc.add<bool>("matchToPrevious", true);
57  desc.add<double>("MaxEta", 2.5);
58  desc.add<double>("MinPt", 0.0);
59  desc.add<double>("MinPtPair", 0.0);
60  desc.add<double>("MinInvMass", 1.0);
61  desc.add<double>("MaxInvMass", 20.0);
62  desc.add<int>("ChargeOpt", -1);
63  descriptions.add("hltDisplacedmumuVtxProducer", desc);
64 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 67 of file HLTDisplacedmumuVtxProducer.cc.

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

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, matchToPrevious_, 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 50 of file HLTDisplacedmumuVtxProducer.h.

Referenced by produce().

◆ matchToPrevious_

const bool HLTDisplacedmumuVtxProducer::matchToPrevious_
private

Definition at line 44 of file HLTDisplacedmumuVtxProducer.h.

Referenced by produce().

◆ maxEta_

const double HLTDisplacedmumuVtxProducer::maxEta_
private

Definition at line 45 of file HLTDisplacedmumuVtxProducer.h.

Referenced by produce().

◆ maxInvMass_

const double HLTDisplacedmumuVtxProducer::maxInvMass_
private

Definition at line 49 of file HLTDisplacedmumuVtxProducer.h.

Referenced by produce().

◆ minInvMass_

const double HLTDisplacedmumuVtxProducer::minInvMass_
private

Definition at line 48 of file HLTDisplacedmumuVtxProducer.h.

Referenced by produce().

◆ minPt_

const double HLTDisplacedmumuVtxProducer::minPt_
private

Definition at line 46 of file HLTDisplacedmumuVtxProducer.h.

Referenced by produce().

◆ minPtPair_

const double HLTDisplacedmumuVtxProducer::minPtPair_
private

Definition at line 47 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:428
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:47
HLTDisplacedmumuVtxProducer::maxInvMass_
const double maxInvMass_
Definition: HLTDisplacedmumuVtxProducer.h:49
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
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:50
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
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
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
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:45
reco::JetExtendedAssociation::LorentzVector
math::PtEtaPhiELorentzVectorF LorentzVector
Definition: JetExtendedAssociation.h:25
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
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::matchToPrevious_
const bool matchToPrevious_
Definition: HLTDisplacedmumuVtxProducer.h:44
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HLTDisplacedmumuVtxProducer::minInvMass_
const double minInvMass_
Definition: HLTDisplacedmumuVtxProducer.h:48
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:183
HLTDisplacedmumuVtxProducer::minPt_
const double minPt_
Definition: HLTDisplacedmumuVtxProducer.h:46
KalmanVertexFitter
Definition: KalmanVertexFitter.h:22
HLTDisplacedmumuVtxProducer::previousCandToken_
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
Definition: HLTDisplacedmumuVtxProducer.h:43