CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
TSGForRoadSearch Class Reference

#include <TSGForRoadSearch.h>

Inheritance diagram for TSGForRoadSearch:
TrackerSeedGenerator

Public Types

typedef std::vector
< TrajectorySeed
BTSeedCollection
 
typedef std::pair< const
Trajectory *, reco::TrackRef
TrackCand
 
- Public Types inherited from TrackerSeedGenerator
typedef std::vector
< TrajectorySeed
BTSeedCollection
 
typedef std::pair< const
Trajectory *, reco::TrackRef
TrackCand
 

Public Member Functions

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

Private Member Functions

bool IPfts (const reco::Track &, FreeTrajectoryState &)
 get the FTS for a Track: adjusting the error matrix if requested More...
 
void makeSeeds_0 (const reco::Track &, std::vector< TrajectorySeed > &)
 oseed from inside-out: innermost Strip layer More...
 
void makeSeeds_1 (const reco::Track &, std::vector< TrajectorySeed > &)
 not implemented More...
 
void makeSeeds_2 (const reco::Track &, std::vector< TrajectorySeed > &)
 not implemented More...
 
void makeSeeds_3 (const reco::Track &, std::vector< TrajectorySeed > &)
 outside-in: outermost Strip layer More...
 
void makeSeeds_4 (const reco::Track &, std::vector< TrajectorySeed > &)
 inside-out: innermost Pixel/Strip layer More...
 
bool notAtIPtsos (TrajectoryStateOnSurface &state)
 make the adjustement away from PCA state if requested More...
 
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 More...
 

Private Attributes

bool theAdjustAtIp
 adjust the state at IP or where it is defined for the seed More...
 
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
 

Additional Inherited Members

- Protected Attributes inherited from TrackerSeedGenerator
const edm::EventtheEvent
 
const MuonServiceProxytheProxyService
 

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

Definition at line 45 of file TSGForRoadSearch.h.

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.

27  {
28 
29  theOption = par.getParameter<unsigned int>("option");
30  theCopyMuonRecHit = par.getParameter<bool>("copyMuonRecHit");
31 
32  double Chi2 = par.getParameter<double>("maxChi2");
34 
35  thePropagatorName = par.getParameter<std::string>("propagatorName");
36  thePropagatorCompatibleName = par.getParameter<std::string>("propagatorCompatibleName");
37 
38  theCategory = "TSGForRoadSearch|TrackerSeedGenerator";
39 
40  theManySeeds = par.getParameter<bool>("manySeeds");
41  if (theManySeeds){ theUpdator = new KFUpdator();}
42  else{ theUpdator=0;}
43 
44  edm::ParameterSet errorMatrixPset = par.getParameter<edm::ParameterSet>("errorMatrixPset");
45  if (!errorMatrixPset.empty()){
46  theAdjustAtIp = errorMatrixPset.getParameter<bool>("atIP");
47  theErrorMatrixAdjuster = new MuonErrorMatrix(errorMatrixPset);}
48  else {
49  theAdjustAtIp =false;
51 }
T getParameter(std::string const &) const
bool empty() const
Definition: ParameterSet.h:219
bool theAdjustAtIp
adjust the state at IP or where it is defined for the seed
std::string theCategory
T sqrt(T t)
Definition: SSEVec.h:46
Chi2MeasurementEstimator * theChi2Estimator
MuonErrorMatrix * theErrorMatrixAdjuster
std::string thePropagatorCompatibleName
std::string thePropagatorName
Definition: Chi2.h:17
unsigned int theOption
TrajectoryStateUpdator * theUpdator
TSGForRoadSearch::~TSGForRoadSearch ( )
virtual

Definition at line 52 of file TSGForRoadSearch.cc.

References theChi2Estimator, theErrorMatrixAdjuster, and theUpdator.

52  {
53  delete theChi2Estimator;
54  if (theUpdator) delete theUpdator;
56 }
Chi2MeasurementEstimator * theChi2Estimator
MuonErrorMatrix * theErrorMatrixAdjuster
TrajectoryStateUpdator * theUpdator

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.

59  {
60  theProxyService = service;
61 }
const MuonServiceProxy * theProxyService
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().

98  {
99 
101  LogDebug(theCategory)<<"pure L2 state: "<<fts;
102  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.";
103  return false;}
104 
105  //rescale the error at IP
107  LogDebug(theCategory)<<"after adjusting the error matrix: "<<fts;}
108 
109  return true;
110 }
#define LogDebug(id)
void adjust(FreeTrajectoryState &state)
adjust the error matrix on the state
edm::ESHandle< MagneticField > magneticField() const
get the magnetic field
bool theAdjustAtIp
adjust the state at IP or where it is defined for the seed
std::string theCategory
const MuonServiceProxy * theProxyService
MuonErrorMatrix * theErrorMatrixAdjuster
FreeTrajectoryState initialFreeState(const reco::Track &tk, const MagneticField *field)
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, detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().

