1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 ////////////////////////////////////////////////////////////////////////////////
18 // Glauber MC implementation
20 // origin: PHOBOS experiment
21 // alification: Mikolaj Krzewicki, Nikhef, mikolaj.krzewicki@cern.ch
22 // update: You Zhou, Nikhef, yzhou@nikhef.nl
23 ////////////////////////////////////////////////////////////////////////////////
25 #include <Riostream.h>
30 #include <TObjArray.h>
36 #include "AliGlauberNucleon.h"
37 #include "AliGlauberNucleus.h"
38 #include "AliGlauberMC.h"
41 ClassImp(AliGlauberMC)
43 //______________________________________________________________________________
44 AliGlauberMC::AliGlauberMC(Option_t* NA, Option_t* NB, Double_t xsect) :
126 fMeanr2Cos2PhiColl(0),
127 fMeanr2Sin2PhiColl(0),
128 fMeanr2Cos3PhiColl(0),
129 fMeanr2Sin3PhiColl(0),
130 fMeanr2Cos4PhiColl(0),
131 fMeanr2Sin4PhiColl(0),
132 fMeanr2Cos5PhiColl(0),
133 fMeanr2Sin5PhiColl(0),
134 fMeanr3Cos3PhiColl(0),
135 fMeanr3Sin3PhiColl(0),
136 fMeanr4Cos4PhiColl(0),
137 fMeanr4Sin4PhiColl(0),
138 fMeanr5Cos5PhiColl(0),
139 fMeanr5Sin5PhiColl(0),
144 fMeanr2Cos2PhiCom(0),
145 fMeanr2Sin2PhiCom(0),
146 fMeanr2Cos3PhiCom(0),
147 fMeanr2Sin3PhiCom(0),
148 fMeanr2Cos4PhiCom(0),
149 fMeanr2Sin4PhiCom(0),
150 fMeanr2Cos5PhiCom(0),
151 fMeanr2Sin5PhiCom(0),
152 fMeanr3Cos3PhiCom(0),
153 fMeanr3Sin3PhiCom(0),
154 fMeanr4Cos4PhiCom(0),
155 fMeanr4Sin4PhiCom(0),
156 fMeanr5Cos5PhiCom(0),
157 fMeanr5Sin5PhiCom(0),
178 for (UInt_t i=0; i<(sizeof(fdNdEtaParam)/sizeof(fdNdEtaParam[0])); i++)
183 SetName(Form("Glauber_%s_%s",fANucleus.GetName(),fBNucleus.GetName()));
184 SetTitle(Form("Glauber %s+%s Version",fANucleus.GetName(),fBNucleus.GetName()));
187 //______________________________________________________________________________
188 AliGlauberMC::~AliGlauberMC()
194 //______________________________________________________________________________
195 AliGlauberMC::AliGlauberMC(const AliGlauberMC& in):
197 fANucleus(in.fANucleus),
198 fBNucleus(in.fBNucleus),
200 fNucleonsA(in.fNucleonsA),
201 fNucleonsB(in.fNucleonsB),
210 fMeanX2Parts(in.fMeanX2Parts),
211 fMeanY2Parts(in.fMeanY2Parts),
212 fMeanXYParts(in.fMeanXYParts),
213 fMeanXParts(in.fMeanXParts),
214 fMeanYParts(in.fMeanYParts),
215 fMeanOXParts(in.fMeanOXParts),
216 fMeanOYParts(in.fMeanOYParts),
217 fMeanXColl(in.fMeanXColl),
218 fMeanYColl(in.fMeanYColl),
219 fMeanOXColl(in.fMeanOXColl),
220 fMeanOYColl(in.fMeanOYColl),
221 fMeanX2Coll(in.fMeanX2Coll),
222 fMeanY2Coll(in.fMeanY2Coll),
223 fMeanXYColl(in.fMeanXYColl),
224 fMeanXCom(in.fMeanXCom),
225 fMeanYCom(in.fMeanYCom),
226 fMeanOXCom(in.fMeanOXCom),
227 fMeanOYCom(in.fMeanOYCom),
228 fMeanX2Com(in.fMeanX2Com),
229 fMeanY2Com(in.fMeanY2Com),
230 fMeanXYCom(in.fMeanXYCom),
231 fMeanXSystem(in.fMeanXSystem),
232 fMeanYSystem(in.fMeanYSystem),
237 fMeanOXA(in.fMeanOXA),
238 fMeanOYA(in.fMeanOYA),
239 fMeanOXB(in.fMeanOXB),
240 fMeanOYB(in.fMeanOYB),
243 fTotalEvents(in.fTotalEvents),
246 fMultType(in.fMultType),
247 fMaxNpartFound(in.fMaxNpartFound),
258 fMeanr2Cos2Phi(in.fMeanr2Cos2Phi),
259 fMeanr2Sin2Phi(in.fMeanr2Sin2Phi),
260 fMeanr2Cos3Phi(in.fMeanr2Cos3Phi),
261 fMeanr2Sin3Phi(in.fMeanr2Sin3Phi),
262 fMeanr2Cos4Phi(in.fMeanr2Cos4Phi),
263 fMeanr2Sin4Phi(in.fMeanr2Sin4Phi),
264 fMeanr2Cos5Phi(in.fMeanr2Cos5Phi),
265 fMeanr2Sin5Phi(in.fMeanr2Sin5Phi),
266 fMeanr3Cos3Phi(in.fMeanr3Cos3Phi),
267 fMeanr3Sin3Phi(in.fMeanr3Sin3Phi),
268 fMeanr4Cos4Phi(in.fMeanr4Cos4Phi),
269 fMeanr4Sin4Phi(in.fMeanr4Sin4Phi),
270 fMeanr5Cos5Phi(in.fMeanr5Cos5Phi),
271 fMeanr5Sin5Phi(in.fMeanr5Sin5Phi),
272 fMeanr2Coll(in.fMeanr2Coll),
273 fMeanr3Coll(in.fMeanr3Coll),
274 fMeanr4Coll(in.fMeanr4Coll),
275 fMeanr5Coll(in.fMeanr5Coll),
276 fMeanr2Cos2PhiColl(in.fMeanr2Cos2PhiColl),
277 fMeanr2Sin2PhiColl(in.fMeanr2Sin2PhiColl),
278 fMeanr2Cos3PhiColl(in.fMeanr2Cos3PhiColl),
279 fMeanr2Sin3PhiColl(in.fMeanr2Sin3PhiColl),
280 fMeanr2Cos4PhiColl(in.fMeanr2Cos4PhiColl),
281 fMeanr2Sin4PhiColl(in.fMeanr2Sin4PhiColl),
282 fMeanr2Cos5PhiColl(in.fMeanr2Cos5PhiColl),
283 fMeanr2Sin5PhiColl(in.fMeanr2Sin5PhiColl),
284 fMeanr3Cos3PhiColl(in.fMeanr3Cos3PhiColl),
285 fMeanr3Sin3PhiColl(in.fMeanr3Sin3PhiColl),
286 fMeanr4Cos4PhiColl(in.fMeanr4Cos4PhiColl),
287 fMeanr4Sin4PhiColl(in.fMeanr4Sin4PhiColl),
288 fMeanr5Cos5PhiColl(in.fMeanr5Cos5PhiColl),
289 fMeanr5Sin5PhiColl(in.fMeanr5Sin5PhiColl),
290 fMeanr2Com(in.fMeanr2Com),
291 fMeanr3Com(in.fMeanr3Com),
292 fMeanr4Com(in.fMeanr4Com),
293 fMeanr5Com(in.fMeanr5Com),
294 fMeanr2Cos2PhiCom(in.fMeanr2Cos2PhiCom),
295 fMeanr2Sin2PhiCom(in.fMeanr2Sin2PhiCom),
296 fMeanr2Cos3PhiCom(in.fMeanr2Cos3PhiCom),
297 fMeanr2Sin3PhiCom(in.fMeanr2Sin3PhiCom),
298 fMeanr2Cos4PhiCom(in.fMeanr2Cos4PhiCom),
299 fMeanr2Sin4PhiCom(in.fMeanr2Sin4PhiCom),
300 fMeanr2Cos5PhiCom(in.fMeanr2Cos5PhiCom),
301 fMeanr2Sin5PhiCom(in.fMeanr2Sin5PhiCom),
302 fMeanr3Cos3PhiCom(in.fMeanr3Cos3PhiCom),
303 fMeanr3Sin3PhiCom(in.fMeanr3Sin3PhiCom),
304 fMeanr4Cos4PhiCom(in.fMeanr4Cos4PhiCom),
305 fMeanr4Sin4PhiCom(in.fMeanr4Sin4PhiCom),
306 fMeanr5Cos5PhiCom(in.fMeanr5Cos5PhiCom),
307 fMeanr5Sin5PhiCom(in.fMeanr5Sin5PhiCom),
308 fSx2Parts(in.fSx2Parts),
309 fSy2Parts(in.fSy2Parts),
310 fSxyParts(in.fSxyParts),
311 fSx2Coll(in.fSx2Coll),
312 fSy2Coll(in.fSy2Coll),
313 fSxyColl(in.fSxyColl),
319 fDoPartProd(in.fDoPartProd),
325 fSigFluc(in.fSigFluc)
328 memcpy(fdNdEtaParam,in.fdNdEtaParam,sizeof(fdNdEtaParam));
331 //______________________________________________________________________________
332 AliGlauberMC& AliGlauberMC::operator=(const AliGlauberMC& in)
335 if (&in==this) return *this;
336 fANucleus=in.fANucleus;
337 fBNucleus=in.fBNucleus;
339 fNucleonsA=in.fNucleonsA;
340 fNucleonsB=in.fNucleonsB;
353 fMeanXParts=in.fMeanXParts;
354 fMeanYParts=in.fMeanYParts;
355 fMeanOXParts=in.fMeanOXParts;
356 fMeanOYParts=in.fMeanOYParts;
357 fMeanXColl=in.fMeanXColl;
358 fMeanYColl=in.fMeanYColl;
359 fMeanOXColl=in.fMeanOXColl;
360 fMeanOYColl=in.fMeanOYColl;
361 fMeanX2Coll=in.fMeanX2Coll;
362 fMeanY2Coll=in.fMeanY2Coll;
363 fMeanXYColl=in.fMeanXYColl;
364 fMeanr2Coll=in.fMeanr2Coll;
365 fMeanr3Coll=in.fMeanr3Coll;
366 fMeanr4Coll=in.fMeanr4Coll;
367 fMeanr5Coll=in.fMeanr5Coll;
368 fMeanXCom=in.fMeanXColl;
369 fMeanYCom=in.fMeanYColl;
370 fMeanOXCom=in.fMeanOXCom;
371 fMeanOYCom=in.fMeanOYCom;
372 fMeanX2Com=in.fMeanX2Com;
373 fMeanY2Com=in.fMeanY2Com;
374 fMeanXYCom=in.fMeanXYCom;
375 fMeanr2Com=in.fMeanr2Com;
376 fMeanr3Com=in.fMeanr3Com;
377 fMeanr4Com=in.fMeanr4Com;
378 fMeanr5Com=in.fMeanr5Com;
379 fMeanXSystem=in.fMeanXSystem;
380 fMeanYSystem=in.fMeanYSystem;
385 fMeanOXA=in.fMeanOXA;
386 fMeanOYA=in.fMeanOYA;
387 fMeanOXB=in.fMeanOXB;
388 fMeanOYB=in.fMeanOYB;
391 fTotalEvents=in.fTotalEvents;
394 fMultType=in.fMultType,
395 memcpy(fdNdEtaParam,in.fdNdEtaParam,sizeof(fdNdEtaParam));
396 fMaxNpartFound=in.fMaxNpartFound;
403 fMeanr2Cos2Phi=in.fMeanr2Cos2Phi;
404 fMeanr2Sin2Phi=in.fMeanr2Sin2Phi;
405 fMeanr2Cos3Phi=in.fMeanr2Cos3Phi;
406 fMeanr2Sin3Phi=in.fMeanr2Sin3Phi;
407 fMeanr2Cos4Phi=in.fMeanr2Cos4Phi;
408 fMeanr2Sin4Phi=in.fMeanr2Sin4Phi;
409 fMeanr2Cos5Phi=in.fMeanr2Cos5Phi;
410 fMeanr2Sin5Phi=in.fMeanr2Sin5Phi;
411 fMeanr3Cos3Phi=in.fMeanr3Cos3Phi;
412 fMeanr3Sin3Phi=in.fMeanr3Sin3Phi;
413 fMeanr4Cos4Phi=in.fMeanr4Cos4Phi;
414 fMeanr4Sin4Phi=in.fMeanr4Sin4Phi;
415 fMeanr5Cos5Phi=in.fMeanr5Cos5Phi;
416 fMeanr5Sin5Phi=in.fMeanr5Sin5Phi;
417 fMeanr2Cos2PhiColl=in.fMeanr2Cos2PhiColl;
418 fMeanr2Sin2PhiColl=in.fMeanr2Sin2PhiColl;
419 fMeanr2Cos3PhiColl=in.fMeanr2Cos3PhiColl;
420 fMeanr2Sin3PhiColl=in.fMeanr2Sin3PhiColl;
421 fMeanr2Cos4PhiColl=in.fMeanr2Cos4PhiColl;
422 fMeanr2Sin4PhiColl=in.fMeanr2Sin4PhiColl;
423 fMeanr2Cos5PhiColl=in.fMeanr2Cos5PhiColl;
424 fMeanr2Sin5PhiColl=in.fMeanr2Sin5PhiColl;
425 fMeanr3Cos3PhiColl=in.fMeanr3Cos3PhiColl;
426 fMeanr3Sin3PhiColl=in.fMeanr3Sin3PhiColl;
427 fMeanr4Cos4PhiColl=in.fMeanr4Cos4PhiColl;
428 fMeanr4Sin4PhiColl=in.fMeanr4Sin4PhiColl;
429 fMeanr5Cos5PhiColl=in.fMeanr5Cos5PhiColl;
430 fMeanr5Sin5PhiColl=in.fMeanr5Sin5PhiColl;
431 fMeanr2Cos2PhiCom=in.fMeanr2Cos2PhiCom;
432 fMeanr2Sin2PhiCom=in.fMeanr2Sin2PhiCom;
433 fMeanr2Cos3PhiCom=in.fMeanr2Cos3PhiCom;
434 fMeanr2Sin3PhiCom=in.fMeanr2Sin3PhiCom;
435 fMeanr2Cos4PhiCom=in.fMeanr2Cos4PhiCom;
436 fMeanr2Sin4PhiCom=in.fMeanr2Sin4PhiCom;
437 fMeanr2Cos5PhiCom=in.fMeanr2Cos5PhiCom;
438 fMeanr2Sin5PhiCom=in.fMeanr2Sin5PhiCom;
439 fMeanr3Cos3PhiCom=in.fMeanr3Cos3PhiCom;
440 fMeanr3Sin3PhiCom=in.fMeanr3Sin3PhiCom;
441 fMeanr4Cos4PhiCom=in.fMeanr4Cos4PhiCom;
442 fMeanr4Sin4PhiCom=in.fMeanr4Sin4PhiCom;
443 fMeanr5Cos5PhiCom=in.fMeanr5Cos5PhiCom;
444 fMeanr5Sin5PhiCom=in.fMeanr5Sin5PhiCom;
445 fSx2Parts=in.fSx2Parts;
446 fSy2Parts=in.fSy2Parts;
447 fSxyParts=in.fSxyParts;
448 fSx2Coll=in.fSx2Coll;
449 fSy2Coll=in.fSy2Coll;
450 fSxyColl=in.fSxyColl;
459 //______________________________________________________________________________
460 Bool_t AliGlauberMC::CalcEvent(Double_t bgen)
466 fSigFluc = new TF1("fSigFluc","[0]*x/[3]/(x/[3]+[1])*exp(-((x/[1]/[3]-1)/[2])^2)",0,250);
467 fSigFluc->SetParameters(1,fSig0,fOmega,fLambda);
468 cout << "Setting fluc: " << fSig0 << " " << fOmega << " " << fLambda << endl;
472 fANucleus.ThrowNucleons(-bgen/2.);
473 fNucleonsA = fANucleus.GetNucleons();
474 fAN = fANucleus.GetN();
476 //fAN = 3 * fANucleus.GetN(); // for Pb, Number of quark = 3*208;
477 for (Int_t i = 0; i<fAN; i++)
479 AliGlauberNucleon *nucleonA=(AliGlauberNucleon*)(fNucleonsA->UncheckedAt(i));
480 nucleonA->SetInNucleusA();
481 nucleonA->SetSigNN(fXSect);
483 nucleonA->SetSigNN(fSigFluc->GetRandom());
485 fBNucleus.ThrowNucleons(bgen/2.);
486 fNucleonsB = fBNucleus.GetNucleons();
487 //fBN = 3 * fBNucleus.GetN(); // Number of quark = number of nucleus*3;
488 fBN = fBNucleus.GetN();
490 for (Int_t i = 0; i<fBN; i++)
492 AliGlauberNucleon *nucleonB=(AliGlauberNucleon*)(fNucleonsB->UncheckedAt(i));
493 nucleonB->SetInNucleusB();
494 nucleonB->SetSigNN(fXSect);
496 nucleonB->SetSigNN(fSigFluc->GetRandom());
501 fSigFluc = new TF1("fSigFluc","[0]*x/[3]/(x/[3]+[1])*exp(-((x/[1]/[3]-1)/[2])^2)",0,250);
502 fSigFluc->SetParameters(1,fSig0,fOmega,fLambda);
503 cout << "Setting fluc: " << fSig0 << " " << fOmega << " " << fLambda << endl;
505 fXSect = fSigFluc->GetRandom();
507 // "ball" diameter = distance at which two balls interact
508 Double_t d2 = (Double_t)fXSect/(TMath::Pi()*10); // in fm^2
512 Double_t Ncohc = 0; // hard core
514 // for each of the A nucleons in nucleus B
515 for (Int_t i = 0; i<fBN; i++)
517 AliGlauberNucleon *nucleonB=(AliGlauberNucleon*)(fNucleonsB->UncheckedAt(i));
518 for (Int_t j = 0 ; j < fAN ; j++)
520 AliGlauberNucleon *nucleonA=(AliGlauberNucleon*)(fNucleonsA->UncheckedAt(j));
521 Double_t dx = nucleonB->GetX()-nucleonA->GetX();
522 Double_t dy = nucleonB->GetY()-nucleonA->GetY();
523 Double_t dij = dx*dx+dy*dy;
525 //fXSect = nucleonA->GetSigNN();
526 //fXSect = (nucleonA->GetSigNN()+nucleonB->GetSigNN())/2.;
527 fXSect = TMath::Max(nucleonA->GetSigNN(),nucleonB->GetSigNN());
528 d2 = (Double_t)fXSect/(TMath::Pi()*10); // in fm^2
554 return CalcResults(bgen);
557 //______________________________________________________________________________
558 Bool_t AliGlauberMC::CalcResults(Double_t bgen)
560 // calc results for the given event
561 //return true if we have participants
622 fMeanr2Cos2PhiColl=0.;
623 fMeanr2Sin2PhiColl=0.;
624 fMeanr2Cos3PhiColl=0.;
625 fMeanr2Sin3PhiColl=0.;
626 fMeanr2Cos4PhiColl=0.;
627 fMeanr2Sin4PhiColl=0.;
628 fMeanr2Cos5PhiColl=0.;
629 fMeanr2Sin5PhiColl=0.;
630 fMeanr3Cos3PhiColl=0.;
631 fMeanr3Sin3PhiColl=0.;
632 fMeanr4Cos4PhiColl=0.;
633 fMeanr4Sin4PhiColl=0.;
634 fMeanr5Cos5PhiColl=0.;
635 fMeanr5Sin5PhiColl=0.;
640 fMeanr2Cos2PhiCom=0.;
641 fMeanr2Sin2PhiCom=0.;
642 fMeanr2Cos3PhiCom=0.;
643 fMeanr2Sin3PhiCom=0.;
644 fMeanr2Cos4PhiCom=0.;
645 fMeanr2Sin4PhiCom=0.;
646 fMeanr2Cos5PhiCom=0.;
647 fMeanr2Sin5PhiCom=0.;
648 fMeanr3Cos3PhiCom=0.;
649 fMeanr3Sin3PhiCom=0.;
650 fMeanr4Cos4PhiCom=0.;
651 fMeanr4Sin4PhiCom=0.;
652 fMeanr5Cos5PhiCom=0.;
653 fMeanr5Sin5PhiCom=0.;
655 for (Int_t i = 0; i<fAN; i++)
657 AliGlauberNucleon *nucleonA=(AliGlauberNucleon*)(fNucleonsA->UncheckedAt(i));
658 Double_t oXA = nucleonA->GetX();
659 Double_t oYA = nucleonA->GetY();
660 //fMeanOXSystem += oXA;
661 //fMeanOYSystem += oYA;
665 if(nucleonA->IsWounded())
672 fMeanOXCom += oXA*(1-0.150);
673 fMeanOYCom += oXA*(1-0.150);
677 for (Int_t i = 0; i<fBN; i++)
679 AliGlauberNucleon *nucleonB=(AliGlauberNucleon*)(fNucleonsB->UncheckedAt(i));
680 Double_t oXB=nucleonB->GetX();
681 Double_t oYB=nucleonB->GetY();
683 if(nucleonB->IsWounded())
685 Int_t oNcoll = nucleonB->GetNColl();
688 fMeanOXColl += oXB*oNcoll;
689 fMeanOXCom += oXB*((1-0.150)+0.150*oNcoll);
691 fMeanOYColl += oYB*oNcoll;
692 fMeanOYCom += oYB*((1-0.150)+0.150*oNcoll);
694 fONcom += ((1-0.150)+0.150*oNcoll);
700 fMeanOXParts /= fONpart;
701 fMeanOYParts /= fONpart;
711 fMeanOXColl /= fONcoll;
712 fMeanOYColl /= fONcoll;
722 fMeanOXCom /= fONcom;
723 fMeanOYCom /= fONcom;
731 //////////////////////////////////////////////////////////////////
732 for (Int_t i = 0; i<fAN; i++)
734 AliGlauberNucleon *nucleonA=(AliGlauberNucleon*)(fNucleonsA->UncheckedAt(i));
735 Double_t xAA = nucleonA->GetX(); // X
736 Double_t yAA = nucleonA->GetY(); // Y
737 Double_t xAPart = xAA - fMeanOXParts; // X'
738 Double_t yAPart = yAA - fMeanOYParts; // Y'
739 Double_t r2APart = xAPart *xAPart+yAPart*yAPart; // r'^2
740 Double_t rAPart = TMath::Sqrt(r2APart); // r'
741 Double_t r3APart = r2APart*rAPart;
742 Double_t r4APart = r3APart*rAPart;
743 Double_t r5APart = r4APart*rAPart;
744 Double_t phiAPart = TMath::ATan2(yAPart,xAPart);
745 Double_t sin2PhiAPart = TMath::Sin(2.*phiAPart);
746 Double_t cos2PhiAPart = TMath::Cos(2.*phiAPart);
747 Double_t sin3PhiAPart = TMath::Sin(3.*phiAPart);
748 Double_t cos3PhiAPart = TMath::Cos(3.*phiAPart);
749 Double_t sin4PhiAPart = TMath::Sin(4.*phiAPart);
750 Double_t cos4PhiAPart = TMath::Cos(4.*phiAPart);
751 Double_t sin5PhiAPart = TMath::Sin(5.*phiAPart);
752 Double_t cos5PhiAPart = TMath::Cos(5.*phiAPart);
755 Double_t xACom = xAA - fMeanOXCom; // X'-Combine
756 Double_t yACom = yAA - fMeanOYCom; // Y'-C
757 Double_t r2ACom = xACom *xACom+yACom*yACom; // r'^2-C
758 Double_t rACom = TMath::Sqrt(r2ACom); // r'-C
759 Double_t r3ACom = r2ACom*rACom;
760 Double_t r4ACom = r3ACom*rACom;
761 Double_t r5ACom = r4ACom*rACom;
762 Double_t phiACom = TMath::ATan2(yACom,xACom);
763 Double_t sin2PhiACom = TMath::Sin(2.*phiACom);
764 Double_t cos2PhiACom = TMath::Cos(2.*phiACom);
765 Double_t sin3PhiACom = TMath::Sin(3.*phiACom);
766 Double_t cos3PhiACom = TMath::Cos(3.*phiACom);
767 Double_t sin4PhiACom = TMath::Sin(4.*phiACom);
768 Double_t cos4PhiACom = TMath::Cos(4.*phiACom);
769 Double_t sin5PhiACom = TMath::Sin(5.*phiACom);
770 Double_t cos5PhiACom = TMath::Cos(5.*phiACom);
776 fMeanX2 += xAA * xAA;
777 fMeanY2 += yAA * yAA;
778 fMeanXY += xAA * yAA;
780 if(nucleonA->IsWounded())
784 fMeanXParts += xAPart;
785 fMeanYParts += yAPart;
786 fMeanX2Parts += xAPart * xAPart;
787 fMeanY2Parts += yAPart * yAPart;
788 fMeanXYParts += xAPart * yAPart;
793 fMeanr2Cos2Phi += r2APart*cos2PhiAPart;
794 fMeanr2Sin2Phi += r2APart*sin2PhiAPart;
795 fMeanr2Cos3Phi += r2APart*cos3PhiAPart;
796 fMeanr2Sin3Phi += r2APart*sin3PhiAPart;
797 fMeanr2Cos4Phi += r2APart*cos4PhiAPart;
798 fMeanr2Sin4Phi += r2APart*sin4PhiAPart;
799 fMeanr2Cos5Phi += r2APart*cos5PhiAPart;
800 fMeanr2Sin5Phi += r2APart*sin5PhiAPart;
801 fMeanr3Cos3Phi += r3APart*cos3PhiAPart;
802 fMeanr3Sin3Phi += r3APart*sin3PhiAPart;
803 fMeanr4Cos4Phi += r4APart*cos4PhiAPart;
804 fMeanr4Sin4Phi += r4APart*sin4PhiAPart;
805 fMeanr5Cos5Phi += r5APart*cos5PhiAPart;
806 fMeanr5Sin5Phi += r5APart*sin5PhiAPart;
809 fMeanXCom += xACom*(1-0.150);
810 fMeanYCom += yACom*(1-0.150);
811 fMeanX2Com += xACom*xACom*(1-0.150);
812 fMeanY2Com += yACom*yACom*(1-0.150);
813 fMeanXYCom += xACom*yACom*(1-0.150);
815 fMeanr2Com += r2ACom*(1-0.150);
816 fMeanr3Com += r3ACom*(1-0.150);
817 fMeanr4Com += r4ACom*(1-0.150);
818 fMeanr5Com += r5ACom*(1-0.150);
819 fMeanr2Cos2PhiCom += r2ACom*cos2PhiACom*(1-0.150);
820 fMeanr2Sin2PhiCom += r2ACom*sin2PhiACom*(1-0.150);
821 fMeanr2Cos3PhiCom += r2ACom*cos3PhiACom*(1-0.150);
822 fMeanr2Sin3PhiCom += r2ACom*sin3PhiACom*(1-0.150);
823 fMeanr2Cos4PhiCom += r2ACom*cos4PhiACom*(1-0.150);
824 fMeanr2Sin4PhiCom += r2ACom*sin4PhiACom*(1-0.150);
825 fMeanr2Cos5PhiCom += r2ACom*cos5PhiACom*(1-0.150);
826 fMeanr2Sin5PhiCom += r2ACom*sin5PhiACom*(1-0.150);
827 fMeanr3Cos3PhiCom += r3ACom*cos3PhiACom*(1-0.150);
828 fMeanr3Sin3PhiCom += r3ACom*sin3PhiACom*(1-0.150);
829 fMeanr4Cos4PhiCom += r4ACom*cos4PhiACom*(1-0.150);
830 fMeanr4Sin4PhiCom += r4ACom*sin4PhiACom*(1-0.150);
831 fMeanr5Cos5PhiCom += r5ACom*cos5PhiACom*(1-0.150);
832 fMeanr5Sin5PhiCom += r5ACom*sin5PhiACom*(1-0.150);
837 for (Int_t i = 0; i<fBN; i++)
839 AliGlauberNucleon *nucleonB=(AliGlauberNucleon*)(fNucleonsB->UncheckedAt(i));
840 Double_t xBB = nucleonB->GetX();
841 Double_t yBB = nucleonB->GetY();
843 Double_t xBPart = xBB - fMeanOXParts; // X'
844 Double_t yBPart = yBB - fMeanOYParts; // Y'
845 Double_t r2BPart = xBPart*xBPart+yBPart*yBPart; // r'^2
846 Double_t rBPart = TMath::Sqrt(r2BPart); // r'
847 Double_t r3BPart = r2BPart*rBPart;
848 Double_t r4BPart = r3BPart*rBPart;
849 Double_t r5BPart = r4BPart*rBPart;
850 Double_t phiBPart = TMath::ATan2(yBPart,xBPart);
851 Double_t sin2PhiBPart = TMath::Sin(2.*phiBPart);
852 Double_t cos2PhiBPart = TMath::Cos(2.*phiBPart);
853 Double_t sin3PhiBPart = TMath::Sin(3.*phiBPart);
854 Double_t cos3PhiBPart = TMath::Cos(3.*phiBPart);
855 Double_t sin4PhiBPart = TMath::Sin(4.*phiBPart);
856 Double_t cos4PhiBPart = TMath::Cos(4.*phiBPart);
857 Double_t sin5PhiBPart = TMath::Sin(5.*phiBPart);
858 Double_t cos5PhiBPart = TMath::Cos(5.*phiBPart);
860 Double_t xBColl = xBB - fMeanOXColl; // X'-Binary
861 Double_t yBColl = yBB - fMeanOYColl; // Y'-B
862 Double_t r2BColl = xBColl*xBColl+yBColl*yBColl; // r'^2-B
863 Double_t rBColl = TMath::Sqrt(r2BColl); // r'-B
864 Double_t r3BColl = r2BColl*rBColl;
865 Double_t r4BColl = r3BColl*rBColl;
866 Double_t r5BColl = r4BColl*rBColl;
867 Double_t phiBColl = TMath::ATan2(yBColl,xBColl);
868 Double_t sin2PhiBColl = TMath::Sin(2.*phiBColl);
869 Double_t cos2PhiBColl = TMath::Cos(2.*phiBColl);
870 Double_t sin3PhiBColl = TMath::Sin(3.*phiBColl);
871 Double_t cos3PhiBColl = TMath::Cos(3.*phiBColl);
872 Double_t sin4PhiBColl = TMath::Sin(4.*phiBColl);
873 Double_t cos4PhiBColl = TMath::Cos(4.*phiBColl);
874 Double_t sin5PhiBColl = TMath::Sin(5.*phiBColl);
875 Double_t cos5PhiBColl = TMath::Cos(5.*phiBColl);
877 Double_t xBCom = xBB - fMeanOXCom; // X'-Combine
878 Double_t yBCom = yBB - fMeanOYCom; // Y'-C
879 Double_t r2BCom = xBCom *xBCom+yBCom*yBCom; // r'^2-C
880 Double_t rBCom = TMath::Sqrt(r2BCom); // r'-C
881 Double_t r3BCom = r2BCom*rBCom;
882 Double_t r4BCom = r3BCom*rBCom;
883 Double_t r5BCom = r4BCom*rBCom;
884 Double_t phiBCom = TMath::ATan2(yBCom,xBCom);
885 Double_t sin2PhiBCom = TMath::Sin(2.*phiBCom);
886 Double_t cos2PhiBCom = TMath::Cos(2.*phiBCom);
887 Double_t sin3PhiBCom = TMath::Sin(3.*phiBCom);
888 Double_t cos3PhiBCom = TMath::Cos(3.*phiBCom);
889 Double_t sin4PhiBCom = TMath::Sin(4.*phiBCom);
890 Double_t cos4PhiBCom = TMath::Cos(4.*phiBCom);
891 Double_t sin5PhiBCom = TMath::Sin(5.*phiBCom);
892 Double_t cos5PhiBCom = TMath::Cos(5.*phiBCom);
902 if(nucleonB->IsWounded())
904 Int_t ncoll = nucleonB->GetNColl();
906 fMeanXParts += xBPart;
907 fMeanXColl += xBColl*ncoll;
908 fMeanXCom += xBCom*((1-0.150)+0.150*ncoll);
909 fMeanYParts += yBPart;
910 fMeanYColl += yBColl*ncoll;
911 fMeanYCom += yBCom*((1-0.150)+0.150*ncoll);
912 fMeanX2Parts += xBPart * xBPart;
913 fMeanX2Coll += xBColl*xBColl*ncoll;
914 fMeanX2Com += xBCom*xBCom*((1-0.150)+0.150*ncoll);
915 fMeanY2Parts += yBPart * yBPart;
916 fMeanY2Coll += yBColl*yBColl*ncoll;
917 fMeanY2Com += yBCom*yBCom*((1-0.150)+0.150*ncoll);
918 fMeanXYParts += xBPart * yBPart;
919 fMeanXYColl += xBColl*yBColl*ncoll;
920 fMeanXYCom += xBCom*yBCom*((1-0.150)+0.150*ncoll);
922 fNcom += ((1-0.150)+0.150*ncoll);
927 fMeanr2Cos2Phi += r2BPart*cos2PhiBPart;
928 fMeanr2Sin2Phi += r2BPart*sin2PhiBPart;
929 fMeanr2Cos3Phi += r2BPart*cos3PhiBPart;
930 fMeanr2Sin3Phi += r2BPart*sin3PhiBPart;
931 fMeanr2Cos4Phi += r2BPart*cos4PhiBPart;
932 fMeanr2Sin4Phi += r2BPart*sin4PhiBPart;
933 fMeanr2Cos5Phi += r2BPart*cos5PhiBPart;
934 fMeanr2Sin5Phi += r2BPart*sin5PhiBPart;
935 fMeanr3Cos3Phi += r3BPart*cos3PhiBPart;
936 fMeanr3Sin3Phi += r3BPart*sin3PhiBPart;
937 fMeanr4Cos4Phi += r4BPart*cos4PhiBPart;
938 fMeanr4Sin4Phi += r4BPart*sin4PhiBPart;
939 fMeanr5Cos5Phi += r5BPart*cos5PhiBPart;
940 fMeanr5Sin5Phi += r5BPart*sin5PhiBPart;
941 fMeanr2Coll += r2BColl*ncoll;
942 fMeanr3Coll += r3BColl*ncoll;
943 fMeanr4Coll += r4BColl*ncoll;
944 fMeanr5Coll += r5BColl*ncoll;
945 fMeanr2Cos2PhiColl += r2BColl*cos2PhiBColl*ncoll;
946 fMeanr2Sin2PhiColl += r2BColl*sin2PhiBColl*ncoll;
947 fMeanr2Cos3PhiColl += r2BColl*cos3PhiBColl*ncoll;
948 fMeanr2Sin3PhiColl += r2BColl*sin3PhiBColl*ncoll;
949 fMeanr2Cos4PhiColl += r2BColl*cos4PhiBColl*ncoll;
950 fMeanr2Sin4PhiColl += r2BColl*sin4PhiBColl*ncoll;
951 fMeanr2Cos5PhiColl += r2BColl*cos5PhiBColl*ncoll;
952 fMeanr2Sin5PhiColl += r2BColl*sin5PhiBColl*ncoll;
953 fMeanr3Cos3PhiColl += r3BColl*cos3PhiBColl*ncoll;
954 fMeanr3Sin3PhiColl += r3BColl*sin3PhiBColl*ncoll;
955 fMeanr4Cos4PhiColl += r4BColl*cos4PhiBColl*ncoll;
956 fMeanr4Sin4PhiColl += r4BColl*sin4PhiBColl*ncoll;
957 fMeanr5Cos5PhiColl += r5BColl*cos5PhiBColl*ncoll;
958 fMeanr5Sin5PhiColl += r5BColl*sin5PhiBColl*ncoll;
959 fMeanr2Com += r2BCom*((1-0.150)+0.150*ncoll);
960 fMeanr3Com += r3BCom*((1-0.150)+0.150*ncoll);
961 fMeanr4Com += r4BCom*((1-0.150)+0.150*ncoll);
962 fMeanr5Com += r5BCom*((1-0.150)+0.150*ncoll);
963 fMeanr2Cos2PhiCom += r2BCom*cos2PhiBCom*((1-0.150)+0.150*ncoll);
964 fMeanr2Sin2PhiCom += r2BCom*sin2PhiBCom*((1-0.150)+0.150*ncoll);
965 fMeanr2Cos3PhiCom += r2BCom*cos3PhiBCom*((1-0.150)+0.150*ncoll);
966 fMeanr2Sin3PhiCom += r2BCom*sin3PhiBCom*((1-0.150)+0.150*ncoll);
967 fMeanr2Cos4PhiCom += r2BCom*cos4PhiBCom*((1-0.150)+0.150*ncoll);
968 fMeanr2Sin4PhiCom += r2BCom*sin4PhiBCom*((1-0.150)+0.150*ncoll);
969 fMeanr2Cos5PhiCom += r2BCom*cos5PhiBCom*((1-0.150)+0.150*ncoll);
970 fMeanr2Sin5PhiCom += r2BCom*sin5PhiBCom*((1-0.150)+0.150*ncoll);
971 fMeanr3Cos3PhiCom += r3BCom*cos3PhiBCom*((1-0.150)+0.150*ncoll);
972 fMeanr3Sin3PhiCom += r3BCom*sin3PhiBCom*((1-0.150)+0.150*ncoll);
973 fMeanr4Cos4PhiCom += r4BCom*cos4PhiBCom*((1-0.150)+0.150*ncoll);
974 fMeanr4Sin4PhiCom += r4BCom*sin4PhiBCom*((1-0.150)+0.150*ncoll);
975 fMeanr5Cos5PhiCom += r5BCom*cos5PhiBCom*((1-0.150)+0.150*ncoll);
976 fMeanr5Sin5PhiCom += r5BCom*sin5PhiBCom*((1-0.150)+0.150*ncoll);
982 fMeanXParts /= fNpart;
983 fMeanYParts /= fNpart;
984 fMeanX2Parts /= fNpart;
985 fMeanY2Parts /= fNpart;
986 fMeanXYParts /= fNpart;
991 fMeanr2Cos2Phi /= fNpart;
992 fMeanr2Sin2Phi /= fNpart;
993 fMeanr2Cos3Phi /= fNpart;
994 fMeanr2Sin3Phi /= fNpart;
995 fMeanr2Cos4Phi /= fNpart;
996 fMeanr2Sin4Phi /= fNpart;
997 fMeanr2Cos5Phi /= fNpart;
998 fMeanr2Sin5Phi /= fNpart;
999 fMeanr3Cos3Phi /= fNpart;
1000 fMeanr3Sin3Phi /= fNpart;
1001 fMeanr4Cos4Phi /= fNpart;
1002 fMeanr4Sin4Phi /= fNpart;
1003 fMeanr5Cos5Phi /= fNpart;
1004 fMeanr5Sin5Phi /= fNpart;
1036 fMeanXColl /= fNcoll;
1037 fMeanYColl /= fNcoll;
1038 fMeanX2Coll /= fNcoll;
1039 fMeanY2Coll /= fNcoll;
1040 fMeanXYColl /= fNcoll;
1041 fMeanr2Coll /= fNcoll;
1042 fMeanr3Coll /= fNcoll;
1043 fMeanr4Coll /= fNcoll;
1044 fMeanr5Coll /= fNcoll;
1045 fMeanr2Cos2PhiColl /= fNcoll;
1046 fMeanr2Sin2PhiColl /= fNcoll;
1047 fMeanr2Cos3PhiColl /= fNcoll;
1048 fMeanr2Sin3PhiColl /= fNcoll;
1049 fMeanr2Cos4PhiColl /= fNcoll;
1050 fMeanr2Sin4PhiColl /= fNcoll;
1051 fMeanr2Cos5PhiColl /= fNcoll;
1052 fMeanr2Sin5PhiColl /= fNcoll;
1053 fMeanr3Cos3PhiColl /= fNcoll;
1054 fMeanr3Sin3PhiColl /= fNcoll;
1055 fMeanr4Cos4PhiColl /= fNcoll;
1056 fMeanr4Sin4PhiColl /= fNcoll;
1057 fMeanr5Cos5PhiColl /= fNcoll;
1058 fMeanr5Sin5PhiColl /= fNcoll;
1068 fMeanr2Cos2PhiColl =0;
1069 fMeanr2Sin2PhiColl =0;
1070 fMeanr2Cos3PhiColl =0;
1071 fMeanr2Sin3PhiColl =0;
1072 fMeanr2Cos4PhiColl =0;
1073 fMeanr2Sin4PhiColl =0;
1074 fMeanr2Cos5PhiColl =0;
1075 fMeanr2Sin5PhiColl =0;
1076 fMeanr3Cos3PhiColl =0;
1077 fMeanr3Sin3PhiColl =0;
1078 fMeanr4Cos4PhiColl =0;
1079 fMeanr4Sin4PhiColl =0;
1080 fMeanr5Cos5PhiColl =0;
1081 fMeanr5Sin5PhiColl =0;
1088 fMeanX2Com /= fNcom;
1089 fMeanY2Com /= fNcom;
1090 fMeanXYCom /= fNcom;
1091 fMeanr2Com /= fNcom;
1092 fMeanr3Com /= fNcom;
1093 fMeanr4Com /= fNcom;
1094 fMeanr5Com /= fNcom;
1095 fMeanr2Cos2PhiCom /= fNcom;
1096 fMeanr2Sin2PhiCom /= fNcom;
1097 fMeanr2Cos3PhiCom /= fNcom;
1098 fMeanr2Sin3PhiCom /= fNcom;
1099 fMeanr2Cos4PhiCom /= fNcom;
1100 fMeanr2Sin4PhiCom /= fNcom;
1101 fMeanr2Cos5PhiCom /= fNcom;
1102 fMeanr2Sin5PhiCom /= fNcom;
1103 fMeanr3Cos3PhiCom /= fNcom;
1104 fMeanr3Sin3PhiCom /= fNcom;
1105 fMeanr4Cos4PhiCom /= fNcom;
1106 fMeanr4Sin4PhiCom /= fNcom;
1107 fMeanr5Cos5PhiCom /= fNcom;
1108 fMeanr5Sin5PhiCom /= fNcom;
1118 fMeanr2Cos2PhiCom =0;
1119 fMeanr2Sin2PhiCom =0;
1120 fMeanr2Cos3PhiCom =0;
1121 fMeanr2Sin3PhiCom =0;
1122 fMeanr2Cos4PhiCom =0;
1123 fMeanr2Sin4PhiCom =0;
1124 fMeanr2Cos5PhiCom =0;
1125 fMeanr2Sin5PhiCom =0;
1126 fMeanr3Cos3PhiCom =0;
1127 fMeanr3Sin3PhiCom =0;
1128 fMeanr4Cos4PhiCom =0;
1129 fMeanr4Sin4PhiCom =0;
1130 fMeanr5Cos5PhiCom =0;
1131 fMeanr5Sin5PhiCom =0;
1136 fMeanXSystem /= (fAN + fBN);
1137 fMeanYSystem /= (fAN + fBN);
1138 fMeanX2 /= (fAN + fBN);
1139 fMeanY2 /= (fAN + fBN);
1140 fMeanXY /= (fAN + fBN);
1175 //////////////////////////////////////////////////////////////////
1176 fSx2Parts=fMeanX2Parts-(fMeanXParts*fMeanXParts);
1177 fSy2Parts=fMeanY2Parts-(fMeanYParts*fMeanYParts);
1178 fSxyParts=fMeanXYParts-fMeanXParts*fMeanYParts;
1179 fSx2Coll=fMeanX2Coll-(fMeanXColl*fMeanXColl);
1180 fSy2Coll=fMeanY2Coll-(fMeanYColl*fMeanYColl);
1181 fSxyColl=fMeanXYColl-fMeanXColl*fMeanYColl;
1182 fSx2Com=fMeanX2Com-(fMeanXCom*fMeanXCom);
1183 fSy2Com=fMeanY2Com-(fMeanYCom*fMeanYCom);
1184 fSxyCom=fMeanXYCom-fMeanXCom*fMeanYCom;
1187 if (fNpart>0) fEvents++;
1188 if (fNpart==0) return kFALSE;
1189 if (fNpart > fMaxNpartFound) fMaxNpartFound = fNpart;
1194 //______________________________________________________________________________
1195 void AliGlauberMC::Draw(Option_t* /*option*/)
1198 fANucleus.Draw(fXSect, 2);
1199 fBNucleus.Draw(fXSect, 4);
1206 e.DrawEllipse(GetB()/2,0,fBNucleus.GetR(),fBNucleus.GetR(),0,360,0);
1207 e.DrawEllipse(-GetB()/2,0,fANucleus.GetR(),fANucleus.GetR(),0,360,0);
1210 //______________________________________________________________________________
1211 Double_t AliGlauberMC::GetTotXSect() const
1214 return (1.*fEvents/fTotalEvents)*TMath::Pi()*fBMax*fBMax/100;
1217 //______________________________________________________________________________
1218 Double_t AliGlauberMC::GetTotXSectErr() const
1220 //total xsection error
1221 return GetTotXSect()/TMath::Sqrt((Double_t)fEvents) *
1222 TMath::Sqrt(Double_t(1.-fEvents/fTotalEvents));
1225 //______________________________________________________________________________
1226 TObjArray *AliGlauberMC::GetNucleons()
1228 //get array of nucleons
1229 if(!fNucleonsA || !fNucleonsB) return 0;
1230 fNucleonsA->SetOwner(0);
1231 fNucleonsB->SetOwner(0);
1232 TObjArray *allnucleons=new TObjArray(fAN+fBN);
1233 allnucleons->SetOwner();
1234 for (Int_t i = 0; i<fAN; i++)
1236 allnucleons->Add(fNucleonsA->UncheckedAt(i));
1238 for (Int_t i = 0; i<fBN; i++)
1240 allnucleons->Add(fNucleonsB->UncheckedAt(i));
1245 //______________________________________________________________________________
1246 Double_t AliGlauberMC::NegativeBinomialDistribution(Int_t x, Int_t k, Double_t nmean)
1248 //produce a number distributed acc. neg.bin.dist
1251 cout << "Error, zero or negative K" << endl;
1254 return (TMath::Binomial(x+k-1,x))
1255 *TMath::Power(((nmean/Double_t(k))/(1+nmean/Double_t(k))),Double_t(x))
1256 *(1/(TMath::Power((1+nmean/Double_t(k)),Double_t(k))));
1259 //______________________________________________________________________________
1260 Int_t AliGlauberMC::NegativeBinomialRandom(Int_t k, Double_t nmean) const
1262 //return random integer from a Negative Binomial Distribution
1263 static const Int_t fMaxPlot = 1000;
1264 Double_t array[fMaxPlot];
1265 array[0] = NegativeBinomialDistribution(0,k,nmean);
1266 for (Int_t i=1; i<fMaxPlot; i++)
1268 array[i] = NegativeBinomialDistribution(i,k,nmean) + array[i-1];
1270 Double_t r = gRandom->Uniform(0,1);
1271 return TMath::BinarySearch(fMaxPlot,array,r)+2;
1275 //______________________________________________________________________________
1276 Int_t AliGlauberMC::NegativeBinomialRandomSV(Double_t k, Double_t nbar) const
1278 // negative binomial distribution generator, S. Voloshin, 09-May-2007
1281 Double_t ran=gRandom->Rndm();
1282 Double_t trm=1./pow(1.+nbar/k,k);
1285 cout<<"NBD overflow"<<" nbar="<<nbar<<" k="<<k<<endl;
1288 for(i=0; i<2000 && sum<ran ; i++)
1291 trm *= (k+i)/(i+1.)*(nbar/(nbar+k));
1296 //______________________________________________________________________________
1297 Int_t AliGlauberMC::DoubleNegativeBinomialRandom( Int_t k,
1301 Double_t alpha ) const
1303 //return random integer from a Double Negative Binomial Distribution
1304 static const Int_t fMaxPlot = 1000;
1305 Double_t array[fMaxPlot];
1306 array[0] = alpha*NegativeBinomialDistribution(0,k,nmean)+(1-alpha)*NegativeBinomialDistribution(0,k2,nmean2);
1307 for (Int_t i=1; i<fMaxPlot; i++)
1309 array[i] = alpha*NegativeBinomialDistribution(i,k,nmean)+(1-alpha)*NegativeBinomialDistribution(i,k2,nmean2) + array[i-1];
1311 Double_t r = gRandom->Uniform(0,1);
1312 return TMath::BinarySearch(fMaxPlot,array,r)+2;
1315 //______________________________________________________________________________
1316 Double_t AliGlauberMC::GetdNdEta() const
1321 return GetdNdEtaSimple(fdNdEtaParam);
1323 return GetdNdEtaNBD(fdNdEtaParam);
1325 return GetdNdEtaNBDSV(fdNdEtaParam);
1327 return GetdNdEtaTwoNBD(fdNdEtaParam);
1329 return GetdNdEtaGBW(fdNdEtaParam);
1335 //______________________________________________________________________________
1336 Double_t AliGlauberMC::GetdNdEtaSimple(const Double_t* p) const
1338 //Get particle density per unit of rapidity
1339 //using two component model
1340 //Parameters: npp, x
1341 Double_t nnp = p[0]; //=8.0
1342 Double_t x = p[1]; //=0.13
1344 return nnp*((1.-x)*fNpart/2.+x*fNcoll);
1347 //______________________________________________________________________________
1348 Double_t AliGlauberMC::GetdNdEtaGBW( const Double_t* p ) const
1350 //Get particle density per unit of rapidity
1351 //using the GBW model
1352 //Parameters: delta, lambda, snn
1353 Double_t delta = p[0]; //=0.79
1354 Double_t lambda = p[1]; //=0.288
1355 Double_t snn = p[2]; //=30.25
1357 return fNpart*0.47*TMath::Sqrt(TMath::Power(snn,lambda))
1358 * TMath::Power(fNpart,(1.-delta)/3./delta);
1361 //_______________________________________________________________________________
1362 Double_t AliGlauberMC::GetdNdEtaNBDSV ( const Double_t* p ) const
1364 //Get particle density per unit of rapidity (from Sergei)
1365 Double_t npp = p[0]; //=2.49
1366 Double_t ratioSgm2Mu = p[1]; //=1.7
1367 Double_t xhard = p[2]; //=0.13
1369 double knb=npp/(ratioSgm2Mu-1.); // sgm^2/mu = 1+ mu/k
1370 double scale = (1.-xhard)*fNpart/2.+xhard*fNcoll; // effectively get number of pp collisions
1372 if (knb*scale <1000.)
1374 nch1=(float) NegativeBinomialRandomSV( npp*scale, knb*scale );
1378 nch1=(float) NegativeBinomialRandomSV( npp*scale/2., knb*scale/2. ) +
1379 (float) NegativeBinomialRandomSV( npp*scale/2., knb*scale/2. );
1384 //_______________________________________________________________________________
1385 Double_t AliGlauberMC::GetdNdEtaNBD ( const Double_t* p ) const
1387 //Get particle density per unit of rapidity
1388 //using a aandomized number from a negative binomial distrubution
1389 //Parameters: k = related to distribition width=3
1390 // nmean = mean of distribution=4
1391 // beta = set contribution of participants / binary collisions to multiplicity=0.13
1392 Int_t k = TMath::Nint(p[0]);
1393 Double_t nmean = p[1];
1394 Double_t beta = p[2];
1397 for(Int_t i = 0; i<fNpart; i++)
1399 mulnp+=NegativeBinomialRandom(k,nmean);
1402 for(Int_t i = 0; i<fNcoll; i++)
1404 mulnb+=NegativeBinomialRandom(k,nmean);
1406 return (1-beta)*mulnp/2+beta*mulnb;
1409 //______________________________________________________________________________
1410 Double_t AliGlauberMC::GetdNdEtaTwoNBD ( const Double_t* p ) const
1412 //Get particle density per unit of rapidity
1413 //using random numbers from two negative binomial distributions
1414 //Parameters: k1 = related to distribition width of distribution 1=3
1415 // nmean1 = mean of distribution 1=4
1416 // k2 = related to distribition width of distribution 2=2
1417 // nmean2 = mean of distribution 2=11
1418 // alpha = set contributions of distrubitin 1 / distribution 2=0.4
1419 // beta = set contribution of participants / binary collisions to multiplicity =0.13
1420 Int_t k1 = TMath::Nint(p[0]);
1421 Double_t nmean1 = p[1];
1422 Int_t k2 = TMath::Nint(p[2]);
1423 Double_t nmean2 = p[3];
1424 Double_t alpha = p[4];
1425 Double_t beta = p[6];
1428 for(Int_t i = 0; i<fNpart; i++)
1430 mulnp+=DoubleNegativeBinomialRandom(k1,nmean1,k2,nmean2,alpha);
1433 for(Int_t i = 0; i<fNcoll; i++)
1435 mulnb+=DoubleNegativeBinomialRandom(k1,nmean1,k2,nmean2,alpha);
1437 Double_t mul=(1-beta)*mulnp/2+beta*mulnb;
1441 //______________________________________________________________________________
1442 Double_t AliGlauberMC::GetEccentricityPart() const
1444 //get participant eccentricity of participants
1445 if (fNpart<2) return 0.0;
1446 return (TMath::Sqrt((fSy2Parts-fSx2Parts)*(fSy2Parts-fSx2Parts)+4*fSxyParts*fSxyParts)/(fSy2Parts+fSx2Parts));
1449 //_____________________________________________________________________________
1450 Double_t AliGlauberMC::GetEccentricityPartColl() const
1452 //get participant eccentricity of binary collisions
1453 if (fNcoll<0) return 0.0;
1454 if (fSy2Coll==0.0) return 0.0;
1455 return (TMath::Sqrt((fSy2Coll-fSx2Coll)*(fSy2Coll-fSx2Coll)+4*fSxyColl*fSxyColl)/(fSy2Coll+fSx2Coll));
1458 //_____________________________________________________________________________
1459 Double_t AliGlauberMC::GetEccentricityPartCom() const
1461 //get participant eccentricity of binary collisions
1462 if (fNcom<0) return 0.0;
1463 return (TMath::Sqrt((fSy2Com-fSx2Com)*(fSy2Com-fSx2Com)+4*fSxyCom*fSxyCom)/(fSy2Com+fSx2Com));
1465 //______________________________________________________________________________
1466 Double_t AliGlauberMC::GetEccentricity() const
1468 //get standard eccentricity of participants
1469 if (fNpart<2) return 0.0;
1470 return ((fSy2Parts-fSx2Parts)/(fSy2Parts+fSx2Parts));
1473 //______________________________________________________________________________
1474 Double_t AliGlauberMC::GetEccentricityColl() const
1476 //get standard eccentricity of binary collisions
1477 if (fNcoll<0) return 0.0;
1478 if (fSy2Coll==0.0) return 0.0;
1479 return ((fSy2Coll-fSx2Coll)/(fSy2Coll+fSx2Coll));
1482 //______________________________________________________________________________
1483 Double_t AliGlauberMC::GetEccentricityCom() const
1485 //get standard eccentricity of combined weight
1486 if (fNcom<0) return 0.0;
1487 return ((fSy2Com-fSx2Com)/(fSy2Com+fSx2Com));
1488 //return (((fMeanY2Com-(fMeanYCom*fMeanYCom)) - (fMeanX2Com-(fMeanXCom*fMeanXCom))) / ((fMeanY2Com-(fMeanYCom*fMeanYCom)) + (fMeanX2Com-(fMeanXCom*fMeanXCom))) );
1491 //______________________________________________________________________________
1492 Double_t AliGlauberMC::GetStoa() const
1494 //get standard Transverse Overlap Area
1495 if (fNpart<2) return 0.0;
1496 return ( TMath::Pi()*(TMath::Sqrt(fSx2Parts))*(TMath::Sqrt(fSy2Parts)));
1499 //______________________________________________________________________________
1500 Bool_t AliGlauberMC::NextEvent(Double_t bgen)
1503 Int_t nAttempts = 10; // set indices, max attempts and max comparisons
1504 Bool_t succes = kFALSE;
1505 for(Int_t j=0; j<nAttempts; j++)
1507 if(bgen<0||!succes) //get impactparameter
1509 bgen = TMath::Sqrt((fBMax*fBMax-fBMin*fBMin)*gRandom->Rndm()+fBMin*fBMin);
1511 if ( (succes=CalcEvent(bgen)) ) break; //ends if we have particparts
1515 //______________________________________________________________________________
1516 Double_t AliGlauberMC::GetEpsilon2Part() const
1518 //get participant eccentricity of participants
1519 if (fNpart<2) return 0.0;
1520 return (TMath::Sqrt(fMeanr2Cos2Phi*fMeanr2Cos2Phi+fMeanr2Sin2Phi*fMeanr2Sin2Phi)/fMeanr2);
1522 //______________________________________________________________________________
1523 Double_t AliGlauberMC::GetEpsilon3Part() const
1525 //get participant eccentricity of participants
1526 if (fNpart<2) return 0.0;
1527 return (TMath::Sqrt(fMeanr2Cos3Phi*fMeanr2Cos3Phi+fMeanr2Sin3Phi*fMeanr2Sin3Phi)/fMeanr2);
1528 //return (TMath::Sqrt(fMeanr3Cos3Phi*fMeanr3Cos3Phi+fMeanr3Sin3Phi*fMeanr3Sin3Phi)/fMeanr3);
1530 //______________________________________________________________________________
1531 Double_t AliGlauberMC::GetEpsilon4Part() const
1533 //get participant eccentricity of participants
1534 if (fNpart<2) return 0.0;
1535 return (TMath::Sqrt(fMeanr2Cos4Phi*fMeanr2Cos4Phi+fMeanr2Sin4Phi*fMeanr2Sin4Phi)/fMeanr2);
1536 //return (TMath::Sqrt(fMeanr4Cos4Phi*fMeanr4Cos4Phi+fMeanr4Sin4Phi*fMeanr4Sin4Phi)/fMeanr4);
1539 //______________________________________________________________________________
1540 Double_t AliGlauberMC::GetEpsilon5Part() const
1542 //get participant eccentricity of participants
1543 if (fNpart<2) return 0.0;
1544 return (TMath::Sqrt(fMeanr2Cos5Phi*fMeanr2Cos5Phi+fMeanr2Sin5Phi*fMeanr2Sin5Phi)/fMeanr2);
1545 //return (TMath::Sqrt(fMeanr5Cos5Phi*fMeanr5Cos5Phi+fMeanr5Sin5Phi*fMeanr5Sin5Phi)/fMeanr5);
1548 //______________________________________________________________________________
1549 Double_t AliGlauberMC::GetEpsilon2Coll() const
1551 //get epsilon2 of binary collisions
1552 if (fNcoll<0) return 0.0;
1553 if (fMeanr2Coll==0.0) return 0.0;
1554 return (TMath::Sqrt(fMeanr2Cos2PhiColl*fMeanr2Cos2PhiColl+fMeanr2Sin2PhiColl*fMeanr2Sin2PhiColl)/fMeanr2Coll);
1557 //______________________________________________________________________________
1558 Double_t AliGlauberMC::GetEpsilon3Coll() const
1560 //get epsilon3 of binary collisions
1561 if (fNcoll<0) return 0.0;
1562 if (fMeanr2Coll==0.0) return 0.0;
1563 return (TMath::Sqrt(fMeanr2Cos3PhiColl*fMeanr2Cos3PhiColl+fMeanr2Sin3PhiColl*fMeanr2Sin3PhiColl)/fMeanr2Coll);
1564 //return (TMath::Sqrt(fMeanr3Cos3PhiColl*fMeanr3Cos3PhiColl+fMeanr3Sin3PhiColl*fMeanr3Sin3PhiColl)/fMeanr3Coll);
1567 //______________________________________________________________________________
1568 Double_t AliGlauberMC::GetEpsilon4Coll() const
1570 //get epsilon4 of binary collisions
1571 if (fNcoll<0) return 0.0;
1572 if (fMeanr2Coll==0.0) return 0.0;
1573 return (TMath::Sqrt(fMeanr2Cos4PhiColl*fMeanr2Cos4PhiColl+fMeanr2Sin4PhiColl*fMeanr2Sin4PhiColl)/fMeanr2Coll);
1574 //return (TMath::Sqrt(fMeanr4Cos4PhiColl*fMeanr4Cos4PhiColl+fMeanr4Sin4PhiColl*fMeanr4Sin4PhiColl)/fMeanr4Coll);
1577 //______________________________________________________________________________
1578 Double_t AliGlauberMC::GetEpsilon5Coll() const
1580 //get epsilon5 of binary collisions
1581 if (fNcoll<0) return 0.0;
1582 if (fMeanr2Coll==0.0) return 0.0;
1583 return (TMath::Sqrt(fMeanr2Cos5PhiColl*fMeanr2Cos5PhiColl+fMeanr2Sin5PhiColl*fMeanr2Sin5PhiColl)/fMeanr2Coll);
1584 //return (TMath::Sqrt(fMeanr5Cos5PhiColl*fMeanr5Cos5PhiColl+fMeanr5Sin5PhiColl*fMeanr5Sin5PhiColl)/fMeanr5Coll);
1587 //______________________________________________________________________________
1588 Double_t AliGlauberMC::GetEpsilon2Com() const
1590 //get epsilon2 of binary collisions
1591 if (fNcom<0) return 0.0;
1592 return (TMath::Sqrt(fMeanr2Cos2PhiCom*fMeanr2Cos2PhiCom+fMeanr2Sin2PhiCom*fMeanr2Sin2PhiCom)/fMeanr2Com);
1595 //______________________________________________________________________________
1596 Double_t AliGlauberMC::GetEpsilon3Com() const
1598 //get epsilon3 of binary collisions
1599 if (fNcom<0) return 0.0;
1600 return (TMath::Sqrt(fMeanr2Cos3PhiCom*fMeanr2Cos3PhiCom+fMeanr2Sin3PhiCom*fMeanr2Sin3PhiCom)/fMeanr2Com);
1601 //return (TMath::Sqrt(fMeanr3Cos3PhiCom*fMeanr3Cos3PhiCom+fMeanr3Sin3PhiCom*fMeanr3Sin3PhiCom)/fMeanr3Com);
1604 //______________________________________________________________________________
1605 Double_t AliGlauberMC::GetEpsilon4Com() const
1607 //get epsilon4 of binary collisions
1608 if (fNcom<0) return 0.0;
1609 return (TMath::Sqrt(fMeanr2Cos4PhiCom*fMeanr2Cos4PhiCom+fMeanr2Sin4PhiCom*fMeanr2Sin4PhiCom)/fMeanr2Com);
1610 //return (TMath::Sqrt(fMeanr4Cos4PhiCom*fMeanr4Cos4PhiCom+fMeanr4Sin4PhiCom*fMeanr4Sin4PhiCom)/fMeanr4Com);
1613 //______________________________________________________________________________
1614 Double_t AliGlauberMC::GetEpsilon5Com() const
1616 //get epsilon5 of binary collisions
1617 if (fNcom<0) return 0.0;
1618 return (TMath::Sqrt(fMeanr2Cos5PhiCom*fMeanr2Cos5PhiCom+fMeanr2Sin5PhiCom*fMeanr2Sin5PhiCom)/fMeanr2Com);
1619 //return (TMath::Sqrt(fMeanr5Cos5PhiCom*fMeanr5Cos5PhiCom+fMeanr5Sin5PhiCom*fMeanr5Sin5PhiCom)/fMeanr5Com);
1622 //______________________________________________________________________________
1623 Double_t AliGlauberMC::GetPsi2() const
1625 return ((TMath::ATan2(fMeanr2Sin2Phi,fMeanr2Cos2Phi)+TMath::Pi())/2);
1628 //______________________________________________________________________________
1629 Double_t AliGlauberMC::GetPsi3() const
1631 return ((TMath::ATan2(fMeanr2Sin3Phi,fMeanr2Cos3Phi)+TMath::Pi())/3);
1632 //return ((TMath::ATan2(fMeanr3Sin3Phi,fMeanr3Cos3Phi)+TMath::Pi())/3);
1635 //______________________________________________________________________________
1636 Double_t AliGlauberMC::GetPsi4() const
1638 return ((TMath::ATan2(fMeanr2Sin4Phi,fMeanr2Cos4Phi)+TMath::Pi())/4);
1639 //return ((TMath::ATan2(fMeanr4Sin4Phi,fMeanr4Cos4Phi)+TMath::Pi())/4);
1642 //______________________________________________________________________________
1643 Double_t AliGlauberMC::GetPsi5() const
1645 return ((TMath::ATan2(fMeanr2Sin5Phi,fMeanr2Cos5Phi)+TMath::Pi())/5);
1646 //return ((TMath::ATan2(fMeanr5Sin5Phi,fMeanr5Cos5Phi)+TMath::Pi())/5);
1649 /*_____________________________________________________________________________
1650 Double_t AliGlauberMC::GetE43Part() const
1652 //get participant eccentricity of participants
1653 if (fNpart<2) return 0.0;
1654 //return ((TMath::Sqrt(fMeanr2Cos2Phi*fMeanr2Cos2Phi+fMeanr2Sin2Phi*fMeanr2Sin2Phi)/fMeanr2) * (TMath::Sqrt(fMeanr2Cos2Phi*fMeanr2Cos2Phi+fMeanr2Sin2Phi*fMeanr2Sin2Phi)/fMeanr2) * (TMath::Sqrt(fMeanr2Cos4Phi*fMeanr2Cos4Phi+fMeanr2Sin4Phi*fMeanr2Sin4Phi)/fMeanr2) * TMath::Cos (((TMath::ATan2(fMeanr2Sin2Phi,fMeanr2Cos2Phi)+TMath::Pi())/2) - ((TMath::ATan2(fMeanr2Sin4Phi,fMeanr2Cos4Phi)+TMath::Pi())/4)));
1655 return ((TMath::Sqrt(fMeanr2Cos2Phi*fMeanr2Cos2Phi+fMeanr2Sin2Phi*fMeanr2Sin2Phi)/fMeanr2) * (TMath::Sqrt(fMeanr2Cos2Phi*fMeanr2Cos2Phi+fMeanr2Sin2Phi*fMeanr2Sin2Phi)/fMeanr2) * (TMath::Sqrt(fMeanr4Cos4Phi*fMeanr4Cos4Phi+fMeanr4Sin4Phi*fMeanr4Sin4Phi)/fMeanr4) * TMath::Cos(((TMath::ATan2(fMeanr2Sin2Phi,fMeanr2Cos2Phi)+TMath::Pi())/2) - ((TMath::ATan2(fMeanr4Sin4Phi,fMeanr4Cos4Phi)+TMath::Pi())/4)));
1659 //______________________________________________________________________________
1660 Double_t AliGlauberMC::GetE43Coll() const
1662 //get epsilon5 of binary collisions
1663 if (fNcoll<2) return 0.0;
1664 //return ((TMath::Sqrt(fMeanr2Cos2PhiColl*fMeanr2Cos2PhiColl+fMeanr2Sin2PhiColl*fMeanr2Sin2PhiColl)/fMeanr2Coll) * (TMath::Sqrt(fMeanr2Cos2PhiColl*fMeanr2Cos2PhiColl+fMeanr2Sin2PhiColl*fMeanr2Sin2PhiColl)/fMeanr2Coll) * (TMath::Sqrt(fMeanr2Cos4PhiColl*fMeanr2Cos4PhiColl+fMeanr2Sin4PhiColl*fMeanr2Sin4PhiColl)/fMeanr2Coll) * TMath::Cos(((TMath::ATan2(fMeanr2Sin2Phi,fMeanr2Cos2Phi)+TMath::Pi())/2) - ((TMath::ATan2(fMeanr2Sin4Phi,fMeanr2Cos4Phi)+TMath::Pi())/4)));
1665 return ((TMath::Sqrt(fMeanr2Cos2PhiColl*fMeanr2Cos2PhiColl+fMeanr2Sin2PhiColl*fMeanr2Sin2PhiColl)/fMeanr2Coll) * (TMath::Sqrt(fMeanr2Cos2PhiColl*fMeanr2Cos2PhiColl+fMeanr2Sin2PhiColl*fMeanr2Sin2PhiColl)/fMeanr2Coll) * (TMath::Sqrt(fMeanr4Cos4PhiColl*fMeanr4Cos4PhiColl+fMeanr4Sin4PhiColl*fMeanr4Sin4PhiColl)/fMeanr4Coll) * TMath::Cos(((TMath::ATan2(fMeanr2Sin2Phi,fMeanr2Cos2Phi)+TMath::Pi())/2) - ((TMath::ATan2(fMeanr4Sin4Phi,fMeanr4Cos4Phi)+TMath::Pi())/4)));
1668 //______________________________________________________________________________
1669 Double_t AliGlauberMC::GetE43Com() const
1671 //get epsilon5 of binary collisions
1672 if (fNcom<2) return 0.0;
1673 //return ((TMath::Sqrt(fMeanr2Cos2PhiCom*fMeanr2Cos2PhiCom+fMeanr2Sin2PhiCom*fMeanr2Sin2PhiCom)/fMeanr2Com) * (TMath::Sqrt(fMeanr2Cos2PhiCom*fMeanr2Cos2PhiCom+fMeanr2Sin2PhiCom*fMeanr2Sin2PhiCom)/fMeanr2Com) * (TMath::Sqrt(fMeanr2Cos4PhiCom*fMeanr2Cos4PhiCom+fMeanr2Sin4PhiCom*fMeanr2Sin4PhiCom)/fMeanr2Com) * TMath::Cos(((TMath::ATan2(fMeanr2Sin2Phi,fMeanr2Cos2Phi)+TMath::Pi())/2) - ((TMath::ATan2(fMeanr2Sin4Phi,fMeanr2Cos4Phi)+TMath::Pi())/4)));
1674 return ((TMath::Sqrt(fMeanr2Cos2PhiCom*fMeanr2Cos2PhiCom+fMeanr2Sin2PhiCom*fMeanr2Sin2PhiCom)/fMeanr2Com) * (TMath::Sqrt(fMeanr2Cos2PhiCom*fMeanr2Cos2PhiCom+fMeanr2Sin2PhiCom*fMeanr2Sin2PhiCom)/fMeanr2Com) * (TMath::Sqrt(fMeanr4Cos4PhiCom*fMeanr4Cos4PhiCom+fMeanr4Sin4PhiCom*fMeanr4Sin4PhiCom)/fMeanr4Com) * TMath::Cos(((TMath::ATan2(fMeanr2Sin2Phi,fMeanr2Cos2Phi)+TMath::Pi())/2) - ((TMath::ATan2(fMeanr4Sin4Phi,fMeanr4Cos4Phi)+TMath::Pi())/4)));
1676 //___________________________________________________________________________
1678 Double_t AliGlauberMC::GetPsi4m2() const
1680 //return (TMath::Cos(4*((TMath::ATan2(fMeanr2Sin4Phi,fMeanr2Cos4Phi)+TMath::Pi())/4) - ((TMath::ATan2(fMeanr2Sin2Phi,fMeanr2Cos2Phi)+TMath::Pi())/2)));
1681 return (TMath::Cos(4*(((TMath::ATan2(fMeanr4Sin4Phi,fMeanr4Cos4Phi)+TMath::Pi())/4)-((TMath::ATan2(fMeanr2Sin2Phi,fMeanr2Cos2Phi)+TMath::Pi())/2))));
1684 //______________________________________________________________________________
1685 void AliGlauberMC::Run(Int_t nevents)
1688 cout << "Generating " << nevents << " events..." << endl;
1689 TString name(Form("nt_%s_%s",fANucleus.GetName(),fBNucleus.GetName()));
1690 TString title(Form("%s + %s (x-sect = %d mb)",fANucleus.GetName(),fBNucleus.GetName(),(Int_t) fXSect));
1693 fnt = new TNtuple(name,title,
1694 "Npart:Ncoll:B:MeanX:MeanY:MeanX2:MeanY2:MeanXY:VarX:VarY:VarXY:MeanXSystem:MeanYSystem:MeanXA:MeanYA:MeanXB:MeanYB:VarE:Stoa:VarEColl:VarECom:VarEPart:VarEPartColl:VarEPartCom:dNdEta:dNdEtaGBW:dNdEtaTwoNBD:xsect:tAA:Epsl2:Epsl3:Epsl4:Epsl5:E2Coll:E3Coll:E4Coll:E5Coll:E2Com:E3Com:E4Com:E5Com:Psi2:Psi3:Psi4:Psi5:BNN:signn:Ncollw");
1695 fnt->SetDirectory(0);
1699 for (Int_t i = 0; i<nevents; i++)
1715 v[5] = fMeanX2Parts;
1716 v[6] = fMeanY2Parts;
1717 v[7] = fMeanXYParts;
1721 v[11] = fMeanXSystem;
1722 v[12] = fMeanYSystem;
1727 v[17] = GetEccentricity();
1729 v[19] = GetEccentricityColl();
1730 v[20] = GetEccentricityCom();
1731 v[21] = GetEccentricityPart();
1732 v[22] = GetEccentricityPartColl();
1733 v[23] = GetEccentricityPartCom();
1736 v[24] = GetdNdEta();
1737 v[25] = GetdNdEta();
1738 v[26] = v[24]+v[25];
1749 if (GetNcoll()>0) mytAA=GetNcoll()/fXSect;
1751 //_____________epsilon2,3,4,4_______
1752 v[29] = GetEpsilon2Part();
1753 v[30] = GetEpsilon3Part();
1754 v[31] = GetEpsilon4Part();
1755 v[32] = GetEpsilon5Part();
1756 v[33] = GetEpsilon2Coll();
1757 v[34] = GetEpsilon3Coll();
1758 v[35] = GetEpsilon4Coll();
1759 v[36] = GetEpsilon5Coll();
1760 v[37] = GetEpsilon2Com();
1761 v[38] = GetEpsilon3Com();
1762 v[39] = GetEpsilon4Com();
1763 v[40] = GetEpsilon5Com();
1775 if ((i%100)==0) std::cout << "Generating Event # " << i << "... \r" << flush;
1777 std::cout << "Generating Event # " << nevents << "... \r" << endl << "Done! Succesfull events: " << q << " discarded events: " << u <<"."<< endl;
1780 //---------------------------------------------------------------------------------
1781 void AliGlauberMC::RunAndSaveNtuple( Int_t n,
1782 const Option_t *sysA,
1783 const Option_t *sysB,
1791 AliGlauberMC mcg(sysA,sysB,signn);
1792 mcg.SetMinDistance(mind);
1796 TNtuple *nt=mcg.GetNtuple();
1797 TFile out(fname,"recreate",fname,9);
1799 printf("total cross section with a nucleon-nucleon cross section \t%f is \t%f",signn,mcg.GetTotXSect());
1803 //---------------------------------------------------------------------------------
1804 void AliGlauberMC::RunAndSaveNucleons( Int_t n,
1805 const Option_t *sysA,
1807 const Double_t signn,
1813 AliGlauberMC mcg(sysA,sysB,signn);
1814 mcg.SetMinDistance(mind);
1817 out=new TFile(fname,"recreate",fname,9);
1819 for(Int_t ievent=0; ievent<n; ievent++)
1822 //get an event with at least one collision
1823 while(!mcg.NextEvent()) {}
1825 //access, save and (if wanted) print out nucleons
1826 TObjArray* nucleons=mcg.GetNucleons();
1827 if(!nucleons) continue;
1829 nucleons->Write(Form("nucleonarray%d",ievent),TObject::kSingleKey);
1833 cout<<endl<<endl<<"EVENT NO: "<<ievent<<endl;
1834 cout<<"B = "<<mcg.GetB()<<" Npart = "<<mcg.GetNpart()<<endl<<endl;
1835 printf("Nucleus\t X\t Y\t Z\tNcoll\n");
1836 Int_t nNucls=nucleons->GetEntries();
1837 for(Int_t iNucl=0; iNucl<nNucls; iNucl++)
1839 AliGlauberNucleon *nucl=(AliGlauberNucleon *)nucleons->UncheckedAt(iNucl);
1841 if(nucl->IsInNucleusB()) nucleus='B';
1842 Double_t x=nucl->GetX();
1843 Double_t y=nucl->GetY();
1844 Double_t z=nucl->GetZ();
1845 Int_t ncoll=nucl->GetNColl();
1846 printf(" %c\t%2.2f\t%2.2f\t%2.2f\t%3d\n",nucleus,x,y,z,ncoll);
1853 //---------------------------------------------------------------------------------
1854 void AliGlauberMC::Reset()