/////////////////////////////////////////////////////////////////////
//
// Generic angular distribution
// This algorithm evaluates the angular distribution of
// the particle "primary" which must be a "daughter"
//
// The angle to be evaluated is the relative angle between
// the "primary" particle momentum in the "reference" frame
// and the "reference" particle momentum. This momentum, however
// is determined in the "base_reference" frame.
// If "ang_reference" is used, the angle is determined
// relative to this particle
//
//
// If "base_reference" is not set, the default is the lab frame
// If "reference" is not set, the default is the parent particle
// If "ang_reference" is not set, but "beam", ang_reference
// is set to beam
//
//
// If "align" is set, the reference will be the composite particle
// of the primary + align 
// This can be used for the alignment of two particles
//
// The 2nd parameter for TF2 is the mass of the reference
// If "mass_reference" is set, this particle (e.g. q) will be used
// Such a feature is useful for energy-dependent parameterizations
//
//
//                                  Author:  I. Froehlich
//                                  Written: 01.10.2006
//                                  Revised: 24.10.2010
//                                  
//                                  
/////////////////////////////////////////////////////////////////////


using namespace std;
#include <sstream>
#include <iostream>
#include <iomanip>

#include "PAngularDistribution.h"

ClassImp(PAngularDistribution)

PAngularDistribution::PAngularDistribution() {
    Fatal("PAngularDistribution()", "Wrong constructor called");
};

PAngularDistribution::PAngularDistribution(const Char_t *id,const  Char_t *de) :
    PDistribution(id, de) {

    angles1 = NULL;
    angles2 = NULL;
    anglesg = NULL;
    anglesh = NULL;
    reference = NULL;
    base_reference = NULL;
    ang_reference = NULL;
    parent = NULL;
    align = NULL;
    check_abort = never_abort = always_reject = kFALSE;
    rotate = kTRUE;
    mass_reference = NULL;
    beam = target = NULL;
    align_is_daughter = kFALSE;
    direct_sampling_possible=kFALSE;
    reflection_symmetry=kFALSE;
    spline=kFALSE;
    g_spline=NULL;
    n_daughters=0;

    fNpar = 1 ; //Parameter1: mass_reference

    //ROOT6
    fParErrors.resize(fNpar);
    fParMin.resize(fNpar);
    fParMax.resize(fNpar);
    fParams = new TF1Parameters(fNpar);
   
    fParErrors[0]  = 0;
    fParMin[0]     = 0;
    fParMax[0]     = 0;
    
    fParams->SetParName(0, "Mass reference for 2-dim angular distributions");
    fParams->SetParameter(0, 0);

#if 0
    //ROOT5
    if (fNpar) {
	fNames      = new TString[fNpar];
	fParams     = new Double_t[fNpar];
	fParErrors  = new Double_t[fNpar];
	fParMin     = new Double_t[fNpar];
	fParMax     = new Double_t[fNpar];
	for (int i = 0; i < fNpar; i++) {
	    fParams[i]     = 0;
	    fParErrors[i]  = 0;
	    fParMin[i]     = 0;
	    fParMax[i]     = 0;
	}
	fNames[0] = "Mass reference for 2-dim angular distributions";
    }
    fParams[0]=0;
#endif

    fNpx  = 1000;   
    fXmin = -1;
    fXmax = 1;

    for (int i=0; i<MAX_ANG_NUM; i++) {
	daughter[i]=NULL;
    }

    weight_max = 1.;
};

PDistribution *PAngularDistribution::Clone(const char *) const {
    return new PAngularDistribution((const PAngularDistribution &)* this);
};

