Zfluk Class Reference

#include <Zfluk.h>

List of all members.

Public Member Functions

 Zfluk (const char *dir="")
virtual ~Zfluk ()
void SetParameters (std::vector< double > par)
 Get/Set parameters used for reweighting (for PiMinus and later fits).
const std::vector< double > & GetParameters ()
double GetWeightRHC2012 (int ptype, double pt, double pz)
 Function used for RHC fits (6pi+,6pi-,6k+ and 2k- parameters).
double GetWeightMINOSplus (int ptype, double pt, double pz)
 Function used for MINOS+ fits (6pi+,6pi-,6k+ and 2k- parameters).
double GetWeightMINOSplus2 (int ptype, double pt, double pz)
 Function used for MINOS+ fits with MINOS+ param2 (6pi+,6pi-,6k+ and 2k- parameters).
double GetWeightMINOSplus3 (int ptype, double pt, double pz)
 Function used for MINOS+ fits with MINOS+ param2 (6pi+,6pi-,6k+ and 6k- parameters).
double GetWeightMINOSplusSea (int ptype, double pt, double pz)
 Function used for MINOS+ fits with MINOS+ param2 (6pi+,6pi-,6k+ and 2k- parameters).
double GetWeightMINOSplusN1J (int ptype, double pt, double pz)
 Function used for MINOS+ fits with MINOS+ param1 (8pi+,8pi- parameters, same weights for kaons).
double GetWeight (int ptype, double pt, double pz)
 Function used for PiMinus and later fits (6pi+,2pi-,6k+ and 2k- parameters).
double GetWeightBoston (int ptype, double pt, double pz, std::vector< double > zflVec)
 Function used for Boston fit (6pi+,6pi-,2k+ and 2k- parameters).
double GetWeightPRL (int ptype, double pt, double pz, double *par)
 Following two functions used for PRL-like reweighting (6pi+ and 1k+ parameter).
double GetWeightPRL (int tpType, double tpx, double tpy, double tpz, double *par)
double GetMeanPT (int ptype)
double GetReweightedMeanPT (int ptype)
double GetPTshift (int ptype, double pz_low=0., double pz_up=120.)
double GetNFrac (int ptype, double pz_low=0., double pz_up=120., double pt_low=0., double pt_up=1.)
TH2F * GetReweightedPTXF (int ptype)
TH2F * GetPTXF (int ptype)
TH2F * GetWeightHistogram (int ptype)
void UseParameterization (const char *which)
 Used in times of PRL fit to choose between TV and SKZP functional forms.

Private Types

enum  EParticleType {
  kPiPlus = 8, kPiMinus = 9, kKPlus = 11, kKMinus = 12,
  kK0L = 10, kUnknown = 0
}
typedef enum Zfluk::EParticleType ParticleType_t

Private Member Functions

std::string GetParticleName (Zfluk::ParticleType_t ptype)
Zfluk::ParticleType_t GetParticleEnum (int ptype)
void RecalculateWeights ()

Private Attributes

int whichParameterization
std::vector< double > fPar
std::vector< ParticleType_tfPlist
std::map
< Zfluk::ParticleType_t, TH2F * > 
fPTXF
std::map
< Zfluk::ParticleType_t, TH2F * > 
fWeightedPTXF
std::map
< Zfluk::ParticleType_t, TH2F * > 
fWeightHist
std::map
< Zfluk::ParticleType_t,
double > 
fMeanPT
std::map
< Zfluk::ParticleType_t,
double > 
fN
std::map
< Zfluk::ParticleType_t,
double > 
fNWeighted
std::map
< Zfluk::ParticleType_t,
double > 
fWeightedMeanPT
std::map
< Zfluk::ParticleType_t, int > 
fNBinsY
std::map
< Zfluk::ParticleType_t, int > 
fNBinsX

Detailed Description

Definition at line 24 of file Zfluk.h.


Member Typedef Documentation


Member Enumeration Documentation

enum Zfluk::EParticleType [private]
Enumerator:
kPiPlus 
kPiMinus 
kKPlus 
kKMinus 
kK0L 
kUnknown 

Definition at line 91 of file Zfluk.h.

00092   {
00093     kPiPlus  = 8,
00094     kPiMinus = 9,
00095     kKPlus   = 11,
00096     kKMinus  = 12,
00097     kK0L     = 10,
00098     kUnknown = 0
00099   } ParticleType_t;


Constructor & Destructor Documentation

Zfluk::Zfluk ( const char *  dir = ""  ) 

Definition at line 87 of file Zfluk.cxx.

References base, Form(), gSystem(), Msg::kDebug, Msg::kFatal, NuParticle::kKMinus, NuParticle::kKPlus, NuParticle::kPiMinus, NuParticle::kPiPlus, and MSG.

00088   :fPar(0)
00089 { 
00090   whichParameterization=0; //by default using SKZP parameterization
00091 
00092   // topDir is where the fluka05 pt-xf histogram file is
00093   std::string topDir=dir; // user may set location of input data
00094   if(topDir=="") { // by default, this code looks in a standard place
00095     topDir="MCReweight/data";
00096     std::string base="";
00097     base=getenv("SRT_PRIVATE_CONTEXT");
00098     if (base!="" && base!=".")
00099       {
00100         // check if directory exists in SRT_PRIVATE_CONTEXT
00101         std::string path = base + "/" + topDir;
00102         void *dir_ptr = gSystem -> OpenDirectory(path.c_str());
00103         if(!dir_ptr) base=getenv("SRT_PUBLIC_CONTEXT"); // if it doesn't exist then use SRT_PUBLIC_CONTEXT
00104         gSystem->FreeDirectory(dir_ptr);
00105       }
00106     else base=getenv("SRT_PUBLIC_CONTEXT");
00107     
00108     if(base=="") {
00109       MSG("MCReweight",Msg::kFatal)<<"No SRT_PUBLIC_CONTEXT set"<<std::endl;
00110       assert(false);
00111     }
00112     topDir = base+ "/" + topDir;
00113   }
00114 
00115   MSG("Zfluk",Msg::kDebug) <<"Zfluk reading data from: "<<topDir<<std::endl;
00116   std::string fileName =topDir+"/fluka05ptxf.root";
00117 
00118   TFile* hFile=new TFile(fileName.c_str());
00119   
00120   fPlist.push_back(kPiPlus);
00121   fPlist.push_back(kPiMinus);
00122   fPlist.push_back(kKPlus);
00123   fPlist.push_back(kKMinus);
00124   fPlist.push_back(kK0L);
00125   
00126   for (std::vector<ParticleType_t>::iterator itPlist=fPlist.begin();itPlist!=fPlist.end(); itPlist++)
00127     {
00128       TH2F* hist=dynamic_cast <TH2F*> (hFile->Get(Form("hF05ptxf%s",GetParticleName(*itPlist).c_str()))->Clone());
00129       hist->SetDirectory(0);
00130       TH2F* hist2=dynamic_cast <TH2F*> (hist->Clone(Form("hWeightedPTXF%s",GetParticleName(*itPlist).c_str())));
00131       hist2->SetDirectory(0);
00132       hist2->SetTitle(Form("%s weighted pt-pz",GetParticleName(*itPlist).c_str()));
00133       fWeightHist[*itPlist]=dynamic_cast<TH2F*> (hist->Clone(Form("hWeight%s",GetParticleName(*itPlist).c_str())));
00134 
00135       fWeightHist[*itPlist]->Divide(hist2);
00136       fWeightHist[*itPlist]->SetDirectory(0);
00137 
00138       std::pair<Zfluk::ParticleType_t, TH2F* > p(*itPlist, hist);
00139       std::pair<Zfluk::ParticleType_t, TH2F* > p2(*itPlist, hist2);
00140       fPTXF.insert(p);
00141       fWeightedPTXF.insert(p2);
00142 
00143       fPTXF[*itPlist]->SetDirectory(0);
00144       fWeightedPTXF[*itPlist]->SetDirectory(0);
00145 
00146       fMeanPT[*itPlist]=fPTXF[*itPlist]->ProjectionY()->GetMean()*1000.;
00147       fWeightedMeanPT[*itPlist]=fWeightedPTXF[*itPlist]->ProjectionY()->GetMean()*1000.;
00148             
00149       double N=fPTXF[*itPlist]->ProjectionY()->GetSumOfWeights();
00150       double wN=fWeightedPTXF[*itPlist]->ProjectionY()->GetSumOfWeights();
00151 
00152       fN[*itPlist]=N;
00153       fNWeighted[*itPlist]=wN;
00154     }
00155   hFile->Close();
00156   delete hFile;
00157   hFile=0;
00158 }

Zfluk::~Zfluk (  )  [virtual]

Definition at line 160 of file Zfluk.cxx.

References fMeanPT, fN, fNBinsX, fNBinsY, fNWeighted, fPar, fPlist, fPTXF, fWeightedMeanPT, fWeightedPTXF, and fWeightHist.

00160               {
00161  for (std::vector<ParticleType_t>::iterator itPlist=fPlist.begin();itPlist!=fPlist.end(); itPlist++)
00162     {
00163       delete fWeightHist[*itPlist];
00164       delete fPTXF[*itPlist];
00165       delete fWeightedPTXF[*itPlist];
00166     }
00167  fWeightHist.clear();
00168  fPTXF.clear();
00169  fWeightedPTXF.clear();
00170  fMeanPT.clear();
00171  fWeightedMeanPT.clear();
00172  fN.clear();
00173  fNWeighted.clear();
00174  fPlist.clear();
00175  fPar.clear();
00176  fNBinsX.clear();
00177  fNBinsY.clear();
00178 }


Member Function Documentation

double Zfluk::GetMeanPT ( int  ptype  )  [inline]

Definition at line 67 of file Zfluk.h.

References fMeanPT, and GetParticleEnum().

00067 {return fMeanPT[GetParticleEnum(ptype)];};

double Zfluk::GetNFrac ( int  ptype,
double  pz_low = 0.,
double  pz_up = 120.,
double  pt_low = 0.,
double  pt_up = 1. 
)

Get fractional change in number of secondaries due to reweighting in certain pt-pz region.

Definition at line 1771 of file Zfluk.cxx.

References fPTXF, fWeightedPTXF, and GetParticleEnum().

