LZfluk Class Reference

#include <LZfluk.h>

List of all members.

Public Member Functions

 LZfluk ()
virtual ~LZfluk ()
void Config (const Registry &reg)
void Init ()
void SetParameters (std::vector< double > par)
 Get/Set parameters used for reweighting (for PiMinus and later fits).
const std::vector< double > & GetParameters ()
double GetWeight (int ptype, double pt, double pz)
 Function used for PiMinus and later fits (6pi+,2pi-,6k+ and 2k- parameters).
double CalcWeight (int ptype, double pt, double pz)
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)
TH2D * 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 LZfluk::EParticleType ParticleType_t

Private Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 26 of file LZfluk.h.


Member Typedef Documentation


Member Enumeration Documentation

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

Definition at line 70 of file LZfluk.h.

00071    {
00072       kPiPlus  = 8,
00073       kPiMinus = 9,
00074       kKPlus   = 11,
00075       kKMinus  = 12,
00076       kK0L     = 10,
00077       kUnknown = 0
00078    } ParticleType_t;


Constructor & Destructor Documentation

LZfluk::LZfluk (  ) 

Definition at line 88 of file LZfluk.cxx.

00089    :fPar(0),
00090     fWghtFromHist(true)
00091 {
00092 
00093 }

LZfluk::~LZfluk (  )  [virtual]

Definition at line 200 of file LZfluk.cxx.

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

00200                 {
00201  for (std::vector<ParticleType_t>::iterator itPlist=fPlist.begin();itPlist!=fPlist.end(); itPlist++)
00202     {
00203       delete fWeightHist[*itPlist];
00204       delete fPTXF[*itPlist];
00205       delete fWeightedPTXF[*itPlist];
00206     }
00207  fWeightHist.clear();
00208  fPTXF.clear();
00209  fWeightedPTXF.clear();
00210  fMeanPT.clear();
00211  fWeightedMeanPT.clear();
00212  fN.clear();
00213  fNWeighted.clear();
00214  fPlist.clear();
00215  fPar.clear();
00216  fNBinsX.clear();
00217  fNBinsY.clear();
00218 }


Member Function Documentation

double LZfluk::CalcWeight ( int  ptype,
double  pt,
double  pz 
)

Definition at line 284 of file LZfluk.cxx.

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

Referenced by GetWeight(), and RecalculateWeights().

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

void LZfluk::Config ( const Registry reg  ) 

Definition at line 221 of file LZfluk.cxx.

References fWghtFromHist, and Registry::Get().

00222 {
00223 
00224    const char *value_char = 0;
00225 
00226    if(reg.Get("WGHTFROMHIST", value_char) && value_char)
00227    {
00228       if(std::strcmp(value_char, "no") == 0) 
00229       {
00230          fWghtFromHist = false;
00231       }
00232    }
00233 
00234         
00235    cout << "LZfluk::Config" << endl;
00236    cout << "   Get Weight From Hist = " <<  fWghtFromHist << endl;
00237    
00238    
00239 }

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

Definition at line 46 of file LZfluk.h.

References fMeanPT, and GetParticleEnum().

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

double LZfluk::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 482 of file LZfluk.cxx.

References fPTXF, fWeightedPTXF, and GetParticleEnum().

00483 {
00484   //returns the fractional change in number of particles due to reweighting in xf-pt region 
00485   //given by pz_low, pz_up and pt_low, pt_up
00486   
00487   LZfluk::ParticleType_t eptype=GetParticleEnum(ptype);
00488   if (fPTXF.find(eptype)==fPTXF.end())
00489     {
00490       return 1.;
00491     }
00492   int xlow=int(pz_low+1.);
00493   int xup=int(pz_up+1.);
00494   int ylow=int(50.*pt_low+1.);
00495   int yup=int(50.*pt_up+1.);
00496   
00497   double wsum(0.);
00498   double sum(0.);
00499   for (int i=xlow;i<xup;i++)
00500     {
00501       for (int j=ylow;j<yup;j++)
00502         {
00503           sum+=fPTXF[eptype]->GetBinContent(i,j);
00504           wsum+=fWeightedPTXF[eptype]->GetBinContent(i,j);
00505         }
00506     }
00507 
00508   return wsum/sum;
00509 }

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

