/////////////////////////////////////////////////////////////////////
//  Pluto Particle Data
//
//  This class contains tool functions and variables
//
//                             Author:  M.A. Kagarlis
//                             Written: 31/01/99
//                             Revised: 24/05/2004 R.H.
//                             Revised particle tables: 09/06/2004 R.H.
//                             Bug fixes: 13/10/2004 R.H.
//                             mu+mu-: 02/02/2005 R.H.
//                             N1535: 25/01/2007 R.H.
//                             Moved the physics to stand-alone classes 
//                                    (IF, 23.7.2007)
//
//  N.b. that the variables will be moved to the data base soon
//
//  System variables:
//   _system_alloc_verbosity: set =0 to avoid the ALLOCATION printout
//////////////////////////////////////////////////////////////////////

#define INGO_DEBUG

const long double hbar = 6.582122e-25; // units of (GeV s)

// local arrays
#include "PData.h"
#include "PKinematics.h"                          // kinematics in-line functions
#include "PUtils.h"                               // utilities class
#include "TF2.h"

int PData::LPW(const int &id, const int &i1, const int &i2) {
    // lowest allowed transition partial wave for the decay
    // of a hadron (id) to two hadrons (i1 & i2).

    int jres = makeStaticData()->GetParticleSpin(id),  // parent 2 x spin
	j1 = makeStaticData()->GetParticleSpin(i1),    // 1st particle 2 x spin
	j2 = makeStaticData()->GetParticleSpin(i2),    // 2nd particle 2 x spin
	j12max = j1+j2,           // angular momentum limits
	j12min = abs(j1-j2),      // for selection rule
	l = TMath::Min(abs(jres-j12max),abs(jres-j12min))/2,  
	// lowest ang. mom. transfer
	c = (l%2 != abs(makeStaticData()->GetParticleParity(id)
			-makeStaticData()->GetParticleParity(i1)*
			makeStaticData()->GetParticleParity(i2))/2);
    // parity correction
    return l+c;
}

int PData::IsMDalitz(const int &idx) {
    // checks if decay mode with index idx is a mesonic Dalitz decay
    // This is calculated here on the fly, dalitz_id is 0 on default

    //TODO: add flag in data base
//    int did=DalitzID[idx];
//    if (did) return (did!=-1) ? did : 0; // -1 means "no"
//    DalitzID[idx]=-1;

    if (!makeStaticData()->IsParticleMeson(makeStaticData()->GetDecayParent(idx))) 
	return 0;
    int i, ic[10];
    ic[0] = 10; 
    makeStaticData()->GetDecayMode(idx, ic);  // retrieve info for current decay mode
    if (!*ic || *ic>2) return 0; // 0 or >2 products; cannot be Dalitz decay
    for (i=1; i<=2; ++i) 
	if (makeStaticData()->IsParticle(ic[i], "dilepton") || 
	    makeStaticData()->IsParticle(ic[i], "dimuon")) {
	//DalitzID[idx]=1;
	return 1;
    }
    return 0;
}
  

#include "TApplication.h"
#include "../Version.h"
#include "../Compiled.h"

PSplash *gSplash = 0;             // global pointer to PSplash instance
static PSplash PSplashInstance;   // create instance on library load

#include "TLorentzVector.h"
#include "TClass.h"
#include "TMethodCall.h"
//#include "TCint.h"

PSplash::PSplash() {
    if (gApplication)
	if (!gApplication->NoLogoOpt()) {
	    cout << "  *********************************************************" << endl;
	    cout << "  * The Pluto event generator                              " << endl;
	    cout << "  * Developed by HADES and all contributing AUTHORS        " << endl;
	    cout << "  * www-hades.gsi.de/computing/pluto/html/PlutoIndex.html  " << endl;
	    cout << "  * Version: " << version_string << endl;
	    cout << "  * Compiled on " << date_string << endl;
	    cout << "  *********************************************************" << endl;	   	    
	}
}

ClassImp(PSplash)
ClassImp(PData)



    
 PData.cc:1
 PData.cc:2
 PData.cc:3
 PData.cc:4
 PData.cc:5
 PData.cc:6
 PData.cc:7
 PData.cc:8
 PData.cc:9
 PData.cc:10
 PData.cc:11
 PData.cc:12
 PData.cc:13
 PData.cc:14
 PData.cc:15
 PData.cc:16
 PData.cc:17
 PData.cc:18
 PData.cc:19
 PData.cc:20
 PData.cc:21
 PData.cc:22
 PData.cc:23
 PData.cc:24
 PData.cc:25
 PData.cc:26
 PData.cc:27
 PData.cc:28
 PData.cc:29
 PData.cc:30
 PData.cc:31
 PData.cc:32
 PData.cc:33
 PData.cc:34
 PData.cc:35
 PData.cc:36
 PData.cc:37
 PData.cc:38
 PData.cc:39
 PData.cc:40
 PData.cc:41
 PData.cc:42
 PData.cc:43
 PData.cc:44
 PData.cc:45
 PData.cc:46
 PData.cc:47
 PData.cc:48
 PData.cc:49
 PData.cc:50
 PData.cc:51
 PData.cc:52
 PData.cc:53
 PData.cc:54
 PData.cc:55
 PData.cc:56
 PData.cc:57
 PData.cc:58
 PData.cc:59
 PData.cc:60
 PData.cc:61
 PData.cc:62
 PData.cc:63
 PData.cc:64
 PData.cc:65
 PData.cc:66
 PData.cc:67
 PData.cc:68
 PData.cc:69
 PData.cc:70
 PData.cc:71
 PData.cc:72
 PData.cc:73
 PData.cc:74
 PData.cc:75
 PData.cc:76
 PData.cc:77
 PData.cc:78
 PData.cc:79
 PData.cc:80
 PData.cc:81
 PData.cc:82
 PData.cc:83
 PData.cc:84
 PData.cc:85
 PData.cc:86
 PData.cc:87
 PData.cc:88
 PData.cc:89
 PData.cc:90
 PData.cc:91
 PData.cc:92
 PData.cc:93
 PData.cc:94
 PData.cc:95
 PData.cc:96
 PData.cc:97
 PData.cc:98
 PData.cc:99
 PData.cc:100
 PData.cc:101
 PData.cc:102
 PData.cc:103
 PData.cc:104
 PData.cc:105