CMS 3D CMS Logo

FastL3MuonTrajectoryBuilder Class Reference

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

#include <FastSimulation/Muons/interface/FastL3MuonTrajectoryBuilder.h>

Inheritance diagram for FastL3MuonTrajectoryBuilder:

GlobalTrajectoryBuilderBase MuonTrajectoryBuilder

List of all members.

Public Member Functions

void clear ()
 clear memory
 FastL3MuonTrajectoryBuilder (const edm::ParameterSet &, const MuonServiceProxy *)
 constructor with Parameter Set and MuonServiceProxy
virtual void setEvent (const edm::Event &)
 pass the Event to the algo at each event
MuonTrajectoryBuilder::CandidateContainer trajectories (const TrackCand &)
 reconstruct trajectories from standalone and tracker only Tracks
 ~FastL3MuonTrajectoryBuilder ()
 destructor

Private Member Functions

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

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


Detailed Description

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

Date
2008/05/14 17:43:23
Revision
1.6

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(), theFirstEvent, and theTrackerTrajectoryCollection.

00052 : 
00053   GlobalTrajectoryBuilderBase(par, service), 
00054   theTkSeedGenerator(0), theTrajectoryCleaner(0) 
00055 {
00056 
00057   theFirstEvent = true;
00058   
00059   theTrackerTrajectoryCollection = par.getParameter<edm::InputTag>("TrackerTrajectories");
00060 
00061 #ifdef FAMOS_DEBUG
00062   dbe = edm::Service<DQMStore>().operator->();
00063   matchMuons = dbe->book1D("MatchMuons", "Eta distribution (match)",100,-2.5,2.5);
00064   refitMuons = dbe->book1D("RefitMuons", "Eta distribution (refit)",100,-2.5,2.5);
00065 #endif
00066 
00067 }

FastL3MuonTrajectoryBuilder::~FastL3MuonTrajectoryBuilder (  ) 

destructor

Definition at line 74 of file FastL3MuonTrajectoryBuilder.cc.

References theTrajectoryCleaner.

00074                                                           {
00075   if (theTrajectoryCleaner) delete theTrajectoryCleaner;
00076 #ifdef FAMOS_DEBUG
00077   dbe->save("test.root");
00078 #endif
00079 }


Member Function Documentation

void FastL3MuonTrajectoryBuilder::clear ( void   ) 

clear memory

Definition at line 224 of file FastL3MuonTrajectoryBuilder.cc.

References regionalTkTracks.

Referenced by FastL3MuonProducer::produce().

00224                                    { 
00225   std::vector<TrackCand>::const_iterator is = regionalTkTracks.begin();
00226   std::vector<TrackCand>::const_iterator il = regionalTkTracks.end();
00227   for ( ; is != il; ++is) {
00228     delete (*is).first;   
00229   }
00230 }

std::vector< FastL3MuonTrajectoryBuilder::TrackCand > FastL3MuonTrajectoryBuilder::makeTkCandCollection ( const TrackCand staCand  )  [private, virtual]

make a TrackCand collection using tracker Track, Trajectory information

Implements GlobalTrajectoryBuilderBase.

Definition at line 177 of file FastL3MuonTrajectoryBuilder.cc.

References edm::Event::getByLabel(), theEvent, and theTrackerTrajectoryCollection.

Referenced by setEvent().

00177                                                                           {
00178 
00179   // const std::string category = "Muon|RecoMuon|FastL3MuonTrajectoryBuilder|makeTkCandCollection";
00180 
00181   std::vector<TrackCand> tkCandColl;  
00182 
00183   // Get the tracker tracks
00184   edm:: Handle<std::vector<Trajectory> > theTrajectories;
00185   edm::Handle<TrajTrackAssociationCollection> theAssoMap;  
00186   theEvent->getByLabel(theTrackerTrajectoryCollection,theTrajectories);
00187   theEvent->getByLabel(theTrackerTrajectoryCollection,theAssoMap);
00188   
00189   TrajTrackAssociationCollection::const_iterator anAssociation;  
00190   TrajTrackAssociationCollection::const_iterator firstAssociation;  
00191   TrajTrackAssociationCollection::const_iterator lastAssociation;
00192   firstAssociation = theAssoMap->begin();
00193   lastAssociation = theAssoMap->end();
00194 
00195   // Loop on muon tracks seeded by L2 muons
00196   for ( anAssociation = firstAssociation; anAssociation != lastAssociation; ++anAssociation ) { 
00197     edm::Ref<std::vector<Trajectory> > aTrajectoryRef = anAssociation->key;
00198     reco::TrackRef aTrackRef = anAssociation->val;
00199     tkCandColl.push_back(TrackCand(new Trajectory((*aTrajectoryRef)),reco::TrackRef()));
00200   }
00201         
00202   // LogTrace(category) << "Found " << tkCandColl.size() << " tkCands from seeds";
00203   // std::cout << "Found " << tkCandColl.size() << " tkCands from seeds" << std::endl;
00204 
00205   return tkCandColl;
00206 
00207 }

std::vector< Trajectory > FastL3MuonTrajectoryBuilder::makeTrajsFromSeeds ( const std::vector< TrajectorySeed > &  tkSeeds  )  const [private]

build a tracker Trajectory from a seed

Definition at line 214 of file FastL3MuonTrajectoryBuilder.cc.

References HLT_VtxMuL3::result.

00214                                                                                               {
00215 
00216   // const std::string category = "Muon|RecoMuon|FastL3MuonTrajectoryBuilder|makeTrajsFromSeeds";
00217   std::vector<Trajectory> result;
00218   // edm::LogInfo(category) << "Trajectories from all seeds " << result.size();
00219   return result;
00220 
00221 }

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, makeTkCandCollection(), regionalTkTracks, GlobalTrajectoryBuilderBase::setEvent(), and theEvent.

