71 const std::vector<TrajectoryMeasurement> &tmColl = trajectory->
measurements();
72 for(std::vector<TrajectoryMeasurement>::const_iterator itTraj = tmColl.begin();
73 itTraj != tmColl.end();
76 if (!itTraj->updatedState().isValid())
continue;
82 if(!hit->isValid() || hit->geographicalId().det() !=
DetId::Tracker)
continue;
85 const DetId& hit_detId = hit->geographicalId();
86 unsigned int IntRawDetID = (hit_detId.
rawId());
87 unsigned int IntSubDetID = (hit_detId.
subdetId());
89 if(IntSubDetID == 0)
continue;
100 LocalError errHit = hit->localPositionError();
108 if(errHit.xx()<0. || errHit.yy()<0. || errTrk.
xx()<0. || errTrk.
yy()<0.){
109 edm::LogError(
"TrackerValidationVariables") <<
"@SUB=TrackerValidationVariables::fillHitQuantities"
110 <<
"One of the squared error methods gives negative result"
111 <<
"\n\terrHit.xx()\terrHit.yy()\terrTrk.xx()\terrTrk.yy()"
112 <<
"\n\t" << errHit.xx()
113 <<
"\t" << errHit.yy()
114 <<
"\t" << errTrk.
xx()
115 <<
"\t" << errTrk.
yy();
121 float resXErr =
std::sqrt( errHit.xx() + errTrk.
xx() );
122 float resYErr =
std::sqrt( errHit.yy() + errTrk.
yy() );
124 hitStruct.
resX = res.
x();
125 hitStruct.
resY = res.
y();
136 float resXprime(999.
F), resYprime(999.
F);
137 float resXatTrkY(999.
F);
138 float resXprimeErr(999.
F), resYprimeErr(999.
F);
142 float uOrientation(-999.
F), vOrientation(-999.
F);
143 float resXTopol(999.
F), resYTopol(999.
F);
144 float resXatTrkYTopol(999.
F);
146 const Surface& surface = hit->detUnit()->surface();
147 const BoundPlane& boundplane = hit->detUnit()->surface();
148 const Bounds& bound = boundplane.bounds();
153 LocalPoint lPModule(0.,0.,0.), lUDirection(1.,0.,0.), lVDirection(0.,1.,0.);
155 gUDirection = surface.
toGlobal(lUDirection),
156 gVDirection = surface.
toGlobal(lVDirection);
162 uOrientation =
deltaPhi(gUDirection.barePhi(),gPModule.
barePhi()) >= 0. ? +1.
F : -1.
F;
163 vOrientation = gVDirection.z() - gPModule.
z() >= 0 ? +1.F : -1.F;
165 resXatTrkYTopol = res.
x();
167 resXprimeErr = resXErr;
168 resYprimeErr = resYErr;
171 if (rectangularBound!=
NULL) {
173 length = rectangularBound->
length();
174 width = rectangularBound->
width();
179 <<
"[TrackerValidationVariables] Cannot cast bounds to RectangularPlaneBounds as expected for TPB, TIB and TOB";
184 uOrientation = gUDirection.perp() - gPModule.
perp() >= 0 ? +1.F : -1.F;
185 vOrientation =
deltaPhi(gVDirection.barePhi(),gPModule.
barePhi()) >= 0. ? +1.
F : -1.
F;
187 resXatTrkYTopol = res.
x();
189 resXprimeErr = resXErr;
190 resYprimeErr = resYErr;
193 if (rectangularBound!=
NULL) {
195 length = rectangularBound->
length();
196 width = rectangularBound->
width();
201 <<
"[TrackerValidationVariables] Cannot cast bounds to RectangularPlaneBounds as expected for TPE";
207 uOrientation =
deltaPhi(gUDirection.barePhi(),gPModule.
barePhi()) >= 0. ? +1.
F : -1.
F;
208 vOrientation = gVDirection.perp() - gPModule.
perp() >= 0. ? +1.F : -1.F;
210 if (!dynamic_cast<const RadialStripTopology*>(&detUnit.
type().
topology()))
continue;
219 if (measHitErr.
uu()<0. ||
220 measHitErr.
vv()<0. ||
221 measTrkErr.
uu()<0. ||
223 edm::LogError(
"TrackerValidationVariables") <<
"@SUB=TrackerValidationVariables::fillHitQuantities"
224 <<
"One of the squared error methods gives negative result"
225 <<
"\n\tmeasHitErr.uu()\tmeasHitErr.vv()\tmeasTrkErr.uu()\tmeasTrkErr.vv()"
226 <<
"\n\t" << measHitErr.
uu()
227 <<
"\t" << measHitErr.
vv()
228 <<
"\t" << measTrkErr.
uu()
229 <<
"\t" << measTrkErr.
vv();
239 resXTopol = (phiTrk-phiHit)*r_0;
243 resXatTrkYTopol = lPTrk.
x() - LocalHitPosCor.
x();
247 float cosPhiHit(
cos(phiHit)), cosPhiTrk(
cos(phiTrk)),
248 sinPhiHit(
sin(phiHit)), sinPhiTrk(
sin(phiTrk));
250 resYTopol = measTrkPos.
y()*localStripLengthTrk - measHitPos.
y()*localStripLengthHit + l_0*(1/cosPhiTrk - 1/cosPhiHit);
255 + sinPhiTrk*sinPhiTrk/
pow(cosPhiTrk,4)*measTrkErr.
uu() );
256 resYprimeErr =
std::sqrt(measHitErr.
vv()*localStripLengthHit*localStripLengthHit
257 + measTrkErr.
vv()*localStripLengthTrk*localStripLengthTrk + helpSummand );
261 if (trapezoidalBound!=
NULL) {
262 hitStruct.
inside = trapezoidalBound->inside(lPTrk);
263 length = trapezoidalBound->length();
264 width = trapezoidalBound->width();
275 <<
"[TrackerValidationVariables] Cannot cast bounds to TrapezoidalPlaneBounds as expected for TID and TEC";
279 edm::LogWarning(
"TrackerValidationVariables") <<
"@SUB=TrackerValidationVariables::fillHitQuantities"
280 <<
"No valid tracker subdetector " << IntSubDetID;
284 resXprime = resXTopol*uOrientation;
285 resXatTrkY = resXatTrkYTopol;
286 resYprime = resYTopol*vOrientation;
305 v_avhitout.push_back(hitStruct);
312 std::vector<AVTrackStruct> & v_avtrackout)
324 std::vector<AVTrackStruct> & v_avtrackout)
331 LogDebug(
"TrackerValidationVariables") <<
"TrajTrack collection size " << TrajTracksMap->size();
337 iPair != TrajTracksMap->end();
340 trajectory = &(*(*iPair).key);
341 track = &(*(*iPair).val);
347 trackStruct.
p = track->
p();
348 trackStruct.
pt = track->
pt();
350 trackStruct.
px = track->
px();
351 trackStruct.
py = track->
py();
352 trackStruct.
pz = track->
pz();
353 trackStruct.
eta = track->
eta();
354 trackStruct.
phi = track->
phi();
359 double theLocalMagFieldInInverseGeV = magneticField->inInverseGeV(gPoint).z();
360 trackStruct.
kappa = -track->
charge()*theLocalMagFieldInInverseGeV/track->
pt();
362 trackStruct.
d0 = track->
d0();
363 trackStruct.
dz = track->
dz();
369 v_avtrackout.push_back(trackStruct);
TrackerValidationVariables()
double p() const
momentum vector magnitude
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
T getParameter(std::string const &) const
virtual float localStripLength(const LocalPoint &) const =0
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
virtual const GeomDetType & type() const
friend struct const_iterator
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
LocalVector localDirection() const
LocalPoint localPosition() const
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
double phi() const
azimuthal angle of momentum vector
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
void fillHitQuantities(const Trajectory *trajectory, std::vector< AVHitStruct > &v_avhitout)
virtual LocalPoint localPosition(float strip) const =0
double px() const
x coordinate of momentum vector
virtual float detHeight() const =0
std::vector< AVHitStruct > hits
LocalError positionError() const
uint32_t rawId() const
get the raw id
virtual bool inside(const Local2DPoint &p) const
DataContainer const & measurements() const
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
double eta() const
pseudorapidity of momentum vector
double chi2() const
chi-squared of the fit
edm::EDGetTokenT< std::vector< Trajectory > > trajCollectionToken_
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
double ndof() const
number of degrees of freedom of the fit
helper::RootFunctionHelper< F, args >::root_function function(F &f)
double pt() const
track transverse momentum
Cos< T >::type cos(const T &t)
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
~TrackerValidationVariables()
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
virtual float angularWidth() const =0
unsigned short numberOfValidHits() const
number of valid hits found
const LocalTrajectoryError & localError() const
virtual float width() const
Width along local X.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
double pz() const
z coordinate of momentum vector
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
double vz() const
z coordinate of the reference point on track
virtual float stripAngle(float strip) const =0
void fillTrackQuantities(const edm::Event &, const edm::EventSetup &, std::vector< AVTrackStruct > &v_avtrackout)
edm::EDGetTokenT< TrajTrackAssociationCollection > trajTracksToken_
virtual float originToIntersection() const =0
virtual const Topology & topology() const =0
double vy() const
y coordinate of the reference point on track
virtual float length() const
Lenght along local Y.
int charge() const
track electric charge
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Power< A, B >::type pow(const A &a, const B &b)
double py() const
y coordinate of momentum vector
double vx() const
x coordinate of the reference point on track
GlobalVector globalDirection() const