/////////////////////////////////////////////////////////////////////
//  PDistribution Class implementation file
//
//  PDistribution keeps information about generic distributions
//  This is only the base class
//  Algorithms implemented in the inherited classes
//  Distributions are inherited from TF1, this means that
//  the distributions may use Eval to make drawing very easy
//
//                                  Author:  I. Froehlich
/////////////////////////////////////////////////////////////////////


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

#include "PDistribution.h"


ClassImp(PDistribution)

PDistribution::PDistribution() {
    identifier   = new char[1];
    description  = new char[1];
    version_flag = VERSION_SAMPLING; 
    no_daughters = 0;
    enable       = 1;
    primary_key  = -1;
    group        = NULL;
    position     = 0;
    linkdbdone   = 0;
    debug_flag   = 0;
    for (int i=0; i<MAX_PARTICLE_LIST; i++) {
	particle[i] = NULL;
	names[i]    = NULL;
	particle_flag[i] = 0;
	pid[i] = 0;
	private_flag[i]     = NULL;
	private_flag_int[i] = NULL;
    }
}

PDistribution::PDistribution(const Char_t *id, const Char_t *de):
    TF1(id, "0", 0, 1) {

    identifier  = new char[strlen(id) + 1];
    description = new char[strlen(de) + 1];
    strcpy((char *)identifier, id);
    strcpy((char *)description, de);

    no_daughters = 0;

    w_max = -1.;
    w_num = 0;
    w_sum = 0;
    exp_w_mean = 1.;
    dynamic_range = 1.;
    opt_string = NULL;
    
    version_flag = VERSION_SAMPLING; 
    relative_warning = 1;

    enable = 1;
    is_activated = 0;
    primary_key = model_def_key = sec_key = -1;

    group      = NULL;
    position   = 0;
    linkdbdone = 0;
    debug_flag = 0;
    preliminary_particles = 0;
    for (int i=0; i<MAX_PARTICLE_LIST; i++) {
	particle[i] = NULL;
	names[i]    = NULL;
	particle_flag[i] = 0;
	pid[i] = 0;
	private_flag[i]     = NULL;
	private_flag_int[i] = NULL;
    }

    // Copied from TF1 constructor... 
    SetName(id);
    fNpar = 0;

    fXmin      = 0.;
    fXmax      = 0.;
    
    fNpx       = 1;
    fType      = 0;
    //    fFunction  = 0;
    fNdim = 1;
    //... to be overwritten by PChannelModel

    draw_scaling = 1.;
}

PDistribution::~PDistribution() {
    delete[] identifier;
    delete[] description;
}

PDistribution *PDistribution::Clone(const char *) const {
    Fatal("Clone", "Clone calling virt. function for %s", description);
    return NULL;
};

Bool_t PDistribution::FreezeOut(void) {
    //called once after the link to the data base has been done
    //LinkDB()
    
    return kTRUE;    
};

Bool_t PDistribution::Init(void) {
    //reading the private flags e.g. 
    //called directly after attaching the distribution to the channel
    //particle pointers complete at this point
    
    return kTRUE;    
};

Bool_t PDistribution::IsNotRejected(void) {
    //check after genbod if the generated daughters are matching to the distributions
    //Each inherited class must decide on its own, what should be done here
    //Can be used to cut-out distributions from phase space

    return kTRUE;   
};

Bool_t PDistribution::Prepare(void) {
    //make the preparation is front of genbod here
    //e.g. rotations
    return kTRUE;   
};

Bool_t PDistribution::SampleMass(void) {
    //Can be user-defined mass sampling

    return kFALSE; //Switched off by default
};

Bool_t PDistribution::SampleMomentum(void) {
    //Can be user-defined momentum sampling (e.g. genbod)

    return kFALSE; //Switched off by default
};

Bool_t PDistribution::SampleAngle(void) {
    //Can be user-defined angular sampling

    return kFALSE; //Switched off by default
};

Bool_t PDistribution::Finalize(void) {
    //rotate back, if needed
    //return kFALSE if EndOfChain should be called
    return kTRUE;   
};


Bool_t PDistribution::EndOfChain(void) {
  return kTRUE; 
};

Bool_t PDistribution::CheckAbort(void) {
    //Moreover, the class must decide if the complete chain must be aborted
    //e.g. jump over a resonance, and look to the angular distributions
    //of the decay products
    //If true, resample the complete reaction chain

    return kFALSE;
};