00084                                                                 {
00085   
00086   // const std::string category = "Muon|RecoMuon|FastL3MuonTrajectoryBuilder|setEvent";
00087     
00088   GlobalTrajectoryBuilderBase::setEvent(event);
00089   theEvent = &event;
00090     
00091   // Retrieve tracker tracks for muons
00092   regionalTkTracks = makeTkCandCollection(dummyStaCand);
00093   // edm::LogInfo(category) << "Found " << regionalTkTracks.size() << " tracker tracks from Muons";  
00094 
00095 }

MuonCandidate::CandidateContainer FastL3MuonTrajectoryBuilder::trajectories ( const TrackCand staCandIn  ) 

reconstruct trajectories from standalone and tracker only Tracks

Definition at line 101 of file FastL3MuonTrajectoryBuilder.cc.

References GlobalTrajectoryBuilderBase::addTraj(), GlobalTrajectoryBuilderBase::build(), it, GlobalMuonTrackMatcher::match(), MuonCandidate::muonTrack(), GlobalTrajectoryBuilderBase::refitTrajectory(), regionalTkTracks, HLT_VtxMuL3::result, edm::second(), GlobalTrajectoryBuilderBase::thePtCut, and GlobalTrajectoryBuilderBase::trackMatcher().

00101                                                                     {
00102 
00103   // static const std::string category = "FastL3MuonTrajectoryBuilder";
00104 
00105   // cut on muons with low momenta
00106   if ( (staCandIn).second->pt() < thePtCut || 
00107        (staCandIn).second->innerMomentum().Rho() < thePtCut || 
00108        (staCandIn).second->innerMomentum().R() < 2.5 ) return CandidateContainer();
00109 
00110   // convert the STA track into a Trajectory if Trajectory not already present
00111   TrackCand staCand(staCandIn);
00112   addTraj(staCand);
00113   
00114   // match tracker tracks to muon track
00115   std::vector<TrackCand> trackerTracks = trackMatcher()->match(staCand, regionalTkTracks);
00116 
00117   // edm::LogInfo(category) << "Found " << trackerTracks.size() << " matching tracker tracks within region of interest";
00118   if ( trackerTracks.empty() ) return CandidateContainer();
00119   
00120   // build a combined tracker-muon MuonCandidate
00121   //
00122   // turn tkMatchedTracks into MuonCandidates
00123   //
00124   //edm::LogInfo(category) << "turn tkMatchedTracks into MuonCandidates";
00125   CandidateContainer tkTrajs;
00126   for (std::vector<TrackCand>::const_iterator tkt = trackerTracks.begin(); tkt != trackerTracks.end(); tkt++) {
00127     if ((*tkt).first != 0 && (*tkt).first->isValid()) {
00128       std::vector<Trajectory> refittedTk;
00129       Trajectory refittedTkTraj = *(*tkt).first;
00130       refittedTk = refitTrajectory(*(*tkt).first);
00131       if(refittedTk.size() == 1) refittedTkTraj = refittedTk.front();
00132       
00133       MuonCandidate* muonCand = new MuonCandidate( 0 ,staCand.second,(*tkt).second, new Trajectory(refittedTkTraj));
00134       tkTrajs.push_back(muonCand);
00135 #ifdef FAMOS_DEBUG
00136       if ( muonCand->muonTrack()->innerMomentum().Perp2() > 400. ) 
00137         matchMuons->Fill(muonCand->muonTrack()->innerMomentum().Eta());
00138 #endif
00139       // LogTrace(category) << "tpush";
00140 
00141     }
00142   }
00143   
00144   if ( tkTrajs.empty() )  {
00145     // edm::LogInfo(category) << "tkTrajs empty";
00146     return CandidateContainer();
00147   }
00148   
00149   CandidateContainer result = build(staCand, tkTrajs);  
00150 #ifdef FAMOS_DEBUG
00151   if ( result.size() > 0 ) { 
00152     CandidateContainer::const_iterator muonIt = result.begin();
00153     if ((*muonIt)->muonTrack()->innerMomentum().Perp2() > 400. ) 
00154       refitMuons->Fill((*muonIt)->muonTrack()->innerMomentum().Eta());
00155   }
00156 #endif
00157   // edm::LogInfo(category) << "Found "<< result.size() << " L3Muons from one L2Cand";
00158 
00159   // free memory
00160   if ( staCandIn.first == 0) delete staCand.first;
00161 
00162   for( CandidateContainer::const_iterator it = tkTrajs.begin(); it != tkTrajs.end(); ++it) {
00163     if ( (*it)->trajectory() ) delete (*it)->trajectory();
00164     if ( (*it)->trackerTrajectory() ) delete (*it)->trackerTrajectory();
00165     if ( *it ) delete (*it);
00166   }
00167   tkTrajs.clear();  
00168 
00169   return result;
00170   
00171 }


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]

Reimplemented from GlobalTrajectoryBuilderBase.

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]

Reimplemented from GlobalTrajectoryBuilderBase.

Definition at line 73 of file FastL3MuonTrajectoryBuilder.h.

edm::InputTag FastL3MuonTrajectoryBuilder::theTrackerTrajectoryCollection [private]

Definition at line 82 of file FastL3MuonTrajectoryBuilder.h.

Referenced by FastL3MuonTrajectoryBuilder(), and makeTkCandCollection().

TrajectoryCleaner* FastL3MuonTrajectoryBuilder::theTrajectoryCleaner [private]

Definition at line 77 of file FastL3MuonTrajectoryBuilder.h.

Referenced by ~FastL3MuonTrajectoryBuilder().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:43 2009 for CMSSW by  doxygen 1.5.4