TPCRUtilFcns Namespace Reference


Functions

Double_t dEdxFitFcn (Double_t *x, Double_t *par)
Double_t BBlochE910 (Double_t *x, Double_t *par)
Double_t LogBBlochE910 (Double_t *x, Double_t *par)
Double_t EleBBlochE910 (Double_t *x, Double_t *par)
Double_t LogEleBBlochE910 (Double_t *x, Double_t *par)
Double_t BBlochRaw (Double_t *x, Double_t *par)
Double_t EleBBlochRaw (Double_t *x, Double_t *par)
Double_t OnedEdxFcn (Double_t *x, Double_t *par)
void MakeItPretty (TF1 *fitfcn, double hmax)
Double_t dEdxResFcn (Double_t *x, Double_t *par)


Function Documentation

Double_t TPCRUtilFcns::dEdxFitFcn ( Double_t *  x,
Double_t *  par 
)

Definition at line 364 of file TPCRUtils.cxx.

Referenced by TPCRdEdxCalib::DoFits(), and main().

00364                                                             {
00365 
00366   Double_t piY = par[0];
00367   Double_t piC = par[1];
00368 
00369   Double_t elY = par[2];
00370   Double_t elC = par[3];
00371 
00372   Double_t kaY = par[4];
00373   Double_t kaC = par[5];
00374 
00375   Double_t proY = par[6];
00376   Double_t proC = par[7];
00377 
00378   Double_t deuY = par[8];
00379   Double_t deuC = par[9];
00380 
00381   Double_t sig = par[10];
00382 
00383   Double_t pion = piY*exp(-0.5*pow(x[0]-piC,2)/(sig*sig*piC*piC) );
00384   Double_t electron = elY*exp(-0.5*pow(x[0]-elC,2)/(sig*sig*elC*elC) );
00385   Double_t kaon = kaY*exp(-0.5*pow(x[0]-kaC,2)/(sig*sig*kaC*kaC) );
00386   Double_t proton = proY*exp(-0.5*pow(x[0]-proC,2)/(sig*sig*proC*proC) );
00387   Double_t deuteron = deuY*exp(-0.5*pow(x[0]-deuC,2)/(sig*sig*deuC*deuC) );
00388 
00389   return pion+electron+kaon+proton+deuteron;
00390 
00391 }

Double_t TPCRUtilFcns::BBlochE910 ( Double_t *  x,
Double_t *  par 
)

Definition at line 400 of file TPCRUtils.cxx.

References A, p, and Z.

Referenced by LogBBlochE910(), and TPCRUtils::Reset().

00400                                                             {
00401 
00402   Double_t Z = 1.; //for now only consider Z = 1
00403   Double_t me = 0.000511; //electron mass
00404 
00405   Double_t mass = par[0];
00406   Double_t p = x[0];
00407   Double_t bg = p/mass;
00408 
00409   Double_t beta = sqrt(bg*bg/(1+bg*bg));
00410   Double_t beta2 = beta*beta;
00411   if(beta > 1.) 
00412     std::cout << "Houston, we have a problem.  Velocity exceeds the speed of light." << std::endl;
00413   Double_t gamma = sqrt(1/(1-beta2));
00414 
00415   Double_t A = par[1];
00416   Double_t B = par[2];
00417   Double_t C = par[3];
00418   Double_t D = par[4];
00419   Double_t fmax = par[5];
00420 
00421   Double_t Tmax = (2*me*bg*bg)/(1 + 2*gamma*me/mass + pow(me/mass,2));
00422 
00423   Double_t dedx0 = (A*Z*Z/beta2)*(0.5*log(Tmax) + C*log(bg) - beta2 + B);
00424   Double_t dedx1 = pow(dedx0,D);
00425 
00426   return (fmax*dedx1/(fmax + dedx1));
00427 
00428 }

Double_t TPCRUtilFcns::LogBBlochE910 ( Double_t *  x,
Double_t *  par 
)

Definition at line 432 of file TPCRUtils.cxx.

References BBlochE910().

Referenced by main().