01772 {
01773   //returns the fractional change in number of particles due to reweighting in xf-pt region 
01774   //given by pz_low, pz_up and pt_low, pt_up
01775   
01776   Zfluk::ParticleType_t eptype=GetParticleEnum(ptype);
01777   if (fPTXF.find(eptype)==fPTXF.end())
01778     {
01779       return 1.;
01780     }
01781   int xlow=int(pz_low+1.);
01782   int xup=int(pz_up+1.);
01783   int ylow=int(50.*pt_low+1.);
01784   int yup=int(50.*pt_up+1.);
01785   
01786   double wsum(0.);
01787   double sum(0.);
01788   for (int i=xlow;i<xup;i++)
01789     {
01790       for (int j=ylow;j<yup;j++)
01791         {
01792           sum+=fPTXF[eptype]->GetBinContent(i,j);
01793           wsum+=fWeightedPTXF[eptype]->GetBinContent(i,j);
01794         }
01795     }
01796 
01797   return wsum/sum;
01798 }

const std::vector<double>& Zfluk::GetParameters (  )  [inline]

Definition at line 33 of file Zfluk.h.

References fPar.

00033 {return fPar;};

Zfluk::ParticleType_t Zfluk::GetParticleEnum ( int  ptype  )  [private]

Definition at line 1816 of file Zfluk.cxx.

References kK0L, kKMinus, kKPlus, kPiMinus, kPiPlus, and kUnknown.

Referenced by GetMeanPT(), GetNFrac(), GetPTshift(), GetPTXF(), GetReweightedMeanPT(), GetReweightedPTXF(), GetWeight(), GetWeightHistogram(), GetWeightMINOSplus(), GetWeightMINOSplus2(), GetWeightMINOSplus3(), GetWeightMINOSplusN1J(), GetWeightMINOSplusSea(), and GetWeightRHC2012().

01817 {
01818   switch (ptype)
01819     {
01820     case 8   :       return kPiPlus;      break;
01821     case 211 :       return kPiPlus;      break;    
01822     case 9   :       return kPiMinus;     break;
01823     case -211:       return kPiMinus;     break;
01824     case 11  :       return kKPlus;       break;
01825     case 321 :       return kKPlus;       break;
01826     case 12  :       return kKMinus;      break;
01827     case -321:       return kKMinus;      break;
01828     case 10  :       return kK0L;         break;
01829     case 130 :       return kK0L;         break;
01830     default:         return kUnknown;     break;
01831     }
01832   return kUnknown;
01833 
01834 }

std::string Zfluk::GetParticleName ( Zfluk::ParticleType_t  ptype  )  [private]

Definition at line 1800 of file Zfluk.cxx.

References kK0L, kKMinus, kKPlus, kPiMinus, kPiPlus, and kUnknown.

01801 {
01802 switch (ptype)
01803    {
01804    case kPiPlus:          return "PiPlus";    break;
01805    case kPiMinus:         return "PiMinus";   break;
01806    case kKPlus:           return "KPlus";     break;
01807    case kKMinus:          return "KMinus";    break;
01808    case kK0L:             return "K0L";       break;
01809    case kUnknown:         return "Unknown";   break;
01810    default:               return "Unknown";   break;
01811    }
01812  
01813    return "Unknown";
01814 }

double Zfluk::GetPTshift ( int  ptype,
double  pz_low = 0.,
double  pz_up = 120. 
)

GetPTshift(par) returns the shift in mean pT for a given set of parameters. This function uses fluka05ptxf.root file that should be in MCReweight/data by default.

Definition at line 1736 of file Zfluk.cxx.

References fMeanPT, fPTXF, fWeightedMeanPT, fWeightedPTXF, and GetParticleEnum().

01737 {
01738   //returns the pT shift for ptype particle due to reweighting in xf slice
01739   //given by pz_low and pz_up
01740   //this function returns correct ptshift only if the parameters were set using SetParameters
01741 
01742   Zfluk::ParticleType_t eptype=GetParticleEnum(ptype);
01743 
01744   if (fPTXF.find(eptype)==fPTXF.end())
01745     {
01746       return 0.;
01747     }
01748   if (pz_low==0.&&pz_up==120.) return fWeightedMeanPT[eptype]-fMeanPT[eptype];
01749  
01750   int xlow=int(pz_low+1.);
01751   int xup=int(pz_up+1.);
01752  
01753   double pt;
01754   double meanpt(0.);
01755   double sum(0.);
01756   for (int i=xlow;i<xup;i++)
01757     {
01758       for (int j=1;j<51;j++)
01759         {
01760           pt=0.02*j-0.01;
01761           meanpt+=fWeightedPTXF[eptype]->GetBinContent(i,j)*pt;
01762           sum+=fWeightedPTXF[eptype]->GetBinContent(i,j);
01763         }
01764     }
01765   meanpt/=sum;
01766   meanpt*=1000.;  //GeV to MeV
01767 
01768   return meanpt-fMeanPT[eptype];
01769 
01770 }

TH2F* Zfluk::GetPTXF ( int  ptype  )  [inline]

Definition at line 80 of file Zfluk.h.

References fPTXF, and GetParticleEnum().

00080 {return fPTXF[GetParticleEnum(ptype)];};

double Zfluk::GetReweightedMeanPT ( int  ptype  )  [inline]

Definition at line 68 of file Zfluk.h.

References fWeightedMeanPT, and GetParticleEnum().

00068 {return fWeightedMeanPT[GetParticleEnum(ptype)];};

TH2F* Zfluk::GetReweightedPTXF ( int  ptype  )  [inline]

Definition at line 79 of file Zfluk.h.

References fWeightedPTXF, and GetParticleEnum().

00079 {return fWeightedPTXF[GetParticleEnum(ptype)];};

double Zfluk::GetWeight ( int  ptype,
double  pt,
double  pz 
)

Function used for PiMinus and later fits (6pi+,2pi-,6k+ and 2k- parameters).

Definition at line 296 of file Zfluk.cxx.

References fN, fNWeighted, fPar, GetParticleEnum(), kK0L, kKMinus, kKPlus, kPiMinus, kPiPlus, Msg::kWarning, and MAXMSG.

Referenced by SKZPWeightCalculator::GetBeamWeight(), and RecalculateWeights().

00297 {
00298   double weight=1.;
00299 
00300   if (fPar.size()==0) 
00301     {
00302       MAXMSG("MCReweight",Msg::kWarning,10)
00303         <<"You need to set the parameters before calling "
00304         <<"Zfluk::GetWeight (use SetParameters(vector<double>))"<<std::endl
00305         <<"Returning weight = "<<weight<<std::endl;
00306       return weight;
00307     }
00308 
00309   double xF=pz/120.;
00310   double A,B,C;
00311   double Ap,Bp,Cp;
00312   Zfluk::ParticleType_t eptype=GetParticleEnum(ptype);
00313 
00314   // This is SKZP parameterization
00315   if (xF>1.||xF<0.) return weight;
00316   if (pT>1.||pT<0.) return weight;
00317 
00318   if (eptype==kPiPlus)
00319     {
00320       //Calculate weight for pions
00321       if (pT>=0.03)
00322         {
00323           // calculate the A, B and C in SKZP parameterization
00324           // A, B and C are best fit to Fluka 05
00325           
00326           A=-0.00761*pow((1.-xF),4.045)*(1.+9620.*xF)*pow(xF,-2.975);
00327           B=0.05465*pow((1.-xF),2.675)*(1.+69590.*xF)*pow(xF,-3.144);
00328           
00329           if (xF<0.22){
00330             C=-7.058/pow(xF,-0.1419)+9.188;
00331           }
00332           else{
00333             C = (3.008/exp((xF-0.1984)*3.577)) + 2.616*xF+0.1225;
00334           }
00335           
00336           // scale/skew A, B and C
00337           Ap=(fPar[0]+fPar[1]*xF)*A;
00338           Bp=(fPar[2]+fPar[3]*xF)*B;
00339           Cp=(fPar[4]+fPar[5]*xF)*C;
00340             
00341           weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
00342         }
00343       else weight=GetWeight(ptype,0.031,pz);  // for low pT
00344     }
00345   else if (eptype==kKPlus)
00346     {
00347       if (pT>=0.05)
00348         {
00349           // calculate the A, B and C in SKZP parameterization
00350           // A, B and C are best fit to Fluka 05
00351           
00352           A=-0.005187*pow((1.-xF),4.119)*(1.+2170.*xF)*pow(xF,-2.767);
00353           B=0.4918*pow((1.-xF),2.672)*(1.+1373.*xF)*pow(xF,-2.927);
00354           
00355           if (xF<0.22){
00356             C=-16.10/pow(xF,-0.04582)+17.92;
00357           }
00358           else{
00359             C = (6.905/exp((xF+0.163)*6.718)) - 0.4257*xF + 2.486;
00360           }
00361           
00362           // scale/skew A, B and C
00363           Ap=(fPar[6]+fPar[7]*xF)*A;
00364           Bp=(fPar[8]+fPar[9]*xF)*B;
00365           Cp=(fPar[10]+fPar[11]*xF)*C;
00366 
00367           weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
00368         }
00369       else 
00370         weight=GetWeight(ptype,0.051,pz);  // for low pT
00371     }
00372   else if (eptype==kPiMinus)
00373     {
00374       weight=GetWeight(kPiPlus,pT,pz);
00375       if ( pz > 4. ) weight *= ( fPar[12] + fPar[13] * xF );
00376     }
00377   else if (eptype==kKMinus)
00378     {
00379       weight=GetWeight(kKPlus,pT,pz)*(fPar[14]+fPar[15]*xF);
00380     }
00381   else if (eptype==kK0L)
00382     {
00383       //N(K0L) approximately given with (N(K+)+3*N(K-))/4
00384       weight= ((fNWeighted[kKPlus]+3.*fNWeighted[kKMinus])
00385                /(fN[kKPlus]+3.*fN[kKMinus]));
00386     }
00387   if (weight>10.) weight=10.;
00388   return weight;
00389 }

double Zfluk::GetWeightBoston ( int  ptype,
double  pt,
double  pz,
std::vector< double >  zflVec 
)

Function used for Boston fit (6pi+,6pi-,2k+ and 2k- parameters).

Definition at line 198 of file Zfluk.cxx.

References Msg::kError, MSG, and whichParameterization.

Referenced by SKZPWeightCalculator::GetBeamWeight(), and GetWeightPRL().

