LCOV - code coverage report
Current view: top level - EVGEN - AliGenITSULib.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 47 2.1 %
Date: 2016-06-14 17:26:59 Functions: 1 6 16.7 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : 
      17             : // Library class for particle pt and y distributions used for 
      18             : // ITS Upgrade related signal simulations.
      19             : //
      20             : // Author: Annalisa Mastroserio <Annalisa.Mastroserio@cern.ch>
      21             : //
      22             : 
      23             : #include <TPDGCode.h>
      24             : #include <TMath.h>
      25             : #include <TRandom.h>
      26             : #include <TString.h>
      27             : 
      28             : #include "AliGenITSULib.h"
      29             : #include "AliLog.h"
      30             : 
      31           6 : ClassImp(AliGenITSULib)
      32             : 
      33             :  typedef Double_t (*GenFunc)   (const Double_t*,  const Double_t*);
      34             :  typedef Int_t    (*GenFuncIp) (TRandom *);
      35             : 
      36             : 
      37             : Double_t AliGenITSULib::PtLcDist( const Double_t *x, const Double_t *)
      38             : {
      39             :  //     pt-distribution
      40             :  // same shape as the Lb pt distribution for high pt were overestimated. The Lb fitting funcion has been
      41             :  // used from 3.5 GeV/c on. At smaller Pt, the shape is likely as  sqrt(x)*exp(-x) 
      42             :  Double_t par[6]={2.781336,1.353902,4.634330,(145479448.743187/202262270.892062),1.789479,-1.329143}; 
      43             :  Double_t y=0;
      44           0 :  if(x[0]<3.5) y= par[3]*(TMath::Power(x[0],par[4]))*TMath::Exp(x[0]*par[5]);
      45           0 :  else y= x[0]/TMath::Power((1+TMath::Power(x[0]/par[0],par[1])),par[2]);
      46           0 :  return y;
      47             : }
      48             : 
      49             : 
      50             : Double_t AliGenITSULib::PtLbDist( const Double_t *x, const Double_t *)
      51             : {
      52             :  //     pt-distribution (fitted in 0-30 GeV/c)
      53             :  Double_t par[4]={3.42500e-03,6.18902,1.76908,3.24823};
      54           0 :  return par[0]*x[0]/TMath::Power((1+TMath::Power(x[0]/par[1],par[2])),par[3]);
      55             : }
      56             : 
      57             : GenFunc AliGenITSULib::GetPt(Int_t iPID, const char * sForm) const
      58             : {
      59             :  // Return pointer to Pt parameterisation
      60           0 :  AliDebug(1,Form("PID: %i, form: %s \n",iPID,sForm)); 
      61           0 :  TString type(sForm);
      62             :  GenFunc func;
      63             : 
      64           0 :  if(type=="FLAT") {
      65             :   func=PtFlat;
      66           0 :  } else if(type=="DIST") {
      67             : 
      68           0 :   switch(TMath::Abs(iPID)) {
      69             : 
      70           0 :    case kLb    :    func=PtLbDist; break;  
      71           0 :    case kLc    :    func=PtLcDist; break;  
      72           0 :    case kXi_c  :    func=PtLcDist; break;
      73           0 :    case kBplus :    func=PtLbDist; break;
      74           0 :    case kBzero :    func=PtLbDist; break;
      75           0 :    case kDs    :    func=PtLcDist; break;
      76           0 :    case kDplus :    func=PtLcDist; break;
      77           0 :    default : AliError(Form("Unknown particle type: %i, Pt dist is 0",iPID));      func=0;
      78           0 :   } 
      79             :  }else {
      80           0 :   AliError(Form("Unknown Pt distribution %s. Pt distribution is set to 0 ",sForm));
      81             :   func=0;
      82             :  }
      83             : 
      84             :  return func;
      85           0 : }
      86             : 
      87             : GenFunc AliGenITSULib::GetY(Int_t iPID, const char *sForm) const
      88             : {
      89             :  GenFunc func;
      90             : 
      91           0 :  if(TMath::Abs(iPID) != kLc && TMath::Abs(iPID) != kLb && TMath::Abs(iPID) != kXi_c && TMath::Abs(iPID) != kBplus && TMath::Abs(iPID) != kBzero && TMath::Abs(iPID)!=kDplus && TMath::Abs(iPID)!=kDs) {
      92           0 :   AliError(Form("Unknown PID: %i, form: %s, returning 0",iPID,sForm));   //////////   
      93             :   func=0;
      94           0 :  } else { 
      95             :   func = YFlat;
      96             :  }
      97           0 :  return func;
      98             : }
      99             : 
     100             : GenFuncIp AliGenITSULib::GetIp(Int_t iPID, const char *sForm) const
     101             : {
     102           0 :  AliDebug(1,Form(" %i - %s",iPID,sForm));
     103             :  // Return pointer to particle type parameterisation
     104             :  GenFuncIp id;
     105             : 
     106           0 :  if(TMath::Abs(iPID) != kLc && TMath::Abs(iPID) != kLb && TMath::Abs(iPID) != kXi_c && TMath::Abs(iPID) != kBplus && TMath::Abs(iPID) != kBzero && TMath::Abs(iPID)!=kDplus && TMath::Abs(iPID)!=kDs) {
     107           0 :   AliError(Form("Unknown PID: %i, form: %s, return 0",iPID,sForm));   //////////      
     108             :   id = 0;
     109           0 :  } else {
     110           0 :   switch (iPID){
     111           0 :    case kLc    :                                  return id=IpLcPlus;
     112           0 :    case -kLc   :                                  return id=IpLcMinus;
     113           0 :    case kLb    :                                  return id=IpLb;
     114           0 :    case -kLb   :                                  return id=IpLbBar;
     115           0 :    case kXi_c  :                                  return id=IpXic;
     116           0 :    case -kXi_c :                                  return id=IpXicBar;
     117           0 :    case kBplus :                                  return id=IpBPlus;
     118           0 :    case kBzero :                                  return id=IpB0;
     119           0 :    case -kBzero:                                  return id=IpB0Bar;
     120           0 :    case -kBplus:                                  return id=IpBMinus;
     121           0 :    case kDs    :                                  return id=IpDsPlus;
     122           0 :    case -kDs   :                                  return id=IpDsMinus;
     123           0 :    case kDplus :                                  return id=IpDPlus;
     124           0 :    case -kDplus:                                  return id=IpDMinus;
     125           0 :    default  : AliFatal(Form("Unknown particle type: %i",iPID));  id=0;
     126             :   }
     127             : 
     128             :  }
     129             : 
     130           0 :  return id;
     131           0 : }

Generated by: LCOV version 1.11