Referenced by makeSeeds_4(), and trackerSeeds().

115  {
116  //get the state at IP
117  FreeTrajectoryState cIPFTS;
118  if (!IPfts(muon, cIPFTS)) return;
119 
120  //take state at inner surface and check the first part reached
121  const std::vector<BarrelDetLayer*> & blc = theGeometricSearchTracker->tibLayers();
122  TrajectoryStateOnSurface inner = theProxyService->propagator(thePropagatorName)->propagate(cIPFTS,blc.front()->surface());
123  if ( !inner.isValid() ) {LogDebug(theCategory) <<"inner state is not valid. no seed."; return;}
124 
125  //rescale the error
126  if (!notAtIPtsos(inner)) return;
127 
128  double z = inner.globalPosition().z();
129 
130  const std::vector<ForwardDetLayer*> &ptidc = theGeometricSearchTracker->posTidLayers();
131  const std::vector<ForwardDetLayer*> &ptecc = theGeometricSearchTracker->posTecLayers();
132  const std::vector<ForwardDetLayer*> &ntidc = theGeometricSearchTracker->negTidLayers();
133  const std::vector<ForwardDetLayer*> &ntecc = theGeometricSearchTracker->negTecLayers();
134 
135  const DetLayer *inLayer = 0;
136  if( fabs(z) < ptidc.front()->surface().position().z() ) {
137  inLayer = blc.front();
138  } else if ( fabs(z) < ptecc.front()->surface().position().z() ) {
139  inLayer = ( z < 0 ) ? ntidc.front() : ptidc.front() ;
140  } else {
141  inLayer = ( z < 0 ) ? ntecc.front() : ptecc.front() ;
142  }
143 
144  //find out at least one compatible detector reached
145  std::vector< DetLayer::DetWithState > compatible;
146  compatible.reserve(10);
148 
149  //loop the parts until at least a compatible is found
150  while (compatible.size()==0) {
151  switch ( inLayer->subDetector() ) {
156  LogDebug(theCategory)<<"from inside-out, trying TEC or TOB layers. no seed.";
157  return;
158  break;
160  inLayer = ( z < 0 ) ? ntidc.front() : ptidc.front() ;
161  break;
163  inLayer = ( z < 0 ) ? ntecc.front() : ptecc.front() ;
164  break;
165  default:
166  LogDebug(theCategory)<<"subdetectorid is not a tracker sub-dectector id. skipping.";
167  return;
168  }
170  }
171 
172  pushTrajectorySeed(muon,compatible,alongMomentum,result);
173 
174  return;
175 }
#define LogDebug(id)
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool IPfts(const reco::Track &, FreeTrajectoryState &)
get the FTS for a Track: adjusting the error matrix if requested
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
GlobalPoint globalPosition() const
double double double z
std::string theCategory
T z() const
Definition: PV3DBase.h:63
bool notAtIPtsos(TrajectoryStateOnSurface &state)
make the adjustement away from PCA state if requested
tuple result
Definition: query.py:137
Chi2MeasurementEstimator * theChi2Estimator
const MuonServiceProxy * theProxyService
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
std::string thePropagatorCompatibleName
std::string thePropagatorName
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
edm::ESHandle< Propagator > propagator(std::string propagatorName) const
get the propagator
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().