Definition at line 39 of file LZfluk.h.

References fPar.

00039 {return fPar;};

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

Definition at line 529 of file LZfluk.cxx.

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

Referenced by CalcWeight(), GetMeanPT(), GetNFrac(), GetPTshift(), GetPTXF(), GetReweightedMeanPT(), GetReweightedPTXF(), GetWeight(), and GetWeightHistogram().

00530 {
00531   switch (ptype)
00532     {
00533     case 8   :       return kPiPlus;      break;
00534     case 211 :       return kPiPlus;      break;    
00535     case 9   :       return kPiMinus;     break;
00536     case -211:       return kPiMinus;     break;
00537     case 11  :       return kKPlus;       break;
00538     case 321 :       return kKPlus;       break;
00539     case 12  :       return kKMinus;      break;
00540     case -321:       return kKMinus;      break;
00541     case 10  :       return kK0L;         break;
00542     case 130 :       return kK0L;         break;
00543     default:         return kUnknown;     break;
00544     }
00545   return kUnknown;
00546 
00547 }

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

Definition at line 512 of file LZfluk.cxx.

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

Referenced by Init(), and RecalculateWeights().

00513 {
00514 switch (ptype)
00515    {
00516    case kPiPlus:          return "PiPlus";    break;
00517    case kPiMinus:         return "PiMinus";   break;
00518    case kKPlus:           return "KPlus";     break;
00519    case kKMinus:          return "KMinus";    break;
00520    case kK0L:             return "K0L";       break;
00521    case kUnknown:         return "Unknown";   break;
00522    default:               return "Unknown";   break;
00523    }
00524  
00525    return "Unknown";
00526 }

double LZfluk::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 445 of file LZfluk.cxx.

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

00446 {
00447   //returns the pT shift for ptype particle due to reweighting in xf slice
00448   //given by pz_low and pz_up
00449   //this function returns correct ptshift only if the parameters were set using SetParameters
00450 
00451   LZfluk::ParticleType_t eptype=GetParticleEnum(ptype);
00452 
00453   if (fPTXF.find(eptype)==fPTXF.end())
00454     {
00455       return 0.;
00456     }
00457   if (pz_low==0.&&pz_up==120.) return fWeightedMeanPT[eptype]-fMeanPT[eptype];
00458  
00459   int xlow=int(pz_low+1.);
00460   int xup=int(pz_up+1.);
00461  
00462   double pt;
00463   double meanpt(0.);
00464   double sum(0.);
00465   for (int i=xlow;i<xup;i++)
00466     {
00467       for (int j=1;j<51;j++)
00468         {
00469           pt=0.02*j-0.01;
00470           meanpt+=fWeightedPTXF[eptype]->GetBinContent(i,j)*pt;
00471           sum+=fWeightedPTXF[eptype]->GetBinContent(i,j);
00472         }
00473     }
00474   meanpt/=sum;
00475   meanpt*=1000.;  //GeV to MeV
00476 
00477   return meanpt-fMeanPT[eptype];
00478 
00479 }

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

Definition at line 59 of file LZfluk.h.

References fPTXF, and GetParticleEnum().

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

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

Definition at line 47 of file LZfluk.h.

References fWeightedMeanPT, and GetParticleEnum().

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

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

Definition at line 58 of file LZfluk.h.

References fWeightedPTXF, and GetParticleEnum().

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

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

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

Definition at line 242 of file LZfluk.cxx.

References CalcWeight(), fWeightHist, fWghtFromHist, GetParticleEnum(), kKPlus, kPiMinus, and kPiPlus.