Bool_t PAngularDistribution::Init(void) {

    if ((angles1 == NULL ) && (angles2 == NULL ) && (anglesg == NULL ) && (anglesh == NULL )) {
	//At least one of the parameterized functions must be present
	Error("Init", "Angular distribution not found");
	return kFALSE;
    }

    //looking for primary. This is also mandatory
    primary = GetParticle("primary");
    if (!primary) {
	Error("Init", "Primary particle not found");
	return kFALSE;
    }

    //primary->Print();
    reference      = GetParticle("reference");
    base_reference = GetParticle("base_reference");
    mass_reference = GetParticle("mass_reference");
    ang_reference  = GetParticle("ang_reference");
    align = GetParticle("align");
    
    if (align) {//check if align is a daughter or parent
	if ((current_flag == PARTICLE_LIST_PARENT) ||
	    (current_flag == PARTICLE_LIST_DAUGHTER))
	    align_is_daughter = kTRUE;
    }

    //In addition we need the beam and target for some models
    beam   = GetParticle("beam");
    target = GetParticle("target");

    if (!ang_reference && beam) ang_reference=beam;

    //Now get the parent
    for (int i=0; i<position; i++) {
	if (particle_flag[i] == PARTICLE_LIST_PARENT)
	    parent = particle[i];
    }

    if (!parent) {
	Error("Init", "Parent not found");
	return kFALSE;
    }

    if (!reference) reference = parent;
    
    for (int i=0; i<position; i++) {
	if ((particle_flag[i] & PARTICLE_LIST_GRANDPARENT) 
	    | (particle_flag[i] & PARTICLE_LIST_GRANDGRANDPARENT) 
	    | (particle_flag[i] & PARTICLE_LIST_SIBLING)) 
	    check_abort = kTRUE;
    }

    //get ADDITIONAL daughters
    bool myloop = 1;
    for (n_daughters=0; n_daughters<MAX_ANG_NUM && myloop; n_daughters++) {
	daughter[n_daughters] = GetParticle("daughter");
	if (!daughter[n_daughters]) {
	    myloop = 0;
	} 
    }
    n_daughters--;

    direct_sampling_possible = kFALSE; 

    if (!align &&             // no composite
	!mass_reference &&    // too complicated
	reference==parent &&  // direct sampling in parent frame
	n_daughters &&        // No mistake in template
	!always_reject &&
	(angles1 || anglesh || anglesg))              // Only 1dim-sampling
	direct_sampling_possible=kTRUE;
    //N.B. this is overwritten by inherited models (e.g.PDeltaAngularDistribution)
    //cout << direct_sampling_possible << endl;
    return kTRUE;    
};

Bool_t PAngularDistribution::Prepare(void) {

    direct_sampling_done = kFALSE;
    return kTRUE;
};

Bool_t PAngularDistribution::Finalize(void) {
    return kTRUE;
};

Bool_t PAngularDistribution::CheckAbort(void) {
    //    cout << check_abort << endl;
    if (never_abort) return kFALSE;
    return check_abort;
};


Bool_t PAngularDistribution::SampleAngle(void) {
    //Try first to sample the angle, rather to use
    //the rejection method. This works
    //in the simple cases, and only if there
    //are no correlated angular distributions
    
    if (!direct_sampling_possible) return kFALSE;
    
    // primary->Print();
    // for (int i=0;i<n_daughters;i++) daughter[i]->Print();
    
    if (!Rotate(1)) return kFALSE;    
    
    // cout << "---" << endl;
    // primary_tmp.Print();
    // for (int i=0;i<n_daughters;i++) daughter[i]->Print();
    // cout << "*********************" << endl;
    
    //now we rotate all daughters such that primary_tmp is pointing to the z-axis
    double prim_phi   = primary_tmp.Phi();
    double prim_theta = primary_tmp.Theta();

#if 1
    
    //primary->Print();
    // primary_tmp.Print();
    // for (int i=0;i<n_daughters;i++) daughter[i]->Print();

    primary_tmp.RotateZ(-prim_phi);
    primary_tmp.RotateY(-prim_theta);
    for (int i=0; i<n_daughters; i++) {
	daughter[i]->RotateZ(-prim_phi);
	daughter[i]->RotateY(-prim_theta);
    }

    //sample the polar angle
    double polar_angle = acos(SamplePolarAngle(0.5*(cos(prim_theta)+1)));   
    //2r=cos_theta-1 was the definition in the baryon_cos alg of the original PChannel
    //polar_angle=prim_theta;
    //cout << polar_angle << endl;

    if ((polar_angle < -2.*TMath::Pi()) || (polar_angle > 2.*TMath::Pi())) {
	Warning("SampleAngle", "Wrong polar angle");
	return kFALSE;
    }

    //rotate the particles such that primary has the correct polar angle
    primary_tmp.RotateY(polar_angle);
    for (int i=0;i<n_daughters;i++)
	daughter[i]->RotateY(polar_angle);

    //restore the old azimuthal angle
    primary_tmp.RotateZ(prim_phi);
    for (int i=0; i<n_daughters; i++)
	daughter[i]->RotateZ(prim_phi);
#endif
    //rotate back to the old frame
    if (!RotateBack(1)) return kFALSE;        

    //if all worked out we can copy the primary :
    *primary = primary_tmp;
       
    direct_sampling_done = kTRUE;
    
    return kTRUE;
}