177  {
178  edm::LogError(theCategory)<<"option 1 of TSGForRoadSearch is not implemented yet. Please use 0,3 or 4. no seed.";
179  return;
180 }
std::string theCategory
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().

182  {
183  edm::LogError(theCategory)<<"option 2 of TSGForRoadSearch is not implemented yet. Please use 0,3 or 4. no seed.";
184  return;
185 }
std::string theCategory
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, GloballyPositioned< T >::position(), position, edm::ESHandle< class >::product(), MuonServiceProxy::propagator(), pushTrajectorySeed(), DetLayer::subDetector(), GeometricSearchDet::surface(), GeomDetEnumerators::TEC, theCategory, theChi2Estimator, theGeometricSearchTracker, thePropagatorCompatibleName, thePropagatorName, theProxyService, GeomDetEnumerators::TIB, GeomDetEnumerators::TID, GeomDetEnumerators::TOB, detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().

Referenced by trackerSeeds().

190  {
191  //get the state at IP
192  FreeTrajectoryState cIPFTS;
193  if (!IPfts(muon, cIPFTS)) return;
194 
195  //take state at outer surface and check the first part reached
196  const std::vector<BarrelDetLayer*> &blc = theGeometricSearchTracker->tobLayers();
197 
198  // TrajectoryStateOnSurface outer = theProxyService->propagator(thePropagatorName)->propagate(cIPFTS,blc.back()->surface());
200  TrajectoryStateOnSurface outer = onBounds(cIPFTS);
201 
202  if ( !outer.isValid() ) {LogDebug(theCategory) <<"outer state is not valid. no seed."; return;}
203 
204  //rescale the error
205  if (!notAtIPtsos(outer)) return;
206 
207  double z = outer.globalPosition().z();
208 
209  const std::vector<ForwardDetLayer*> &ptecc = theGeometricSearchTracker->posTecLayers();
210  const std::vector<ForwardDetLayer*> &ntecc = theGeometricSearchTracker->negTecLayers();
211 
212  LogDebug(theCategory)<<"starting looking for a compatible layer from: "<<outer<<"\nz: "<<z<<"TEC1 z: "<<ptecc.front()->surface().position().z();
213 
214  unsigned int layerShift=0;
215  const DetLayer *inLayer = 0;
216  if (fabs(z) < ptecc.front()->surface().position().z() ){
217  inLayer = *(blc.rbegin()+layerShift);
218  LogTrace(theCategory)<<"choosing TOB layer with shift: "<<layerShift;
219  } else {
220  unsigned int tecIt=1;
221  for (; tecIt!=ptecc.size();tecIt++){
222  LogTrace(theCategory)<<"checking surface with shift: "<<tecIt
223  <<"z: "<<ptecc[tecIt]->surface().position().z();
224  if (fabs(z) < ptecc[tecIt]->surface().position().z())
225  {inLayer = ( z < 0 ) ? ntecc[tecIt-1] : ptecc[tecIt-1] ;
226  layerShift=tecIt-1;
227  LogTrace(theCategory)<<"choosing TEC layer with shift: "<<layerShift
228  <<" and z: "<<inLayer->surface().position().z();
229  break;}}
230  if (!inLayer) {inLayer = ( z < 0 ) ? ntecc.back() : ptecc.back();
231  LogTrace(theCategory)<<"choosing last TEC layer with z: "<<inLayer->surface().position().z();
232  }
233  }
234 
235  //find out at least one compatible detector reached
236  std::vector< DetLayer::DetWithState > compatible;
237  compatible.reserve(10);
239 
240  //loop the parts until at least a compatible is found
241  while (compatible.size()==0) {
242  switch ( inLayer->subDetector() ) {
248  layerShift++;
249  if (layerShift>=blc.size()){
250  LogDebug(theCategory) <<"all barrel layers are exhausted to find starting state. no seed,";
251  return;}
252  inLayer = *(blc.rbegin()+layerShift);
253  break;
255  if (layerShift==0){
256  LogDebug(theCategory) <<"failed to get a compatible module on a TEC layer, using the last TOB layer.";
257  inLayer = *(blc.rbegin()+layerShift);
258  }
259  else{
260  layerShift--;
261  LogDebug(theCategory) <<"reaching more in with layer "<<layerShift<<" in TEC";
262  inLayer = ( z < 0 ) ? ntecc[layerShift] : ptecc[layerShift] ;
263  }
264  break;
265  default:
266  edm::LogError(theCategory)<<"subdetectorid is not a tracker sub-dectector id. skipping.";
267  return;
268  }
270  }
271 
273 
274  return;
275 }
#define LogDebug(id)
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool IPfts(const reco::Track &, FreeTrajectoryState &)
get the FTS for a Track: adjusting the error matrix if requested
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
double double double z
std::string theCategory
T z() const
Definition: PV3DBase.h:63
bool notAtIPtsos(TrajectoryStateOnSurface &state)
make the adjustement away from PCA state if requested
tuple result
Definition: query.py:137
Chi2MeasurementEstimator * theChi2Estimator
#define LogTrace(id)
const MuonServiceProxy * theProxyService
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
T const * product() const
Definition: ESHandle.h:62
std::string thePropagatorCompatibleName
static int position[264][3]
Definition: ReadPGInfo.cc:509
std::string thePropagatorName
const PositionType & position() const
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
edm::ESHandle< Propagator > propagator(std::string propagatorName) const
get the propagator
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, detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().

