test
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 | Static Private Member Functions | Private Attributes
HLTmumutkVtxProducer Class Reference

#include <HLTmumutkVtxProducer.h>

Inheritance diagram for HLTmumutkVtxProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTmumutkVtxProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~HLTmumutkVtxProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & 
itemsToGetFromEvent () 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::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, std::vector< reco::RecoChargedCandidateRef > &ref2)
 
bool overlap (const reco::TrackRef &trackref1, const reco::TrackRef &trackref2)
 

Static Private Member Functions

static FreeTrajectoryState initialFreeState (const reco::Track &, const MagneticField *)
 

Private Attributes

const edm::InputTag beamSpotTag_
 
const edm::EDGetTokenT
< reco::BeamSpot
beamSpotToken_
 
const double maxEta_
 
const double maxInvMass_
 
const std::string mfName_
 
const double minD0Significance_
 
const double minInvMass_
 
const double minPt_
 
const edm::InputTag muCandTag_
 
const edm::EDGetTokenT
< reco::RecoChargedCandidateCollection
muCandToken_
 
const double overlapDR_
 
const edm::InputTag previousCandTag_
 
const edm::EDGetTokenT
< trigger::TriggerFilterObjectWithRefs
previousCandToken_
 
const double thirdTrackMass_
 
const edm::InputTag trkCandTag_
 
const edm::EDGetTokenT
< reco::RecoChargedCandidateCollection
trkCandToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
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 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

HLT Filter for b to (mumu) + X

Implementation: <Notes on="" implementation>="">

Definition at line 42 of file HLTmumutkVtxProducer.h.

Constructor & Destructor Documentation

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

Definition at line 31 of file HLTmumutkVtxProducer.cc.

31  :
32  muCandTag_ (iConfig.getParameter<edm::InputTag>("MuCand")),
33  muCandToken_(consumes<reco::RecoChargedCandidateCollection>(muCandTag_)),
34  trkCandTag_ (iConfig.getParameter<edm::InputTag>("TrackCand")),
35  trkCandToken_(consumes<reco::RecoChargedCandidateCollection>(trkCandTag_)),
36  previousCandTag_(iConfig.getParameter<edm::InputTag>("PreviousCandTag")),
37  previousCandToken_(consumes<trigger::TriggerFilterObjectWithRefs>(previousCandTag_)),
38  mfName_(iConfig.getParameter<std::string>("SimpleMagneticField")),
39  thirdTrackMass_(iConfig.getParameter<double>("ThirdTrackMass")),
40  maxEta_(iConfig.getParameter<double>("MaxEta")),
41  minPt_(iConfig.getParameter<double>("MinPt")),
42  minInvMass_(iConfig.getParameter<double>("MinInvMass")),
43  maxInvMass_(iConfig.getParameter<double>("MaxInvMass")),
44  minD0Significance_(iConfig.getParameter<double>("MinD0Significance")),
45  overlapDR_(iConfig.getParameter<double>("OverlapDR")),
46  beamSpotTag_ (iConfig.getParameter<edm::InputTag> ("BeamSpotTag")),
47  beamSpotToken_(consumes<reco::BeamSpot>(beamSpotTag_))
48 {
49  produces<VertexCollection>();
50 }
T getParameter(std::string const &) const
const std::string mfName_
const edm::InputTag beamSpotTag_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > trkCandToken_
const edm::InputTag previousCandTag_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > muCandToken_
const edm::InputTag trkCandTag_
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
const edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
const edm::InputTag muCandTag_
HLTmumutkVtxProducer::~HLTmumutkVtxProducer ( )

Definition at line 53 of file HLTmumutkVtxProducer.cc.

53 {}

Member Function Documentation

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

Definition at line 225 of file HLTmumutkVtxProducer.cc.

References i, and convertSQLiteXML::ok.

Referenced by produce().

225  {
226  bool ok=false;
227  for (unsigned int i=0; i<refVect.size(); i++) {
228  if ( refVect[i]->get<TrackRef>() == trackref ) {
229  ok=true;
230  break;
231  }
232  }
233  return ok;
234 }
int i
Definition: DBlmapReader.cc:9
void HLTmumutkVtxProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 56 of file HLTmumutkVtxProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), HLT_25ns10e33_v2_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

