1 #ifndef CombinedKinematicConstraintT_H
2 #define CombinedKinematicConstraintT_H
9 #if defined( __GXX_EXPERIMENTAL_CXX0X__)
17 template<
class TupleType,
size_t N>
21 static void call(TupleType&
t,
F f)
24 do_iterate<TupleType, N-1>::call(t,f);
27 static void call(TupleType
const & t,
F f)
30 do_iterate<TupleType, N-1>::call(t,f);
36 template<
class TupleType>
37 struct do_iterate<TupleType, 0>
40 static void call(TupleType&,
F)
43 static void call(TupleType
const &,
F)
47 template<
class TupleType,
typename F>
48 void iterate_tuple(TupleType& t,
F f)
53 template<
class TupleType,
typename F>
54 void iterate_tuple(TupleType
const& t,
F f)
60 namespace combinedConstraintHelpers {
65 typedef typename std::tuple_element<
N-1,TupleType>
::type Elem;
66 enum { nDim = Elem::nDim + totDim<TupleType,
N-1>::nDim};
69 template<
class TupleType>
70 struct totDim<TupleType, 0> {
75 void sum2(
T&
x,
T y) { x+=
y;}
88 struct PlaceValue :
public Place<DIM> {
89 PlaceValue(ROOT::Math::SVector<double, DIM> & iret) :
ret(iret){}
90 ROOT::Math::SVector<double, DIM> &
ret;
92 void operator()(
C const &
cs) {
98 template<
int DIM,
int NTRK>
99 struct PlaceParDer :
public Place<DIM> {
100 PlaceParDer(ROOT::Math::SMatrix<double, DIM, 7*NTRK> & iret) :
ret(iret){}
101 ROOT::Math::SMatrix<double, DIM, 7*NTRK> &
ret;
103 void operator()(
C const &
cs) {
105 ret.Place_at(cs.parametersDerivative(),this->
offset,0);
110 struct PlacePosDer :
public Place<DIM> {
111 PlacePosDer(ROOT::Math::SMatrix<double, DIM, 3> & iret) :
ret(iret){}
112 ROOT::Math::SMatrix<double, DIM, 3> &
ret;
114 void operator()(
C const &
cs) {
116 ret.Place_at(cs.positionDerivative(),this->
offset,0);
136 template<
class TupleType,
int NTRK >
143 typedef typename super::valueType
valueType;
147 typedef TupleType Constraints;
150 enum {
DIM = super::nDim};
158 virtual void init(
const std::vector<KinematicState>&
states,
161 std::bind(&
base::init,std::placeholders::_1,std::ref(states),std::ref(point), std::ref(mf)));
172 combinedConstraintHelpers::PlaceValue<DIM> helper(super::vl());
182 combinedConstraintHelpers::PlaceParDer<DIM,NTRK> helper(super::jac_d());
192 combinedConstraintHelpers::PlacePosDer<DIM> helper(super::jac_e());
202 iterate_tuple(
constraints,std::bind(combinedConstraintHelpers::sum2<int>,std::ref(tot),
203 std::bind(&base::numberOfEquations,std::placeholders::_1)
209 virtual CombinedKinematicConstraintT *
clone()
const
211 return new CombinedKinematicConstraintT(*
this);
219 #endif // __GXX_EXPERIMENTAL_CXX0X__
ROOT::Math::SMatrix< double, DIM, 3 > positionDerivativeType
auto_ptr< ClusterSequence > cs
ROOT::Math::SMatrix< double, DIM, 7 *NTRK > parametersDerivativeType
virtual int numberOfEquations() const =0
ROOT::Math::SVector< double, DIM > valueType
virtual void fillPositionDerivative() const =0
virtual MultiTrackKinematicConstraintBaseT * clone() const =0
virtual void fillParametersDerivative() const =0
virtual void init(const std::vector< KinematicState > &states, const GlobalPoint &point, const GlobalVector &mf)=0
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
virtual void fillValue() const =0
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point