CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
TrackExtenderWithMTDT< TrackCollection > Class Template Reference
Inheritance diagram for TrackExtenderWithMTDT< TrackCollection >:
edm::stream::EDProducer<>

Public Types

typedef edm::View< TrackTypeInputCollection
 
typedef TrackCollection::value_type TrackType
 
- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

reco::Track buildTrack (const reco::TrackRef &, const Trajectory &, const Trajectory &, const reco::BeamSpot &, const MagneticField *field, const Propagator *prop, bool hasMTD, float &pathLength, float &tmtdOut, float &sigmatmtdOut, GlobalPoint &tmtdPosOut, float &tofpi, float &tofk, float &tofp, float &sigmatofpi, float &sigmatofk, float &sigmatofp) const
 
reco::TrackExtra buildTrackExtra (const Trajectory &trajectory) const
 
RefitDirection::GeometricalDirection checkRecHitsOrdering (TransientTrackingRecHit::ConstRecHitContainer const &recHits) const
 
string dumpLayer (const DetLayer *layer) const
 
void fillMatchingHits (const DetLayer *, const TrajectoryStateOnSurface &, const Trajectory &, const float, const float, const TrackSegments &, const MTDTrackingDetSetVector &, const Propagator *, const reco::BeamSpot &, const float &, const bool, TransientTrackingRecHit::ConstRecHitContainer &, MTDHitMatchingInfo &) const
 
template<class H , class T >
void fillValueMap (edm::Event &iEvent, const H &handle, const std::vector< T > &vec, const edm::EDPutToken &token) const
 
void produce (edm::Event &ev, const edm::EventSetup &es) final
 
 TrackExtenderWithMTDT (const ParameterSet &pset)
 
TransientTrackingRecHit::ConstRecHitContainer tryBTLLayers (const TrajectoryStateOnSurface &, const Trajectory &traj, const float, const float, const TrackSegments &, const MTDTrackingDetSetVector &, const MTDDetLayerGeometry *, const MagneticField *field, const Propagator *prop, const reco::BeamSpot &bs, const float vtxTime, const bool matchVertex, MTDHitMatchingInfo &bestHit) const
 
TransientTrackingRecHit::ConstRecHitContainer tryETLLayers (const TrajectoryStateOnSurface &, const Trajectory &traj, const float, const float, const TrackSegments &, const MTDTrackingDetSetVector &, const MTDDetLayerGeometry *, const MagneticField *field, const Propagator *prop, const reco::BeamSpot &bs, const float vtxTime, const bool matchVertex, MTDHitMatchingInfo &bestHit) const
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDPutToken assocOrigTrkToken_
 
edm::EDPutToken betaOrigTrkToken_
 
const float bsTimeSpread_
 
edm::EDGetTokenT< reco::BeamSpotbsToken_
 
const float btlChi2Cut_
 
edm::EDPutToken btlMatchChi2Token_
 
edm::EDPutToken btlMatchTimeChi2Token_
 
const float btlTimeChi2Cut_
 
edm::ESHandle< TransientTrackBuilderbuilder_
 
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecordbuilderToken_
 
edm::ESGetToken< MTDDetLayerGeometry, MTDRecoGeometryRecorddlgeoToken_
 
const float dzCut_
 
const float estMaxChi2_
 
const float estMaxNSigma_
 
const float etlChi2Cut_
 
edm::EDPutToken etlMatchChi2Token_
 
edm::EDPutToken etlMatchTimeChi2Token_
 
const float etlTimeChi2Cut_
 
edm::EDGetTokenT< GlobalPointgenVtxPositionToken_
 
edm::EDGetTokenT< float > genVtxTimeToken_
 
edm::ESHandle< GlobalTrackingGeometrygtg_
 
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecordgtgToken_
 
edm::ESHandle< TransientTrackingRecHitBuilderhitbuilder_
 
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecordhitbuilderToken_
 
edm::EDGetTokenT< MTDTrackingDetSetVectorhitsToken_
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmagfldToken_
 
const std::string mtdRecHitBuilder_
 
edm::EDPutToken npixBarrelToken_
 
edm::EDPutToken npixEndcapToken_
 
edm::EDPutToken outermostHitPositionToken_
 
edm::EDPutToken pathLengthOrigTrkToken_
 
edm::EDPutToken pOrigTrkToken_
 
const std::string propagator_
 
edm::ESGetToken< Propagator, TrackingComponentsRecordpropToken_
 
edm::EDPutToken sigmat0OrigTrkToken_
 
edm::EDPutToken sigmatmtdOrigTrkToken_
 
edm::EDPutToken sigmatofkOrigTrkToken_
 
edm::EDPutToken sigmatofpiOrigTrkToken_
 
edm::EDPutToken sigmatofpOrigTrkToken_
 
edm::EDPutToken t0OrigTrkToken_
 
std::unique_ptr< MeasurementEstimatortheEstimator
 
std::unique_ptr< TrackTransformertheTransformer
 
edm::EDPutToken tmtdOrigTrkToken_
 
edm::EDPutToken tmtdPosOrigTrkToken_
 
edm::EDPutToken tofkOrigTrkToken_
 
edm::EDPutToken tofpiOrigTrkToken_
 
edm::EDPutToken tofpOrigTrkToken_
 
edm::EDGetTokenT< InputCollectiontracksToken_
 
edm::EDGetTokenT< TrajTrackAssociationCollectiontrajTrackAToken_
 
const std::string transientTrackBuilder_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdttopoToken_
 
const bool updateExtra_
 
const bool updatePattern_
 
const bool updateTraj_
 
const bool useSimVertex_
 
const bool useVertex_
 
edm::EDGetTokenT< VertexCollectionvtxToken_
 

Detailed Description

template<class TrackCollection>
class TrackExtenderWithMTDT< TrackCollection >

Definition at line 469 of file TrackExtenderWithMTD.cc.

Member Typedef Documentation

◆ InputCollection

template<class TrackCollection >
typedef edm::View<TrackType> TrackExtenderWithMTDT< TrackCollection >::InputCollection

Definition at line 472 of file TrackExtenderWithMTD.cc.

◆ TrackType

template<class TrackCollection >
typedef TrackCollection::value_type TrackExtenderWithMTDT< TrackCollection >::TrackType

Definition at line 471 of file TrackExtenderWithMTD.cc.

Constructor & Destructor Documentation

◆ TrackExtenderWithMTDT()

template<class TrackCollection >
TrackExtenderWithMTDT< TrackCollection >::TrackExtenderWithMTDT ( const ParameterSet pset)

Definition at line 626 of file TrackExtenderWithMTD.cc.

References TrackExtenderWithMTDT< TrackCollection >::assocOrigTrkToken_, TrackExtenderWithMTDT< TrackCollection >::betaOrigTrkToken_, TrackExtenderWithMTDT< TrackCollection >::btlMatchChi2Token_, TrackExtenderWithMTDT< TrackCollection >::btlMatchTimeChi2Token_, TrackExtenderWithMTDT< TrackCollection >::builderToken_, TrackExtenderWithMTDT< TrackCollection >::dlgeoToken_, TrackExtenderWithMTDT< TrackCollection >::estMaxChi2_, TrackExtenderWithMTDT< TrackCollection >::estMaxNSigma_, TrackExtenderWithMTDT< TrackCollection >::etlMatchChi2Token_, TrackExtenderWithMTDT< TrackCollection >::etlMatchTimeChi2Token_, TrackExtenderWithMTDT< TrackCollection >::genVtxPositionToken_, TrackExtenderWithMTDT< TrackCollection >::genVtxTimeToken_, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), TrackExtenderWithMTDT< TrackCollection >::gtgToken_, TrackExtenderWithMTDT< TrackCollection >::hitbuilderToken_, TrackExtenderWithMTDT< TrackCollection >::magfldToken_, TrackExtenderWithMTDT< TrackCollection >::mtdRecHitBuilder_, TrackExtenderWithMTDT< TrackCollection >::npixBarrelToken_, TrackExtenderWithMTDT< TrackCollection >::npixEndcapToken_, TrackExtenderWithMTDT< TrackCollection >::outermostHitPositionToken_, TrackExtenderWithMTDT< TrackCollection >::pathLengthOrigTrkToken_, TrackExtenderWithMTDT< TrackCollection >::pOrigTrkToken_, TrackExtenderWithMTDT< TrackCollection >::propagator_, TrackExtenderWithMTDT< TrackCollection >::propToken_, TrackExtenderWithMTDT< TrackCollection >::sigmat0OrigTrkToken_, TrackExtenderWithMTDT< TrackCollection >::sigmatmtdOrigTrkToken_, TrackExtenderWithMTDT< TrackCollection >::sigmatofkOrigTrkToken_, TrackExtenderWithMTDT< TrackCollection >::sigmatofpiOrigTrkToken_, TrackExtenderWithMTDT< TrackCollection >::sigmatofpOrigTrkToken_, TrackExtenderWithMTDT< TrackCollection >::t0OrigTrkToken_, TrackExtenderWithMTDT< TrackCollection >::theEstimator, TrackExtenderWithMTDT< TrackCollection >::theTransformer, TrackExtenderWithMTDT< TrackCollection >::tmtdOrigTrkToken_, TrackExtenderWithMTDT< TrackCollection >::tmtdPosOrigTrkToken_, TrackExtenderWithMTDT< TrackCollection >::tofkOrigTrkToken_, TrackExtenderWithMTDT< TrackCollection >::tofpiOrigTrkToken_, TrackExtenderWithMTDT< TrackCollection >::tofpOrigTrkToken_, TrackExtenderWithMTDT< TrackCollection >::transientTrackBuilder_, TrackExtenderWithMTDT< TrackCollection >::ttopoToken_, TrackExtenderWithMTDT< TrackCollection >::useSimVertex_, TrackExtenderWithMTDT< TrackCollection >::useVertex_, and TrackExtenderWithMTDT< TrackCollection >::vtxToken_.

