Newer
Older
//************************************************************************//
// //
// Copyright 2013 Bertram Kopf (bertram@ep1.rub.de) //
// Julian Pychy (julian@ep1.rub.de) //
// - Ruhr-Universität Bochum //
// //
// This file is part of Pawian. //
// //
// Pawian is free software: you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation, either version 3 of the License, or //
// (at your option) any later version. //
// //
// Pawian is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with Pawian. If not, see <http://www.gnu.org/licenses/>. //
// //
//************************************************************************//
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#include <getopt.h>
#include <fstream>
#include <sstream>
#include <string>
#include "Examples/Tutorial/LineShapes/TwoPoles.hh"
#include "qft++/matrix/KpoleMatrix.hh"
#include "qft++/matrix/TMatrix.hh"
#include "TFile.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TMath.h"
#include "ErrLogger/ErrLogger.hh"
TwoPoles::TwoPoles(double MassRes1, double Width1, double MassRes2, double Width2, double deltaMass) :
_theTFile(0)
{
if (MassRes1 < MassRes2){
_massLow = MassRes1;
_widthLow = Width1;
_massHigh = MassRes2;
_widthHigh = Width2;
}
else{
_massLow = MassRes2;
_widthLow = Width2;
_massHigh = MassRes1;
_widthHigh = Width1;
}
_theTFile=new TFile("TwoPoles.root","recreate");
_massShapeHist= new TH1F("_massShapeHist", "BreitWigner",301, _massLow-deltaMass, _massHigh+deltaMass);
_massShapeKmatrHist= new TH1F("_massShapeKmatrHist", "mass shape Kmatrix",301, _massLow-deltaMass, _massHigh+deltaMass);
_massShapeKmatrHistRel= new TH1F("_massShapeKmatrHistRel", "mass shape rel. Kmatrix",301, _massLow-deltaMass, _massHigh+deltaMass);
_argandHist=new TH2F("_argandHist","Argand plot",301, -1., 1., 301, 0., 1.3);
_argandHist->SetXTitle("Re(Bw)");
_argandHist->SetYTitle("Im(Bw)");
_argandHist->SetMarkerStyle(6);
_argandKmatrHist=new TH2F("_argandKmatrHist","Argand plot K matrix",301, -1., 1., 301, 0., 1.3);
_argandKmatrHist->SetXTitle("Re(Bw)");
_argandKmatrHist->SetYTitle("Im(Bw)");
_argandKmatrHist->SetMarkerStyle(6);
_argandKmatrHistRel=new TH2F("_argandKmatrHistRel","Argand plot rel. K matrix",301, -1., 1., 301, 0., 1.3);
_argandKmatrHistRel->SetXTitle("Re(Bw)");
_argandKmatrHistRel->SetYTitle("Im(Bw)");
_argandKmatrHistRel->SetMarkerStyle(6);
//initialize here the phase shift histogramms _phaseHistMap
_phaseHist=new TH2F("_phaseHist", "phase shift",301, _massLow-deltaMass, _massHigh+deltaMass, 301, 0., 3.1415);
_phaseHist->SetXTitle("mass");
_phaseHist->SetYTitle("phase #delta(#phi)");
_phaseHist->SetMarkerStyle(6);
_phaseKmatrHist=new TH2F("_phaseKmatrHist", "phase shift Kmatrix",301, _massLow-deltaMass, _massHigh+deltaMass, 301, 0., 3.1415);
_phaseKmatrHist->SetXTitle("mass");
_phaseKmatrHist->SetYTitle("phase #delta(#phi)");
_phaseKmatrHist->SetMarkerStyle(6);
_phaseKmatrHistRel=new TH2F("_phaseKmatrHistRel", "phase shift rel Kmatrix",301, _massLow-deltaMass, _massHigh+deltaMass, 301, 0., 3.1415);
_phaseKmatrHistRel->SetXTitle("mass");
_phaseKmatrHistRel->SetYTitle("phase #delta(#phi)");
_phaseKmatrHistRel->SetMarkerStyle(6);
// break up momentum q0
double piMass=0.135;
// double rhoLow=sqrt( ( _massLow*_massLow-(piMass+piMass)*(piMass+piMass) )
// * ( _massLow*_massLow - (piMass-piMass) * (piMass-piMass) ) ) / (_massLow);
// double rhoHigh=sqrt( ( _massHigh*_massHigh-(piMass+piMass)*(piMass+piMass) )
// * ( _massHigh*_massHigh - (piMass-piMass) * (piMass-piMass) ) ) / (_massHigh);
double rhoLow=sqrt( (1-(2.*piMass/_massLow)*(2.*piMass/_massLow)) );
double rhoHigh=sqrt( (1-(2.*piMass/_massHigh)*(2.*piMass/_massHigh)) );
double gLow=sqrt(_massLow*_widthLow/rhoLow);
double gHigh=sqrt(_massHigh*_widthHigh/rhoHigh);
pair <double, double> theMassDecPair(piMass, piMass);
vector <pair <double, double> > theMassDecPairVec;
theMassDecPairVec.push_back(theMassDecPair);
vector<double> low_gis;
low_gis.push_back(gLow);
KpoleMatrix kPoleLow(low_gis, _massLow, theMassDecPairVec);
vector<double> high_gis;
high_gis.push_back(gHigh);
KpoleMatrix kPoleHigh(high_gis, _massHigh, theMassDecPairVec);
vector<KpoleMatrix> kPoles;
kPoles.push_back(kPoleLow);
kPoles.push_back(kPoleHigh);
TMatrix theTMatrix(kPoles);
double stepSize=( (_massHigh+deltaMass)-(_massLow-deltaMass) )/300.;
for (double massIt=_massLow-deltaMass; massIt<_massHigh+deltaMass; massIt+=stepSize){
Vector4<double> res4V(massIt, 0., 0., 0.);
complex<double> currentBWs=BreitWigner(res4V, _massLow, _widthLow)+BreitWigner(res4V, _massHigh, _widthHigh);
double weight=norm(currentBWs);
_massShapeHist->Fill(massIt,weight);
_argandHist->Fill(currentBWs.real(),currentBWs.imag());
//fill here the phase shift histogramms: hint "atan2(imag,real)"
_phaseHist->Fill(massIt, atan2(currentBWs.imag(), currentBWs.real()));
//Kmatrix
// break up momentum q0
// double piMass=0.135;
// double qlow=sqrt( ( _massLow*_massLow-(piMass+piMass)*(piMass+piMass) )
// * ( _massLow*_massLow - (piMass-piMass) * (piMass-piMass) ) ) / (_massLow);
// double qhigh=sqrt( ( _massHigh*_massHigh-(piMass+piMass)*(piMass+piMass) )
// * ( _massHigh*_massHigh - (piMass-piMass) * (piMass-piMass) ) ) / (_massHigh);
// break up momentum qab
// phase space factor rhoLow
// double rhoLow=2*qlow/_massLow;
// double rhoHigh=2*qhigh/_massHigh;
// phase space factor rhoMab
// double rhoMab=2*qab/massIt;
theTMatrix.updateMatrix(massIt);
complex<double> currentTmatrix=theTMatrix(0,0);
cout << "TMatrix:\t" << currentTmatrix << endl;
weight=norm(currentTmatrix);
_massShapeKmatrHist->Fill(massIt,weight);
_argandKmatrHist->Fill(currentTmatrix.real(),currentTmatrix.imag());
_phaseKmatrHist->Fill(massIt, atan2(currentTmatrix.imag(), currentTmatrix.real()));
theTMatrix.updateMatrixRel(massIt);
complex<double> currentTmatrixRel=theTMatrix(0,0);
cout << "TMatrixRel:\t" << currentTmatrixRel << endl;
weight=norm(currentTmatrixRel);
_massShapeKmatrHistRel->Fill(massIt,weight);
_argandKmatrHistRel->Fill(currentTmatrixRel.real(),currentTmatrixRel.imag());
_phaseKmatrHistRel->Fill(massIt, atan2(currentTmatrixRel.imag(), currentTmatrixRel.real()));
}
}
TwoPoles::~TwoPoles()
{
_theTFile->Write();
_theTFile->Close();
}