Bool_t PAngularDistribution::Rotate(Int_t rotate_daughters) {
    //Tool method to rotate all tmp particles into
    //the defined frames
    //if rotate_daughters=1 the daughters (the original one!)
    //are rotated as well. This is needed for direct samplings

    Int_t loc_n_daughters = n_daughters * rotate_daughters;
    
    primary_tmp = primary;  //particle under investigation. Make better a copy
    primary_tmp.Boost(parent->BoostVector());  // go back to lab frame
    for (int i=0; i<loc_n_daughters; i++) 
	daughter[i]->Boost(parent->BoostVector());
    PParticle compound(primary_tmp);
    PParticle atmp;
    if (ang_reference) ang_tmp = ang_reference;
    //if (ang_reference) ang_tmp . Print();

    if (align) {
	atmp = align;
	if (align_is_daughter)
	    atmp.Boost(parent->BoostVector());  // go back to lab frame
	compound.AddTmp(atmp); //Do not use "+" in evtloop
	reference = &compound;
    }

    if (base_reference == NULL) {  // no 2nd reference frame
	if (rotate) {
	    primary_tmp.RotateZ(-reference->Phi());
	    primary_tmp.RotateY(-reference->Theta());
	    primary_tmp.Boost(0, 0, -reference->Beta());
	    ang_tmp.RotateZ(-reference->Phi());
	    ang_tmp.RotateY(-reference->Theta());
	    ang_tmp.Boost(0, 0, -reference->Beta());
	    for (int i=0; i<loc_n_daughters; i++) {
		daughter[i]->RotateZ(-reference->Phi());
		daughter[i]->RotateY(-reference->Theta());
		daughter[i]->Boost(0,0,-reference->Beta());
	    }
	} else {
	    primary_tmp.Boost(-reference->BoostVector());
	    for (int i=0; i<loc_n_daughters; i++) {
		daughter[i]->Boost(-reference->BoostVector());	
	    }
	}
    } else { // first go to 2nd reference (e.g. base_reference=eta), then
	// rotate and boost to 1st reference (e.g. reference=dilepton)
	reference_tmp = reference;

	primary_tmp.Boost(-base_reference->BoostVector());  // daughter in base_reference
	ang_tmp.Boost(-base_reference->BoostVector());  
	reference_tmp.Boost(-base_reference->BoostVector()); // reference in base_reference
	for (int i=0; i<loc_n_daughters; i++) {
	    daughter[i]->Boost(-base_reference->BoostVector());
	}
	if (rotate) {
	    primary_tmp.RotateZ(-reference_tmp.Phi());  // rotate daughter reference onto z-axis
	    primary_tmp.RotateY(-reference_tmp.Theta());
	    primary_tmp.Boost(0, 0, -reference_tmp.Beta());
	    ang_tmp.RotateZ(-reference_tmp.Phi());
	    ang_tmp.RotateY(-reference_tmp.Theta());	 
	    ang_tmp.Boost(0, 0, -reference_tmp.Beta());
	    for (int i=0; i<loc_n_daughters; i++) {
		daughter[i]->RotateZ(-reference_tmp.Phi());
		daughter[i]->RotateY(-reference_tmp.Theta());
		daughter[i]->Boost(0, 0, -reference_tmp.Beta());
	    }
	} else {
	    primary_tmp.Boost(-reference_tmp.BoostVector()); // go to reference
	    for (int i=0; i<loc_n_daughters; i++) 
		daughter[i]->Boost(-reference_tmp.BoostVector());
	}
    }
    
    //finally take ang_reference into account
    if (ang_reference && rotate) {
	primary_tmp.RotateZ(-ang_tmp.Phi());  // rotate daughter reference onto z-axis
	primary_tmp.RotateY(-ang_tmp.Theta());
	for (int i=0; i<loc_n_daughters; i++) {
	    daughter[i]->RotateZ(-ang_tmp.Phi());
	    daughter[i]->RotateY(-ang_tmp.Theta());
	}	    
    }

    return kTRUE;
}

