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
 
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 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
 
ConstReferenceCountingPointer
< TransientTrackingRecHit
theHit
 

Detailed Description

Definition at line 19 of file TrajectoryAtInvalidHit.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file TrajectoryAtInvalidHit.cc.

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

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

Member Function Documentation

double TrajectoryAtInvalidHit::globalX ( ) const

Definition at line 166 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 170 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 174 of file TrajectoryAtInvalidHit.cc.

175 {
176  return globZ;
177 }
bool TrajectoryAtInvalidHit::isDoubleSided ( unsigned int  iidd) const

Definition at line 194 of file TrajectoryAtInvalidHit.cc.

References TOBDetId::layer(), TIBDetId::layer(), TIDDetId::ring(), TECDetId::ring(), strip(), DetId::subdetId(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.

194  {
196  unsigned int subid=strip.subdetId();
197  unsigned int layer = 0;
198  if (subid == StripSubdetector::TIB) {
199  TIBDetId tibid(iidd);
200  layer = tibid.layer();
201  if (layer == 1 || layer == 2) return true;
202  else return false;
203  }
204  else if (subid == StripSubdetector::TOB) {
205  TOBDetId tobid(iidd);
206  layer = tobid.layer() + 4 ;
207  if (layer == 5 || layer == 6) return true;
208  else return false;
209  }
210  else if (subid == StripSubdetector::TID) {
211  TIDDetId tidid(iidd);
212  layer = tidid.ring() + 10;
213  if (layer == 11 || layer == 12) return true;
214  else return false;
215  }
216  else if (subid == StripSubdetector::TEC) {
217  TECDetId tecid(iidd);
218  layer = tecid.ring() + 13 ;
219  if (layer == 14 || layer == 15 || layer == 18) return true;
220  else return false;
221  }
222  else
223  return false;
224 }
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
double TrajectoryAtInvalidHit::localDxDz ( ) const

Definition at line 160 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 163 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 152 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 156 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 140 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 144 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 148 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 179 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 226 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 189 of file TrajectoryAtInvalidHit.cc.

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

Definition at line 184 of file TrajectoryAtInvalidHit.cc.

185 {
186  return acceptance;
187 }

Member Data Documentation

bool TrajectoryAtInvalidHit::acceptance
private

Definition at line 56 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::globX
private

Definition at line 54 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::globY
private

Definition at line 54 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::globZ
private

Definition at line 54 of file TrajectoryAtInvalidHit.h.

bool TrajectoryAtInvalidHit::hasValidHit
private

Definition at line 57 of file TrajectoryAtInvalidHit.h.

unsigned int TrajectoryAtInvalidHit::iidd
private

Definition at line 55 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::locDxDz
private

Definition at line 53 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::locDyDz
private

Definition at line 53 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::locX
private

Definition at line 51 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::locXError
private

Definition at line 52 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::locY
private

Definition at line 51 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::locYError
private

Definition at line 52 of file TrajectoryAtInvalidHit.h.

float TrajectoryAtInvalidHit::locZ
private

Definition at line 51 of file TrajectoryAtInvalidHit.h.

TrajectoryStateOnSurface TrajectoryAtInvalidHit::theCombinedPredictedState
private

Definition at line 50 of file TrajectoryAtInvalidHit.h.

ConstReferenceCountingPointer<TransientTrackingRecHit> TrajectoryAtInvalidHit::theHit
private

Definition at line 59 of file TrajectoryAtInvalidHit.h.