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 Member Functions | Private Attributes
FastL3MuonTrajectoryBuilder Class Reference

#include <FastL3MuonTrajectoryBuilder.h>

Inheritance diagram for FastL3MuonTrajectoryBuilder:
GlobalTrajectoryBuilderBase MuonTrajectoryBuilder

Public Member Functions

void clear ()
 clear memory More...
 
 FastL3MuonTrajectoryBuilder (const edm::ParameterSet &, const MuonServiceProxy *)
 constructor with Parameter Set and MuonServiceProxy More...
 
virtual void setEvent (const edm::Event &)
 pass the Event to the algo at each event More...
 
MuonTrajectoryBuilder::CandidateContainer trajectories (const TrackCand &)
 reconstruct trajectories from standalone and tracker only Tracks More...
 
 ~FastL3MuonTrajectoryBuilder ()
 destructor More...
 
- Public Member Functions inherited from GlobalTrajectoryBuilderBase
 GlobalTrajectoryBuilderBase (const edm::ParameterSet &, const MuonServiceProxy *)
 constructor with Parameter Set and MuonServiceProxy More...
 
MuonTrajectoryBuilder::TrajectoryContainer trajectories (const TrajectorySeed &)
 dummy implementation, unused in this class More...
 
virtual ~GlobalTrajectoryBuilderBase ()
 destructor More...
 
- Public Member Functions inherited from MuonTrajectoryBuilder
 MuonTrajectoryBuilder ()
 constructor More...
 
virtual ~MuonTrajectoryBuilder ()
 destructor More...
 

Private Member Functions

std::vector< TrackCandmakeTkCandCollection (const TrackCand &)
 make a TrackCand collection using tracker Track, Trajectory information More...
 
TC makeTrajsFromSeeds (const std::vector< TrajectorySeed > &) const
 build a tracker Trajectory from a seed More...
 

Private Attributes

TrackCand dummyStaCand
 
std::vector< TrackCandregionalTkTracks
 
const edm::EventtheEvent
 
bool theFirstEvent
 
edm::InputTag theSimModule
 
edm::ESHandle< TrajectoryBuildertheTkBuilder
 
std::string theTkBuilderName
 
TrackerSeedGeneratortheTkSeedGenerator
 
bool theTkTrajsAvailableFlag
 
edm::InputTag theTrackerTrajectoryCollection
 
TrajectoryCleanertheTrajectoryCleaner
 

Additional Inherited Members

- Public Types inherited from GlobalTrajectoryBuilderBase
typedef
MuonTransientTrackingRecHit::ConstMuonRecHitContainer 
ConstMuonRecHitContainer
 
typedef
MuonTransientTrackingRecHit::ConstMuonRecHitPointer 
ConstMuonRecHitPointer
 
typedef
TransientTrackingRecHit::ConstRecHitContainer 
ConstRecHitContainer
 
typedef
TransientTrackingRecHit::ConstRecHitPointer 
ConstRecHitPointer
 
typedef
MuonTransientTrackingRecHit::MuonRecHitContainer 
MuonRecHitContainer
 
typedef
MuonTransientTrackingRecHit::MuonRecHitPointer 
MuonRecHitPointer
 
typedef
TransientTrackingRecHit::RecHitContainer 
RecHitContainer
 
typedef
TransientTrackingRecHit::RecHitPointer 
RecHitPointer
 
typedef std::vector< TrajectoryTC
 
typedef TC::const_iterator TI
 
- Public Types inherited from MuonTrajectoryBuilder
typedef
MuonCandidate::CandidateContainer 
CandidateContainer
 
typedef std::pair< const
Trajectory *, reco::TrackRef
TrackCand
 
typedef
MuonCandidate::TrajectoryContainer 
TrajectoryContainer
 
- Protected Types inherited from GlobalTrajectoryBuilderBase
enum  RefitDirection { inToOut, outToIn, undetermined }
 
- Protected Member Functions inherited from GlobalTrajectoryBuilderBase
void addTraj (TrackCand &)
 if TrackCand has only a TrackRef, attempt to add Trajectory* More...
 
MuonTrajectoryBuilder::CandidateContainer build (const TrackCand &, MuonTrajectoryBuilder::CandidateContainer &) const
 build combined trajectory from sta Track and tracker RecHits More...
 
void checkMuonHits (const reco::Track &, ConstRecHitContainer &, ConstRecHitContainer &, std::vector< int > &) const
 check muon RecHits, calculate chamber occupancy and select hits to be used in the final fit More...
 
RefitDirection checkRecHitsOrdering (const ConstRecHitContainer &) const
 This does nothing now. More...
 
std::vector< TrackCandchooseRegionalTrackerTracks (const TrackCand &, const std::vector< TrackCand > &)
 choose tracker tracks within region of interest More...
 
