CMS 3D CMS Logo

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

#include <TrajectoryAtInvalidHit.h>

Public Member Functions

double globalX () const
 
double globalY () const
 
double globalZ () const
 
bool isDoubleSided (unsigned int iidd, const TrackerTopology *tTopo) const
 
double localDxDz () const
 
double localDyDz () const
 
double localErrorX () const
 
double localErrorY () const
 
double localX () const
 
double localY () const
 
double localZ () const
 
unsigned int monodet_id () const
 
 TrajectoryAtInvalidHit (const TrajectoryMeasurement &, const TrackerTopology *tTopo, const TrackerGeometry *tracker, const Propagator &propagator, const unsigned int mono=0)
 
TrajectoryStateOnSurface tsos () const
 
bool validHit () const
 
bool withinAcceptance () const
 

Private Attributes

bool acceptance
 
float globX
 
float globY
 
float globZ
 
bool hasValidHit
 
unsigned int iidd
 
float locDxDz
 
float locDyDz
 
float locX
 
float locXError
 
float locY
 
float locYError
 
float locZ
 
TrajectoryStateOnSurface theCombinedPredictedState
 
TrackingRecHit::ConstRecHitPointer theHit
 

Detailed Description

Definition at line 21 of file TrajectoryAtInvalidHit.h.

Constructor & Destructor Documentation

TrajectoryAtInvalidHit::TrajectoryAtInvalidHit ( const TrajectoryMeasurement tm,
const TrackerTopology tTopo,
const TrackerGeometry tracker,
const Propagator propagator,
const unsigned int  mono = 0 
)

Definition at line 18 of file TrajectoryAtInvalidHit.cc.

References funct::abs(), TrajectoryMeasurement::backwardPredictedState(), Surface::bounds(), TrajectoryStateCombiner::combine(), gather_cfg::cout, TrajectoryMeasurement::forwardPredictedState(), GeomDet::geographicalId(), TrackerGeometry::idToDet(), Bounds::inside(), TrajectoryStateOnSurface::isValid(), bookConverter::max, min(), GluedGeomDet::monoDet(), Propagator::propagate(), DetId::rawId(), TrajectoryMeasurement::recHit(), mathSSE::sqrt(), GluedGeomDet::stereoDet(), DetId::subdetId(), GeomDet::surface(), and StripSubdetector::TOB.

