Skip to content

Commit

Permalink
Changes concerning the cocktail simulations used for heavy flavour v2…
Browse files Browse the repository at this point in the history
… analyses.

The update does the following things:
PYTHIA6/AliDecayerPythia.cxx:
- enable J/Psi decays into electrons and gammas
EVGEN/*:
- use well defined pT and v2 spectra parametrizations for the pions
- implement KET scaling
- implement "forced decay" of gammas

Theodor Rascanu
  • Loading branch information
amorsch committed Feb 6, 2014
1 parent fcc9b52 commit 3cc34b0
Show file tree
Hide file tree
Showing 6 changed files with 771 additions and 163 deletions.
123 changes: 78 additions & 45 deletions EVGEN/AliGenEMCocktail.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

/* $Id: AliGenEMCocktail.cxx 40702 2010-04-26 13:09:52Z morsch $ */

// Class to create cocktails for physics with electrons, di-electrons,
// Class to create the cocktail for physics with electrons, di-electrons,
// and photons from the decay of the following sources:
// pizero, eta, rho, omega, etaprime, phi
// Kinematic distributions of the sources are taken from AliGenEMlib.
Expand All @@ -25,6 +25,7 @@
// or they are generated according to the pT distributions themselves
// (weighting mode: kAnalog)


#include <TObjArray.h>
#include <TParticle.h>
#include <TF1.h>
Expand All @@ -49,33 +50,38 @@ ClassImp(AliGenEMCocktail)

//________________________________________________________________________
AliGenEMCocktail::AliGenEMCocktail()
:AliGenCocktail(),
:AliGenCocktail(),
fDecayer(0),
fDecayMode(kAll),
fWeightingMode(kNonAnalog),
fNPart(1000),
fYieldArray()
fYieldArray(),
fPtSelect(0),
fCentrality(0),
fV2Systematic(0),
fForceConv(kFALSE),
fHeaviestParticle(kGENs)
{
// Constructor
// Constructor

}

//_________________________________________________________________________
AliGenEMCocktail::~AliGenEMCocktail()
{
// Destructor
// Destructor

}

//_________________________________________________________________________
void AliGenEMCocktail::CreateCocktail()
{
// create and add sources to the cocktail
// create and add sources to the cocktail

fDecayer->SetForceDecay(fDecayMode);
fDecayer->ForceDecay();

// Set kinematic limits
// Set kinematic limits
Double_t ptMin = fPtMin;
Double_t ptMax = fPtMax;
Double_t yMin = fYMin;;
Expand All @@ -85,80 +91,108 @@ void AliGenEMCocktail::CreateCocktail()
AliInfo(Form("Ranges pT:%4.1f : %4.1f GeV/c, y:%4.2f : %4.2f, Phi:%5.1f : %5.1f degres",ptMin,ptMax,yMin,yMax,phiMin,phiMax));
AliInfo(Form("the parametrised sources uses the decay mode %d",fDecayMode));

// Create and add electron sources to the generator
//Initialize user selection for Pt Parameterization and centrality:
AliGenEMlib::SelectParams(fPtSelect,fCentrality,fV2Systematic);

// Create and add electron sources to the generator

// pizero
AliGenParam * genpizero=0;
// pizero
AliGenParam *genpizero=0;
Char_t namePizero[10];
snprintf(namePizero,10, "Pizero");
snprintf(namePizero,10,"Pizero");
genpizero = new AliGenParam(fNPart, new AliGenEMlib(), AliGenEMlib::kPizero, "DUMMY");
AddSource2Generator(namePizero,genpizero);
TF1 *fPtPizero = genpizero->GetPt();
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,99,0)
fYieldArray[kGenPizero] = fPtPizero->Integral(fPtMin,fPtMax,1.e-6);
#else
fYieldArray[kGenPizero] = fPtPizero->Integral(fPtMin,fPtMax,(Double_t*)0,1.e-6);
fYieldArray[kGenPizero] = fPtPizero->Integral(fPtMin,fPtMax,(Double_t *)0,1.e-6);
#endif
// eta
AliGenParam * geneta=0;