00432                                                                {
00433   Double_t ex = pow(10,x[0]);
00434 
00435   return log10(BBlochE910(&ex, par));
00436 }

Double_t TPCRUtilFcns::EleBBlochE910 ( Double_t *  x,
Double_t *  par 
)

Definition at line 446 of file TPCRUtils.cxx.

References A, and p.

Referenced by LogEleBBlochE910(), and TPCRUtils::Reset().

00446                                                                {
00447 
00448   Double_t p = x[0];
00449 
00450   Double_t A = par[0];
00451   Double_t B = par[1];
00452   Double_t C = par[2];
00453   Double_t D = par[3];
00454 
00455   if(log(p) <= D) return (A*log(p) + B -C*pow(D-log(p),3) );
00456   else return (A*log(p) + B);
00457 
00458 }

Double_t TPCRUtilFcns::LogEleBBlochE910 ( Double_t *  x,
Double_t *  par 
)

Definition at line 462 of file TPCRUtils.cxx.

References EleBBlochE910().

Referenced by main().

00462                                                                   {
00463   Double_t ex = pow(10,x[0]);
00464 
00465   return log10(EleBBlochE910(&ex, par));
00466 }

Double_t TPCRUtilFcns::BBlochRaw ( Double_t *  x,
Double_t *  par 
)

Definition at line 480 of file TPCRUtils.cxx.

References A, p, and Z.

Referenced by TPCRdEdxCalib::DoFits(), and main().

00480                                                            {
00481 
00482   Double_t Z = 1.; //for now only consider Z = 1
00483 
00484   Double_t mass = par[0];
00485   Double_t p = x[0];
00486   Double_t bg = p/mass;
00487 
00488   Double_t beta = sqrt(bg*bg/(1+bg*bg));
00489   Double_t beta2 = beta*beta;
00490 
00491   Double_t A = par[1];
00492   Double_t B = par[2];
00493   Double_t C = par[3];
00494   Double_t D = par[4];
00495   Double_t fmax = par[5];
00496 
00497   Double_t dedx0 = (A*Z*Z/beta2)*(C*log(bg) - beta2 + B);
00498   Double_t dedx1 = pow(dedx0,D);
00499 
00500   return (fmax*dedx1/(fmax + dedx1)/0.5);
00501 
00502 }

Double_t TPCRUtilFcns::EleBBlochRaw ( Double_t *  x,
Double_t *  par 
)

Definition at line 513 of file TPCRUtils.cxx.

References A, and p.

Referenced by TPCRdEdxCalib::DoFits(), and main().

00513                                                               {
00514 
00515   Double_t p = x[0];
00516 
00517   Double_t A = par[0];
00518   Double_t B = par[1];
00519   Double_t C = par[2];
00520   Double_t D = par[3];
00521 
00522   if(log(p) <= D) return (A*log(p)-C*pow(D-log(p),3) )/0.5;
00523   else return (A*log(p) + B)/0.5;
00524 
00525 }

Double_t TPCRUtilFcns::OnedEdxFcn ( Double_t *  x,
Double_t *  par 
)

Definition at line 531 of file TPCRUtils.cxx.

Referenced by MakeItPretty().

00531                                                             {
00532 
00533   Double_t piY = par[0];
00534   Double_t piC = par[1];
00535   Double_t piS = par[2];
00536 
00537   return piY*exp(-0.5*pow(x[0]-piC,2)/(piS*piS*piC*piC) );
00538 
00539 }

void TPCRUtilFcns::MakeItPretty ( TF1 *  fitfcn,
double  hmax 
)

Definition at line 545 of file TPCRUtils.cxx.

References OnedEdxFcn().