00199 {
00200   double xF;
00201   double weight=1.;
00202   if (tpz<0.) return weight;
00203   double A,B,C;
00204   double Ap,Bp,Cp;
00205   xF=tpz/120.;
00206 
00207   // This is SKZP parameterization
00208   if (whichParameterization==0)
00209     {
00210       if (tpType==211||tpType==8)
00211         {
00212           //Calculate weight for pions
00213           if (pT>=0.05)
00214             {
00215               // calculate the A, B and C in SKZP parameterization
00216               // A, B and C are best fit to Fluka 05
00217               
00218               A=-0.00761*pow((1.-xF),4.045)*(1.+9620.*xF)*pow(xF,-2.975);
00219               B=0.05465*pow((1.-xF),2.675)*(1.+69590.*xF)*pow(xF,-3.144);
00220               
00221               if (xF<0.22){
00222                 C=-7.058/pow(xF,-0.1419)+9.188;
00223               }
00224               else{
00225                 C = (3.008/exp((xF-0.1984)*3.577)) + 2.616*xF+0.1225;
00226               }
00227               // scale/skew A, B and C
00228               Ap=(par[0]+par[1]*xF)*A;
00229               Bp=(par[2]+par[3]*xF)*B;
00230               Cp=(par[4]+par[5]*xF)*C;
00231               
00232               weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
00233             }
00234           else weight=GetWeightBoston(tpType,0.051,tpz,par);  // for low pT
00235         }
00236       else if (tpType==321||tpType==11)
00237         {
00238           //for kaons
00239           weight=par[6]+par[7]*xF;
00240         }
00241       else if (tpType==-211||tpType==9)
00242         {
00243           // calculate the A, B and C in SKZP parameterization
00244           // A, B and C are best fit to Fluka 05
00245           if (pT>=0.05)
00246             {
00247               A=-0.006327*pow((1.-xF),5.734)*(1.+13660.*xF)*pow(xF,-2.898);
00248               B=0.04605*pow((1.-xF),3.291)*(1.+58610.*xF)*pow(xF,-3.209);
00249               
00250               if (xF<0.22){
00251                 C=-16.02/pow(xF,-0.06456)+17.61;
00252               }
00253               else{
00254                 C = (2.963/exp((xF-0.1774)*2.265)) + 1.732*xF+0.03925;
00255               }
00256               
00257               // scale/skew A, B and C
00258               Ap=(par[8]+par[9]*xF)*A;
00259               Bp=(par[10]+par[11]*xF)*B;
00260               Cp=(par[12]+par[13]*xF)*C;
00261               
00262               weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
00263             }
00264           else weight=GetWeightBoston(tpType,0.051,tpz,par);  // for low pT
00265           
00266         }
00267       else if (tpType==-321||tpType==12)
00268         {
00269           //for kaons
00270           weight=par[14]+par[15]*xF;
00271         }
00272     }
00273   else if (whichParameterization==1)
00274     {
00275       // This is TV parameterization
00276       if (tpType==211||tpType==8){
00277  
00278         weight=par[0]*(1.+par[1]*pT)/(1.+par[2]*pT)*
00279                exp(-par[3]*tpz*pow(pT,par[4]));
00280  
00281       }
00282       else if (tpType==321||tpType==11) {
00283         weight=par[5];
00284       }
00285       
00286     }
00287   else
00288     {
00289       MSG("MCReweight",Msg::kError) << "Please select one of the two hadron production"<<std::endl;
00290       MSG("MCReweight",Msg::kError) << " parameterizations (SKZP (default) or TV)"<<std::endl;
00291       return 0.;;
00292     }
00293   return weight;
00294 }

TH2F* Zfluk::GetWeightHistogram ( int  ptype  )  [inline]

Definition at line 81 of file Zfluk.h.

References fWeightHist, and GetParticleEnum().

00081 {return fWeightHist[GetParticleEnum(ptype)];};

double Zfluk::GetWeightMINOSplus ( int  ptype,
double  pt,
double  pz 
)

Function used for MINOS+ fits (6pi+,6pi-,6k+ and 2k- parameters).

Definition at line 510 of file Zfluk.cxx.

References fN, fNWeighted, fPar, GetParticleEnum(), kK0L, kKMinus, kKPlus, kPiMinus, kPiPlus, Msg::kWarning, and MAXMSG.

Referenced by SKZPWeightCalculator::GetBeamWeight().

00511 {
00512   double weight=1.;
00513 
00514   if (fPar.size()==0)
00515     {
00516       MAXMSG("MCReweight",Msg::kWarning,10)
00517         <<"You need to set the parameters before calling "
00518         <<"Zfluk::GetWeightMINOSplus (use SetParameters(vector<double>))"<<std::endl
00519         <<"Returning weight = "<<weight<<std::endl;
00520       return weight;
00521     }
00522 
00523   double xF=pz/120.;
00524   double A,B,C;
00525   double Ap,Bp,Cp;
00526   Zfluk::ParticleType_t eptype=GetParticleEnum(ptype);
00527 
00528   // This is SKZP parameterization
00529   if (xF>1.||xF<0.) return weight;
00530   if (pT>1.||pT<0.) return weight;
00531 
00532   if (eptype==kPiPlus)
00533     {
00534       double a1 = -0.174369;
00535       double a2 = 4.1554;
00536       double a3 = 6500.02;
00537       double a4 = 2.96007;
00538       double b1 = 2.68362;
00539       double b2 = 2.83139;
00540       double b3 = 11197.9;
00541       double b4 = 3.20971;
00542       double c1 = -18.8924;
00543       double c2 = -0.062175;
00544       double c3 = 20.5475;
00545       double c4 = 2.13106;
00546       double c5 = -0.179052;
00547       double c6 = 5.46831;
00548       double c7 = 0.613703;
00549       double c8 = 1.52365;
00550 
00551       //Calculate weight for pions
00552       if (pT>=0.03)
00553         {
00554           // calculate the A, B and C in SKZP parameterization
00555           // A, B and C are best fit to Flugg08 MINOS+
00556 
00557           A=a1*pow((1.-xF),a2)*(1.+a3*xF)*pow(xF,-a4);
00558           B=b1*pow((1.-xF),b2)*(1.+b3*xF)*pow(xF,-b4);
00559 
00560           if (xF<0.22){
00561             C=c1/pow(xF,c2)+c3;
00562           }
00563           else{
00564             C = (c4/exp((xF+c5)*c6)) + c7*xF+c8;
00565           }
00566 
00567           // scale/skew A, B and C
00568           Ap=(fPar[0]+fPar[1]*xF)*A;
00569           Bp=(fPar[2]+fPar[3]*xF)*B;
00570           Cp=(fPar[4]+fPar[5]*xF)*C;
00571 
00572           weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
00573         }
00574       else weight=GetWeightMINOSplus(ptype,0.031,pz);  // for low pT
00575     }
00576   else if (eptype==kKPlus)
00577     {
00578       double a1 = -0.063343;
00579       double a2 = 3.66129;
00580       double a3 = 2046.13;
00581       double a4 = 2.87385;
00582       double b1 = 2.09094;
00583       double b2 = 2.56403;
00584       double b3 = 2123.62;
00585       double b4 = 3.07026;
00586       double c1 = -11.4855;
00587       double c2 = -0.096170;
00588       double c3 = 12.7184;
00589       double c4 = 4.90156;
00590       double c5 = -0.464451;
00591       double c6 = 1.41071;
00592       double c7 = 5.52378;
00593       double c8 = -5.30836;
00594 
00595       if (pT>=0.05)
00596         {
00597           // calculate the A, B and C in SKZP parameterization
00598           // A, B and C are best fit to Flugg08 MINOS+
00599 
00600           A=a1*pow((1.-xF),a2)*(1.+a3*xF)*pow(xF,-a4);
00601           B=b1*pow((1.-xF),b2)*(1.+b3*xF)*pow(xF,-b4);
00602 
00603           if (xF<0.22){
00604             C=c1/pow(xF,c2)+c3;
00605           }
00606           else{
00607             C = (c4/exp((xF+c5)*c6)) + c7*xF+c8;
00608           }
00609 
00610           // scale/skew A, B and C
00611           Ap=(fPar[6]+fPar[7]*xF)*A;
00612           Bp=(fPar[8]+fPar[9]*xF)*B;
00613           Cp=(fPar[10]+fPar[11]*xF)*C;
00614 
00615           weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
00616         }
00617       else
00618         weight=GetWeightMINOSplus(ptype,0.051,pz);  // for low pT
00619     }
00620   else if (eptype==kPiMinus)
00621     {
00622       double a1 = -0.168909;
00623       double a2 = 5.02215;
00624       double a3 = 5331.25;
00625       double a4 = 2.98745;
00626       double b1 = 1.91238;
00627       double b2 = 3.39871;
00628       double b3 = 10890.6;
00629       double b4 = 3.27664;
00630       double c1 = -29.5577;
00631       double c2 = -0.043595;
00632       double c3 = 30.6268;
00633       double c4 = 2.16653;
00634       double c5 = -0.200708;
00635       double c6 = 3.12584;
00636       double c7 = 0.995916;
00637       double c8 = 0.730098;
00638 
00639       //Calculate weight for pi-minus
00640       if (pT>=0.03)
00641         {
00642           // calculate the A, B and C in SKZP parameterization
00643           // A, B and C are best fit to Flugg08 MINOS+
00644 
00645           A=a1*pow((1.-xF),a2)*(1.+a3*xF)*pow(xF,-a4);
00646           B=b1*pow((1.-xF),b2)*(1.+b3*xF)*pow(xF,-b4);
00647 
00648           if (xF<0.22){
00649             C=c1/pow(xF,c2)+c3;
00650           }
00651           else{
00652             C = (c4/exp((xF+c5)*c6)) + c7*xF+c8;
00653           }
00654 
00655           // scale/skew A, B and C
00656           Ap=(fPar[12]+fPar[13]*xF)*A;
00657           Bp=(fPar[14]+fPar[15]*xF)*B;
00658           Cp=(fPar[16]+fPar[17]*xF)*C;
00659 
00660           weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
00661         }
00662       else weight=GetWeightMINOSplus(ptype,0.031,pz);  // for low pT
00663     }
00664   else if (eptype==kKMinus)
00665     {
00666       weight=GetWeightMINOSplus(kKPlus,pT,pz)*(fPar[18]+fPar[19]*xF);
00667     }
00668   else if (eptype==kK0L)
00669     {
00670       //N(K0L) approximately given with (N(K+)+3*N(K-))/4
00671       weight= ((fNWeighted[kKPlus]+3.*fNWeighted[kKMinus])
00672                /(fN[kKPlus]+3.*fN[kKMinus]));
00673     }
00674   if (weight>10.) weight=10.;
00675   return weight;
00676 }

double Zfluk::GetWeightMINOSplus2 ( int  ptype,
double  pt,
double  pz 
)

Function used for MINOS+ fits with MINOS+ param2 (6pi+,6pi-,6k+ and 2k- parameters).

