CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual void beginJob ()
 
virtual void endJob ()
 
 HLTDisplacedmumumuVtxProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~HLTDisplacedmumumuVtxProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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)
 

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::TriggerFilterObjectWithRefs
previousCandToken_
 
edm::InputTag srcTag_
 
edm::EDGetTokenT
< reco::RecoChargedCandidateCollection
srcToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 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 36 of file HLTDisplacedmumumuVtxProducer.cc.

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 ( )

Definition at line 52 of file HLTDisplacedmumumuVtxProducer.cc.

53 {
54 
55 }

Member Function Documentation

void HLTDisplacedmumumuVtxProducer::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 73 of file HLTDisplacedmumumuVtxProducer.cc.

74 {
75 
76 }
bool HLTDisplacedmumumuVtxProducer::checkPreviousCand ( const reco::TrackRef trackref,
std::vector< reco::RecoChargedCandidateRef > &  ref2 
)
private

Definition at line 205 of file HLTDisplacedmumumuVtxProducer.cc.

References i, and convertSQLiteXML::ok.

Referenced by produce().

205  {
206  bool ok=false;
207  for (unsigned int i=0; i<refVect.size(); i++) {
208  if ( refVect[i]->get<TrackRef>() == trackref ) {
209  ok=true;
210  break;
211  }
212  }
213  return ok;
214 }
int i
Definition: DBlmapReader.cc:9
void HLTDisplacedmumumuVtxProducer::endJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 79 of file HLTDisplacedmumumuVtxProducer.cc.

80 {
81 
82 }
void HLTDisplacedmumumuVtxProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 58 of file HLTDisplacedmumumuVtxProducer.cc.

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

58  {
60  desc.add<edm::InputTag>("Src",edm::InputTag("hltL3MuonCandidates"));
61  desc.add<edm::InputTag>("PreviousCandTag",edm::InputTag(""));
62  desc.add<double>("MaxEta",2.5);
63  desc.add<double>("MinPt",0.0);
64  desc.add<double>("MinPtTriplet",0.0);
65  desc.add<double>("MinInvMass",1.0);
66  desc.add<double>("MaxInvMass",20.0);
67  desc.add<int>("ChargeOpt",-1);
68  descriptions.add("hltDisplacedmumumuVtxProducer", desc);
69 }
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 
)
virtual

Implements edm::EDProducer.

Definition at line 85 of file HLTDisplacedmumumuVtxProducer.cc.

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

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

Member Data Documentation

int HLTDisplacedmumumuVtxProducer::chargeOpt_
private

Definition at line 51 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

double HLTDisplacedmumumuVtxProducer::maxEta_
private

Definition at line 46 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

double HLTDisplacedmumumuVtxProducer::maxInvMass_
private

Definition at line 50 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

double HLTDisplacedmumumuVtxProducer::minInvMass_
private

Definition at line 49 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

double HLTDisplacedmumumuVtxProducer::minPt_
private

Definition at line 47 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

double HLTDisplacedmumumuVtxProducer::minPtTriplet_
private

Definition at line 48 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

edm::InputTag HLTDisplacedmumumuVtxProducer::previousCandTag_
private

Definition at line 44 of file HLTDisplacedmumumuVtxProducer.h.

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

Definition at line 45 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().

edm::InputTag HLTDisplacedmumumuVtxProducer::srcTag_
private

Definition at line 42 of file HLTDisplacedmumumuVtxProducer.h.

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

Definition at line 43 of file HLTDisplacedmumumuVtxProducer.h.

Referenced by produce().