Referenced by trackerSeeds().

281  {
282  //get the state at IP
283  FreeTrajectoryState cIPFTS;
284  if (!IPfts(muon, cIPFTS)) return;
285 
286  //take state at inner surface and check the first part reached
287  const std::vector<BarrelDetLayer*> & blc = theGeometricSearchTracker->pixelBarrelLayers();
288  if (blc.empty()){edm::LogError(theCategory)<<"want to start from pixel layer, but no barrel exists. trying without pixel.";
289  makeSeeds_0(muon, result);
290  return;}
291 
292  TrajectoryStateOnSurface inner = theProxyService->propagator(thePropagatorName)->propagate(cIPFTS,blc.front()->surface());
293  if ( !inner.isValid() ) {LogDebug(theCategory) <<"inner state is not valid. no seed."; return;}
294 
295  //rescale the error
296  if (!notAtIPtsos(inner)) return;
297 
298  double z = inner.globalPosition().z();
299 
300  const std::vector<ForwardDetLayer*> &ppxlc = theGeometricSearchTracker->posPixelForwardLayers();
301  const std::vector<ForwardDetLayer*> &npxlc = theGeometricSearchTracker->negPixelForwardLayers();
302  const std::vector<ForwardDetLayer*> &ptidc = theGeometricSearchTracker->posTidLayers();
303  const std::vector<ForwardDetLayer*> &ptecc = theGeometricSearchTracker->posTecLayers();
304  const std::vector<ForwardDetLayer*> &ntidc = theGeometricSearchTracker->negTidLayers();
305  const std::vector<ForwardDetLayer*> &ntecc = theGeometricSearchTracker->negTecLayers();
306 
307  if ((ppxlc.empty() || npxlc.empty()) && (ptidc.empty() || ptecc.empty()) )
308  { edm::LogError(theCategory)<<"want to start from pixel layer, but no forward layer exists. trying without pixel.";
309  makeSeeds_0(muon, result);
310  return;}
311 
312  const DetLayer *inLayer = 0;
313  std::vector<ForwardDetLayer*>::const_iterator layerIt ;
314 
315  double fz=fabs(z);
316 
317  //simple way of finding a first layer to try out
318  if (fz < fabs(((z>0)?ppxlc:npxlc).front()->surface().position().z())){
319  inLayer = blc.front();}
320  else if (fz < fabs(((z>0)?ppxlc:npxlc).back()->surface().position().z())){
321  layerIt = ((z>0)?ppxlc:npxlc).begin();
322  inLayer= *layerIt;}
323  else if (fz < fabs(((z>0)?ptidc:ntidc).front()->surface().position().z())){
324  layerIt = ((z>0)?ppxlc:npxlc).end()-1;
325  inLayer= *layerIt;}
326  else if (fz < fabs(((z>0)?ptecc:ntecc).front()->surface().position().z())){
327  layerIt = ((z>0)?ptidc:ntidc).begin();
328  inLayer= *layerIt;}
329  else if (fz < fabs(((z>0)?ptecc:ntecc).back()->surface().position().z())){
330  layerIt = ((z>0)?ptecc:ntecc).begin();
331  inLayer= *layerIt;}
332  else {
333  edm::LogWarning(theCategory)<<"the state is not consistent with any tracker layer:\n"
334  <<inner;
335  return;}
336 
337  //find out at least one compatible detector reached
338  std::vector< DetLayer::DetWithState > compatible;
339  compatible.reserve(10);
341 
342  //if none were found. you should do something more.
343  if (compatible.size()==0){
344  std::vector<ForwardDetLayer*>::const_iterator pxlEnd = (z>0)? ppxlc.end() : npxlc.end();
345  std::vector<ForwardDetLayer*>::const_iterator tidEnd = (z>0)? ptidc.end() : ntidc.end();
346  std::vector<ForwardDetLayer*>::const_iterator tecEnd = (z>0)? ptecc.end() : ntecc.end();
347  std::vector<ForwardDetLayer*>::const_iterator pxlBegin = (z>0)? ppxlc.begin() : npxlc.begin();
348  std::vector<ForwardDetLayer*>::const_iterator tidBegin = (z>0)? ptidc.begin() : ntidc.begin();
349  std::vector<ForwardDetLayer*>::const_iterator tecBegin = (z>0)? ptecc.begin() : ntecc.begin();
350 
351  //go to first disk if not already in a disk situation
352  if (!dynamic_cast<const ForwardDetLayer*>(inLayer)) layerIt =pxlBegin--;
353 
354  while (compatible.size()==0) {
355  switch ( (*layerIt)->subDetector() ) {
357  {
358  layerIt++;
359  //if end of list reached. go to the first TID
360  if (layerIt==pxlEnd) layerIt=tidBegin;
361  break;
362  }
364  {
365  layerIt++;
366  //if end of list reached. go to the first TEC
367  if (layerIt==tidEnd) layerIt = tecBegin;
368  break;
369  }
371  {
372  layerIt++;
373  if (layerIt==tecEnd){
374  edm::LogWarning(theCategory)<<"ran out of layers to find a seed: no seed.";
375  return;}
376  }
377  case GeomDetEnumerators::PixelBarrel: { edm::LogError(theCategory)<<"this should not happen... ever. Please report. GeomDetEnumerators::PixelBarrel. no seed."; return;}
378  case GeomDetEnumerators::TIB: { edm::LogError(theCategory)<<"this should not happen... ever. Please report. GeomDetEnumerators::TIB. no seed."; return;}
379  case GeomDetEnumerators::TOB: { edm::LogError(theCategory)<<"this should not happen... ever. Please report. GeomDetEnumerators::TOB. no seed."; return;}
380  default: { edm::LogError(theCategory)<<"Subdetector id is not a tracker sub-detector id. no seed."; return;}
381  }//switch
382 
383  (*layerIt)->compatibleDetsV(inner,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator,compatible);
384  }//while
385  }//if size==0
386 
387  pushTrajectorySeed(muon,compatible,alongMomentum,result);
388 
389  return;
390 }
#define LogDebug(id)
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
bool IPfts(const reco::Track &, FreeTrajectoryState &)
get the FTS for a Track: adjusting the error matrix if requested
GlobalPoint globalPosition() const
double double double z
std::string theCategory
T z() const
Definition: PV3DBase.h:63
bool notAtIPtsos(TrajectoryStateOnSurface &state)
make the adjustement away from PCA state if requested
tuple result
Definition: query.py:137
Chi2MeasurementEstimator * theChi2Estimator
const MuonServiceProxy * theProxyService
void makeSeeds_0(const reco::Track &, std::vector< TrajectorySeed > &)
oseed from inside-out: innermost 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
std::string thePropagatorCompatibleName
static int position[264][3]
Definition: ReadPGInfo.cc:509
std::string thePropagatorName
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
edm::ESHandle< Propagator > propagator(std::string propagatorName) const
get the propagator
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().