627  : tracksToken_(consumes<InputCollection>(iConfig.getParameter<edm::InputTag>("tracksSrc"))),
628  trajTrackAToken_(consumes<TrajTrackAssociationCollection>(iConfig.getParameter<edm::InputTag>("trjtrkAssSrc"))),
629  hitsToken_(consumes<MTDTrackingDetSetVector>(iConfig.getParameter<edm::InputTag>("hitsSrc"))),
630  bsToken_(consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpotSrc"))),
631  updateTraj_(iConfig.getParameter<bool>("updateTrackTrajectory")),
632  updateExtra_(iConfig.getParameter<bool>("updateTrackExtra")),
633  updatePattern_(iConfig.getParameter<bool>("updateTrackHitPattern")),
634  mtdRecHitBuilder_(iConfig.getParameter<std::string>("MTDRecHitBuilder")),
635  propagator_(iConfig.getParameter<std::string>("Propagator")),
636  transientTrackBuilder_(iConfig.getParameter<std::string>("TransientTrackBuilder")),
637  estMaxChi2_(iConfig.getParameter<double>("estimatorMaxChi2")),
638  estMaxNSigma_(iConfig.getParameter<double>("estimatorMaxNSigma")),
639  btlChi2Cut_(iConfig.getParameter<double>("btlChi2Cut")),
640  btlTimeChi2Cut_(iConfig.getParameter<double>("btlTimeChi2Cut")),
641  etlChi2Cut_(iConfig.getParameter<double>("etlChi2Cut")),
642  etlTimeChi2Cut_(iConfig.getParameter<double>("etlTimeChi2Cut")),
643  useVertex_(iConfig.getParameter<bool>("useVertex")),
644  useSimVertex_(iConfig.getParameter<bool>("useSimVertex")),
645  dzCut_(iConfig.getParameter<double>("dZCut")),
646  bsTimeSpread_(iConfig.getParameter<double>("bsTimeSpread")) {
647  if (useVertex_) {
648  if (useSimVertex_) {
649  genVtxPositionToken_ = consumes<GlobalPoint>(iConfig.getParameter<edm::InputTag>("genVtxPositionSrc"));
650  genVtxTimeToken_ = consumes<float>(iConfig.getParameter<edm::InputTag>("genVtxTimeSrc"));
651  } else
652  vtxToken_ = consumes<VertexCollection>(iConfig.getParameter<edm::InputTag>("vtxSrc"));
653  }
654 
655  theEstimator = std::make_unique<Chi2MeasurementEstimator>(estMaxChi2_, estMaxNSigma_);
656  theTransformer = std::make_unique<TrackTransformer>(iConfig.getParameterSet("TrackTransformer"), consumesCollector());
657 
658  btlMatchChi2Token_ = produces<edm::ValueMap<float>>("btlMatchChi2");
659  etlMatchChi2Token_ = produces<edm::ValueMap<float>>("etlMatchChi2");
660  btlMatchTimeChi2Token_ = produces<edm::ValueMap<float>>("btlMatchTimeChi2");
661  etlMatchTimeChi2Token_ = produces<edm::ValueMap<float>>("etlMatchTimeChi2");
662  npixBarrelToken_ = produces<edm::ValueMap<int>>("npixBarrel");
663  npixEndcapToken_ = produces<edm::ValueMap<int>>("npixEndcap");
664  outermostHitPositionToken_ = produces<edm::ValueMap<float>>("generalTrackOutermostHitPosition");
665  pOrigTrkToken_ = produces<edm::ValueMap<float>>("generalTrackp");
666  betaOrigTrkToken_ = produces<edm::ValueMap<float>>("generalTrackBeta");
667  t0OrigTrkToken_ = produces<edm::ValueMap<float>>("generalTrackt0");
668  sigmat0OrigTrkToken_ = produces<edm::ValueMap<float>>("generalTracksigmat0");
669  pathLengthOrigTrkToken_ = produces<edm::ValueMap<float>>("generalTrackPathLength");
670  tmtdOrigTrkToken_ = produces<edm::ValueMap<float>>("generalTracktmtd");
671  sigmatmtdOrigTrkToken_ = produces<edm::ValueMap<float>>("generalTracksigmatmtd");
672  tmtdPosOrigTrkToken_ = produces<edm::ValueMap<GlobalPoint>>("generalTrackmtdpos");
673  tofpiOrigTrkToken_ = produces<edm::ValueMap<float>>("generalTrackTofPi");
674  tofkOrigTrkToken_ = produces<edm::ValueMap<float>>("generalTrackTofK");
675  tofpOrigTrkToken_ = produces<edm::ValueMap<float>>("generalTrackTofP");
676  sigmatofpiOrigTrkToken_ = produces<edm::ValueMap<float>>("generalTrackSigmaTofPi");
677  sigmatofkOrigTrkToken_ = produces<edm::ValueMap<float>>("generalTrackSigmaTofK");
678  sigmatofpOrigTrkToken_ = produces<edm::ValueMap<float>>("generalTrackSigmaTofP");
679  assocOrigTrkToken_ = produces<edm::ValueMap<int>>("generalTrackassoc");
680 
681  builderToken_ = esConsumes<TransientTrackBuilder, TransientTrackRecord>(edm::ESInputTag("", transientTrackBuilder_));
683  esConsumes<TransientTrackingRecHitBuilder, TransientRecHitRecord>(edm::ESInputTag("", mtdRecHitBuilder_));
684  gtgToken_ = esConsumes<GlobalTrackingGeometry, GlobalTrackingGeometryRecord>();
685  dlgeoToken_ = esConsumes<MTDDetLayerGeometry, MTDRecoGeometryRecord>();
686  magfldToken_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
687  propToken_ = esConsumes<Propagator, TrackingComponentsRecord>(edm::ESInputTag("", propagator_));
688  ttopoToken_ = esConsumes<TrackerTopology, TrackerTopologyRcd>();
689 
690  produces<edm::OwnVector<TrackingRecHit>>();
691  produces<reco::TrackExtraCollection>();
692  produces<TrackCollection>();
693 }
edm::EDPutToken btlMatchTimeChi2Token_
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > hitbuilderToken_
edm::EDPutToken btlMatchChi2Token_
edm::EDPutToken tofpOrigTrkToken_
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > gtgToken_
edm::EDPutToken sigmatofkOrigTrkToken_
edm::EDGetTokenT< reco::BeamSpot > bsToken_
std::unique_ptr< MeasurementEstimator > theEstimator
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > ttopoToken_
edm::EDPutToken etlMatchChi2Token_
edm::EDGetTokenT< GlobalPoint > genVtxPositionToken_
edm::EDPutToken tofkOrigTrkToken_
edm::EDPutToken etlMatchTimeChi2Token_
edm::EDPutToken sigmat0OrigTrkToken_
edm::EDPutToken tmtdOrigTrkToken_
edm::EDGetTokenT< MTDTrackingDetSetVector > hitsToken_
edm::EDPutToken sigmatofpiOrigTrkToken_
edm::EDPutToken tmtdPosOrigTrkToken_
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > builderToken_
const std::string mtdRecHitBuilder_
edm::EDPutToken assocOrigTrkToken_
const std::string propagator_
edm::EDPutToken outermostHitPositionToken_
edm::ESGetToken< Propagator, TrackingComponentsRecord > propToken_
const std::string transientTrackBuilder_
std::unique_ptr< TrackTransformer > theTransformer
edm::EDPutToken npixBarrelToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfldToken_
edm::EDPutToken npixEndcapToken_
edm::EDPutToken betaOrigTrkToken_
edm::EDGetTokenT< TrajTrackAssociationCollection > trajTrackAToken_
edm::EDPutToken pathLengthOrigTrkToken_
edm::EDPutToken sigmatmtdOrigTrkToken_
edm::EDPutToken tofpiOrigTrkToken_
edm::EDGetTokenT< float > genVtxTimeToken_
edm::EDGetTokenT< VertexCollection > vtxToken_
edm::EDGetTokenT< InputCollection > tracksToken_
edm::EDPutToken sigmatofpOrigTrkToken_
edm::ESGetToken< MTDDetLayerGeometry, MTDRecoGeometryRecord > dlgeoToken_

Member Function Documentation

◆ buildTrack()

template<class TrackCollection >
reco::Track TrackExtenderWithMTDT< TrackCollection >::buildTrack ( const reco::TrackRef orig,
const Trajectory traj,
const Trajectory trajWithMtd,
const reco::BeamSpot bs,
const MagneticField field,
const Propagator prop,
bool  hasMTD,
float &  pathLength,
float &  tmtdOut,
float &  sigmatmtdOut,
GlobalPoint tmtdPosOut,
float &  tofpi,
float &  tofk,
float &  tofp,
float &  sigmatofpi,
float &  sigmatofk,
float &  sigmatofp 
) const

Definition at line 1328 of file TrackExtenderWithMTD.cc.

References funct::abs(), cms::cuda::bs, c_cm_ns, FreeTrajectoryState::charge(), Trajectory::chiSquared(), FreeTrajectoryState::curvilinearError(), f, FastTime, DetId::Forward, BaseTrackerRecHit::globalPosition(), createfilelist::int, LogTrace, Trajectory::measurements(), FreeTrajectoryState::momentum(), PixelVertexMonitor_cff::ndof, Trajectory::ndof(), AlCaHLTBitMon_ParallelJobs::p, FreeTrajectoryState::position(), cms_rounding::roundIfNear0(), mathSSE::sqrt(), FrontierCondition_GT_autoExpress_cfi::t0, MTDTrackingRecHit::time(), MTDTrackingRecHit::timeError(), TrajectoryStateClosestToBeamLine::trackStateAtPCA(), reco::TrackBase::undefQuality, and findQualityFiles::v.

1344  {
1346  bool tsbcl_status = getTrajectoryStateClosestToBeamLine(traj, bs, thePropagator, tscbl);
1347 
1348  if (!tsbcl_status)
1349  return reco::Track();
1350 
1351  GlobalPoint v = tscbl.trackStateAtPCA().position();
1352  math::XYZPoint pos(v.x(), v.y(), v.z());
1353  GlobalVector p = tscbl.trackStateAtPCA().momentum();
1354  math::XYZVector mom(p.x(), p.y(), p.z());
1355 
1356  int ndof = traj.ndof();
1357 
1358  float t0 = 0.f;
1359  float covt0t0 = -1.f;
1360  pathLengthOut = -1.f; // if there is no MTD flag the pathlength with -1
1361  tmtdOut = 0.f;
1362  sigmatmtdOut = -1.f;
1363  float betaOut = 0.f;
1364  float covbetabeta = -1.f;
1365 
1366  auto routput = [&]() {
1367  return reco::Track(traj.chiSquared(),
1368  int(ndof),
1369  pos,
1370  mom,
1371  tscbl.trackStateAtPCA().charge(),
1373  orig->algo(),
1375  t0,
1376  betaOut,
1377  covt0t0,
1378  covbetabeta);
1379  };
1380 
1381  //compute path length for time backpropagation, using first MTD hit for the momentum
1382  if (hasMTD) {
1383  float pathlength;
1384  TrackSegments trs;
1385  bool validpropagation = trackPathLength(trajWithMtd, bs, thePropagator, pathlength, trs);
1386  float thit = 0.f;
1387  float thiterror = -1.f;
1388  GlobalPoint thitpos{0., 0., 0.};
1389  bool validmtd = false;
1390 
1391  if (!validpropagation) {
1392  return routput();
1393  }
1394 
1395  uint32_t ihitcount(0), ietlcount(0);
1396  for (auto const& hit : trajWithMtd.measurements()) {
1397  if (hit.recHit()->geographicalId().det() == DetId::Forward &&
1398  ForwardSubdetector(hit.recHit()->geographicalId().subdetId()) == FastTime) {
1399  ihitcount++;
1400  if (MTDDetId(hit.recHit()->geographicalId()).mtdSubDetector() == MTDDetId::MTDType::ETL) {
1401  ietlcount++;
1402  }
1403  }
1404  }
1405 
1406  LogTrace("TrackExtenderWithMTD") << "TrackExtenderWithMTD: selected #hits " << ihitcount << " from ETL "
1407  << ietlcount;
1408 
1409  auto ihit1 = trajWithMtd.measurements().cbegin();
1410  if (ihitcount == 1) {
1411  const MTDTrackingRecHit* mtdhit = static_cast<const MTDTrackingRecHit*>((*ihit1).recHit()->hit());
1412  thit = mtdhit->time();
1413  thiterror = mtdhit->timeError();
1414  thitpos = mtdhit->globalPosition();
1415  validmtd = true;
1416  } else if (ihitcount == 2 && ietlcount == 2) {
1417  std::pair<float, float> lastStep = trs.getSegmentPathAndMom2(0);
1418  float etlpathlength = std::abs(lastStep.first * c_cm_ns);
1419  //
1420  // The information of the two ETL hits is combined and attributed to the innermost hit
1421  //
1422  if (etlpathlength == 0.f) {
1423  validpropagation = false;
1424  } else {
1425  pathlength -= etlpathlength;
1426  trs.removeFirstSegment();
1427  const MTDTrackingRecHit* mtdhit1 = static_cast<const MTDTrackingRecHit*>((*ihit1).recHit()->hit());
1428  const MTDTrackingRecHit* mtdhit2 = static_cast<const MTDTrackingRecHit*>((*(ihit1 + 1)).recHit()->hit());
1429  TrackTofPidInfo tofInfo = computeTrackTofPidInfo(
1430  lastStep.second, etlpathlength, trs, mtdhit1->time(), mtdhit1->timeError(), 0.f, 0.f, true, TofCalc::kCost);
1431  //
1432  // Protect against incompatible times
1433  //
1434  float err1 = tofInfo.dterror2;
1435  float err2 = mtdhit2->timeError() * mtdhit2->timeError();
1436  if (cms_rounding::roundIfNear0(err1) == 0.f || cms_rounding::roundIfNear0(err2) == 0.f) {
1437  edm::LogError("TrackExtenderWithMTD")
1438  << "MTD tracking hits with zero time uncertainty: " << err1 << " " << err2;
1439  } else {
1440  if ((tofInfo.dt - mtdhit2->time()) * (tofInfo.dt - mtdhit2->time()) < (err1 + err2) * etlTimeChi2Cut_) {
1441  //
1442  // Subtract the ETL time of flight from the outermost measurement, and combine it in a weighted average with the innermost
1443  // the mass ambiguity related uncertainty on the time of flight is added as an additional uncertainty
1444  //
1445  err1 = 1.f / err1;
1446  err2 = 1.f / err2;
1447  thiterror = 1.f / (err1 + err2);
1448  thit = (tofInfo.dt * err1 + mtdhit2->time() * err2) * thiterror;
1449  thiterror = std::sqrt(thiterror);
1450  thitpos = mtdhit2->globalPosition();
1451  LogTrace("TrackExtenderWithMTD")
1452  << "TrackExtenderWithMTD: p trk = " << p.mag() << " ETL hits times/errors: 1) " << mtdhit1->time()
1453  << " +/- " << mtdhit1->timeError() << " , 2) " << mtdhit2->time() << " +/- " << mtdhit2->timeError()
1454  << " extrapolated time1: " << tofInfo.dt << " +/- " << tofInfo.dterror << " average = " << thit
1455  << " +/- " << thiterror << "\n hit1 pos: " << mtdhit1->globalPosition()
1456  << " hit2 pos: " << mtdhit2->globalPosition() << " etl path length " << etlpathlength << std::endl;
1457  validmtd = true;
1458  } else {
1459  // if back extrapolated time of the outermost measurement not compatible with the innermost, keep the one with smallest error
1460  if (err1 <= err2) {
1461  thit = tofInfo.dt;
1462  thiterror = tofInfo.dterror;
1463  validmtd = true;
1464  } else {
1465  thit = mtdhit2->time();
1466  thiterror = mtdhit2->timeError();
1467  validmtd = true;
1468  }
1469  }
1470  }
1471  }
1472  } else {
1473  edm::LogInfo("TrackExtenderWithMTD")
1474  << "MTD hits #" << ihitcount << "ETL hits #" << ietlcount << " anomalous pattern, skipping...";
1475  }
1476 
1477  if (validmtd && validpropagation) {
1478  //here add the PID uncertainty for later use in the 1st step of 4D vtx reconstruction
1479  TrackTofPidInfo tofInfo = computeTrackTofPidInfo(
1480  p.mag2(), pathlength, trs, thit, thiterror, 0.f, 0.f, true, TofCalc::kSegm, SigmaTofCalc::kCost);
1481 
1482  pathLengthOut = pathlength; // set path length if we've got a timing hit
1483  tmtdOut = thit;
1484  sigmatmtdOut = thiterror;
1485  tmtdPosOut = thitpos;
1486  t0 = tofInfo.dt;
1487  covt0t0 = tofInfo.dterror2;
1488  betaOut = tofInfo.beta_pi;
1489  covbetabeta = tofInfo.betaerror * tofInfo.betaerror;
1490  tofpi = tofInfo.dt_pi;
1491  tofk = tofInfo.dt_k;
1492  tofp = tofInfo.dt_p;
1493  sigmatofpi = tofInfo.sigma_dt_pi;
1494  sigmatofk = tofInfo.sigma_dt_k;
1495  sigmatofp = tofInfo.sigma_dt_p;
1496  }
1497  }
1498 
1499  return routput();
1500 }
const CurvilinearTrajectoryError & curvilinearError() const
constexpr double c_cm_ns
float chiSquared() const
Definition: Trajectory.h:241
Log< level::Error, false > LogError
ForwardSubdetector
#define LogTrace(id)
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
DataContainer const & measurements() const
Definition: Trajectory.h:178
GlobalPoint position() const
int ndof(bool bon=true) const
Definition: Trajectory.cc:97
T sqrt(T t)
Definition: SSEVec.h:23
TrackCharge charge() const
GlobalVector momentum() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
constexpr valType roundIfNear0(valType value, double tolerance=1.e-7)
Definition: Rounding.h:11
Log< level::Info, false > LogInfo
GlobalPoint globalPosition() const final
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
A 2D TrackerRecHit with time and time error information.
float timeError() const
float time() const

◆ buildTrackExtra()

template<class TrackCollection >
reco::TrackExtra TrackExtenderWithMTDT< TrackCollection >::buildTrackExtra ( const Trajectory trajectory) const

Definition at line 1503 of file TrackExtenderWithMTD.cc.

References alongMomentum, Surface::bounds(), TrajectoryStateOnSurface::curvilinearError(), Trajectory::direction(), Trajectory::firstMeasurement(), TrajectoryStateOnSurface::globalParameters(), Bounds::inside(), Trajectory::lastMeasurement(), LogTrace, metname, GlobalTrajectoryParameters::momentum(), oppositeToMomentum, AlCaHLTBitMon_ParallelJobs::p, GlobalTrajectoryParameters::position(), TrajectoryMeasurement::recHit(), Trajectory::recHits(), Trajectory::seedRef(), GeomDet::surface(), GeomDet::toLocal(), TrajectoryMeasurement::updatedState(), and findQualityFiles::v.

1503  {
1504  static const string metname = "TrackExtenderWithMTD";
1505 
1506  const Trajectory::RecHitContainer transRecHits = trajectory.recHits();
1507 
1508  // put the collection of TrackingRecHit in the event
1509 
1510  // sets the outermost and innermost TSOSs
1511  // ToDo: validation for track states with MTD
1512  TrajectoryStateOnSurface outerTSOS;
1513  TrajectoryStateOnSurface innerTSOS;
1514  unsigned int innerId = 0, outerId = 0;
1516  DetId outerDetId;
1517 
1518  if (trajectory.direction() == alongMomentum) {
1519  LogTrace(metname) << "alongMomentum";
1520  outerTSOS = trajectory.lastMeasurement().updatedState();
1521  innerTSOS = trajectory.firstMeasurement().updatedState();
1522  outerId = trajectory.lastMeasurement().recHit()->geographicalId().rawId();
1523  innerId = trajectory.firstMeasurement().recHit()->geographicalId().rawId();
1524  outerRecHit = trajectory.lastMeasurement().recHit();
1525  outerDetId = trajectory.lastMeasurement().recHit()->geographicalId();
1526  } else if (trajectory.direction() == oppositeToMomentum) {
1527  LogTrace(metname) << "oppositeToMomentum";
1528  outerTSOS = trajectory.firstMeasurement().updatedState();
1529  innerTSOS = trajectory.lastMeasurement().updatedState();
1530  outerId = trajectory.firstMeasurement().recHit()->geographicalId().rawId();
1531  innerId = trajectory.lastMeasurement().recHit()->geographicalId().rawId();
1532  outerRecHit = trajectory.firstMeasurement().recHit();
1533  outerDetId = trajectory.firstMeasurement().recHit()->geographicalId();
1534  } else
1535  LogError(metname) << "Wrong propagation direction!";
1536 
1537  const GeomDet* outerDet = gtg_->idToDet(outerDetId);
1538  GlobalPoint outerTSOSPos = outerTSOS.globalParameters().position();
1539  bool inside = outerDet->surface().bounds().inside(outerDet->toLocal(outerTSOSPos));
1540 
1541  GlobalPoint hitPos =
1542  (outerRecHit->isValid()) ? outerRecHit->globalPosition() : outerTSOS.globalParameters().position();
1543 
1544  if (!inside) {
1545  LogTrace(metname) << "The Global Muon outerMostMeasurementState is not compatible with the recHit detector!"
1546  << " Setting outerMost postition to recHit position if recHit isValid: "
1547  << outerRecHit->isValid();
1548  LogTrace(metname) << "From " << outerTSOSPos << " to " << hitPos;
1549  }
1550 
1551  //build the TrackExtra
1552  GlobalPoint v = (inside) ? outerTSOSPos : hitPos;
1553  GlobalVector p = outerTSOS.globalParameters().momentum();
1554  math::XYZPoint outpos(v.x(), v.y(), v.z());
1555  math::XYZVector outmom(p.x(), p.y(), p.z());
1556 
1557  v = innerTSOS.globalParameters().position();
1558  p = innerTSOS.globalParameters().momentum();
1559  math::XYZPoint inpos(v.x(), v.y(), v.z());
1560  math::XYZVector inmom(p.x(), p.y(), p.z());
1561 
1562  reco::TrackExtra trackExtra(outpos,
1563  outmom,
1564  true,
1565  inpos,
1566  inmom,
1567  true,
1568  outerTSOS.curvilinearError(),
1569  outerId,
1570  innerTSOS.curvilinearError(),
1571  innerId,
1572  trajectory.direction(),
1573  trajectory.seedRef());
1574 
1575  return trackExtra;
1576 }
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
const std::string metname
const GlobalTrajectoryParameters & globalParameters() const
edm::RefToBase< TrajectorySeed > seedRef(void) const
Definition: Trajectory.h:303
Log< level::Error, false > LogError
const GeomDet * idToDet(DetId) const override
TrajectoryMeasurement const & lastMeasurement() const
Definition: Trajectory.h:150
#define LogTrace(id)
PropagationDirection const & direction() const
Definition: Trajectory.cc:133
ConstRecHitContainer recHits() const
Definition: Trajectory.h:186
Definition: DetId.h:17
ConstRecHitContainer RecHitContainer
Definition: Trajectory.h:42
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const CurvilinearTrajectoryError & curvilinearError() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
TrackingRecHit::ConstRecHitPointer ConstRecHitPointer
TrajectoryStateOnSurface const & updatedState() const
TrajectoryMeasurement const & firstMeasurement() const
Definition: Trajectory.h:166
edm::ESHandle< GlobalTrackingGeometry > gtg_
ConstRecHitPointer const & recHit() const
const Bounds & bounds() const
Definition: Surface.h:87

◆ checkRecHitsOrdering()

template<class TrackCollection >
RefitDirection::GeometricalDirection TrackExtenderWithMTDT< TrackCollection >::checkRecHitsOrdering ( TransientTrackingRecHit::ConstRecHitContainer const &  recHits) const
inline

Definition at line 525 of file TrackExtenderWithMTD.cc.

References dqmdumpme::first, RefitDirection::insideOut, dqmdumpme::last, LogDebug, RefitDirection::outsideIn, position, FastTrackerRecHitMaskProducer_cfi::recHits, and RefitDirection::undetermined.

526  {
527  if (!recHits.empty()) {
528  GlobalPoint first = gtg_->idToDet(recHits.front()->geographicalId())->position();
529  GlobalPoint last = gtg_->idToDet(recHits.back()->geographicalId())->position();
530 
531  // maybe perp2?
532  auto rFirst = first.mag2();
533  auto rLast = last.mag2();
534  if (rFirst < rLast)
536  if (rFirst > rLast)
538  }
539  LogDebug("TrackExtenderWithMTD") << "Impossible to determine the rechits order" << endl;
541  }
const GeomDet * idToDet(DetId) const override
static int position[264][3]
Definition: ReadPGInfo.cc:289
edm::ESHandle< GlobalTrackingGeometry > gtg_
#define LogDebug(id)

◆ dumpLayer()

template<class TrackCollection >
string TrackExtenderWithMTDT< TrackCollection >::dumpLayer ( const DetLayer layer) const

Definition at line 1579 of file TrackExtenderWithMTD.cc.

References nano_mu_digi_cff::layer, and convertSQLitetoXML_cfg::output.

1579  {
1580  stringstream output;
1581 
1582  const BoundSurface* sur = nullptr;
1583  const BoundCylinder* bc = nullptr;
1584  const BoundDisk* bd = nullptr;
1585 
1586  sur = &(layer->surface());
1587  if ((bc = dynamic_cast<const BoundCylinder*>(sur))) {
1588  output << " Cylinder of radius: " << bc->radius() << endl;
1589  } else if ((bd = dynamic_cast<const BoundDisk*>(sur))) {
1590  output << " Disk at: " << bd->position().z() << endl;
1591  }
1592  return output.str();
1593 }
Definition: output.py:1

◆ fillDescriptions()

template<class TrackCollection >
void TrackExtenderWithMTDT< TrackCollection >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 696 of file TrackExtenderWithMTD.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, TrackTransformer::fillPSetDescription(), ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

696  {
698  desc.add<edm::InputTag>("tracksSrc", edm::InputTag("generalTracks"));
699  desc.add<edm::InputTag>("trjtrkAssSrc", edm::InputTag("generalTracks"));
700  desc.add<edm::InputTag>("hitsSrc", edm::InputTag("mtdTrackingRecHits"));
701  desc.add<edm::InputTag>("beamSpotSrc", edm::InputTag("offlineBeamSpot"));
702  desc.add<edm::InputTag>("genVtxPositionSrc", edm::InputTag("genParticles:xyz0"));
703  desc.add<edm::InputTag>("genVtxTimeSrc", edm::InputTag("genParticles:t0"));
704  desc.add<edm::InputTag>("vtxSrc", edm::InputTag("offlinePrimaryVertices4D"));
705  desc.add<bool>("updateTrackTrajectory", true);
706  desc.add<bool>("updateTrackExtra", true);
707  desc.add<bool>("updateTrackHitPattern", true);
708  desc.add<std::string>("TransientTrackBuilder", "TransientTrackBuilder");
709  desc.add<std::string>("MTDRecHitBuilder", "MTDRecHitBuilder");
710  desc.add<std::string>("Propagator", "PropagatorWithMaterialForMTD");
712  false,
713  "KFFitterForRefitInsideOut",
714  "KFSmootherForRefitInsideOut",
715  "PropagatorWithMaterialForMTD",
716  "alongMomentum",
717  true,
718  "WithTrackAngle",
719  "MuonRecHitBuilder",
720  "MTDRecHitBuilder");
721  desc.add<edm::ParameterSetDescription>("TrackTransformer", transDesc);
722  desc.add<double>("estimatorMaxChi2", 500.);
723  desc.add<double>("estimatorMaxNSigma", 10.);
724  desc.add<double>("btlChi2Cut", 50.);
725  desc.add<double>("btlTimeChi2Cut", 10.);
726  desc.add<double>("etlChi2Cut", 50.);
727  desc.add<double>("etlTimeChi2Cut", 10.);
728  desc.add<bool>("useVertex", false);
729  desc.add<bool>("useSimVertex", false);
730  desc.add<double>("dZCut", 0.1);
731  desc.add<double>("bsTimeSpread", 0.2);
732  descriptions.add("trackExtenderWithMTDBase", desc);
733 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillPSetDescription(edm::ParameterSetDescription &descriptions, bool doPredictionsOnly=false, const std::string &fitter="KFFitterForRefitInsideOut", const std::string &smoother="KFSmootherForRefitInsideOut", const std::string &propagator="SmartPropagatorAnyRK", const std::string &refitDirection="alongMomentum", bool refitRPCHits=true, const std::string &trackerRecHitBuilder="WithTrackAngle", const std::string &muonRecHitBuilder="MuonRecHitBuilder", const std::string &mtdRecHitBuilder="MTDRecHitBuilder")
fillDescriptions

◆ fillMatchingHits()

template<class TrackCollection >
void TrackExtenderWithMTDT< TrackCollection >::fillMatchingHits ( const DetLayer ilay,
const TrajectoryStateOnSurface tsos,
const Trajectory traj,
const float  pmag2,
const float  pathlength0,
const TrackSegments &  trs0,
const MTDTrackingDetSetVector hits,
const Propagator prop,
const reco::BeamSpot bs,
const float &  vtxTime,
const bool  matchVertex,
TransientTrackingRecHit::ConstRecHitContainer output,
MTDHitMatchingInfo &  bestHit 
) const

Definition at line 1241 of file TrackExtenderWithMTD.cc.

References cms::cuda::bs, hfClusterShapes_cfi::hits, DetLayer::isBarrel(), and LogTrace.

1253  {
1254  std::set<MTDHitMatchingInfo> hitsInLayer;
1255  bool hitMatched = false;
1256 
1257  using namespace std::placeholders;
1258  auto find_hits = std::bind(find_hits_in_dets,
1259  std::cref(hits),
1260  std::cref(traj),
1261  ilay,
1262  std::cref(tsos),
1263  pmag2,
1264  pathlength0,
1265  trs0,
1266  _1,
1267  std::cref(bs),
1268  bsTimeSpread_,
1269  prop,
1270  theEstimator.get(),
1271  _2,
1272  std::ref(hitsInLayer));
1273 
1274  if (useVertex_ && matchVertex)
1275  find_hits(vtxTime, true);
1276  else
1277  find_hits(0, false);
1278 
1279  float spaceChi2Cut = ilay->isBarrel() ? btlChi2Cut_ : etlChi2Cut_;
1280  float timeChi2Cut = ilay->isBarrel() ? btlTimeChi2Cut_ : etlTimeChi2Cut_;
1281 
1282  //just take the first hit because the hits are sorted on their matching quality
1283  if (!hitsInLayer.empty()) {
1284  //check hits to pass minimum quality matching requirements
1285  auto const& firstHit = *hitsInLayer.begin();
1286  LogTrace("TrackExtenderWithMTD") << "TrackExtenderWithMTD: matching trial 1: estChi2= " << firstHit.estChi2
1287  << " timeChi2= " << firstHit.timeChi2;
1288  if (firstHit.estChi2 < spaceChi2Cut && firstHit.timeChi2 < timeChi2Cut) {
1289  hitMatched = true;
1290  output.push_back(hitbuilder_->build(firstHit.hit));
1291  if (firstHit < bestHit)
1292  bestHit = firstHit;
1293  }
1294  }
1295 
1296  if (useVertex_ && matchVertex && !hitMatched) {
1297  //try a second search with beamspot hypothesis
1298  hitsInLayer.clear();
1299  find_hits(0, false);
1300  if (!hitsInLayer.empty()) {
1301  auto const& firstHit = *hitsInLayer.begin();
1302  LogTrace("TrackExtenderWithMTD") << "TrackExtenderWithMTD: matching trial 2: estChi2= " << firstHit.estChi2
1303  << " timeChi2= " << firstHit.timeChi2;
1304  if (firstHit.timeChi2 < timeChi2Cut) {
1305  if (firstHit.estChi2 < spaceChi2Cut) {
1306  hitMatched = true;
1307  output.push_back(hitbuilder_->build(firstHit.hit));
1308  if (firstHit < bestHit)
1309  bestHit = firstHit;
1310  }
1311  }
1312  }
1313  }
1314 
1315 #ifdef EDM_ML_DEBUG
1316  if (hitMatched) {
1317  LogTrace("TrackExtenderWithMTD") << "TrackExtenderWithMTD: matched hit with time: " << bestHit.hit->time()
1318  << " +/- " << bestHit.hit->timeError();
1319  } else {
1320  LogTrace("TrackExtenderWithMTD") << "TrackExtenderWithMTD: no matched hit";
1321  }
1322 #endif
1323 }
std::unique_ptr< MeasurementEstimator > theEstimator
#define LogTrace(id)
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
edm::ESHandle< TransientTrackingRecHitBuilder > hitbuilder_
Definition: output.py:1
bool isBarrel() const
Definition: DetLayer.h:31

◆ fillValueMap()

template<class TrackCollection >
template<class H , class T >
void TrackExtenderWithMTDT< TrackCollection >::fillValueMap ( edm::Event iEvent,
const H &  handle,
const std::vector< T > &  vec,
const edm::EDPutToken token 
) const

Definition at line 737 of file TrackExtenderWithMTD.cc.

References trigObjTnPSource_cfi::filler, patZpeak::handle, iEvent, eostools::move(), MillePedeFileConverter_cfg::out, and unpackBuffers-CaloStage2::token.

740  {
741  auto out = std::make_unique<edm::ValueMap<T>>();
743  filler.insert(handle, vec.begin(), vec.end());
744  filler.fill();
745  iEvent.put(token, std::move(out));
746 }
int iEvent
Definition: GenABIO.cc:224
def move(src, dest)
Definition: eostools.py:511

◆ produce()

template<class TrackCollection >
void TrackExtenderWithMTDT< TrackCollection >::produce ( edm::Event ev,
const edm::EventSetup es 
)
final

setup the track extras

Definition at line 749 of file TrackExtenderWithMTD.cc.

References funct::abs(), cms::cuda::bs, gather_cfg::cout, PVValHelper::dz, makeMEIFBenchmarkPlots::ev, f, ALCARECOEcalPhiSym_cff::float, dqm-mbProfile::format, edm::EventSetup::getHandle(), edm::EventSetup::getTransientHandle(), hfClusterShapes_cfi::hits, mps_fire::i, RefitDirection::insideOut, Trajectory::isValid(), LogTrace, PV3DBase< T, PVType, FrameType >::mag2(), volumeBasedMagneticField_160812_cfi::magfield, reco::HitPattern::MISSING_INNER_HITS, FreeTrajectoryState::momentum(), eostools::move(), config::ordering, mps_fire::result, groupFilesInBlocks::reverse, mathSSE::sqrt(), HLT_2024v14_cff::track, reco::HitPattern::TRACK_HITS, and TrajectoryStateClosestToBeamLine::trackStateAtPCA().

749  {
750  //this produces pieces of the track extra
751  Traj2TrackHits t2t;
752 
753  theTransformer->setServices(es);
754  TrackingRecHitRefProd hitsRefProd = ev.getRefBeforePut<TrackingRecHitCollection>();
755  reco::TrackExtraRefProd extrasRefProd = ev.getRefBeforePut<reco::TrackExtraCollection>();
756 
757  gtg_ = es.getHandle(gtgToken_);
758 
759  auto geo = es.getTransientHandle(dlgeoToken_);
760 
762 
765 
766  auto propH = es.getTransientHandle(propToken_);
767  const Propagator* prop = propH.product();
768 
769  auto httopo = es.getTransientHandle(ttopoToken_);
770  const TrackerTopology& ttopo = *httopo;
771 
772  auto output = std::make_unique<TrackCollection>();
773  auto extras = std::make_unique<reco::TrackExtraCollection>();
774  auto outhits = std::make_unique<edm::OwnVector<TrackingRecHit>>();
775 
776  std::vector<float> btlMatchChi2;
777  std::vector<float> etlMatchChi2;
778  std::vector<float> btlMatchTimeChi2;
779  std::vector<float> etlMatchTimeChi2;
780  std::vector<int> npixBarrel;
781  std::vector<int> npixEndcap;
782  std::vector<float> outermostHitPosition;
783  std::vector<float> pOrigTrkRaw;
784  std::vector<float> betaOrigTrkRaw;
785  std::vector<float> t0OrigTrkRaw;
786  std::vector<float> sigmat0OrigTrkRaw;
787  std::vector<float> pathLengthsOrigTrkRaw;
788  std::vector<float> tmtdOrigTrkRaw;
789  std::vector<float> sigmatmtdOrigTrkRaw;
790  std::vector<GlobalPoint> tmtdPosOrigTrkRaw;
791  std::vector<float> tofpiOrigTrkRaw;
792  std::vector<float> tofkOrigTrkRaw;
793  std::vector<float> tofpOrigTrkRaw;
794  std::vector<float> sigmatofpiOrigTrkRaw;
795  std::vector<float> sigmatofkOrigTrkRaw;
796  std::vector<float> sigmatofpOrigTrkRaw;
797  std::vector<int> assocOrigTrkRaw;
798 
799  auto const tracksH = ev.getHandle(tracksToken_);
800 
801  const auto& trjtrks = ev.get(trajTrackAToken_);
802 
803  //MTD hits DetSet
804  const auto& hits = ev.get(hitsToken_);
805 
806  //beam spot
807  const auto& bs = ev.get(bsToken_);
808 
809  const Vertex* pv = nullptr;
810  if (useVertex_ && !useSimVertex_) {
811  auto const& vtxs = ev.get(vtxToken_);
812  if (!vtxs.empty())
813  pv = &vtxs[0];
814  }
815 
816  std::unique_ptr<math::XYZTLorentzVectorF> genPV(nullptr);
817  if (useVertex_ && useSimVertex_) {
818  const auto& genVtxPosition = ev.get(genVtxPositionToken_);
819  const auto& genVtxTime = ev.get(genVtxTimeToken_);
820  genPV = std::make_unique<math::XYZTLorentzVectorF>(
821  genVtxPosition.x(), genVtxPosition.y(), genVtxPosition.z(), genVtxTime);
822  }
823 
824  float vtxTime = 0.f;
825  if (useVertex_) {
826  if (useSimVertex_ && genPV) {
827  vtxTime = genPV->t();
828  } else if (pv)
829  vtxTime = pv->t(); //already in ns
830  }
831 
832  std::vector<unsigned> track_indices;
833  unsigned itrack = 0;
834 
835  for (const auto& trjtrk : trjtrks) {
836  const Trajectory& trajs = *trjtrk.key;
837  const reco::TrackRef& track = trjtrk.val;
838 
839  LogTrace("TrackExtenderWithMTD") << "TrackExtenderWithMTD: extrapolating track " << itrack
840  << " p/pT = " << track->p() << " " << track->pt() << " eta = " << track->eta();
841  LogTrace("TrackExtenderWithMTD") << "TrackExtenderWithMTD: sigma_p = "
842  << sqrt(track->covariance()(0, 0)) * track->p2()
843  << " sigma_p/p = " << sqrt(track->covariance()(0, 0)) * track->p() * 100 << " %";
844 
845  float trackVtxTime = 0.f;
846  if (useVertex_) {
847  float dz;
848  if (useSimVertex_)
849  dz = std::abs(track->dz(math::XYZPoint(*genPV)));
850  else
851  dz = std::abs(track->dz(pv->position()));
852 
853  if (dz < dzCut_)
854  trackVtxTime = vtxTime;
855  }
856 
857  reco::TransientTrack ttrack(track, magfield.product(), gtg_);
858  auto thits = theTransformer->getTransientRecHits(ttrack);
860  MTDHitMatchingInfo mBTL, mETL;
861 
862  if (trajs.isValid()) {
863  // get the outermost trajectory point on the track
866  bool tscbl_status = getTrajectoryStateClosestToBeamLine(trajs, bs, prop, tscbl);
867 
868  if (tscbl_status) {
869  float pmag2 = tscbl.trackStateAtPCA().momentum().mag2();
870  float pathlength0;
871  TrackSegments trs0;
872  trackPathLength(trajs, tscbl, prop, pathlength0, trs0);
873 
874  const auto& btlhits = tryBTLLayers(tsos,
875  trajs,
876  pmag2,
877  pathlength0,
878  trs0,
879  hits,
880  geo.product(),
881  magfield.product(),
882  prop,
883  bs,
884  trackVtxTime,
885  trackVtxTime != 0.f,
886  mBTL);
887  mtdthits.insert(mtdthits.end(), btlhits.begin(), btlhits.end());
888 
889  // in the future this should include an intermediate refit before propagating to the ETL
890  // for now it is ok
891  const auto& etlhits = tryETLLayers(tsos,
892  trajs,
893  pmag2,
894  pathlength0,
895  trs0,
896  hits,
897  geo.product(),
898  magfield.product(),
899  prop,
900  bs,
901  trackVtxTime,
902  trackVtxTime != 0.f,
903  mETL);
904  mtdthits.insert(mtdthits.end(), etlhits.begin(), etlhits.end());
905  }
906 #ifdef EDM_ML_DEBUG
907  else {
908  LogTrace("TrackExtenderWithMTD") << "Failing getTrajectoryStateClosestToBeamLine, no search for hits in MTD!";
909  }
910 #endif
911  }
912 
913  auto ordering = checkRecHitsOrdering(thits);
915  thits.insert(thits.end(), mtdthits.begin(), mtdthits.end());
916  } else {
917  std::reverse(mtdthits.begin(), mtdthits.end());
918  mtdthits.insert(mtdthits.end(), thits.begin(), thits.end());
919  thits.swap(mtdthits);
920  }
921 
922  const auto& trajwithmtd =
923  mtdthits.empty() ? std::vector<Trajectory>(1, trajs) : theTransformer->transform(ttrack, thits);
924  float pMap = 0.f, betaMap = 0.f, t0Map = 0.f, sigmat0Map = -1.f, pathLengthMap = -1.f, tmtdMap = 0.f,
925  sigmatmtdMap = -1.f, tofpiMap = 0.f, tofkMap = 0.f, tofpMap = 0.f, sigmatofpiMap = -1.f, sigmatofkMap = -1.f,
926  sigmatofpMap = -1.f;
927  GlobalPoint tmtdPosMap{0., 0., 0.};
928  int iMap = -1;
929 
930  for (const auto& trj : trajwithmtd) {
931  const auto& thetrj = (updateTraj_ ? trj : trajs);
932  float pathLength = 0.f, tmtd = 0.f, sigmatmtd = -1.f, tofpi = 0.f, tofk = 0.f, tofp = 0.f, sigmatofpi = -1.f,
933  sigmatofk = -1.f, sigmatofp = -1.f;
934  GlobalPoint tmtdPos{0., 0., 0.};
935  LogTrace("TrackExtenderWithMTD") << "TrackExtenderWithMTD: refit track " << itrack << " p/pT = " << track->p()
936  << " " << track->pt() << " eta = " << track->eta();
938  thetrj,
939  trj,
940  bs,
941  magfield.product(),
942  prop,
943  !trajwithmtd.empty() && !mtdthits.empty(),
944  pathLength,
945  tmtd,
946  sigmatmtd,
947  tmtdPos,
948  tofpi,
949  tofk,
950  tofp,
951  sigmatofpi,
952  sigmatofk,
953  sigmatofp);
954  if (result.ndof() >= 0) {
956  reco::TrackExtra::TrajParams trajParams;
958  size_t hitsstart = outhits->size();
959  if (updatePattern_) {
960  t2t(trj, *outhits, trajParams, chi2s); // this fills the output hit collection
961  } else {
962  t2t(thetrj, *outhits, trajParams, chi2s);
963  }
964  size_t hitsend = outhits->size();
965  extras->push_back(buildTrackExtra(trj)); // always push back the fully built extra, update by setting in track
966  extras->back().setHits(hitsRefProd, hitsstart, hitsend - hitsstart);
967  extras->back().setTrajParams(trajParams, chi2s);
968  //create the track
969  output->push_back(result);
970  btlMatchChi2.push_back(mBTL.hit ? mBTL.estChi2 : -1.f);
971  etlMatchChi2.push_back(mETL.hit ? mETL.estChi2 : -1.f);
972  btlMatchTimeChi2.push_back(mBTL.hit ? mBTL.timeChi2 : -1.f);
973  etlMatchTimeChi2.push_back(mETL.hit ? mETL.timeChi2 : -1.f);
974  pathLengthMap = pathLength;
975  tmtdMap = tmtd;
976  sigmatmtdMap = sigmatmtd;
977  tmtdPosMap = tmtdPos;
978  auto& backtrack = output->back();
979  iMap = output->size() - 1;
980  pMap = backtrack.p();
981  betaMap = backtrack.beta();
982  t0Map = backtrack.t0();
983  sigmat0Map = std::copysign(std::sqrt(std::abs(backtrack.covt0t0())), backtrack.covt0t0());
984  tofpiMap = tofpi;
985  tofkMap = tofk;
986  tofpMap = tofp;
987  sigmatofpiMap = sigmatofpi;
988  sigmatofkMap = sigmatofk;
989  sigmatofpMap = sigmatofp;
990  reco::TrackExtraRef extraRef(extrasRefProd, extras->size() - 1);
991  backtrack.setExtra((updateExtra_ ? extraRef : track->extra()));
992  for (unsigned ihit = hitsstart; ihit < hitsend; ++ihit) {
993  backtrack.appendHitPattern((*outhits)[ihit], ttopo);
994  }
995 #ifdef EDM_ML_DEBUG
996  LogTrace("TrackExtenderWithMTD") << "TrackExtenderWithMTD: hit pattern of refitted track";
997  for (int i = 0; i < backtrack.hitPattern().numberOfAllHits(reco::HitPattern::TRACK_HITS); i++) {
998  backtrack.hitPattern().printHitPattern(reco::HitPattern::TRACK_HITS, i, std::cout);
999  }
1000  LogTrace("TrackExtenderWithMTD") << "TrackExtenderWithMTD: missing hit pattern of refitted track";
1001  for (int i = 0; i < backtrack.hitPattern().numberOfAllHits(reco::HitPattern::MISSING_INNER_HITS); i++) {
1002  backtrack.hitPattern().printHitPattern(reco::HitPattern::MISSING_INNER_HITS, i, std::cout);
1003  }
1004 #endif
1005  npixBarrel.push_back(backtrack.hitPattern().numberOfValidPixelBarrelHits());
1006  npixEndcap.push_back(backtrack.hitPattern().numberOfValidPixelEndcapHits());
1007  outermostHitPosition.push_back(
1008  mBTL.hit ? (float)(*track).outerRadius()
1009  : (float)(*track).outerZ()); // save R of the outermost hit for BTL, z for ETL.
1010 
1011  LogTrace("TrackExtenderWithMTD") << "TrackExtenderWithMTD: tmtd " << tmtdMap << " +/- " << sigmatmtdMap
1012  << " t0 " << t0Map << " +/- " << sigmat0Map << " tof pi/K/p " << tofpiMap
1013  << "+/-" << fmt::format("{:0.2g}", sigmatofpiMap) << " ("
1014  << fmt::format("{:0.2g}", sigmatofpiMap / tofpiMap * 100) << "%) " << tofkMap
1015  << "+/-" << fmt::format("{:0.2g}", sigmatofkMap) << " ("
1016  << fmt::format("{:0.2g}", sigmatofkMap / tofkMap * 100) << "%) " << tofpMap
1017  << "+/-" << fmt::format("{:0.2g}", sigmatofpMap) << " ("
1018  << fmt::format("{:0.2g}", sigmatofpMap / tofpMap * 100) << "%) ";
1019  } else {
1020  LogTrace("TrackExtenderWithMTD") << "Error in the MTD track refitting. This should not happen";
1021  }
1022  }
1023 
1024  pOrigTrkRaw.push_back(pMap);
1025  betaOrigTrkRaw.push_back(betaMap);
1026  t0OrigTrkRaw.push_back(t0Map);
1027  sigmat0OrigTrkRaw.push_back(sigmat0Map);
1028  pathLengthsOrigTrkRaw.push_back(pathLengthMap);
1029  tmtdOrigTrkRaw.push_back(tmtdMap);
1030  sigmatmtdOrigTrkRaw.push_back(sigmatmtdMap);
1031  tmtdPosOrigTrkRaw.push_back(tmtdPosMap);
1032  tofpiOrigTrkRaw.push_back(tofpiMap);
1033  tofkOrigTrkRaw.push_back(tofkMap);
1034  tofpOrigTrkRaw.push_back(tofpMap);
1035  sigmatofpiOrigTrkRaw.push_back(sigmatofpiMap);
1036  sigmatofkOrigTrkRaw.push_back(sigmatofkMap);
1037  sigmatofpOrigTrkRaw.push_back(sigmatofpMap);
1038  assocOrigTrkRaw.push_back(iMap);
1039 
1040  if (iMap == -1) {
1041  btlMatchChi2.push_back(-1.f);
1042  etlMatchChi2.push_back(-1.f);
1043  btlMatchTimeChi2.push_back(-1.f);
1044  etlMatchTimeChi2.push_back(-1.f);
1045  npixBarrel.push_back(-1.f);
1046  npixEndcap.push_back(-1.f);
1047  outermostHitPosition.push_back(0.);
1048  }
1049 
1050  ++itrack;
1051  }
1052 
1053  auto outTrksHandle = ev.put(std::move(output));
1054  ev.put(std::move(extras));
1055  ev.put(std::move(outhits));
1056 
1057  fillValueMap(ev, tracksH, btlMatchChi2, btlMatchChi2Token_);
1058  fillValueMap(ev, tracksH, etlMatchChi2, etlMatchChi2Token_);
1059  fillValueMap(ev, tracksH, btlMatchTimeChi2, btlMatchTimeChi2Token_);
1060  fillValueMap(ev, tracksH, etlMatchTimeChi2, etlMatchTimeChi2Token_);
1061  fillValueMap(ev, tracksH, npixBarrel, npixBarrelToken_);
1062  fillValueMap(ev, tracksH, npixEndcap, npixEndcapToken_);
1063  fillValueMap(ev, tracksH, outermostHitPosition, outermostHitPositionToken_);
1064  fillValueMap(ev, tracksH, pOrigTrkRaw, pOrigTrkToken_);
1065  fillValueMap(ev, tracksH, betaOrigTrkRaw, betaOrigTrkToken_);
1066  fillValueMap(ev, tracksH, t0OrigTrkRaw, t0OrigTrkToken_);
1067  fillValueMap(ev, tracksH, sigmat0OrigTrkRaw, sigmat0OrigTrkToken_);
1068  fillValueMap(ev, tracksH, pathLengthsOrigTrkRaw, pathLengthOrigTrkToken_);
1069  fillValueMap(ev, tracksH, tmtdOrigTrkRaw, tmtdOrigTrkToken_);
1070  fillValueMap(ev, tracksH, sigmatmtdOrigTrkRaw, sigmatmtdOrigTrkToken_);
1071  fillValueMap(ev, tracksH, tmtdPosOrigTrkRaw, tmtdPosOrigTrkToken_);
1072  fillValueMap(ev, tracksH, tofpiOrigTrkRaw, tofpiOrigTrkToken_);
1073  fillValueMap(ev, tracksH, tofkOrigTrkRaw, tofkOrigTrkToken_);
1074  fillValueMap(ev, tracksH, tofpOrigTrkRaw, tofpOrigTrkToken_);
1075  fillValueMap(ev, tracksH, sigmatofpiOrigTrkRaw, sigmatofpiOrigTrkToken_);
1076  fillValueMap(ev, tracksH, sigmatofkOrigTrkRaw, sigmatofkOrigTrkToken_);
1077  fillValueMap(ev, tracksH, sigmatofpOrigTrkRaw, sigmatofpOrigTrkToken_);
1078  fillValueMap(ev, tracksH, assocOrigTrkRaw, assocOrigTrkToken_);
1079 }
edm::EDPutToken btlMatchTimeChi2Token_
bool isValid() const
Definition: Trajectory.h:257
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > hitbuilderToken_
edm::EDPutToken btlMatchChi2Token_
std::vector< unsigned char > Chi2sFive
edm::EDPutToken tofpOrigTrkToken_
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > gtgToken_
edm::EDPutToken sigmatofkOrigTrkToken_
edm::EDGetTokenT< reco::BeamSpot > bsToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > ttopoToken_
edm::EDPutToken etlMatchChi2Token_
edm::EDGetTokenT< GlobalPoint > genVtxPositionToken_
T mag2() const
Definition: PV3DBase.h:63
edm::EDPutToken tofkOrigTrkToken_
edm::EDPutToken etlMatchTimeChi2Token_
edm::EDPutToken sigmat0OrigTrkToken_
void fillValueMap(edm::Event &iEvent, const H &handle, const std::vector< T > &vec, const edm::EDPutToken &token) const
edm::EDPutToken tmtdOrigTrkToken_
edm::EDGetTokenT< MTDTrackingDetSetVector > hitsToken_
#define LogTrace(id)
TransientTrackingRecHit::ConstRecHitContainer tryETLLayers(const TrajectoryStateOnSurface &, const Trajectory &traj, const float, const float, const TrackSegments &, const MTDTrackingDetSetVector &, const MTDDetLayerGeometry *, const MagneticField *field, const Propagator *prop, const reco::BeamSpot &bs, const float vtxTime, const bool matchVertex, MTDHitMatchingInfo &bestHit) const
reco::TransientTrack build(const reco::Track *p) const
edm::EDPutToken sigmatofpiOrigTrkToken_
std::vector< LocalTrajectoryParameters > TrajParams
edm::EDPutToken tmtdPosOrigTrkToken_
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > builderToken_
TrajectoryStateOnSurface outermostMeasurementState() const
T sqrt(T t)
Definition: SSEVec.h:23
reco::Track buildTrack(const reco::TrackRef &, const Trajectory &, const Trajectory &, const reco::BeamSpot &, const MagneticField *field, const Propagator *prop, bool hasMTD, float &pathLength, float &tmtdOut, float &sigmatmtdOut, GlobalPoint &tmtdPosOut, float &tofpi, float &tofk, float &tofp, float &sigmatofpi, float &sigmatofk, float &sigmatofp) const
GlobalVector momentum() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
edm::EDPutToken assocOrigTrkToken_
edm::EDPutToken outermostHitPositionToken_
edm::ESGetToken< Propagator, TrackingComponentsRecord > propToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
edm::ESHandle< TransientTrackingRecHitBuilder > hitbuilder_
std::vector< ConstRecHitPointer > ConstRecHitContainer
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:10
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
reco::TrackExtra buildTrackExtra(const Trajectory &trajectory) const
edm::ESHandle< TransientTrackBuilder > builder_
std::unique_ptr< TrackTransformer > theTransformer
edm::EDPutToken npixBarrelToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfldToken_
edm::EDPutToken npixEndcapToken_
edm::EDPutToken betaOrigTrkToken_
ESTransientHandle< T > getTransientHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:141
edm::EDGetTokenT< TrajTrackAssociationCollection > trajTrackAToken_
edm::EDPutToken pathLengthOrigTrkToken_
Definition: output.py:1
edm::ESHandle< GlobalTrackingGeometry > gtg_
edm::EDPutToken sigmatmtdOrigTrkToken_
TransientTrackingRecHit::ConstRecHitContainer tryBTLLayers(const TrajectoryStateOnSurface &, const Trajectory &traj, const float, const float, const TrackSegments &, const MTDTrackingDetSetVector &, const MTDDetLayerGeometry *, const MagneticField *field, const Propagator *prop, const reco::BeamSpot &bs, const float vtxTime, const bool matchVertex, MTDHitMatchingInfo &bestHit) const
edm::EDPutToken tofpiOrigTrkToken_
edm::EDGetTokenT< float > genVtxTimeToken_
ordering
Definition: config.py:7
edm::EDGetTokenT< VertexCollection > vtxToken_
edm::EDGetTokenT< InputCollection > tracksToken_
def move(src, dest)
Definition: eostools.py:511
RefitDirection::GeometricalDirection checkRecHitsOrdering(TransientTrackingRecHit::ConstRecHitContainer const &recHits) const
edm::EDPutToken sigmatofpOrigTrkToken_
edm::ESGetToken< MTDDetLayerGeometry, MTDRecoGeometryRecord > dlgeoToken_

