CMS 3D CMS Logo

TSGForRoadSearch Class Reference

Description: this class generates hit-less TrajectorySeed from a given Track. More...

#include <RecoMuon/TrackerSeedGenerator/plugins/TSGForRoadSearch.h>

Inheritance diagram for TSGForRoadSearch:

TrackerSeedGenerator

List of all members.

Public Types

typedef std::vector
< TrajectorySeed
BTSeedCollection
typedef std::pair< const
Trajectory *, reco::TrackRef
TrackCand

Public Member Functions

void init (const MuonServiceProxy *service)
 initialize the service
void setEvent (const edm::Event &event)
 set the event: update the MeasurementTracker
void trackerSeeds (const TrackCand &, const TrackingRegion &, BTSeedCollection &)
 generated seed(s) for a track. the tracking region is not used.
 TSGForRoadSearch (const edm::ParameterSet &pset)
virtual ~TSGForRoadSearch ()

Private Member Functions

void adjust (TrajectoryStateOnSurface &)
 adjust the error matrix of the TSOS
void adjust (FreeTrajectoryState &)
 adjust the error matrix of the FTS
bool IPfts (const reco::Track &, FreeTrajectoryState &)
 get the FTS for a Track: adjusting the error matrix if requested
void makeSeeds_0 (const reco::Track &, std::vector< TrajectorySeed > &)
 oseed from inside-out: innermost Strip layer
void makeSeeds_1 (const reco::Track &, std::vector< TrajectorySeed > &)
 not implemented
void makeSeeds_2 (const reco::Track &, std::vector< TrajectorySeed > &)
 not implemented
void makeSeeds_3 (const reco::Track &, std::vector< TrajectorySeed > &)
 outside-in: outermost Strip layer
void makeSeeds_4 (const reco::Track &, std::vector< TrajectorySeed > &)
 inside-out: innermost Pixel/Strip layer
void pushTrajectorySeed (const reco::Track &muon, std::vector< DetLayer::DetWithState > &compatible, PropagationDirection direction, std::vector< TrajectorySeed > &result) const
 add the seed(s) to the collection of seeds

Private Attributes

bool theAdjustAtIp
std::string theCategory
Chi2MeasurementEstimatortheChi2Estimator
edm::ParameterSet theConfig
bool theCopyMuonRecHit
MuonErrorMatrixtheErrorMatrixAdjuster
bool theManySeeds
edm::ESHandle< MeasurementTrackertheMeasurementTracker
uint theOption
edm::ESHandle< PropagatortheProp
std::string thePropagatorCompatibleName
std::string thePropagatorName
edm::ESHandle< PropagatorthePropCompatible
const MuonServiceProxy * theProxyService
bool theScale
TrajectoryStateUpdatortheUpdator


Detailed Description

Description: this class generates hit-less TrajectorySeed from a given Track.

the original error matrix of the Track is adjusted (configurable). this class is principally used for muon HLT. for options are available:

regular operation is one seed per track, but optionnaly, more than one seed can be madefor one track.

Author:
Jean-Roch Vlimant

Definition at line 42 of file TSGForRoadSearch.h.


Member Typedef Documentation

typedef std::vector<TrajectorySeed> TSGForRoadSearch::BTSeedCollection

Reimplemented from TrackerSeedGenerator.

Definition at line 45 of file TSGForRoadSearch.h.

typedef std::pair<const Trajectory*, reco::TrackRef> TSGForRoadSearch::TrackCand

Reimplemented from TrackerSeedGenerator.

Definition at line 46 of file TSGForRoadSearch.h.


Constructor & Destructor Documentation

TSGForRoadSearch::TSGForRoadSearch ( const edm::ParameterSet pset  ) 

Definition at line 27 of file TSGForRoadSearch.cc.

References Chi2MeasurementEstimatorESProducer_cfi::Chi2MeasurementEstimator, edm::ParameterSet::empty(), edm::ParameterSet::getParameter(), funct::sqrt(), theAdjustAtIp, theCategory, theChi2Estimator, theCopyMuonRecHit, theErrorMatrixAdjuster, theManySeeds, theOption, thePropagatorCompatibleName, thePropagatorName, and theUpdator.