Definition at line 681 of file Zfluk.cxx.

References fN, fNWeighted, fPar, GetParticleEnum(), kK0L, kKMinus, kKPlus, kPiMinus, kPiPlus, Msg::kWarning, and MAXMSG.

Referenced by SKZPWeightCalculator::GetBeamWeight().

00682 {
00683   double weight=1.;
00684 
00685   if (fPar.size()==0)
00686     {
00687       MAXMSG("MCReweight",Msg::kWarning,10)
00688         <<"You need to set the parameters before calling "
00689         <<"Zfluk::GetWeightMINOSplus2 (use SetParameters(vector<double>))"<<std::endl
00690         <<"Returning weight = "<<weight<<std::endl;
00691       return weight;
00692     }
00693 
00694   double xF=pz/120.;
00695   double A,B,C;
00696   double Ap,Bp,Cp;
00697   Zfluk::ParticleType_t eptype=GetParticleEnum(ptype);
00698 
00699   // This is SKZP parameterization
00700   if (xF>1.||xF<0.) return weight;
00701   if (pT>1.||pT<0.) return weight;
00702 
00703   if (eptype==kPiPlus)
00704     {
00705 
00706       //MINOS+ flugg08 'regular' (best-fit) parametrisation
00707       double a1 = 11.626;
00708       double a2 = 2.94402;
00709       double a3 = -53.2124;
00710       double a4 = 3.26934;
00711       double b1 = 2.04568;
00712       double b2 = 3.08177;
00713       double b3 = 22771.8;
00714       double b4 = 3.00019;
00715       double c1 = -7.53874;
00716       double c2 = -0.1826;
00717       double c3 = 9.08175;
00718       double c4 = 1.67882;
00719       double c5 = -0.12317;
00720       double c6 = 8.95217;
00721       double c7 = -0.75410;
00722       double c8 = 2.86347;
00723 
00724       //Calculate weight for pions
00725       if (pT>=0.03)
00726         {
00727           // calculate the A, B and C in SKZP parameterization
00728           // A, B and C are best fit to Flugg08 MINOS+
00729 
00730           A=a1*pow((1.-xF),a2)*(1.+a3*xF)*pow(xF,-a4);
00731           B=b1*pow((1.-xF),b2)*(1.+b3*xF)*pow(xF,-b4);
00732 
00733           if (xF<0.22){
00734             C=c1/pow(xF,c2)+c3;
00735           }
00736           else{
00737             C = (c4/exp((xF+c5)*c6)) + c7*xF+c8;
00738           }
00739 
00740           // scale/skew A, B and C
00741           Ap=(fPar[0]+fPar[1]*xF)*A;
00742           Bp=(fPar[2]+fPar[3]*xF)*B;
00743           Cp=(fPar[4]+fPar[5]*xF)*C;
00744 
00745           weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
00746         }
00747       else weight=GetWeightMINOSplus2(ptype,0.031,pz);  // for low pT
00748     }
00749   else if (eptype==kKPlus)
00750     {
00751 
00752       //MINOS+ flugg08 'regular' (best-fit) parametrisation
00753       double a1 = 2.05165;
00754       double a2 = 2.87063;
00755       double a3 = -55.3625;
00756       double a4 = 2.97932;
00757       double b1 = 0.741186;
00758       double b2 = 2.96739;
00759       double b3 = 10883.7;
00760       double b4 = 2.79326;
00761       double c1 = -4.79522;
00762       double c2 = -0.28964;
00763       double c3 = 5.98698;
00764       double c4 = 6.90941;
00765       double c5 = 0.323327;
00766       double c6 = 5.15999;
00767       double c7 = -0.53025;
00768       double c8 = 2.62459;
00769 
00770       if (pT>=0.05)
00771         {
00772           // calculate the A, B and C in SKZP parameterization
00773           // A, B and C are best fit to Flugg08 MINOS+
00774 
00775           A=a1*pow((1.-xF),a2)*(1.+a3*xF)*pow(xF,-a4);
00776           B=b1*pow((1.-xF),b2)*(1.+b3*xF)*pow(xF,-b4);
00777 
00778           if (xF<0.22){
00779             C=c1/pow(xF,c2)+c3;
00780           }
00781           else{
00782             C = (c4/exp((xF+c5)*c6)) + c7*xF+c8;
00783           }
00784 
00785           // scale/skew A, B and C
00786           Ap=(fPar[6]+fPar[7]*xF)*A;
00787           Bp=(fPar[8]+fPar[9]*xF)*B;
00788           Cp=(fPar[10]+fPar[11]*xF)*C;
00789 
00790           weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
00791         }
00792       else
00793         weight=GetWeightMINOSplus2(ptype,0.051,pz);  // for low pT
00794     }
00795   else if (eptype==kPiMinus)
00796     {
00797 
00798       //MINOS+ flugg08 'regular' (best-fit) parametrisation
00799       double a1 = 8.33552;
00800       double a2 = 3.57521;
00801       double a3 = -53.4627;
00802       double a4 = 3.3361;
00803       double b1 = 1.24421;
00804       double b2 = 3.4827;
00805       double b3 = 22734.4;
00806       double b4 = 3.11944;
00807       double c1 = -17.1133;
00808       double c2 = -0.06759;
00809       double c3 = 18.5386;
00810       double c4 = 0.652364;
00811       double c5 = -0.22222;
00812       double c6 = 6.64856;
00813       double c7 = -0.58336;
00814       double c8 = 2.60096;
00815 
00816       //Calculate weight for pi-minus
00817       if (pT>=0.03)
00818         {
00819           // calculate the A, B and C in SKZP parameterization
00820           // A, B and C are best fit to Flugg08 MINOS+
00821 
00822           A=a1*pow((1.-xF),a2)*(1.+a3*xF)*pow(xF,-a4);
00823           B=b1*pow((1.-xF),b2)*(1.+b3*xF)*pow(xF,-b4);
00824 
00825           if (xF<0.22){
00826             C=c1/pow(xF,c2)+c3;
00827           }
00828           else{
00829             C = (c4/exp((xF+c5)*c6)) + c7*xF+c8;
00830           }
00831 
00832           // scale/skew A, B and C
00833           Ap=(fPar[12]+fPar[13]*xF)*A;
00834           Bp=(fPar[14]+fPar[15]*xF)*B;
00835           Cp=(fPar[16]+fPar[17]*xF)*C;
00836 
00837           weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
00838         }
00839       else weight=GetWeightMINOSplus2(ptype,0.031,pz);  // for low pT
00840     }
00841   else if (eptype==kKMinus)
00842     {
00843       weight=GetWeightMINOSplus2(kKPlus,pT,pz)*(fPar[18]+fPar[19]*xF);
00844     }
00845   else if (eptype==kK0L)
00846     {
00847       //N(K0L) approximately given with (N(K+)+3*N(K-))/4
00848       weight= ((fNWeighted[kKPlus]+3.*fNWeighted[kKMinus])
00849                /(fN[kKPlus]+3.*fN[kKMinus]));
00850     }
00851   if (weight>10.) weight=10.;
00852   return weight;
00853 }

double Zfluk::GetWeightMINOSplus3 ( int  ptype,
double  pt,
double  pz 
)

Function used for MINOS+ fits with MINOS+ param2 (6pi+,6pi-,6k+ and 6k- parameters).

Definition at line 856 of file Zfluk.cxx.

References fN, fNWeighted, fPar, GetParticleEnum(), kK0L, kKMinus, kKPlus, kPiMinus, kPiPlus, Msg::kWarning, and MAXMSG.