◆ tryBTLLayers()

template<class TrackCollection >
TransientTrackingRecHit::ConstRecHitContainer TrackExtenderWithMTDT< TrackCollection >::tryBTLLayers ( const TrajectoryStateOnSurface tsos,
const Trajectory traj,
const float  pmag2,
const float  pathlength0,
const TrackSegments &  trs0,
const MTDTrackingDetSetVector hits,
const MTDDetLayerGeometry geo,
const MagneticField field,
const Propagator prop,
const reco::BeamSpot bs,
const float  vtxTime,
const bool  matchVertex,
MTDHitMatchingInfo &  bestHit 
) const

Definition at line 1171 of file TrackExtenderWithMTD.cc.

References MTDDetLayerGeometry::allBTLLayers(), cms::cuda::bs, hfClusterShapes_cfi::hits, hgcalTBTopologyTester_cfi::layers, LogTrace, and convertSQLitetoXML_cfg::output.

1184  {
1185  const vector<const DetLayer*>& layers = geo->allBTLLayers();
1186 
1188  bestHit = MTDHitMatchingInfo();
1189  for (const DetLayer* ilay : layers) {
1190  LogTrace("TrackExtenderWithMTD") << "Hit search: BTL layer at R= "
1191  << static_cast<const BarrelDetLayer*>(ilay)->specificSurface().radius();
1192 
1193  fillMatchingHits(ilay, tsos, traj, pmag2, pathlength0, trs0, hits, prop, bs, vtxTime, matchVertex, output, bestHit);
1194  }
1195 
1196  return output;
1197 }
#define LogTrace(id)
void fillMatchingHits(const DetLayer *, const TrajectoryStateOnSurface &, const Trajectory &, const float, const float, const TrackSegments &, const MTDTrackingDetSetVector &, const Propagator *, const reco::BeamSpot &, const float &, const bool, TransientTrackingRecHit::ConstRecHitContainer &, MTDHitMatchingInfo &) const
const std::vector< const DetLayer * > & allBTLLayers() const
return the BTL DetLayers (barrel), inside-out
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: output.py:1

