CMS 3D CMS Logo

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::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(), TrajectoryMeasurement::forwardPredictedState(), GeomDet::geographicalId(), Bounds::inside(), TrajectoryStateOnSurface::isValid(), SiStripPI::max, SiStripPI::min, GluedGeomDet::monoDet(), TrackCandidateProducer_cfi::propagator, DetId::rawId(), TrajectoryMeasurement::recHit(), beamSpotPI::sigmaX, beamSpotPI::sigmaY, mathSSE::sqrt(), GluedGeomDet::stereoDet(), nano_mu_digi_cff::strip, GeomDet::surface(), StripSubdetector::TOB, PbPb_ZMuSkimMuonDPG_cff::tracker, geometryCSVtoXML::xx, geometryCSVtoXML::yy, and geometryCSVtoXML::zz.

23  {
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.;
40  float sigmaX = 5.0;
41  float yB = 0.;
42  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, tTopo)) {
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  const GluedGeomDet* gdet = static_cast<const GluedGeomDet*>(tracker->idToDet(matched_id));
58 
59  // get the sensor det indicated by mono
60  if (mono == 1)
61  monodet = gdet->stereoDet();
62  else
63  monodet = gdet->monoDet(); // this should only be mono == 2
64 
65  // set theCombinedPredictedState to be on the sensor surface, not the matched surface
66  DetId mono_id = monodet->geographicalId();
67  const Surface& surface = tracker->idToDet(mono_id)->surface();
69 
71  edm::LogWarning("TrajectoryAtInvalidHit") << "found invalid combinedpredictedstate after propagation" << endl;
72  return;
73  }
74 
75  //check if hit on trajectory is valid for this sensor
76  if ((iidd & 0x3) == 0) {
77  // passed id is on matched surface (ie neither rphi, nor stereo surface)
78  // so the rechits on both sensors should be invalid
79  hasValidHit = theHit->isValid();
80  //cout << "should always be invalid = " << theHit->isValid() << endl;
81  } else {
82  if (iidd == mono_id) {
83  //mono sensor for this TrajAtInvalidHit is same as originally passed in from trajectory
84  //normally should only happen for valid hits, but sometimes is invalid
85  hasValidHit = theHit->isValid();
86  //cout << "check always true = " << theHit->isValid() << endl;
87  } else {
88  // mono sensor for this TrajAtInvalidHit is not as originally passed in from trajectory
89  // so this is a partner missing from the trajectory and is thus invalid
90  hasValidHit = false;
91  //cout << "setting invalid by fiat" << endl;
92  }
93  }
94 
95  //set module id to be mono det
96  iidd = monodet->geographicalId().rawId();
97  } else {
98  monodet = theHit->det();
99  hasValidHit = theHit->isValid();
100  }
101 
112 
113  // this should never be a glued det, only rphi or stero
114  //cout << "From TrajAtValidHit module " << iidd << " matched/stereo/rphi = " << ((iidd & 0x3)==0) << "/" << ((iidd & 0x3)==1) << "/" << ((iidd & 0x3)==2) << endl;
115 
116  // Restrict the bound regions for better understanding of the modul assignment.
117 
118  LocalPoint BoundedPoint;
119  float xx, yy, zz;
120 
121  // Insert the bounded values
122  if (locX < 0.)
123  xx = min(locX - xB, locX - sigmaX * locXError);
124  else
125  xx = max(locX + xB, locX + sigmaX * locXError);
126 
127  if (locY < 0.)
128  yy = min(locY - yB, locY - sigmaY * locYError);
129  else
130  yy = max(locY + yB, locY + sigmaY * locYError);
131 
133 
134  BoundedPoint = LocalPoint(xx, yy, zz);
135 
136  if (monodet->surface().bounds().inside(BoundedPoint) && abs(locY) > sigmaYBond * locYError) {
137  acceptance = true;
138  } else {
139  // hit is within xB, yB from the edge of the detector, so throw it out
140  acceptance = false;
141  }
142 }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
const LocalTrajectoryError & localError() const
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
T z() const
Definition: PV3DBase.h:61
TrajectoryStateOnSurface theCombinedPredictedState
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
const LocalTrajectoryParameters & localParameters() const
LocalError positionError() const
float yy() const
Definition: LocalError.h:24
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
GlobalPoint globalPosition() const
T sqrt(T t)
Definition: SSEVec.h:19
AlgebraicVector5 vector() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TrajectoryStateOnSurface const & backwardPredictedState() const
Access to backward predicted state (from smoother)
static constexpr auto TOB
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:19
bool isDoubleSided(unsigned int iidd, const TrackerTopology *tTopo) const
Definition: DetId.h:17
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:20
TrackingRecHit::ConstRecHitPointer theHit
Log< level::Warning, false > LogWarning
TSOS combine(const TSOS &pTsos1, const TSOS &pTsos2) const
float xx() const
Definition: LocalError.h:22
ConstRecHitPointer const & recHit() const
const Bounds & bounds() const
Definition: Surface.h:87

