BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
Criteria.h
Go to the documentation of this file.
1#ifndef CRITERIA__H
2#define CRITERAI__H
3
4#include "GaudiKernel/SmartDataPtr.h"
5
9
10HepLorentzVector getP4(RecEmcShower* gTrk)
11{
12
13 double eraw = gTrk->energy();
14 double phi = gTrk->phi();
15 double the = gTrk->theta();
16
17 return HepLorentzVector( eraw * sin(the) * cos(phi),
18 eraw * sin(the) * sin(phi),
19 eraw * cos(the),
20 eraw );
21}
23{
24
25}
26struct GammaPair : public std::pair<EvtRecTrack*,EvtRecTrack*>
27{
28 GammaPair(EvtRecTrack* g1, EvtRecTrack* g2, double m/*, double s, double c*/)
29 :First(g1), Second(g2), inv_m(m)/*, chisq(s), cos_theta(c)*/{;}
32 double inv_m;
33// double chisq;
34// double cos_theta;
35};
36/*struct less_chisq: public binary_function <GammaPair, GammaPair, bool>
37{
38 bool operator()(const GammaPair& lgp, const GammaPair& rgp)
39 {
40 return lgp.chisq < rgp.chisq;
41 }
42};*/
43struct high_momentum: public binary_function <GammaPair, GammaPair, bool>
44{
45 bool operator()(const GammaPair& lgp, const GammaPair& rgp)
46 {
47 double p1 = (getP4(lgp.First->emcShower())+ getP4(lgp.Second->emcShower())).rho();
48 double p2 = (getP4(rgp.First->emcShower())+ getP4(rgp.Second->emcShower())).rho();
49 return p1 > p2;
50 }
51};
53{
54 Criteria(double inv_min = 0.10, double inv_max = 0.18):_inv_min(inv_min), _inv_max(inv_max){;}
55 double _inv_min;
56 double _inv_max;
57 virtual bool check(const GammaPair& gp) const
58 {
59 // std::cout<<"gp.inv_m"<<gp.inv_m<<" inv_min"<<_inv_min<<std::endl;
60 if( gp.inv_m> _inv_min && gp.inv_m < _inv_max) return true;
61 else return false;
62 }
63};
64/*struct KFitCriteria : public Criteria
65{
66 KFitCriteria(double chisq_cut = 20., double costheta_cut = 0.98 ): _chisq_cut(chisq_cut),_costheta_cut(costheta_cut){;}
67 double _chisq_cut;
68 double _costheta_cut;
69 virtual bool check(const GammaPair& gp) const
70 {
71 // std::cout<<"gp.chisq"<<gp.chisq<<" chisq_cut"<<_chisq_cut<<std::endl;
72 if(gp.chisq > _chisq_cut) return false;
73 if(fabs(gp.cos_theta) > _costheta_cut) return false;
74 return true;
75 }
76};*/
77/*struct helper : public Criteria
78{
79 helper(){;}
80 double mass(const GammaPair& gp) const{
81 EvtRecTrack* g1Trk = gp.First;
82 EvtRecTrack* g2Trk = gp.Second;
83
84 RecEmcShower* g1Shower = g1Trk->emcShower();
85 RecEmcShower* g2Shower = g2Trk->emcShower();
86 return (getP4(g1Shower)+getP4(g2Shower)).m();
87 }
88 double angle(const GammaPair& gp) const{
89 EvtRecTrack* g1Trk = gp.First;
90 EvtRecTrack* g2Trk = gp.Second;
91
92 RecEmcShower* g1Shower = g1Trk->emcShower();
93 RecEmcShower* g2Shower = g2Trk->emcShower();
94 return getP4(g1Shower).angle(getP4(g2Shower).vect());;
95 }
96};*/
97#endif
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
HepLorentzVector getP4(RecEmcShower *gTrk)
Definition: Criteria.h:10
bool isGoodGamma(EvtRecTrack *gtrk)
Definition: Criteria.h:22
double theta() const
Definition: DstEmcShower.h:38
double phi() const
Definition: DstEmcShower.h:39
double energy() const
Definition: DstEmcShower.h:45
RecEmcShower * emcShower()
Definition: EvtRecTrack.h:58
double _inv_max
Definition: Criteria.h:56
Criteria(double inv_min=0.10, double inv_max=0.18)
Definition: Criteria.h:54
double _inv_min
Definition: Criteria.h:55
virtual bool check(const GammaPair &gp) const
Definition: Criteria.h:57
double inv_m
Definition: Criteria.h:32
EvtRecTrack * Second
Definition: Criteria.h:31
EvtRecTrack * First
Definition: Criteria.h:30
GammaPair(EvtRecTrack *g1, EvtRecTrack *g2, double m)
Definition: Criteria.h:28
bool operator()(const GammaPair &lgp, const GammaPair &rgp)
Definition: Criteria.h:45