Bool_t PAngularDistribution::RotateBack(Int_t rotate_daughters) {
    //restore the all tmp particles and the daughters

    Int_t loc_n_daughters = n_daughters * rotate_daughters;

    if (ang_reference && rotate) {
	primary_tmp.RotateY(ang_tmp.Theta());
	primary_tmp.RotateZ(ang_tmp.Phi());  // rotate daughter reference onto z-axis
	for (int i=0; i<loc_n_daughters; i++) {
	    daughter[i]->RotateY(ang_tmp.Theta());
	    daughter[i]->RotateZ(ang_tmp.Phi());
	}	    
    }

    if (base_reference==NULL) {  // no 2nd reference frame
	if (rotate) {
	    primary_tmp.Boost(0, 0, reference->Beta()); // go to 1st reference frame	    
	    primary_tmp.RotateY(reference->Theta());
	    primary_tmp.RotateZ(reference->Phi());
	    for (int i=0; i<loc_n_daughters; i++) {
		daughter[i]->Boost(0, 0, reference->Beta());
		daughter[i]->RotateY(reference->Theta());
		daughter[i]->RotateZ(reference->Phi());
	    }
	} else {
	    primary_tmp.Boost(reference->BoostVector());
	    for (int i=0; i<loc_n_daughters; i++) {
		daughter[i]->Boost(reference->BoostVector());
	    }
	}
    } else { // first go to 2nd reference (e.g. base_reference=eta), then
	// rotate and boost to 1st reference (e.g. reference=dilepton)
	primary_tmp.Boost(0,0,reference_tmp.Beta()); // go to reference
	primary_tmp.RotateY(reference_tmp.Theta());
	primary_tmp.RotateZ(reference_tmp.Phi());  // rotate daughter reference onto z-axis

	for (int i=0; i<loc_n_daughters; i++) {
	    daughter[i]->Boost(0, 0, reference_tmp.Beta());
	    daughter[i]->RotateY(reference_tmp.Theta());
	    daughter[i]->RotateZ(reference_tmp.Phi());
	}	

	primary_tmp.Boost(base_reference->BoostVector());  // daughter in base_reference
	reference_tmp.Boost(base_reference->BoostVector()); // reference in base_reference
	for (int i=0; i<loc_n_daughters; i++) {
	    daughter[i]->Boost(base_reference->BoostVector()); 
	}
    }
    primary_tmp.Boost(-parent->BoostVector());  // go back to parent frame
    for (int i=0; i<loc_n_daughters; i++) 
	daughter[i]->Boost(-parent->BoostVector());
    return kTRUE;
}

Bool_t PAngularDistribution::IsNotRejected(void) {

    if (direct_sampling_done) return kTRUE;

    Double_t tmp_c0, f;
 
    if (!Rotate(0)) return kFALSE;

    tmp_c0 = cos(primary_tmp.Theta());
    
    if ((reflection_symmetry) && (tmp_c0<0.)) {
        tmp_c0 = -tmp_c0;
    }

    if (angles1) {
	f = angles1->Eval(tmp_c0);
    }
    else if (angles2) {
	if (mass_reference)
	    f = angles2->Eval(tmp_c0, mass_reference->M());
	else
	    f = angles2->Eval(tmp_c0, reference->M());
    } else {
        f = anglesg->Eval(tmp_c0, g_spline);
    }

    if (f > weight_max) {
	weight_max = f*1.1;
	Warning("IsNotRejected", "[%s] Weight > max, new max is %lf", GetName(), weight_max);
    }

    if ((f/weight_max) > PUtils::sampleFlat()) 
	return kTRUE; // sample now distribution
    
    return kFALSE;
};

double PAngularDistribution::SamplePolarAngle(double) {
    if (angles1) {
	return angles1->GetRandom();
    } else if (anglesh){
	return anglesh->GetRandom();
    } else { //No GetRandom for TGraph, wrapper for TF2

	if (mass_reference) {
	    q_value = mass_reference->M();
	    SetParameter(0, mass_reference->M());
	} else {
	    q_value = reference->M();
	    SetParameter(0, reference->M());
	}
	return this->GetRandom();
    }
}

Double_t PAngularDistribution::EvalPar(const Double_t *x, const Double_t *params) {
    if (params) {
	q_value = (int)params[0];
    }
    if (Eval(x[0]) < 0) {
	Warning("EvalPar", "q_value is negative: %lf", q_value);
    }
    return Eval(x[0]);
}
 
Double_t PAngularDistribution::Eval(Double_t x, Double_t, Double_t, Double_t) const
{
    if ((reflection_symmetry) && (x<0.)) x = -x;

    if (angles1) return angles1->Eval(x);
    if (angles2) return angles2->Eval(x, q_value);
    if (anglesg) return anglesg->Eval(x, g_spline, "");
    return 0;
}