const TrajectorychooseTrajectory (const std::vector< Trajectory * > &, int) const
 choose final trajectory More...
 
RectangularEtaPhiTrackingRegion defineRegionOfInterest (const reco::TrackRef &) const
 define region of interest with tracker More...
 
void fixTEC (ConstRecHitContainer &all, double scl_x, double scl_y) const
 rescale errors of outermost TEC RecHit More...
 
TransientTrackingRecHit::ConstRecHitContainer getTransientRecHits (const reco::Track &) const
 get transient RecHits of a Track More...
 
void printHits (const ConstRecHitContainer &) const
 print all RecHits of a trajectory More...
 
ConstRecHitContainer selectMuonHits (const Trajectory &, const std::vector< int > &) const
 select muon hits compatible with trajectory; check hits in chambers with showers More...
 
ConstRecHitContainer selectTrackerHits (const ConstRecHitContainer &) const
 select tracker hits; exclude some tracker hits in the global trajectory More...
 
const MuonServiceProxyservice () const
 
GlobalMuonTrackMatchertrackMatcher () const
 
double trackProbability (const Trajectory &) const
 calculate chi2 probability (-ln(P)) More...
 
- Protected Attributes inherited from GlobalTrajectoryBuilderBase
std::string theCategory
 
float thePCut
 
float thePtCut
 

Detailed Description

class to build muon trajectory from STA L2 muons and tracker tracks

Date:
2008/03/24 20:07:54
Revision:
1.5
Author
Patrick Janot - CERN

Definition at line 41 of file FastL3MuonTrajectoryBuilder.h.

Constructor & Destructor Documentation

FastL3MuonTrajectoryBuilder::FastL3MuonTrajectoryBuilder ( const edm::ParameterSet par,
const MuonServiceProxy service 
)

constructor with Parameter Set and MuonServiceProxy

Class: FastL3MuonTrajectoryBuilder

Description: Reconstruct muons starting from a muon track reconstructed in the standalone muon system (with DT, CSC and RPC information) and from already reconstructed tracker tracks. It performs matching between the reconstructed tracks in the muon system and the tracker.

Date:
2008/05/14 17:43:24
Revision:
1.9

Authors : Patrick Janot - CERN

Definition at line 50 of file FastL3MuonTrajectoryBuilder.cc.

References edm::ParameterSet::getParameter(), cmsCodeRules.cppFunctionSkipper::operator, refitMuons_cfi::refitMuons, theFirstEvent, and theTrackerTrajectoryCollection.

52 :
53  GlobalTrajectoryBuilderBase(par, service),
55 {
56 
57  theFirstEvent = true;
58 
59  theTrackerTrajectoryCollection = par.getParameter<edm::InputTag>("TrackerTrajectories");
60 
61 #ifdef FAMOS_DEBUG
62  dbe = edm::Service<DQMStore>().operator->();
63  matchMuons = dbe->book1D("MatchMuons", "Eta distribution (match)",100,-2.5,2.5);
64  refitMuons = dbe->book1D("RefitMuons", "Eta distribution (refit)",100,-2.5,2.5);
65 #endif
66 
67 }
T getParameter(std::string const &) const
GlobalTrajectoryBuilderBase(const edm::ParameterSet &, const MuonServiceProxy *)
constructor with Parameter Set and MuonServiceProxy
TrackerSeedGenerator * theTkSeedGenerator
FastL3MuonTrajectoryBuilder::~FastL3MuonTrajectoryBuilder ( )

destructor

Definition at line 74 of file FastL3MuonTrajectoryBuilder.cc.

References theTrajectoryCleaner.

74  {
76 #ifdef FAMOS_DEBUG
77  dbe->save("test.root");
78 #endif
79 }

Member Function Documentation

void FastL3MuonTrajectoryBuilder::clear ( void  )
std::vector< FastL3MuonTrajectoryBuilder::TrackCand > FastL3MuonTrajectoryBuilder::makeTkCandCollection ( const TrackCand staCand)
privatevirtual

make a TrackCand collection using tracker Track, Trajectory information

Implements GlobalTrajectoryBuilderBase.

Definition at line 173 of file FastL3MuonTrajectoryBuilder.cc.

References edm::Event::getByLabel(), edm::helpers::KeyVal< K, V >::key, theEvent, theTrackerTrajectoryCollection, and edm::helpers::KeyVal< K, V >::val.

Referenced by setEvent().