00243 {
00244     
00245    if(fWghtFromHist)
00246    {
00247       
00248       double weight = 1.0;
00249       
00250       LZfluk::ParticleType_t eptype=GetParticleEnum(ptype);
00251       
00252       if(eptype != kPiPlus && eptype != kKPlus && eptype != kPiMinus && eptype != kPiMinus)
00253       {
00254          return 1.0;
00255       }
00256       
00257       if (pz > 120.0 || pz < 0.0 || pT < 0.0 || pT > 1.0)
00258       {
00259          return weight;
00260       }
00261       
00262       const int nbinsx = fWeightHist[eptype] -> GetNbinsX();
00263       const int nbinsy = fWeightHist[eptype] -> GetNbinsY();
00264       
00265       int binx = (fWeightHist[eptype] -> GetXaxis()) -> FindFixBin(pz);
00266       int biny = (fWeightHist[eptype] -> GetYaxis()) -> FindFixBin(pT);
00267       
00268       if(!(binx < 1) && !(biny < 1) && !(binx > nbinsx) && !(biny > nbinsy))
00269       {
00270          weight = fWeightHist[eptype] -> GetBinContent(binx, biny);
00271       }
00272       
00273       return weight;
00274    }
00275 
00276    else
00277    {
00278       return CalcWeight(ptype,pT,pz);
00279    }
00280    
00281 }

TH2D* LZfluk::GetWeightHistogram ( int  ptype  )  [inline]

Definition at line 60 of file LZfluk.h.

References fWeightHist, and GetParticleEnum().

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

void LZfluk::Init ( void   ) 

Definition at line 96 of file LZfluk.cxx.

References base, fMeanPT, fN, fNWeighted, Form(), fPlist, fPTXF, fWeightedMeanPT, fWeightedPTXF, fWeightHist, GetParticleName(), gSystem(), Msg::kDebug, Msg::kFatal, kK0L, kKMinus, kKPlus, kPiMinus, kPiPlus, MSG, and whichParameterization.

