CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

TSGForRoadSearch Class Reference

#include <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

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
bool notAtIPtsos (TrajectoryStateOnSurface &state)
 make the adjustement away from PCA state if requested
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
 adjust the state at IP or where it is defined for the seed
std::string theCategory
Chi2MeasurementEstimatortheChi2Estimator
edm::ParameterSet theConfig
bool theCopyMuonRecHit
MuonErrorMatrixtheErrorMatrixAdjuster
edm::ESHandle
< GeometricSearchTracker
theGeometricSearchTracker
bool theManySeeds
edm::ESHandle< MeasurementTrackertheMeasurementTracker
unsigned int theOption
edm::ESHandle< PropagatortheProp
std::string thePropagatorCompatibleName
std::string thePropagatorName
edm::ESHandle< PropagatorthePropCompatible
const MuonServiceProxytheProxyService
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

Reimplemented from TrackerSeedGenerator.

Definition at line 45 of file TSGForRoadSearch.h.

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(), mathSSE::sqrt(), theAdjustAtIp, theCategory, theChi2Estimator, theCopyMuonRecHit, theErrorMatrixAdjuster, theManySeeds, theOption, thePropagatorCompatibleName, thePropagatorName, and theUpdator.

                                                             {

  theOption = par.getParameter<unsigned int>("option");
  theCopyMuonRecHit = par.getParameter<bool>("copyMuonRecHit");

  double Chi2 = par.getParameter<double>("maxChi2");
  theChi2Estimator = new Chi2MeasurementEstimator(Chi2,sqrt(Chi2));
  
  thePropagatorName = par.getParameter<std::string>("propagatorName");
  thePropagatorCompatibleName = par.getParameter<std::string>("propagatorCompatibleName");

  theCategory = "TSGForRoadSearch|TrackerSeedGenerator";

  theManySeeds = par.getParameter<bool>("manySeeds");
  if (theManySeeds){ theUpdator = new KFUpdator();}
  else{  theUpdator=0;}

  edm::ParameterSet errorMatrixPset = par.getParameter<edm::ParameterSet>("errorMatrixPset");
  if (!errorMatrixPset.empty()){
    theAdjustAtIp = errorMatrixPset.getParameter<bool>("atIP");
    theErrorMatrixAdjuster = new MuonErrorMatrix(errorMatrixPset);}
  else {
    theAdjustAtIp =false;
    theErrorMatrixAdjuster=0;}
}
TSGForRoadSearch::~TSGForRoadSearch ( ) [virtual]

Member Function Documentation

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

initialize the service

Reimplemented from TrackerSeedGenerator.

Definition at line 59 of file TSGForRoadSearch.cc.

References theProxyService.

                                                          {
  theProxyService = service;
}
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 98 of file TSGForRoadSearch.cc.

References MuonErrorMatrix::adjust(), trajectoryStateTransform::initialFreeState(), LogDebug, MuonServiceProxy::magneticField(), theAdjustAtIp, theCategory, theErrorMatrixAdjuster, and theProxyService.

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

                                                                             {
  
  fts = trajectoryStateTransform::initialFreeState(muon,&*theProxyService->magneticField());
  LogDebug(theCategory)<<"pure L2 state: "<<fts;
  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."; 
    return false;}

  //rescale the error at IP
  if (theErrorMatrixAdjuster && theAdjustAtIp){ theErrorMatrixAdjuster->adjust(fts);
    LogDebug(theCategory)<<"after adjusting the error matrix: "<<fts;}

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

oseed from inside-out: innermost Strip layer

Definition at line 115 of file TSGForRoadSearch.cc.

References alongMomentum, GeometricSearchDet::compatibleDetsV(), TrajectoryStateOnSurface::globalPosition(), SurfaceOrientation::inner, IPfts(), TrajectoryStateOnSurface::isValid(), LogDebug, notAtIPtsos(), GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, MuonServiceProxy::propagator(), pushTrajectorySeed(), DetLayer::subDetector(), GeomDetEnumerators::TEC, theCategory, theChi2Estimator, theGeometricSearchTracker, thePropagatorCompatibleName, thePropagatorName, theProxyService, GeomDetEnumerators::TIB, GeomDetEnumerators::TID, GeomDetEnumerators::TOB, PV3DBase< T, PVType, FrameType >::z(), and z.