00027                                                              {
00028 
00029   theOption = par.getParameter<uint>("option");
00030   theCopyMuonRecHit = par.getParameter<bool>("copyMuonRecHit");
00031 
00032   double Chi2 = par.getParameter<double>("maxChi2");
00033   if (Chi2>0){ theChi2Estimator = new Chi2MeasurementEstimator(Chi2,sqrt(Chi2));}
00034   else { theChi2Estimator=0;}
00035   
00036   thePropagatorName = par.getParameter<std::string>("propagatorName");
00037   thePropagatorCompatibleName = par.getParameter<std::string>("propagatorCompatibleName");
00038 
00039   theCategory = "TSGForRoadSearch|TrackerSeedGenerator";
00040   //  theLayerShift = par.getParameter<uint>("layerShift");
00041 
00042   theManySeeds = par.getParameter<bool>("manySeeds");
00043   if (theManySeeds){ theUpdator = new KFUpdator();}
00044   else{  theUpdator=0;}
00045 
00046   edm::ParameterSet errorMatrixPset = par.getParameter<edm::ParameterSet>("errorMatrixPset");
00047   if (!errorMatrixPset.empty()){
00048     theAdjustAtIp = errorMatrixPset.getParameter<bool>("atIP");
00049     //    theScale = !errorMatrixPset.getParameter<bool>("assignError");
00050     theErrorMatrixAdjuster = new MuonErrorMatrix(errorMatrixPset);}
00051   else {
00052     theAdjustAtIp =false;
00053     theErrorMatrixAdjuster=0;}
00054 }

TSGForRoadSearch::~TSGForRoadSearch (  )  [virtual]

Definition at line 55 of file TSGForRoadSearch.cc.

References theChi2Estimator, and theUpdator.

00055                                    {
00056   delete theChi2Estimator;
00057   if (theUpdator)  delete theUpdator;
00058   //  if (theErrorMatrixAdjuster) delete theErrorMatrixAdjuster;
00059 }


Member Function Documentation

void TSGForRoadSearch::adjust ( TrajectoryStateOnSurface state  )  [private]

adjust the error matrix of the TSOS

Definition at line 103 of file TSGForRoadSearch.cc.