56  {
58  desc.add<edm::InputTag>("MuCand",edm::InputTag("hltMuTracks"));
59  desc.add<edm::InputTag>("TrackCand",edm::InputTag("hltMumukAllConeTracks"));
60  desc.add<edm::InputTag>("PreviousCandTag",edm::InputTag("hltDisplacedmumuFilterDoubleMu4Jpsi"));
61  desc.add<std::string>("SimpleMagneticField","");
62  desc.add<double>("ThirdTrackMass",0.493677);
63  desc.add<double>("MaxEta",2.5);
64  desc.add<double>("MinPt",3.0);
65  desc.add<double>("MinInvMass",0.0);
66  desc.add<double>("MaxInvMass",99999.);
67  desc.add<double>("MinD0Significance",0.0);
68  desc.add<double>("OverlapDR",1.44e-4);
69  desc.add<edm::InputTag>("BeamSpotTag",edm::InputTag("hltOfflineBeamSpot"));
70  descriptions.add("HLTmumutkVtxProducer",desc);
71 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
FreeTrajectoryState HLTmumutkVtxProducer::initialFreeState ( const reco::Track tk,
const MagneticField field 
)
staticprivate

Definition at line 209 of file HLTmumutkVtxProducer.cc.

References reco::TrackBase::charge(), reco::TrackBase::covariance(), reco::TrackBase::momentum(), and reco::TrackBase::vertex().

Referenced by produce().

210 {
211  Basic3DVector<float> pos( tk.vertex());
212  GlobalPoint gpos( pos);
213  Basic3DVector<float> mom( tk.momentum());
214  GlobalVector gmom( mom);
215  GlobalTrajectoryParameters par( gpos, gmom, tk.charge(), field);
217  return FreeTrajectoryState( par, err);
218 }
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:670
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition: TrackBase.h:682
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:726
int charge() const
track electric charge
Definition: TrackBase.h:562
bool HLTmumutkVtxProducer::overlap ( const reco::TrackRef trackref1,
const reco::TrackRef trackref2 
)
private

Definition at line 220 of file HLTmumutkVtxProducer.cc.

References deltaR(), and overlapDR_.

Referenced by produce().

220  {
221  if (deltaR(trackref1->eta(), trackref1->phi(),trackref2->eta(), trackref2->phi()) < overlapDR_) return 1;
222  return 0;
223 }
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
void HLTmumutkVtxProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 74 of file HLTmumutkVtxProducer.cc.

References funct::abs(), beamSpotToken_, checkPreviousCand(), reco::e1, reco::e2, edm::EventSetup::get(), edm::Ref< C, T, F >::get(), edm::Event::getByToken(), initialFreeState(), TransientVertex::isValid(), LogDebug, maxEta_, maxInvMass_, mfName_, minD0Significance_, minInvMass_, minPt_, eostools::move(), muCandToken_, overlap(), AlCaHLTBitMon_ParallelJobs::p, p1, p2, p3, previousCandToken_, edm::ESHandle< class >::product(), edm::Event::put(), Measurement1D::significance(), mathSSE::sqrt(), thirdTrackMass_, TrajectoryStateClosestToBeamLine::transverseImpactParameter(), trigger::TriggerMuon, trkCandToken_, KalmanVertexFitter::vertex(), and GoodVertex_cfg::vertexCollection.

75 {
76  const double MuMass(0.106);
77  const double MuMass2(MuMass*MuMass);
78  const double thirdTrackMass2(thirdTrackMass_*thirdTrackMass_);
79 
80  // get hold of muon trks
82  iEvent.getByToken(muCandToken_,mucands);
83 
84  //get the transient track builder:
86  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",theB);
87 
88  //get the beamspot position
89  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
90  iEvent.getByToken(beamSpotToken_,recoBeamSpotHandle);
91 
92  //get the b field
93  ESHandle<MagneticField> bFieldHandle;
94  iSetup.get<IdealMagneticFieldRecord>().get(mfName_, bFieldHandle);
95  const MagneticField* magField = bFieldHandle.product();
96  TSCBLBuilderNoMaterial blsBuilder;
97 
98  // get track candidates around displaced muons
100  iEvent.getByToken(trkCandToken_,trkcands);
101 
102  unique_ptr<VertexCollection> vertexCollection(new VertexCollection());
103 
104  // Ref to Candidate object to be recorded in filter object
107  RecoChargedCandidateRef refTrk;
108 
109  double e1,e2,e3;
111 
112  if ( mucands->size() < 2 ) return;
113  if ( trkcands->size() < 1 ) return;
114 
115  RecoChargedCandidateCollection::const_iterator mucand1;
116  RecoChargedCandidateCollection::const_iterator mucand2;
117  RecoChargedCandidateCollection::const_iterator trkcand;
118 
119  // get the objects passing the previous filter
121  iEvent.getByToken(previousCandToken_,previousCands);
122 
123  vector<RecoChargedCandidateRef> vPrevCands;
124  previousCands->getObjects(TriggerMuon,vPrevCands);
125 
126  for (mucand1=mucands->begin(); mucand1!=mucands->end(); ++mucand1) {
127  TrackRef trk1 = mucand1->get<TrackRef>();
128  LogDebug("HLTmumutkVtxProducer") << " 1st muon: q*pt= " << trk1->charge()*trk1->pt()
129  << ", eta= " << trk1->eta()
130  << ", hits= " << trk1->numberOfValidHits();
131 
132  //first check if this muon passed the previous filter
133  if( ! checkPreviousCand( trk1, vPrevCands) ) continue;
134 
135  // eta and pt cut
136  if (fabs(trk1->eta()) > maxEta_) continue;
137  if (trk1->pt() < minPt_ ) continue;
138 
139  mucand2 = mucand1; ++mucand2;
140  for (; mucand2!=mucands->end(); mucand2++) {
141  TrackRef trk2 = mucand2->get<TrackRef>();
142 
143  LogDebug("HLTDisplacedMumukFilter") << " 2nd muon: q*pt= " << trk2->charge()*trk2->pt()
144  << ", eta= " << trk2->eta()
145  << ", hits= " << trk2->numberOfValidHits();
146 
147  //first check if this muon passed the previous filter
148  if( ! checkPreviousCand( trk2, vPrevCands) ) continue;
149  // eta and pt cut
150  if (fabs(trk2->eta()) > maxEta_) continue;
151  if (trk2->pt() < minPt_ ) continue;
152 
153  //loop on track collection
154  for ( trkcand = trkcands->begin(); trkcand !=trkcands->end(); ++trkcand) {
155  TrackRef trk3 = trkcand->get<TrackRef>();
156  if( overlap( trk1, trk3) ) continue;
157  if( overlap( trk2, trk3) ) continue;
158 
159  LogDebug("HLTDisplacedMumukFilter") << " 3rd track: q*pt= " << trk3->charge()*trk3->pt()
160  << ", eta= " << trk3->eta()
161  << ", hits= " << trk3->numberOfValidHits();
162 
163  // eta and pt cut
164  if (fabs(trk3->eta()) > maxEta_) continue;
165  if (trk3->pt() < minPt_ ) continue;
166 
167  // Combined system
168  e1 = sqrt(trk1->momentum().Mag2() + MuMass2 );
169  e2 = sqrt(trk2->momentum().Mag2() + MuMass2 );
170  e3 = sqrt(trk3->momentum().Mag2() + thirdTrackMass2);
171 
172  p1 = Particle::LorentzVector(trk1->px(),trk1->py(),trk1->pz(),e1);
173  p2 = Particle::LorentzVector(trk2->px(),trk2->py(),trk2->pz(),e2);
174  p3 = Particle::LorentzVector(trk3->px(),trk3->py(),trk3->pz(),e3);
175 
176  p = p1+p2+p3;
177 
178  //invariant mass cut
179  double invmass = abs(p.mass());
180  LogDebug("HLTDisplacedMumukFilter") << " Invmass= " << invmass;
181  if (invmass<minInvMass_) continue;
182  if (invmass>maxInvMass_) continue;
183 
184  // do the vertex fit
185  vector<TransientTrack> t_tks;
186  t_tks.push_back((*theB).build(&trk1));
187  t_tks.push_back((*theB).build(&trk2));
188  t_tks.push_back((*theB).build(&trk3));
189  if (t_tks.size()!=3) continue;
190 
191  FreeTrajectoryState InitialFTS = initialFreeState(*trk3, magField);
192  TrajectoryStateClosestToBeamLine tscb( blsBuilder(InitialFTS, *recoBeamSpotHandle) );
193  double d0sig = tscb.transverseImpactParameter().significance();
194  if (d0sig < minD0Significance_) continue;
195 
196  KalmanVertexFitter kvf;
197  TransientVertex tv = kvf.vertex(t_tks);
198  if (!tv.isValid()) continue;
199  Vertex vertex = tv;
200 
201  // put vertex in the event
202  vertexCollection->push_back(vertex);
203  }
204  }
205  }
206  iEvent.put(std::move(vertexCollection));
207 }
#define LogDebug(id)
static FreeTrajectoryState initialFreeState(const reco::Track &, const MagneticField *)
const std::string mfName_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
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
bool overlap(const reco::TrackRef &trackref1, const reco::TrackRef &trackref2)
T sqrt(T t)
Definition: SSEVec.h:18
bool checkPreviousCand(const reco::TrackRef &trackref, std::vector< reco::RecoChargedCandidateRef > &ref2)
def move
Definition: eostools.py:510
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > trkCandToken_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:244
double p2[4]
Definition: TauolaWrapper.h:90
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > muCandToken_
Float e1
Definition: deltaR.h:20
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
Float e2
Definition: deltaR.h:21
double p1[4]
Definition: TauolaWrapper.h:89
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > previousCandToken_
const edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
bool isValid() const
math::PtEtaPhiELorentzVectorF LorentzVector
double p3[4]
Definition: TauolaWrapper.h:91

Member Data Documentation

const edm::InputTag HLTmumutkVtxProducer::beamSpotTag_
private

Definition at line 72 of file HLTmumutkVtxProducer.h.

const edm::EDGetTokenT<reco::BeamSpot> HLTmumutkVtxProducer::beamSpotToken_
private

Definition at line 73 of file HLTmumutkVtxProducer.h.

Referenced by produce().

const double HLTmumutkVtxProducer::maxEta_
private

Definition at line 65 of file HLTmumutkVtxProducer.h.

Referenced by produce().

const double HLTmumutkVtxProducer::maxInvMass_
private

Definition at line 68 of file HLTmumutkVtxProducer.h.

Referenced by produce().

const std::string HLTmumutkVtxProducer::mfName_
private

Definition at line 62 of file HLTmumutkVtxProducer.h.

Referenced by produce().

const double HLTmumutkVtxProducer::minD0Significance_
private

Definition at line 69 of file HLTmumutkVtxProducer.h.

Referenced by produce().

const double HLTmumutkVtxProducer::minInvMass_
private

Definition at line 67 of file HLTmumutkVtxProducer.h.

Referenced by produce().

const double HLTmumutkVtxProducer::minPt_
private

Definition at line 66 of file HLTmumutkVtxProducer.h.

Referenced by produce().

const edm::InputTag HLTmumutkVtxProducer::muCandTag_
private

Definition at line 55 of file HLTmumutkVtxProducer.h.

const edm::EDGetTokenT<reco::RecoChargedCandidateCollection> HLTmumutkVtxProducer::muCandToken_
private

Definition at line 56 of file HLTmumutkVtxProducer.h.

Referenced by produce().

const double HLTmumutkVtxProducer::overlapDR_
private

Definition at line 70 of file HLTmumutkVtxProducer.h.

Referenced by overlap().

const edm::InputTag HLTmumutkVtxProducer::previousCandTag_
private

Definition at line 59 of file HLTmumutkVtxProducer.h.

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

Definition at line 60 of file HLTmumutkVtxProducer.h.

Referenced by produce().

const double HLTmumutkVtxProducer::thirdTrackMass_
private

Definition at line 64 of file HLTmumutkVtxProducer.h.

Referenced by produce().

const edm::InputTag HLTmumutkVtxProducer::trkCandTag_
private

Definition at line 57 of file HLTmumutkVtxProducer.h.

const edm::EDGetTokenT<reco::RecoChargedCandidateCollection> HLTmumutkVtxProducer::trkCandToken_
private

Definition at line 58 of file HLTmumutkVtxProducer.h.

Referenced by produce().