MINT2
SpinFactor.h
Go to the documentation of this file.
1 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
2 // status: Mon 9 Feb 2009 19:18:13 GMT
3 #ifndef SPINFACTOR
4 #define SPINFACTOR
5 
7 #include "Mint/ISpinFactor.h"
8 #include "Mint/counted_ptr.h"
9 #include "Mint/CachedByEvent.h"
10 #include "Mint/FitParDependent.h"
11 #include "Mint/CachedByEvent.h"
12 #include "Mint/NamedParameter.h"
13 
14 #include "TLorentzVector.h"
15 
16 #include <string>
17 #include <iostream>
18 
19 class SpinFactor
20 : virtual public MINT::IReturnRealForEvent<IDalitzEvent>
21 , virtual public MINT::IReturnComplexForEvent<IDalitzEvent>
22 , public CachedByEvent<std::complex<double> >
23 , public MINT::FitParDependent
24 , virtual public ISpinFactor{
25  protected:
26  // AssociatingDecayTree _associatingDecayTree;
28  int _nFinal;
29  TLorentzVector p(int i, IDalitzEvent& evt);
30  std::vector<MINT::const_counted_ptr<AssociatedDecayTree> > fsPS; // final state PseudoScalars.
32 
33  public:
34  virtual double getVal(IDalitzEvent& evt)=0;
35  virtual double RealVal(IDalitzEvent& evt){return getVal(evt);}// some dublication here...
36  virtual std::complex<double> ComplexVal(IDalitzEvent& evt){
37  //return getNewVal(evt);
38  return getValWithCachingPermutation(evt);
39  //return std::complex<double>(getVal(evt),0);
40  }
41  virtual std::complex<double> getNewVal(IDalitzEvent& evt){return std::complex<double>(getVal(evt),0);}
42 
43 
44  double mRes(const AssociatedDecayTreeItem& adt, IDalitzEvent& evt);
46  , IDalitzEvent& evt);
47  // will return PDG mass, exceept for "non-resonant particles",
48  // where it's the reconstructed mass.
49 
50  const AssociatedDecayTree& theDecay() const{
51  return _theDecay;
52  }
53  // for backward comp.
55  return _theDecay;
56  }
57 
58  //const AssociatedDecayTree& theDecay(const DalitzEventPattern& pat) const{
59  //return _associatingDecayTree.getTree(pat);
60  // This returns the tree associated with the amplitude/spin factor
61  // not the tree associated with the event. The only reason to
62  // take the eventPattern is to re-order the final state
63  // as in the event. But the mother particle is that of the amplitude
64  // spin factor, and this is what defines, for example, if it is
65  // treated as D0 or D0bar event.
66  //}
68  return theDecay(evt.eventPattern()); // for backw. compatibility
69  }
70  //DecayTree theBareDecay() const{
71  // return _theDecay
72  //}
73 
74  SpinFactor(const AssociatedDecayTree& decay, int nFinal=3)
77  , ISpinFactor()
78  //, _associatingDecayTree(decay)
79  , _theDecay(decay)
80  , _nFinal(nFinal)
81  , fsPS(nFinal, (MINT::const_counted_ptr<AssociatedDecayTree>) 0)
82  , _useZemachTensors("useZemachTensors",1,MINT::NamedParameterBase::QUIET)
83  {}
84 
85  SpinFactor(const SpinFactor& other) // just create a new one
88  , ISpinFactor()
89  , CachedByEvent(other)
90  , FitParDependent(other)
91  // , _associatingDecayTree(other._associatingDecayTree)
92  , _theDecay(other._theDecay)
93  , _nFinal(other._nFinal)
94  , fsPS(other._nFinal, (MINT::const_counted_ptr<AssociatedDecayTree>) 0)
95  , _useZemachTensors("useZemachTensors",1,MINT::NamedParameterBase::QUIET)
96  {}
97  virtual void printYourself(std::ostream& os=std::cout) const=0;
98  virtual void printParsing(std::ostream& os=std::cout) const;
100 
101  virtual const DecayTree& exampleDecay()=0;
102  virtual std::string name() const=0;
103 };
104 
105 #endif
106 //
virtual std::complex< double > getNewVal(IDalitzEvent &evt)
Definition: SpinFactor.h:41
FitParDependent(IFitParRegister *daddy=0)
virtual std::complex< double > ComplexVal(IDalitzEvent &evt)
Definition: SpinFactor.h:36
virtual ~SpinFactor()
Definition: SpinFactor.h:99
std::vector< MINT::const_counted_ptr< AssociatedDecayTree > > fsPS
Definition: SpinFactor.h:30
SpinFactor(const AssociatedDecayTree &decay, int nFinal=3)
Definition: SpinFactor.h:74
virtual const DecayTree & exampleDecay()=0
virtual void printParsing(std::ostream &os=std::cout) const
Definition: SpinFactor.cpp:57
int _nFinal
Definition: SpinFactor.h:28
virtual std::string name() const =0
virtual double RealVal(IDalitzEvent &evt)
Definition: SpinFactor.h:35
MINT::NamedParameter< int > _useZemachTensors
Definition: SpinFactor.h:31
TLorentzVector p(int i, IDalitzEvent &evt)
Definition: SpinFactor.cpp:11
virtual void printYourself(std::ostream &os=std::cout) const =0
virtual const DalitzEventPattern & eventPattern() const =0
double mRes(const AssociatedDecayTreeItem &adt, IDalitzEvent &evt)
Definition: SpinFactor.cpp:53
const AssociatedDecayTree & theDecay() const
Definition: SpinFactor.h:50
SpinFactor(const SpinFactor &other)
Definition: SpinFactor.h:85
const AssociatedDecayTree & theDecay(IDalitzEvent &evt) const
Definition: SpinFactor.h:67
const AssociatedDecayTree & theDecay(const DalitzEventPattern &) const
Definition: SpinFactor.h:54
const AssociatedDecayTree & _theDecay
Definition: SpinFactor.h:27
virtual double getVal(IDalitzEvent &evt)=0
std::complex< double > getValWithCachingPermutation(IDalitzEvent &evt)
Definition: CachedByEvent.h:93