Member Function Documentation

◆ globalX()

double TrajectoryAtInvalidHit::globalX ( ) const

Definition at line 151 of file TrajectoryAtInvalidHit.cc.

Referenced by SiStripHitEfficiencyWorker::fillForTraj().

151 { return globX; }

◆ globalY()

double TrajectoryAtInvalidHit::globalY ( ) const

Definition at line 152 of file TrajectoryAtInvalidHit.cc.

Referenced by SiStripHitEfficiencyWorker::fillForTraj().

152 { return globY; }

◆ globalZ()

double TrajectoryAtInvalidHit::globalZ ( ) const

Definition at line 153 of file TrajectoryAtInvalidHit.cc.

Referenced by SiStripHitEfficiencyWorker::fillForTraj().

153 { return globZ; }

◆ isDoubleSided()

bool TrajectoryAtInvalidHit::isDoubleSided ( unsigned int  iidd,
const TrackerTopology tTopo 
) const

Definition at line 161 of file TrajectoryAtInvalidHit.cc.

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

161  {
163  unsigned int subid = strip.subdetId();
164  unsigned int layer = 0;
165  if (subid == StripSubdetector::TIB) {
166  layer = tTopo->tibLayer(iidd);
167  if (layer == 1 || layer == 2)
168  return true;
169  else
170  return false;
171  } else if (subid == StripSubdetector::TOB) {
172  layer = tTopo->tobLayer(iidd) + 4;
173  if (layer == 5 || layer == 6)
174  return true;
175  else
176  return false;
177  } else if (subid == StripSubdetector::TID) {
178  layer = tTopo->tidRing(iidd) + 10;
179  if (layer == 11 || layer == 12)
180  return true;
181  else
182  return false;
183  } else if (subid == StripSubdetector::TEC) {
184  layer = tTopo->tecRing(iidd) + 13;
185  if (layer == 14 || layer == 15 || layer == 18)
186  return true;
187  else
188  return false;
189  } else
190  return false;
191 }
static constexpr auto TEC
unsigned int tobLayer(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
static constexpr auto TOB
static constexpr auto TIB
unsigned int tidRing(const DetId &id) const
unsigned int tibLayer(const DetId &id) const
static constexpr auto TID

◆ localDxDz()

double TrajectoryAtInvalidHit::localDxDz ( ) const

Definition at line 149 of file TrajectoryAtInvalidHit.cc.

149 { return locDxDz; }

◆ localDyDz()

double TrajectoryAtInvalidHit::localDyDz ( ) const

Definition at line 150 of file TrajectoryAtInvalidHit.cc.

150 { return locDyDz; }

◆ localErrorX()

double TrajectoryAtInvalidHit::localErrorX ( ) const

Definition at line 147 of file TrajectoryAtInvalidHit.cc.

Referenced by SiStripHitEfficiencyWorker::fillForTraj().

147 { return locXError; }

◆ localErrorY()

double TrajectoryAtInvalidHit::localErrorY ( ) const

Definition at line 148 of file TrajectoryAtInvalidHit.cc.

Referenced by SiStripHitEfficiencyWorker::fillForTraj().

148 { return locYError; }

◆ localX()

double TrajectoryAtInvalidHit::localX ( ) const

Definition at line 144 of file TrajectoryAtInvalidHit.cc.

Referenced by SiStripHitEfficiencyWorker::fillForTraj().

144 { return locX; }

◆ localY()

double TrajectoryAtInvalidHit::localY ( ) const

Definition at line 145 of file TrajectoryAtInvalidHit.cc.

Referenced by SiStripHitEfficiencyWorker::fillForTraj().

145 { return locY; }

◆ localZ()

double TrajectoryAtInvalidHit::localZ ( ) const

Definition at line 146 of file TrajectoryAtInvalidHit.cc.

146 { return locZ; }

◆ monodet_id()

unsigned int TrajectoryAtInvalidHit::monodet_id ( ) const

Definition at line 155 of file TrajectoryAtInvalidHit.cc.

Referenced by SiStripHitEfficiencyWorker::fillForTraj().

155 { return iidd; }

◆ tsos()

TrajectoryStateOnSurface TrajectoryAtInvalidHit::tsos ( ) const

Definition at line 193 of file TrajectoryAtInvalidHit.cc.

193 { return theCombinedPredictedState; }
TrajectoryStateOnSurface theCombinedPredictedState

◆ validHit()

bool TrajectoryAtInvalidHit::validHit ( ) const

Definition at line 159 of file TrajectoryAtInvalidHit.cc.

◆ withinAcceptance()

bool TrajectoryAtInvalidHit::withinAcceptance ( ) const

Member Data Documentation

◆ acceptance

bool TrajectoryAtInvalidHit::acceptance
private

Definition at line 57 of file TrajectoryAtInvalidHit.h.

◆ globX

float TrajectoryAtInvalidHit::globX
private

Definition at line 55 of file TrajectoryAtInvalidHit.h.

◆ globY

float TrajectoryAtInvalidHit::globY
private

Definition at line 55 of file TrajectoryAtInvalidHit.h.

◆ globZ

float TrajectoryAtInvalidHit::globZ
private

Definition at line 55 of file TrajectoryAtInvalidHit.h.

◆ hasValidHit

bool TrajectoryAtInvalidHit::hasValidHit
private

Definition at line 58 of file TrajectoryAtInvalidHit.h.

◆ iidd

unsigned int TrajectoryAtInvalidHit::iidd
private

Definition at line 56 of file TrajectoryAtInvalidHit.h.

◆ locDxDz

float TrajectoryAtInvalidHit::locDxDz
private

Definition at line 54 of file TrajectoryAtInvalidHit.h.

◆ locDyDz

float TrajectoryAtInvalidHit::locDyDz
private

Definition at line 54 of file TrajectoryAtInvalidHit.h.

◆ locX

float TrajectoryAtInvalidHit::locX
private

Definition at line 52 of file TrajectoryAtInvalidHit.h.

◆ locXError

float TrajectoryAtInvalidHit::locXError
private

Definition at line 53 of file TrajectoryAtInvalidHit.h.

◆ locY

float TrajectoryAtInvalidHit::locY
private

Definition at line 52 of file TrajectoryAtInvalidHit.h.

◆ locYError

float TrajectoryAtInvalidHit::locYError
private

Definition at line 53 of file TrajectoryAtInvalidHit.h.

◆ locZ

float TrajectoryAtInvalidHit::locZ
private

Definition at line 52 of file TrajectoryAtInvalidHit.h.

◆ theCombinedPredictedState

TrajectoryStateOnSurface TrajectoryAtInvalidHit::theCombinedPredictedState
private

Definition at line 51 of file TrajectoryAtInvalidHit.h.

◆ theHit

TrackingRecHit::ConstRecHitPointer TrajectoryAtInvalidHit::theHit
private

Definition at line 60 of file TrajectoryAtInvalidHit.h.