CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
DualByL2TSG Class Reference

#include <DualByL2TSG.h>

Inheritance diagram for DualByL2TSG:
SeparatingTSG CompositeTSG TrackerSeedGenerator

Public Member Functions

 DualByL2TSG (const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
 
unsigned int selectTSG (const TrackCand &, const TrackingRegion &)
 decide the TSG depending on the existence of a L3 track seeded from the L2. Return value is 0 or 1. More...
 
- Public Member Functions inherited from SeparatingTSG
 SeparatingTSG (const edm::ParameterSet &pset, edm::ConsumesCollector &IC)
 
void trackerSeeds (const TrackCand &, const TrackingRegion &, const TrackerTopology *, BTSeedCollection &)
 provides the seeds from the TSGs: must be overloaded More...
 
virtual ~SeparatingTSG ()
 
- Public Member Functions inherited from CompositeTSG
 CompositeTSG (const edm::ParameterSet &pset, edm::ConsumesCollector &IC)
 
void init (const MuonServiceProxy *service)
 initialized the TSGs More...
 
void setEvent (const edm::Event &event)
 set the event to the TSGs More...
 
virtual ~CompositeTSG ()
 
- Public Member Functions inherited from TrackerSeedGenerator
const edm::EventgetEvent () const
 
 TrackerSeedGenerator ()
 
virtual ~TrackerSeedGenerator ()
 destructor More...
 

Private Attributes

edm::Handle
< reco::TrackCollection
l3muonH
 
edm::EDGetTokenT
< reco::TrackCollection
l3muonToken
 
std::string theCategory
 
edm::InputTag theL3CollectionLabelA
 

Additional Inherited Members

- Public Types inherited from CompositeTSG
typedef std::vector
< TrajectorySeed
BTSeedCollection
 
typedef std::pair< const
Trajectory *, reco::TrackRef
TrackCand
 
- Public Types inherited from TrackerSeedGenerator
typedef std::vector
< TrajectorySeed
BTSeedCollection
 
typedef std::pair< const
Trajectory *, reco::TrackRef
TrackCand
 
- Protected Member Functions inherited from CompositeTSG
unsigned int nTSGs ()
 
- Protected Attributes inherited from CompositeTSG
std::string theCategory
 
std::vector< std::string > theNames
 
const MuonServiceProxytheProxyService
 
std::vector
< TrackerSeedGenerator * > 
theTSGs
 
- Protected Attributes inherited from TrackerSeedGenerator
const edm::EventtheEvent
 
const MuonServiceProxytheProxyService
 

Detailed Description

Description: SeparatingTSG (TrackerSeedGenerator) which makes a check to see if a previous seed lead to a L3 track

Author
Jean-Roch vlimant, Adam Everett

Definition at line 18 of file DualByL2TSG.h.

Constructor & Destructor Documentation

DualByL2TSG::DualByL2TSG ( const edm::ParameterSet pset,
edm::ConsumesCollector iC 
)

Definition at line 12 of file DualByL2TSG.cc.

References edm::ConsumesCollector::consumes(), edm::ParameterSet::getParameter(), l3muonToken, CompositeTSG::nTSGs(), theCategory, and theL3CollectionLabelA.

12  : SeparatingTSG(pset,iC){ theCategory ="DualByL2TSG";
13  theL3CollectionLabelA = pset.getParameter<edm::InputTag>("L3TkCollectionA");
14  if (nTSGs()!=2)
15  {edm::LogError(theCategory)<<"not two seed generators provided";}
16 
18 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::TrackCollection > l3muonToken
Definition: DualByL2TSG.h:30
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
SeparatingTSG(const edm::ParameterSet &pset, edm::ConsumesCollector &IC)
Definition: SeparatingTSG.cc:5
std::string theCategory
Definition: DualByL2TSG.h:27
unsigned int nTSGs()
Definition: CompositeTSG.h:40
edm::InputTag theL3CollectionLabelA
Definition: DualByL2TSG.h:28

Member Function Documentation

unsigned int DualByL2TSG::selectTSG ( const TrackCand muonTrackCand,
const TrackingRegion region 
)
virtual

decide the TSG depending on the existence of a L3 track seeded from the L2. Return value is 0 or 1.

Implements SeparatingTSG.

Definition at line 20 of file DualByL2TSG.cc.

References edm::HandleBase::failedToGet(), edm::Event::getByToken(), TrackerSeedGenerator::getEvent(), i, l3muonH, l3muonToken, LogDebug, findQualityFiles::maxI, and theCategory.

21 {
22  LogDebug(theCategory)<<"|eta|=|"<<muonTrackCand.second->eta()<<"|";
23 
24  bool re_do_this_L2 = true;
25  //LogDebug("TrackerSeedGenerator")<<theEvent;
26  //getEvent();
27 
28  //retrieve L3 track collection
30  getEvent()->getByToken(l3muonToken ,l3muonH);
31  if(l3muonH.failedToGet()) return 0;
32 
33  unsigned int maxI = l3muonH->size();
34 
35  LogDebug(theCategory) << "TheCollectionA size " << maxI;
36 
37  // Loop through all tracks, if the track was seeded from this L2, then skip
38  for (unsigned int i=0;i!=maxI;++i){
39  reco::TrackRef tk(l3muonH,i);
41  reco::TrackRef staTrack = l3seedRef->l2Track();
42 
43  if(staTrack == (muonTrackCand.second) ) re_do_this_L2 = false;
44  //LogDebug(theCategory) << "The DualByL2TSG selectTSG loop " << re_do_this_L2 << " staCand " << muonTrackCand.second->eta() << " " << muonTrackCand.second->pt() << " alreadyMadeRefToL3 " << staTrack->eta() << " " << staTrack->pt();
45  }
46 
47  LogDebug(theCategory) << "The DualByL2TSG to use " << re_do_this_L2 ;
48 
49  return re_do_this_L2 ? 1 : 0;
50 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< reco::TrackCollection > l3muonToken
Definition: DualByL2TSG.h:30
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
edm::Handle< reco::TrackCollection > l3muonH
Definition: DualByL2TSG.h:29
const edm::Event * getEvent() const
bool failedToGet() const
Definition: HandleBase.h:79
std::string theCategory
Definition: DualByL2TSG.h:27

Member Data Documentation

edm::Handle<reco::TrackCollection> DualByL2TSG::l3muonH
private

Definition at line 29 of file DualByL2TSG.h.

Referenced by selectTSG().

edm::EDGetTokenT<reco::TrackCollection> DualByL2TSG::l3muonToken
private

Definition at line 30 of file DualByL2TSG.h.

Referenced by DualByL2TSG(), and selectTSG().

std::string DualByL2TSG::theCategory
private

Definition at line 27 of file DualByL2TSG.h.

Referenced by DualByL2TSG(), and selectTSG().

edm::InputTag DualByL2TSG::theL3CollectionLabelA
private

Definition at line 28 of file DualByL2TSG.h.

Referenced by DualByL2TSG().