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 &, const TrackerTopology *, BTSeedCollection &)
 generated seed(s) for a track. the tracking region is not used. More...
 
 TSGForRoadSearch (const edm::ParameterSet &pset, edm::ConsumesCollector &IC)
 
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
 
const MeasurementTrackerEventtheMeasurementTrackerEvent
 
edm::InputTag theMeasurementTrackerEventTag
 
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 46 of file TSGForRoadSearch.h.

Member Typedef Documentation

Definition at line 49 of file TSGForRoadSearch.h.

Definition at line 50 of file TSGForRoadSearch.h.

Constructor & Destructor Documentation

TSGForRoadSearch::TSGForRoadSearch ( const edm::ParameterSet pset,
edm::ConsumesCollector IC 
)

Definition at line 28 of file TSGForRoadSearch.cc.

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

28  {
29 
30  theOption = par.getParameter<unsigned int>("option");
31  theCopyMuonRecHit = par.getParameter<bool>("copyMuonRecHit");
32 
33  double Chi2 = par.getParameter<double>("maxChi2");
35 
36  thePropagatorName = par.getParameter<std::string>("propagatorName");
37  thePropagatorCompatibleName = par.getParameter<std::string>("propagatorCompatibleName");
38 
39  theCategory = "TSGForRoadSearch|TrackerSeedGenerator";
40 
41  theManySeeds = par.getParameter<bool>("manySeeds");
42  if (theManySeeds){ theUpdator = new KFUpdator();}
43  else{ theUpdator=0;}
44 
45  edm::ParameterSet errorMatrixPset = par.getParameter<edm::ParameterSet>("errorMatrixPset");
46  if (!errorMatrixPset.empty()){
47  theAdjustAtIp = errorMatrixPset.getParameter<bool>("atIP");
48  theErrorMatrixAdjuster = new MuonErrorMatrix(errorMatrixPset);}
49  else {
50  theAdjustAtIp =false;
52 
53  theMeasurementTrackerEventTag = par.getParameter<edm::InputTag>("MeasurementTrackerEvent");
55 }
T getParameter(std::string const &) const
bool empty() const
Definition: ParameterSet.h:216
edm::InputTag theMeasurementTrackerEventTag
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:48
Chi2MeasurementEstimator * theChi2Estimator
const MeasurementTrackerEvent * theMeasurementTrackerEvent
MuonErrorMatrix * theErrorMatrixAdjuster
std::string thePropagatorCompatibleName
std::string thePropagatorName
Definition: Chi2.h:17
unsigned int theOption
TrajectoryStateUpdator * theUpdator
TSGForRoadSearch::~TSGForRoadSearch ( )
virtual

Definition at line 56 of file TSGForRoadSearch.cc.

References theChi2Estimator, theErrorMatrixAdjuster, and theUpdator.

56  {
57  delete theChi2Estimator;
58  if (theUpdator) delete theUpdator;
60 }
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 63 of file TSGForRoadSearch.cc.

References theProxyService.

63  {
64  theProxyService = service;
65 }
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 107 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().

107  {
108 
110  LogDebug(theCategory)<<"pure L2 state: "<<fts;
111  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.";
112  return false;}
113 
114  //rescale the error at IP
116  LogDebug(theCategory)<<"after adjusting the error matrix: "<<fts;}
117 
118  return true;
119 }
#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 124 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().

