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
 
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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 30 of file HLTDisplacedmumumuVtxProducer.h.

Constructor & Destructor Documentation

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

Definition at line 35 of file HLTDisplacedmumumuVtxProducer.cc.

References ~HLTDisplacedmumumuVtxProducer().

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 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > srcToken_
HLTDisplacedmumumuVtxProducer::~HLTDisplacedmumumuVtxProducer ( )
overridedefault

Member Function Documentation

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

Definition at line 201 of file HLTDisplacedmumumuVtxProducer.cc.

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

Referenced by produce().

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 }
void HLTDisplacedmumumuVtxProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 51 of file HLTDisplacedmumumuVtxProducer.cc.

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

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 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HLTDisplacedmumumuVtxProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
override

Definition at line 65 of file HLTDisplacedmumumuVtxProducer.cc.

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

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  }
198  iEvent.put(std::move(vertexCollection));
199 }
#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
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
T sqrt(T t)
Definition: SSEVec.h:19
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > srcToken_
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
double p2[4]
Definition: TauolaWrapper.h:90
bool checkPreviousCand(const reco::TrackRef &trackref, const std::vector< reco::RecoChargedCandidateRef > &ref2) const
double p1[4]
Definition: TauolaWrapper.h:89
T get() const
Definition: EventSetup.h:73
bool isValid() const
def move(src, dest)
Definition: eostools.py:511
math::PtEtaPhiELorentzVectorF LorentzVector
double p3[4]
Definition: TauolaWrapper.h:91

Member Data Documentation

const int HLTDisplacedmumumuVtxProducer::chargeOpt_
private

Definition at line 49 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

const double HLTDisplacedmumumuVtxProducer::maxEta_
private

Definition at line 44 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

const double HLTDisplacedmumumuVtxProducer::maxInvMass_
private

Definition at line 48 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

const double HLTDisplacedmumumuVtxProducer::minInvMass_
private

Definition at line 47 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

const double HLTDisplacedmumumuVtxProducer::minPt_
private

Definition at line 45 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

const double HLTDisplacedmumumuVtxProducer::minPtTriplet_
private

Definition at line 46 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

const edm::InputTag HLTDisplacedmumumuVtxProducer::previousCandTag_
private

Definition at line 42 of file HLTDisplacedmumumuVtxProducer.h.

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

Definition at line 43 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

const edm::InputTag HLTDisplacedmumumuVtxProducer::srcTag_
private

Definition at line 40 of file HLTDisplacedmumumuVtxProducer.h.

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

Definition at line 41 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().