1 /*************************************************************************
2 * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 // ---------------------------------------------------
17 // MC event level cuts for azimuthal isotropic
18 // expansion in highly central collisions analysis
19 // author: Cristian ANDREI
20 // acristian@niham.nipne.ro
21 // ----------------------------------------------------
24 #include <TParticle.h>
26 #include "AliMCEvent.h"
29 #include "AliAnalysisCentralCutEvtMC.h"
34 //____________________________________________________________________
35 ClassImp(AliAnalysisCentralCutEvtMC)
37 //____________________________________________________________________
38 AliAnalysisCentralCutEvtMC::AliAnalysisCentralCutEvtMC(const Char_t* name, const Char_t* title)
39 :AliAnalysisCuts(name,title)
55 AliAnalysisCentralCutEvtMC::~AliAnalysisCentralCutEvtMC(){
60 //___________________________________________________________________________
61 Bool_t AliAnalysisCentralCutEvtMC::IsSelected(TObject *obj){
62 // Checks whether the event passes the cuts
65 printf("Pointer to MC Event is null! \n");
69 AliMCEvent *mcEvent = dynamic_cast<AliMCEvent*> (obj);
71 printf("AliAnalysisCentralCutEvtMC -> Can't get MCEvt!\n");
77 Int_t mult = CalcMult(mcEvent);
78 if((mult<fMultMin)||(mult>fMultMax)){
84 Double_t dir = CalcDir(mcEvent);
85 if((dir<fDirMin)||(dir>fDirMax)){
91 Double_t dirU = CalcDirUnit(mcEvent);
92 if((dirU<fDirUMin)||(dirU>fDirUMax)){
100 //___________________________________________________________________________
101 Int_t AliAnalysisCentralCutEvtMC::CalcMult(AliMCEvent* const mcEvent) {
102 // Computes the multiplicity of the event
104 AliStack *stack=mcEvent->Stack();
105 if(!stack) return -1;
107 Int_t nPrim = stack->GetNprimary();
112 for(Int_t i = 0; i < nPrim; i++){//track loop -> compute multiplicity
114 TParticle *particle=stack->Particle(i);
119 eta = particle->Eta();
121 if((eta > 0.5)||(eta < -0.5)){ //------------mid-rapidity
125 TParticlePDG *particlePDG = particle->GetPDG(0);
130 if(TMath::Abs(particlePDG->Charge()) < 3){
142 //____________________________________________________________________________
143 Double_t AliAnalysisCentralCutEvtMC::CalcDir(AliMCEvent* const mcEvent) {
144 // computes the directivity of the event
146 AliStack *stack=mcEvent->Stack();
147 if(!stack) return -1;
149 Int_t nPrim = stack->GetNprimary();
162 for(Int_t i = 0; i < nPrim; i++){//track loop -> compute directivity
164 TParticle *particle=stack->Particle(i);
169 eta = particle->Eta();
171 if((eta > 1.9)||(eta < 0.0)){ // half of the SPD coverage -> directivity
175 TParticlePDG *particlePDG = particle->GetPDG(0);
180 if(TMath::Abs(particlePDG->Charge()) < 3){
189 sumaPx = sumaPx + px;
190 sumaPy = sumaPy + py;
192 sumaPt = sumaPt + pt;
199 if(sumaPt < 0.0000001){
203 dir = (sqrt(pow(sumaPx,2)+pow(sumaPy,2)))/sumaPt;
208 //__________________________________________________________________
209 Double_t AliAnalysisCentralCutEvtMC::CalcDirUnit(AliMCEvent* const mcEvent) {
210 // computes the directivity using only the SPD unity vectors
212 AliStack *stack=mcEvent->Stack();
217 Int_t nPrim = stack->GetNprimary();
225 Double_t px,py,pxU,pyU;
226 Double_t sumaPxU = 0;
227 Double_t sumaPyU = 0;
230 for(Int_t i = 0; i < nPrim; i++){//track loop -> compute directivity
232 TParticle *particle=stack->Particle(i);
237 eta = particle->Eta();
239 if((eta > 1.9)||(eta < 0.0)){ // half of the SPD coverage -> directivity
243 TParticlePDG *particlePDG = particle->GetPDG(0);
248 if(TMath::Abs(particlePDG->Charge()) < 3){
259 sumaPxU = sumaPxU + pxU;
260 sumaPyU = sumaPyU + pyU;
270 dirU = (sqrt(pow(sumaPxU,2)+pow(sumaPyU,2)))/goodtrack;