#include <RecoMuon/L3TrackFinder/interface/L3MuonTrajectoryBuilder.h>
Definition at line 30 of file L3MuonTrajectoryBuilder.h.
L3MuonTrajectoryBuilder::L3MuonTrajectoryBuilder | ( | const edm::ParameterSet & | par, | |
const MuonServiceProxy * | service | |||
) |
constructor with Parameter Set and MuonServiceProxy
Definition at line 71 of file L3MuonTrajectoryBuilder.cc.
References DBSPlugin::get(), edm::ParameterSet::getParameter(), GlobalTrajectoryBuilderBase::service(), theFirstEvent, theSeedName, theTkBuilderName, theTkCollName, theTkSeedGenerator, and theTrajectoryCleaner.
00072 : GlobalTrajectoryBuilderBase(par, service), theTkSeedGenerator(0) { 00073 00074 theFirstEvent = true; 00075 00076 // 00077 // start seed generator; 00078 // 00079 ParameterSet seedGenPSet = par.getParameter<ParameterSet>("SeedGeneratorParameters"); 00080 std::string seedGenName = seedGenPSet.getParameter<std::string>("ComponentName"); 00081 theTkSeedGenerator = TrackerSeedGeneratorFactory::get()->create(seedGenName, seedGenPSet); 00082 theTkSeedGenerator->init(GlobalTrajectoryBuilderBase::service()); 00083 00084 theTkBuilderName = par.getParameter<std::string>("TkTrackBuilder"); 00085 00086 theTrajectoryCleaner = new TrajectoryCleanerBySharedHits(); 00087 00088 theSeedName = par.getParameter<edm::InputTag>("l3SeedLabel"); 00089 theTkCollName = par.getParameter<edm::InputTag>("tkTrajLabel"); 00090 00091 }
L3MuonTrajectoryBuilder::~L3MuonTrajectoryBuilder | ( | ) |
destructor
Definition at line 98 of file L3MuonTrajectoryBuilder.cc.
References theTrajectoryCleaner.
00098 { 00099 if (theTrajectoryCleaner) delete theTrajectoryCleaner; 00100 }
vector< L3MuonTrajectoryBuilder::TrackCand > L3MuonTrajectoryBuilder::makeTkCandCollection | ( | const TrackCand & | staCand | ) | [private, virtual] |
make a TrackCand collection using tracker Track, Trajectory information
Implements GlobalTrajectoryBuilderBase.
Definition at line 203 of file L3MuonTrajectoryBuilder.cc.
References category, GlobalTrajectoryBuilderBase::defineRegionOfInterest(), LogDebug, LogTrace, makeTrajsFromSeeds(), theSeedCollection, theSeedsAvailable, theTkSeedGenerator, theTkTrajCollection, theTrajsAvailable, TrackerSeedGenerator::trackerSeeds(), and tt.
Referenced by trajectories().
00203 { 00204 00205 const std::string category = "Muon|RecoMuon|L3MuonTrajectoryBuilder|makeTkCandCollection"; 00206 00207 vector<TrackCand> tkCandColl; 00208 00209 if (theTrajsAvailable) { 00210 LogDebug(category) << "Found " << theTkTrajCollection->size() <<" tkCands"; 00211 for (TC::const_iterator tt=theTkTrajCollection->begin();tt!=theTkTrajCollection->end();++tt){ 00212 tkCandColl.push_back(TrackCand(new Trajectory(*tt),reco::TrackRef())); 00213 } 00214 LogTrace(category) << "Found " << tkCandColl.size() << " tkCands from seeds"; 00215 return tkCandColl; 00216 } 00217 00218 // Tracks not available, make seeds and trajectories 00219 // std::vector<L3MuonTrajectorySeed> useSeeds; 00220 std::vector<TrajectorySeed> tkSeeds; 00221 if( theSeedsAvailable ) { 00222 L3MuonTrajectorySeedCollection::const_iterator l3Seed; 00223 for(l3Seed=theSeedCollection->begin(); l3Seed != theSeedCollection->end(); ++l3Seed) { 00224 const reco::TrackRef & l2FromSeed = l3Seed->l2Track(); 00225 if(staCand.second == l2FromSeed) tkSeeds.push_back(*l3Seed); 00226 } 00227 } else { 00228 00229 LogTrace(category) << "Making Seeds"; 00230 00231 RectangularEtaPhiTrackingRegion region = defineRegionOfInterest((staCand.second)); 00232 theTkSeedGenerator->trackerSeeds(staCand, region, tkSeeds); 00233 } 00234 00235 LogTrace(category) << "Found " << tkSeeds.size() << " tracker seeds"; 00236 00237 TC allTkTrajs = makeTrajsFromSeeds(tkSeeds); 00238 00239 for (TC::const_iterator tt=allTkTrajs.begin();tt!=allTkTrajs.end();++tt){ 00240 tkCandColl.push_back(TrackCand(new Trajectory(*tt),reco::TrackRef())); 00241 } 00242 00243 LogTrace(category) << "Found " << tkCandColl.size() << " tkCands from seeds"; 00244 00245 return tkCandColl; 00246 00247 }
TC L3MuonTrajectoryBuilder::makeTrajsFromSeeds | ( | const std::vector< TrajectorySeed > & | ) | const [private] |
void L3MuonTrajectoryBuilder::setEvent | ( | const edm::Event & | event | ) | [virtual] |
pass the Event to the algo at each event
Reimplemented from GlobalTrajectoryBuilderBase.
Definition at line 105 of file L3MuonTrajectoryBuilder.cc.
References category, GlobalTrajectoryBuilderBase::service(), TrackerSeedGenerator::setEvent(), GlobalTrajectoryBuilderBase::setEvent(), theFirstEvent, theSeedCollection, theSeedName, theSeedsAvailable, theTkBuilder, theTkBuilderName, theTkCandsAvailable, theTkCollName, theTkSeedGenerator, theTkTrackCandCollection, theTkTrajCollection, and theTrajsAvailable.
00105 { 00106 00107 const std::string category = "Muon|RecoMuon|L3MuonTrajectoryBuilder|setEvent"; 00108 00109 GlobalTrajectoryBuilderBase::setEvent(event); 00110 00111 00112 if (theFirstEvent) { 00113 00114 theFirstEvent = false; 00115 LogInfo(category) << "Constructing a Tk Trajectory Builder"; 00116 GlobalTrajectoryBuilderBase::service()->eventSetup().get<CkfComponentsRecord>().get(theTkBuilderName,theTkBuilder); 00117 } 00118 00119 theTkBuilder->setEvent(event); 00120 00121 theTkSeedGenerator->setEvent(event); 00122 00123 theSeedsAvailable = event.getByLabel(theSeedName,theSeedCollection); 00124 theTrajsAvailable = event.getByLabel(theTkCollName,theTkTrajCollection); 00125 theTkCandsAvailable = event.getByLabel(theTkCollName,theTkTrackCandCollection); 00126 00127 }
MuonCandidate::CandidateContainer L3MuonTrajectoryBuilder::trajectories | ( | const TrackCand & | staCandIn | ) |
reconstruct trajectories from standalone and tracker only Tracks
Definition at line 132 of file L3MuonTrajectoryBuilder.cc.
References GlobalTrajectoryBuilderBase::addTraj(), GlobalTrajectoryBuilderBase::build(), category, it, LogTrace, makeTkCandCollection(), GlobalMuonTrackMatcher::match(), GlobalTrajectoryBuilderBase::refitTrajectory(), HLT_VtxMuL3::result, edm::second(), GlobalTrajectoryBuilderBase::thePtCut, and GlobalTrajectoryBuilderBase::trackMatcher().
00132 { 00133 00134 const std::string category = "Muon|RecoMuon|L3MuonTrajectoryBuilder|trajectories"; 00135 00136 // cut on muons with low momenta 00137 if ( (staCandIn).second->pt() < thePtCut || (staCandIn).second->innerMomentum().Rho() < thePtCut || (staCandIn).second->innerMomentum().R() < 2.5 ) return CandidateContainer(); 00138 00139 // convert the STA track into a Trajectory if Trajectory not already present 00140 TrackCand staCand(staCandIn); 00141 addTraj(staCand); 00142 00143 vector<TrackCand> trackerTracks; 00144 00145 vector<TrackCand> regionalTkTracks = makeTkCandCollection(staCand); 00146 LogInfo(category) << "Found " << regionalTkTracks.size() << " tracks within region of interest"; 00147 00148 // match tracker tracks to muon track 00149 trackerTracks = trackMatcher()->match(staCand, regionalTkTracks); 00150 00151 LogInfo(category) << "Found " << trackerTracks.size() << " matching tracker tracks within region of interest"; 00152 if ( trackerTracks.empty() ) return CandidateContainer(); 00153 00154 // build a combined tracker-muon MuonCandidate 00155 // 00156 // turn tkMatchedTracks into MuonCandidates 00157 // 00158 LogInfo(category) << "turn tkMatchedTracks into MuonCandidates"; 00159 CandidateContainer tkTrajs; 00160 for (vector<TrackCand>::const_iterator tkt = trackerTracks.begin(); tkt != trackerTracks.end(); tkt++) { 00161 if ((*tkt).first != 0 && (*tkt).first->isValid()) { 00162 std::vector<Trajectory> refittedTk; 00163 Trajectory refittedTkTraj = *(*tkt).first; 00164 refittedTk = refitTrajectory(*(*tkt).first); 00165 if(refittedTk.size() == 1) refittedTkTraj = refittedTk.front(); 00166 00167 MuonCandidate* muonCand = new MuonCandidate( 0 ,staCand.second,(*tkt).second, new Trajectory(refittedTkTraj)); 00168 tkTrajs.push_back(muonCand); 00169 LogTrace(category) << "tpush"; 00170 00171 } 00172 } 00173 00174 if ( tkTrajs.empty() ) { 00175 LogInfo(category) << "tkTrajs empty"; 00176 return CandidateContainer(); 00177 } 00178 00179 CandidateContainer result = build(staCand, tkTrajs); 00180 LogInfo(category) << "Found "<< result.size() << " L3Muons from one L2Cand"; 00181 00182 // free memory 00183 if ( staCandIn.first == 0) delete staCand.first; 00184 00185 for( CandidateContainer::const_iterator it = tkTrajs.begin(); it != tkTrajs.end(); ++it) { 00186 if ( (*it)->trajectory() ) delete (*it)->trajectory(); 00187 if ( (*it)->trackerTrajectory() ) delete (*it)->trackerTrajectory(); 00188 if ( *it ) delete (*it); 00189 } 00190 tkTrajs.clear(); 00191 00192 for ( vector<TrackCand>::const_iterator is = regionalTkTracks.begin(); is != regionalTkTracks.end(); ++is) { 00193 delete (*is).first; 00194 } 00195 00196 return result; 00197 00198 }
bool L3MuonTrajectoryBuilder::theFirstEvent [private] |
Definition at line 57 of file L3MuonTrajectoryBuilder.h.
Referenced by L3MuonTrajectoryBuilder(), and setEvent().
Definition at line 69 of file L3MuonTrajectoryBuilder.h.
Referenced by makeTkCandCollection(), and setEvent().
Definition at line 68 of file L3MuonTrajectoryBuilder.h.
Referenced by L3MuonTrajectoryBuilder(), and setEvent().
Definition at line 58 of file L3MuonTrajectoryBuilder.h.
Referenced by makeTkCandCollection(), and setEvent().
std::string L3MuonTrajectoryBuilder::theTkBuilderName [private] |
Definition at line 65 of file L3MuonTrajectoryBuilder.h.
Referenced by L3MuonTrajectoryBuilder(), and setEvent().
Definition at line 71 of file L3MuonTrajectoryBuilder.h.
Referenced by L3MuonTrajectoryBuilder(), and setEvent().
Definition at line 62 of file L3MuonTrajectoryBuilder.h.
Referenced by L3MuonTrajectoryBuilder(), makeTkCandCollection(), and setEvent().
Definition at line 72 of file L3MuonTrajectoryBuilder.h.
Referenced by makeTkCandCollection(), and setEvent().
Definition at line 63 of file L3MuonTrajectoryBuilder.h.
Referenced by L3MuonTrajectoryBuilder(), and ~L3MuonTrajectoryBuilder().
Definition at line 59 of file L3MuonTrajectoryBuilder.h.
Referenced by makeTkCandCollection(), and setEvent().