Functions | Variables
bwnorm.C File Reference
#include <iostream>
#include <TH1F.h>
#include <TMath.h>
#include <TCanvas.h>
#include <TGraph.h>
#include <TLegend.h>

Go to the source code of this file.

Functions

void bwnorm (void)
 
void print_norm (int method, double Wmax=3.0)
 
double bwfunc (double mR, double gRo, int L, double W)
 
double bwintegrate (double mR, double gRo, int L, double Wmin, double Wmax)
 
double bwintegrate_neugen (double mR, double gRo, int L, int n)
 

Variables

const int kNRes = 18
 
const char * kResName [kNRes]
 
const int kResN [kNRes]
 
const int kResL [kNRes]
 
const double kResMass [kNRes]
 
const double kResWidth [kNRes]
 
const int kResColor [kNRes]
 
const int kResStyle [kNRes]
 

Function Documentation

double bwfunc ( double  mR,
double  gRo,
int  L,
double  W 
)

Definition at line 191 of file bwnorm.C.

192 {
193 // breit-wigner function
194 //
195  double pi = 3.141;
196  double mN = 0.938;
197  double mPi = 0.140;
198  double mR2 = TMath::Power(mR, 2);
199  double mN2 = TMath::Power(mN, 2);
200  double mPi2 = TMath::Power(mPi,2);
201  double W2 = TMath::Power(W, 2);
202  double qpW2 = TMath::Power(W2 - mN2 - mPi2, 2) - 4*mN2*mPi2;
203  double qpM2 = TMath::Power(mR2 - mN2 - mPi2, 2) - 4*mN2*mPi2;
204  double qpW = TMath::Sqrt(TMath::Max(0.,qpW2)) / (2*W);
205  double qpM = TMath::Sqrt(TMath::Max(0.,qpM2)) / (2*mR);
206  double gR = gRo * TMath::Power( qpW/qpM, 2*L+1 );
207  double gR2 = TMath::Power(gR, 2);
208  double brwg = (0.5/pi)*gR / (TMath::Power(W-mR, 2) + 0.25*gR2);
209  return brwg;
210 }
const double pi
Definition: LAr.C:31
double bwintegrate ( double  mR,
double  gRo,
int  L,
double  Wmin,
double  Wmax 
)

Definition at line 156 of file bwnorm.C.

158 {
159 // integrate within input W range
160 //
161  int N = 1000* TMath::Nint( (Wmax-Wmin)/gRo );
162  if(N%2==0) N++;
163 
164  double dW = (Wmax-Wmin)/(N-1);
165 
166  double sum = 0.5 * (bwfunc(mR,gRo,L,Wmin) + bwfunc(mR,gRo,L,Wmax));
167 
168  for(int i=1; i<N-1; i++) {
169  double W = Wmin + i*dW;
170  sum += ( bwfunc(mR,gRo,L,W) * (i%2+1) );
171  }
172  sum *= (2.*dW/3.);
173 
174  return sum;
175 }
size_t i(0)
double Wmax[kNWBins]
double bwfunc(double mR, double gRo, int L, double W)
Definition: bwnorm.C:191
double Wmin[kNWBins]
double bwintegrate_neugen ( double  mR,
double  gRo,
int  L,
int  n 
)

Definition at line 177 of file bwnorm.C.

178 {
179 // integrate using std neugen W range
180 //
181  int NW = 4;
182  if(n==2) NW=2;
183  if(n==0) NW=6;
184 
185  double Wmin = 0.001;
186  double Wmax = mR + NW*gRo;
187 
188  return bwintegrate(mR,gRo,L,Wmin,Wmax);
189 }
double Wmax[kNWBins]
double Wmin[kNWBins]
double bwintegrate(double mR, double gRo, int L, double Wmin, double Wmax)
Definition: bwnorm.C:156
void bwnorm ( void  )

Definition at line 85 of file bwnorm.C.

