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
 
 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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
bool wantsStreamLuminosityBlocks () const noexcept final
 
bool wantsStreamRuns () const noexcept 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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_
 
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecordtransientTrackRecordToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
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)
 
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 ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 32 of file HLTDisplacedmumumuVtxProducer.h.

Constructor & Destructor Documentation

◆ HLTDisplacedmumumuVtxProducer()

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

Definition at line 28 of file HLTDisplacedmumumuVtxProducer.cc.

29  : transientTrackRecordToken_(esConsumes(edm::ESInputTag("", "TransientTrackBuilder"))),
30  srcTag_(iConfig.getParameter<edm::InputTag>("Src")),
31  srcToken_(consumes<reco::RecoChargedCandidateCollection>(srcTag_)),
32  previousCandTag_(iConfig.getParameter<edm::InputTag>("PreviousCandTag")),
33  previousCandToken_(consumes<trigger::TriggerFilterObjectWithRefs>(previousCandTag_)),
34  maxEta_(iConfig.getParameter<double>("MaxEta")),
35  minPt_(iConfig.getParameter<double>("MinPt")),
36  minPtTriplet_(iConfig.getParameter<double>("MinPtTriplet")),
37  minInvMass_(iConfig.getParameter<double>("MinInvMass")),
38  maxInvMass_(iConfig.getParameter<double>("MaxInvMass")),
39  chargeOpt_(iConfig.getParameter<int>("ChargeOpt")) {
40  produces<VertexCollection>();
41 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transientTrackRecordToken_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > srcToken_

◆ ~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 194 of file HLTDisplacedmumumuVtxProducer.cc.

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

Referenced by produce().

195  {
196  bool ok = false;
197  for (auto& i : refVect) {
198  if (i->get<TrackRef>() == trackref) {
199  ok = true;
200  break;
201  }
202  }
203  return ok;
204 }

◆ fillDescriptions()

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

Definition at line 45 of file HLTDisplacedmumumuVtxProducer.cc.

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

45  {
47  desc.add<edm::InputTag>("Src", edm::InputTag("hltL3MuonCandidates"));
48  desc.add<edm::InputTag>("PreviousCandTag", edm::InputTag(""));
49  desc.add<double>("MaxEta", 2.5);
50  desc.add<double>("MinPt", 0.0);
51  desc.add<double>("MinPtTriplet", 0.0);
52  desc.add<double>("MinInvMass", 1.0);
53  desc.add<double>("MaxInvMass", 20.0);
54  desc.add<int>("ChargeOpt", -1);
55  descriptions.add("hltDisplacedmumumuVtxProducer", desc);
56 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 59 of file HLTDisplacedmumumuVtxProducer.cc.

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

59  {
60  double const MuMass = 0.106;
61  double const MuMass2 = MuMass * MuMass;
62 
63  // get hold of muon trks
65  iEvent.getByToken(srcToken_, mucands);
66 
67  // get the transient track builder
68  auto const& theB = iSetup.getHandle(transientTrackRecordToken_);
69 
70  std::unique_ptr<VertexCollection> vertexCollection(new VertexCollection());
71 
72  // look at all mucands, check cuts and make vertices
73  double e1, e2, e3;
75 
76  RecoChargedCandidateCollection::const_iterator cand1;
77  RecoChargedCandidateCollection::const_iterator cand2;
78  RecoChargedCandidateCollection::const_iterator cand3;
79 
80  // get the objects passing the previous filter
82  iEvent.getByToken(previousCandToken_, previousCands);
83 
84  vector<RecoChargedCandidateRef> vPrevCands;
85  previousCands->getObjects(TriggerMuon, vPrevCands);
86 
87  for (cand1 = mucands->begin(); cand1 != mucands->end(); cand1++) {
88  TrackRef tk1 = cand1->get<TrackRef>();
89  LogDebug("HLTDisplacedMumumuFilter") << " 1st muon in loop: q*pt= " << cand1->charge() * cand1->pt()
90  << ", eta= " << cand1->eta() << ", hits= " << tk1->numberOfValidHits();
91 
92  //first check if this muon passed the previous filter
93  if (!checkPreviousCand(tk1, vPrevCands))
94  continue;
95 
96  // cuts
97  if (fabs(cand1->eta()) > maxEta_)
98  continue;
99  if (cand1->pt() < minPt_)
100  continue;
101 
102  cand2 = cand1;
103  cand2++;
104  for (; cand2 != mucands->end(); cand2++) {
105  TrackRef tk2 = cand2->get<TrackRef>();
106 
107  // eta cut
108  LogDebug("HLTMuonDimuonFilter") << " 2nd muon in loop: q*pt= " << cand2->charge() * cand2->pt()
109  << ", eta= " << cand2->eta() << ", hits= " << tk2->numberOfValidHits()
110  << ", d0= " << tk2->d0();
111  //first check if this muon passed the previous filter
112  if (!checkPreviousCand(tk2, vPrevCands))
113  continue;
114 
115  // cuts
116  if (fabs(cand2->eta()) > maxEta_)
117  continue;
118  if (cand2->pt() < minPt_)
119  continue;
120 
121  cand3 = cand2;
122  cand3++;
123  for (; cand3 != mucands->end(); cand3++) {
124  TrackRef tk3 = cand3->get<TrackRef>();
125 
126  // eta cut
127  LogDebug("HLTMuonDimuonFilter") << " 3rd muon in loop: q*pt= " << cand3->charge() * cand3->pt()
128  << ", eta= " << cand3->eta() << ", hits= " << tk3->numberOfValidHits()
129  << ", d0= " << tk3->d0();
130  //first check if this muon passed the previous filter
131  if (!checkPreviousCand(tk3, vPrevCands))
132  continue;
133 
134  // cuts
135  if (fabs(cand3->eta()) > maxEta_)
136  continue;
137  if (cand3->pt() < minPt_)
138  continue;
139 
140  // opposite sign or same sign
141  if (chargeOpt_ > 0) {
142  if (fabs(cand1->charge() + cand2->charge() + cand3->charge()) != chargeOpt_)
143  continue;
144  }
145 
146  // Combined dimuon system
147  e1 = sqrt(cand1->momentum().Mag2() + MuMass2);
148  e2 = sqrt(cand2->momentum().Mag2() + MuMass2);
149  e3 = sqrt(cand3->momentum().Mag2() + MuMass2);
150  p1 = Particle::LorentzVector(cand1->px(), cand1->py(), cand1->pz(), e1);
151  p2 = Particle::LorentzVector(cand2->px(), cand2->py(), cand2->pz(), e2);
152  p3 = Particle::LorentzVector(cand3->px(), cand3->py(), cand3->pz(), e3);
153  p = p1 + p2 + p3;
154 
155  if (p.pt() < minPtTriplet_)
156  continue;
157 
158  double invmass = abs(p.mass());
159  LogDebug("HLTDisplacedMumumuFilter") << " ... 1-2 invmass= " << invmass;
160 
161  if (invmass < minInvMass_)
162  continue;
163  if (invmass > maxInvMass_)
164  continue;
165 
166  // do the vertex fit
167  vector<TransientTrack> t_tks;
168  TransientTrack ttkp1 = (*theB).build(&tk1);
169  TransientTrack ttkp2 = (*theB).build(&tk2);
170  TransientTrack ttkp3 = (*theB).build(&tk3);
171  t_tks.push_back(ttkp1);
172  t_tks.push_back(ttkp2);
173  t_tks.push_back(ttkp3);
174 
175  if (t_tks.size() != 3)
176  continue;
177 
178  KalmanVertexFitter kvf;
179  TransientVertex tv = kvf.vertex(t_tks);
180 
181  if (!tv.isValid())
182  continue;
183 
184  Vertex vertex = tv;
185 
186  // put vertex in the event
187  vertexCollection->push_back(vertex);
188  }
189  }
190  }
192 }
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
std::vector< Vertex > VertexCollection
Definition: Vertex.h:31
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transientTrackRecordToken_
int iEvent
Definition: GenABIO.cc:224
bool isValid() const
T sqrt(T t)
Definition: SSEVec.h:23
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > srcToken_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
bool checkPreviousCand(const reco::TrackRef &trackref, const std::vector< reco::RecoChargedCandidateRef > &ref2) const
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:226
def move(src, dest)
Definition: eostools.py:511
math::PtEtaPhiELorentzVectorF LorentzVector
#define LogDebug(id)

Member Data Documentation

◆ chargeOpt_

const int HLTDisplacedmumumuVtxProducer::chargeOpt_
private

Definition at line 52 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

◆ maxEta_

const double HLTDisplacedmumumuVtxProducer::maxEta_
private

Definition at line 47 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

◆ maxInvMass_

const double HLTDisplacedmumumuVtxProducer::maxInvMass_
private

Definition at line 51 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

◆ minInvMass_

const double HLTDisplacedmumumuVtxProducer::minInvMass_
private

Definition at line 50 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

◆ minPt_

const double HLTDisplacedmumumuVtxProducer::minPt_
private

Definition at line 48 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

◆ minPtTriplet_

const double HLTDisplacedmumumuVtxProducer::minPtTriplet_
private

Definition at line 49 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

◆ previousCandTag_

const edm::InputTag HLTDisplacedmumumuVtxProducer::previousCandTag_
private

Definition at line 45 of file HLTDisplacedmumumuVtxProducer.h.

◆ previousCandToken_

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

Definition at line 46 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

◆ srcTag_

const edm::InputTag HLTDisplacedmumumuVtxProducer::srcTag_
private

Definition at line 43 of file HLTDisplacedmumumuVtxProducer.h.

◆ srcToken_

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

Definition at line 44 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

◆ transientTrackRecordToken_

const edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> HLTDisplacedmumumuVtxProducer::transientTrackRecordToken_
private

Definition at line 42 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().