void PAngularDistribution::Print(const Option_t *) const {
    BasePrint();

    cout << "    Formula used: ";
    if (angles1) { 
	if (angles1->GetExpFormula() != TString("")) cout << angles1->GetExpFormula();
	else cout << "<compiled>";
    } else if (angles2) {
	if (angles2->GetExpFormula() != TString("")) cout << angles2->GetExpFormula();
	else cout << "<compiled>";
    } else if (anglesg) {
        cout << "<TGraph>";
    } else cout << "NONE";
    
    cout << endl;
}


 PAngularDistribution.cc:1
 PAngularDistribution.cc:2
 PAngularDistribution.cc:3
 PAngularDistribution.cc:4
 PAngularDistribution.cc:5
 PAngularDistribution.cc:6
 PAngularDistribution.cc:7
 PAngularDistribution.cc:8
 PAngularDistribution.cc:9
 PAngularDistribution.cc:10
 PAngularDistribution.cc:11
 PAngularDistribution.cc:12
 PAngularDistribution.cc:13
 PAngularDistribution.cc:14
 PAngularDistribution.cc:15
 PAngularDistribution.cc:16
 PAngularDistribution.cc:17
 PAngularDistribution.cc:18
 PAngularDistribution.cc:19
 PAngularDistribution.cc:20
 PAngularDistribution.cc:21
 PAngularDistribution.cc:22
 PAngularDistribution.cc:23
 PAngularDistribution.cc:24
 PAngularDistribution.cc:25
 PAngularDistribution.cc:26
 PAngularDistribution.cc:27
 PAngularDistribution.cc:28
 PAngularDistribution.cc:29
 PAngularDistribution.cc:30
 PAngularDistribution.cc:31
 PAngularDistribution.cc:32
 PAngularDistribution.cc:33
 PAngularDistribution.cc:34
 PAngularDistribution.cc:35
 PAngularDistribution.cc:36
 PAngularDistribution.cc:37
 PAngularDistribution.cc:38
 PAngularDistribution.cc:39
 PAngularDistribution.cc:40
 PAngularDistribution.cc:41
 PAngularDistribution.cc:42
 PAngularDistribution.cc:43
 PAngularDistribution.cc:44
 PAngularDistribution.cc:45
 PAngularDistribution.cc:46
 PAngularDistribution.cc:47
 PAngularDistribution.cc:48
 PAngularDistribution.cc:49
 PAngularDistribution.cc:50
 PAngularDistribution.cc:51
 PAngularDistribution.cc:52
 PAngularDistribution.cc:53
 PAngularDistribution.cc:54
 PAngularDistribution.cc:55
 PAngularDistribution.cc:56
 PAngularDistribution.cc:57
 PAngularDistribution.cc:58
 PAngularDistribution.cc:59
 PAngularDistribution.cc:60
 PAngularDistribution.cc:61
 PAngularDistribution.cc:62
 PAngularDistribution.cc:63
 PAngularDistribution.cc:64
 PAngularDistribution.cc:65
 PAngularDistribution.cc:66
 PAngularDistribution.cc:67
 PAngularDistribution.cc:68
 PAngularDistribution.cc:69
 PAngularDistribution.cc:70
 PAngularDistribution.cc:71
 PAngularDistribution.cc:72
 PAngularDistribution.cc:73
 PAngularDistribution.cc:74
 PAngularDistribution.cc:75
 PAngularDistribution.cc:76
 PAngularDistribution.cc:77
 PAngularDistribution.cc:78
 PAngularDistribution.cc:79
 PAngularDistribution.cc:80
 PAngularDistribution.cc:81
 PAngularDistribution.cc:82
 PAngularDistribution.cc:83
 PAngularDistribution.cc:84
 PAngularDistribution.cc:85
 PAngularDistribution.cc:86
 PAngularDistribution.cc:87
 PAngularDistribution.cc:88
 PAngularDistribution.cc:89
 PAngularDistribution.cc:90
 PAngularDistribution.cc:91
 PAngularDistribution.cc:92
 PAngularDistribution.cc:93
 PAngularDistribution.cc:94
 PAngularDistribution.cc:95
 PAngularDistribution.cc:96
 PAngularDistribution.cc:97
 PAngularDistribution.cc:98
 PAngularDistribution.cc:99
 PAngularDistribution.cc:100
 PAngularDistribution.cc:101
 PAngularDistribution.cc:102
 PAngularDistribution.cc:103
 PAngularDistribution.cc:104
 PAngularDistribution.cc:105
 PAngularDistribution.cc:106
 PAngularDistribution.cc:107
 PAngularDistribution.cc:108
 PAngularDistribution.cc:109
 PAngularDistribution.cc:110
 PAngularDistribution.cc:111
 PAngularDistribution.cc:112
 PAngularDistribution.cc:113
 PAngularDistribution.cc:114
 PAngularDistribution.cc:115
 PAngularDistribution.cc:116
 PAngularDistribution.cc:117
 PAngularDistribution.cc:118
 PAngularDistribution.cc:119
 PAngularDistribution.cc:120
 PAngularDistribution.cc:121
 PAngularDistribution.cc:122
 PAngularDistribution.cc:123
 PAngularDistribution.cc:124
 PAngularDistribution.cc:125
 PAngularDistribution.cc:126
 PAngularDistribution.cc:127
 PAngularDistribution.cc:128
 PAngularDistribution.cc:129
 PAngularDistribution.cc:130
 PAngularDistribution.cc:131
 PAngularDistribution.cc:132
 PAngularDistribution.cc:133
 PAngularDistribution.cc:134
 PAngularDistribution.cc:135
 PAngularDistribution.cc:136
 PAngularDistribution.cc:137
 PAngularDistribution.cc:138
 PAngularDistribution.cc:139
 PAngularDistribution.cc:140
 PAngularDistribution.cc:141
 PAngularDistribution.cc:142
 PAngularDistribution.cc:143
 PAngularDistribution.cc:144
 PAngularDistribution.cc:145
 PAngularDistribution.cc:146
 PAngularDistribution.cc:147
 PAngularDistribution.cc:148
 PAngularDistribution.cc:149
 PAngularDistribution.cc:150
 PAngularDistribution.cc:151
 PAngularDistribution.cc:152
 PAngularDistribution.cc:153
 PAngularDistribution.cc:154
 PAngularDistribution.cc:155
 PAngularDistribution.cc:156
 PAngularDistribution.cc:157
 PAngularDistribution.cc:158
 PAngularDistribution.cc:159
 PAngularDistribution.cc:160
 PAngularDistribution.cc:161
 PAngularDistribution.cc:162
 PAngularDistribution.cc:163
 PAngularDistribution.cc:164
 PAngularDistribution.cc:165
 PAngularDistribution.cc:166
 PAngularDistribution.cc:167
 PAngularDistribution.cc:168
 PAngularDistribution.cc:169
 PAngularDistribution.cc:170
 PAngularDistribution.cc:171
 PAngularDistribution.cc:172
 PAngularDistribution.cc:173
 PAngularDistribution.cc:174
 PAngularDistribution.cc:175
 PAngularDistribution.cc:176
 PAngularDistribution.cc:177
 PAngularDistribution.cc:178
 PAngularDistribution.cc:179
 PAngularDistribution.cc:180
 PAngularDistribution.cc:181
 PAngularDistribution.cc:182
 PAngularDistribution.cc:183
 PAngularDistribution.cc:184
 PAngularDistribution.cc:185
 PAngularDistribution.cc:186
 PAngularDistribution.cc:187
 PAngularDistribution.cc:188
 PAngularDistribution.cc:189
 PAngularDistribution.cc:190
 PAngularDistribution.cc:191
 PAngularDistribution.cc:192
 PAngularDistribution.cc:193
 PAngularDistribution.cc:194
 PAngularDistribution.cc:195
 PAngularDistribution.cc:196
 PAngularDistribution.cc:197
 PAngularDistribution.cc:198
 PAngularDistribution.cc:199
 PAngularDistribution.cc:200
 PAngularDistribution.cc:201
 PAngularDistribution.cc:202
 PAngularDistribution.cc:203
 PAngularDistribution.cc:204
 PAngularDistribution.cc:205
 PAngularDistribution.cc:206
 PAngularDistribution.cc:207
 PAngularDistribution.cc:208
 PAngularDistribution.cc:209
 PAngularDistribution.cc:210
 PAngularDistribution.cc:211
 PAngularDistribution.cc:212
 PAngularDistribution.cc:213
 PAngularDistribution.cc:214
 PAngularDistribution.cc:215
 PAngularDistribution.cc:216
 PAngularDistribution.cc:217
 PAngularDistribution.cc:218
 PAngularDistribution.cc:219
 PAngularDistribution.cc:220
 PAngularDistribution.cc:221
 PAngularDistribution.cc:222
 PAngularDistribution.cc:223
 PAngularDistribution.cc:224
 PAngularDistribution.cc:225
 PAngularDistribution.cc:226
 PAngularDistribution.cc:227
 PAngularDistribution.cc:228
 PAngularDistribution.cc:229
 PAngularDistribution.cc:230
 PAngularDistribution.cc:231
 PAngularDistribution.cc:232
 PAngularDistribution.cc:233
 PAngularDistribution.cc:234
 PAngularDistribution.cc:235
 PAngularDistribution.cc:236
 PAngularDistribution.cc:237
 PAngularDistribution.cc:238
 PAngularDistribution.cc:239
 PAngularDistribution.cc:240
 PAngularDistribution.cc:241
 PAngularDistribution.cc:242
 PAngularDistribution.cc:243
 PAngularDistribution.cc:244
 PAngularDistribution.cc:245
 PAngularDistribution.cc:246
 PAngularDistribution.cc:247
 PAngularDistribution.cc:248
 PAngularDistribution.cc:249
 PAngularDistribution.cc:250
 PAngularDistribution.cc:251
 PAngularDistribution.cc:252
 PAngularDistribution.cc:253
 PAngularDistribution.cc:254
 PAngularDistribution.cc:255
 PAngularDistribution.cc:256
 PAngularDistribution.cc:257
 PAngularDistribution.cc:258
 PAngularDistribution.cc:259
 PAngularDistribution.cc:260
 PAngularDistribution.cc:261
 PAngularDistribution.cc:262
 PAngularDistribution.cc:263
 PAngularDistribution.cc:264
 PAngularDistribution.cc:265
 PAngularDistribution.cc:266
 PAngularDistribution.cc:267
 PAngularDistribution.cc:268
 PAngularDistribution.cc:269
 PAngularDistribution.cc:270
 PAngularDistribution.cc:271
 PAngularDistribution.cc:272
 PAngularDistribution.cc:273
 PAngularDistribution.cc:274
 PAngularDistribution.cc:275
 PAngularDistribution.cc:276
 PAngularDistribution.cc:277
 PAngularDistribution.cc:278
 PAngularDistribution.cc:279
 PAngularDistribution.cc:280
 PAngularDistribution.cc:281
 PAngularDistribution.cc:282
 PAngularDistribution.cc:283
 PAngularDistribution.cc:284
 PAngularDistribution.cc:285
 PAngularDistribution.cc:286
 PAngularDistribution.cc:287
 PAngularDistribution.cc:288
 PAngularDistribution.cc:289
 PAngularDistribution.cc:290
 PAngularDistribution.cc:291
 PAngularDistribution.cc:292
 PAngularDistribution.cc:293
 PAngularDistribution.cc:294
 PAngularDistribution.cc:295
 PAngularDistribution.cc:296
 PAngularDistribution.cc:297
 PAngularDistribution.cc:298
 PAngularDistribution.cc:299
 PAngularDistribution.cc:300
 PAngularDistribution.cc:301
 PAngularDistribution.cc:302
 PAngularDistribution.cc:303
 PAngularDistribution.cc:304
 PAngularDistribution.cc:305
 PAngularDistribution.cc:306
 PAngularDistribution.cc:307
 PAngularDistribution.cc:308
 PAngularDistribution.cc:309
 PAngularDistribution.cc:310
 PAngularDistribution.cc:311
 PAngularDistribution.cc:312
 PAngularDistribution.cc:313
 PAngularDistribution.cc:314
 PAngularDistribution.cc:315
 PAngularDistribution.cc:316
 PAngularDistribution.cc:317
 PAngularDistribution.cc:318
 PAngularDistribution.cc:319
 PAngularDistribution.cc:320
 PAngularDistribution.cc:321
 PAngularDistribution.cc:322
 PAngularDistribution.cc:323
 PAngularDistribution.cc:324
 PAngularDistribution.cc:325
 PAngularDistribution.cc:326
 PAngularDistribution.cc:327
 PAngularDistribution.cc:328
 PAngularDistribution.cc:329
 PAngularDistribution.cc:330
 PAngularDistribution.cc:331
 PAngularDistribution.cc:332
 PAngularDistribution.cc:333
 PAngularDistribution.cc:334
 PAngularDistribution.cc:335
 PAngularDistribution.cc:336
 PAngularDistribution.cc:337
 PAngularDistribution.cc:338
 PAngularDistribution.cc:339
 PAngularDistribution.cc:340
 PAngularDistribution.cc:341
 PAngularDistribution.cc:342
 PAngularDistribution.cc:343
 PAngularDistribution.cc:344
 PAngularDistribution.cc:345
 PAngularDistribution.cc:346
 PAngularDistribution.cc:347
 PAngularDistribution.cc:348
 PAngularDistribution.cc:349
 PAngularDistribution.cc:350
 PAngularDistribution.cc:351
 PAngularDistribution.cc:352
 PAngularDistribution.cc:353
 PAngularDistribution.cc:354
 PAngularDistribution.cc:355
 PAngularDistribution.cc:356
 PAngularDistribution.cc:357
 PAngularDistribution.cc:358
 PAngularDistribution.cc:359
 PAngularDistribution.cc:360
 PAngularDistribution.cc:361
 PAngularDistribution.cc:362
 PAngularDistribution.cc:363
 PAngularDistribution.cc:364
 PAngularDistribution.cc:365
 PAngularDistribution.cc:366
 PAngularDistribution.cc:367
 PAngularDistribution.cc:368
 PAngularDistribution.cc:369
 PAngularDistribution.cc:370
 PAngularDistribution.cc:371
 PAngularDistribution.cc:372
 PAngularDistribution.cc:373
 PAngularDistribution.cc:374
 PAngularDistribution.cc:375
 PAngularDistribution.cc:376
 PAngularDistribution.cc:377
 PAngularDistribution.cc:378
 PAngularDistribution.cc:379
 PAngularDistribution.cc:380
 PAngularDistribution.cc:381
 PAngularDistribution.cc:382
 PAngularDistribution.cc:383
 PAngularDistribution.cc:384
 PAngularDistribution.cc:385
 PAngularDistribution.cc:386
 PAngularDistribution.cc:387
 PAngularDistribution.cc:388
 PAngularDistribution.cc:389
 PAngularDistribution.cc:390
 PAngularDistribution.cc:391
 PAngularDistribution.cc:392
 PAngularDistribution.cc:393
 PAngularDistribution.cc:394
 PAngularDistribution.cc:395
 PAngularDistribution.cc:396
 PAngularDistribution.cc:397
 PAngularDistribution.cc:398
 PAngularDistribution.cc:399
 PAngularDistribution.cc:400
 PAngularDistribution.cc:401
 PAngularDistribution.cc:402
 PAngularDistribution.cc:403
 PAngularDistribution.cc:404
 PAngularDistribution.cc:405
 PAngularDistribution.cc:406
 PAngularDistribution.cc:407
 PAngularDistribution.cc:408
 PAngularDistribution.cc:409
 PAngularDistribution.cc:410
 PAngularDistribution.cc:411
 PAngularDistribution.cc:412
 PAngularDistribution.cc:413
 PAngularDistribution.cc:414
 PAngularDistribution.cc:415
 PAngularDistribution.cc:416
 PAngularDistribution.cc:417
 PAngularDistribution.cc:418
 PAngularDistribution.cc:419
 PAngularDistribution.cc:420
 PAngularDistribution.cc:421
 PAngularDistribution.cc:422
 PAngularDistribution.cc:423
 PAngularDistribution.cc:424
 PAngularDistribution.cc:425
 PAngularDistribution.cc:426
 PAngularDistribution.cc:427
 PAngularDistribution.cc:428
 PAngularDistribution.cc:429
 PAngularDistribution.cc:430
 PAngularDistribution.cc:431
 PAngularDistribution.cc:432
 PAngularDistribution.cc:433
 PAngularDistribution.cc:434
 PAngularDistribution.cc:435
 PAngularDistribution.cc:436
 PAngularDistribution.cc:437
 PAngularDistribution.cc:438
 PAngularDistribution.cc:439
 PAngularDistribution.cc:440
 PAngularDistribution.cc:441
 PAngularDistribution.cc:442
 PAngularDistribution.cc:443
 PAngularDistribution.cc:444
 PAngularDistribution.cc:445
 PAngularDistribution.cc:446
 PAngularDistribution.cc:447
 PAngularDistribution.cc:448
 PAngularDistribution.cc:449
 PAngularDistribution.cc:450
 PAngularDistribution.cc:451
 PAngularDistribution.cc:452
 PAngularDistribution.cc:453
 PAngularDistribution.cc:454
 PAngularDistribution.cc:455
 PAngularDistribution.cc:456
 PAngularDistribution.cc:457
 PAngularDistribution.cc:458
 PAngularDistribution.cc:459
 PAngularDistribution.cc:460
 PAngularDistribution.cc:461
 PAngularDistribution.cc:462
 PAngularDistribution.cc:463
 PAngularDistribution.cc:464
 PAngularDistribution.cc:465
 PAngularDistribution.cc:466
 PAngularDistribution.cc:467
 PAngularDistribution.cc:468
 PAngularDistribution.cc:469
 PAngularDistribution.cc:470
 PAngularDistribution.cc:471
 PAngularDistribution.cc:472
 PAngularDistribution.cc:473
 PAngularDistribution.cc:474
 PAngularDistribution.cc:475
 PAngularDistribution.cc:476
 PAngularDistribution.cc:477
 PAngularDistribution.cc:478
 PAngularDistribution.cc:479
 PAngularDistribution.cc:480
 PAngularDistribution.cc:481
 PAngularDistribution.cc:482
 PAngularDistribution.cc:483
 PAngularDistribution.cc:484
 PAngularDistribution.cc:485
 PAngularDistribution.cc:486
 PAngularDistribution.cc:487
 PAngularDistribution.cc:488
 PAngularDistribution.cc:489
 PAngularDistribution.cc:490
 PAngularDistribution.cc:491
 PAngularDistribution.cc:492
 PAngularDistribution.cc:493
 PAngularDistribution.cc:494
 PAngularDistribution.cc:495
 PAngularDistribution.cc:496
 PAngularDistribution.cc:497
 PAngularDistribution.cc:498
 PAngularDistribution.cc:499
 PAngularDistribution.cc:500
 PAngularDistribution.cc:501
 PAngularDistribution.cc:502
 PAngularDistribution.cc:503
 PAngularDistribution.cc:504
 PAngularDistribution.cc:505
 PAngularDistribution.cc:506
 PAngularDistribution.cc:507
 PAngularDistribution.cc:508
 PAngularDistribution.cc:509
 PAngularDistribution.cc:510
 PAngularDistribution.cc:511
 PAngularDistribution.cc:512
 PAngularDistribution.cc:513
 PAngularDistribution.cc:514
 PAngularDistribution.cc:515
 PAngularDistribution.cc:516
 PAngularDistribution.cc:517