24 materialEffects_(
config.materialEffects),
26 useRefittedState_(
config.useRefittedState),
27 constructTsosWithErrors_(
config.constructTsosWithErrors)
30 if (
config.hitsAreReverse) {
31 TransientTrackingRecHit::ConstRecHitContainer::const_reverse_iterator itRecHits;
34 fwdRecHits.first.reserve(
recHits.first.size());
35 for (itRecHits =
recHits.first.rbegin(); itRecHits !=
recHits.first.rend(); ++itRecHits) {
36 fwdRecHits.first.push_back(*itRecHits);
39 fwdRecHits.second.reserve(
recHits.second.size());
40 for (itRecHits =
recHits.second.rbegin(); itRecHits !=
recHits.second.rend(); ++itRecHits) {
41 fwdRecHits.second.push_back(*itRecHits);
52 materialEffects_(
none),
54 useRefittedState_(
false),
55 constructTsosWithErrors_(
false) {}
71 config.useBeamSpot =
false;
72 config.hitsAreReverse =
false;
92 unsigned int nLocal = deriv.first.num_row();
93 unsigned int nTbd = deriv.first.num_col();
99 for (
unsigned int row = 0; row < nLocal; ++row) {
100 for (
unsigned int col = 0;
col < nTbd; ++
col) {
101 tbdToLocal1(row,
col) = deriv.first[row][
col];
106 std::make_pair(trajectory1.
gblInput().front().first, trajectory1.
gblInput().front().second * tbdToLocal1));
109 for (
unsigned int row = 0; row < nLocal; ++row) {
110 for (
unsigned int col = 0;
col < nTbd; ++
col) {
111 tbdToLocal2(row,
col) = deriv.second[row][
col];
116 std::make_pair(trajectory2.
gblInput().front().first, trajectory2.
gblInput().front().second * tbdToLocal2));
156 theDerivatives.sub(rowOffset, colOffset, fullDeriv1.sub(1, nHitMeas1, 1, nTbd));
159 rowOffset, colOffset, trajectory1.
derivatives().sub(1, nHitMeas1, nLocal + 1, nPar1 + nVirtualPar1));
161 rowOffset += nHitMeas1;
163 theDerivatives.sub(rowOffset, colOffset, fullDeriv2.sub(1, nHitMeas2, 1, nTbd));
164 colOffset += (nPar1 + nVirtualPar1 + nTbd - nLocal);
166 rowOffset, colOffset, trajectory2.
derivatives().sub(1, nHitMeas2, nLocal + 1, nPar2 + nVirtualPar2));
168 rowOffset += nHitMeas2;
170 theDerivatives.sub(rowOffset, colOffset, fullDeriv1.sub(nHitMeas1 + 1, nHitMeas1 + nVirtualMeas1, 1, nTbd));
175 trajectory1.
derivatives().sub(nHitMeas1 + 1, nHitMeas1 + nVirtualMeas1, nLocal + 1, nPar1 + nVirtualPar1));
177 rowOffset += nVirtualMeas1;
179 theDerivatives.sub(rowOffset, colOffset, fullDeriv2.sub(nHitMeas2 + 1, nHitMeas2 + nVirtualMeas2, 1, nTbd));
180 colOffset += (nPar1 + nVirtualPar1 + nTbd - nLocal);
184 trajectory2.
derivatives().sub(nHitMeas2 + 1, nHitMeas2 + nVirtualMeas2, nLocal + 1, nPar2 + nVirtualPar2));
189 trajectory1.
measurements().sub(nHitMeas1 + 1, nHitMeas1 + nVirtualMeas1));
191 trajectory2.
measurements().sub(nHitMeas2 + 1, nHitMeas2 + nVirtualMeas2));
204 state.decayParameters().covariance().similarity(
theDerivatives.sub(1, nHitMeas1 + nHitMeas2, 1, 9));
209 rowOffset += nVirtualMeas2;
210 int indMass = rowOffset - 1;
235 std::vector<TrajectoryStateOnSurface>::const_iterator itTsos;
252 const double coeff = 1
e-2;
259 float dpinv = coeff * (fabs(
p.x()) + fabs(
p.y()) + fabs(
p.z())) * invP * invP;
260 float dxdir = coeff * (fabs(
p.x()) + fabs(
p.z())) /
p.z() /
p.z();
261 float dydir = coeff * (fabs(
p.y()) + fabs(
p.z())) /
p.z() /
p.z();
262 localErrors[0][0] = dpinv * dpinv;
263 localErrors[1][1] = dxdir * dxdir;
264 localErrors[2][2] = dydir * dydir;
const AlgebraicMatrix & localToTrajectory() const
unsigned int numberOfPar() const
std::pair< int, int > theNumberOfRecHits
const AlgebraicSymMatrix & measurementErrors() const
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
float signedInverseMomentum() const
Signed inverse momentum q/p (zero for neutrals).
bool construct(const TwoBodyDecayTrajectoryState &state, const ConstRecHitCollection &recHits, const MagneticField *field, const reco::BeamSpot &beamSpot)
unsigned int numberOfHits() const
AlgebraicMatrix theDerivatives
unsigned int theNumberOfVirtualPars
unsigned int numberOfHitMeas() const
unsigned int numberOfVirtualMeas() const
void constructSingleTsosWithErrors(const TrajectoryStateOnSurface &tsos, int iTsos, const MagneticField *field)
unsigned int theNumberOfVirtualMeas
const AlgebraicVector & measurements() const
TwoBodyDecayTrajectory(void)
const LocalTrajectoryParameters & localParameters() const
const PropagationDirection propDir_
unsigned int numberOfVirtualPar() const
const SurfaceType & surface() const
AlgebraicVector theParameters
AlgebraicVector theMeasurements
Eigen::VectorXd theGblExtPrecisions
const std::vector< TrajectoryStateOnSurface > & trajectoryStates() const
U second(std::pair< T, U > const &p)
AlgebraicSymMatrix theTrajectoryPositionCov
std::vector< std::pair< std::vector< gbl::GblPoint >, Eigen::MatrixXd > > theGblInput
CLHEP::HepMatrix AlgebraicMatrix
LocalVector momentum() const
Momentum vector in the local frame.
const MaterialEffects materialEffects_
unsigned int theNumberOfHits
AlgebraicVector theTrajectoryPositions
const AlgebraicVector & trajectoryPositions() const
TransientTrackingRecHit::ConstRecHitContainer theRecHits
AlgebraicSymMatrix theMeasurementsCov
static constexpr unsigned int nMeasPerHit
std::pair< TrajectoryStateOnSurface, TrajectoryStateOnSurface > TsosContainer
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Eigen::MatrixXd theGblExtDerivatives
std::vector< std::pair< std::vector< gbl::GblPoint >, Eigen::MatrixXd > > & gblInput()
void constructTsosVecWithErrors(const ReferenceTrajectory &traj1, const ReferenceTrajectory &traj2, const MagneticField *field)
Eigen::VectorXd theGblExtMeasurements
const bool useRefittedState_
std::pair< AlgebraicMatrix, AlgebraicMatrix > Derivatives
std::vector< TrajectoryStateOnSurface > theTsosVec
const bool constructTsosWithErrors_
dictionary config
Read in AllInOne config in JSON format.
const TransientTrackingRecHit::ConstRecHitContainer & recHits() const
unsigned int theNumberOfPars
uint32_t dimension(pat::CandKinResolution::Parametrization parametrization)
Returns the number of free parameters in a parametrization (3 or 4)
std::pair< ConstRecHitContainer, ConstRecHitContainer > ConstRecHitCollection
const AlgebraicMatrix & derivatives() const