Double_t PDistribution::GetWeight(void) {
    //Support for weights in the PChannel::Decay()

    return 1.;
};

Bool_t PDistribution::WriteDebugInfo(PParticle *par) {
    par->addDebugString((char *)GetDescription());

    return kTRUE;
};

void PDistribution::Reset(void) {
    for (int i=0; i<MAX_PARTICLE_LIST; i++) {
	particle[i]=NULL;
    }
    ResetStatus();
};

Int_t PDistribution::GetStatus(void) {
    for (int i=0; i<position; i++) {
	if (particle[i]==NULL) {
	    return -1;
	}
    }
    return 0;
}

Int_t PDistribution::Add(const Char_t *opt) {
    parse_s=4;
    PUtils::Tokenize(opt, ",", parse, &parse_s);
    if (parse_s==1) {
	Warning("Add","Not enough options in %s",opt);
	return -1;
    }
    if (parse_s == 2) return Add(parse[0], parse[1]);
    if (parse_s == 3) return Add(parse[0], parse[1], parse[2]);
    if (parse_s == 4) return Add(parse[0], parse[1], parse[2], parse[3]);
    return -1;
}

Int_t PDistribution::Set(const Char_t *opt) {
    parse_s=2;
    PUtils::Tokenize(opt, ",", parse, &parse_s);
    if (parse_s == 1) {
	Warning("Set", "Not enough options in %s", opt);
	return -1;
    }
    if (parse_s == 2) return Set(parse[0], parse[1]);
  
    return -1;
}

Int_t PDistribution::Add(const Char_t *name, int flag, const Char_t *pflag) {
    if (position == MAX_PARTICLE_LIST) {
	Error("Add", "MAX_PARTICLE_LIST reached");
	return -1;
    }

    if (GetVersionFlag(VERSION_IS_PRIMARY) 
	&& !(flag==PARTICLE_LIST_DAUGHTER) 
	&& !(flag==PARTICLE_LIST_PARENT) 
	&& relative_warning ) {
	Warning("Add", 
		"The primary model (%s) must not have other relatives then parent or daughter",
		identifier);
    }

    if (preliminary_particles) {
 	position = 0; //Overwrite everything
 	preliminary_particles = 0;
    }

    particle[position] = NULL;
    names[position]    = name;
    particle_flag[position] = flag;
    private_flag[position]  = pflag;
    if (strcmp(name, "q") == 0) { //particle is quasi
	pid[position]    = DISTRIBUTION_QUASI_PID;
	relative_warning = 0; //switch off for grandparents
    }
    else if (strcmp(name, "?") == 0) //can be anything
	pid[position] = DISTRIBUTION_SOMETHING_PID;
    else if (strcmp(name, "N") == 0) //any nucleon
	pid[position] = DISTRIBUTION_NUCLEON_PID;
    else
	pid[position] = makeStaticData()->GetParticleID(name);
    position++;
    return 0;
};

Int_t PDistribution::Set(const Char_t *name, const Char_t *pflag) {
    for (int i=0; i<position; i++) {
	if ((strcmp(name, names[i]) == 0)) {
	    private_flag[i] = pflag;
	    return 0;
	}
    }
    return -1;
};

Int_t PDistribution::Add(const Char_t *name,  const Char_t *flag1, 
			 const Char_t *flag2, const Char_t *flag3) {

    Int_t tmp = GetFlag(flag1);
    if (tmp == 0) {
	Warning("Add", "Could not get flag. First flag must be *not* private");
	return -1;
    }

    tmp |= (GetFlag(flag2) | GetFlag(flag3));
    
    const Char_t *pflag = NULL;
    if ((GetFlag(flag2) == 0) && (flag2  != NULL)) 
	pflag = flag2;
    if ((GetFlag(flag3) == 0) && (flag3  != NULL)) 
	pflag = flag3;
    if (!flag2 || GetFlag(flag2)) {  //catch the "parent,sibling" case
	TString *delme = new TString(flag1);
	delme->ToLower(); //memory leak but avoids GetDaughter bug
	pflag = (Char_t*)delme->Data(); //copy the official flag to private one to make GetParticle("parent");
    }

    return Add(name, tmp, pflag);
};