124  {
125  //get the state at IP
126  FreeTrajectoryState cIPFTS;
127  if (!IPfts(muon, cIPFTS)) return;
128 
129  //take state at inner surface and check the first part reached
130  const std::vector<BarrelDetLayer*> & blc = theGeometricSearchTracker->tibLayers();
131  TrajectoryStateOnSurface inner = theProxyService->propagator(thePropagatorName)->propagate(cIPFTS,blc.front()->surface());
132  if ( !inner.isValid() ) {LogDebug(theCategory) <<"inner state is not valid. no seed."; return;}
133 
134  //rescale the error
135  if (!notAtIPtsos(inner)) return;
136 
137  double z = inner.globalPosition().z();
138 
139  const std::vector<ForwardDetLayer*> &ptidc = theGeometricSearchTracker->posTidLayers();
140  const std::vector<ForwardDetLayer*> &ptecc = theGeometricSearchTracker->posTecLayers();
141  const std::vector<ForwardDetLayer*> &ntidc = theGeometricSearchTracker->negTidLayers();
142  const std::vector<ForwardDetLayer*> &ntecc = theGeometricSearchTracker->negTecLayers();
143 
144  const DetLayer *inLayer = 0;
145  if( fabs(z) < ptidc.front()->surface().position().z() ) {
146  inLayer = blc.front();
147  } else if ( fabs(z) < ptecc.front()->surface().position().z() ) {
148  inLayer = ( z < 0 ) ? ntidc.front() : ptidc.front() ;
149  } else {
150  inLayer = ( z < 0 ) ? ntecc.front() : ptecc.front() ;
151  }
152 
153  //find out at least one compatible detector reached
154  std::vector< DetLayer::DetWithState > compatible;
155  compatible.reserve(10);
157 
158  //loop the parts until at least a compatible is found
159  while (compatible.size()==0) {
160  switch ( inLayer->subDetector() ) {
165  LogDebug(theCategory)<<"from inside-out, trying TEC or TOB layers. no seed.";
166  return;
167  break;
169  inLayer = ( z < 0 ) ? ntidc.front() : ptidc.front() ;
170  break;
172  inLayer = ( z < 0 ) ? ntecc.front() : ptecc.front() ;
173  break;
174  default:
175  LogDebug(theCategory)<<"subdetectorid is not a tracker sub-dectector id. skipping.";
176  return;
177  }
179  }
180 
181  pushTrajectorySeed(muon,compatible,alongMomentum,result);
182 
183  return;
184 }
#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
float float float z
std::string theCategory
T z() const
Definition: PV3DBase.h:64
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 186 of file TSGForRoadSearch.cc.

References theCategory.

Referenced by trackerSeeds().

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

not implemented

Definition at line 191 of file TSGForRoadSearch.cc.

References theCategory.

Referenced by trackerSeeds().

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

outside-in: outermost Strip layer

Definition at line 199 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().

199  {
200  //get the state at IP
201  FreeTrajectoryState cIPFTS;
202  if (!IPfts(muon, cIPFTS)) return;
203 
204  //take state at outer surface and check the first part reached
205  const std::vector<BarrelDetLayer*> &blc = theGeometricSearchTracker->tobLayers();
206 
207  // TrajectoryStateOnSurface outer = theProxyService->propagator(thePropagatorName)->propagate(cIPFTS,blc.back()->surface());
209  TrajectoryStateOnSurface outer = onBounds(cIPFTS);
210 
211  if ( !outer.isValid() ) {LogDebug(theCategory) <<"outer state is not valid. no seed."; return;}
212 
213  //rescale the error
214  if (!notAtIPtsos(outer)) return;
215 
216  double z = outer.globalPosition().z();
217 
218  const std::vector<ForwardDetLayer*> &ptecc = theGeometricSearchTracker->posTecLayers();
219  const std::vector<ForwardDetLayer*> &ntecc = theGeometricSearchTracker->negTecLayers();
220 
221  LogDebug(theCategory)<<"starting looking for a compatible layer from: "<<outer<<"\nz: "<<z<<"TEC1 z: "<<ptecc.front()->surface().position().z();
222 
223  unsigned int layerShift=0;
224  const DetLayer *inLayer = 0;
225  if (fabs(z) < ptecc.front()->surface().position().z() ){
226  inLayer = *(blc.rbegin()+layerShift);
227  LogTrace(theCategory)<<"choosing TOB layer with shift: "<<layerShift;
228  } else {
229  unsigned int tecIt=1;
230  for (; tecIt!=ptecc.size();tecIt++){
231  LogTrace(theCategory)<<"checking surface with shift: "<<tecIt
232  <<"z: "<<ptecc[tecIt]->surface().position().z();
233  if (fabs(z) < ptecc[tecIt]->surface().position().z())
234  {inLayer = ( z < 0 ) ? ntecc[tecIt-1] : ptecc[tecIt-1] ;
235  layerShift=tecIt-1;
236  LogTrace(theCategory)<<"choosing TEC layer with shift: "<<layerShift
237  <<" and z: "<<inLayer->surface().position().z();
238  break;}}
239  if (!inLayer) {inLayer = ( z < 0 ) ? ntecc.back() : ptecc.back();
240  LogTrace(theCategory)<<"choosing last TEC layer with z: "<<inLayer->surface().position().z();
241  }
242  }
243 
244  //find out at least one compatible detector reached
245  std::vector< DetLayer::DetWithState > compatible;
246  compatible.reserve(10);
248 
249  //loop the parts until at least a compatible is found
250  while (compatible.size()==0) {
251  switch ( inLayer->subDetector() ) {
257  layerShift++;
258  if (layerShift>=blc.size()){
259  LogDebug(theCategory) <<"all barrel layers are exhausted to find starting state. no seed,";
260  return;}
261  inLayer = *(blc.rbegin()+layerShift);
262  break;
264  if (layerShift==0){
265  LogDebug(theCategory) <<"failed to get a compatible module on a TEC layer, using the last TOB layer.";
266  inLayer = *(blc.rbegin()+layerShift);
267  }
268  else{
269  layerShift--;
270  LogDebug(theCategory) <<"reaching more in with layer "<<layerShift<<" in TEC";
271  inLayer = ( z < 0 ) ? ntecc[layerShift] : ptecc[layerShift] ;
272  }
273  break;
274  default:
275  edm::LogError(theCategory)<<"subdetectorid is not a tracker sub-dectector id. skipping.";
276  return;
277  }
279  }
280 
282 
283  return;
284 }
#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)
float float float z
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
std::string theCategory
T z() const
Definition: PV3DBase.h:64
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
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 290 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().

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

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

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