// eta
if(fHeaviestParticle<kGenEta)return;
AliGenParam *geneta=0;
Char_t nameEta[10];
snprintf(nameEta,10, "Eta");
snprintf(nameEta,10,"Eta");
geneta = new AliGenParam(fNPart, new AliGenEMlib(), AliGenEMlib::kEta, "DUMMY");
AddSource2Generator(nameEta,geneta);
TF1 *fPtEta = geneta->GetPt();
#if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0)
fYieldArray[kGenEta] = fPtEta->Integral(fPtMin,fPtMax,(Double_t*)0,1.e-6);
#else
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,99,0)
fYieldArray[kGenEta] = fPtEta->Integral(fPtMin,fPtMax,1.e-6);
#else
fYieldArray[kGenEta] = fPtEta->Integral(fPtMin,fPtMax,(Double_t *)0,1.e-6);
#endif
// rho
AliGenParam * genrho=0;

// rho
if(fHeaviestParticle<kGenRho)return;
AliGenParam *genrho=0;
Char_t nameRho[10];
snprintf(nameRho,10, "Rho");
snprintf(nameRho,10,"Rho");
genrho = new AliGenParam(fNPart, new AliGenEMlib(), AliGenEMlib::kRho, "DUMMY");
AddSource2Generator(nameRho,genrho);
TF1 *fPtRho = genrho->GetPt();
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,99,0)
fYieldArray[kGenRho] = fPtRho->Integral(fPtMin,fPtMax,1.e-6);
#else
fYieldArray[kGenRho] = fPtRho->Integral(fPtMin,fPtMax,(Double_t*)0,1.e-6);
fYieldArray[kGenRho] = fPtRho->Integral(fPtMin,fPtMax,(Double_t *)0,1.e-6);
#endif
// omega
AliGenParam * genomega=0;

// omega
if(fHeaviestParticle<kGenOmega)return;
AliGenParam *genomega=0;
Char_t nameOmega[10];
snprintf(nameOmega,10, "Omega");
snprintf(nameOmega,10,"Omega");
genomega = new AliGenParam(fNPart, new AliGenEMlib(), AliGenEMlib::kOmega, "DUMMY");
AddSource2Generator(nameOmega,genomega);
TF1 *fPtOmega = genomega->GetPt();
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,99,0)
fYieldArray[kGenOmega] = fPtOmega->Integral(fPtMin,fPtMax,1.e-6);
#else
fYieldArray[kGenOmega] = fPtOmega->Integral(fPtMin,fPtMax,(double*)0,1.e-6);
fYieldArray[kGenOmega] = fPtOmega->Integral(fPtMin,fPtMax,(Double_t *)0,1.e-6);
#endif
// etaprime
AliGenParam * genetaprime=0;

// etaprime
if(fHeaviestParticle<kGenEtaprime)return;
AliGenParam *genetaprime=0;
Char_t nameEtaprime[10];
snprintf(nameEtaprime,10, "Etaprime");
snprintf(nameEtaprime,10,"Etaprime");
genetaprime = new AliGenParam(fNPart, new AliGenEMlib(), AliGenEMlib::kEtaprime, "DUMMY");
AddSource2Generator(nameEtaprime,genetaprime);
TF1 *fPtEtaprime = genetaprime->GetPt();
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,99,0)
fYieldArray[kGenEtaprime] = fPtEtaprime->Integral(fPtMin,fPtMax,1.e-6);
#else
fYieldArray[kGenEtaprime] = fPtEtaprime->Integral(fPtMin,fPtMax,(Double_t*)0,1.e-6);
fYieldArray[kGenEtaprime] = fPtEtaprime->Integral(fPtMin,fPtMax,(Double_t *)0,1.e-6);
#endif
// phi
AliGenParam * genphi=0;