00857 {
00858   double weight=1.;
00859 
00860   if (fPar.size()==0)
00861     {
00862       MAXMSG("MCReweight",Msg::kWarning,10)
00863         <<"You need to set the parameters before calling "
00864         <<"Zfluk::GetWeightMINOSplus3 (use SetParameters(vector<double>))"<<std::endl
00865         <<"Returning weight = "<<weight<<std::endl;
00866       return weight;
00867     }
00868 
00869   double xF=pz/120.;
00870   double A,B,C;
00871   double Ap,Bp,Cp;
00872   Zfluk::ParticleType_t eptype=GetParticleEnum(ptype);
00873 
00874   // This is SKZP parameterization
00875   if (xF>1.||xF<0.) return weight;
00876   if (pT>1.||pT<0.) return weight;
00877 
00878   if (eptype==kPiPlus)
00879     {
00880 
00881       //MINOS+ flugg08 'regular' (best-fit) parametrisation
00882       double a1 = 11.626;
00883       double a2 = 2.94402;
00884       double a3 = -53.2124;
00885       double a4 = 3.26934;
00886       double b1 = 2.04568;
00887       double b2 = 3.08177;
00888       double b3 = 22771.8;
00889       double b4 = 3.00019;
00890       double c1 = -7.53874;
00891       double c2 = -0.1826;
00892       double c3 = 9.08175;
00893       double c4 = 1.67882;
00894       double c5 = -0.12317;
00895       double c6 = 8.95217;
00896       double c7 = -0.75410;
00897       double c8 = 2.86347;
00898 
00899       //Calculate weight for pions
00900       if (pT>=0.03)
00901         {
00902           // calculate the A, B and C in SKZP parameterization
00903           // A, B and C are best fit to Flugg08 MINOS+
00904 
00905           A=a1*pow((1.-xF),a2)*(1.+a3*xF)*pow(xF,-a4);
00906           B=b1*pow((1.-xF),b2)*(1.+b3*xF)*pow(xF,-b4);
00907 
00908           if (xF<0.22){
00909             C=c1/pow(xF,c2)+c3;
00910           }
00911           else{
00912             C = (c4/exp((xF+c5)*c6)) + c7*xF+c8;
00913           }
00914 
00915           // scale/skew A, B and C
00916           Ap=(fPar[0]+fPar[1]*xF)*A;
00917           Bp=(fPar[2]+fPar[3]*xF)*B;
00918           Cp=(fPar[4]+fPar[5]*xF)*C;
00919 
00920           weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
00921         }
00922       else weight=GetWeightMINOSplus3(ptype,0.031,pz);  // for low pT
00923     }
00924   else if (eptype==kKPlus)
00925     {
00926 
00927       //MINOS+ flugg08 'regular' (best-fit) parametrisation
00928       double a1 = 2.05165;
00929       double a2 = 2.87063;
00930       double a3 = -55.3625;
00931       double a4 = 2.97932;
00932       double b1 = 0.741186;
00933       double b2 = 2.96739;
00934       double b3 = 10883.7;
00935       double b4 = 2.79326;
00936       double c1 = -4.79522;
00937       double c2 = -0.28964;
00938       double c3 = 5.98698;
00939       double c4 = 6.90941;
00940       double c5 = 0.323327;
00941       double c6 = 5.15999;
00942       double c7 = -0.53025;
00943       double c8 = 2.62459;
00944 
00945       if (pT>=0.05)
00946         {
00947           // calculate the A, B and C in SKZP parameterization
00948           // A, B and C are best fit to Flugg08 MINOS+
00949 
00950           A=a1*pow((1.-xF),a2)*(1.+a3*xF)*pow(xF,-a4);
00951           B=b1*pow((1.-xF),b2)*(1.+b3*xF)*pow(xF,-b4);
00952 
00953           if (xF<0.22){
00954             C=c1/pow(xF,c2)+c3;
00955           }
00956           else{
00957             C = (c4/exp((xF+c5)*c6)) + c7*xF+c8;
00958           }
00959 
00960           // scale/skew A, B and C
00961           Ap=(fPar[6]+fPar[7]*xF)*A;
00962           Bp=(fPar[8]+fPar[9]*xF)*B;
00963           Cp=(fPar[10]+fPar[11]*xF)*C;
00964 
00965           weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
00966         }
00967       else
00968         weight=GetWeightMINOSplus3(ptype,0.051,pz);  // for low pT
00969     }
00970   else if (eptype==kPiMinus)
00971     {
00972 
00973       //MINOS+ flugg08 'regular' (best-fit) parametrisation
00974       double a1 = 8.33552;
00975       double a2 = 3.57521;
00976       double a3 = -53.4627;
00977       double a4 = 3.3361;
00978       double b1 = 1.24421;
00979       double b2 = 3.4827;
00980       double b3 = 22734.4;
00981       double b4 = 3.11944;
00982       double c1 = -17.1133;
00983       double c2 = -0.06759;
00984       double c3 = 18.5386;
00985       double c4 = 0.652364;
00986       double c5 = -0.22222;
00987       double c6 = 6.64856;
00988       double c7 = -0.58336;
00989       double c8 = 2.60096;
00990 
00991       //Calculate weight for pi-minus
00992       if (pT>=0.03)
00993         {
00994           // calculate the A, B and C in SKZP parameterization
00995           // A, B and C are best fit to Flugg08 MINOS+
00996 
00997           A=a1*pow((1.-xF),a2)*(1.+a3*xF)*pow(xF,-a4);
00998           B=b1*pow((1.-xF),b2)*(1.+b3*xF)*pow(xF,-b4);
00999 
01000           if (xF<0.22){
01001             C=c1/pow(xF,c2)+c3;
01002           }
01003           else{
01004             C = (c4/exp((xF+c5)*c6)) + c7*xF+c8;
01005           }
01006 
01007           // scale/skew A, B and C
01008           Ap=(fPar[12]+fPar[13]*xF)*A;
01009           Bp=(fPar[14]+fPar[15]*xF)*B;
01010           Cp=(fPar[16]+fPar[17]*xF)*C;
01011 
01012           weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
01013         }
01014       else weight=GetWeightMINOSplus3(ptype,0.031,pz);  // for low pT
01015     }
01016 
01017   else if (eptype==kKMinus)
01018     {
01019       //MINOS+ flugg08 'regular' (best-fit) parametrisation                                                                                                                                                                 
01020       double a1 = 3.371;
01021       double a2 = 6.758;
01022       double a3 = -64.30;
01023       double a4 = 2.707;
01024       double b1 = 0.8784;
01025       double b2 = 6.75;
01026       double b3 = 12930;
01027       double b4 = 2.629;
01028       double c1 = -8.372;
01029       double c2 = -0.1373;
01030       double c3 = 9.51;
01031       double c4 = 3.23;
01032       double c5 = -0.6546;
01033       double c6 = 1.293;
01034       double c7 = 2.811;
01035       double c8 = -3.536;
01036 
01037       if (pT>=0.05)
01038         {
01039           // calculate the A, B and C in SKZP parameterization                                                                                                                                                              
01040           // A, B and C are best fit to Flugg08 MINOS+                                                                                                                                                                      
01041           A=a1*pow((1.-xF),a2)*(1.+a3*xF)*pow(xF,-a4);
01042           B=b1*pow((1.-xF),b2)*(1.+b3*xF)*pow(xF,-b4);
01043 
01044           if (xF<0.22){
01045             C=c1/pow(xF,c2)+c3;
01046           }
01047           else{
01048             C = (c4/exp((xF+c5)*c6)) + c7*xF+c8;
01049           }
01050 
01051           // scale/skew A, B and C                                                                                                                                                                                          
01052           Ap=(fPar[18]+fPar[19]*xF)*A;
01053           Bp=(fPar[20]+fPar[21]*xF)*B;
01054           Cp=(fPar[22]+fPar[23]*xF)*C;
01055 
01056           weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
01057         }
01058       else
01059         weight=GetWeightMINOSplus3(ptype,0.051,pz);  // for low pT                                                                                                                                                         
01060     }
01061 
01062   else if (eptype==kK0L)
01063     {
01064       //N(K0L) approximately given with (N(K+)+3*N(K-))/4
01065       weight= ((fNWeighted[kKPlus]+3.*fNWeighted[kKMinus])
01066                /(fN[kKPlus]+3.*fN[kKMinus]));
01067     }
01068   if (weight>10.) weight=10.;
01069   return weight;
01070 }

double Zfluk::GetWeightMINOSplusN1J ( int  ptype,
double  pt,
double  pz 
)

Function used for MINOS+ fits with MINOS+ param1 (8pi+,8pi- parameters, same weights for kaons).

Definition at line 1261 of file Zfluk.cxx.

References fPar, GetParticleEnum(), kK0L, kKMinus, kKPlus, kPiMinus, kPiPlus, Msg::kWarning, and MAXMSG.

Referenced by SKZPWeightCalculator::GetBeamWeight().