References TrajectoryStateOnSurface::curvilinearError(), MuonErrorMatrix::get(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalParameters(), MuonErrorMatrix::multiply(), TrajectoryStateOnSurface::surface(), TrajectoryStateOnSurface::surfaceSide(), theErrorMatrixAdjuster, and TrajectoryStateOnSurface::weight().

00103                                                              {
00104   CurvilinearTrajectoryError oMat = state.curvilinearError();
00105   CurvilinearTrajectoryError sfMat = theErrorMatrixAdjuster->get(state.globalMomentum());//FIXME with position
00106 
00107   //  if (theScale){
00108   MuonErrorMatrix::multiply(oMat, sfMat);
00109   //  }
00110   //  else{
00111   //    oMat=sfMat;
00112   //  }
00113   state = TrajectoryStateOnSurface(state.globalParameters(),
00114                                    oMat,
00115                                    state.surface(),
00116                                    state.surfaceSide(),
00117                                    state.weight());
00118 }

void TSGForRoadSearch::adjust ( FreeTrajectoryState state  )  [private]

adjust the error matrix of the FTS

Definition at line 89 of file TSGForRoadSearch.cc.

References FreeTrajectoryState::curvilinearError(), MuonErrorMatrix::get(), FreeTrajectoryState::momentum(), MuonErrorMatrix::multiply(), FreeTrajectoryState::parameters(), and theErrorMatrixAdjuster.

Referenced by IPfts(), makeSeeds_0(), makeSeeds_3(), and makeSeeds_4().

00089                                                         {
00090   CurvilinearTrajectoryError oMat = state.curvilinearError();
00091   CurvilinearTrajectoryError sfMat = theErrorMatrixAdjuster->get(state.momentum());//FIXME with position
00092 
00093   //  if (theScale){
00094   MuonErrorMatrix::multiply(oMat, sfMat);
00095   //  }
00096   //  else{
00097   //    oMat=sfMat;
00098   //  }
00099   state = FreeTrajectoryState(state.parameters(),
00100                               oMat);
00101 }

void TSGForRoadSearch::init ( const MuonServiceProxy *  service  )  [virtual]

initialize the service

Reimplemented from TrackerSeedGenerator.

Definition at line 62 of file TSGForRoadSearch.cc.

References theProxyService.

00062                                                           {
00063   theProxyService = service;
00064 }

bool TSGForRoadSearch::IPfts ( const reco::Track muon,
FreeTrajectoryState fts 
) [private]

get the FTS for a Track: adjusting the error matrix if requested

Definition at line 120 of file TSGForRoadSearch.cc.

References adjust(), TrajectoryStateTransform::initialFreeState(), LogDebug, PV3DBase< T, PVType, FrameType >::mag(), FreeTrajectoryState::momentum(), FreeTrajectoryState::position(), theAdjustAtIp, theCategory, theErrorMatrixAdjuster, and theProxyService.

Referenced by makeSeeds_0(), makeSeeds_3(), and makeSeeds_4().

00120                                                                              {
00121   TrajectoryStateTransform transform; 
00122   fts = transform.initialFreeState(muon,&*theProxyService->magneticField());
00123   LogDebug(theCategory)<<fts;
00124   if (fts.position().mag()==0 && fts.momentum().mag()==0){ edm::LogError(theCategory)<<"initial state of muon is (0,0,0)(0,0,0). no seed."; 
00125     return false;}
00126 
00127   //rescale the error at IP
00128   if (theErrorMatrixAdjuster && theAdjustAtIp){ adjust(fts); }
00129 
00130   return true;
00131 }

void TSGForRoadSearch::makeSeeds_0 ( const reco::Track muon,
std::vector< TrajectorySeed > &  result 
) [private]

oseed from inside-out: innermost Strip layer

Definition at line 136 of file TSGForRoadSearch.cc.

References adjust(), alongMomentum, GeometricSearchDet::compatibleDets(), TrajectoryStateOnSurface::globalPosition(), SurfaceOrientation::inner, IPfts(), TrajectoryStateOnSurface::isValid(), LogDebug, NULL, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, pushTrajectorySeed(), DetLayer::subDetector(), StripSubdetector::TEC, theAdjustAtIp, theCategory, theChi2Estimator, theErrorMatrixAdjuster, theMeasurementTracker, thePropagatorCompatibleName, thePropagatorName, theProxyService, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, PV3DBase< T, PVType, FrameType >::z(), and z.

Referenced by makeSeeds_4(), and trackerSeeds().

00136                                                                                            {
00137   //get the state at IP
00138   FreeTrajectoryState cIPFTS;
00139   if (!IPfts(muon, cIPFTS)) return;
00140 
00141   //take state at inner surface and check the first part reached
00142   std::vector<BarrelDetLayer*> blc = theMeasurementTracker->geometricSearchTracker()->tibLayers();
00143   TrajectoryStateOnSurface inner = theProxyService->propagator(thePropagatorName)->propagate(cIPFTS,blc.front()->surface());
00144   if ( !inner.isValid() ) {LogDebug(theCategory) <<"inner state is not valid. no seed."; return;}
00145 
00146   //rescale the error
00147   if (theErrorMatrixAdjuster && !theAdjustAtIp){ adjust(inner); }
00148 
00149   double z = inner.globalPosition().z();
00150 
00151   std::vector<ForwardDetLayer*> ptidc = theMeasurementTracker->geometricSearchTracker()->posTidLayers();
00152   std::vector<ForwardDetLayer*> ptecc = theMeasurementTracker->geometricSearchTracker()->posTecLayers();
00153   std::vector<ForwardDetLayer*> ntidc = theMeasurementTracker->geometricSearchTracker()->negTidLayers();
00154   std::vector<ForwardDetLayer*> ntecc = theMeasurementTracker->geometricSearchTracker()->negTecLayers();
00155 
00156   const DetLayer *inLayer = NULL;
00157   if( fabs(z) < ptidc.front()->surface().position().z()  ) {
00158     inLayer = blc.front();
00159   } else if ( fabs(z) < ptecc.front()->surface().position().z() ) {
00160     inLayer = ( z < 0 ) ? ntidc.front() : ptidc.front() ;
00161   } else {
00162     inLayer = ( z < 0 ) ? ntecc.front() : ptecc.front() ;
00163   }
00164 
00165   //find out at least one compatible detector reached
00166   std::vector< DetLayer::DetWithState > compatible = inLayer->compatibleDets(inner,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator);
00167 
00168   //loop the parts until at least a compatible is found
00169   while (compatible.size()==0) {
00170     switch ( inLayer->subDetector() ) {
00171     case PixelSubdetector::PixelBarrel:
00172     case PixelSubdetector::PixelEndcap:
00173     case StripSubdetector::TOB:
00174     case StripSubdetector::TEC:
00175       LogDebug(theCategory)<<"from inside-out, trying TEC or TOB layers. no seed.";
00176       return;
00177       break;
00178     case StripSubdetector::TIB:
00179       inLayer = ( z < 0 ) ? ntidc.front() : ptidc.front() ;
00180       break;
00181     case StripSubdetector::TID:
00182       inLayer = ( z < 0 ) ? ntecc.front() : ptecc.front() ;
00183       break;
00184     default:
00185       LogDebug(theCategory)<<"subdetectorid is not a tracker sub-dectector id. skipping.";
00186       return;
00187     }
00188     compatible = inLayer->compatibleDets(inner,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator);
00189   }
00190 
00191   pushTrajectorySeed(muon,compatible,alongMomentum,result);
00192 
00193   return;
00194 }

void TSGForRoadSearch::makeSeeds_1 ( const reco::Track muon,
std::vector< TrajectorySeed > &  result 
) [private]

not implemented

Definition at line 196 of file TSGForRoadSearch.cc.

References theCategory.

Referenced by trackerSeeds().

00196                                                                                            {
00197   edm::LogError(theCategory)<<"option 1 of TSGForRoadSearch is not implemented yet. Please use 0,3 or 4. no seed.";
00198   return;
00199 }

void TSGForRoadSearch::makeSeeds_2 ( const reco::Track muon,
std::vector< TrajectorySeed > &  result 
) [private]

not implemented

Definition at line 201 of file TSGForRoadSearch.cc.

References theCategory.

Referenced by trackerSeeds().

00201                                                                                            {
00202   edm::LogError(theCategory)<<"option 2 of TSGForRoadSearch is not implemented yet. Please use 0,3 or 4. no seed.";
00203   return;
00204 }

void TSGForRoadSearch::makeSeeds_3 ( const reco::Track muon,
std::vector< TrajectorySeed > &  result 
) [private]

outside-in: outermost Strip layer

Definition at line 209 of file TSGForRoadSearch.cc.

References adjust(), GeometricSearchDet::compatibleDets(), IPfts(), LogDebug, NULL, oppositeToMomentum, SurfaceOrientation::outer, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, pushTrajectorySeed(), DetLayer::subDetector(), StripSubdetector::TEC, theAdjustAtIp, theCategory, theChi2Estimator, theErrorMatrixAdjuster, theMeasurementTracker, thePropagatorCompatibleName, thePropagatorName, theProxyService, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, and z.

Referenced by trackerSeeds().

00209                                                                                            {
00210   //get the state at IP
00211   FreeTrajectoryState cIPFTS;
00212   if (!IPfts(muon, cIPFTS)) return;
00213 
00214   //take state at outer surface and check the first part reached
00215   std::vector<BarrelDetLayer*> blc = theMeasurementTracker->geometricSearchTracker()->tobLayers();
00216 
00217   //  TrajectoryStateOnSurface outer = theProxyService->propagator(thePropagatorName)->propagate(cIPFTS,blc.back()->surface());
00218   StateOnTrackerBound onBounds(theProxyService->propagator(thePropagatorName).product());
00219   TrajectoryStateOnSurface outer = onBounds(cIPFTS);
00220 
00221   if ( !outer.isValid() ) {LogDebug(theCategory) <<"outer state is not valid. no seed."; return;}
00222   
00223   //rescale the error
00224   if (theErrorMatrixAdjuster && !theAdjustAtIp){ adjust(outer); }
00225 
00226   double z = outer.globalPosition().z();
00227 
00228   std::vector<ForwardDetLayer*> ptidc = theMeasurementTracker->geometricSearchTracker()->posTidLayers();
00229   std::vector<ForwardDetLayer*> ptecc = theMeasurementTracker->geometricSearchTracker()->posTecLayers();
00230   std::vector<ForwardDetLayer*> ntidc = theMeasurementTracker->geometricSearchTracker()->negTidLayers();
00231   std::vector<ForwardDetLayer*> ntecc = theMeasurementTracker->geometricSearchTracker()->negTecLayers();
00232 
00233   uint layerShift=0;
00234   const DetLayer *inLayer = NULL;
00235   if (fabs(z) < ptecc.front()->surface().position().z()  ){
00236     inLayer = *(blc.rbegin()+layerShift);
00237   } else {
00238     //whoa ! +1 should not be allowed !
00239     uint tecIt=1;
00240     for (; tecIt!=ptecc.size();tecIt++){
00241       if (fabs(z) < ptecc[tecIt]->surface().position().z())
00242         {inLayer = ( z < 0 ) ? ntecc[tecIt-1] : ptecc[tecIt-1] ; break;}}
00243     if (!inLayer) {inLayer = ( z < 0 ) ? ntecc.back() : ptecc.back();}
00244   }
00245 
00246   //find out at least one compatible detector reached
00247   std::vector< DetLayer::DetWithState > compatible = inLayer->compatibleDets(outer,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator);
00248 
00249   //loop the parts until at least a compatible is found
00250   while (compatible.size()==0) {
00251     switch ( inLayer->subDetector() ) {
00252     case PixelSubdetector::PixelBarrel:
00253     case PixelSubdetector::PixelEndcap:
00254     case StripSubdetector::TIB:
00255     case StripSubdetector::TID:
00256     case StripSubdetector::TOB:
00257       layerShift++;
00258       if (layerShift>=blc.size()){
00259         LogDebug(theCategory) <<"all barrel layers are exhausted to find starting state. no seed,";
00260         return;}
00261       inLayer = *(blc.rbegin()+layerShift);
00262       break;
00263     case StripSubdetector::TEC:
00264       inLayer = *(blc.rbegin()+layerShift);
00265       break;
00266     default:
00267       edm::LogError(theCategory)<<"subdetectorid is not a tracker sub-dectector id. skipping.";
00268       return;
00269     }
00270     compatible = inLayer->compatibleDets(outer,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator);
00271   }
00272 
00273   pushTrajectorySeed(muon,compatible,oppositeToMomentum,result);
00274 
00275   return;
00276 }

void TSGForRoadSearch::makeSeeds_4 ( const reco::Track muon,
std::vector< TrajectorySeed > &  result 
) [private]

inside-out: innermost Pixel/Strip layer

Definition at line 282 of file TSGForRoadSearch.cc.

References adjust(), alongMomentum, prof2calltree::back, GeometricSearchDet::compatibleDets(), prof2calltree::front, TrajectoryStateOnSurface::globalPosition(), SurfaceOrientation::inner, IPfts(), TrajectoryStateOnSurface::isValid(), LogDebug, makeSeeds_0(), NULL, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, pushTrajectorySeed(), StripSubdetector::TEC, theAdjustAtIp, theCategory, theChi2Estimator, theErrorMatrixAdjuster, theMeasurementTracker, thePropagatorCompatibleName, thePropagatorName, theProxyService, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, PV3DBase< T, PVType, FrameType >::z(), and z.

Referenced by trackerSeeds().

00282                                                                                            {
00283   //get the state at IP
00284   FreeTrajectoryState cIPFTS;
00285   if (!IPfts(muon, cIPFTS)) return;
00286 
00287   //take state at inner surface and check the first part reached
00288   std::vector<BarrelDetLayer*> blc = theMeasurementTracker->geometricSearchTracker()->pixelBarrelLayers();
00289   if (blc.empty()){edm::LogError(theCategory)<<"want to start from pixel layer, but no barrel exists. trying without pixel."; 
00290     makeSeeds_0(muon, result);
00291     return;}
00292 
00293   TrajectoryStateOnSurface inner = theProxyService->propagator(thePropagatorName)->propagate(cIPFTS,blc.front()->surface());
00294   if ( !inner.isValid() ) {LogDebug(theCategory) <<"inner state is not valid. no seed."; return;}
00295 
00296   //rescale the error
00297   if (theErrorMatrixAdjuster && !theAdjustAtIp){ adjust(inner); }
00298     
00299   double z = inner.globalPosition().z();
00300 
00301   std::vector<ForwardDetLayer*> ppxlc = theMeasurementTracker->geometricSearchTracker()->posPixelForwardLayers();
00302   std::vector<ForwardDetLayer*> npxlc = theMeasurementTracker->geometricSearchTracker()->negPixelForwardLayers();
00303   std::vector<ForwardDetLayer*> ptidc = theMeasurementTracker->geometricSearchTracker()->posTidLayers();
00304   std::vector<ForwardDetLayer*> ptecc = theMeasurementTracker->geometricSearchTracker()->posTecLayers();
00305   std::vector<ForwardDetLayer*> ntidc = theMeasurementTracker->geometricSearchTracker()->negTidLayers();
00306   std::vector<ForwardDetLayer*> ntecc = theMeasurementTracker->geometricSearchTracker()->negTecLayers();
00307 
00308   if ((ppxlc.empty() || npxlc.empty()) && (ptidc.empty() || ptecc.empty()) )
00309     { edm::LogError(theCategory)<<"want to start from pixel layer, but no forward layer exists. trying without pixel.";
00310       makeSeeds_0(muon, result);
00311       return;}
00312 
00313   const DetLayer *inLayer = NULL;
00314   std::vector<ForwardDetLayer*>::iterator layerIt ;
00315 
00316   double fz=fabs(z);
00317   
00318   //simple way of finding a first layer to try out
00319   if (fz < fabs(((z>0)?ppxlc:npxlc).front()->surface().position().z())){
00320     inLayer = blc.front();}
00321   else if (fz < fabs(((z>0)?ppxlc:npxlc).back()->surface().position().z())){
00322     layerIt = ((z>0)?ppxlc:npxlc).begin();
00323     inLayer= *layerIt;}
00324   else if (fz < fabs(((z>0)?ptidc:ntidc).front()->surface().position().z())){
00325     layerIt = ((z>0)?ppxlc:npxlc).end()-1;
00326     inLayer= *layerIt;}
00327   else if (fz < fabs(((z>0)?ptecc:ntecc).front()->surface().position().z())){
00328     layerIt = ((z>0)?ptidc:ntidc).begin();
00329     inLayer= *layerIt;}
00330   else if (fz < fabs(((z>0)?ptecc:ntecc).back()->surface().position().z())){
00331     layerIt = ((z>0)?ptecc:ntecc).begin();
00332     inLayer= *layerIt;}
00333   else {
00334     edm::LogWarning(theCategory)<<"the state is not consistent with any tracker layer:\n"
00335                              <<inner;
00336     return;}
00337   
00338   //find out at least one compatible detector reached
00339   std::vector< DetLayer::DetWithState > compatible = inLayer->compatibleDets(inner,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator);
00340   
00341   //if none were found. you should do something more.
00342   if (compatible.size()==0){
00343     std::vector<ForwardDetLayer*>::iterator pxlEnd = (z>0)? ppxlc.end() : npxlc.end();
00344     std::vector<ForwardDetLayer*>::iterator tidEnd = (z>0)? ptidc.end() : ntidc.end();
00345     std::vector<ForwardDetLayer*>::iterator tecEnd = (z>0)? ptecc.end() : ntecc.end();
00346     std::vector<ForwardDetLayer*>::iterator pxlBegin = (z>0)? ppxlc.begin() : npxlc.begin();
00347     std::vector<ForwardDetLayer*>::iterator tidBegin = (z>0)? ptidc.begin() : ntidc.begin();
00348     std::vector<ForwardDetLayer*>::iterator tecBegin = (z>0)? ptecc.begin() : ntecc.begin();
00349 
00350     //go to first disk if not already in a disk situation
00351     if (!dynamic_cast<const ForwardDetLayer*>(inLayer)) layerIt =pxlBegin--;
00352     
00353     while (compatible.size()==0) {
00354       switch ( (*layerIt)->subDetector() ) {
00355       case PixelSubdetector::PixelEndcap:
00356         {
00357           layerIt++;
00358           //if end of list reached. go to the first TID
00359           if (layerIt==pxlEnd) layerIt=tidBegin;
00360           break;
00361         }
00362       case StripSubdetector::TID:
00363         {
00364           layerIt++;
00365           //if end of list reached. go to the first TEC
00366           if (layerIt==tidEnd) layerIt = tecBegin;
00367           break;
00368         }
00369       case StripSubdetector::TEC:
00370         {
00371           layerIt++;
00372           if (layerIt==tecEnd){
00373             edm::LogWarning(theCategory)<<"ran out of layers to find a seed: no seed.";
00374             return;}
00375         }
00376       case PixelSubdetector::PixelBarrel: { edm::LogError(theCategory)<<"this should not happen... ever. Please report. PixelSubdetector::PixelBarrel. no seed."; return;}
00377       case StripSubdetector::TIB: { edm::LogError(theCategory)<<"this should not happen... ever. Please report. StripSubdetector::TIB. no seed."; return;}
00378       case StripSubdetector::TOB: { edm::LogError(theCategory)<<"this should not happen... ever. Please report. StripSubdetector::TOB. no seed."; return;}
00379       default:  { edm::LogError(theCategory)<<"Subdetector id is not a tracker sub-detector id. no seed."; return;}
00380       }//switch
00381 
00382       compatible = (*layerIt)->compatibleDets(inner,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator);
00383     }//while
00384   }//if size==0
00385 
00386   pushTrajectorySeed(muon,compatible,alongMomentum,result);
00387 
00388   return;
00389 }

void TSGForRoadSearch::pushTrajectorySeed ( const reco::Track muon,
std::vector< DetLayer::DetWithState > &  compatible,
PropagationDirection  direction,
std::vector< TrajectorySeed > &  result 
) const [private]

add the seed(s) to the collection of seeds

Definition at line 395 of file TSGForRoadSearch.cc.

References edm::OwnVector< T, P >::clear(), MeasurementDet::fastMeasurements(), GeomDet::geographicalId(), LogDebug, TrajectoryStateTransform::persistentState(), edm::OwnVector< T, P >::push_back(), DetId::rawId(), reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), reco::Track::recHitsSize(), theCategory, theChi2Estimator, theCopyMuonRecHit, theManySeeds, theMeasurementTracker, thePropagatorCompatibleName, theProxyService, theUpdator, tmp, and TrajectoryStateUpdator::update().