86 {
87  TCanvas * c = new TCanvas("c","",20,20,500,500);
88  c->SetFillColor(0);
89  c->SetBorderMode(0);
90 
91  TLegend * lg = new TLegend(0.15, 0.30, 0.35, 0.85);
92  lg->SetFillColor(0);
93 
94  const int kNW = 150;
95 
96  double norm[kNRes][kNW];
97  double wmax[kNRes][kNW];
98 
99  TGraph * grnorm[kNRes];
100 
101  for(int ires=0; ires<kNRes; ires++) {
102 
103  double m = kResMass [ires];
104  double w = kResWidth [ires];
105  int l = kResL [ires];
106 
107  double Wmin = 0.01;
108  double Wmax = m+w;
109  for(int iw=0; iw<kNW; iw++) {
110  Wmax+=w;
111  wmax[ires][iw] = Wmax;
112  norm[ires][iw] = bwintegrate(m,w,l,Wmin,Wmax);
113  }//w
114 
115  grnorm[ires] = new TGraph(kNW, wmax[ires], norm[ires]);
116 
117  grnorm[ires]->SetLineWidth(2);
118  grnorm[ires]->SetLineStyle(kResStyle[ires]);
119  grnorm[ires]->SetLineColor(kResColor[ires]);
120 
121  lg->AddEntry(grnorm[ires], kResName[ires], "L");
122 
123  }//res
124 
125  c->cd();
126  TH1F * hframe = (TH1F*)c->DrawFrame(1.0, 0.6, 3.0, 1.2);
127  hframe->GetXaxis()->SetTitle("W_{max} (GeV) in integration");
128  hframe->GetYaxis()->SetTitle("normalization");
129  hframe->Draw();
130  for(int ires=0; ires<kNRes; ires++) {
131  grnorm[ires]->Draw("L");
132  }
133  lg->Draw();
134  c->Update();
135 }
static const double m
Definition: Units.h:79
double Wmax[kNWBins]
const char * kResName[kNRes]
Definition: bwnorm.C:25
const int kResL[kNRes]
Definition: bwnorm.C:39
const double kResMass[kNRes]
Definition: bwnorm.C:46
const int kResColor[kNRes]
Definition: bwnorm.C:60
double Wmin[kNWBins]
const int kNRes
Definition: bwnorm.C:23
double bwintegrate(double mR, double gRo, int L, double Wmin, double Wmax)
Definition: bwnorm.C:156
const double kResWidth[kNRes]
Definition: bwnorm.C:53
const int kResStyle[kNRes]
Definition: bwnorm.C:67
void print_norm ( int  method,
double  Wmax = 3.0 
)

Definition at line 137 of file bwnorm.C.