01262 {
01263   double weight=1.;
01264 
01265   if (fPar.size()==0)
01266     {
01267       MAXMSG("MCReweight",Msg::kWarning,10)
01268         <<"You need to set the parameters before calling "
01269         <<"Zfluk::GetWeightMINOSplusN1J (use SetParameters(vector<double>))"<<std::endl
01270         <<"Returning weight = "<<weight<<std::endl;
01271       return weight;
01272     }
01273 
01274   double xF=pz/120.;
01275   double A,B,C,D,E;
01276   double Ap,Bp,Cp,Dp,Ep;
01277   Zfluk::ParticleType_t eptype=GetParticleEnum(ptype);
01278 
01279   // This is SKZP parameterization
01280   //  if (xF>1.||xF<0.) return weight;
01281   //  if (pT>1.||pT<0.) return weight;
01282   if (xF<0.02) return weight;
01283   if (pT>1.4||pT<=0.) return weight;
01284 
01285   if (eptype==kPiPlus||eptype==kKPlus)
01286     {
01287       double bpar[10];
01288       double cpar[10];
01289       double dpar[10];
01290       double epar[10];
01291       int ipar;
01292       //Calculate weight for pions
01293       //        if (pT>=0.03)
01294       if (pT>=0.0)
01295         {
01296           // calculate the A, B and C in SKZP parameterization
01297           // A, B and C are best fit to Flugg08 MINOS+
01298           A=0.0;
01299           B=0.0;
01300           C=0.0;
01301           D=0.0;
01302           E=0.0;
01303 
01304             
01305           //SET UP B
01306           if (xF>0.01&&xF<=0.1)
01307             {
01308               ipar=6;
01309               bpar[0]=1.136930542e+08;
01310               bpar[1]=-9.530270526e+09;
01311               bpar[2]=2.848348318e+11;
01312               bpar[3]=-3.964718642e+12;
01313               bpar[4]=2.619601978e+13;
01314               bpar[5]=-6.646230925e+13;
01315               B=0.0;
01316               for (int ix=0; ix<ipar; ix++)
01317                 {
01318                   B+=bpar[ix]*pow(xF,ix);
01319                 }
01320             }
01321           if (xF>0.1&&xF<=0.25)
01322             {
01323               ipar=7;
01324               bpar[0]=-8.165096451e+06;
01325               bpar[1]=1.595140549e+08;
01326               bpar[2]=-1.086447823e+09;
01327               bpar[3]=2.131445536e+09;
01328               bpar[4]=7.592099396e+09;
01329               bpar[5]=-3.907171536e+10;
01330               bpar[6]=4.664571252e+10;
01331 
01332               for (int ix=0; ix<ipar; ix++)
01333                 {
01334                   B+=bpar[ix]*pow(xF,ix);
01335                 }
01336             }
01337           if (xF>0.25&&xF<=0.54)
01338             {
01339               bpar[0]=-1.639572056e+06;
01340               bpar[1]=1.773829745e+07;
01341               bpar[2]=-6.371612319e+07;
01342               bpar[3]=5.549209169e+07;
01343               bpar[4]=1.703558613e+08;
01344               bpar[5]=-4.120403623e+08;
01345               bpar[6]=2.555996880e+08;
01346               ipar=7;
01347               for (int ix=0; ix<ipar; ix++)
01348                 {
01349                   B+=bpar[ix]*pow(xF,ix);
01350                 }
01351             }
01352           if (xF>0.54)
01353             {
01354               bpar[0]=-4.015418927e+04;
01355               bpar[1]=1.813464881e+05;
01356               bpar[2]=-1.991497139e+05;
01357               bpar[3]=-1.439084077e+05;
01358               bpar[4]=3.692586625e+05;
01359               bpar[5]=-1.678086570e+05;
01360               ipar=6;
01361               for (int ix=0; ix<ipar; ix++)
01362                 {
01363                   B+=bpar[ix]*pow(xF,ix);
01364                 }
01365             }
01366 
01367           //SET UP C
01368       
01369           if (xF>0.01&&xF<=0.15)
01370             {
01371               cpar[0]=-1.1402861723377e+09;
01372               cpar[1]=1.7000255680268e+11;
01373               cpar[2]=-7.4926308033481e+12;
01374               cpar[3]=1.5997805687009e+14;
01375               cpar[4]=-1.8946615078315e+15;
01376               cpar[5]=1.2751428098631e+16;
01377               cpar[6]=-4.5743789357010e+16;
01378               cpar[7]=6.8019712830139e+16;
01379               ipar=8;
01380               for (int ix=0; ix<ipar; ix++)
01381                 {
01382                   C+=cpar[ix]*pow(xF,ix);
01383                 }
01384             }
01385           if (xF>0.15&&xF<=0.6)
01386             {
01387               cpar[0]=6.073722573e+07;
01388               cpar[1]=-8.608039150e+08;
01389               cpar[2]=5.229940709e+09;
01390               cpar[3]=-1.757172124e+10;
01391               cpar[4]=3.516896510e+10;
01392               cpar[5]=-4.187484309e+10;
01393               cpar[6]=2.744716863e+10;
01394               cpar[7]=-7.638253318e+09;
01395               ipar=8;
01396               for (int ix=0; ix<ipar; ix++)
01397                 {
01398                   C+=cpar[ix]*pow(xF,ix);
01399                 }
01400             }
01401       
01402           if (xF>0.6)
01403             {
01404               cpar[0]=-1.937003272e+06;
01405               cpar[1]=1.488049233e+07;
01406               cpar[2]=-4.431153993e+07;
01407               cpar[3]=6.457690765e+07;
01408               cpar[4]=-4.632946452e+07;
01409               cpar[5]=1.313888341e+07;
01410               ipar=6;
01411               for (int ix=0; ix<ipar; ix++)
01412                 {
01413                   C+=cpar[ix]*pow(xF,ix);
01414                 }
01415             }
01416 
01417 
01418           //SET UP D
01419           if (xF<0.1)
01420             {
01421               dpar[0]=2.871762157e+00;
01422               dpar[1]=4.318246857e+02;
01423               dpar[2]=-1.184179392e+04;
01424               dpar[3]=1.287071731e+05;
01425               dpar[4]=-4.943452785e+05;
01426               ipar=5;
01427               for (int ix=0; ix<ipar; ix++)
01428                 {
01429                   D+=dpar[ix]*pow(xF,ix);
01430                 }
01431             }
01432           if (xF>=0.1)
01433             { 
01434               dpar[0]=7.482939858e+00;
01435               dpar[1]=2.695763868e+00;
01436               dpar[2]=-9.997758435e+01;
01437               dpar[3]=2.893603218e+02;
01438               dpar[4]=-3.268337107e+02;
01439               dpar[5]=1.307736659e+02;
01440               ipar=6;
01441               for (int ix=0; ix<ipar; ix++)
01442                 {
01443                   D+=dpar[ix]*pow(xF,ix);
01444                 }
01445             }
01446 
01447           //SET UP E
01448           if (xF<0.2)
01449             {
01450               epar[0]=2.695090536e+00;
01451               epar[1]=-1.787376433e+02;
01452               epar[2]=6.661035733e+03;
01453               epar[3]=-1.247186380e+05;
01454               epar[4]=1.301149518e+06;
01455               epar[5]=-7.663441489e+06;
01456               epar[6]=2.380581676e+07;
01457               epar[7]=-3.029149869e+07;
01458               ipar=8;
01459               for (int ix=0; ix<ipar; ix++)
01460                 {
01461                   E+=epar[ix]*pow(xF,ix);
01462                 }
01463             }
01464 
01465           if (xF>=0.2)
01466             {
01467               epar[0]=8.510702164e-01;
01468               epar[1]=-3.081639896e-01;
01469               epar[2]=1.129974469e+01;
01470               epar[3]=-2.417596299e+01;
01471               epar[4]=1.489392594e+01;
01472               ipar=5;
01473               for (int ix=0; ix<ipar; ix++)
01474                 {
01475                   E+=epar[ix]*pow(xF,ix);
01476                 }
01477             }
01478 
01479           Ap=0.0;
01480           
01481           Bp=(fPar[0]+fPar[1]*xF)*B;
01482           Cp=(fPar[2]+fPar[3]*xF)*C;
01483           Dp=(fPar[4]+fPar[5]*xF)*D;
01484           Ep=(fPar[6]+fPar[7]*xF)*E;
01485           weight=((Ap+Bp*pT+Cp*pT*pT)/(A+B*pT+C*pT*pT))*(exp((-1)*Dp*pow(pT,Ep))/exp((-1)*D*pow(pT,E)));
01486         }
01487     }
01488   else if (eptype==kPiMinus||eptype==kKMinus)
01489     {
01490       double bpar[10];
01491       double cpar[10];
01492       double dpar[10];
01493       double epar[10];
01494       int ipar;
01495       //Calculate weight for pions
01496       //        if (pT>=0.03)
01497       if (pT>=0.0)
01498         {
01499           // calculate the A, B and C in SKZP parameterization
01500           // A, B and C are best fit to Flugg08 MINOS+
01501           A=0.0;
01502           B=0.0;
01503           C=0.0;
01504           D=0.0;
01505           E=0.0;
01506 
01507             
01508           //SET UP B
01509           if (xF>0.01&&xF<=0.09)
01510             {
01511               ipar=6;
01512               bpar[0]=-2.538412786e+07;
01513               bpar[1]=7.286445170e+09;
01514               bpar[2]=-3.544211311e+11;
01515               bpar[3]=6.811749108e+12;
01516               bpar[4]=-5.812360363e+13;
01517               bpar[5]=1.842840260e+14;
01518               B=0.0;
01519               for (int ix=0; ix<ipar; ix++)
01520                 {
01521                   B+=bpar[ix]*pow(xF,ix);
01522                 }
01523             }
01524           if (xF>0.09&&xF<=0.24)
01525             {
01526               ipar=8;
01527               bpar[0]=7.091482185e+07;
01528               bpar[1]=-2.908563487e+09;
01529               bpar[2]=4.992887895e+10;
01530               bpar[3]=-4.662351046e+11;
01531               bpar[4]=2.563059525e+12;
01532               bpar[5]=-8.309732052e+12;
01533               bpar[6]=1.473559142e+13;
01534               bpar[7]=-1.104163515e+13;
01535 
01536               for (int ix=0; ix<ipar; ix++)
01537                 {
01538                   B+=bpar[ix]*pow(xF,ix);
01539                 }
01540             }
01541           if (xF>0.24&&xF<=0.54)
01542             {
01543               ipar=8;
01544               bpar[0]=-5.520000710e+06;
01545               bpar[1]=9.649782727e+07;
01546               bpar[2]=-7.021855503e+08;
01547               bpar[3]=2.769428872e+09;
01548               bpar[4]=-6.411191871e+09;
01549               bpar[5]=8.728647460e+09;
01550               bpar[6]=-6.481012384e+09;
01551               bpar[7]=2.026880507e+09;
01552               for (int ix=0; ix<ipar; ix++)
01553                 {
01554                   B+=bpar[ix]*pow(xF,ix);
01555                 }
01556             }
01557           if (xF>0.54)
01558             {
01559               ipar=6;
01560               bpar[0]=1.793258082e+06;
01561               bpar[1]=-1.301870591e+07;
01562               bpar[2]=3.765741540e+07;
01563               bpar[3]=-5.420754501e+07;
01564               bpar[4]=3.881296171e+07;
01565               bpar[5]=-1.105457981e+07;
01566               for (int ix=0; ix<ipar; ix++)
01567                 {
01568                   B+=bpar[ix]*pow(xF,ix);
01569                 }
01570             }
01571 
01572           //SET UP C
01573      
01574           if (xF>0.01&&xF<=0.14)
01575             {
01576               ipar=8;
01577               cpar[0]=-1.6507263168400e+08;
01578               cpar[1]=3.8827728834428e+10;
01579               cpar[2]=-1.6088502968793e+12;
01580               cpar[3]=3.0260644289333e+13;
01581               cpar[4]=-3.1048178937027e+14;
01582               cpar[5]=1.8037454646700e+15;
01583               cpar[6]=-5.5913524723780e+15;
01584               cpar[7]=7.2053576247586e+15;
01585               for (int ix=0; ix<ipar; ix++)
01586                 {
01587                   C+=cpar[ix]*pow(xF,ix);
01588                 }
01589             }
01590           if (xF>0.14&&xF<=0.59)
01591             {
01592               ipar=8;
01593               cpar[0]=3.446451483e+07;
01594               cpar[1]=-5.390292553e+08;
01595               cpar[2]=3.651844987e+09;
01596               cpar[3]=-1.377072959e+10;
01597               cpar[4]=3.105890345e+10;
01598               cpar[5]=-4.178231372e+10;
01599               cpar[6]=3.099688558e+10;
01600               cpar[7]=-9.775972424e+09;
01601 
01602               for (int ix=0; ix<ipar; ix++)
01603                 {
01604                   C+=cpar[ix]*pow(xF,ix);
01605                 }
01606             }
01607       
01608           if (xF>0.59)
01609             {
01610               ipar=6;
01611               cpar[0]=-2.014423542e+06;
01612               cpar[1]=1.502160519e+07;
01613               cpar[2]=-4.423520725e+07;
01614               cpar[3]=6.445376427e+07;
01615               cpar[4]=-4.654445737e+07;
01616               cpar[5]=1.334158878e+07;
01617               for (int ix=0; ix<ipar; ix++)
01618                 {
01619                   C+=cpar[ix]*pow(xF,ix);
01620                 }
01621             }
01622 
01623 
01624           //SET UP D
01625           if (xF<0.09)
01626             {
01627               ipar=5;
01628               dpar[0]=2.877058697e+00;
01629               dpar[1]=4.260481448e+02;
01630               dpar[2]=-1.175709292e+04;
01631               dpar[3]=1.270728849e+05;
01632               dpar[4]=-4.879203769e+05;
01633               for (int ix=0; ix<ipar; ix++)
01634                 {
01635                   D+=dpar[ix]*pow(xF,ix);
01636                 }
01637             }
01638           if (xF>=0.09)
01639             { 
01640               ipar=6;
01641               dpar[0]=8.577259703e+00;
01642               dpar[1]=-3.106957466e+01;
01643               dpar[2]=1.174929250e+02;
01644               dpar[3]=-2.957456364e+02;
01645               dpar[4]=3.820586861e+02;
01646               dpar[5]=-1.934544414e+02;
01647               for (int ix=0; ix<ipar; ix++)
01648                 {
01649                   D+=dpar[ix]*pow(xF,ix);
01650                 }
01651             }
01652 
01653           //SET UP E
01654           if (xF<0.2)
01655             {
01656               ipar=8;
01657               epar[0]=2.561392544e+00;
01658               epar[1]=-1.556007483e+02;
01659               epar[2]=5.429027575e+03;
01660               epar[3]=-9.414248360e+04;
01661               epar[4]=9.105252697e+05;
01662               epar[5]=-4.990987716e+06;
01663               epar[6]=1.449951613e+07;
01664               epar[7]=-1.734389794e+07;
01665               for (int ix=0; ix<ipar; ix++)
01666                 {
01667                   E+=epar[ix]*pow(xF,ix);
01668                 }
01669             }
01670 
01671           if (xF>=0.2)
01672             {
01673               ipar=5;
01674               epar[0]=1.254042724e+00;
01675               epar[1]=-2.419608112e+00;
01676               epar[2]=1.428429527e+01;
01677               epar[3]=-2.515360948e+01;
01678               epar[4]=1.603278679e+01;
01679               for (int ix=0; ix<ipar; ix++)
01680                 {
01681                   E+=epar[ix]*pow(xF,ix);
01682                 }
01683             }
01684 
01685           Ap=0.0;
01686           
01687           Bp=(fPar[8]+fPar[9]*xF)*B;
01688           Cp=(fPar[10]+fPar[11]*xF)*C;
01689           Dp=(fPar[12]+fPar[13]*xF)*D;
01690           Ep=(fPar[14]+fPar[15]*xF)*E;
01691           weight=((Ap+Bp*pT+Cp*pT*pT)/(A+B*pT+C*pT*pT))*(exp((-1)*Dp*pow(pT,Ep))/exp((-1)*D*pow(pT,E)));
01692         }
01693     }
01694   else if (eptype==kK0L)
01695     {
01696       weight=1.0;
01697     }
01698   if (weight>10.0) weight=10.0;
01699   if (weight<0.0) weight=1.0;
01700   return weight;
01701 }

