ROOTPWA
CalcAmpl.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <string>
3 #include <stdio.h>
4 #include "TFhh.h"
5 using namespace std;
6 
7 int main(int narg, char* carg[]) {
8 
9  if (narg < 4) {
10  cout << endl
11  << "This program requires 3 input strings for the mother and "<<endl
12  << "the 2 decay particles, each of the form Jp," << endl
13  << "where J is the spin of the particle and p = +/- its parity"
14  << endl
15  << endl
16  << "options that may follow the three Jp terms:" << endl
17  << "-H result output also in header file format" << endl
18  << endl;
19 
20  return 0;
21  }
22 
23  int opt=0;
24  for (int oi=4; oi<narg; oi++) {
25  int nchar = sizeof(carg[oi])/sizeof(char);
26  if (nchar>1 && carg[oi][1]=='H') {
27  cout << "H option length:" << nchar << endl;
28  opt=2;
29  }
30  }
31 
32  int jmother;
33  char pmother; int pm;
34  int jdecay1;
35  char pdecay1; int p1;
36  int jdecay2;
37  char pdecay2; int p2;
38 
39  sscanf(carg[1], "%d%c", &jmother, &pmother);
40  cout << "Mother particle: " << jmother << pmother << endl;
41  if (pmother=='+') pm= 1;
42  else pm=-1;
43 
44  sscanf(carg[2], "%1d%c", &jdecay1, &pdecay1);
45  cout << "1. decay particle: " << jdecay1 << pdecay1 << endl;
46  if (pdecay1=='+') p1= 1;
47  else p1=-1;
48 
49  sscanf(carg[3], "%1d%c", &jdecay2, &pdecay2);
50  cout << "2. decay particle: " << jdecay2 << pdecay2 << endl;
51  if (pdecay2=='+') p2= 1;
52  else p2=-1;
53 
54  cout << jmother << "," << pm << ","
55  << jdecay1 << "," << p1 << ","
56  << jdecay2 << "," << p2 << endl;
57 
58  TJSS jss(jmother, pm, jdecay1, p1, jdecay2, p2, opt);
59 
60 }
61