173  {
174 
175  // const std::string category = "Muon|RecoMuon|FastL3MuonTrajectoryBuilder|makeTkCandCollection";
176 
177  std::vector<TrackCand> tkCandColl;
178 
179  // Get the tracker tracks
180  edm:: Handle<std::vector<Trajectory> > theTrajectories;
184 
188  firstAssociation = theAssoMap->begin();
189  lastAssociation = theAssoMap->end();
190 
191  // Loop on muon tracks seeded by L2 muons
192  for ( anAssociation = firstAssociation; anAssociation != lastAssociation; ++anAssociation ) {
193  edm::Ref<std::vector<Trajectory> > aTrajectoryRef = anAssociation->key;
194  reco::TrackRef aTrackRef = anAssociation->val;
195  tkCandColl.push_back(TrackCand(new Trajectory((*aTrajectoryRef)),reco::TrackRef()));
196  }
197 
198  // LogTrace(category) << "Found " << tkCandColl.size() << " tkCands from seeds";
199  // std::cout << "Found " << tkCandColl.size() << " tkCands from seeds" << std::endl;
200 
201  return tkCandColl;
202 
203 }
std::pair< const Trajectory *, reco::TrackRef > TrackCand
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
std::vector< Trajectory > FastL3MuonTrajectoryBuilder::makeTrajsFromSeeds ( const std::vector< TrajectorySeed > &  tkSeeds) const
private

build a tracker Trajectory from a seed

Definition at line 210 of file FastL3MuonTrajectoryBuilder.cc.

References query::result.

210  {
211 
212  // const std::string category = "Muon|RecoMuon|FastL3MuonTrajectoryBuilder|makeTrajsFromSeeds";
213  std::vector<Trajectory> result;
214  // edm::LogInfo(category) << "Trajectories from all seeds " << result.size();
215  return result;
216 
217 }
tuple result
Definition: query.py:137
void FastL3MuonTrajectoryBuilder::setEvent ( const edm::Event event)
virtual

pass the Event to the algo at each event

Reimplemented from GlobalTrajectoryBuilderBase.

Definition at line 84 of file FastL3MuonTrajectoryBuilder.cc.

References dummyStaCand, event(), makeTkCandCollection(), regionalTkTracks, GlobalTrajectoryBuilderBase::setEvent(), and theEvent.

84  {
85 
86  // const std::string category = "Muon|RecoMuon|FastL3MuonTrajectoryBuilder|setEvent";
87 
89  theEvent = &event;
90 
91  // Retrieve tracker tracks for muons
93  // edm::LogInfo(category) << "Found " << regionalTkTracks.size() << " tracker tracks from Muons";
94 
95 }
std::vector< TrackCand > makeTkCandCollection(const TrackCand &)
make a TrackCand collection using tracker Track, Trajectory information
virtual void setEvent(const edm::Event &)
pass the Event to the algo at each event
std::vector< TrackCand > regionalTkTracks
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
MuonCandidate::CandidateContainer FastL3MuonTrajectoryBuilder::trajectories ( const TrackCand staCandIn)
virtual

reconstruct trajectories from standalone and tracker only Tracks

Implements MuonTrajectoryBuilder.

Definition at line 101 of file FastL3MuonTrajectoryBuilder.cc.

References GlobalTrajectoryBuilderBase::addTraj(), GlobalTrajectoryBuilderBase::build(), GlobalMuonTrackMatcher::match(), MuonCandidate::muonTrack(), refitMuons_cfi::refitMuons, regionalTkTracks, query::result, edm::second(), GlobalTrajectoryBuilderBase::thePtCut, and GlobalTrajectoryBuilderBase::trackMatcher().