00097 {
00098    cout << "LZfluk::Init" << endl;
00099 
00100     std::string dir = "";
00101     TH1::AddDirectory(kFALSE);
00102    
00103   whichParameterization=0; //by default using SKZP parameterization
00104 
00105   // topDir is where the fluka05 pt-xf histogram file is
00106   std::string topDir=dir; // user may set location of input data
00107   if(topDir=="") { // by default, this code looks in a standard place
00108     topDir="MCReweight/data";
00109     std::string base="";
00110     base=getenv("SRT_PRIVATE_CONTEXT");
00111     if (base!="" && base!=".")
00112       {
00113         // check if directory exists in SRT_PRIVATE_CONTEXT
00114         std::string path = base + "/" + topDir;
00115         void *dir_ptr = gSystem -> OpenDirectory(path.c_str());
00116         if(!dir_ptr) base=getenv("SRT_PUBLIC_CONTEXT"); // if it doesn't exist then use SRT_PUBLIC_CONTEXT
00117         gSystem->FreeDirectory(dir_ptr);
00118       }
00119     else base=getenv("SRT_PUBLIC_CONTEXT");
00120     
00121     if(base=="") {
00122       MSG("MCReweight",Msg::kFatal)<<"No SRT_PUBLIC_CONTEXT set"<<std::endl;
00123       assert(false);
00124     }
00125     topDir = base+ "/" + topDir;
00126   }
00127 
00128   MSG("LZfluk",Msg::kDebug) <<"LZfluk reading data from: "<<topDir<<std::endl;
00129   std::string fileName =topDir+"/fluka05ptxf.root";
00130 
00131   TFile* hFile= 0;
00132 
00133   cout << "Opening ptxf file" << endl;
00134 
00135   hFile = new TFile(fileName.c_str());
00136 
00137   if(!hFile || !(hFile->IsOpen()))
00138   {
00139      hFile = new TFile("/minos/scratch/loiacono/Data/ForMonFit/fluka05ptxf.root", "READ");
00140      if(!hFile || !(hFile->IsOpen()))
00141      {
00142         cout << "Can't open /minos/scratch/loiacono/Data/ForMonFit/fluka05ptxf.root" << endl;
00143      }
00144   }
00145   
00146   fPlist.push_back(kPiPlus);
00147   fPlist.push_back(kPiMinus);
00148   fPlist.push_back(kKPlus);
00149   fPlist.push_back(kKMinus);
00150   fPlist.push_back(kK0L);
00151   
00152   for (std::vector<ParticleType_t>::iterator itPlist=fPlist.begin();itPlist!=fPlist.end(); itPlist++)
00153     {
00154       TH2F* hist=dynamic_cast <TH2F*> (hFile->Get(Form("hF05ptxf%s",GetParticleName(*itPlist).c_str()))->Clone());
00155       hist->SetDirectory(0);
00156       TH2F* hist2=dynamic_cast <TH2F*> (hist->Clone(Form("hWeightedPTXF%s",GetParticleName(*itPlist).c_str())));
00157       hist2->SetDirectory(0);
00158       hist2->SetTitle(Form("%s weighted pt-pz",GetParticleName(*itPlist).c_str()));
00159 
00160       //const int nbinsx = hist -> GetNbinsX();
00161       const int nbinsx = 120;
00162       const int nbinsy = hist -> GetNbinsY();
00163       //cout << "nbinsx = " << nbinsx << "nbinsy = " << nbinsy << endl;
00164       //
00165       //The bins need to be the same as the bins that the pt-pz plots for the horn current scans!!!!!!!!!!!!!!!!!!!!!!!
00166       //
00167       fWeightHist[*itPlist] = new TH2D(Form("hWeightedPTXF%s",GetParticleName(*itPlist).c_str()),GetParticleName(*itPlist).c_str(), nbinsx, 0, 120, nbinsy, 0, 1);
00168       for(int ibinx = 0; ibinx <= nbinsx+1; ++ibinx)
00169       {
00170          for(int ibiny = 0; ibiny <= nbinsy+1; ++ibiny)
00171          {
00172             //cout << "ibinx = " << ibinx << "ibiny = " << ibiny << endl;
00173             fWeightHist[*itPlist] -> SetBinContent(ibinx, ibiny, 1.0);
00174          }
00175       }
00176       fWeightHist[*itPlist]->SetDirectory(0);
00177 
00178       std::pair<LZfluk::ParticleType_t, TH2F* > p(*itPlist, hist);
00179       std::pair<LZfluk::ParticleType_t, TH2F* > p2(*itPlist, hist2);
00180       fPTXF.insert(p);
00181       fWeightedPTXF.insert(p2);
00182 
00183       fPTXF[*itPlist]->SetDirectory(0);
00184       fWeightedPTXF[*itPlist]->SetDirectory(0);
00185 
00186       fMeanPT[*itPlist]=fPTXF[*itPlist]->ProjectionY()->GetMean()*1000.;
00187       fWeightedMeanPT[*itPlist]=fWeightedPTXF[*itPlist]->ProjectionY()->GetMean()*1000.;
00188             
00189       double N=fPTXF[*itPlist]->ProjectionY()->GetSumOfWeights();
00190       double wN=fWeightedPTXF[*itPlist]->ProjectionY()->GetSumOfWeights();
00191 
00192       fN[*itPlist]=N;
00193       fNWeighted[*itPlist]=wN;
00194     }
00195   hFile->Close();
00196   delete hFile;
00197   hFile=0;
00198 }

void LZfluk::RecalculateWeights (  )  [private]

Definition at line 380 of file LZfluk.cxx.

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

Referenced by SetParameters().

