CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
TrackInfoProducerAlgorithm Class Reference

#include <TrackInfoProducerAlgorithm.h>

Public Types

typedef TrackingRecHit::ConstRecHitPointer ConstRecHitPointer
 

Public Member Functions

LocalPoint project (const GeomDet *det, const GeomDet *projdet, LocalPoint position, LocalVector trackdirection) const
 
void run (const edm::Ref< std::vector< Trajectory > > traj_iterator, reco::TrackRef track, reco::TrackInfo &output, const TrackerGeometry *tracker)
 
 TrackInfoProducerAlgorithm (const edm::ParameterSet &conf)
 
 ~TrackInfoProducerAlgorithm ()
 

Private Attributes

std::string backwardPredictedStateTag_
 
std::string combinedStateTag_
 
edm::ParameterSet conf_
 
std::string forwardPredictedStateTag_
 
std::string updatedStateTag_
 

Detailed Description

Definition at line 20 of file TrackInfoProducerAlgorithm.h.

Member Typedef Documentation

◆ ConstRecHitPointer

Definition at line 22 of file TrackInfoProducerAlgorithm.h.

Constructor & Destructor Documentation

◆ TrackInfoProducerAlgorithm()

TrackInfoProducerAlgorithm::TrackInfoProducerAlgorithm ( const edm::ParameterSet conf)
inline

Definition at line 24 of file TrackInfoProducerAlgorithm.h.

25  : conf_(conf),
26  forwardPredictedStateTag_(conf.getParameter<std::string>("forwardPredictedState")),
27  backwardPredictedStateTag_(conf.getParameter<std::string>("backwardPredictedState")),
28  updatedStateTag_(conf.getParameter<std::string>("updatedState")),
29  combinedStateTag_(conf.getParameter<std::string>("combinedState")) {}

◆ ~TrackInfoProducerAlgorithm()

TrackInfoProducerAlgorithm::~TrackInfoProducerAlgorithm ( )
inline

Definition at line 31 of file TrackInfoProducerAlgorithm.h.

31 {}

Member Function Documentation

◆ project()

LocalPoint TrackInfoProducerAlgorithm::project ( const GeomDet det,
const GeomDet projdet,
LocalPoint  position,
LocalVector  trackdirection 
) const

Definition at line 172 of file TrackInfoProducerAlgorithm.cc.

175  {
176  GlobalPoint globalpoint = (det->surface()).toGlobal(position);
177 
178  // position of the initial and final point of the strip in glued local coordinates
179  LocalPoint projposition = (projdet->surface()).toLocal(globalpoint);
180 
181  //correct the position with the track direction
182 
183  float scale = -projposition.z() / trackdirection.z();
184 
185  projposition += scale * trackdirection;
186 
187  return projposition;
188 }

References position, Scenarios_cff::scale, GeomDet::surface(), toLocal(), and PV3DBase< T, PVType, FrameType >::z().

◆ run()

void TrackInfoProducerAlgorithm::run ( const edm::Ref< std::vector< Trajectory > >  traj_iterator,
reco::TrackRef  track,
reco::TrackInfo output,
const TrackerGeometry tracker 
)

Definition at line 16 of file TrackInfoProducerAlgorithm.cc.

