return -1000.;
}
- Double_t R=CalcRk(I0,I1);
- if(R<0.){
+ Double_t r=CalcRk(I0,I1);
+ if(r<0.){
Fatal("GetELossRandomK","R should not be negative");
return -1000.;
}
Fatal("GetELossRandomK","wc should be greater than zero");
return -1000.;
}
- if(SampleEnergyLoss(ipart,R)!=0){
+ if(SampleEnergyLoss(ipart,r)!=0){
Fatal("GetELossRandomK","Could not sample energy loss");
return -1000.;
}
// all parameters are well within the bounds.
// read-in data tables before first call
- Double_t R=CalcRk(I0,I1);
- if(R<=0.){
+ Double_t r=CalcRk(I0,I1);
+ if(r<=0.){
return 0.;
}
return 0.;
}
- return GetELossRandomKFastR(ipart,R,wc,e);
+ return GetELossRandomKFastR(ipart,r,wc,e);
}
-Double_t AliQuenchingWeights::GetELossRandomKFastR(Int_t ipart, Double_t R, Double_t wc, Double_t e)
+Double_t AliQuenchingWeights::GetELossRandomKFastR(Int_t ipart, Double_t r, Double_t wc, Double_t e)
{
// return DeltaE for new dynamic version
// for given parton type, R and wc value and energy
// all parameters are well within the bounds.
// read-in data tables before first call
- if(R>=fgkRMax) {
- R=fgkRMax-1;
+ if(r>=fgkRMax) {
+ r=fgkRMax-1;
}
Double_t discrete=0.;
Int_t bin=1;
Double_t xxxx = fHisto->GetBinCenter(bin);
if(fMultSoft)
- CalcMult(ipart,R,xxxx,continuous,discrete);
+ CalcMult(ipart,r,xxxx,continuous,discrete);
else
- CalcSingleHard(ipart,R,xxxx,continuous,discrete);
+ CalcSingleHard(ipart,r,xxxx,continuous,discrete);
if(discrete>=1.0) {
return 0.; //no energy loss
if(fMultSoft) {
for(Int_t bin=2; bin<=kbinmax; bin++) {
xxxx = fHisto->GetBinCenter(bin);
- CalcMult(ipart,R,xxxx,continuous,discrete);
+ CalcMult(ipart,r,xxxx,continuous,discrete);
fHisto->SetBinContent(bin,continuous);
}
} else {
for(Int_t bin=2; bin<=kbinmax; bin++) {
xxxx = fHisto->GetBinCenter(bin);
- CalcSingleHard(ipart,R,xxxx,continuous,discrete);
+ CalcSingleHard(ipart,r,xxxx,continuous,discrete);
fHisto->SetBinContent(bin,continuous);
}
}
{
// return discrete weight
- Double_t R=CalcRk(I0,I1);
- if(R<=0.){
+ Double_t r=CalcRk(I0,I1);
+ if(r<=0.){
return 1.;
}
- return GetDiscreteWeightR(ipart,R);
+ return GetDiscreteWeightR(ipart,r);
}
-Double_t AliQuenchingWeights::GetDiscreteWeightR(Int_t ipart, Double_t R)
+Double_t AliQuenchingWeights::GetDiscreteWeightR(Int_t ipart, Double_t r)
{
// return discrete weight
- if(R>=fgkRMax) {
- R=fgkRMax-1;
+ if(r>=fgkRMax) {
+ r=fgkRMax-1;
}
Double_t discrete=0.;
Int_t bin=1;
Double_t xxxx = fHisto->GetBinCenter(bin);
if(fMultSoft)
- CalcMult(ipart,R,xxxx,continuous,discrete);
+ CalcMult(ipart,r,xxxx,continuous,discrete);
else
- CalcSingleHard(ipart,R,xxxx,continuous,discrete);
+ CalcSingleHard(ipart,r,xxxx,continuous,discrete);
return discrete;
}
-void AliQuenchingWeights::GetZeroLossProb(Double_t &p,Double_t &prw,Double_t &prw_cont,
+void AliQuenchingWeights::GetZeroLossProb(Double_t &p,Double_t &prw,Double_t &prwcont,
Int_t ipart,Double_t I0,Double_t I1,Double_t e)
{
- p=1.;prw=1.;prw_cont=1.;
- Double_t R=CalcRk(I0,I1);
- if(R<=0.){
+ //calculate the probabilty that there is no energy
+ //loss for different ways of energy constraint
+ p=1.;prw=1.;prwcont=1.;
+ Double_t r=CalcRk(I0,I1);
+ if(r<=0.){
return;
}
Double_t wc=CalcWCk(I1);
if(wc<=0.){
return;
}
- GetZeroLossProbR(p,prw,prw_cont,ipart,R,wc,e);
+ GetZeroLossProbR(p,prw,prwcont,ipart,r,wc,e);
}
-void AliQuenchingWeights::GetZeroLossProbR(Double_t &p,Double_t &prw,Double_t &prw_cont,
- Int_t ipart, Double_t R,Double_t wc,Double_t e)
+void AliQuenchingWeights::GetZeroLossProbR(Double_t &p,Double_t &prw,Double_t &prwcont,
+ Int_t ipart, Double_t r,Double_t wc,Double_t e)
{
- if(R>=fgkRMax) {
- R=fgkRMax-1;
+ //calculate the probabilty that there is no energy
+ //loss for different ways of energy constraint
+ if(r>=fgkRMax) {
+ r=fgkRMax-1;
}
Double_t discrete=0.;
if(fMultSoft) {
for(Int_t bin=1; bin<=kbinmax; bin++) {
Double_t xxxx = fHisto->GetBinCenter(bin);
- CalcMult(ipart,R,xxxx,continuous,discrete);
+ CalcMult(ipart,r,xxxx,continuous,discrete);
fHisto->SetBinContent(bin,continuous);
}
} else {
for(Int_t bin=1; bin<=kbinmax; bin++) {
Double_t xxxx = fHisto->GetBinCenter(bin);
- CalcSingleHard(ipart,R,xxxx,continuous,discrete);
+ CalcSingleHard(ipart,r,xxxx,continuous,discrete);
fHisto->SetBinContent(bin,continuous);
}
}
prw=fHisto->GetBinContent(1)/hint;
Double_t xxxx = fHisto->GetBinCenter(1);
- CalcMult(ipart,R,xxxx,continuous,discrete);
+ CalcMult(ipart,r,xxxx,continuous,discrete);
fHisto->SetBinContent(1,continuous);
hint=fHisto->Integral(1,kbinmax);
fHisto->Scale(1./hint*(1-discrete));
fHisto->Fill(0.,discrete);
- prw_cont=fHisto->GetBinContent(1);
+ prwcont=fHisto->GetBinContent(1);
}
Int_t AliQuenchingWeights::SampleEnergyLoss()
return 0;
}
-Int_t AliQuenchingWeights::SampleEnergyLoss(Int_t ipart, Double_t R)
+Int_t AliQuenchingWeights::SampleEnergyLoss(Int_t ipart, Double_t r)
{
// Sample energy loss directly for one particle type
// choses R (safe it and keep it until next call of function)
Int_t bin=1;
Double_t xxxx = fHisto->GetBinCenter(bin);
if(fMultSoft)
- CalcMult(ipart,R,xxxx,continuous,discrete);
+ CalcMult(ipart,r,xxxx,continuous,discrete);
else
- CalcSingleHard(ipart,R,xxxx,continuous,discrete);
+ CalcSingleHard(ipart,r,xxxx,continuous,discrete);
if(discrete>=1.) {
fHisto->SetBinContent(1,1.);
for(Int_t bin=2; bin<=fgkBins; bin++) {
xxxx = fHisto->GetBinCenter(bin);
if(fMultSoft)
- CalcMult(ipart,R,xxxx,continuous,discrete);
+ CalcMult(ipart,r,xxxx,continuous,discrete);
else
- CalcSingleHard(ipart,R,xxxx,continuous,discrete);
+ CalcSingleHard(ipart,r,xxxx,continuous,discrete);
fHisto->SetBinContent(bin,continuous);
}
return histx;
}
-TH1F* AliQuenchingWeights::ComputeQWHistoX(Int_t ipart,Double_t R) const
+TH1F* AliQuenchingWeights::ComputeQWHistoX(Int_t ipart,Double_t r) const
{
// compute P(E) distribution for
// given ipart = 1 for quark, 2 for gluon
}
Char_t hname[100];
- sprintf(hname,"hQWHistox_%s_%d_%.2f",meddesc,ipart,R);
+ sprintf(hname,"hQWHistox_%s_%d_%.2f",meddesc,ipart,r);
TH1F *histx = new TH1F("histx",hname,fgkBins,0.,fgkMaxBin);
histx->SetXTitle("x = #Delta E/#omega_{c}");
if(fMultSoft)
histx->SetYTitle("p(#Delta E/#bar#omega_{c})");
histx->SetLineColor(4);
- Double_t rrrr = R;
+ Double_t rrrr = r;
Double_t continuous=0.,discrete=0.;
//loop on histogram channels
for(Int_t bin=1; bin<=fgkBins; bin++) {
return h;
}
-TH1F* AliQuenchingWeights::ComputeELossHisto(Int_t ipart,Double_t R) const
+TH1F* AliQuenchingWeights::ComputeELossHisto(Int_t ipart,Double_t r) const
{
// compute energy loss histogram for
// parton type and given R
- TH1F *dummy = ComputeQWHistoX(ipart,R);
+ TH1F *dummy = ComputeQWHistoX(ipart,r);
if(!dummy) return 0;
Char_t hname[100];
- sprintf(hname,"hELossHistox_%d_%.2f",ipart,R);
+ sprintf(hname,"hELossHistox_%d_%.2f",ipart,r);
TH1F *histx = new TH1F("histxr",hname,fgkBins,0.,fgkMaxBin);
for(Int_t i=0;i<100000;i++){
//if(i % 1000 == 0) cout << "." << flush;
return ret;
}
-Double_t AliQuenchingWeights::GetMeanELoss(Int_t ipart,Double_t R) const
+Double_t AliQuenchingWeights::GetMeanELoss(Int_t ipart,Double_t r) const
{
// compute average energy loss over wc
// for parton type and given R
- TH1F *dummy = ComputeELossHisto(ipart,R);
+ TH1F *dummy = ComputeELossHisto(ipart,r);
if(!dummy) return 0;
Double_t ret=dummy->GetMean();
delete dummy;
Int_t AliQuenchingWeights::GetIndex(Double_t len) const
{
+ //get the index according to length
if(len>fLengthMax) len=fLengthMax;
Int_t l=Int_t(len/0.25);
AliQuenchingWeights();
AliQuenchingWeights(const AliQuenchingWeights& a);
+ AliQuenchingWeights& operator=(const AliQuenchingWeights& a)
+ {a.Copy(*this); return(*this);}
virtual ~AliQuenchingWeights();
void Reset();
Int_t SampleEnergyLoss();
- Int_t SampleEnergyLoss(Int_t ipart, Double_t R);
+ Int_t SampleEnergyLoss(Int_t ipart, Double_t r);
Double_t GetELossRandom(Int_t ipart, Double_t length, Double_t e=1.e10) const;
Double_t CalcQuenchedEnergy(Int_t ipart, Double_t length, Double_t e) const;
Double_t GetELossRandomK(Int_t ipart, Double_t I0, Double_t I1, Double_t e=1.e10);
Double_t CalcQuenchedEnergyK(Int_t ipart, Double_t I0, Double_t I1, Double_t e);
Double_t GetELossRandomKFast(Int_t ipart, Double_t I0, Double_t I1, Double_t e=1.e10);
- Double_t GetELossRandomKFastR(Int_t ipart, Double_t R, Double_t wc, Double_t e=1.e10);
+ Double_t GetELossRandomKFastR(Int_t ipart, Double_t r, Double_t wc, Double_t e=1.e10);
Double_t CalcQuenchedEnergyKFast(Int_t ipart, Double_t I0, Double_t I1, Double_t e);
Double_t GetDiscreteWeight(Int_t ipart, Double_t I0, Double_t I1);
- Double_t GetDiscreteWeightR(Int_t ipart, Double_t R);
- void GetZeroLossProb(Double_t &p,Double_t &prw,Double_t &prw_cont,
+ Double_t GetDiscreteWeightR(Int_t ipart, Double_t r);
+ void GetZeroLossProb(Double_t &p,Double_t &prw,Double_t &prwcont,
Int_t ipart,Double_t I0,Double_t I1,Double_t e=1.e10);
- void GetZeroLossProbR(Double_t &p,Double_t &prw, Double_t &prw_cont,
- Int_t ipart,Double_t R,Double_t wc,Double_t e=1.e10);
+ void GetZeroLossProbR(Double_t &p,Double_t &prw, Double_t &prwcont,
+ Int_t ipart,Double_t r,Double_t wc,Double_t e=1.e10);
//multiple soft scattering approximation
Int_t InitMult(const Char_t *contall="$(ALICE_ROOT)/FASTSIM/data/cont_mult.all",
TH1F* ComputeQWHisto (Int_t ipart,Double_t medval,Double_t length) const;
TH1F* ComputeQWHistoX(Int_t ipart,Double_t medval,Double_t length) const;
- TH1F* ComputeQWHistoX(Int_t ipart,Double_t R) const;
+ TH1F* ComputeQWHistoX(Int_t ipart,Double_t r) const;
TH1F* ComputeELossHisto(Int_t ipart,Double_t medval,Double_t l,Double_t e=1.e10) const;
TH1F* ComputeELossHisto(Int_t ipart,Double_t medval,TH1F *hEll,Double_t e=1.e10) const;
- TH1F* ComputeELossHisto(Int_t ipart,Double_t R) const;
+ TH1F* ComputeELossHisto(Int_t ipart,Double_t r) const;
Double_t GetMeanELoss(Int_t ipart,Double_t medval,Double_t l) const;
Double_t GetMeanELoss(Int_t ipart,Double_t medval,TH1F *hEll) const;
- Double_t GetMeanELoss(Int_t ipart,Double_t R) const;
+ Double_t GetMeanELoss(Int_t ipart,Double_t r) const;
void PlotDiscreteWeights(Double_t len=4) const;
void PlotContWeights(Int_t itype,Double_t len) const;