double Zfluk::GetWeightMINOSplusSea ( int  ptype,
double  pt,
double  pz 
)

Function used for MINOS+ fits with MINOS+ param2 (6pi+,6pi-,6k+ and 2k- parameters).

Definition at line 1073 of file Zfluk.cxx.

References fN, fNWeighted, fPar, GetParticleEnum(), kK0L, kKMinus, kKPlus, kPiMinus, kPiPlus, Msg::kWarning, and MAXMSG.

01074 {
01075   double weight=1.;
01076 
01077   if (fPar.size()==0)
01078     {
01079       MAXMSG("MCReweight",Msg::kWarning,10)
01080         <<"You need to set the parameters before calling "
01081         <<"Zfluk::GetWeightMINOSplusSea (use SetParameters(vector<double>))"<<std::endl
01082         <<"Returning weight = "<<weight<<std::endl;
01083       return weight;
01084     }
01085 
01086   double xF=pz/120.;
01087   double A,B,C;
01088   double Ap,Bp,Cp;
01089   double App,Bpp,Cpp;
01090   double WP, WPp, WPpp;
01091 
01092   Zfluk::ParticleType_t eptype=GetParticleEnum(ptype);
01093 
01094   // This is SKZP parameterization
01095   if (xF>1.||xF<0.) return weight;
01096   if (pT>1.||pT<0.) return weight;
01097 
01098   if (eptype==kPiPlus)
01099     {
01100 
01101       //MINOS+ flugg08 'regular' (best-fit) parametrisation
01102       double a1 = 11.626;
01103       double a2 = 2.94402;
01104       double a3 = -53.2124;
01105       double a4 = 3.26934;
01106       double b1 = 2.04568;
01107       double b2 = 3.08177;
01108       double b3 = 22771.8;
01109       double b4 = 3.00019;
01110       double c1 = -7.53874;
01111       double c2 = -0.1826;
01112       double c3 = 9.08175;
01113       double c4 = 1.67882;
01114       double c5 = -0.12317;
01115       double c6 = 8.95217;
01116       double c7 = -0.75410;
01117       double c8 = 2.86347;
01118 
01119       //Calculate weight for pions
01120       if (pT>=0.03)
01121         {
01122           // calculate the A, B and C in SKZP parameterization
01123           // A, B and C are best fit to Flugg08 MINOS+
01124 
01125           A=a1*pow((1.-xF),a2)*(1.+a3*xF)*pow(xF,-a4);
01126           B=b1*pow((1.-xF),b2)*(1.+b3*xF)*pow(xF,-b4);
01127 
01128           if (xF<0.22){
01129             C=c1/pow(xF,c2)+c3;
01130           }
01131           else{
01132             C = (c4/exp((xF+c5)*c6)) + c7*xF+c8;
01133           }
01134 
01135           // scale/skew A, B and C
01136           Ap=(fPar[0]+fPar[1]*xF)*A;
01137           Bp=(fPar[2]+fPar[3]*xF)*B;
01138           Cp=(fPar[4]+fPar[5]*xF)*C;
01139 
01140         }
01141       else weight=GetWeightMINOSplusSea(ptype,0.031,pz);  // for low pT
01142     }
01143   else if (eptype==kKPlus)
01144     {
01145 
01146       //MINOS+ flugg08 'regular' (best-fit) parametrisation
01147       double a1 = 2.05165;
01148       double a2 = 2.87063;
01149       double a3 = -55.3625;
01150       double a4 = 2.97932;
01151       double b1 = 0.741186;
01152       double b2 = 2.96739;
01153       double b3 = 10883.7;
01154       double b4 = 2.79326;
01155       double c1 = -4.79522;
01156       double c2 = -0.28964;
01157       double c3 = 5.98698;
01158       double c4 = 6.90941;
01159       double c5 = 0.323327;
01160       double c6 = 5.15999;
01161       double c7 = -0.53025;
01162       double c8 = 2.62459;
01163 
01164       if (pT>=0.05)
01165         {
01166           // calculate the A, B and C in SKZP parameterization
01167           // A, B and C are best fit to Flugg08 MINOS+
01168 
01169           A=a1*pow((1.-xF),a2)*(1.+a3*xF)*pow(xF,-a4);
01170           B=b1*pow((1.-xF),b2)*(1.+b3*xF)*pow(xF,-b4);
01171 
01172           if (xF<0.22){
01173             C=c1/pow(xF,c2)+c3;
01174           }
01175           else{
01176             C = (c4/exp((xF+c5)*c6)) + c7*xF+c8;
01177           }
01178 
01179           // scale/skew A, B and C
01180           Ap=(fPar[6]+fPar[7]*xF)*A;
01181           Bp=(fPar[8]+fPar[9]*xF)*B;
01182           Cp=(fPar[10]+fPar[11]*xF)*C;
01183 
01184           weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
01185         }
01186       else 
01187         weight=GetWeightMINOSplusSea(ptype,0.051,pz);  // for low pT
01188     }
01189   else if (eptype==kPiMinus)
01190     {
01191 
01192       //MINOS+ flugg08 'regular' (best-fit) parametrisation
01193       double a1 = 8.33552;
01194       double a2 = 3.57521;
01195       double a3 = -53.4627;
01196       double a4 = 3.3361;
01197       double b1 = 1.24421;
01198       double b2 = 3.4827;
01199       double b3 = 22734.4;
01200       double b4 = 3.11944;
01201       double c1 = -17.1133;
01202       double c2 = -0.06759;
01203       double c3 = 18.5386;
01204       double c4 = 0.652364;
01205       double c5 = -0.22222;
01206       double c6 = 6.64856;
01207       double c7 = -0.58336;
01208       double c8 = 2.60096;
01209 
01210       //Calculate weight for pi-minus
01211       if (pT>=0.03)
01212         {
01213           // calculate the A, B and C in SKZP parameterization
01214           // A, B and C are best fit to Flugg08 MINOS+
01215 
01216           A=a1*pow((1.-xF),a2)*(1.+a3*xF)*pow(xF,-a4);
01217           B=b1*pow((1.-xF),b2)*(1.+b3*xF)*pow(xF,-b4);
01218 
01219           if (xF<0.22){
01220             C=c1/pow(xF,c2)+c3;
01221           }
01222           else{
01223             C = (c4/exp((xF+c5)*c6)) + c7*xF+c8;
01224           }
01225 
01226           // scale/skew A, B and C
01227           Ap=(fPar[12]+fPar[13]*xF)*A;
01228           Bp=(fPar[14]+fPar[15]*xF)*B;
01229           Cp=(fPar[16]+fPar[17]*xF)*C;
01230 
01231           // scale/skew A, B and C
01232           App=(fPar[18]+fPar[19]*xF)*A;
01233           Bpp=(fPar[20]+fPar[21]*xF)*B;
01234           Cpp=(fPar[22]+fPar[23]*xF)*C;
01235 
01236           //          weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
01237 
01238           WP=(A+B*pT)*exp((-C)*pow(pT,3./2.));
01239           WPp=(Ap+Bp*pT)*exp((-Cp)*pow(pT,3./2.));
01240           WPpp=(App+Bpp*pT)*exp((-Cpp)*pow(pT,3./2.));
01241           weight=((0.5*fPar[24]*WPp)+(0.5*fPar[25]*WPpp))/WP;
01242 
01243         }
01244       else weight=GetWeightMINOSplusSea(ptype,0.031,pz);  // for low pT
01245     }
01246   else if (eptype==kKMinus)
01247     {
01248       weight=GetWeightMINOSplusSea(kKPlus,pT,pz)*(fPar[26]+fPar[27]*xF);
01249     }
01250   else if (eptype==kK0L)
01251     {
01252       //N(K0L) approximately given with (N(K+)+3*N(K-))/4
01253       weight= ((fNWeighted[kKPlus]+3.*fNWeighted[kKMinus])
01254                /(fN[kKPlus]+3.*fN[kKMinus]));
01255     }
01256   if (weight>10.) weight=10.;
01257   return weight;
01258 }

double Zfluk::GetWeightPRL ( int  tpType,
double  tpx,
double  tpy,
double  tpz,
double *  par 
) [inline]

Definition at line 61 of file Zfluk.h.

References GetWeightPRL().

00062                                                                    {
00063     double pT=sqrt(tpx*tpx+tpy*tpy);
00064     return GetWeightPRL(tpType, pT, tpz, par);
00065   };

double Zfluk::GetWeightPRL ( int  ptype,
double  pt,
double  pz,
double *  par 
)

Following two functions used for PRL-like reweighting (6pi+ and 1k+ parameter).

Definition at line 180 of file Zfluk.cxx.

References GetWeightBoston(), and whichParameterization.

Referenced by SKZPWeightCalculator::GetBeamWeight(), and GetWeightPRL().