Referenced by makeSeeds_0(), makeSeeds_3(), and makeSeeds_4().

00395                                                                                                                                                                                        {
00396 
00397   if (compatible.empty()){
00398     LogDebug(theCategory)<<"pushTrajectorySeed with no compatible module. 0 seed.";
00399     return;}
00400 
00401   if (theManySeeds){
00402     TrajectoryStateTransform tsTransform;    
00403 
00404     //finf out every compatible measurements
00405     for (std::vector<DetLayer::DetWithState >::iterator DWSit = compatible.begin(); DWSit!=compatible.end();++DWSit){
00406       bool aBareTS=false;
00407       const GeomDet * gd = DWSit->first;
00408       if (!gd){edm::LogError(theCategory)<<"GeomDet is not valid."; continue;}
00409       const MeasurementDet * md= theMeasurementTracker->idToDet(gd->geographicalId());
00410       std::vector<TrajectoryMeasurement> tmp = md->fastMeasurements(DWSit->second,DWSit->second,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator);
00411       //make a trajectory seed for each of them
00412 
00413       for (std::vector<TrajectoryMeasurement>::iterator Mit = tmp.begin(); Mit!=tmp.end();++Mit){
00414         TrajectoryStateOnSurface predState(Mit->predictedState());
00415         TrajectoryMeasurement::ConstRecHitPointer hit = Mit->recHit();
00416         TrajectorySeed::recHitContainer rhContainer;
00417         if (theCopyMuonRecHit){
00418           LogDebug(theCategory)<<"copying ("<<muon.recHitsSize()<<") muon recHits";
00419           //copy the muon rechit into the seed
00420           for (trackingRecHit_iterator trit = muon.recHitsBegin(); trit!=muon.recHitsEnd();trit++) {
00421             rhContainer.push_back( (*trit).get()->clone() );  }}
00422         
00423         if ( hit->isValid()) {
00424           TrajectoryStateOnSurface upState(theUpdator->update(predState,*hit));
00425           
00426           PTrajectoryStateOnDet & PTSOD = *tsTransform.persistentState(upState,gd->geographicalId().rawId());
00427           LogDebug(theCategory)<<"state used to build a trajectory seed: \n"<<upState
00428                              <<"on detector: "<<gd->geographicalId().rawId();
00429           //add the tracking rechit
00430           if (theCopyMuonRecHit){
00431             edm::LogError(theCategory)<<"not a bare seed and muon hits are copied. dumping the muon hits.";
00432             rhContainer.clear();}
00433           rhContainer.push_back(hit->hit()->clone());
00434 
00435           result.push_back(TrajectorySeed(PTSOD,rhContainer,direction));          
00436         }
00437         else {
00438           //rec hit is not valid. put a bare TrajectorySeed, only once !
00439           if (!aBareTS){
00440             aBareTS=true;
00441             
00442             PTrajectoryStateOnDet & PTSOD = *tsTransform.persistentState(predState,gd->geographicalId().rawId());
00443             LogDebug(theCategory)<<"state used to build a bare trajectory seed: \n"<<predState
00444                                <<"on detector: "<<gd->geographicalId().rawId();
00445     
00446             result.push_back(TrajectorySeed(PTSOD,rhContainer,direction));
00447           }
00448         }
00449 
00450       }
00451 
00452 
00453     }
00454   }
00455   else{
00456     //transform it into a PTrajectoryStateOnDet
00457     TrajectoryStateTransform tsTransform;
00458     PTrajectoryStateOnDet & PTSOD = *tsTransform.persistentState(compatible.front().second,compatible.front().first->geographicalId().rawId());
00459     LogDebug(theCategory)<<"state used to build a bare trajectory seed: \n"<<compatible.front().second
00460                        <<"on detector: "<<compatible.front().first->geographicalId().rawId();
00461     
00462     TrajectorySeed::recHitContainer rhContainer;
00463     if (theCopyMuonRecHit){
00464       LogDebug(theCategory)<<"copying ("<<muon.recHitsSize()<<") muon recHits";
00465       //copy the muon rechit into the seed
00466       for (trackingRecHit_iterator trit = muon.recHitsBegin(); trit!=muon.recHitsEnd();trit++) {
00467         rhContainer.push_back( (*trit).get()->clone() );  }}
00468     
00469     //add this seed to the list and return it
00470     result.push_back(TrajectorySeed(PTSOD,rhContainer,direction));
00471   }
00472     return;
00473 }