23 {
24  if ( tm.backwardPredictedState().isValid() )
27  else
29 
31  return;
32  }
33  theHit = tm.recHit();
34  iidd = theHit->geographicalId().rawId();
36  unsigned int subid=strip.subdetId();
37  // xB and yB are for absolute borders on the trajectories included in the study, sigmaX sigmaY are
38  // significance cuts on the distance from the detector surface
39  float xB = 0.; float sigmaX = 5.0;
40  float yB = 0.; float sigmaY = 5.0;
41  float sigmaYBond = 0.;
42  //set bounds for point to be within to be counted in the study
43  if (subid == StripSubdetector::TOB) {
44  sigmaYBond = 5.0;
45  }
46  const GeomDetUnit * monodet;
47 
48  // if module is from a double sided layer, write out info for either the
49  // rphi surface (mono = 1) or the stereo surface (mono = 2)--not the matched hit surface
50  if (( mono > 0 ) && isDoubleSided(iidd, tTopo) ) {
51  // find matched det id, that is the matched hit surface between the two sensors
52  unsigned int matched_iidd = iidd-(iidd & 0x3);
53  DetId matched_id(matched_iidd);
54 
55  GluedGeomDet * gdet=(GluedGeomDet *)tracker->idToDet(matched_id);
56 
57  // get the sensor det indicated by mono
58  if (mono == 1) monodet=gdet->stereoDet();
59  else monodet=gdet->monoDet(); // this should only be mono == 2
60 
61  // set theCombinedPredictedState to be on the sensor surface, not the matched surface
62  DetId mono_id = monodet->geographicalId();
63  const Surface &surface = tracker->idToDet(mono_id)->surface();
65  surface);
66 
68  cout << "found invalid combinedpredictedstate after propagation"<< endl;
69  return;
70  }
71 
72  //check if hit on trajectory is valid for this sensor
73  if ((iidd & 0x3)==0) {
74  // passed id is on matched surface (ie neither rphi, nor stereo surface)
75  // so the rechits on both sensors should be invalid
76  hasValidHit = theHit->isValid();
77  //cout << "should always be invalid = " << theHit->isValid() << endl;
78  } else {
79  if (iidd==mono_id) {
80  //mono sensor for this TrajAtInvalidHit is same as originally passed in from trajectory
81  //normally should only happen for valid hits, but sometimes is invalid
82  hasValidHit = theHit->isValid();
83  //cout << "check always true = " << theHit->isValid() << endl;
84  } else {
85  // mono sensor for this TrajAtInvalidHit is not as originally passed in from trajectory
86  // so this is a partner missing from the trajectory and is thus invalid
87  hasValidHit = false;
88  //cout << "setting invalid by fiat" << endl;
89  }
90  }
91 
92  //set module id to be mono det
93  iidd = monodet->geographicalId().rawId();
94  } else {
95  monodet = (GeomDetUnit*)theHit->det();
96  hasValidHit = theHit->isValid();
97  }
98 
109 
110  // this should never be a glued det, only rphi or stero
111  //cout << "From TrajAtValidHit module " << iidd << " matched/stereo/rphi = " << ((iidd & 0x3)==0) << "/" << ((iidd & 0x3)==1) << "/" << ((iidd & 0x3)==2) << endl;
112 
113  // Restrict the bound regions for better understanding of the modul assignment.
114 
115  LocalPoint BoundedPoint;
116  float xx, yy ,zz;
117 
118  // Insert the bounded values
119  if (locX < 0. ) xx = min(locX - xB,locX - sigmaX*locXError);
120  else xx = max(locX + xB, locX + sigmaX*locXError);
121 
122  if (locY < 0. ) yy = min(locY - yB,locY - sigmaY*locYError);
123  else yy = max(locY + yB, locY + sigmaY*locYError);
124 
126 
127  BoundedPoint = LocalPoint(xx,yy,zz);
128 
129  if ( monodet->surface().bounds().inside(BoundedPoint) && abs(locY) > sigmaYBond*locYError ){
130  acceptance = true;
131  }
132  else {
133  // hit is within xB, yB from the edge of the detector, so throw it out
134  acceptance = false;
135  }
136 }
float xx() const
Definition: LocalError.h:24
ConstRecHitPointer const & recHit() const
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:20
const LocalTrajectoryParameters & localParameters() const
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
TSOS combine(const TSOS &pTsos1, const TSOS &pTsos2) const
TrajectoryStateOnSurface theCombinedPredictedState
T y() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
const Bounds & bounds() const
Definition: Surface.h:120
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
LocalError positionError() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
AlgebraicVector5 vector() const
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
T min(T a, T b)
Definition: MathUtil.h:58
const LocalTrajectoryError & localError() const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
bool isDoubleSided(unsigned int iidd, const TrackerTopology *tTopo) const
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
Definition: DetId.h:18
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
TrackingRecHit::ConstRecHitPointer theHit
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:145
T x() const
Definition: PV3DBase.h:62
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:21
TrajectoryStateOnSurface const & backwardPredictedState() const
Access to backward predicted state (from smoother)
virtual const TrackerGeomDet * idToDet(DetId) const

Member Function Documentation

double TrajectoryAtInvalidHit::globalX ( ) const

Definition at line 164 of file TrajectoryAtInvalidHit.cc.

165 {
166  return globX;
167 }
double TrajectoryAtInvalidHit::globalY ( ) const

Definition at line 168 of file TrajectoryAtInvalidHit.cc.

169 {
170  return globY;
171 }
double TrajectoryAtInvalidHit::globalZ ( ) const

Definition at line 172 of file TrajectoryAtInvalidHit.cc.

173 {
174  return globZ;
175 }
bool TrajectoryAtInvalidHit::isDoubleSided ( unsigned int  iidd,
const TrackerTopology tTopo 
) const

Definition at line 192 of file TrajectoryAtInvalidHit.cc.

References DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecRing(), StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TrackerTopology::tidRing(), StripSubdetector::TOB, and TrackerTopology::tobLayer().