00545                                                         {
00546 
00547   TF1* pion = new TF1("piongaus",TPCRUtilFcns::OnedEdxFcn,2,4.5,3);
00548   pion->SetParameters(fitfcn->GetParameter(0), fitfcn->GetParameter(1),fitfcn->GetParameter(10));
00549   pion->SetLineColor(2);
00550   pion->SetLineWidth(1);
00551   pion->Draw("same");
00552   TLine* piline = new TLine(fitfcn->GetParameter(1),0.,fitfcn->GetParameter(1),hmax);
00553   piline->SetLineColor(2);
00554   piline->Draw();
00555   TLatex* pitext = new TLatex(0.8,0.8,"#pi");
00556   pitext->SetNDC();
00557   pitext->SetTextColor(2);
00558   pitext->Draw();
00559 
00560   TF1* ele = new TF1("elegaus",TPCRUtilFcns::OnedEdxFcn,2,4.5,3);
00561   ele->SetParameters(fitfcn->GetParameter(2), fitfcn->GetParameter(3),fitfcn->GetParameter(10));
00562   ele->SetLineColor(6);
00563   ele->SetLineWidth(1);
00564   ele->Draw("same");
00565   TLine* eline = new TLine(fitfcn->GetParameter(3),0.,fitfcn->GetParameter(3),hmax);
00566   eline->SetLineColor(6);
00567   eline->Draw();
00568   TLatex* etext = new TLatex(0.8,0.75,"e");
00569   etext->SetNDC();
00570   etext->SetTextColor(6);
00571   etext->Draw();
00572 
00573   TF1* kaon = new TF1("kaongaus",TPCRUtilFcns::OnedEdxFcn,2,4.5,3);
00574   kaon->SetParameters(fitfcn->GetParameter(4), fitfcn->GetParameter(5),fitfcn->GetParameter(10));
00575   kaon->SetLineColor(3);
00576   kaon->SetLineWidth(1);
00577   kaon->Draw("same");
00578   TLine* kline = new TLine(fitfcn->GetParameter(5),0.,fitfcn->GetParameter(5),hmax);
00579   kline->SetLineColor(3);
00580   kline->Draw();
00581   TLatex* ktext = new TLatex(0.8,0.7,"K");
00582   ktext->SetNDC();
00583   ktext->SetTextColor(3);
00584   ktext->Draw();
00585 
00586   TF1* proton = new TF1("protongaus",TPCRUtilFcns::OnedEdxFcn,2,4.5,3);
00587   proton->SetParameters(fitfcn->GetParameter(6), fitfcn->GetParameter(7),fitfcn->GetParameter(10));
00588   proton->SetLineColor(4);
00589   proton->SetLineWidth(1);
00590   proton->Draw("same");
00591   TLine* pline = new TLine(fitfcn->GetParameter(7),0.,fitfcn->GetParameter(7),hmax);
00592   pline->SetLineColor(4);
00593   pline->Draw();
00594   TLatex* ptext = new TLatex(0.8,0.65,"p");
00595   ptext->SetNDC();
00596   ptext->SetTextColor(4);
00597   ptext->Draw();
00598 
00599   TF1* deuteron = new TF1("deuterongaus",TPCRUtilFcns::OnedEdxFcn,2,4.5,3);
00600   deuteron->SetParameters(fitfcn->GetParameter(8), fitfcn->GetParameter(9),fitfcn->GetParameter(10));
00601   deuteron->SetLineColor(7);
00602   deuteron->SetLineWidth(1);
00603   deuteron->Draw("same");
00604   TLine* dline = new TLine(fitfcn->GetParameter(9),0.,fitfcn->GetParameter(9),hmax);
00605   dline->SetLineColor(7);
00606   dline->Draw();
00607   TLatex* dtext = new TLatex(0.8,0.6,"d");
00608   dtext->SetNDC();
00609   dtext->SetTextColor(7);
00610   dtext->Draw();
00611 
00612 }

Double_t TPCRUtilFcns::dEdxResFcn ( Double_t *  x,
Double_t *  par 
)

Definition at line 616 of file TPCRUtils.cxx.

References A, and nhits.

Referenced by TPCRUtils::Reset().

00616                                                             {
00617 
00618   Double_t nhits = x[0];
00619 
00620   Double_t A = par[0];
00621   Double_t B = par[1];
00622 
00623   return A*pow(nhits,B);
00624 
00625 }


Generated on Mon Nov 23 08:05:26 2009 for MIPP(E907) by  doxygen 1.4.7