98  {
99  LogDebug(theCategory)<<"outer state: "<<state;
102  LogDebug(theCategory)<<"outer state after rescale: "<<state;
103  }
104  return true;
105 }
#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
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 405 of file TSGForRoadSearch.cc.

References edm::OwnVector< T, P >::clear(), MeasurementDetWithData::fastMeasurements(), GeomDet::geographicalId(), MeasurementTrackerEvent::idToDet(), 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, theMeasurementTrackerEvent, thePropagatorCompatibleName, theProxyService, theUpdator, tmp, and TrajectoryStateUpdator::update().

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

405  {
406 
407  if (compatible.empty()){
408  LogDebug(theCategory)<<"pushTrajectorySeed with no compatible module. 0 seed.";
409  return;}
410 
411  if (theManySeeds){
412 
413 
414  //finf out every compatible measurements
415  for (std::vector<DetLayer::DetWithState >::iterator DWSit = compatible.begin(); DWSit!=compatible.end();++DWSit){
416  bool aBareTS=false;
417  const GeomDet * gd = DWSit->first;
418  if (!gd){edm::LogError(theCategory)<<"GeomDet is not valid."; continue;}
420  std::vector<TrajectoryMeasurement> tmp = md.fastMeasurements(DWSit->second,DWSit->second,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator);
421  //make a trajectory seed for each of them
422 
423  for (std::vector<TrajectoryMeasurement>::iterator Mit = tmp.begin(); Mit!=tmp.end();++Mit){
424  TrajectoryStateOnSurface predState(Mit->predictedState());
427  if (theCopyMuonRecHit){
428  LogDebug(theCategory)<<"copying ("<<muon.recHitsSize()<<") muon recHits";
429  //copy the muon rechit into the seed
430  for (trackingRecHit_iterator trit = muon.recHitsBegin(); trit!=muon.recHitsEnd();trit++) {
431  rhContainer.push_back( (*trit).get()->clone() ); }}
432 
433  if ( hit->isValid()) {
434  TrajectoryStateOnSurface upState(theUpdator->update(predState,*hit));
435 
437  LogDebug(theCategory)<<"state used to build a trajectory seed: \n"<<upState
438  <<"on detector: "<<gd->geographicalId().rawId();
439  //add the tracking rechit
440  if (theCopyMuonRecHit){
441  edm::LogError(theCategory)<<"not a bare seed and muon hits are copied. dumping the muon hits.";
442  rhContainer.clear();}
443  rhContainer.push_back(hit->hit()->clone());
444 
445  result.push_back(TrajectorySeed(PTSOD,rhContainer,direction));
446  }
447  else {
448  //rec hit is not valid. put a bare TrajectorySeed, only once !
449  if (!aBareTS){
450  aBareTS=true;
451 
453  LogDebug(theCategory)<<"state used to build a bare trajectory seed: \n"<<predState
454  <<"on detector: "<<gd->geographicalId().rawId();
455 
456  result.push_back(TrajectorySeed(PTSOD,rhContainer,direction));
457  }
458  }
459 
460  }
461 
462 
463  }
464  }
465  else{
466  //transform it into a PTrajectoryStateOnDet
467 
468  PTrajectoryStateOnDet const& PTSOD = trajectoryStateTransform::persistentState(compatible.front().second,compatible.front().first->geographicalId().rawId());
469  LogDebug(theCategory)<<"state used to build a bare trajectory seed: \n"<<compatible.front().second
470  <<"on detector: "<<compatible.front().first->geographicalId().rawId();
471 
473  if (theCopyMuonRecHit){
474  LogDebug(theCategory)<<"copying ("<<muon.recHitsSize()<<") muon recHits";
475  //copy the muon rechit into the seed
476  for (trackingRecHit_iterator trit = muon.recHitsBegin(); trit!=muon.recHitsEnd();trit++) {
477  rhContainer.push_back( (*trit).get()->clone() ); }}
478 
479  //add this seed to the list and return it
480  result.push_back(TrajectorySeed(PTSOD,rhContainer,direction));
481  }
482  return;
483 }
#define LogDebug(id)
MeasurementDetWithData idToDet(const DetId &id) const
Previous MeasurementDetSystem interface.
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:68
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
std::string theCategory
void push_back(D *&d)
Definition: OwnVector.h:273
std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &tsos2, const Propagator &prop, const MeasurementEstimator &est) const
tuple result
Definition: query.py:137
void clear()
Definition: OwnVector.h:370
Chi2MeasurementEstimator * theChi2Estimator
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:62
const MuonServiceProxy * theProxyService
const MeasurementTrackerEvent * theMeasurementTrackerEvent
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:64
void TSGForRoadSearch::setEvent ( const edm::Event event)
virtual