void TSGForRoadSearch::setEvent ( const edm::Event event  )  [virtual]

set the event: update the MeasurementTracker

Reimplemented from TrackerSeedGenerator.

Definition at line 66 of file TSGForRoadSearch.cc.

References edm::ESHandle< T >::isValid(), theCategory, theMeasurementTracker, and theProxyService.

00066                                                     {
00067   //get the measurementtracker
00068   theProxyService->eventSetup().get<CkfComponentsRecord>().get(theMeasurementTracker);
00069   if (!theMeasurementTracker.isValid())/*abort*/{edm::LogError(theCategory)<<"measurement tracker geometry not found ";}
00070 }

void TSGForRoadSearch::trackerSeeds ( const TrackCand muonTrackCand,
const TrackingRegion region,
BTSeedCollection result 
) [virtual]

generated seed(s) for a track. the tracking region is not used.

Reimplemented from TrackerSeedGenerator.

Definition at line 74 of file TSGForRoadSearch.cc.

References makeSeeds_0(), makeSeeds_1(), makeSeeds_2(), makeSeeds_3(), makeSeeds_4(), and theOption.

00074                                                                                                                                      {
00075   switch (theOption){
00076   case 0:
00077     makeSeeds_0(*muonTrackCand.second,result);break;
00078   case 1:
00079     makeSeeds_1(*muonTrackCand.second,result);break;
00080   case 2:
00081     makeSeeds_2(*muonTrackCand.second,result);break;
00082   case 3:
00083     makeSeeds_3(*muonTrackCand.second,result);break;
00084   case 4:
00085     makeSeeds_4(*muonTrackCand.second,result);break;
00086   }  
00087 }


