MINT2
MappedDalitzBWArea.h
Go to the documentation of this file.
1 #ifndef MAPPED_DALITZ_BW_AREA_HH
2 #define MAPPED_DALITZ_BW_AREA_HH
3 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
4 // status: Mon 9 Feb 2009 19:17:58 GMT
5 
6 #include "Mint/DalitzBWArea.h"
9 #include "Mint/Permutation.h"
10 #include "Mint/DalitzEvent.h"
11 
12 #include "TRandom.h"
13 #include "TLorentzVector.h"
14 
15 #include "Mint/counted_ptr.h"
16 #include "Mint/IGenFct.h"
17 
18 #include <vector>
19 #include <iostream>
20 
22  TRandom* _rnd;
23 
25 
27 
28  std::vector<MINT::counted_ptr<IGenFct> > _limits;
29 
31 
32  void setup();
33  void findMapping();
34  void applyLimits();
35 
36  bool allConsecutive() const;
37  bool allStandardised() const;
38 
39  /*
40  static std::vector<TLorentzVector> mapP4(const DalitzEvent& evt
41  , const Permutation& mapping
42  );
43  static std::vector<TLorentzVector>& mapP4(const DalitzEvent& evt
44  , const Permutation& mapping
45  , std::vector<TLorentzVector>& p4
46  );
47  */
48 
49  std::vector<TLorentzVector>& mapP4(const DalitzEvent& evt
50  , const Permutation& mapping
51  , std::vector<TLorentzVector>& p4
52  ) const{
53  unsigned int n = evt.eventPattern().size();
54  p4.resize(n);
55  for(unsigned int i=0; i < n; i++){
56  int mappedIndex = mapping[i];
57  if(mappedIndex < 0 || mappedIndex + 1 > (int) n){
58  std::cout << "ERROR in MappedDalitzBWArea::mapP4()"
59  << "\n Index out of range: " << mappedIndex
60  << " not in [0, " << n-1
61  << std::endl;
62  throw "index out of range.";
63  }
64  p4[mappedIndex] = evt.p(i);
65  }
66  return p4;
67  }
68  std::vector<TLorentzVector> mapP4(const DalitzEvent& evt
69  , const Permutation& mapping
70  ) const{
71  std::vector<TLorentzVector> p4(evt.eventPattern().size());
72  return mapP4(evt, mapping, p4);
73  }
74 
75  public:
78  , TRandom* rnd=gRandom);
80  , const MINT::counted_ptr<IGenFct>& oneFunction
81  , TRandom* rnd=gRandom);
83  , const MINT::counted_ptr<IGenFct>& oneFunction
84  , const MINT::counted_ptr<IGenFct>& otherFunction
85  , TRandom* rnd=gRandom);
87  , const std::vector<MINT::counted_ptr<IGenFct> >& functions
88  , TRandom* rnd=gRandom);
89 
91 
92  virtual ~MappedDalitzBWArea();
93 
94  bool checkIntegration() const{
95  return _area.checkIntegration();}
96 
98 
99  bool isInside(const DalitzEvent& evt) const;
100  bool isInside(const DalitzCoordinate& dc) const;
101  bool isInside(const std::vector<DalitzCoordinate>& dcList) const;
102 
103  double genValue(const DalitzEvent& evt) const;
104 
105  double size() const{
106  return _area.size();}
107  double integral() const{
108  return _area.integral();
109  }
110  void setUnWeightPs(bool doSo=true){_area.setUnWeightPs(doSo);}
111  bool unWeightPs(){return _area.unWeightPs();}
112 
113  void print(std::ostream& os = std::cout) const;
114 
115  MINT::counted_ptr<IGenFct> fct_for_s(const std::vector<int>& indices) const;
116  MINT::counted_ptr<IGenFct> fct_for_s(int i, int j, int k=-1) const;
117 
119 
120  bool setRnd(TRandom* rnd=gRandom);
121 };
122 
123 std::ostream& operator<<(std::ostream& os, const MappedDalitzBWArea& mda);
124 
125 #endif
126 //
double integral() const
DalitzEventPattern _pat
bool setRnd(TRandom *rnd=gRandom)
virtual const DalitzEventPattern & eventPattern() const
Definition: DalitzEvent.h:173
std::vector< TLorentzVector > & mapP4(const DalitzEvent &evt, const Permutation &mapping, std::vector< TLorentzVector > &p4) const
MINT::counted_ptr< DalitzEvent > tryEventForOwner() const
DalitzEventPattern _mappedPat
void setUnWeightPs(bool doSo=true)
std::vector< MINT::counted_ptr< IGenFct > > _limits
void setUnWeightPs(bool doSo=true)
Definition: DalitzBWArea.h:125
bool isInside(const DalitzEvent &evt) const
MINT::counted_ptr< IGenFct > fct_for_s(const std::vector< int > &indices) const
bool checkIntegration() const
virtual const TLorentzVector & p(unsigned int i) const
unsigned int size() const
Permutation _inverseMapping
bool unWeightPs() const
Definition: DalitzBWArea.h:124
double size() const
MappedDalitzBWArea & operator=(const MappedDalitzBWArea &other)
bool checkIntegration() const
double genValue(const DalitzEvent &evt) const
double integral() const
std::vector< TLorentzVector > mapP4(const DalitzEvent &evt, const Permutation &mapping) const
std::ostream & operator<<(std::ostream &os, const MappedDalitzBWArea &mda)
void print(std::ostream &os=std::cout) const