set the event: update the MeasurementTracker

Reimplemented from TrackerSeedGenerator.

Definition at line 67 of file TSGForRoadSearch.cc.

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

67  {
68  //get the measurementtracker
69  if (theManySeeds){
71  if (!theMeasurementTracker.isValid())/*abort*/{edm::LogError(theCategory)<<"measurement tracker geometry not found ";}
72  }
74 
76  event.getByLabel(theMeasurementTrackerEventTag, data);
78 }
edm::InputTag theMeasurementTrackerEventTag
const edm::EventSetup & eventSetup() const
get the whole EventSetup
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
edm::ESHandle< MeasurementTracker > theMeasurementTracker
std::string theCategory
const MuonServiceProxy * theProxyService
const MeasurementTrackerEvent * theMeasurementTrackerEvent
const T & get() const
Definition: EventSetup.h:55
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
bool isValid() const
Definition: ESHandle.h:37
void TSGForRoadSearch::trackerSeeds ( const TrackCand ,
const TrackingRegion ,
const TrackerTopology ,
BTSeedCollection  
)
virtual

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

Reimplemented from TrackerSeedGenerator.

Definition at line 82 of file TSGForRoadSearch.cc.

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

83  {
84  switch (theOption){
85  case 0:
86  makeSeeds_0(*muonTrackCand.second,result);break;
87  case 1:
88  makeSeeds_1(*muonTrackCand.second,result);break;
89  case 2:
90  makeSeeds_2(*muonTrackCand.second,result);break;
91  case 3:
92  makeSeeds_3(*muonTrackCand.second,result);break;
93  case 4:
94  makeSeeds_4(*muonTrackCand.second,result);break;
95  }
96 }
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 84 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 88 of file TSGForRoadSearch.h.

bool TSGForRoadSearch::theCopyMuonRecHit
private

Definition at line 100 of file TSGForRoadSearch.h.

Referenced by pushTrajectorySeed(), and TSGForRoadSearch().

MuonErrorMatrix* TSGForRoadSearch::theErrorMatrixAdjuster
private

Definition at line 109 of file TSGForRoadSearch.h.

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

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

Definition at line 91 of file TSGForRoadSearch.h.

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

bool TSGForRoadSearch::theManySeeds
private

Definition at line 101 of file TSGForRoadSearch.h.

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

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

Definition at line 90 of file TSGForRoadSearch.h.

Referenced by setEvent().

const MeasurementTrackerEvent* TSGForRoadSearch::theMeasurementTrackerEvent
private

Definition at line 94 of file TSGForRoadSearch.h.

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

edm::InputTag TSGForRoadSearch::theMeasurementTrackerEventTag
private

Definition at line 93 of file TSGForRoadSearch.h.

Referenced by setEvent(), and TSGForRoadSearch().

unsigned int TSGForRoadSearch::theOption
private

Definition at line 99 of file TSGForRoadSearch.h.

Referenced by trackerSeeds(), and TSGForRoadSearch().

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

Definition at line 103 of file TSGForRoadSearch.h.

std::string TSGForRoadSearch::thePropagatorCompatibleName
private
std::string TSGForRoadSearch::thePropagatorName
private

Definition at line 102 of file TSGForRoadSearch.h.

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

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

Definition at line 105 of file TSGForRoadSearch.h.

const MuonServiceProxy* TSGForRoadSearch::theProxyService
private
TrajectoryStateUpdator* TSGForRoadSearch::theUpdator
private

Definition at line 96 of file TSGForRoadSearch.h.

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