Ticket #223: C7_615.C
File C7_615.C, 9.8 KB (added by , 12 years ago) |
---|
Line | |
---|---|
1 | #include "PHASIC++/Channels/Single_Channel.H" |
2 | #include "ATOOLS/Org/Run_Parameter.H" |
3 | #include "PHASIC++/Channels/Channel_Elements.H" |
4 | #include "PHASIC++/Channels/Vegas.H" |
5 | |
6 | using namespace PHASIC; |
7 | using namespace ATOOLS; |
8 | |
9 | namespace PHASIC { |
10 | class C7_615 : public Single_Channel { |
11 | double m_amct,m_alpha,m_ctmax,m_ctmin; |
12 | Info_Key m_kTC23_0_378_1_26_5_4,m_kTC24_0_8_1_6_7_2345,m_kTC24_0_8_1__23457_6,m_kTC_0_78_1_26_3_45,m_kTC_0_78_1_6_345_2,m_kTC_0__1__8_234567,m_kZS_0; |
13 | Vegas* p_vegas; |
14 | public: |
15 | C7_615(int,int,Flavour*,Integration_Info * const); |
16 | ~C7_615(); |
17 | void GenerateWeight(Vec4D *,Cut_Data *); |
18 | void GeneratePoint(Vec4D *,Cut_Data *,double *); |
19 | void AddPoint(double); |
20 | void MPISync() { p_vegas->MPISync(); } |
21 | void Optimize() { p_vegas->Optimize(); } |
22 | void EndOptimize() { p_vegas->EndOptimize(); } |
23 | void WriteOut(std::string pId) { p_vegas->WriteOut(pId); } |
24 | void ReadIn(std::string pId) { p_vegas->ReadIn(pId); } |
25 | void ISRInfo(int &,double &,double &); |
26 | std::string ChID(); |
27 | }; |
28 | } |
29 | |
30 | extern "C" Single_Channel * Getter_C7_615(int nin,int nout,Flavour* fl,Integration_Info * const info) { |
31 | return new C7_615(nin,nout,fl,info); |
32 | } |
33 | |
34 | void C7_615::GeneratePoint(Vec4D * p,Cut_Data * cuts,double * _ran) |
35 | { |
36 | double *ran = p_vegas->GeneratePoint(_ran); |
37 | for(int i=0;i<rannum;i++) rans[i]=ran[i]; |
38 | Vec4D p2345678=p[0]+p[1]; |
39 | double s2345678_max = p2345678.Abs2(); |
40 | double s234567_max = sqr(sqrt(s2345678_max)-sqrt(ms[8])); |
41 | double s6 = ms[6]; |
42 | double s68_min = cuts->Getscut(std::string("68")); |
43 | double s23457_max = sqr(sqrt(s2345678_max)-sqrt(s68_min)); |
44 | double s678_min = cuts->Getscut(std::string("678")); |
45 | double s2345_max = sqr(sqrt(s2345678_max)-sqrt(s678_min)); |
46 | double s2 = ms[2]; |
47 | double s2678_min = cuts->Getscut(std::string("2678")); |
48 | double s345_max = sqr(sqrt(s2345678_max)-sqrt(s2678_min)); |
49 | double s23678_min = cuts->Getscut(std::string("23678")); |
50 | double s45_max = sqr(sqrt(s2345678_max)-sqrt(s23678_min)); |
51 | double s4 = ms[4]; |
52 | double s5 = ms[5]; |
53 | double s45_min = cuts->Getscut(std::string("45")); |
54 | Vec4D p45; |
55 | double s45 = CE.ThresholdMomenta(1.5,4.*sqrt(s45_min),s45_min,s45_max,ran[0]); |
56 | double s3 = ms[3]; |
57 | double s345_min = cuts->Getscut(std::string("345")); |
58 | s345_min = Max(s345_min,sqr(sqrt(s3)+sqrt(s45))); |
59 | Vec4D p345; |
60 | double s345 = CE.ThresholdMomenta(1.5,2.*sqrt(s345_min),s345_min,s345_max,ran[1]); |
61 | double s2345_min = cuts->Getscut(std::string("2345")); |
62 | s2345_min = Max(s2345_min,sqr(sqrt(s345)+sqrt(s2))); |
63 | Vec4D p2345; |
64 | double s2345 = CE.ThresholdMomenta(1.5,2.*sqrt(s2345_min),s2345_min,s2345_max,ran[2]); |
65 | double s7 = ms[7]; |
66 | double s23457_min = cuts->Getscut(std::string("23457")); |
67 | s23457_min = Max(s23457_min,sqr(sqrt(s7)+sqrt(s2345))); |
68 | Vec4D p23457; |
69 | double s23457 = CE.ThresholdMomenta(1.5,2.*sqrt(s23457_min),s23457_min,s23457_max,ran[3]); |
70 | double s234567_min = cuts->Getscut(std::string("234567")); |
71 | s234567_min = Max(s234567_min,sqr(sqrt(s23457)+sqrt(s6))); |
72 | Vec4D p234567; |
73 | double s234567 = CE.ThresholdMomenta(1.5,2.*sqrt(s234567_min),s234567_min,s234567_max,ran[4]); |
74 | double s8 = ms[8]; |
75 | m_ctmax = cuts->cosmax[0][8]; |
76 | m_ctmin = cuts->cosmin[0][8]; |
77 | CE.TChannelMomenta(p[0],p[1],p[8],p234567,s8,s234567,0.,m_alpha,m_ctmax,m_ctmin,m_amct,0,ran[5],ran[6]); |
78 | double tmass206 = Flavour((kf_code)(24)).Mass(); |
79 | Vec4D p0_8 = p[0]-p[8]; |
80 | CE.TChannelMomenta(p0_8,p[1],p23457,p[6],s23457,s6,tmass206,m_alpha,1.,-1.,m_amct,0,ran[7],ran[8]); |
81 | double tmass202 = Flavour((kf_code)(24)).Mass(); |
82 | Vec4D p1_6 = p[1]-p[6]; |
83 | CE.TChannelMomenta(p0_8,p1_6,p[7],p2345,s7,s2345,tmass202,m_alpha,1.,-1.,m_amct,0,ran[9],ran[10]); |
84 | Vec4D p0_78 = p0_8-p[7]; |
85 | CE.TChannelMomenta(p0_78,p1_6,p345,p[2],s345,s2,0.,m_alpha,1.,-1.,m_amct,0,ran[11],ran[12]); |
86 | Vec4D p1_26 = p1_6-p[2]; |
87 | CE.TChannelMomenta(p0_78,p1_26,p[3],p45,s3,s45,0.,m_alpha,1.,-1.,m_amct,0,ran[13],ran[14]); |
88 | double tmass204 = Flavour((kf_code)(23)).Mass(); |
89 | Vec4D p0_378 = p0_87-p[3]; |
90 | CE.TChannelMomenta(p0_378,p1_26,p[5],p[4],s5,s4,tmass204,m_alpha,1.,-1.,m_amct,0,ran[15],ran[16]); |
91 | } |
92 | |
93 | void C7_615::GenerateWeight(Vec4D* p,Cut_Data * cuts) |
94 | { |
95 | double wt = 1.; |
96 | Vec4D p2345678=p[0]+p[1]; |
97 | double s2345678_max = p2345678.Abs2(); |
98 | double s234567_max = sqr(sqrt(s2345678_max)-sqrt(ms[8])); |
99 | double s6 = ms[6]; |
100 | double s68_min = cuts->Getscut(std::string("68")); |
101 | double s23457_max = sqr(sqrt(s2345678_max)-sqrt(s68_min)); |
102 | double s678_min = cuts->Getscut(std::string("678")); |
103 | double s2345_max = sqr(sqrt(s2345678_max)-sqrt(s678_min)); |
104 | double s2 = ms[2]; |
105 | double s2678_min = cuts->Getscut(std::string("2678")); |
106 | double s345_max = sqr(sqrt(s2345678_max)-sqrt(s2678_min)); |
107 | double s23678_min = cuts->Getscut(std::string("23678")); |
108 | double s45_max = sqr(sqrt(s2345678_max)-sqrt(s23678_min)); |
109 | double s4 = ms[4]; |
110 | double s5 = ms[5]; |
111 | double s45_min = cuts->Getscut(std::string("45")); |
112 | Vec4D p45 = p[4]+p[5]; |
113 | double s45 = dabs(p45.Abs2()); |
114 | wt *= CE.ThresholdWeight(1.5,4.*sqrt(s45_min),s45_min,s45_max,s45,rans[0]); |
115 | double s3 = ms[3]; |
116 | double s345_min = cuts->Getscut(std::string("345")); |
117 | s345_min = Max(s345_min,sqr(sqrt(s3)+sqrt(s45))); |
118 | Vec4D p345 = p[3]+p[4]+p[5]; |
119 | double s345 = dabs(p345.Abs2()); |
120 | wt *= CE.ThresholdWeight(1.5,2.*sqrt(s345_min),s345_min,s345_max,s345,rans[1]); |
121 | double s2345_min = cuts->Getscut(std::string("2345")); |
122 | s2345_min = Max(s2345_min,sqr(sqrt(s345)+sqrt(s2))); |
123 | Vec4D p2345 = p[2]+p[3]+p[4]+p[5]; |
124 | double s2345 = dabs(p2345.Abs2()); |
125 | wt *= CE.ThresholdWeight(1.5,2.*sqrt(s2345_min),s2345_min,s2345_max,s2345,rans[2]); |
126 | double s7 = ms[7]; |
127 | double s23457_min = cuts->Getscut(std::string("23457")); |
128 | s23457_min = Max(s23457_min,sqr(sqrt(s7)+sqrt(s2345))); |
129 | Vec4D p23457 = p[2]+p[3]+p[4]+p[5]+p[7]; |
130 | double s23457 = dabs(p23457.Abs2()); |
131 | wt *= CE.ThresholdWeight(1.5,2.*sqrt(s23457_min),s23457_min,s23457_max,s23457,rans[3]); |
132 | double s234567_min = cuts->Getscut(std::string("234567")); |
133 | s234567_min = Max(s234567_min,sqr(sqrt(s23457)+sqrt(s6))); |
134 | Vec4D p234567 = p[2]+p[3]+p[4]+p[5]+p[6]+p[7]; |
135 | double s234567 = dabs(p234567.Abs2()); |
136 | wt *= CE.ThresholdWeight(1.5,2.*sqrt(s234567_min),s234567_min,s234567_max,s234567,rans[4]); |
137 | double s8 = ms[8]; |
138 | m_ctmax = cuts->cosmax[0][8]; |
139 | m_ctmin = cuts->cosmin[0][8]; |
140 | if (m_kTC_0__1__8_234567.Weight()==ATOOLS::UNDEFINED_WEIGHT) |
141 | m_kTC_0__1__8_234567<<CE.TChannelWeight(p[0],p[1],p[8],p234567,0.,m_alpha,m_ctmax,m_ctmin,m_amct,0,m_kTC_0__1__8_234567[0],m_kTC_0__1__8_234567[1]); |
142 | wt *= m_kTC_0__1__8_234567.Weight(); |
143 | |
144 | rans[5]= m_kTC_0__1__8_234567[0]; |
145 | rans[6]= m_kTC_0__1__8_234567[1]; |
146 | double tmass206 = Flavour((kf_code)(24)).Mass(); |
147 | Vec4D p0_8 = p[0]-p[8]; |
148 | if (m_kTC24_0_8_1__23457_6.Weight()==ATOOLS::UNDEFINED_WEIGHT) |
149 | m_kTC24_0_8_1__23457_6<<CE.TChannelWeight(p0_8,p[1],p23457,p[6],tmass206,m_alpha,1.,-1.,m_amct,0,m_kTC24_0_8_1__23457_6[0],m_kTC24_0_8_1__23457_6[1]); |
150 | wt *= m_kTC24_0_8_1__23457_6.Weight(); |
151 | |
152 | rans[7]= m_kTC24_0_8_1__23457_6[0]; |
153 | rans[8]= m_kTC24_0_8_1__23457_6[1]; |
154 | double tmass202 = Flavour((kf_code)(24)).Mass(); |
155 | Vec4D p1_6 = p[1]-p[6]; |
156 | if (m_kTC24_0_8_1_6_7_2345.Weight()==ATOOLS::UNDEFINED_WEIGHT) |
157 | m_kTC24_0_8_1_6_7_2345<<CE.TChannelWeight(p0_8,p1_6,p[7],p2345,tmass202,m_alpha,1.,-1.,m_amct,0,m_kTC24_0_8_1_6_7_2345[0],m_kTC24_0_8_1_6_7_2345[1]); |
158 | wt *= m_kTC24_0_8_1_6_7_2345.Weight(); |
159 | |
160 | rans[9]= m_kTC24_0_8_1_6_7_2345[0]; |
161 | rans[10]= m_kTC24_0_8_1_6_7_2345[1]; |
162 | Vec4D p0_78 = p0_8-p[7]; |
163 | if (m_kTC_0_78_1_6_345_2.Weight()==ATOOLS::UNDEFINED_WEIGHT) |
164 | m_kTC_0_78_1_6_345_2<<CE.TChannelWeight(p0_78,p1_6,p345,p[2],0.,m_alpha,1.,-1.,m_amct,0,m_kTC_0_78_1_6_345_2[0],m_kTC_0_78_1_6_345_2[1]); |
165 | wt *= m_kTC_0_78_1_6_345_2.Weight(); |
166 | |
167 | rans[11]= m_kTC_0_78_1_6_345_2[0]; |
168 | rans[12]= m_kTC_0_78_1_6_345_2[1]; |
169 | Vec4D p1_26 = p1_6-p[2]; |
170 | if (m_kTC_0_78_1_26_3_45.Weight()==ATOOLS::UNDEFINED_WEIGHT) |
171 | m_kTC_0_78_1_26_3_45<<CE.TChannelWeight(p0_78,p1_26,p[3],p45,0.,m_alpha,1.,-1.,m_amct,0,m_kTC_0_78_1_26_3_45[0],m_kTC_0_78_1_26_3_45[1]); |
172 | wt *= m_kTC_0_78_1_26_3_45.Weight(); |
173 | |
174 | rans[13]= m_kTC_0_78_1_26_3_45[0]; |
175 | rans[14]= m_kTC_0_78_1_26_3_45[1]; |
176 | double tmass204 = Flavour((kf_code)(23)).Mass(); |
177 | Vec4D p0_378 = p0_87-p[3]; |
178 | if (m_kTC23_0_378_1_26_5_4.Weight()==ATOOLS::UNDEFINED_WEIGHT) |
179 | m_kTC23_0_378_1_26_5_4<<CE.TChannelWeight(p0_378,p1_26,p[5],p[4],tmass204,m_alpha,1.,-1.,m_amct,0,m_kTC23_0_378_1_26_5_4[0],m_kTC23_0_378_1_26_5_4[1]); |
180 | wt *= m_kTC23_0_378_1_26_5_4.Weight(); |
181 | |
182 | rans[15]= m_kTC23_0_378_1_26_5_4[0]; |
183 | rans[16]= m_kTC23_0_378_1_26_5_4[1]; |
184 | double vw = p_vegas->GenerateWeight(rans); |
185 | if (wt!=0.) wt = vw/wt/pow(2.*M_PI,7*3.-4.); |
186 | |
187 | weight = wt; |
188 | } |
189 | |
190 | C7_615::C7_615(int nin,int nout,Flavour* fl,Integration_Info * const info) |
191 | : Single_Channel(nin,nout,fl) |
192 | { |
193 | name = std::string("C7_615"); |
194 | rannum = 17; |
195 | rans = new double[rannum]; |
196 | m_amct = 1.; |
197 | m_alpha = .9; |
198 | m_ctmax = 1.; |
199 | m_ctmin = -1.; |
200 | m_kTC23_0_378_1_26_5_4.Assign(std::string("TC23_0_378_1_26_5_4"),2,0,info); |
201 | m_kTC24_0_8_1_6_7_2345.Assign(std::string("TC24_0_8_1_6_7_2345"),2,0,info); |
202 | m_kTC24_0_8_1__23457_6.Assign(std::string("TC24_0_8_1__23457_6"),2,0,info); |
203 | m_kTC_0_78_1_26_3_45.Assign(std::string("TC_0_78_1_26_3_45"),2,0,info); |
204 | m_kTC_0_78_1_6_345_2.Assign(std::string("TC_0_78_1_6_345_2"),2,0,info); |
205 | m_kTC_0__1__8_234567.Assign(std::string("TC_0__1__8_234567"),2,0,info); |
206 | m_kZS_0.Assign(std::string("ZS_0"),2,0,info); |
207 | p_vegas = new Vegas(rannum,100,name); |
208 | } |
209 | |
210 | C7_615::~C7_615() |
211 | { |
212 | delete p_vegas; |
213 | } |
214 | |
215 | void C7_615::ISRInfo(int & type,double & mass,double & width) |
216 | { |
217 | type = 2; |
218 | mass = 0; |
219 | width = 0.; |
220 | } |
221 | |
222 | void C7_615::AddPoint(double Value) |
223 | { |
224 | Single_Channel::AddPoint(Value); |
225 | p_vegas->AddPoint(Value,rans); |
226 | } |
227 | std::string C7_615::ChID() |
228 | { |
229 | return std::string("CG2$MTH_2345$MTH_234567$MTH_23457$MTH_345$MTH_45$TC23_0_378_1_26_5_4$TC24_0_8_1_6_7_2345$TC24_0_8_1__23457_6$TC_0_78_1_26_3_45$TC_0_78_1_6_345_2$TC_0__1__8_234567$ZS_0$"); |
230 | } |