// phi
if(fHeaviestParticle<kGenPhi)return;
AliGenParam *genphi=0;
Char_t namePhi[10];
snprintf(namePhi, 10, "Phi");
snprintf(namePhi,10,"Phi");
genphi = new AliGenParam(fNPart, new AliGenEMlib(), AliGenEMlib::kPhi, "DUMMY");
AddSource2Generator(namePhi,genphi);
TF1 *fPtPhi = genphi->GetPt();
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,99,0)
fYieldArray[kGenPhi] = fPtPhi->Integral(fPtMin,fPtMax,1.e-6);
#else
fYieldArray[kGenPhi] = fPtPhi->Integral(fPtMin,fPtMax,(Double_t*)0,1.e-6);
fYieldArray[kGenPhi] = fPtPhi->Integral(fPtMin,fPtMax,(Double_t *)0,1.e-6);
#endif

// jpsi
if(fHeaviestParticle<kGenJpsi)return;
AliGenParam *genjpsi=0;
Char_t nameJpsi[10];
snprintf(nameJpsi,10,"Jpsi");
genjpsi = new AliGenParam(fNPart, new AliGenEMlib(), AliGenEMlib::kJpsi, "DUMMY");
AddSource2Generator(nameJpsi,genjpsi);
TF1 *fPtJpsi = genjpsi->GetPt();
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,99,0)
fYieldArray[kGenJpsi] = fPtJpsi->Integral(fPtMin,fPtMax,1.e-6);
#else
fYieldArray[kGenJpsi] = fPtJpsi->Integral(fPtMin,fPtMax,(Double_t *)0,1.e-6);
#endif

}