138 {
139  for(int ires=0; ires<kNRes; ires++) {
140 
141  double m = kResMass [ires];
142  double w = kResWidth [ires];
143  int l = kResL [ires];
144  int n = kResN [ires];
145 
146  double norm=0;
147  if (method==0) norm = bwintegrate_neugen(m,w,l,n);
148  else if (method==1) norm = bwintegrate(m,w,l,0.01,Wmax);
149 
150  cout << kResName[ires] << " --> Norm = " << norm
151  << " (multiplied by pi -> "
152  << norm * TMath::Pi() << ")" << endl;
153  }
154 }
static const double m
Definition: Units.h:79
double bwintegrate_neugen(double mR, double gRo, int L, int n)
Definition: bwnorm.C:177
double Wmax[kNWBins]
the ParameterSet object passed in for the configuration of a destination should be the only source that can affect the behavior of that destination This is to eliminate the dependencies of configuring a destination from multiple mostly from the defaults It suppresses possible glitches about changing the configuration file somewhere outside of a destination segament might still affect the behavior of that destination In the previous configuration for a specific the value of a certain e may come from following and have been suppressed It the configuring ParameterSet object for each destination will be required to carry a parameter list as complete as possible If a parameter still cannot be found in the ParameterSet the configuration code will go look for a hardwired default directly The model is a great simplicity comparing with the previous especially when looking for default values Another great advantage is most of the parameters now have very limited places that allows to appear Usually they can only appear at one certain level in a configuration file For in the old configuring model or in a default ParameterSet object inside of a or in a category or in a severity object This layout of multiple sources for a single parameter brings great confusion in both writing a configuration and in processing the configuration file Under the new the only allowed place for the parameter limit to appear is inside of a category which is inside of a destination object Other improvements simplify the meaning of a destination name In the old a destination name has multiple folds of meanings the e cout and cerr have the special meaning of logging messages to standard output or standard error the name also serves as the output filename if the destination is a file these names are also references to look up for detailed configurations in configuring the MessageFacility The multi purpose of the destination name might cause some unwanted behavior in either writing or parsing the configuration file To amend in the new model the destination name is now merely a name for a which might represent the literal purpose of this or just an id All other meanings of the destinations names now go into the destination ParameterSet as individual such as the type parameter and filename parameter Following is the deatiled rule for the new configuring Everything that is related with MessageFacility configuration must be wrapped in a single ParameterSet object with the name MessageFacility The MessageFacility ParameterSet object contains a series of top level parameters These parameters can be chosen a vector of string listing the name of debug enabled models Or use *to enable debug messages in all modules a vector of string a vector of string a vector of string a ParameterSet object containing the list of all destinations The destinations ParameterSet object is a combination of ParameterSet objects for individual destinations There are two types of destinations that you can insert in the destinations ParameterSet ordinary including cout
const int kResN[kNRes]
Definition: bwnorm.C:32
const char * kResName[kNRes]
Definition: bwnorm.C:25
const int kResL[kNRes]
Definition: bwnorm.C:39
const double kResMass[kNRes]
Definition: bwnorm.C:46
const int kNRes
Definition: bwnorm.C:23
double bwintegrate(double mR, double gRo, int L, double Wmin, double Wmax)
Definition: bwnorm.C:156
const double kResWidth[kNRes]
Definition: bwnorm.C:53

Variable Documentation

const int kNRes = 18

Definition at line 23 of file bwnorm.C.

const int kResColor[kNRes]
Initial value:
= {
1, 8, 2, 8, 2,
2, 8, 2, 1, 1,
1, 5, 1, 1, 5,
5, 1, 8
}

Definition at line 60 of file bwnorm.C.

const int kResL[kNRes]
Initial value:
= {
1, 0, 2, 0, 2,
2, 0, 2, 1, 1,
1, 3, 1, 1, 3,
3, 1, 0
}

Definition at line 39 of file bwnorm.C.

const double kResMass[kNRes]
Initial value:
= {
1.232, 1.535, 1.520, 1.650, 1.700,
1.675, 1.620, 1.700, 1.440, 1.600,
1.720, 1.680, 1.910, 1.920, 1.905,
1.950, 1.710, 1.970
}

Definition at line 46 of file bwnorm.C.

const int kResN[kNRes]
Initial value:
= {
0, 1, 1, 1, 1,
1, 1, 1, 1, 9,
2, 2, 2, 2, 2,
2, 2, 0
}

Definition at line 32 of file bwnorm.C.

const char* kResName[kNRes]
Initial value:
= {
"P33(1232)", "S11(1535)", "D13(1520)", "S11(1650)", "D13(1700)",
"D15(1675)", "S31(1620)", "D33(1700)", "P11(1440)", "P33(1600)",
"P13(1720)", "F15(1680)", "P31(1910)", "P33(1920)", "F35(1905)",
"F37(1950)", "P11(1710)", "F17(1970)"
}

Definition at line 25 of file bwnorm.C.

const int kResStyle[kNRes]
Initial value:
= {
1, 1, 1, 2, 2,
3, 3, 4, 2, 3,
4, 1, 2, 2, 2,
3, 3, 4
}

Definition at line 67 of file bwnorm.C.

const double kResWidth[kNRes]
Initial value:
= {
0.120, 0.150, 0.120, 0.150, 0.100,
0.150, 0.150, 0.300, 0.350, 0.350,
0.150, 0.130, 0.250, 0.200, 0.350,
0.300, 0.100, 0.325
}

Definition at line 53 of file bwnorm.C.