19  {
20  std::vector<TrajectoryMeasurement> measurements = traj_iterator->measurements();
21 
22  std::vector<TrajectoryMeasurement>::iterator traj_mes_iterator;
23  //edm::LogInfo("TrackInfoProducer") << "Number of Measurements: "<<measurements.size();
25  int nhit = 0;
26  for (traj_mes_iterator = measurements.begin(); traj_mes_iterator != measurements.end();
27  ++traj_mes_iterator) { //loop on measurements
28 
29  TrajectoryStateOnSurface fwdtsos = traj_mes_iterator->forwardPredictedState();
30  TrajectoryStateOnSurface bwdtsos = traj_mes_iterator->backwardPredictedState();
31  TrajectoryStateOnSurface updatedtsos = traj_mes_iterator->updatedState();
32  TrajectoryStateCombiner statecombiner;
33  TrajectoryStateOnSurface combinedtsos = statecombiner.combine(fwdtsos, bwdtsos);
34 
35  ConstRecHitPointer ttrh = traj_mes_iterator->recHit();
37  if (ttrh->isValid())
38  pos = ttrh->hit()->localPosition();
39  nhit++;
40  unsigned int detid = ttrh->hit()->geographicalId().rawId();
41 
42  TrackingRecHitRef thehitref;
43  TrackingRecHit const* thehitptr = nullptr;
44  int i = 0, j = 0;
45 
46  for (auto const& thehit : track->recHits()) {
47  i++;
48  LocalPoint hitpos;
49  if (thehit->isValid())
50  hitpos = thehit->localPosition();
51  if (thehit->geographicalId().rawId() == detid && (hitpos - pos).mag() < 1e-4) {
52  thehitptr = thehit;
53  thehitref = track->extra()->recHitRef(i - 1);
54  j++;
55  break;
56  }
57  }
58 
59  PTrajectoryStateOnDet const& fwdptsod = trajectoryStateTransform::persistentState(fwdtsos, detid);
60  PTrajectoryStateOnDet const& bwdptsod = trajectoryStateTransform::persistentState(bwdtsos, detid);
61  PTrajectoryStateOnDet const& updatedptsod = trajectoryStateTransform::persistentState(updatedtsos, detid);
62  PTrajectoryStateOnDet const& combinedptsod = trajectoryStateTransform::persistentState(combinedtsos, detid);
63 
64  const ProjectedSiStripRecHit2D* phit = dynamic_cast<const ProjectedSiStripRecHit2D*>(thehitptr);
65  const SiStripMatchedRecHit2D* matchedhit = dynamic_cast<const SiStripMatchedRecHit2D*>(thehitptr);
66 
68  LocalVector monofwd, stereofwd;
69  LocalVector monobwd, stereobwd;
70  LocalVector monoco, stereoco;
71  LocalVector monoup, stereoup;
72 
73  LocalPoint pmonofwd, pstereofwd;
74  LocalPoint pmonobwd, pstereobwd;
75  LocalPoint pmonoco, pstereoco;
76  LocalPoint pmonoup, pstereoup;
77  if (matchedhit) {
78  type = Matched;
79  const GluedGeomDet* gdet = static_cast<const GluedGeomDet*>(tracker->idToDet(matchedhit->geographicalId()));
80 
81  GlobalVector gtrkdirfwd = gdet->toGlobal(fwdptsod.parameters().momentum());
82  GlobalVector gtrkdirbwd = gdet->toGlobal(bwdptsod.parameters().momentum());
83  GlobalVector gtrkdirup = gdet->toGlobal(updatedptsod.parameters().momentum());
84  GlobalVector gtrkdirco = gdet->toGlobal(combinedptsod.parameters().momentum());
85 
86  const GeomDetUnit* monodet = gdet->monoDet();
87 
88  monofwd = monodet->toLocal(gtrkdirfwd);
89  monobwd = monodet->toLocal(gtrkdirbwd);
90  monoup = monodet->toLocal(gtrkdirup);
91  monoco = monodet->toLocal(gtrkdirco);
92 
93  pmonofwd = project(gdet, monodet, fwdptsod.parameters().position(), monofwd);
94  pmonobwd = project(gdet, monodet, bwdptsod.parameters().position(), monobwd);
95  pmonoup = project(gdet, monodet, updatedptsod.parameters().position(), monoup);
96  pmonoco = project(gdet, monodet, combinedptsod.parameters().position(), monoco);
97 
98  const GeomDetUnit* stereodet = gdet->stereoDet();
99 
100  stereofwd = stereodet->toLocal(gtrkdirfwd);
101  stereobwd = stereodet->toLocal(gtrkdirbwd);
102  stereoup = stereodet->toLocal(gtrkdirup);
103  stereoco = stereodet->toLocal(gtrkdirco);
104 
105  pstereofwd = project(gdet, stereodet, fwdptsod.parameters().position(), stereofwd);
106  pstereobwd = project(gdet, stereodet, bwdptsod.parameters().position(), stereobwd);
107  pstereoup = project(gdet, stereodet, updatedptsod.parameters().position(), stereoup);
108  pstereoco = project(gdet, stereodet, combinedptsod.parameters().position(), stereoco);
109 
110  } else if (phit) {
111  type = Projected;
112  const GluedGeomDet* gdet = static_cast<const GluedGeomDet*>(tracker->idToDet(phit->geographicalId()));
113 
114  GlobalVector gtrkdirfwd = gdet->toGlobal(fwdptsod.parameters().momentum());
115  GlobalVector gtrkdirbwd = gdet->toGlobal(bwdptsod.parameters().momentum());
116  GlobalVector gtrkdirup = gdet->toGlobal(updatedptsod.parameters().momentum());
117  GlobalVector gtrkdirco = gdet->toGlobal(combinedptsod.parameters().momentum());
118  const SiStripRecHit2D& originalhit = phit->originalHit();
119  const GeomDetUnit* det;
120  if (!StripSubdetector(originalhit.geographicalId().rawId()).stereo()) {
121  det = gdet->monoDet();
122  monofwd = det->toLocal(gtrkdirfwd);
123  monobwd = det->toLocal(gtrkdirbwd);
124  monoup = det->toLocal(gtrkdirup);
125  monoco = det->toLocal(gtrkdirco);
126  pmonofwd = project(gdet, det, fwdptsod.parameters().position(), monofwd);
127  pmonobwd = project(gdet, det, bwdptsod.parameters().position(), monobwd);
128  pmonoup = project(gdet, det, updatedptsod.parameters().position(), monoup);
129  pmonoco = project(gdet, det, combinedptsod.parameters().position(), monoco);
130  } else {
131  det = gdet->stereoDet();
132  stereofwd = det->toLocal(gtrkdirfwd);
133  stereobwd = det->toLocal(gtrkdirbwd);
134  stereoup = det->toLocal(gtrkdirup);
135  stereoco = det->toLocal(gtrkdirco);
136  pstereofwd = project(gdet, det, fwdptsod.parameters().position(), stereofwd);
137  pstereobwd = project(gdet, det, bwdptsod.parameters().position(), stereobwd);
138  pstereoup = project(gdet, det, updatedptsod.parameters().position(), stereoup);
139  pstereoco = project(gdet, det, combinedptsod.parameters().position(), stereoco);
140  }
141  }
143  if (!forwardPredictedStateTag_.empty())
144  states.insert(std::make_pair(
145  FwPredicted,
146  TrackingStateInfo(std::make_pair(monofwd, stereofwd), std::make_pair(pmonofwd, pstereofwd), fwdptsod)));
147  if (!backwardPredictedStateTag_.empty())
148  states.insert(std::make_pair(
149  BwPredicted,
150  TrackingStateInfo(std::make_pair(monobwd, stereobwd), std::make_pair(pmonobwd, pstereobwd), bwdptsod)));
151  if (!updatedStateTag_.empty())
152  states.insert(std::make_pair(
153  Updated,
154  TrackingStateInfo(std::make_pair(monoup, stereoup), std::make_pair(pmonoup, pstereoup), updatedptsod)));
155  if (!combinedStateTag_.empty())
156  states.insert(std::make_pair(
157  Combined,
158  TrackingStateInfo(std::make_pair(monoco, stereoco), std::make_pair(pmonoco, pstereoco), combinedptsod)));
159 
160  TrackingRecHitInfo tkRecHitInfo(type, states);
161 
162  if (j != 0) {
163  trajinfo.insert(std::make_pair(thehitref, tkRecHitInfo));
164  }
165  // else edm::LogInfo("TrackInfoProducer") << "RecHit not associated ";
166  }
167  //edm::LogInfo("TrackInfoProducer") << "Found "<<nhit<< " hits";
168  //if(fwdtrajinfo.size()!=nhit) edm::LogInfo("TrackInfoProducer") << "Number of trackinfos "<<fwdtrajinfo.size()<< " doesn't match!";
169  output = TrackInfo((traj_iterator->seed()), trajinfo);
170 }