89  {
90  LogDebug(theCategory)<<"outer state: "<<state;
93  LogDebug(theCategory)<<"outer state after rescale: "<<state;
94  }
95  return true;
96 }
#define LogDebug(id)
void adjust(FreeTrajectoryState &state)
adjust the error matrix on the state
bool theAdjustAtIp
adjust the state at IP or where it is defined for the seed
std::string theCategory
MuonErrorMatrix * theErrorMatrixAdjuster
char state
Definition: procUtils.cc:75
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().

396  {
397 
398  if (compatible.empty()){
399  LogDebug(theCategory)<<"pushTrajectorySeed with no compatible module. 0 seed.";
400  return;}
401 
402  if (theManySeeds){
403 
404 
405  //finf out every compatible measurements
406  for (std::vector<DetLayer::DetWithState >::iterator DWSit = compatible.begin(); DWSit!=compatible.end();++DWSit){
407  bool aBareTS=false;
408  const GeomDet * gd = DWSit->first;
409  if (!gd){edm::LogError(theCategory)<<"GeomDet is not valid."; continue;}
410  const MeasurementDet * md= theMeasurementTracker->idToDet(gd->geographicalId());
411  std::vector<TrajectoryMeasurement> tmp = md->fastMeasurements(DWSit->second,DWSit->second,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator);
412  //make a trajectory seed for each of them
413 
414  for (std::vector<TrajectoryMeasurement>::iterator Mit = tmp.begin(); Mit!=tmp.end();++Mit){
415  TrajectoryStateOnSurface predState(Mit->predictedState());
418  if (theCopyMuonRecHit){
419  LogDebug(theCategory)<<"copying ("<<muon.recHitsSize()<<") muon recHits";
420  //copy the muon rechit into the seed
421  for (trackingRecHit_iterator trit = muon.recHitsBegin(); trit!=muon.recHitsEnd();trit++) {
422  rhContainer.push_back( (*trit).get()->clone() ); }}
423 
424  if ( hit->isValid()) {
425  TrajectoryStateOnSurface upState(theUpdator->update(predState,*hit));
426 
428  LogDebug(theCategory)<<"state used to build a trajectory seed: \n"<<upState
429  <<"on detector: "<<gd->geographicalId().rawId();
430  //add the tracking rechit
431  if (theCopyMuonRecHit){
432  edm::LogError(theCategory)<<"not a bare seed and muon hits are copied. dumping the muon hits.";
433  rhContainer.clear();}
434  rhContainer.push_back(hit->hit()->clone());
435 
436  result.push_back(TrajectorySeed(PTSOD,rhContainer,direction));
437  }
438  else {
439  //rec hit is not valid. put a bare TrajectorySeed, only once !
440  if (!aBareTS){
441  aBareTS=true;
442 
444  LogDebug(theCategory)<<"state used to build a bare trajectory seed: \n"<<predState
445  <<"on detector: "<<gd->geographicalId().rawId();
446 
447  result.push_back(TrajectorySeed(PTSOD,rhContainer,direction));
448  }
449  }
450 
451  }
452 
453 
454  }
455  }
456  else{
457  //transform it into a PTrajectoryStateOnDet
458 
459  PTrajectoryStateOnDet const& PTSOD = trajectoryStateTransform::persistentState(compatible.front().second,compatible.front().first->geographicalId().rawId());
460  LogDebug(theCategory)<<"state used to build a bare trajectory seed: \n"<<compatible.front().second
461  <<"on detector: "<<compatible.front().first->geographicalId().rawId();
462 
464  if (theCopyMuonRecHit){
465  LogDebug(theCategory)<<"copying ("<<muon.recHitsSize()<<") muon recHits";
466  //copy the muon rechit into the seed
467  for (trackingRecHit_iterator trit = muon.recHitsBegin(); trit!=muon.recHitsEnd();trit++) {
468  rhContainer.push_back( (*trit).get()->clone() ); }}
469 
470  //add this seed to the list and return it
471  result.push_back(TrajectorySeed(PTSOD,rhContainer,direction));
472  }
473  return;
474 }
#define LogDebug(id)
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const =0
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
Definition: Track.h:69
edm::ESHandle< MeasurementTracker > theMeasurementTracker
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
std::string theCategory
void push_back(D *&d)
Definition: OwnVector.h:273
tuple result
Definition: query.py:137
void clear()
Definition: OwnVector.h:370
Chi2MeasurementEstimator * theChi2Estimator
virtual std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &startingState, const Propagator &, const MeasurementEstimator &) const =0
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:63
const MuonServiceProxy * theProxyService
std::string thePropagatorCompatibleName
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
TrajectoryStateUpdator * theUpdator
edm::ESHandle< Propagator > propagator(std::string propagatorName) const
get the propagator
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:65
void TSGForRoadSearch::setEvent ( const edm::Event event)
virtual

