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)
 
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 43 of file TSGForRoadSearch.h.

Member Typedef Documentation

Definition at line 46 of file TSGForRoadSearch.h.

Definition at line 47 of file TSGForRoadSearch.h.

Constructor & Destructor Documentation

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

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, 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 }
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:48
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 53 of file TSGForRoadSearch.cc.

References theChi2Estimator, theErrorMatrixAdjuster, and theUpdator.

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

References theProxyService.

60  {
61  theProxyService = service;
62 }
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 100 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().

100  {
101 
103  LogDebug(theCategory)<<"pure L2 state: "<<fts;
104  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.";
105  return false;}
106 
107  //rescale the error at IP
109  LogDebug(theCategory)<<"after adjusting the error matrix: "<<fts;}
110 
111  return true;
112 }
#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 117 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().

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

References theCategory.

Referenced by trackerSeeds().

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

not implemented

Definition at line 184 of file TSGForRoadSearch.cc.

References theCategory.

Referenced by trackerSeeds().

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

outside-in: outermost Strip layer

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

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

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

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

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

91  {
92  LogDebug(theCategory)<<"outer state: "<<state;
95  LogDebug(theCategory)<<"outer state after rescale: "<<state;
96  }
97  return true;
98 }
#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 398 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().

398  {
399 
400  if (compatible.empty()){
401  LogDebug(theCategory)<<"pushTrajectorySeed with no compatible module. 0 seed.";
402  return;}
403 
404  if (theManySeeds){
405 
406 
407  //finf out every compatible measurements
408  for (std::vector<DetLayer::DetWithState >::iterator DWSit = compatible.begin(); DWSit!=compatible.end();++DWSit){
409  bool aBareTS=false;
410  const GeomDet * gd = DWSit->first;
411  if (!gd){edm::LogError(theCategory)<<"GeomDet is not valid."; continue;}
412  const MeasurementDet * md= theMeasurementTracker->idToDet(gd->geographicalId());
413  std::vector<TrajectoryMeasurement> tmp = md->fastMeasurements(DWSit->second,DWSit->second,*theProxyService->propagator(thePropagatorCompatibleName),*theChi2Estimator);
414  //make a trajectory seed for each of them
415 
416  for (std::vector<TrajectoryMeasurement>::iterator Mit = tmp.begin(); Mit!=tmp.end();++Mit){
417  TrajectoryStateOnSurface predState(Mit->predictedState());
420  if (theCopyMuonRecHit){
421  LogDebug(theCategory)<<"copying ("<<muon.recHitsSize()<<") muon recHits";
422  //copy the muon rechit into the seed
423  for (trackingRecHit_iterator trit = muon.recHitsBegin(); trit!=muon.recHitsEnd();trit++) {
424  rhContainer.push_back( (*trit).get()->clone() ); }}
425 
426  if ( hit->isValid()) {
427  TrajectoryStateOnSurface upState(theUpdator->update(predState,*hit));
428 
430  LogDebug(theCategory)<<"state used to build a trajectory seed: \n"<<upState
431  <<"on detector: "<<gd->geographicalId().rawId();
432  //add the tracking rechit
433  if (theCopyMuonRecHit){
434  edm::LogError(theCategory)<<"not a bare seed and muon hits are copied. dumping the muon hits.";
435  rhContainer.clear();}
436  rhContainer.push_back(hit->hit()->clone());
437 
438  result.push_back(TrajectorySeed(PTSOD,rhContainer,direction));
439  }
440  else {
441  //rec hit is not valid. put a bare TrajectorySeed, only once !
442  if (!aBareTS){
443  aBareTS=true;
444 
446  LogDebug(theCategory)<<"state used to build a bare trajectory seed: \n"<<predState
447  <<"on detector: "<<gd->geographicalId().rawId();
448 
449  result.push_back(TrajectorySeed(PTSOD,rhContainer,direction));
450  }
451  }
452 
453  }
454 
455 
456  }
457  }
458  else{
459  //transform it into a PTrajectoryStateOnDet
460 
461  PTrajectoryStateOnDet const& PTSOD = trajectoryStateTransform::persistentState(compatible.front().second,compatible.front().first->geographicalId().rawId());
462  LogDebug(theCategory)<<"state used to build a bare trajectory seed: \n"<<compatible.front().second
463  <<"on detector: "<<compatible.front().first->geographicalId().rawId();
464 
466  if (theCopyMuonRecHit){
467  LogDebug(theCategory)<<"copying ("<<muon.recHitsSize()<<") muon recHits";
468  //copy the muon rechit into the seed
469  for (trackingRecHit_iterator trit = muon.recHitsBegin(); trit!=muon.recHitsEnd();trit++) {
470  rhContainer.push_back( (*trit).get()->clone() ); }}
471 
472  //add this seed to the list and return it
473  result.push_back(TrajectorySeed(PTSOD,rhContainer,direction));
474  }
475  return;
476 }
#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)
std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &est) const
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
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 64 of file TSGForRoadSearch.cc.

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

64  {
65  //get the measurementtracker
66  if (theManySeeds){
68  if (!theMeasurementTracker.isValid())/*abort*/{edm::LogError(theCategory)<<"measurement tracker geometry not found ";}
69  }
71 }
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 ,
const TrackerTopology ,
BTSeedCollection  
)
virtual

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

Reimplemented from TrackerSeedGenerator.

Definition at line 75 of file TSGForRoadSearch.cc.

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

76  {
77  switch (theOption){
78  case 0:
79  makeSeeds_0(*muonTrackCand.second,result);break;
80  case 1:
81  makeSeeds_1(*muonTrackCand.second,result);break;
82  case 2:
83  makeSeeds_2(*muonTrackCand.second,result);break;
84  case 3:
85  makeSeeds_3(*muonTrackCand.second,result);break;
86  case 4:
87  makeSeeds_4(*muonTrackCand.second,result);break;
88  }
89 }
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 81 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 85 of file TSGForRoadSearch.h.

bool TSGForRoadSearch::theCopyMuonRecHit
private

Definition at line 94 of file TSGForRoadSearch.h.

Referenced by pushTrajectorySeed(), and TSGForRoadSearch().

MuonErrorMatrix* TSGForRoadSearch::theErrorMatrixAdjuster
private

Definition at line 103 of file TSGForRoadSearch.h.

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

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

Definition at line 88 of file TSGForRoadSearch.h.

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

bool TSGForRoadSearch::theManySeeds
private

Definition at line 95 of file TSGForRoadSearch.h.

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

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

Definition at line 87 of file TSGForRoadSearch.h.

Referenced by pushTrajectorySeed(), and setEvent().

unsigned int TSGForRoadSearch::theOption
private

Definition at line 93 of file TSGForRoadSearch.h.

Referenced by trackerSeeds(), and TSGForRoadSearch().

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

Definition at line 97 of file TSGForRoadSearch.h.

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

Definition at line 96 of file TSGForRoadSearch.h.

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

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

Definition at line 99 of file TSGForRoadSearch.h.

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

Definition at line 90 of file TSGForRoadSearch.h.

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