References reco::BwPredicted, TrajectoryStateCombiner::combine(), reco::Combined, MillePedeFileConverter_cfg::e, reco::FwPredicted, TrackingRecHit::geographicalId(), mps_fire::i, dqmiolumiharvest::j, mag(), reco::Matched, LocalTrajectoryParameters::momentum(), GluedGeomDet::monoDet(), ProjectedSiStripRecHit2D::originalHit(), convertSQLitetoXML_cfg::output, PTrajectoryStateOnDet::parameters(), trajectoryStateTransform::persistentState(), LocalTrajectoryParameters::position(), reco::Projected, DetId::rawId(), reco::Single, GluedGeomDet::stereoDet(), GeomDet::toGlobal(), GeomDet::toLocal(), HLT_2018_cff::track, PbPb_ZMuSkimMuonDPG_cff::tracker, and reco::Updated.

Referenced by DTWorkflow.DTWorkflow::all(), Types.EventID::cppID(), Types.LuminosityBlockID::cppID(), o2olib.O2OTool::execute(), and TrackInfoProducer::produce().

Member Data Documentation

◆ backwardPredictedStateTag_

std::string TrackInfoProducerAlgorithm::backwardPredictedStateTag_
private

Definition at line 41 of file TrackInfoProducerAlgorithm.h.

◆ combinedStateTag_

std::string TrackInfoProducerAlgorithm::combinedStateTag_
private

Definition at line 41 of file TrackInfoProducerAlgorithm.h.

◆ conf_

edm::ParameterSet TrackInfoProducerAlgorithm::conf_
private

Definition at line 40 of file TrackInfoProducerAlgorithm.h.

◆ forwardPredictedStateTag_

std::string TrackInfoProducerAlgorithm::forwardPredictedStateTag_
private

Definition at line 41 of file TrackInfoProducerAlgorithm.h.

◆ updatedStateTag_

