43 , _mapping(pat.size())
44 , _inverseMapping(pat.size())
56 , _mapping(pat.size())
57 , _inverseMapping(pat.size())
71 , _mapping(pat.size())
72 , _inverseMapping(pat.size())
89 ,
const std::vector<DalitzCoordinate>& lim
96 , _mapping(pat.size())
97 , _inverseMapping(pat.size())
105 , _mappedPat(other._mappedPat)
107 , _limits(other._limits)
108 , _mapping(other._mapping)
109 , _inverseMapping(other._inverseMapping)
128 for(
unsigned int i=0; i <
_limits.size(); i++){
145 for(
unsigned int i=1; i<
_pat.
size(); i++){
154 for(
unsigned int i=0; i< ptor.
size(); i++){
156 cout <<
" trying out mapping\n " <<
_mapping << endl;
162 for(
unsigned int i=0; i <
_pat.
size(); i++){
165 cout <<
"ERROR in MappedDalitzArea::findMapping()" 166 <<
"\n Index out of range: " << mappedIndex
169 throw "index out of range.";
171 cout <<
" mapped index of " << i <<
" = " << mappedIndex << endl;
175 cout <<
" using the following mapping:\n " 192 for(
unsigned int i=0; i <
_limits.size(); i++){
203 return mapP4(evt, mapping, p4);
208 , vector<TLorentzVector>& p4
214 for(
unsigned int i=0; i < n; i++){
215 int mappedIndex = mapping[i];
216 if(mappedIndex < 0 || mappedIndex + 1 > (
int) n){
217 cout <<
"ERROR in MappedDalitzArea::mapP4()" 218 <<
"\n Index out of range: " << mappedIndex
219 <<
" not in [0, " << n-1
221 throw "index out of range.";
223 p4[mappedIndex] = evt.
p(i);
233 static vector<TLorentzVector> p4;
241 std::vector<DalitzCoordinate> c(
_limits);
242 for(
unsigned int i=0; i < c.size(); i++){
243 c[i].setVal(0.5*(c[i].min() + c[i].max()));
263 vector<TLorentzVector> p4 =
272 vector<TLorentzVector> p4 =
284 for(
unsigned int i=0; i < dcList.size(); i++){
297 std::vector<MappedDalitzArea>
300 std::vector<MappedDalitzArea> newList;
301 if(n <=0 || LimitIndex >=
_limits.size()){
302 newList.push_back(*
this);
306 std::vector<DalitzCoordinate> splitLimits(
_limits[LimitIndex].
split(n));
307 for(
unsigned int i=0; i< splitLimits.size(); i++){
309 newArea._limits[LimitIndex] = splitLimits[i];
310 newArea.applyLimits();
311 newList.push_back(newArea);
317 std::vector<MappedDalitzArea>
319 std::vector<MappedDalitzArea> returnList;
320 if(n ==0 )
return returnList;
322 std::vector<MappedDalitzArea> newList;
323 returnList.push_back(*
this);
324 for(
unsigned int limitIndex=0; limitIndex<
_limits.size(); limitIndex++){
325 std::vector<MappedDalitzArea> thisIterationsList;
326 for(
unsigned int j=0; j < returnList.size(); j++){
327 std::vector<MappedDalitzArea> tempList =
328 returnList[j].split(limitIndex, n);
329 thisIterationsList.insert(thisIterationsList.end()
330 , tempList.begin(), tempList.end()
333 returnList = thisIterationsList;
339 std::vector<MappedDalitzArea>
342 std::vector<MappedDalitzArea> newList;
343 if(maxWidth <=0)
return newList;
344 if(LimitIndex >=
_limits.size())
return newList;
346 double width = 0.5*(
_limits[LimitIndex].max() -
_limits[LimitIndex].min());
349 cout <<
" MappedDalitzArea::splitIfWiderThan: splitting " 352 unsigned int n = 2*((
unsigned int) fabs(width/maxWidth)) + 1;
353 cout << n <<
" pieces." << endl;
355 std::vector<DalitzCoordinate> splitLimits(
_limits[LimitIndex].
split(n));
356 for(
unsigned int i=0; i< splitLimits.size(); i++){
358 newArea._limits[LimitIndex] = splitLimits[i];
359 newArea.applyLimits();
360 newList.push_back(newArea);
366 std::vector<MappedDalitzArea>
368 std::vector<MappedDalitzArea> returnList;
369 if(maxWidth <= 0 )
return returnList;
371 std::vector<MappedDalitzArea> newList;
372 returnList.push_back(*
this);
373 for(
unsigned int limitIndex=0; limitIndex<
_limits.size(); limitIndex++){
374 std::vector<MappedDalitzArea> thisIterationsList;
375 for(
unsigned int j=0; j < returnList.size(); j++){
376 std::vector<MappedDalitzArea> tempList =
377 returnList[j].splitIfWiderThan(limitIndex, maxWidth);
378 thisIterationsList.insert(thisIterationsList.end()
379 , tempList.begin(), tempList.end()
382 returnList = thisIterationsList;
391 for(
unsigned int i=0; i <
_limits.size(); i++){
393 for(
unsigned int j=0; j < dc.
size(); j++){
406 if(k >=0)v.push_back(k);
413 double epsilon = 1.e-4;
414 for(
unsigned int i=0; i <
_limits.size(); i++){
416 for(
unsigned int j=0; j <
_limits[i].size(); j++){
434 for(
unsigned int i=0; i <
_limits.size(); i++){
437 for(
unsigned int j=0; j <
_limits[i].size(); j++){
452 return this->
less(rhs);
455 return (this->
less(rhs) || (*
this) == rhs);
458 return ! ((*this) < rhs || (*this) == rhs);
461 return ! ((*this) < rhs);
466 for(
unsigned int i=0; i <
_limits.size(); i++){
473 return ! ( (*this) == rhs);
478 os <<
" MappedDalitzArea " 480 for(
unsigned int i=0; i <
_limits.size(); i++){
481 os <<
"\n " <<
_limits[i] << endl;
485 <<
"\n area: " <<
_area;
bool operator<=(const MappedDalitzArea &rhs) const
void setPattern(const DalitzEventPattern &pat)
static std::vector< TLorentzVector > mapP4(const DalitzEvent &evt, const Permutation &mapping)
bool I_am_Consecutive() const
bool operator<(const MappedDalitzArea &rhs) const
void push_back(const T &c)
bool setRnd(TRandom *rnd=gRandom)
bool isInside(const IDalitzEvent &evt) const
virtual const DalitzEventPattern & eventPattern() const
bool operator>(const MappedDalitzArea &rhs) const
bool operator>=(const MappedDalitzArea &rhs) const
std::vector< DalitzCoordinate > _limits
std::vector< MappedDalitzArea > split(unsigned int nWays) const
MINT::counted_ptr< DalitzEvent > makeEventForOwner() const
std::vector< MappedDalitzArea > splitIfWiderThan(double maxWidth) const
bool allConsecutive() const
void encloseInPhaseSpaceArea(double safetyFactor=1.0)
bool setCoordinate(const DalitzCoordinate &c)
DalitzEventPattern _mappedPat
std::ostream & operator<<(std::ostream &os, const MappedDalitzArea &mda)
MINT::counted_ptr< DalitzEvent > makeEventForOwner() const
std::vector< DalitzCoordinate > centre() const
DalitzCoordinate mapMe(const Permutation &perm) const
bool operator==(const MappedDalitzArea &ma) const
bool similar(const MappedDalitzArea &ma) const
virtual const TLorentzVector & p(unsigned int i) const
MappedDalitzArea & operator=(const MappedDalitzArea &other)
bool setRnd(TRandom *rnd=gRandom)
unsigned int size() const
bool operator!=(const MappedDalitzArea &ma) const
bool less(const MappedDalitzArea &ma) const
bool isInside(const DalitzEvent &evt) const
DalitzCoordinate limit_s(const std::vector< int > &indices) const
Permutation _inverseMapping
virtual ~MappedDalitzArea()
void print(std::ostream &os=std::cout) const
Permutation getInverse() const