Referenced by makeSeeds_4(), and trackerSeeds().

                                                                                           {
  //get the state at IP
  FreeTrajectoryState cIPFTS;
  if (!IPfts(muon, cIPFTS)) return;

  //take state at inner surface and check the first part reached
  const std::vector<BarrelDetLayer*> & blc = theGeometricSearchTracker->tibLayers();
  TrajectoryStateOnSurface inner = theProxyService->propagator(thePropagatorName)->propagate(cIPFTS,blc.front()->surface());
  if ( !inner.isValid() ) {LogDebug(theCategory) <<"inner state is not valid. no seed."; return;}

  //rescale the error
  if (!notAtIPtsos(inner)) return;

  double z = inner.globalPosition().z();

  const std::vector<ForwardDetLayer*> &ptidc = theGeometricSearchTracker->posTidLayers();
  const std::vector<ForwardDetLayer*> &ptecc = theGeometricSearchTracker->posTecLayers();
  const std::vector<ForwardDetLayer*> &ntidc = theGeometricSearchTracker->negTidLayers();
  const std::vector<ForwardDetLayer*> &ntecc = theGeometricSearchTracker->negTecLayers();

  const DetLayer *inLayer = 0;
  if( fabs(z) < ptidc.front()->surface().position().z()  ) {
    inLayer = blc.front();
  } else if ( fabs(z) < ptecc.front()->surface().position().z() ) {
    inLayer = ( z < 0 ) ? ntidc.front() : ptidc.front() ;
  } else {
    inLayer = ( z < 0 ) ? ntecc.front() : ptecc.front() ;
  }

  //find out at least one compatible detector reached
  std::vector< DetLayer::DetWithState > compatible;
  compatible.reserve(10);
  inLayer->compatibleDetsV(inner,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator,compatible);

  //loop the parts until at least a compatible is found
  while (compatible.size()==0) {
    switch ( inLayer->subDetector() ) {
    case GeomDetEnumerators::PixelBarrel:
    case GeomDetEnumerators::PixelEndcap:
    case GeomDetEnumerators::TOB:
    case GeomDetEnumerators::TEC:
      LogDebug(theCategory)<<"from inside-out, trying TEC or TOB layers. no seed.";
      return;
      break;
    case GeomDetEnumerators::TIB:
      inLayer = ( z < 0 ) ? ntidc.front() : ptidc.front() ;
      break;
    case GeomDetEnumerators::TID:
      inLayer = ( z < 0 ) ? ntecc.front() : ptecc.front() ;
      break;
    default:
      LogDebug(theCategory)<<"subdetectorid is not a tracker sub-dectector id. skipping.";
      return;
    }
    inLayer->compatibleDetsV(inner,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator,compatible);
  }

  pushTrajectorySeed(muon,compatible,alongMomentum,result);

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

not implemented

Definition at line 177 of file TSGForRoadSearch.cc.

References theCategory.

Referenced by trackerSeeds().

                                                                                           {
  edm::LogError(theCategory)<<"option 1 of TSGForRoadSearch is not implemented yet. Please use 0,3 or 4. no seed.";
  return;
}
void TSGForRoadSearch::makeSeeds_2 ( const reco::Track muon,
std::vector< TrajectorySeed > &  result 
) [private]

not implemented

Definition at line 182 of file TSGForRoadSearch.cc.

References theCategory.

Referenced by trackerSeeds().

                                                                                           {
  edm::LogError(theCategory)<<"option 2 of TSGForRoadSearch is not implemented yet. Please use 0,3 or 4. no seed.";
  return;
}
void TSGForRoadSearch::makeSeeds_3 ( const reco::Track muon,
std::vector< TrajectorySeed > &  result 
) [private]

outside-in: outermost Strip layer

Definition at line 190 of file TSGForRoadSearch.cc.

References GeometricSearchDet::compatibleDetsV(), IPfts(), LogDebug, LogTrace, notAtIPtsos(), oppositeToMomentum, SurfaceOrientation::outer, GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, position, GloballyPositioned< T >::position(), edm::ESHandle< T >::product(), MuonServiceProxy::propagator(), pushTrajectorySeed(), DetLayer::subDetector(), GeometricSearchDet::surface(), GeomDetEnumerators::TEC, theCategory, theChi2Estimator, theGeometricSearchTracker, thePropagatorCompatibleName, thePropagatorName, theProxyService, GeomDetEnumerators::TIB, GeomDetEnumerators::TID, GeomDetEnumerators::TOB, and z.

Referenced by trackerSeeds().

                                                                                           {
  //get the state at IP
  FreeTrajectoryState cIPFTS;
  if (!IPfts(muon, cIPFTS)) return;

  //take state at outer surface and check the first part reached
  const std::vector<BarrelDetLayer*> &blc = theGeometricSearchTracker->tobLayers();

  //  TrajectoryStateOnSurface outer = theProxyService->propagator(thePropagatorName)->propagate(cIPFTS,blc.back()->surface());
  StateOnTrackerBound onBounds(theProxyService->propagator(thePropagatorName).product());
  TrajectoryStateOnSurface outer = onBounds(cIPFTS);

  if ( !outer.isValid() ) {LogDebug(theCategory) <<"outer state is not valid. no seed."; return;}
  
  //rescale the error
  if (!notAtIPtsos(outer)) return;

  double z = outer.globalPosition().z();

  const std::vector<ForwardDetLayer*> &ptecc = theGeometricSearchTracker->posTecLayers();
  const std::vector<ForwardDetLayer*> &ntecc = theGeometricSearchTracker->negTecLayers();

  LogDebug(theCategory)<<"starting looking for a compatible layer from: "<<outer<<"\nz: "<<z<<"TEC1 z: "<<ptecc.front()->surface().position().z();

  unsigned int layerShift=0;
  const DetLayer *inLayer = 0;
  if (fabs(z) < ptecc.front()->surface().position().z()  ){
    inLayer = *(blc.rbegin()+layerShift);
    LogTrace(theCategory)<<"choosing TOB layer with shift: "<<layerShift;
  } else {
    unsigned int tecIt=1;
    for (; tecIt!=ptecc.size();tecIt++){
      LogTrace(theCategory)<<"checking surface with shift: "<<tecIt
                           <<"z: "<<ptecc[tecIt]->surface().position().z();
      if (fabs(z) < ptecc[tecIt]->surface().position().z())
        {inLayer = ( z < 0 ) ? ntecc[tecIt-1] : ptecc[tecIt-1] ; 
          layerShift=tecIt-1;
          LogTrace(theCategory)<<"choosing TEC layer with shift: "<<layerShift
                               <<" and z: "<<inLayer->surface().position().z();
          break;}}
    if (!inLayer) {inLayer = ( z < 0 ) ? ntecc.back() : ptecc.back();
      LogTrace(theCategory)<<"choosing last TEC layer with z: "<<inLayer->surface().position().z();
    }
  }

  //find out at least one compatible detector reached
  std::vector< DetLayer::DetWithState > compatible;
  compatible.reserve(10);
  inLayer->compatibleDetsV(outer,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator,compatible);

  //loop the parts until at least a compatible is found
  while (compatible.size()==0) {
    switch ( inLayer->subDetector() ) {
    case GeomDetEnumerators::PixelBarrel:
    case GeomDetEnumerators::PixelEndcap:
    case GeomDetEnumerators::TIB:
    case GeomDetEnumerators::TID:
    case GeomDetEnumerators::TOB:
      layerShift++;
      if (layerShift>=blc.size()){
        LogDebug(theCategory) <<"all barrel layers are exhausted to find starting state. no seed,";
        return;}
      inLayer = *(blc.rbegin()+layerShift);
      break;
    case GeomDetEnumerators::TEC:
      if (layerShift==0){
        LogDebug(theCategory) <<"failed to get a compatible module on a TEC layer, using the last TOB layer.";
        inLayer = *(blc.rbegin()+layerShift);
      }
      else{
        layerShift--;
        LogDebug(theCategory) <<"reaching more in with layer "<<layerShift<<" in TEC";
        inLayer = ( z < 0 ) ? ntecc[layerShift] : ptecc[layerShift] ;
      }
      break;
    default:
      edm::LogError(theCategory)<<"subdetectorid is not a tracker sub-dectector id. skipping.";
      return;
    }
    inLayer->compatibleDetsV(outer,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator,compatible);
  }

  pushTrajectorySeed(muon,compatible,oppositeToMomentum,result);

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

inside-out: innermost Pixel/Strip layer

Definition at line 281 of file TSGForRoadSearch.cc.

References alongMomentum, prof2calltree::back, GeometricSearchDet::compatibleDetsV(), prof2calltree::front, TrajectoryStateOnSurface::globalPosition(), SurfaceOrientation::inner, IPfts(), TrajectoryStateOnSurface::isValid(), LogDebug, makeSeeds_0(), notAtIPtsos(), GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, position, MuonServiceProxy::propagator(), pushTrajectorySeed(), GeomDetEnumerators::TEC, theCategory, theChi2Estimator, theGeometricSearchTracker, thePropagatorCompatibleName, thePropagatorName, theProxyService, GeomDetEnumerators::TIB, GeomDetEnumerators::TID, GeomDetEnumerators::TOB, PV3DBase< T, PVType, FrameType >::z(), and z.

Referenced by trackerSeeds().

                                                                                           {
  //get the state at IP
  FreeTrajectoryState cIPFTS;
  if (!IPfts(muon, cIPFTS)) return;

  //take state at inner surface and check the first part reached
  const std::vector<BarrelDetLayer*> & blc = theGeometricSearchTracker->pixelBarrelLayers();
  if (blc.empty()){edm::LogError(theCategory)<<"want to start from pixel layer, but no barrel exists. trying without pixel."; 
    makeSeeds_0(muon, result);
    return;}

  TrajectoryStateOnSurface inner = theProxyService->propagator(thePropagatorName)->propagate(cIPFTS,blc.front()->surface());
  if ( !inner.isValid() ) {LogDebug(theCategory) <<"inner state is not valid. no seed."; return;}

  //rescale the error
  if (!notAtIPtsos(inner)) return;
    
  double z = inner.globalPosition().z();

  const std::vector<ForwardDetLayer*> &ppxlc = theGeometricSearchTracker->posPixelForwardLayers();
  const std::vector<ForwardDetLayer*> &npxlc = theGeometricSearchTracker->negPixelForwardLayers();
  const std::vector<ForwardDetLayer*> &ptidc = theGeometricSearchTracker->posTidLayers();
  const std::vector<ForwardDetLayer*> &ptecc = theGeometricSearchTracker->posTecLayers();
  const std::vector<ForwardDetLayer*> &ntidc = theGeometricSearchTracker->negTidLayers();
  const std::vector<ForwardDetLayer*> &ntecc = theGeometricSearchTracker->negTecLayers();

  if ((ppxlc.empty() || npxlc.empty()) && (ptidc.empty() || ptecc.empty()) )
    { edm::LogError(theCategory)<<"want to start from pixel layer, but no forward layer exists. trying without pixel.";
      makeSeeds_0(muon, result);
      return;}

  const DetLayer *inLayer = 0;
  std::vector<ForwardDetLayer*>::const_iterator layerIt ;

  double fz=fabs(z);
  
  //simple way of finding a first layer to try out
  if (fz < fabs(((z>0)?ppxlc:npxlc).front()->surface().position().z())){
    inLayer = blc.front();}
  else if (fz < fabs(((z>0)?ppxlc:npxlc).back()->surface().position().z())){
    layerIt = ((z>0)?ppxlc:npxlc).begin();
    inLayer= *layerIt;}
  else if (fz < fabs(((z>0)?ptidc:ntidc).front()->surface().position().z())){
    layerIt = ((z>0)?ppxlc:npxlc).end()-1;
    inLayer= *layerIt;}
  else if (fz < fabs(((z>0)?ptecc:ntecc).front()->surface().position().z())){
    layerIt = ((z>0)?ptidc:ntidc).begin();
    inLayer= *layerIt;}
  else if (fz < fabs(((z>0)?ptecc:ntecc).back()->surface().position().z())){
    layerIt = ((z>0)?ptecc:ntecc).begin();
    inLayer= *layerIt;}
  else {
    edm::LogWarning(theCategory)<<"the state is not consistent with any tracker layer:\n"
                             <<inner;
    return;}
  
  //find out at least one compatible detector reached
  std::vector< DetLayer::DetWithState > compatible;
  compatible.reserve(10);
  inLayer->compatibleDetsV(inner,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator,compatible);
  
  //if none were found. you should do something more.
  if (compatible.size()==0){
    std::vector<ForwardDetLayer*>::const_iterator pxlEnd = (z>0)? ppxlc.end() : npxlc.end();
    std::vector<ForwardDetLayer*>::const_iterator tidEnd = (z>0)? ptidc.end() : ntidc.end();
    std::vector<ForwardDetLayer*>::const_iterator tecEnd = (z>0)? ptecc.end() : ntecc.end();
    std::vector<ForwardDetLayer*>::const_iterator pxlBegin = (z>0)? ppxlc.begin() : npxlc.begin();
    std::vector<ForwardDetLayer*>::const_iterator tidBegin = (z>0)? ptidc.begin() : ntidc.begin();
    std::vector<ForwardDetLayer*>::const_iterator tecBegin = (z>0)? ptecc.begin() : ntecc.begin();

    //go to first disk if not already in a disk situation
    if (!dynamic_cast<const ForwardDetLayer*>(inLayer)) layerIt =pxlBegin--;
    
    while (compatible.size()==0) {
      switch ( (*layerIt)->subDetector() ) {
      case GeomDetEnumerators::PixelEndcap:
        {
          layerIt++;
          //if end of list reached. go to the first TID
          if (layerIt==pxlEnd) layerIt=tidBegin;
          break;
        }
      case GeomDetEnumerators::TID:
        {
          layerIt++;
          //if end of list reached. go to the first TEC
          if (layerIt==tidEnd) layerIt = tecBegin;
          break;
        }
      case GeomDetEnumerators::TEC:
        {
          layerIt++;
          if (layerIt==tecEnd){
            edm::LogWarning(theCategory)<<"ran out of layers to find a seed: no seed.";
            return;}
        }
      case GeomDetEnumerators::PixelBarrel: { edm::LogError(theCategory)<<"this should not happen... ever. Please report. GeomDetEnumerators::PixelBarrel. no seed."; return;}
      case GeomDetEnumerators::TIB: { edm::LogError(theCategory)<<"this should not happen... ever. Please report. GeomDetEnumerators::TIB. no seed."; return;}
      case GeomDetEnumerators::TOB: { edm::LogError(theCategory)<<"this should not happen... ever. Please report. GeomDetEnumerators::TOB. no seed."; return;}
      default:  { edm::LogError(theCategory)<<"Subdetector id is not a tracker sub-detector id. no seed."; return;}
      }//switch

      (*layerIt)->compatibleDetsV(inner,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator,compatible);
    }//while
  }//if size==0

  pushTrajectorySeed(muon,compatible,alongMomentum,result);

  return;
}
bool TSGForRoadSearch::notAtIPtsos ( TrajectoryStateOnSurface state) [private]

make the adjustement away from PCA state if requested

Definition at line 89 of file TSGForRoadSearch.cc.

References MuonErrorMatrix::adjust(), LogDebug, evf::utils::state, theAdjustAtIp, theCategory, and theErrorMatrixAdjuster.

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

                                                                  {
  LogDebug(theCategory)<<"outer state: "<<state;
  if (theErrorMatrixAdjuster && !theAdjustAtIp){
    theErrorMatrixAdjuster->adjust(state);
    LogDebug(theCategory)<<"outer state after rescale: "<<state;
  }
  return true;
}
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 396 of file TSGForRoadSearch.cc.

References edm::OwnVector< T, P >::clear(), MeasurementDet::fastMeasurements(), GeomDet::geographicalId(), LogDebug, trajectoryStateTransform::persistentState(), MuonServiceProxy::propagator(), 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().

                                                                                                                                                                                       {

  if (compatible.empty()){
    LogDebug(theCategory)<<"pushTrajectorySeed with no compatible module. 0 seed.";
    return;}

  if (theManySeeds){
    

    //finf out every compatible measurements
    for (std::vector<DetLayer::DetWithState >::iterator DWSit = compatible.begin(); DWSit!=compatible.end();++DWSit){
      bool aBareTS=false;
      const GeomDet * gd = DWSit->first;
      if (!gd){edm::LogError(theCategory)<<"GeomDet is not valid."; continue;}
      const MeasurementDet * md= theMeasurementTracker->idToDet(gd->geographicalId());
      std::vector<TrajectoryMeasurement> tmp = md->fastMeasurements(DWSit->second,DWSit->second,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator);
      //make a trajectory seed for each of them

      for (std::vector<TrajectoryMeasurement>::iterator Mit = tmp.begin(); Mit!=tmp.end();++Mit){
        TrajectoryStateOnSurface predState(Mit->predictedState());
        TrajectoryMeasurement::ConstRecHitPointer hit = Mit->recHit();
        TrajectorySeed::recHitContainer rhContainer;
        if (theCopyMuonRecHit){
          LogDebug(theCategory)<<"copying ("<<muon.recHitsSize()<<") muon recHits";
          //copy the muon rechit into the seed
          for (trackingRecHit_iterator trit = muon.recHitsBegin(); trit!=muon.recHitsEnd();trit++) {
            rhContainer.push_back( (*trit).get()->clone() );  }}
        
        if ( hit->isValid()) {
          TrajectoryStateOnSurface upState(theUpdator->update(predState,*hit));
          
          PTrajectoryStateOnDet const & PTSOD = trajectoryStateTransform::persistentState(upState,gd->geographicalId().rawId());
          LogDebug(theCategory)<<"state used to build a trajectory seed: \n"<<upState
                             <<"on detector: "<<gd->geographicalId().rawId();
          //add the tracking rechit
          if (theCopyMuonRecHit){
            edm::LogError(theCategory)<<"not a bare seed and muon hits are copied. dumping the muon hits.";
            rhContainer.clear();}
          rhContainer.push_back(hit->hit()->clone());

          result.push_back(TrajectorySeed(PTSOD,rhContainer,direction));          
        }
        else {
          //rec hit is not valid. put a bare TrajectorySeed, only once !
          if (!aBareTS){
            aBareTS=true;
            
            PTrajectoryStateOnDet const & PTSOD = trajectoryStateTransform::persistentState(predState,gd->geographicalId().rawId());
            LogDebug(theCategory)<<"state used to build a bare trajectory seed: \n"<<predState
                               <<"on detector: "<<gd->geographicalId().rawId();
    
            result.push_back(TrajectorySeed(PTSOD,rhContainer,direction));
          }
        }

      }


    }
  }
  else{
    //transform it into a PTrajectoryStateOnDet
    
    PTrajectoryStateOnDet const& PTSOD = trajectoryStateTransform::persistentState(compatible.front().second,compatible.front().first->geographicalId().rawId());
    LogDebug(theCategory)<<"state used to build a bare trajectory seed: \n"<<compatible.front().second
                       <<"on detector: "<<compatible.front().first->geographicalId().rawId();
    
    TrajectorySeed::recHitContainer rhContainer;
    if (theCopyMuonRecHit){
      LogDebug(theCategory)<<"copying ("<<muon.recHitsSize()<<") muon recHits";
      //copy the muon rechit into the seed
      for (trackingRecHit_iterator trit = muon.recHitsBegin(); trit!=muon.recHitsEnd();trit++) {
        rhContainer.push_back( (*trit).get()->clone() );  }}
    
    //add this seed to the list and return it
    result.push_back(TrajectorySeed(PTSOD,rhContainer,direction));
  }
    return;
}
void TSGForRoadSearch::setEvent ( const edm::Event event) [virtual]
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.

                                                                                                                                     {
  switch (theOption){
  case 0:
    makeSeeds_0(*muonTrackCand.second,result);break;
  case 1:
    makeSeeds_1(*muonTrackCand.second,result);break;
  case 2:
    makeSeeds_2(*muonTrackCand.second,result);break;
  case 3:
    makeSeeds_3(*muonTrackCand.second,result);break;
  case 4:
    makeSeeds_4(*muonTrackCand.second,result);break;
  }  
}

Member Data Documentation

adjust the state at IP or where it is defined for the seed

Definition at line 80 of file TSGForRoadSearch.h.

Referenced by IPfts(), notAtIPtsos(), and TSGForRoadSearch().

std::string TSGForRoadSearch::theCategory [private]

Definition at line 84 of file TSGForRoadSearch.h.

Definition at line 93 of file TSGForRoadSearch.h.

Referenced by pushTrajectorySeed(), and TSGForRoadSearch().

Definition at line 102 of file TSGForRoadSearch.h.

Referenced by IPfts(), notAtIPtsos(), TSGForRoadSearch(), and ~TSGForRoadSearch().

Definition at line 87 of file TSGForRoadSearch.h.

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

Definition at line 94 of file TSGForRoadSearch.h.

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

Definition at line 86 of file TSGForRoadSearch.h.

Referenced by pushTrajectorySeed(), and setEvent().

unsigned int TSGForRoadSearch::theOption [private]

Definition at line 92 of file TSGForRoadSearch.h.

Referenced by trackerSeeds(), and TSGForRoadSearch().

Definition at line 96 of file TSGForRoadSearch.h.

std::string TSGForRoadSearch::thePropagatorName [private]

Definition at line 95 of file TSGForRoadSearch.h.

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

Definition at line 98 of file TSGForRoadSearch.h.

Reimplemented from TrackerSeedGenerator.

Definition at line 90 of file TSGForRoadSearch.h.

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

Definition at line 89 of file TSGForRoadSearch.h.

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