101  {
102 
103  // static const std::string category = "FastL3MuonTrajectoryBuilder";
104 
105  // cut on muons with low momenta
106  if ( (staCandIn).second->pt() < thePtCut ||
107  (staCandIn).second->innerMomentum().Rho() < thePtCut ||
108  (staCandIn).second->innerMomentum().R() < 2.5 ) return CandidateContainer();
109 
110  // convert the STA track into a Trajectory if Trajectory not already present
111  TrackCand staCand(staCandIn);
112  addTraj(staCand);
113 
114  // match tracker tracks to muon track
115  std::vector<TrackCand> trackerTracks = trackMatcher()->match(staCand, regionalTkTracks);
116 
117  // edm::LogInfo(category) << "Found " << trackerTracks.size() << " matching tracker tracks within region of interest";
118  if ( trackerTracks.empty() ) return CandidateContainer();
119 
120  // build a combined tracker-muon MuonCandidate
121  //
122  // turn tkMatchedTracks into MuonCandidates
123  //
124  //edm::LogInfo(category) << "turn tkMatchedTracks into MuonCandidates";
125  CandidateContainer tkTrajs;
126  for (std::vector<TrackCand>::const_iterator tkt = trackerTracks.begin(); tkt != trackerTracks.end(); tkt++) {
127  if ((*tkt).first != 0 && (*tkt).first->isValid()) {
128 
129  MuonCandidate* muonCand = new MuonCandidate(0,staCand.second,(*tkt).second,new Trajectory(*(*tkt).first));
130  tkTrajs.push_back(muonCand);
131 #ifdef FAMOS_DEBUG
132  if ( muonCand->muonTrack()->innerMomentum().Perp2() > 400. )
133  matchMuons->Fill(muonCand->muonTrack()->innerMomentum().Eta());
134 #endif
135  // LogTrace(category) << "tpush";
136 
137  }
138  }
139 
140  if ( tkTrajs.empty() ) {
141  // edm::LogInfo(category) << "tkTrajs empty";
142  return CandidateContainer();
143  }
144 
145  CandidateContainer result = build(staCand, tkTrajs);
146 #ifdef FAMOS_DEBUG
147  if ( result.size() > 0 ) {
148  CandidateContainer::const_iterator muonIt = result.begin();
149  if ((*muonIt)->muonTrack()->innerMomentum().Perp2() > 400. )
150  refitMuons->Fill((*muonIt)->muonTrack()->innerMomentum().Eta());
151  }
152 #endif
153  // edm::LogInfo(category) << "Found "<< result.size() << " L3Muons from one L2Cand";
154 
155  // free memory
156  if ( staCandIn.first == 0) delete staCand.first;
157 
158  for( CandidateContainer::const_iterator it = tkTrajs.begin(); it != tkTrajs.end(); ++it) {
159  if ( (*it)->trajectory() ) delete (*it)->trajectory();
160  if ( (*it)->trackerTrajectory() ) delete (*it)->trackerTrajectory();
161  if ( *it ) delete (*it);
162  }
163  tkTrajs.clear();
164 
165  return result;
166 
167 }
const reco::TrackRef muonTrack() const
return muon track
Definition: MuonCandidate.h:45
MuonCandidate::CandidateContainer CandidateContainer
GlobalMuonTrackMatcher * trackMatcher() const
void addTraj(TrackCand &)
if TrackCand has only a TrackRef, attempt to add Trajectory*
std::pair< const Trajectory *, reco::TrackRef > TrackCand
std::vector< TrackCand > regionalTkTracks
U second(std::pair< T, U > const &p)
tuple result
Definition: query.py:137
double match(const TrackCand &sta, const TrackCand &track, int matchOption=0, int surfaceOption=1) const
MuonTrajectoryBuilder::CandidateContainer build(const TrackCand &, MuonTrajectoryBuilder::CandidateContainer &) const
build combined trajectory from sta Track and tracker RecHits

Member Data Documentation

TrackCand FastL3MuonTrajectoryBuilder::dummyStaCand
private

Definition at line 71 of file FastL3MuonTrajectoryBuilder.h.

Referenced by setEvent().

std::vector<TrackCand> FastL3MuonTrajectoryBuilder::regionalTkTracks
private

Definition at line 70 of file FastL3MuonTrajectoryBuilder.h.

Referenced by clear(), setEvent(), and trajectories().

const edm::Event* FastL3MuonTrajectoryBuilder::theEvent
private

Definition at line 84 of file FastL3MuonTrajectoryBuilder.h.

Referenced by makeTkCandCollection(), and setEvent().

bool FastL3MuonTrajectoryBuilder::theFirstEvent
private

Definition at line 74 of file FastL3MuonTrajectoryBuilder.h.

Referenced by FastL3MuonTrajectoryBuilder().

edm::InputTag FastL3MuonTrajectoryBuilder::theSimModule
private

Definition at line 83 of file FastL3MuonTrajectoryBuilder.h.

edm::ESHandle<TrajectoryBuilder> FastL3MuonTrajectoryBuilder::theTkBuilder
private

Definition at line 80 of file FastL3MuonTrajectoryBuilder.h.

std::string FastL3MuonTrajectoryBuilder::theTkBuilderName
private

Definition at line 79 of file FastL3MuonTrajectoryBuilder.h.

TrackerSeedGenerator* FastL3MuonTrajectoryBuilder::theTkSeedGenerator
private

Definition at line 76 of file FastL3MuonTrajectoryBuilder.h.

bool FastL3MuonTrajectoryBuilder::theTkTrajsAvailableFlag
private

Definition at line 73 of file FastL3MuonTrajectoryBuilder.h.

edm::InputTag FastL3MuonTrajectoryBuilder::theTrackerTrajectoryCollection
private
TrajectoryCleaner* FastL3MuonTrajectoryBuilder::theTrajectoryCleaner
private

Definition at line 77 of file FastL3MuonTrajectoryBuilder.h.

Referenced by ~FastL3MuonTrajectoryBuilder().