◆ tryETLLayers()

template<class TrackCollection >
TransientTrackingRecHit::ConstRecHitContainer TrackExtenderWithMTDT< TrackCollection >::tryETLLayers ( const TrajectoryStateOnSurface tsos,
const Trajectory traj,
const float  pmag2,
const float  pathlength0,
const TrackSegments &  trs0,
const MTDTrackingDetSetVector hits,
const MTDDetLayerGeometry geo,
const MagneticField field,
const Propagator prop,
const reco::BeamSpot bs,
const float  vtxTime,
const bool  matchVertex,
MTDHitMatchingInfo &  bestHit 
) const

Definition at line 1200 of file TrackExtenderWithMTD.cc.

References funct::abs(), MTDDetLayerGeometry::allETLLayers(), cms::cuda::bs, TrajectoryStateOnSurface::globalPosition(), hfClusterShapes_cfi::hits, hgcalTBTopologyTester_cfi::layers, LogTrace, convertSQLitetoXML_cfg::output, groupFilesInBlocks::reverse, ctppsOpticalFunctions_non_DB_cff::z, and PV3DBase< T, PVType, FrameType >::z().

1213  {
1214  const vector<const DetLayer*>& layers = geo->allETLLayers();
1215 
1217  bestHit = MTDHitMatchingInfo();
1218  for (const DetLayer* ilay : layers) {
1219  const BoundDisk& disk = static_cast<const ForwardDetLayer*>(ilay)->specificSurface();
1220  const float diskZ = disk.position().z();
1221 
1222  if (tsos.globalPosition().z() * diskZ < 0)
1223  continue; // only propagate to the disk that's on the same side
1224 
1225  LogTrace("TrackExtenderWithMTD") << "Hit search: ETL disk at Z = " << diskZ;
1226 
1227  fillMatchingHits(ilay, tsos, traj, pmag2, pathlength0, trs0, hits, prop, bs, vtxTime, matchVertex, output, bestHit);
1228  }
1229 
1230  // the ETL hits order must be from the innermost to the outermost
1231 
1232  if (output.size() == 2) {
1233  if (std::abs(output[0]->globalPosition().z()) > std::abs(output[1]->globalPosition().z())) {
1234  std::reverse(output.begin(), output.end());
1235  }
1236  }
1237  return output;
1238 }
T z() const
Definition: PV3DBase.h:61
#define LogTrace(id)
GlobalPoint globalPosition() const
void fillMatchingHits(const DetLayer *, const TrajectoryStateOnSurface &, const Trajectory &, const float, const float, const TrackSegments &, const MTDTrackingDetSetVector &, const Propagator *, const reco::BeamSpot &, const float &, const bool, TransientTrackingRecHit::ConstRecHitContainer &, MTDHitMatchingInfo &) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: output.py:1
const std::vector< const DetLayer * > & allETLLayers() const
return the ETL DetLayers (endcap), -Z to +Z