std::string TrackInfoProducerAlgorithm::updatedStateTag_
private

Definition at line 41 of file TrackInfoProducerAlgorithm.h.

Vector3DBase< float, LocalTag >
TrackInfoProducerAlgorithm::conf_
edm::ParameterSet conf_
Definition: TrackInfoProducerAlgorithm.h:40
mps_fire.i
i
Definition: mps_fire.py:355
GeomDet
Definition: GeomDet.h:27
reco::Combined
Definition: TrackInfoEnum.h:14
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
TrackInfoProducerAlgorithm::combinedStateTag_
std::string combinedStateTag_
Definition: TrackInfoProducerAlgorithm.h:41
TrackInfoProducerAlgorithm::project
LocalPoint project(const GeomDet *det, const GeomDet *projdet, LocalPoint position, LocalVector trackdirection) const
Definition: TrackInfoProducerAlgorithm.cc:172
trajectoryStateTransform::persistentState
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
Definition: TrajectoryStateTransform.cc:14
reco::TrackInfo
Definition: TrackInfo.h:23
pos
Definition: PixelAliasList.h:18
StripSubdetector
Definition: StripSubdetector.h:12
GluedGeomDet::monoDet
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:19
SiStripRecHit2D
Definition: SiStripRecHit2D.h:7
TrackingRecHit::geographicalId
DetId geographicalId() const
Definition: TrackingRecHit.h:120
ProjectedSiStripRecHit2D
Definition: ProjectedSiStripRecHit2D.h:8
edm::Ref
Definition: AssociativeIterator.h:58
reco::RecHitType
RecHitType
Definition: TrackInfoEnum.h:16
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
ConstRecHitPointer
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
Definition: MillePedeAlignmentAlgorithm.cc:75
LocalTrajectoryParameters::position
LocalPoint position() const
Local x and y position coordinates.
Definition: LocalTrajectoryParameters.h:85
TrackInfoProducerAlgorithm::forwardPredictedStateTag_
std::string forwardPredictedStateTag_
Definition: TrackInfoProducerAlgorithm.h:41
ProjectedSiStripRecHit2D::originalHit
SiStripRecHit2D originalHit() const
Definition: ProjectedSiStripRecHit2D.h:56
Point3DBase< float, GlobalTag >
GeomDet::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
GluedGeomDet
Definition: GluedGeomDet.h:7
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
Scenarios_cff.scale
scale
Definition: Scenarios_cff.py:2186
reco::Single
Definition: TrackInfoEnum.h:16
TrajectoryStateCombiner
Definition: TrajectoryStateCombiner.h:13
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
reco::BwPredicted
Definition: TrackInfoEnum.h:14
reco::TrackingRecHitInfo::TrackingStates
std::map< StateType, TrackingStateInfo > TrackingStates
Definition: TrackingRecHitInfo.h:25
reco::TrackInfo::TrajectoryInfo
std::map< TrackingRecHitRef, TrackingRecHitInfo > TrajectoryInfo
default constructor
Definition: TrackInfo.h:26
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
TrackInfoProducerAlgorithm::updatedStateTag_
std::string updatedStateTag_
Definition: TrackInfoProducerAlgorithm.h:41
TrackingRecHit
Definition: TrackingRecHit.h:21
GluedGeomDet::stereoDet
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:20
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::TrackingRecHitInfo
Definition: TrackingRecHitInfo.h:22
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
type
type
Definition: HCALResponse.h:21
reco::Matched
Definition: TrackInfoEnum.h:16
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
PTrajectoryStateOnDet::parameters
const LocalTrajectoryParameters & parameters() const
Definition: PTrajectoryStateOnDet.h:60
SiStripMatchedRecHit2D
Definition: SiStripMatchedRecHit2D.h:8
reco::TrackingStateInfo
Definition: TrackingStateInfo.h:20
LocalTrajectoryParameters::momentum
LocalVector momentum() const
Momentum vector in the local frame.
Definition: LocalTrajectoryParameters.h:88
TrajectoryStateCombiner::combine
TSOS combine(const TSOS &pTsos1, const TSOS &pTsos2) const
Definition: TrajectoryStateCombiner.cc:6
reco::FwPredicted
Definition: TrackInfoEnum.h:14
toLocal
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
Definition: ConversionProducer.h:192
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
PTrajectoryStateOnDet
Definition: PTrajectoryStateOnDet.h:10
reco::Updated
Definition: TrackInfoEnum.h:14
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
TrackInfoProducerAlgorithm::backwardPredictedStateTag_
std::string backwardPredictedStateTag_
Definition: TrackInfoProducerAlgorithm.h:41
reco::Projected
Definition: TrackInfoEnum.h:16
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37