Int_t PDistribution::GetFlag(const Char_t *flag) {
    if (flag == NULL) return 0;
    if (strcmp(flag, "daughter") == 0)         return PARTICLE_LIST_DAUGHTER;
    if (strcmp(flag, "DAUGHTER") == 0)         return PARTICLE_LIST_DAUGHTER;
    if (strcmp(flag, "parent") == 0)           return PARTICLE_LIST_PARENT;
    if (strcmp(flag, "GRANDDAUGHTER") == 0)    return PARTICLE_LIST_GRANDDAUGHTER;
    if (strcmp(flag, "granddaughter") == 0)    return PARTICLE_LIST_GRANDDAUGHTER;    
    if (strcmp(flag, "PARENT") == 0)           return PARTICLE_LIST_PARENT;
    if (strcmp(flag, "grandparent") == 0)      return PARTICLE_LIST_GRANDPARENT;
    if (strcmp(flag, "GRANDPARENT") == 0)      return PARTICLE_LIST_GRANDPARENT;
    if (strcmp(flag, "grandgrandparent") == 0) return PARTICLE_LIST_GRANDGRANDPARENT ;
    if (strcmp(flag, "GRANDGRANDPARENT") == 0) return PARTICLE_LIST_GRANDGRANDPARENT ;
    if (strcmp(flag, "sibling") == 0)          return PARTICLE_LIST_SIBLING;   
    if (strcmp(flag, "SIBLING") == 0)          return PARTICLE_LIST_SIBLING;   
    return 0;
};

void  PDistribution::ResetRelatives(Int_t flag) {
    //Cleans all particles which are not a direct parent or daughter
    //This is used to reset the PChannel and make distributions again tentative

    for (int i=0; i<position; i++) {
	if ((particle_flag[i] != PARTICLE_LIST_DAUGHTER) &&
	    (particle_flag[i] != PARTICLE_LIST_PARENT)) {
	    if (flag && (particle_flag[i]==flag)) {
		particle[i] = NULL;
	    } else if (!flag) {
		particle[i] = NULL;
	    }
	}
    }
    ResetStatus();
};

Int_t PDistribution::SetParticle(PParticle *part, int mypid, int flag) {

    if (!strcmp(GetName(), "_testmodel")) {
	cout << "PDistribution::SetParticle: check particle, mypid: " << mypid << ", flag: " << flag << endl;
	part->Print();
    }
    
    if (no_daughters && (flag == PARTICLE_LIST_DAUGHTER)) {
	if (!strcmp(GetName(), "_testmodel")) cout << "No daughters" << endl;
	return 0; //Do not check daughters if not required
    }

     for (int i=0; i<position; i++) {
	if (((pid[i] == mypid ) && (particle_flag[i] == flag) && (particle[i] == NULL))	    
	    || ((pid[i] == DISTRIBUTION_SOMETHING_PID)  
		&& (particle[i] == NULL) && (particle_flag[i] == flag))
	    || ((pid[i] == DISTRIBUTION_NUCLEON_PID) &&
		(makeStaticData()->GetParticleID("n") == mypid 
		 || makeStaticData()->GetParticleID("p") == mypid ) && 
		(particle[i] == NULL) && (particle_flag[i] == flag))
	    ||
	    ((flag == PARTICLE_LIST_DAUGHTER) && (mypid>1000) && (pid[i]==DISTRIBUTION_QUASI_PID) 
	     && (particle[i] == NULL))) {
	    particle[i] = part;

	    /* BUGBUG: If "anything" already set, and the template is matching
	       then anything has the be shifted, or ? */

	    //Add granddaughters
	    if ((flag == PARTICLE_LIST_DAUGHTER) && (mypid>1000) && (pid[i]==DISTRIBUTION_QUASI_PID)) {
		int pid1 = mypid/1000, pid2 = mypid%1000;
		PParticle *beam   = part->GetScattering(0);
		PParticle *target = part->GetScattering(1);
		if (!beam || !target) {
		    if (!strcmp(GetName(), "_testmodel")) 
			cout << "No beam, no target" << endl;
		    return -1; //have not found anything
		}
		int xpid1 = beam->ID(), 
		    xpid2 = target->ID();

		for (int j=0; j<position; j++) {
		    if ((particle_flag[j] == PARTICLE_LIST_GRANDDAUGHTER) && (particle[j] == NULL)) {
			if (pid[j] == pid1 && xpid1 == pid[j]) {
			    particle[j] = beam;
			    xpid1 = -1;
			}
			else if (pid[j] == pid2 && xpid1 == pid[j]) {
			    particle[j] = beam;
			    xpid1 = -1;
			}
			else if (pid[j] == pid1 && xpid2 == pid[j]) {
			    particle[j] = target;
			    xpid2 = -1;
			}
			else if (pid[j] == pid2 && xpid2 == pid[j]) {
			    particle[j] = target;
			    xpid2 = -1;
			}
		    }
		}
	    }
	    if (!strcmp(GetName(),"_testmodel")) cout << "found" << endl;
	    return 0;
	}
     }
     if (!strcmp(GetName(),"_testmodel")) cout << "Not found" << endl;
     return -1; //have not found anything
};