192  {
194  unsigned int subid=strip.subdetId();
195  unsigned int layer = 0;
196  if (subid == StripSubdetector::TIB) {
197 
198  layer = tTopo->tibLayer(iidd);
199  if (layer == 1 || layer == 2) return true;
200  else return false;
201  }
202  else if (subid == StripSubdetector::TOB) {
203 
204  layer = tTopo->tobLayer(iidd) + 4 ;
205  if (layer == 5 || layer == 6) return true;
206  else return false;
207  }
208  else if (subid == StripSubdetector::TID) {
209 
210  layer = tTopo->tidRing(iidd) + 10;
211  if (layer == 11 || layer == 12) return true;
212  else return false;
213  }
214  else if (subid == StripSubdetector::TEC) {
215 
216  layer = tTopo->tecRing(iidd) + 13 ;
217  if (layer == 14 || layer == 15 || layer == 18) return true;
218  else return false;
219  }
220  else
221  return false;
222 }
unsigned int tibLayer(const DetId &id) const
unsigned int tidRing(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
unsigned int tobLayer(const DetId &id) const
double TrajectoryAtInvalidHit::localDxDz ( ) const

Definition at line 158 of file TrajectoryAtInvalidHit.cc.

158  {
159  return locDxDz;
160 }
double TrajectoryAtInvalidHit::localDyDz ( ) const

Definition at line 161 of file TrajectoryAtInvalidHit.cc.

161  {
162  return locDyDz;
163 }
double TrajectoryAtInvalidHit::localErrorX ( ) const

Definition at line 150 of file TrajectoryAtInvalidHit.cc.

151 {
152  return locXError;
153 }
double TrajectoryAtInvalidHit::localErrorY ( ) const

Definition at line 154 of file TrajectoryAtInvalidHit.cc.

155 {
156  return locYError;
157 }
double TrajectoryAtInvalidHit::localX ( ) const

Definition at line 138 of file TrajectoryAtInvalidHit.cc.

139 {
140  return locX;
141 }
double TrajectoryAtInvalidHit::localY ( ) const

Definition at line 142 of file TrajectoryAtInvalidHit.cc.

143 {
144  return locY;
145 }
double TrajectoryAtInvalidHit::localZ ( ) const

Definition at line 146 of file TrajectoryAtInvalidHit.cc.

147 {
148  return locZ;
149 }
unsigned int TrajectoryAtInvalidHit::monodet_id ( ) const

Definition at line 177 of file TrajectoryAtInvalidHit.cc.

178 {
179  return iidd;
180 }
TrajectoryStateOnSurface TrajectoryAtInvalidHit::tsos ( ) const

Definition at line 224 of file TrajectoryAtInvalidHit.cc.

224  {
226 }
TrajectoryStateOnSurface theCombinedPredictedState
bool TrajectoryAtInvalidHit::validHit ( ) const

Definition at line 187 of file TrajectoryAtInvalidHit.cc.

188 {
189  return hasValidHit;
190 }
bool TrajectoryAtInvalidHit::withinAcceptance ( ) const

Definition at line 182 of file TrajectoryAtInvalidHit.cc.

183 {
184  return acceptance;
185 }

Member Data Documentation

bool TrajectoryAtInvalidHit::acceptance
private

Definition at line 59 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::globX
private

Definition at line 57 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::globY
private

Definition at line 57 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::globZ
private

Definition at line 57 of file TrajectoryAtInvalidHit.h.

bool TrajectoryAtInvalidHit::hasValidHit
private

Definition at line 60 of file TrajectoryAtInvalidHit.h.

unsigned int TrajectoryAtInvalidHit::iidd
private

Definition at line 58 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::locDxDz
private

Definition at line 56 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::locDyDz
private

Definition at line 56 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::locX
private

Definition at line 54 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::locXError
private

Definition at line 55 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::locY
private

Definition at line 54 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::locYError
private

Definition at line 55 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::locZ
private

Definition at line 54 of file TrajectoryAtInvalidHit.h.

TrajectoryStateOnSurface TrajectoryAtInvalidHit::theCombinedPredictedState
private

Definition at line 53 of file TrajectoryAtInvalidHit.h.

TrackingRecHit::ConstRecHitPointer TrajectoryAtInvalidHit::theHit
private

Definition at line 62 of file TrajectoryAtInvalidHit.h.