set the event: update the MeasurementTracker

Reimplemented from TrackerSeedGenerator.

Definition at line 63 of file TSGForRoadSearch.cc.

References MuonServiceProxy::eventSetup(), edm::EventSetup::get(), edm::ESHandleBase::isValid(), theCategory, theGeometricSearchTracker, theManySeeds, theMeasurementTracker, and theProxyService.

63  {
64  //get the measurementtracker
65  if (theManySeeds){
67  if (!theMeasurementTracker.isValid())/*abort*/{edm::LogError(theCategory)<<"measurement tracker geometry not found ";}
68  }
70 }
const edm::EventSetup & eventSetup() const
get the whole EventSetup
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
edm::ESHandle< MeasurementTracker > theMeasurementTracker
std::string theCategory
const MuonServiceProxy * theProxyService
const T & get() const
Definition: EventSetup.h:55
bool isValid() const
Definition: ESHandle.h:37
void TSGForRoadSearch::trackerSeeds ( const TrackCand ,
const TrackingRegion ,
BTSeedCollection  
)
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.

74  {
75  switch (theOption){
76  case 0:
77  makeSeeds_0(*muonTrackCand.second,result);break;
78  case 1:
79  makeSeeds_1(*muonTrackCand.second,result);break;
80  case 2:
81  makeSeeds_2(*muonTrackCand.second,result);break;
82  case 3:
83  makeSeeds_3(*muonTrackCand.second,result);break;
84  case 4:
85  makeSeeds_4(*muonTrackCand.second,result);break;
86  }
87 }
void makeSeeds_2(const reco::Track &, std::vector< TrajectorySeed > &)
not implemented
tuple result
Definition: query.py:137
void makeSeeds_1(const reco::Track &, std::vector< TrajectorySeed > &)
not implemented
void makeSeeds_3(const reco::Track &, std::vector< TrajectorySeed > &)
outside-in: outermost Strip layer
void makeSeeds_0(const reco::Track &, std::vector< TrajectorySeed > &)
oseed from inside-out: innermost Strip layer
void makeSeeds_4(const reco::Track &, std::vector< TrajectorySeed > &)
inside-out: innermost Pixel/Strip layer
unsigned int theOption

Member Data Documentation

bool TSGForRoadSearch::theAdjustAtIp
private

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
Chi2MeasurementEstimator* TSGForRoadSearch::theChi2Estimator
private
edm::ParameterSet TSGForRoadSearch::theConfig
private

Definition at line 84 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 IPfts(), notAtIPtsos(), TSGForRoadSearch(), and ~TSGForRoadSearch().

edm::ESHandle<GeometricSearchTracker> TSGForRoadSearch::theGeometricSearchTracker
private

Definition at line 87 of file TSGForRoadSearch.h.

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

bool TSGForRoadSearch::theManySeeds
private

Definition at line 94 of file TSGForRoadSearch.h.

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

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

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().

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

Definition at line 96 of file TSGForRoadSearch.h.

std::string TSGForRoadSearch::thePropagatorCompatibleName
private
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
TrajectoryStateUpdator* TSGForRoadSearch::theUpdator
private

Definition at line 89 of file TSGForRoadSearch.h.

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