00181 {
00182   //this was used for PRL in 2006 (par was an array of 7 parameters
00183   std::vector<double> parVec;
00184   int npar=0;
00185 
00186   if (whichParameterization==0) npar=7;
00187   else npar=6;
00188   
00189   for (int i=0;i<npar;i++) parVec.push_back(par[i]);
00190   //this fit same as Boston for pi+ and K+, 
00191   //unlike in Boston fit, pi- and K- are not weighted here 
00192   //need 16 parameters to call GetWeightBoston(ptype,pT,pz,parVec)
00193   // fill rest of the parameters so that weights for pi- and K- are 1
00194   for (int i=7;i<16;i++) parVec.push_back(double((i-1)%2));
00195   return GetWeightBoston(ptype,pT,pz,parVec);
00196 }

double Zfluk::GetWeightRHC2012 ( int  ptype,
double  pt,
double  pz 
)

Function used for RHC fits (6pi+,6pi-,6k+ and 2k- parameters).

Definition at line 392 of file Zfluk.cxx.

References fN, fNWeighted, fPar, GetParticleEnum(), kK0L, kKMinus, kKPlus, kPiMinus, kPiPlus, Msg::kWarning, and MAXMSG.

00393 {
00394   double weight=1.;
00395 
00396   if (fPar.size()==0)
00397     {
00398       MAXMSG("MCReweight",Msg::kWarning,10)
00399         <<"You need to set the parameters before calling "
00400         <<"Zfluk::GetWeightRHC2012 (use SetParameters(vector<double>))"<<std::endl
00401         <<"Returning weight = "<<weight<<std::endl;
00402       return weight;
00403     }
00404 
00405   double xF=pz/120.;
00406   double A,B,C;
00407   double Ap,Bp,Cp;
00408   Zfluk::ParticleType_t eptype=GetParticleEnum(ptype);
00409 
00410   // This is SKZP parameterization
00411   if (xF>1.||xF<0.) return weight;
00412   if (pT>1.||pT<0.) return weight;
00413   if (eptype==kPiPlus)
00414     {
00415       //Calculate weight for pions
00416       if (pT>=0.03)
00417         {
00418           // calculate the A, B and C in SKZP parameterization
00419           // A, B and C are best fit to Fluka 05
00420 
00421           A=-0.00761*pow((1.-xF),4.045)*(1.+9620.*xF)*pow(xF,-2.975);
00422           B=0.05465*pow((1.-xF),2.675)*(1.+69590.*xF)*pow(xF,-3.144);
00423 
00424           if (xF<0.22){
00425             C=-7.058/pow(xF,-0.1419)+9.188;
00426           }
00427           else{
00428             C = (3.008/exp((xF-0.1984)*3.577)) + 2.616*xF+0.1225;
00429           }
00430 
00431           // scale/skew A, B and C
00432           Ap=(fPar[0]+fPar[1]*xF)*A;
00433           Bp=(fPar[2]+fPar[3]*xF)*B;
00434           Cp=(fPar[4]+fPar[5]*xF)*C;
00435 
00436           weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
00437         }
00438       else weight=GetWeightRHC2012(ptype,0.031,pz);  // for low pT
00439     }
00440   else if (eptype==kKPlus)
00441     {
00442       if (pT>=0.05)
00443         {
00444           // calculate the A, B and C in SKZP parameterization
00445           // A, B and C are best fit to Fluka 05
00446 
00447           A=-0.005187*pow((1.-xF),4.119)*(1.+2170.*xF)*pow(xF,-2.767);
00448           B=0.4918*pow((1.-xF),2.672)*(1.+1373.*xF)*pow(xF,-2.927);
00449 
00450           if (xF<0.22){
00451             C=-16.10/pow(xF,-0.04582)+17.92;
00452           }
00453           else{
00454             C = (6.905/exp((xF+0.163)*6.718)) - 0.4257*xF + 2.486;
00455           }
00456 
00457           // scale/skew A, B and C
00458           Ap=(fPar[6]+fPar[7]*xF)*A;
00459           Bp=(fPar[8]+fPar[9]*xF)*B;
00460           Cp=(fPar[10]+fPar[11]*xF)*C;
00461 
00462           weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
00463         }
00464       else
00465         weight=GetWeightRHC2012(ptype,0.051,pz);  // for low pT
00466     }
00467   else if (eptype==kPiMinus)
00468     {
00469       //Calculate weight for pi-minus
00470       if (pT>=0.03)
00471         {
00472           // calculate the A, B and C in SKZP parameterization
00473           // A, B and C are best fit to Fluka 05
00474 
00475           A=-0.006306*pow((1.-xF),5.730)*(1.+13650.*xF)*pow(xF,-2.900);
00476           B=0.04608*pow((1.-xF),3.291)*(1.+58570.*xF)*pow(xF,-3.209);
00477 
00478           if (xF<0.22){
00479             C=-16.52/pow(xF,-0.06204)+18.12;
00480           }
00481           else{
00482             C = (2.972/exp((xF-0.1758)*2.266)) + 1.730*xF+0.04196;
00483           }
00484 
00485           // scale/skew A, B and C
00486           Ap=(fPar[12]+fPar[13]*xF)*A;
00487           Bp=(fPar[14]+fPar[15]*xF)*B;
00488           Cp=(fPar[16]+fPar[17]*xF)*C;
00489 
00490           weight=(Ap+Bp*pT)/(A+B*pT)*exp(-(Cp-C)*pow(pT,3./2.));
00491         }
00492       else weight=GetWeightRHC2012(ptype,0.031,pz);  // for low pT
00493     }
00494   else if (eptype==kKMinus)
00495     {
00496       weight=GetWeightRHC2012(kKPlus,pT,pz)*(fPar[18]+fPar[19]*xF);
00497     }
00498   else if (eptype==kK0L)
00499     {
00500       //N(K0L) approximately given with (N(K+)+3*N(K-))/4
00501       weight= ((fNWeighted[kKPlus]+3.*fNWeighted[kKMinus])
00502                /(fN[kKPlus]+3.*fN[kKMinus]));
00503     }
00504   if (weight>10.) weight=10.;
00505   return weight;
00506 }

void Zfluk::RecalculateWeights (  )  [private]

Definition at line 1705 of file Zfluk.cxx.

References fNWeighted, fPlist, fPTXF, fWeightedMeanPT, fWeightedPTXF, fWeightHist, and GetWeight().

Referenced by SetParameters().

01706 {
01707   
01708   for (std::vector<ParticleType_t>::iterator itPlist=fPlist.begin();
01709        itPlist!=fPlist.end(); itPlist++)
01710     {
01711       double xf,pt;
01712       double meanpt(0.);
01713       double sum(0.);
01714       for (int i=0;i<fPTXF[*itPlist]->GetNbinsX()+1;i++)
01715         {
01716           for (int j=0;j<fPTXF[*itPlist]->GetNbinsY()+1;j++)
01717             {
01718               xf=fPTXF[*itPlist]->GetXaxis()->GetBinCenter(i);
01719               pt=fPTXF[*itPlist]->GetYaxis()->GetBinCenter(j);
01720               fWeightedPTXF[*itPlist]
01721                 ->SetBinContent(i,j,(fPTXF[*itPlist]->GetBinContent(i,j)
01722                                      *GetWeight(*itPlist,pt,xf)));
01723               fWeightHist[*itPlist]->SetBinContent(i,j,GetWeight(*itPlist,pt,xf));
01724               meanpt+=fWeightedPTXF[*itPlist]->GetBinContent(i,j)*pt;
01725               sum+=fWeightedPTXF[*itPlist]->GetBinContent(i,j);
01726             }
01727         }
01728       meanpt/=sum;
01729       fWeightedMeanPT[*itPlist]=meanpt*1000.; //GeV to MeV
01730       fNWeighted[*itPlist]=sum;
01731       meanpt=0.;
01732       sum=0.;
01733     }
01734 }

void Zfluk::SetParameters ( std::vector< double >  par  )  [inline]

Get/Set parameters used for reweighting (for PiMinus and later fits).

Definition at line 32 of file Zfluk.h.

References fPar, and RecalculateWeights().

Referenced by SKZPWeightCalculator::Config().

00032 {fPar=par; RecalculateWeights();};

void Zfluk::UseParameterization ( const char *  which  )  [inline]

Used in times of PRL fit to choose between TV and SKZP functional forms.

Definition at line 84 of file Zfluk.h.

References whichParameterization.

Referenced by NtpTools::NtpTools().

00084                                                     {
00085     std::string temp=which;
00086     if (temp=="SKZP") whichParameterization=0;
00087     else whichParameterization=1;
00088   };


Member Data Documentation

std::map<Zfluk::ParticleType_t, double > Zfluk::fMeanPT [private]

Definition at line 113 of file Zfluk.h.

Referenced by GetMeanPT(), GetPTshift(), and ~Zfluk().

std::map<Zfluk::ParticleType_t, double > Zfluk::fN [private]
std::map<Zfluk::ParticleType_t, int > Zfluk::fNBinsX [private]

Definition at line 117 of file Zfluk.h.

Referenced by ~Zfluk().

std::map<Zfluk::ParticleType_t, int > Zfluk::fNBinsY [private]

Definition at line 117 of file Zfluk.h.

Referenced by ~Zfluk().

std::map<Zfluk::ParticleType_t, double > Zfluk::fNWeighted [private]
std::vector<double> Zfluk::fPar [private]
std::vector<ParticleType_t> Zfluk::fPlist [private]

Definition at line 108 of file Zfluk.h.

Referenced by RecalculateWeights(), and ~Zfluk().

std::map<Zfluk::ParticleType_t, TH2F* > Zfluk::fPTXF [private]

Definition at line 110 of file Zfluk.h.

Referenced by GetNFrac(), GetPTshift(), GetPTXF(), RecalculateWeights(), and ~Zfluk().

std::map<Zfluk::ParticleType_t, double > Zfluk::fWeightedMeanPT [private]

Definition at line 116 of file Zfluk.h.

Referenced by GetPTshift(), GetReweightedMeanPT(), RecalculateWeights(), and ~Zfluk().

std::map<Zfluk::ParticleType_t, TH2F* > Zfluk::fWeightedPTXF [private]

Definition at line 111 of file Zfluk.h.

Referenced by GetNFrac(), GetPTshift(), GetReweightedPTXF(), RecalculateWeights(), and ~Zfluk().

std::map<Zfluk::ParticleType_t, TH2F* > Zfluk::fWeightHist [private]

Definition at line 112 of file Zfluk.h.

Referenced by GetWeightHistogram(), RecalculateWeights(), and ~Zfluk().

Definition at line 105 of file Zfluk.h.

Referenced by GetWeightBoston(), GetWeightPRL(), and UseParameterization().


The documentation for this class was generated from the following files:

Generated on 18 Oct 2018 for loon by  doxygen 1.6.1