Int_t PDistribution::CheckDaughters(void) {
    if (no_daughters)  {
	return 0;
    }

    //check if all daughters are complete, return -1 if not
    for (int i=0; i<position; i++) {
	if ((particle_flag[i] == PARTICLE_LIST_DAUGHTER) && (particle[i] == NULL)) {
	    return -1;
	}
    }
    return 0; //all daughters are set
};

void PDistribution::ResetStatus(void) {
    for (int i=0; i<position; i++) {
	if (private_flag_int[i]) {
	    private_flag[i] = private_flag_int[i];
	    private_flag_int[i] = NULL; //remove saved flag
	}
    }
};

PParticle *PDistribution::GetParticle(const Char_t *pflag) {
    //Read the particle in the Init() method of the inherited distribution
    //"pflag" can be a private identifier string (as used in the Add() method)
    //or one of the official strings like daughter, parent etc...
    //Each particle object is been read out only one time

    for (int i=0; i<position; i++) {
	if (private_flag[i]) {
	    if (pflag) {
		if ((strcmp(pflag, private_flag[i]) == 0) ||
		    (strcmp(pflag, makeStaticData()->GetParticleName((pid[i] < 1000)? pid[i] : 0)) == 0)) {
		    private_flag_int[i] = private_flag[i]; //save flag for later use
		    current_flag = particle_flag[i];
		    private_flag[i] = NULL; //remove used flag
		    
		    return particle[i];
		}
	    } else {
		opt_string = private_flag[i];
		return particle[i];
	    }	    
	}   
    }
    return NULL;
};

void PDistribution::BasePrint(void) const {
    cout << "[" << identifier; 
    if (GetVersionFlag() & VERSION_INVERT_WEIGHTING)
	cout << ",IW";
    if (GetVersionFlag() & VERSION_SAMPLING)
	cout << ",S";
    cout << "] " << description << " <" << ClassName() << ">" << endl;
    for (int i=0; i<position; i++) {
	cout << "    " << names[i] << ", PID: " << pid[i];
	if (particle_flag[i] == PARTICLE_LIST_DAUGHTER)
	    cout << " is a Daughter";
	else if (particle_flag[i] == PARTICLE_LIST_PARENT)
	    cout << " is a Parent";
	if (private_flag[i]) 
	    cout << " [" << private_flag[i] << "]" << endl;
	else cout << endl;
	if (particle[i]) { //particle object are already defined
	    particle[i]->Print();
	}
    }
}

void PDistribution::Print(const Option_t *) const {  
    //Debug info
    BasePrint();
}

void PDistribution::SubPrint(Int_t) const {
    //Print sub-models
    return;
}

const Char_t *PDistribution::Path() const {
    if (GetVersionFlag(VERSION_IS_PRIMARY)) return "\0";
    if (model_def_key < 0) return NULL;
    return makeDataBase()->GetName(model_def_key);
}

int PDistribution::GetDepth(int) {
    return -1; //nothing
}


Bool_t PDistribution::ExecCommand(const char *, Double_t) {
    //Pure virtual
    return kFALSE;
}

Bool_t PDistribution::Exec(const char *command) {

    if (strlen(command) == 0) {
	return ExecCommand("", 0);
    };

    char *array[200];
    Int_t array_s = 200; 
    PUtils::Tokenize(command, ";", array, &array_s);

    
    for (int i=0; i<array_s; i++) {
	char *array2[200];
	Int_t array2_s = 200; 
	PUtils::Tokenize(array[i], "=", array2, &array2_s);

	if (array2_s > 2) {
	    Warning("Exec","Syntax error: Too many ='s");
	    return kFALSE;
	} else if (array2_s == 2){
	    Double_t arg;
	    sscanf(array2[1], "%lf", &arg);
	    if (!ExecCommand(array2[0], arg)) {
		Warning("Exec", "Syntax error: %s", array2[1]);
	    }
	} else {
	    if (!ExecCommand(array[i], 0.)) {
		Warning("Exec", "Syntax error: %s", array[i]);
	    }
	}
    }

    return kTRUE;
}

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