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 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 88 of file Zfluk.h.

00089   {
00090     kPiPlus  = 8,
00091     kPiMinus = 9,
00092     kKPlus   = 11,
00093     kKMinus  = 12,
00094     kK0L     = 10,
00095     kUnknown = 0
00096   } 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 64 of file Zfluk.h.

References fMeanPT, and GetParticleEnum().

00064 {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 1334 of file Zfluk.cxx.

References fPTXF, fWeightedPTXF, and GetParticleEnum().

01335 {
01336   //returns the fractional change in number of particles due to reweighting in xf-pt region 
01337   //given by pz_low, pz_up and pt_low, pt_up
01338   
01339   Zfluk::ParticleType_t eptype=GetParticleEnum(ptype);
01340   if (fPTXF.find(eptype)==fPTXF.end())
01341     {
01342       return 1.;
01343     }
01344   int xlow=int(pz_low+1.);
01345   int xup=int(pz_up+1.);
01346   int ylow=int(50.*pt_low+1.);
01347   int yup=int(50.*pt_up+1.);
01348   
01349   double wsum(0.);
01350   double sum(0.);
01351   for (int i=xlow;i<xup;i++)
01352     {
01353       for (int j=ylow;j<yup;j++)
01354         {
01355           sum+=fPTXF[eptype]->GetBinContent(i,j);
01356           wsum+=fWeightedPTXF[eptype]->GetBinContent(i,j);
01357         }
01358     }
01359 
01360   return wsum/sum;
01361 }

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 1379 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(), GetWeightMINOSplusSea(), and GetWeightRHC2012().

01380 {
01381   switch (ptype)
01382     {
01383     case 8   :       return kPiPlus;      break;
01384     case 211 :       return kPiPlus;      break;    
01385     case 9   :       return kPiMinus;     break;
01386     case -211:       return kPiMinus;     break;
01387     case 11  :       return kKPlus;       break;
01388     case 321 :       return kKPlus;       break;
01389     case 12  :       return kKMinus;      break;
01390     case -321:       return kKMinus;      break;
01391     case 10  :       return kK0L;         break;
01392     case 130 :       return kK0L;         break;
01393     default:         return kUnknown;     break;
01394     }
01395   return kUnknown;
01396 
01397 }

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

Definition at line 1363 of file Zfluk.cxx.

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

01364 {
01365 switch (ptype)
01366    {
01367    case kPiPlus:          return "PiPlus";    break;
01368    case kPiMinus:         return "PiMinus";   break;
01369    case kKPlus:           return "KPlus";     break;
01370    case kKMinus:          return "KMinus";    break;
01371    case kK0L:             return "K0L";       break;
01372    case kUnknown:         return "Unknown";   break;
01373    default:               return "Unknown";   break;
01374    }
01375  
01376    return "Unknown";
01377 }

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 1299 of file Zfluk.cxx.

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

01300 {
01301   //returns the pT shift for ptype particle due to reweighting in xf slice
01302   //given by pz_low and pz_up
01303   //this function returns correct ptshift only if the parameters were set using SetParameters
01304 
01305   Zfluk::ParticleType_t eptype=GetParticleEnum(ptype);
01306 
01307   if (fPTXF.find(eptype)==fPTXF.end())
01308     {
01309       return 0.;
01310     }
01311   if (pz_low==0.&&pz_up==120.) return fWeightedMeanPT[eptype]-fMeanPT[eptype];
01312  
01313   int xlow=int(pz_low+1.);
01314   int xup=int(pz_up+1.);
01315  
01316   double pt;
01317   double meanpt(0.);
01318   double sum(0.);
01319   for (int i=xlow;i<xup;i++)
01320     {
01321       for (int j=1;j<51;j++)
01322         {
01323           pt=0.02*j-0.01;
01324           meanpt+=fWeightedPTXF[eptype]->GetBinContent(i,j)*pt;
01325           sum+=fWeightedPTXF[eptype]->GetBinContent(i,j);
01326         }
01327     }
01328   meanpt/=sum;
01329   meanpt*=1000.;  //GeV to MeV
01330 
01331   return meanpt-fMeanPT[eptype];
01332 
01333 }

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

Definition at line 77 of file Zfluk.h.

References fPTXF, and GetParticleEnum().

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

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

Definition at line 65 of file Zfluk.h.

References fWeightedMeanPT, and GetParticleEnum().

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

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

Definition at line 76 of file Zfluk.h.

References fWeightedPTXF, and GetParticleEnum().

00076 {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().

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 78 of file Zfluk.h.

References fWeightHist, and GetParticleEnum().

00078 {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(), and RecalculateWeights().

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 858 of file Zfluk.cxx.

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

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

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 1078 of file Zfluk.cxx.

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

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

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

Definition at line 58 of file Zfluk.h.

References GetWeightPRL().

00059                                                                    {
00060     double pT=sqrt(tpx*tpx+tpy*tpy);
00061     return GetWeightPRL(tpType, pT, tpz, par);
00062   };

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 1268 of file Zfluk.cxx.

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

Referenced by SetParameters().

01269 {
01270   
01271   for (std::vector<ParticleType_t>::iterator itPlist=fPlist.begin();
01272        itPlist!=fPlist.end(); itPlist++)
01273     {
01274       double xf,pt;
01275       double meanpt(0.);
01276       double sum(0.);
01277       for (int i=0;i<fPTXF[*itPlist]->GetNbinsX()+1;i++)
01278         {
01279           for (int j=0;j<fPTXF[*itPlist]->GetNbinsY()+1;j++)
01280             {
01281               xf=fPTXF[*itPlist]->GetXaxis()->GetBinCenter(i);
01282               pt=fPTXF[*itPlist]->GetYaxis()->GetBinCenter(j);
01283               fWeightedPTXF[*itPlist]
01284                 ->SetBinContent(i,j,(fPTXF[*itPlist]->GetBinContent(i,j)
01285                                      *GetWeightMINOSplus2(*itPlist,pt,xf)));
01286               fWeightHist[*itPlist]->SetBinContent(i,j,GetWeightMINOSplus2(*itPlist,pt,xf));
01287               meanpt+=fWeightedPTXF[*itPlist]->GetBinContent(i,j)*pt;
01288               sum+=fWeightedPTXF[*itPlist]->GetBinContent(i,j);
01289             }
01290         }
01291       meanpt/=sum;
01292       fWeightedMeanPT[*itPlist]=meanpt*1000.; //GeV to MeV
01293       fNWeighted[*itPlist]=sum;
01294       meanpt=0.;
01295       sum=0.;
01296     }
01297 }

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 81 of file Zfluk.h.

References whichParameterization.

Referenced by NtpTools::NtpTools().

00081                                                     {
00082     std::string temp=which;
00083     if (temp=="SKZP") whichParameterization=0;
00084     else whichParameterization=1;
00085   };


Member Data Documentation

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

Definition at line 110 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 114 of file Zfluk.h.

Referenced by ~Zfluk().

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

Definition at line 114 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 105 of file Zfluk.h.

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

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

Definition at line 107 of file Zfluk.h.

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

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

Definition at line 113 of file Zfluk.h.

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

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

Definition at line 108 of file Zfluk.h.

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

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

Definition at line 109 of file Zfluk.h.

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

Definition at line 102 of file Zfluk.h.

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


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1