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::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginJob () override
 
void endJob () override
 
 HLTDisplacedmumumuVtxProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HLTDisplacedmumumuVtxProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () 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::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Private Member Functions

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

Private Attributes

int chargeOpt_
 
double maxEta_
 
double maxInvMass_
 
double minInvMass_
 
double minPt_
 
double minPtTriplet_
 
edm::InputTag previousCandTag_
 
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefspreviousCandToken_
 
edm::InputTag srcTag_
 
edm::EDGetTokenT< reco::RecoChargedCandidateCollectionsrcToken_
 

Additional Inherited Members

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

Constructor & Destructor Documentation

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

Definition at line 36 of file HLTDisplacedmumumuVtxProducer.cc.

References ~HLTDisplacedmumumuVtxProducer().

36  :
37  srcTag_ (iConfig.getParameter<edm::InputTag>("Src")),
38  srcToken_(consumes<reco::RecoChargedCandidateCollection>(srcTag_)),
39  previousCandTag_(iConfig.getParameter<edm::InputTag>("PreviousCandTag")),
40  previousCandToken_(consumes<trigger::TriggerFilterObjectWithRefs>(previousCandTag_)),
41  maxEta_ (iConfig.getParameter<double>("MaxEta")),
42  minPt_ (iConfig.getParameter<double>("MinPt")),
43  minPtTriplet_ (iConfig.getParameter<double>("MinPtTriplet")),
44  minInvMass_ (iConfig.getParameter<double>("MinInvMass")),
45  maxInvMass_ (iConfig.getParameter<double>("MaxInvMass")),
46  chargeOpt_ (iConfig.getParameter<int>("ChargeOpt"))
47 {
48  produces<VertexCollection>();
49 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > srcToken_
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
HLTDisplacedmumumuVtxProducer::~HLTDisplacedmumumuVtxProducer ( )
overridedefault

Member Function Documentation

void HLTDisplacedmumumuVtxProducer::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 70 of file HLTDisplacedmumumuVtxProducer.cc.

71 {
72 
73 }
bool HLTDisplacedmumumuVtxProducer::checkPreviousCand ( const reco::TrackRef trackref,
std::vector< reco::RecoChargedCandidateRef > &  ref2 
)
private

Definition at line 202 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::endJob ( void  )
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 76 of file HLTDisplacedmumumuVtxProducer.cc.

77 {
78 
79 }
void HLTDisplacedmumumuVtxProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 55 of file HLTDisplacedmumumuVtxProducer.cc.

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

55  {
57  desc.add<edm::InputTag>("Src",edm::InputTag("hltL3MuonCandidates"));
58  desc.add<edm::InputTag>("PreviousCandTag",edm::InputTag(""));
59  desc.add<double>("MaxEta",2.5);
60  desc.add<double>("MinPt",0.0);
61  desc.add<double>("MinPtTriplet",0.0);
62  desc.add<double>("MinInvMass",1.0);
63  desc.add<double>("MaxInvMass",20.0);
64  desc.add<int>("ChargeOpt",-1);
65  descriptions.add("hltDisplacedmumumuVtxProducer", desc);
66 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HLTDisplacedmumumuVtxProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 82 of file HLTDisplacedmumumuVtxProducer.cc.

References funct::abs(), chargeOpt_, checkPreviousCand(), SiPixelPhase1TrackClustersV_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, KalmanVertexFitter::vertex(), and particleFlowSuperClusterECAL_cfi::vertexCollection.

83 {
84  double const MuMass = 0.106;
85  double const MuMass2 = MuMass*MuMass;
86 
87 
88  // get hold of muon trks
90  iEvent.getByToken(srcToken_,mucands);
91 
92  //get the transient track builder:
94  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",theB);
95 
96  std::unique_ptr<VertexCollection> vertexCollection(new VertexCollection());
97 
98  // look at all mucands, check cuts and make vertices
99  double e1,e2,e3;
101 
102  RecoChargedCandidateCollection::const_iterator cand1;
103  RecoChargedCandidateCollection::const_iterator cand2;
104  RecoChargedCandidateCollection::const_iterator cand3;
105 
106  // get the objects passing the previous filter
108  iEvent.getByToken(previousCandToken_,previousCands);
109 
110  vector<RecoChargedCandidateRef> vPrevCands;
111  previousCands->getObjects(TriggerMuon,vPrevCands);
112 
113  for (cand1=mucands->begin(); cand1!=mucands->end(); cand1++) {
114  TrackRef tk1 = cand1->get<TrackRef>();
115  LogDebug("HLTDisplacedMumumuFilter") << " 1st muon in loop: q*pt= " << cand1->charge()*cand1->pt() << ", eta= " << cand1->eta() << ", hits= " << tk1->numberOfValidHits();
116 
117  //first check if this muon passed the previous filter
118  if( ! checkPreviousCand( tk1, vPrevCands) ) continue;
119 
120  // cuts
121  if (fabs(cand1->eta())>maxEta_) continue;
122  if (cand1->pt() < minPt_) continue;
123 
124  cand2 = cand1; cand2++;
125  for (; cand2!=mucands->end(); cand2++) {
126  TrackRef tk2 = cand2->get<TrackRef>();
127 
128  // eta cut
129  LogDebug("HLTMuonDimuonFilter") << " 2nd muon in loop: q*pt= " << cand2->charge()*cand2->pt() << ", eta= " << cand2->eta() << ", hits= " << tk2->numberOfValidHits() << ", d0= " << tk2->d0();
130  //first check if this muon passed the previous filter
131  if( ! checkPreviousCand( tk2, vPrevCands) ) continue;
132 
133  // cuts
134  if (fabs(cand2->eta())>maxEta_) continue;
135  if (cand2->pt() < minPt_) continue;
136 
137  cand3 = cand2; cand3++;
138  for (; cand3!=mucands->end(); cand3++) {
139  TrackRef tk3 = cand3->get<TrackRef>();
140 
141  // eta cut
142  LogDebug("HLTMuonDimuonFilter") << " 3rd muon in loop: q*pt= " << cand3->charge()*cand3->pt() << ", eta= " << cand3->eta() << ", hits= " << tk3->numberOfValidHits() << ", d0= " << tk3->d0();
143  //first check if this muon passed the previous filter
144  if( ! checkPreviousCand( tk3, vPrevCands) ) continue;
145 
146  // cuts
147  if (fabs(cand3->eta())>maxEta_) continue;
148  if (cand3->pt() < minPt_) continue;
149 
150  // opposite sign or same sign
151  if (chargeOpt_>0) {
152  if (fabs (cand1->charge() + cand2->charge() + cand3->charge()) != chargeOpt_) continue;
153  }
154 
155  // Combined dimuon system
156  e1 = sqrt(cand1->momentum().Mag2()+MuMass2);
157  e2 = sqrt(cand2->momentum().Mag2()+MuMass2);
158  e3 = sqrt(cand3->momentum().Mag2()+MuMass2);
159  p1 = Particle::LorentzVector(cand1->px(),cand1->py(),cand1->pz(),e1);
160  p2 = Particle::LorentzVector(cand2->px(),cand2->py(),cand2->pz(),e2);
161  p3 = Particle::LorentzVector(cand3->px(),cand3->py(),cand3->pz(),e3);
162  p = p1+p2+p3;
163 
164 
165  if (p.pt()<minPtTriplet_) continue;
166 
167  double invmass = abs(p.mass());
168  LogDebug("HLTDisplacedMumumuFilter") << " ... 1-2 invmass= " << invmass;
169 
170  if (invmass<minInvMass_) continue;
171  if (invmass>maxInvMass_) 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 
183  if (t_tks.size()!=3) continue;
184 
185  KalmanVertexFitter kvf;
186  TransientVertex tv = kvf.vertex(t_tks);
187 
188  if (!tv.isValid()) continue;
189 
190  Vertex vertex = tv;
191 
192  // put vertex in the event
193  vertexCollection->push_back(vertex);
194  }
195  }
196  }
197  iEvent.put(std::move(vertexCollection));
198 }
#define LogDebug(id)
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > srcToken_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
T sqrt(T t)
Definition: SSEVec.h:18
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
bool checkPreviousCand(const reco::TrackRef &trackref, std::vector< reco::RecoChargedCandidateRef > &ref2)
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:243
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
T get() const
Definition: EventSetup.h:71
bool isValid() const
def move(src, dest)
Definition: eostools.py:511
math::PtEtaPhiELorentzVectorF LorentzVector
double p3[4]
Definition: TauolaWrapper.h:91

Member Data Documentation

int HLTDisplacedmumumuVtxProducer::chargeOpt_
private

Definition at line 52 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

double HLTDisplacedmumumuVtxProducer::maxEta_
private

Definition at line 47 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

double HLTDisplacedmumumuVtxProducer::maxInvMass_
private

Definition at line 51 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

double HLTDisplacedmumumuVtxProducer::minInvMass_
private

Definition at line 50 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

double HLTDisplacedmumumuVtxProducer::minPt_
private

Definition at line 48 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

double HLTDisplacedmumumuVtxProducer::minPtTriplet_
private

Definition at line 49 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

edm::InputTag HLTDisplacedmumumuVtxProducer::previousCandTag_
private

Definition at line 45 of file HLTDisplacedmumumuVtxProducer.h.

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

Definition at line 46 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

edm::InputTag HLTDisplacedmumumuVtxProducer::srcTag_
private

Definition at line 43 of file HLTDisplacedmumumuVtxProducer.h.

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

Definition at line 44 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().