Member Data Documentation

bool TSGForRoadSearch::theAdjustAtIp [private]

Definition at line 81 of file TSGForRoadSearch.h.

Referenced by IPfts(), makeSeeds_0(), makeSeeds_3(), makeSeeds_4(), and TSGForRoadSearch().

std::string TSGForRoadSearch::theCategory [private]

Definition at line 100 of file TSGForRoadSearch.h.

Referenced by IPfts(), makeSeeds_0(), makeSeeds_1(), makeSeeds_2(), makeSeeds_3(), makeSeeds_4(), pushTrajectorySeed(), setEvent(), and TSGForRoadSearch().

Chi2MeasurementEstimator* TSGForRoadSearch::theChi2Estimator [private]

Definition at line 99 of file TSGForRoadSearch.h.

Referenced by makeSeeds_0(), makeSeeds_3(), makeSeeds_4(), pushTrajectorySeed(), TSGForRoadSearch(), and ~TSGForRoadSearch().

edm::ParameterSet TSGForRoadSearch::theConfig [private]

Definition at line 86 of file TSGForRoadSearch.h.

bool TSGForRoadSearch::theCopyMuonRecHit [private]

Definition at line 93 of file TSGForRoadSearch.h.

Referenced by pushTrajectorySeed(), and TSGForRoadSearch().