Member Data Documentation

◆ assocOrigTrkToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::assocOrigTrkToken_
private

◆ betaOrigTrkToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::betaOrigTrkToken_
private

◆ bsTimeSpread_

template<class TrackCollection >
const float TrackExtenderWithMTDT< TrackCollection >::bsTimeSpread_
private

Definition at line 622 of file TrackExtenderWithMTD.cc.

◆ bsToken_

template<class TrackCollection >
edm::EDGetTokenT<reco::BeamSpot> TrackExtenderWithMTDT< TrackCollection >::bsToken_
private

Definition at line 591 of file TrackExtenderWithMTD.cc.

◆ btlChi2Cut_

template<class TrackCollection >
const float TrackExtenderWithMTDT< TrackCollection >::btlChi2Cut_
private

Definition at line 614 of file TrackExtenderWithMTD.cc.

◆ btlMatchChi2Token_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::btlMatchChi2Token_
private

◆ btlMatchTimeChi2Token_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::btlMatchTimeChi2Token_
private

◆ btlTimeChi2Cut_

template<class TrackCollection >
const float TrackExtenderWithMTDT< TrackCollection >::btlTimeChi2Cut_
private

Definition at line 615 of file TrackExtenderWithMTD.cc.

◆ builder_

template<class TrackCollection >
edm::ESHandle<TransientTrackBuilder> TrackExtenderWithMTDT< TrackCollection >::builder_
private