00381 {
00382   
00383   for (std::vector<ParticleType_t>::iterator itPlist=fPlist.begin();
00384        itPlist!=fPlist.end(); itPlist++)
00385   {
00386      double xf,pt;
00387      double meanpt(0.);
00388      double sum(0.);
00389      const int nbinsx = fPTXF[*itPlist]->GetNbinsX();
00390      const int nbinsy = fPTXF[*itPlist]->GetNbinsY();
00391      for (int i=0;i<=nbinsx+1;i++)
00392      {
00393         for (int j=0;j<=nbinsy+1;j++)
00394         {
00395            xf=fPTXF[*itPlist]->GetXaxis()->GetBinCenter(i);
00396            pt=fPTXF[*itPlist]->GetYaxis()->GetBinCenter(j);
00397            double weight = CalcWeight(*itPlist,pt,xf);
00398            
00399            fWeightedPTXF[*itPlist]
00400               ->SetBinContent(i,j,(fPTXF[*itPlist]->GetBinContent(i,j)
00401                                    *weight));
00402 
00403            
00404            fWeightHist[*itPlist]->SetBinContent(i,j,weight);
00405            if(weight - fWeightHist[*itPlist]->GetBinContent(i,j) != 0)
00406            {
00407               LZfluk::ParticleType_t eptype= *itPlist;
00408               string name = GetParticleName(eptype);
00409               cout << "LZfluk::RecalculateWeights(): name = " << name << " pz = " << xf << " pt = " << pt
00410                    << " weight from calc = " << setprecision(10) << weight << " weight from hist = "
00411                    << fWeightHist[*itPlist]->GetBinContent(i,j)
00412                       << " diff = " << weight - fWeightHist[*itPlist]->GetBinContent(i,j) << endl;
00413            }
00414            
00415            //
00416            // Projection DOES include overflow bins
00417            // Get Mean DOES NOT
00418            //
00419            //need to include the overflow in y for sure in fWeightedPTXF
00420            //because it is used in the ratios below
00421            //but in meanpt we don't want to use this bin
00422            //I have checked that the fluka "signal" in i=nbinsx+1 is always 0
00423            //so it doesn't matter if this bin is included or not. I think the
00424            //proper thing is that is should be because the projection does
00425            //include it
00426            //
00427            if(j == nbinsy+1) continue;
00428            meanpt+=fWeightedPTXF[*itPlist]->GetBinContent(i,j)*pt;
00429            sum+=fWeightedPTXF[*itPlist]->GetBinContent(i,j);
00430            
00431 
00432         }
00433      }
00434      meanpt/=sum;
00435      fWeightedMeanPT[*itPlist]=meanpt*1000.; //GeV to MeV
00436      fNWeighted[*itPlist]=sum;
00437      meanpt=0.;
00438      sum=0.;
00439      
00440      
00441   }
00442 }

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

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

Definition at line 38 of file LZfluk.h.

References fPar, and RecalculateWeights().

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

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

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

Definition at line 63 of file LZfluk.h.

References whichParameterization.

00063                                                      {
00064       std::string temp=which;
00065       if (temp=="SKZP") whichParameterization=0;
00066       else whichParameterization=1;
00067    };


Member Data Documentation

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

Definition at line 92 of file LZfluk.h.

Referenced by GetMeanPT(), GetPTshift(), Init(), and ~LZfluk().

std::map<LZfluk::ParticleType_t, double > LZfluk::fN [private]

Definition at line 93 of file LZfluk.h.

Referenced by CalcWeight(), Init(), and ~LZfluk().

std::map<LZfluk::ParticleType_t, int > LZfluk::fNBinsX [private]

Definition at line 96 of file LZfluk.h.

Referenced by ~LZfluk().

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

Definition at line 96 of file LZfluk.h.

Referenced by ~LZfluk().

std::map<LZfluk::ParticleType_t, double > LZfluk::fNWeighted [private]

Definition at line 94 of file LZfluk.h.

Referenced by CalcWeight(), Init(), RecalculateWeights(), and ~LZfluk().

std::vector<double> LZfluk::fPar [private]

Definition at line 86 of file LZfluk.h.

Referenced by CalcWeight(), GetParameters(), SetParameters(), and ~LZfluk().

std::vector<ParticleType_t> LZfluk::fPlist [private]

Definition at line 87 of file LZfluk.h.

Referenced by Init(), RecalculateWeights(), and ~LZfluk().

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

Definition at line 89 of file LZfluk.h.

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

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

Definition at line 95 of file LZfluk.h.

Referenced by GetPTshift(), GetReweightedMeanPT(), Init(), RecalculateWeights(), and ~LZfluk().

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

Definition at line 90 of file LZfluk.h.

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

std::map<LZfluk::ParticleType_t, TH2D* > LZfluk::fWeightHist [private]

Definition at line 91 of file LZfluk.h.

Referenced by GetWeight(), GetWeightHistogram(), Init(), RecalculateWeights(), and ~LZfluk().

bool LZfluk::fWghtFromHist [private]

Definition at line 100 of file LZfluk.h.

Referenced by Config(), and GetWeight().

Definition at line 84 of file LZfluk.h.

Referenced by Init(), and UseParameterization().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1