MuonErrorMatrix* TSGForRoadSearch::theErrorMatrixAdjuster [private]

Definition at line 102 of file TSGForRoadSearch.h.

Referenced by adjust(), IPfts(), makeSeeds_0(), makeSeeds_3(), makeSeeds_4(), and TSGForRoadSearch().

bool TSGForRoadSearch::theManySeeds [private]

Definition at line 94 of file TSGForRoadSearch.h.

Referenced by pushTrajectorySeed(), and TSGForRoadSearch().

edm::ESHandle<MeasurementTracker> TSGForRoadSearch::theMeasurementTracker [private]

Definition at line 88 of file TSGForRoadSearch.h.

Referenced by makeSeeds_0(), makeSeeds_3(), makeSeeds_4(), pushTrajectorySeed(), and setEvent().

uint TSGForRoadSearch::theOption [private]

Definition at line 92 of file TSGForRoadSearch.h.

Referenced by trackerSeeds(), and TSGForRoadSearch().

edm::ESHandle<Propagator> TSGForRoadSearch::theProp [private]

Definition at line 96 of file TSGForRoadSearch.h.

std::string TSGForRoadSearch::thePropagatorCompatibleName [private]

Definition at line 97 of file TSGForRoadSearch.h.

Referenced by makeSeeds_0(), makeSeeds_3(), makeSeeds_4(), pushTrajectorySeed(), and TSGForRoadSearch().

std::string TSGForRoadSearch::thePropagatorName [private]

Definition at line 95 of file TSGForRoadSearch.h.

Referenced by makeSeeds_0(), makeSeeds_3(), makeSeeds_4(), and TSGForRoadSearch().

edm::ESHandle<Propagator> TSGForRoadSearch::thePropCompatible [private]

Definition at line 98 of file TSGForRoadSearch.h.

const MuonServiceProxy* TSGForRoadSearch::theProxyService [private]

Reimplemented from TrackerSeedGenerator.

Definition at line 90 of file TSGForRoadSearch.h.

Referenced by init(), IPfts(), makeSeeds_0(), makeSeeds_3(), makeSeeds_4(), pushTrajectorySeed(), and setEvent().

bool TSGForRoadSearch::theScale [private]

Definition at line 82 of file TSGForRoadSearch.h.

TrajectoryStateUpdator* TSGForRoadSearch::theUpdator [private]

Definition at line 89 of file TSGForRoadSearch.h.

Referenced by pushTrajectorySeed(), TSGForRoadSearch(), and ~TSGForRoadSearch().


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