Definition at line 600 of file TrackExtenderWithMTD.cc.

◆ builderToken_

template<class TrackCollection >
edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> TrackExtenderWithMTDT< TrackCollection >::builderToken_
private

◆ dlgeoToken_

template<class TrackCollection >
edm::ESGetToken<MTDDetLayerGeometry, MTDRecoGeometryRecord> TrackExtenderWithMTDT< TrackCollection >::dlgeoToken_
private

◆ dzCut_

template<class TrackCollection >
const float TrackExtenderWithMTDT< TrackCollection >::dzCut_
private

Definition at line 621 of file TrackExtenderWithMTD.cc.

◆ estMaxChi2_

template<class TrackCollection >
const float TrackExtenderWithMTDT< TrackCollection >::estMaxChi2_
private

◆ estMaxNSigma_

template<class TrackCollection >
const float TrackExtenderWithMTDT< TrackCollection >::estMaxNSigma_
private

◆ etlChi2Cut_

template<class TrackCollection >
const float TrackExtenderWithMTDT< TrackCollection >::etlChi2Cut_
private

Definition at line 616 of file TrackExtenderWithMTD.cc.

◆ etlMatchChi2Token_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::etlMatchChi2Token_
private

◆ etlMatchTimeChi2Token_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::etlMatchTimeChi2Token_
private