//-------------------------------------------------------------------
Expand All @@ -173,6 +207,7 @@ void AliGenEMCocktail::AddSource2Generator(Char_t* nameSource,
genSource->SetYRange(fYMin, fYMax);
genSource->SetPhiRange(phiMin, phiMax);
genSource->SetWeighting(fWeightingMode);
genSource->SetForceGammaConversion(fForceConv);
if (!gMC) genSource->SetDecayer(fDecayer);
genSource->Init();

Expand All @@ -182,7 +217,7 @@ void AliGenEMCocktail::AddSource2Generator(Char_t* nameSource,
//-------------------------------------------------------------------
void AliGenEMCocktail::Init()
{
// Initialisation
// Initialisation
TIter next(fEntries);
AliGenCocktailEntry *entry;
if (fStack) {
Expand All @@ -195,7 +230,7 @@ void AliGenEMCocktail::Init()
//_________________________________________________________________________
void AliGenEMCocktail::Generate()
{
// Generate event
// Generate event
TIter next(fEntries);
AliGenCocktailEntry *entry = 0;
AliGenCocktailEntry *preventry = 0;
Expand All @@ -206,24 +241,23 @@ void AliGenEMCocktail::Generate()

const TObjArray *partArray = gAlice->GetMCApp()->Particles();

// Generate the vertex position used by all generators
// Generate the vertex position used by all generators
if(fVertexSmear == kPerEvent) Vertex();

//Reseting stack
//Reseting stack
AliRunLoader * runloader = AliRunLoader::Instance();
if (runloader)
if (runloader->Stack())
runloader->Stack()->Clean();

// Loop over generators and generate events
// Loop over generators and generate events
Int_t igen = 0;
Float_t evPlane;
Rndm(&evPlane,1);
evPlane*=TMath::Pi()*2;
while((entry = (AliGenCocktailEntry*)next())) {
gen = entry->Generator();
gen->SetVertex(fVertex.At(0), fVertex.At(1), fVertex.At(2));
gen->SetTime(fTime);

if (fNPart > 0) {
igen++;
Expand All @@ -238,7 +272,7 @@ void AliGenEMCocktail::Generate()
}
next.Reset();

// Setting weights for proper absolute normalization
// Setting weights for proper absolute normalization
Int_t iPart, iMother;
Int_t pdgMother = 0;
Double_t weight = 0.;
Expand Down Expand Up @@ -273,11 +307,13 @@ void AliGenEMCocktail::Generate()
case 333:
dNdy = fYieldArray[kGenPhi];
break;
case 443:
dNdy = fYieldArray[kGenJpsi];
break;

default:
dNdy = 0.;
}

weight = dNdy*part->GetWeight();
part->SetWeight(weight);
}
Expand All @@ -290,9 +326,6 @@ void AliGenEMCocktail::Generate()
for (Int_t j=0; j < 3; j++) eventVertex[j] = fVertex[j];

fHeader->SetPrimaryVertex(eventVertex);
fHeader->SetInteractionTime(fTime);

gAlice->SetGenEventHeader(fHeader);
}


36 changes: 25 additions & 11 deletions EVGEN/AliGenEMCocktail.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,61 @@
//

#include "AliGenCocktail.h"
#include "AliGenParam.h"
#include "AliDecayer.h"
#include "AliGenEMlib.h"
#include "AliPythia.h"
#include "AliDecayer.h"
#include "AliGenParam.h"


class AliGenCocktailEntry;

class AliGenEMCocktail : public AliGenCocktail
{
public:
public:

AliGenEMCocktail();
enum GeneratorCode { kGenPizero, kGenEta, kGenRho, kGenOmega, kGenEtaprime, kGenPhi, kGENs };
enum GeneratorCode { kGenPizero=0, kGenEta, kGenRho, kGenOmega, kGenEtaprime, kGenPhi, kGenJpsi, kGENs };

virtual ~AliGenEMCocktail();
virtual void Init();
virtual void CreateCocktail();
virtual void Generate();
Float_t GetDecayMode() const {return fDecayMode;}
Float_t GetWeightingMode() const {return fWeightingMode;}

void SetDecayer(AliDecayer* const decayer){fDecayer = decayer;}
void SetDecayMode(Decay_t decay){ fDecayMode = decay;}
void SetWeightingMode(Weighting_t weight){ fWeightingMode = weight;}
void SetNPart(Int_t npart){ fNPart = npart;}
void SetNPart(Int_t npart){ fNPart = npart; }
void SetPtParam(Int_t PtSelect){ fPtSelect = PtSelect; }
void SetCentrality(Int_t cent){ fCentrality = cent; }
void SetV2Systematic(Int_t v2sys){ fV2Systematic = v2sys; }
void SetForceGammaConversion(Bool_t force=kTRUE){ fForceConv=force; }
void SetHeaviestParticle(Int_t part){ fHeaviestParticle=part; }

protected:
protected:

//
private:
TVector3& OrthogonalVector(TVector3 &inVec);

private:
AliGenEMCocktail(const AliGenEMCocktail &cocktail);
AliGenEMCocktail & operator=(const AliGenEMCocktail &cocktail);

void AddSource2Generator(Char_t *nameReso, AliGenParam* const genReso);

AliDecayer* fDecayer; // External decayer
Decay_t fDecayMode; // decay mode in which resonances are forced to decay, default: kAll
Weighting_t fWeightingMode; // weighting mode: kAnalog or kNonAnalog
Decay_t fDecayMode; //decay mode in which resonances are forced to decay, default: kAll
Weighting_t fWeightingMode; //weighting mode: kAnalog or kNonAnalog

Int_t fNPart; // multiplicity of each source per event
Double_t fYieldArray[kGENs]; // array of dN/dy for each source

Int_t fPtSelect; // selected pT parameterization
Int_t fCentrality; // selected centrality
Int_t fV2Systematic; //selected systematic error for v2 parameters

Bool_t fForceConv; //select whether you want to force all gammas to convert imidediately
Int_t fHeaviestParticle; //select up to which particle to simulate

ClassDef(AliGenEMCocktail,1) // cocktail for EM physics
};

Expand Down
Loading

0 comments on commit 3cc34b0

Please sign in to comment.