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 19 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(), max(), bookConverter::min, GluedGeomDet::monoDet(), Propagator::propagate(), DetId::rawId(), TrajectoryMeasurement::recHit(), mathSSE::sqrt(), GluedGeomDet::stereoDet(), DetId::subdetId(), GeomDet::surface(), and StripSubdetector::TOB.

24 {
25  if ( tm.backwardPredictedState().isValid() )
28  else
30 
32  return;
33  }
34  theHit = tm.recHit();
35  iidd = theHit->geographicalId().rawId();
37  unsigned int subid=strip.subdetId();
38  // xB and yB are for absolute borders on the trajectories included in the study, sigmaX sigmaY are
39  // significance cuts on the distance from the detector surface
40  float xB = 0.; float sigmaX = 5.0;
41  float yB = 0.; float sigmaY = 5.0;
42  float sigmaYBond = 0.;
43  //set bounds for point to be within to be counted in the study
44  if (subid == StripSubdetector::TOB) {
45  sigmaYBond = 5.0;
46  }
47  const GeomDetUnit * monodet;
48 
49  // if module is from a double sided layer, write out info for either the
50  // rphi surface (mono = 1) or the stereo surface (mono = 2)--not the matched hit surface
51  if (( mono > 0 ) && isDoubleSided(iidd, tTopo) ) {
52  // find matched det id, that is the matched hit surface between the two sensors
53  unsigned int matched_iidd = iidd-(iidd & 0x3);
54  DetId matched_id(matched_iidd);
55 
56  GluedGeomDet * gdet=(GluedGeomDet *)tracker->idToDet(matched_id);
57 
58  // get the sensor det indicated by mono
59  if (mono == 1) monodet=gdet->stereoDet();
60  else monodet=gdet->monoDet(); // this should only be mono == 2
61 
62  // set theCombinedPredictedState to be on the sensor surface, not the matched surface
63  DetId mono_id = monodet->geographicalId();
64  const Surface &surface = tracker->idToDet(mono_id)->surface();
66  surface);
67 
69  cout << "found invalid combinedpredictedstate after propagation"<< endl;
70  return;
71  }
72 
73  //check if hit on trajectory is valid for this sensor
74  if ((iidd & 0x3)==0) {
75  // passed id is on matched surface (ie neither rphi, nor stereo surface)
76  // so the rechits on both sensors should be invalid
77  hasValidHit = theHit->isValid();
78  //cout << "should always be invalid = " << theHit->isValid() << endl;
79  } else {
80  if (iidd==mono_id) {
81  //mono sensor for this TrajAtInvalidHit is same as originally passed in from trajectory
82  //normally should only happen for valid hits, but sometimes is invalid
83  hasValidHit = theHit->isValid();
84  //cout << "check always true = " << theHit->isValid() << endl;
85  } else {
86  // mono sensor for this TrajAtInvalidHit is not as originally passed in from trajectory
87  // so this is a partner missing from the trajectory and is thus invalid
88  hasValidHit = false;
89  //cout << "setting invalid by fiat" << endl;
90  }
91  }
92 
93  //set module id to be mono det
94  iidd = monodet->geographicalId().rawId();
95  } else {
96  monodet = (GeomDetUnit*)theHit->det();
97  hasValidHit = theHit->isValid();
98  }
99 
110 
111  // this should never be a glued det, only rphi or stero
112  //cout << "From TrajAtValidHit module " << iidd << " matched/stereo/rphi = " << ((iidd & 0x3)==0) << "/" << ((iidd & 0x3)==1) << "/" << ((iidd & 0x3)==2) << endl;
113 
114  // Restrict the bound regions for better understanding of the modul assignment.
115 
116  LocalPoint BoundedPoint;
117  float xx, yy ,zz;
118 
119  // Insert the bounded values
120  if (locX < 0. ) xx = min(locX - xB,locX - sigmaX*locXError);
121  else xx = max(locX + xB, locX + sigmaX*locXError);
122 
123  if (locY < 0. ) yy = min(locY - yB,locY - sigmaY*locYError);
124  else yy = max(locY + yB, locY + sigmaY*locYError);
125 
127 
128  BoundedPoint = LocalPoint(xx,yy,zz);
129 
130  if ( monodet->surface().bounds().inside(BoundedPoint) && abs(locY) > sigmaYBond*locYError ){
131  acceptance = true;
132  }
133  else {
134  // hit is within xB, yB from the edge of the detector, so throw it out
135  acceptance = false;
136  }
137 }
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:128
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
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
const T & max(const T &a, const T &b)
T sqrt(T t)
Definition: SSEVec.h:48
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:72
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
virtual const GeomDet * idToDet(DetId) const
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:56
TrackingRecHit::ConstRecHitPointer theHit
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:121
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)

Member Function Documentation

double TrajectoryAtInvalidHit::globalX ( ) const

Definition at line 165 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 169 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 173 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 193 of file TrajectoryAtInvalidHit.cc.

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

193  {
195  unsigned int subid=strip.subdetId();
196  unsigned int layer = 0;
197  if (subid == StripSubdetector::TIB) {
198 
199  layer = tTopo->tibLayer(iidd);
200  if (layer == 1 || layer == 2) return true;
201  else return false;
202  }
203  else if (subid == StripSubdetector::TOB) {
204 
205  layer = tTopo->tobLayer(iidd) + 4 ;
206  if (layer == 5 || layer == 6) return true;
207  else return false;
208  }
209  else if (subid == StripSubdetector::TID) {
210 
211  layer = tTopo->tidRing(iidd) + 10;
212  if (layer == 11 || layer == 12) return true;
213  else return false;
214  }
215  else if (subid == StripSubdetector::TEC) {
216 
217  layer = tTopo->tecRing(iidd) + 13 ;
218  if (layer == 14 || layer == 15 || layer == 18) return true;
219  else return false;
220  }
221  else
222  return false;
223 }
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 159 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 162 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 151 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 155 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 139 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 143 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 147 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 178 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 225 of file TrajectoryAtInvalidHit.cc.

225  {
227 }
TrajectoryStateOnSurface theCombinedPredictedState
bool TrajectoryAtInvalidHit::validHit ( ) const

Definition at line 188 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 183 of file TrajectoryAtInvalidHit.cc.

184 {
185  return acceptance;
186 }

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.