◆ etlTimeChi2Cut_

template<class TrackCollection >
const float TrackExtenderWithMTDT< TrackCollection >::etlTimeChi2Cut_
private

Definition at line 617 of file TrackExtenderWithMTD.cc.

◆ genVtxPositionToken_

template<class TrackCollection >
edm::EDGetTokenT<GlobalPoint> TrackExtenderWithMTDT< TrackCollection >::genVtxPositionToken_
private

◆ genVtxTimeToken_

template<class TrackCollection >
edm::EDGetTokenT<float> TrackExtenderWithMTDT< TrackCollection >::genVtxTimeToken_
private

◆ gtg_

template<class TrackCollection >
edm::ESHandle<GlobalTrackingGeometry> TrackExtenderWithMTDT< TrackCollection >::gtg_
private

Definition at line 604 of file TrackExtenderWithMTD.cc.

◆ gtgToken_

◆ hitbuilder_

template<class TrackCollection >
edm::ESHandle<TransientTrackingRecHitBuilder> TrackExtenderWithMTDT< TrackCollection >::hitbuilder_
private

Definition at line 602 of file TrackExtenderWithMTD.cc.

◆ hitbuilderToken_

template<class TrackCollection >
edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> TrackExtenderWithMTDT< TrackCollection >::hitbuilderToken_
private

