CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GhostTrack.cc
Go to the documentation of this file.
1 #include <vector>
2 
5 
7 
11 
12 using namespace reco;
13 
14 void GhostTrack::initStates(const std::vector<TransientTrack> &tracks,
15  const std::vector<float> &weights, double offset)
16 {
17  std::vector<float>::const_iterator weight = weights.begin();
18  for(std::vector<TransientTrack>::const_iterator iter = tracks.begin();
19  iter != tracks.end(); ++iter) {
20  GhostTrackState state(*iter);
21  state.linearize(prediction_, true, offset);
22  if (weight != weights.end())
23  state.setWeight(*weight++);
24 
25  states_.push_back(state);
26  }
27 }
28 
30  const GhostTrackPrediction &prediction,
31  const std::vector<TransientTrack> &tracks,
32  double ndof, double chi2,
33  const std::vector<float> &weights,
34  const GlobalPoint &origin,
35  bool withOrigin) :
36  prediction_(prediction), prior_(prior),
37  ndof_(ndof), chi2_(chi2)
38 {
39  initStates(tracks, weights,
40  withOrigin ? prediction_.lambda(origin) : 0.);
41 }
42 
43 GhostTrack::GhostTrack(const Track &ghostTrack,
44  const std::vector<TransientTrack> &tracks,
45  const std::vector<float> &weights,
47  const GlobalPoint &origin,
48  bool withOrigin) :
49  prediction_(ghostTrack), prior_(prior),
50  ndof_(ghostTrack.ndof()), chi2_(ghostTrack.chi2())
51 {
52  initStates(tracks, weights,
53  withOrigin ? prediction_.lambda(origin) : 0.);
54 }
double lambda(const GlobalPoint &point) const
void setWeight(double weight)
void initStates(const std::vector< TransientTrack > &tracks, const std::vector< float > &weights, double offset)
Definition: GhostTrack.cc:14
std::vector< GhostTrackState > states_
Definition: GhostTrack.h:56
GhostTrackPrediction prediction_
Definition: GhostTrack.h:54
unsigned int offset(bool)
tuple tracks
Definition: testEve_cfg.py:39
bool linearize(const GhostTrackPrediction &pred, bool initial=false, double lambda=0.)
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalPoint
point in global coordinate system
Definition: Point3D.h:17
dictionary prior
GhostTrack(const GhostTrackPrediction &prior, const GhostTrackPrediction &prediction, const std::vector< GhostTrackState > &states, double ndof, double chi2)
Definition: GhostTrack.h:18
int weight
Definition: histoStyle.py:50