CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GsfCombinedMaterialEffectsUpdator.cc
Go to the documentation of this file.
3 // #include "CommonReco/MaterialEffects/interface/MultipleScatteringUpdator.h"
4 // #include "CommonReco/MaterialEffects/interface/EnergyLossUpdator.h"
6 
7 // GsfCombinedMaterialEffectsUpdator::GsfCombinedMaterialEffectsUpdator () :
8 // GsfMaterialEffectsUpdator()
9 // {
10 // createUpdators(mass());
11 // }
12 
13 // GsfCombinedMaterialEffectsUpdator::GsfCombinedMaterialEffectsUpdator (float mass) :
14 // GsfMaterialEffectsUpdator(mass)
15 // {
16 // createUpdators(mass);
17 // }
18 
21  GsfMaterialEffectsUpdator& elUpdator) :
22  GsfMaterialEffectsUpdator(msUpdator.mass()),
23  theMSUpdator(msUpdator.clone()),
24  theELUpdator(elUpdator.clone()) {}
25 
26 // void
27 // GsfCombinedMaterialEffectsUpdator::createUpdators (const float mass)
28 // {
29 // //
30 // // multiple scattering
31 // //
32 // theMSUpdator = new GsfMaterialEffectsAdapter(MultipleScatteringUpdator(mass));
33 // //
34 // // energy loss: two different objects for electrons / others
35 // //
36 // if ( mass>0.001 )
37 // theELUpdator = new GsfMaterialEffectsAdapter(EnergyLossUpdator(mass));
38 // else
39 // theELUpdator = new GsfBetheHeitlerUpdator();
40 // }
41 
42 //
43 // Computation: combine updates on momentum and cov. matrix from the multiple
44 // scattering and energy loss updators and store them in private data members
45 //
47  const PropagationDirection propDir) const
48 {
49  //
50  // reset components
51  //
52  theWeights.clear();
53  theDeltaPs.clear();
54  theDeltaCovs.clear();
55  //
56  // get components from multiple scattering
57  //
58  std::vector<double> msWeights = theMSUpdator->weights(TSoS,propDir);
59  std::vector<double> msDeltaPs = theMSUpdator->deltaPs(TSoS,propDir);
60  std::vector<AlgebraicSymMatrix55> msDeltaCovs = theMSUpdator->deltaLocalErrors(TSoS,propDir);
61  if ( msWeights.empty() ) {
62  //
63  // create one dummy component
64  //
65  msWeights.push_back(1.);
66  msDeltaPs.push_back(0.);
67  msDeltaCovs.push_back(AlgebraicSymMatrix55());
68  }
69  //
70  // get components from energy loss
71  //
72  std::vector<double> elWeights = theELUpdator->weights(TSoS,propDir);
73  std::vector<double> elDeltaPs = theELUpdator->deltaPs(TSoS,propDir);
74  std::vector<AlgebraicSymMatrix55> elDeltaCovs = theELUpdator->deltaLocalErrors(TSoS,propDir);
75  if ( elWeights.empty() ) {
76  //
77  // create one dummy component
78  //
79  elWeights.push_back(1.);
80  elDeltaPs.push_back(0.);
81  elDeltaCovs.push_back(AlgebraicSymMatrix55());
82  }
83  //
84  // combine the two multi-updates
85  //
86  std::vector<double>::const_iterator iMsWgt(msWeights.begin());
87  std::vector<double>::const_iterator iMsDp(msDeltaPs.begin());
88  std::vector<AlgebraicSymMatrix55>::const_iterator iMsDc(msDeltaCovs.begin());
89  for ( ; iMsWgt<msWeights.end(); iMsWgt++,iMsDp++,iMsDc++ ) {
90 
91  std::vector<double>::const_iterator iElWgt(elWeights.begin());
92  std::vector<double>::const_iterator iElDp(elDeltaPs.begin());
93  std::vector<AlgebraicSymMatrix55>::const_iterator iElDc(elDeltaCovs.begin());
94  for ( ; iElWgt<elWeights.end(); iElWgt++,iElDp++,iElDc++ ) {
95  theWeights.push_back((*iMsWgt)*(*iElWgt));
96  theDeltaPs.push_back((*iMsDp)+(*iElDp));
97  theDeltaCovs.push_back((*iMsDc)+(*iElDc));
98  }
99  }
100 
101 }
102 
std::vector< AlgebraicSymMatrix55 > theDeltaCovs
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
PropagationDirection
virtual GsfMaterialEffectsUpdator * clone() const =0
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection) const
virtual std::vector< double > deltaPs(const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
GsfCombinedMaterialEffectsUpdator(GsfMaterialEffectsUpdator &msUpdator, GsfMaterialEffectsUpdator &elUpdator)
Constructor from multiple scattering and energy loss updator.
virtual std::vector< AlgebraicSymMatrix55 > deltaLocalErrors(const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
DeepCopyPointerByClone< GsfMaterialEffectsUpdator > theMSUpdator
virtual std::vector< double > weights(const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
DeepCopyPointerByClone< GsfMaterialEffectsUpdator > theELUpdator