◆ hitsToken_

template<class TrackCollection >
edm::EDGetTokenT<MTDTrackingDetSetVector> TrackExtenderWithMTDT< TrackCollection >::hitsToken_
private

Definition at line 590 of file TrackExtenderWithMTD.cc.

◆ magfldToken_

template<class TrackCollection >
edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> TrackExtenderWithMTDT< TrackCollection >::magfldToken_
private

◆ mtdRecHitBuilder_

template<class TrackCollection >
const std::string TrackExtenderWithMTDT< TrackCollection >::mtdRecHitBuilder_
private

◆ npixBarrelToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::npixBarrelToken_
private

◆ npixEndcapToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::npixEndcapToken_
private

◆ outermostHitPositionToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::outermostHitPositionToken_
private

◆ pathLengthOrigTrkToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::pathLengthOrigTrkToken_
private

◆ pOrigTrkToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::pOrigTrkToken_
private

◆ propagator_

template<class TrackCollection >
const std::string TrackExtenderWithMTDT< TrackCollection >::propagator_
private

◆ propToken_

template<class TrackCollection >
edm::ESGetToken<Propagator, TrackingComponentsRecord> TrackExtenderWithMTDT< TrackCollection >::propToken_
private

◆ sigmat0OrigTrkToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::sigmat0OrigTrkToken_
private

◆ sigmatmtdOrigTrkToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::sigmatmtdOrigTrkToken_
private

◆ sigmatofkOrigTrkToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::sigmatofkOrigTrkToken_
private

◆ sigmatofpiOrigTrkToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::sigmatofpiOrigTrkToken_
private

◆ sigmatofpOrigTrkToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::sigmatofpOrigTrkToken_
private

◆ t0OrigTrkToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::t0OrigTrkToken_
private

◆ theEstimator

template<class TrackCollection >
std::unique_ptr<MeasurementEstimator> TrackExtenderWithMTDT< TrackCollection >::theEstimator
private

◆ theTransformer

template<class TrackCollection >
std::unique_ptr<TrackTransformer> TrackExtenderWithMTDT< TrackCollection >::theTransformer
private

◆ tmtdOrigTrkToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::tmtdOrigTrkToken_
private

◆ tmtdPosOrigTrkToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::tmtdPosOrigTrkToken_
private

◆ tofkOrigTrkToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::tofkOrigTrkToken_
private

◆ tofpiOrigTrkToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::tofpiOrigTrkToken_
private

◆ tofpOrigTrkToken_

template<class TrackCollection >
edm::EDPutToken TrackExtenderWithMTDT< TrackCollection >::tofpOrigTrkToken_
private

◆ tracksToken_

template<class TrackCollection >
edm::EDGetTokenT<InputCollection> TrackExtenderWithMTDT< TrackCollection >::tracksToken_
private

Definition at line 588 of file TrackExtenderWithMTD.cc.

◆ trajTrackAToken_

template<class TrackCollection >
edm::EDGetTokenT<TrajTrackAssociationCollection> TrackExtenderWithMTDT< TrackCollection >::trajTrackAToken_
private

Definition at line 589 of file TrackExtenderWithMTD.cc.

◆ transientTrackBuilder_

template<class TrackCollection >
const std::string TrackExtenderWithMTDT< TrackCollection >::transientTrackBuilder_
private

◆ ttopoToken_

template<class TrackCollection >
edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> TrackExtenderWithMTDT< TrackCollection >::ttopoToken_
private

◆ updateExtra_

template<class TrackCollection >
const bool TrackExtenderWithMTDT< TrackCollection >::updateExtra_
private

Definition at line 596 of file TrackExtenderWithMTD.cc.

◆ updatePattern_

template<class TrackCollection >
const bool TrackExtenderWithMTDT< TrackCollection >::updatePattern_
private

Definition at line 596 of file TrackExtenderWithMTD.cc.

◆ updateTraj_

template<class TrackCollection >
const bool TrackExtenderWithMTDT< TrackCollection >::updateTraj_
private

Definition at line 596 of file TrackExtenderWithMTD.cc.

◆ useSimVertex_

template<class TrackCollection >
const bool TrackExtenderWithMTDT< TrackCollection >::useSimVertex_
private

◆ useVertex_

template<class TrackCollection >
const bool TrackExtenderWithMTDT< TrackCollection >::useVertex_
private

◆ vtxToken_

template<class TrackCollection >
edm::EDGetTokenT<VertexCollection> TrackExtenderWithMTDT< TrackCollection >::vtxToken_
private