BOSS 8.0.0
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
6# include "EventModel/EventHeader.h"
7# include "EvtRecEvent/EvtRecEvent.h"
8# include "EvtRecEvent/EvtRecTrack.h"
9
10HepLorentzVector getP4( RecEmcShower* gTrk ) {
11
12 double eraw = gTrk->energy();
13 double phi = gTrk->phi();
14 double the = gTrk->theta();
15
16 return HepLorentzVector( eraw * sin( the ) * cos( phi ), eraw * sin( the ) * sin( phi ),
17 eraw * cos( the ), eraw );
18}
19bool isGoodGamma( EvtRecTrack* gtrk ) {}
20struct GammaPair : public std::pair<EvtRecTrack*, EvtRecTrack*> {
21 GammaPair( EvtRecTrack* g1, EvtRecTrack* g2, double m /*, double s, double c*/ )
22 : First( g1 ), Second( g2 ), inv_m( m ) /*, chisq(s), cos_theta(c)*/ {
23 ;
24 }
27 double inv_m;
28 // double chisq;
29 // double cos_theta;
30};
31/*struct less_chisq: public binary_function <GammaPair, GammaPair, bool>
32{
33 bool operator()(const GammaPair& lgp, const GammaPair& rgp)
34 {
35 return lgp.chisq < rgp.chisq;
36 }
37};*/
38struct high_momentum : public binary_function<GammaPair, GammaPair, bool> {
39 bool operator()( const GammaPair& lgp, const GammaPair& rgp ) {
40 double p1 = ( getP4( lgp.First->emcShower() ) + getP4( lgp.Second->emcShower() ) ).rho();
41 double p2 = ( getP4( rgp.First->emcShower() ) + getP4( rgp.Second->emcShower() ) ).rho();
42 return p1 > p2;
43 }
44};
45struct Criteria {
46 Criteria( double inv_min = 0.10, double inv_max = 0.18 )
47 : _inv_min( inv_min ), _inv_max( inv_max ) {
48 ;
49 }
50 double _inv_min;
51 double _inv_max;
52 virtual bool check( const GammaPair& gp ) const {
53 // std::cout<<"gp.inv_m"<<gp.inv_m<<" inv_min"<<_inv_min<<std::endl;
54 if ( gp.inv_m > _inv_min && gp.inv_m < _inv_max ) return true;
55 else return false;
56 }
57};
58/*struct KFitCriteria : public Criteria
59{
60 KFitCriteria(double chisq_cut = 20., double costheta_cut = 0.98 ):
61_chisq_cut(chisq_cut),_costheta_cut(costheta_cut){;} double _chisq_cut; double _costheta_cut;
62 virtual bool check(const GammaPair& gp) const
63 {
64 // std::cout<<"gp.chisq"<<gp.chisq<<"
65chisq_cut"<<_chisq_cut<<std::endl; if(gp.chisq > _chisq_cut) return false;
66 if(fabs(gp.cos_theta) > _costheta_cut) return false;
67 return true;
68 }
69};*/
70/*struct helper : public Criteria
71{
72 helper(){;}
73 double mass(const GammaPair& gp) const{
74 EvtRecTrack* g1Trk = gp.First;
75 EvtRecTrack* g2Trk = gp.Second;
76
77 RecEmcShower* g1Shower = g1Trk->emcShower();
78 RecEmcShower* g2Shower = g2Trk->emcShower();
79 return (getP4(g1Shower)+getP4(g2Shower)).m();
80 }
81 double angle(const GammaPair& gp) const{
82 EvtRecTrack* g1Trk = gp.First;
83 EvtRecTrack* g2Trk = gp.Second;
84
85 RecEmcShower* g1Shower = g1Trk->emcShower();
86 RecEmcShower* g2Shower = g2Trk->emcShower();
87 return getP4(g1Shower).angle(getP4(g2Shower).vect());;
88 }
89};*/
90#endif
double p2[4]
double p1[4]
HepLorentzVector getP4(RecEmcShower *gTrk)
Definition Criteria.h:10
bool isGoodGamma(EvtRecTrack *gtrk)
Definition Criteria.h:19
TF1 * g1
double _inv_max
Definition Criteria.h:51
Criteria(double inv_min=0.10, double inv_max=0.18)
Definition Criteria.h:46
double _inv_min
Definition Criteria.h:50
virtual bool check(const GammaPair &gp) const
Definition Criteria.h:52
double inv_m
Definition Criteria.h:27
EvtRecTrack * Second
Definition Criteria.h:26
EvtRecTrack * First
Definition Criteria.h:25
GammaPair(EvtRecTrack *g1, EvtRecTrack *g2, double m)
Definition Criteria.h:21
bool operator()(const GammaPair &lgp, const GammaPair &rgp)
Definition Criteria.h:39