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 **************************************************************************/
18 // This class implements an interface to the Ampt event generator
20 #include <TClonesArray.h>
21 #include <TObjArray.h>
22 #include <TParticle.h>
27 #include "AliAmptRndm.h"
30 # define amptset amptset_
31 # define amptsetdef amptsetdef_
33 # define invflv invflv_
34 # define profile profile_
35 # define rluget_ampt rluget_ampt_
36 # define rluset_ampt rluset_ampt_
39 # define amptset AMPTSET
40 # define amptsetdef AMPTSETDEF
42 # define invflv INVFLV
43 # define profile PROFILE
44 # define rluget_ampt RLUGET_AMPT
45 # define rluset_ampt RLUSET_AMPT
46 # define type_of_call _stdcall
50 extern "C" void type_of_call amptset(Double_t & , const char *,
51 const char *, const char *,
52 Int_t & , Int_t &, Int_t &,
54 const int, const int);
55 extern "C" void type_of_call amptsetdef();
56 extern "C" void type_of_call ampt(const char *, Double_t &,
57 Double_t &, const int);
58 extern "C" Int_t type_of_call invflv(Int_t &);
59 extern "C" float type_of_call profile(Float_t &);
60 extern "C" void type_of_call rluget_ampt(Int_t & lfn, Int_t & move);
61 extern "C" void type_of_call rluset_ampt(Int_t & lfn, Int_t & move);
69 //______________________________________________________________________________
71 : TGenerator("Ampt","Ampt"),
84 // Default constructor
88 //______________________________________________________________________________
89 TAmpt::TAmpt(Double_t efrm, const char *frame="CMS",
90 const char *proj="A", const char *targ="A",
91 Int_t iap=207, Int_t izp=82, Int_t iat=207, Int_t izt=82,
92 Double_t bmin=0, Double_t bmax=20)
93 : TGenerator("Ampt","Ampt"),
106 // TAmpt constructor:
107 // Note that there may be only one functional TAmpt object
108 // at a time, so it's not useful to create more than one
113 //______________________________________________________________________________
119 //______________________________________________________________________________
120 TObjArray* TAmpt::ImportParticles(Option_t */*option*/)
122 // Import created particles.
125 Int_t numpart = HBT.nlast;
126 printf("TAmpt: AMPT stack contains %d particles.\n", numpart);
128 for (Int_t i=0; i < numpart; ++i) {
130 Double_t px = HBT.plast[i][0];//GeV/c
131 Double_t py = HBT.plast[i][1];//GeV/c
132 Double_t pz = HBT.plast[i][2];//GeV/c
133 Double_t ma = HBT.plast[i][3];//GeV/c/c
134 Double_t vx = 0;//HBT.xlast[i][0]*1e-12;//mm
135 Double_t vy = 0;//HBT.xlast[i][1]*1e-12;//mm
136 Double_t vz = 0;//HBT.xlast[i][2]*1e-12;//mm
137 Double_t vt = 0;//HBT.xlast[i][3]*1e-12;//mm/c
138 //Double_t vx = HBT.xlast[i][0]*1e-12;//mm
139 //Double_t vy = HBT.xlast[i][1]*1e-12;//mm
140 //Double_t vz = HBT.xlast[i][2]*1e-12;//mm
141 //Double_t vt = HBT.xlast[i][3]*1e-12;//mm/c
143 // Rotate xy components of vectors to new reaction plane:
144 Double_t pxp=TMath::Cos(fPsi)*px - TMath::Sin(fPsi)*py;
145 Double_t pyp=TMath::Sin(fPsi)*px + TMath::Cos(fPsi)*py;
146 Double_t vxp=TMath::Cos(fPsi)*vx - TMath::Sin(fPsi)*vy;
147 Double_t vyp=TMath::Sin(fPsi)*vx + TMath::Cos(fPsi)*vy;
149 Int_t pdg = invflv(HBT.lblast[i]);
150 TParticle *p = new TParticle(pdg,
159 TMath::Sqrt(ma*ma+px*px+py*py+pz*pz),
164 if((px==0)&&(py==0)) {
176 //______________________________________________________________________________
177 Int_t TAmpt::ImportParticles(TClonesArray *particles, Option_t */*option*/)
179 // Import created particles.
184 TClonesArray &particlesR = *particles;
187 Int_t numpart = HBT.nlast;
188 printf("TAmpt: AMPT stack contains %d particles.\n", numpart);
190 //at this point not clear how to read particle history, just take primaries.
191 for (Int_t i=0; i < numpart; ++i) {
193 Double_t px = HBT.plast[i][0];//GeV/c
194 Double_t py = HBT.plast[i][1];//GeV/c
195 Double_t pz = HBT.plast[i][2];//GeV/c
196 Double_t ma = HBT.plast[i][3];//GeV/c/c
197 Double_t vx = 0;//HBT.xlast[i][0]*1e-12;//mm
198 Double_t vy = 0;//HBT.xlast[i][1]*1e-12;//mm
199 Double_t vz = 0;//HBT.xlast[i][2]*1e-12;//mm
200 Double_t vt = 0;//HBT.xlast[i][3]*1e-12;//mm/c
201 //Double_t vx = HBT.xlast[i][0]*1e-12;//mm
202 //Double_t vy = HBT.xlast[i][1]*1e-12;//mm
203 //Double_t vz = HBT.xlast[i][2]*1e-12;//mm
204 //Double_t vt = HBT.xlast[i][3]*1e-12;//mm/c
206 // Rotate xy components of vectors to new reaction plane:
207 Double_t pxp=TMath::Cos(fPsi)*px - TMath::Sin(fPsi)*py;
208 Double_t pyp=TMath::Sin(fPsi)*px + TMath::Cos(fPsi)*py;
209 Double_t vxp=TMath::Cos(fPsi)*vx - TMath::Sin(fPsi)*vy;
210 Double_t vyp=TMath::Sin(fPsi)*vx + TMath::Cos(fPsi)*vy;
212 Int_t pdg = invflv(HBT.lblast[i]);
213 //printf("i %d pdg %d px %f py %f pz %f vx %f vy %f vz %f vt %f\n", i, pdg, px, py, pz, vx, vy, vz, vt);
214 new(particlesR[i]) TParticle(pdg,
223 TMath::Sqrt(ma*ma+px*px+py*py+pz*pz),
228 if((px==0)&&(py==0)){
230 particlesR[i]->SetUniqueID(0);
232 particlesR[i]->SetUniqueID(10);
234 particlesR[i]->SetUniqueID(999);
239 //______________________________________________________________________________
240 Int_t TAmpt::ImportNucleons(TClonesArray *nucleons, Option_t */*option*/)
242 // Import created particles.
247 TClonesArray &nucleonsR = *nucleons;
250 Int_t nA = HPARNT.ihnt2[0];
251 for (Int_t i=0; i < nA; ++i) {
252 Double_t x = HJCRDN.yp[i][0] + 0.5*GetBB();
253 Double_t y = HJCRDN.yp[i][1];
254 Double_t z = HJCRDN.yp[i][2];
256 // Rotate xy components of vectors to new reaction plane:
257 Double_t xp=TMath::Cos(fPsi)*x - TMath::Sin(fPsi)*y;
258 Double_t yp=TMath::Sin(fPsi)*x + TMath::Cos(fPsi)*y;
260 Int_t p = HSTRNG.nfp[3][i];
261 Int_t s = HSTRNG.nfp[4][i];
262 new(nucleonsR[i]) TParticle(p,
276 nucleonsR[i]->SetUniqueID(1);
278 Int_t nB = HPARNT.ihnt2[2];
279 for (Int_t i=0; i < nB; ++i) {
280 Double_t x = HJCRDN.yt[i][0] - 0.5*HPARNT.hint1[18];
281 Double_t y = HJCRDN.yt[i][1];
282 Double_t z = HJCRDN.yt[i][2];
284 // Rotate xy components of vectors to new reaction plane:
285 Double_t xp=TMath::Cos(fPsi)*x - TMath::Sin(fPsi)*y;
286 Double_t yp=TMath::Sin(fPsi)*x + TMath::Cos(fPsi)*y;
288 Int_t p = HSTRNG.nft[3][i];
289 Int_t s = HSTRNG.nft[4][i];
290 new(nucleonsR[nA+i]) TParticle(p,
304 nucleonsR[nA+i]->SetUniqueID(-1);
309 //______________________________________________________________________________
310 void TAmpt::SetEFRM(Float_t efrm)
312 // Set the centre of mass (CMS) or lab-energy (LAB)
316 //______________________________________________________________________________
317 void TAmpt::SetFRAME(const char* frame)
319 // Set the frame type ("CMS" or "LAB")
323 //______________________________________________________________________________
324 void TAmpt::SetPROJ(const char* proj)
326 // Set the projectile type
330 //______________________________________________________________________________
331 void TAmpt::SetTARG(const char* targ)
333 // Set the target type
337 //______________________________________________________________________________
338 void TAmpt::SetIAP(Int_t iap)
340 // Set the projectile atomic number
344 //______________________________________________________________________________
345 void TAmpt::SetIZP(Int_t izp)
347 // Set the projectile charge number
351 //______________________________________________________________________________
352 void TAmpt::SetIAT(Int_t iat)
354 // Set the target atomic number
358 //______________________________________________________________________________
359 void TAmpt::SetIZT(Int_t izt)
361 // Set the target charge number
365 //______________________________________________________________________________
366 void TAmpt::SetBMIN(Float_t bmin)
368 // Set the minimum impact parameter
372 //______________________________________________________________________________
373 void TAmpt::SetBMAX(Float_t bmax)
375 // Set the maximum impact parameter
379 //______________________________________________________________________________
380 Float_t TAmpt::GetEFRM() const
382 // Get the centre of mass (CMS) or lab-energy (LAB)
386 //______________________________________________________________________________
387 const char* TAmpt::GetFRAME() const
389 // Get the frame type ("CMS" or "LAB")
390 return fFrame.Data();
393 //______________________________________________________________________________
394 const char* TAmpt::GetPROJ() const
396 // Get the projectile type
400 //______________________________________________________________________________
401 const char* TAmpt::GetTARG() const
403 // Set the target type
407 //______________________________________________________________________________
408 Int_t TAmpt::GetIAP() const
410 // Get the projectile atomic number
414 //______________________________________________________________________________
415 Int_t TAmpt::GetIZP() const
417 // Get the projectile charge number
421 //______________________________________________________________________________
422 Int_t TAmpt::GetIAT() const
424 // Get the target atomic number
428 //______________________________________________________________________________
429 Int_t TAmpt::GetIZT() const
431 // Get the target charge number
435 //______________________________________________________________________________
436 Float_t TAmpt::GetBMIN() const
438 // Get the minimum impact parameter
442 //______________________________________________________________________________
443 Float_t TAmpt::GetBMAX() const
445 // Get the maximum impact parameter
449 //====================== access to common HIPARNT ===============================
451 //______________________________________________________________________________
452 void TAmpt::SetHIPR1(Int_t key,Float_t value)
454 // Set the values of array HIPR1 in common HIPARNT
455 if ( key<1 || key>100 ) {
456 printf ("ERROR in TAmpt:SetHIPR1(key,value): \n ");
457 printf (" key=%i is out of range [1..100]!\n",key);
460 HPARNT.hipr1[key-1]=value;
463 //______________________________________________________________________________
464 Float_t TAmpt::GetHIPR1(Int_t key) const
466 // Get the values of array HIPR1 in common HIPARNT
467 if ( key<1 || key>100 ) {
468 printf ("ERROR in TAmpt:GetHIPR1(key): \n ");
469 printf (" key=%i is out of range [1..100]!\n",key);
472 return HPARNT.hipr1[key-1];
475 //______________________________________________________________________________
476 void TAmpt::SetIHPR2(Int_t key,Int_t value)
478 // Set the values of array HIPR2 in common HIPARNT
479 if ( key<1 || key>50 ) {
480 printf ("ERROR in TAmpt:SetIHPR2(key,value): \n ");
481 printf (" key=%i is out of range [1..50]!\n",key);
484 HPARNT.ihpr2[key-1]=value;
487 //______________________________________________________________________________
488 Int_t TAmpt::GetIHPR2(Int_t key) const
490 // Get the values of array HIPR2 in common HIPARNT
491 if ( key<1 || key>50 ) {
492 printf ("ERROR in TAmpt:GetIHPR2(key): \n ");
493 printf (" key=%i is out of range [1..50]!\n",key);
496 return HPARNT.ihpr2[key-1];
499 //______________________________________________________________________________
500 Float_t TAmpt::GetHINT1(Int_t key) const
502 // Get the values of array HINT1 in common HIPARNT
503 if ( key<1 || key>100 ) {
504 printf ("ERROR in TAmpt:GetHINT1(key): \n ");
505 printf (" key=%i is out of range [1..100]!\n",key);
508 return HPARNT.hint1[key-1];
511 //______________________________________________________________________________
512 Int_t TAmpt::GetIHNT2(Int_t key) const
514 // Get the values of array HINT2 in common HIPARNT
515 if ( key<1 || key>50 ) {
516 printf ("ERROR in TAmpt:GetIHNT2(key): \n ");
517 printf (" key=%i is out of range [1..50]!\n",key);
520 return HPARNT.ihnt2[key-1];
523 //====================== access to common HMAIN1 ===============================
525 //______________________________________________________________________________
526 Int_t TAmpt::GetNATT() const
528 // Get the number of particles produces
532 //______________________________________________________________________________
533 Float_t TAmpt::GetEATT() const
535 // Get total energy of particles
539 //______________________________________________________________________________
540 Int_t TAmpt::GetJATT() const
542 // Get number of hard scatterings
546 //______________________________________________________________________________
547 Int_t TAmpt::GetNT() const
549 // Get number of target participants
553 //______________________________________________________________________________
554 Int_t TAmpt::GetNP() const
556 // Get number of projectile participants
560 //______________________________________________________________________________
561 Int_t TAmpt::GetN0() const
563 // Get number of N-N collisions
567 //______________________________________________________________________________
568 Int_t TAmpt::GetN01() const
570 // Get number of N-wounded collisions
574 //______________________________________________________________________________
575 Int_t TAmpt::GetN10() const
577 // Get number of wounded-N collisions
581 //______________________________________________________________________________
582 Int_t TAmpt::GetN11() const
584 // Get number of wounded-wounded collisions
588 //______________________________________________________________________________
589 Float_t TAmpt::GetBB() const
591 // Get impact parameter
593 return HPARNT.hint1[18];
596 //====================== access to common HMAIN2 ===============================
598 //______________________________________________________________________________
599 Int_t TAmpt::GetKATT(Int_t key1, Int_t key2) const
601 // Get values of array KATT in common HMAIN2
602 if ( key1<1 || key1> _MAXNPARTICLE_ ) {
603 printf("ERROR in TAmpt::GetKATT(key1,key2):\n");
604 printf(" key1=%i is out of range [1..%d]\n",key1,_MAXNPARTICLE_);
607 if ( key2<1 || key2>4 ) {
608 printf("ERROR in TAmpt::GetKATT(key1,key2):\n");
609 printf(" key2=%i is out of range [1..4]\n",key2);
612 return HMAIN2.katt[key2-1][key1-1];
615 //______________________________________________________________________________
616 Float_t TAmpt::GetPATT(Int_t key1, Int_t key2) const
618 // Get values of array PATT in common HMAIN2
619 if ( key1<1 || key1>_MAXNPARTICLE_ ) {
620 printf("ERROR in TAmpt::GetPATT(key1,key2):\n");
621 printf(" key1=%i is out of range [1..130000]\n",key1);
624 if ( key2<1 || key2>4 ) {
625 printf("ERROR in TAmpt::GetPATT(key1,key2):\n");
626 printf(" key2=%i is out of range [1..4]\n",key2);
629 return HMAIN2.patt[key2-1][key1-1];
632 //______________________________________________________________________________
633 Float_t TAmpt::GetVATT(Int_t key1, Int_t key2) const
635 // Get values of array VATT in common HMAIN2
636 if ( key1<1 || key1>_MAXNPARTICLE_ ) {
637 printf("ERROR in TAmpt::GetVATT(key1,key2):\n");
638 printf(" key1=%i is out of range [1..130000]\n",key1);
641 if ( key2<1 || key2>4 ) {
642 printf("ERROR in TAmpt::GetVATT(key1,key2):\n");
643 printf(" key2=%i is out of range [1..4]\n",key2);
646 return HMAIN2.vatt[key2-1][key1-1];
649 //====================== access to common HIJJET1 ===============================
651 //______________________________________________________________________________
652 Int_t TAmpt::GetNPJ(Int_t key) const
654 // Get values of array NPJ of common HIJJET1
655 if ( key<1 || key>300 ) {
656 printf("ERROR in TAmpt::GetNPJ(key):\n");
657 printf(" key=%i is out of range [1..300]\n",key);
660 return HJJET1.npj[key-1];
663 //______________________________________________________________________________
664 Int_t TAmpt::GetKFPJ(Int_t key1, Int_t key2) const
666 // Get values of array KFPJ in common HIJJET1
667 if ( key1<1 || key1>300 ) {
668 printf("ERROR in TAmpt::GetKFPJ(key1):\n");
669 printf(" key1=%i is out of range [1..300]\n",key1);
672 if ( key2<1 || key2>500 ) {
673 printf("ERROR in TAmpt::GetKFPJ(key1,key2):\n");
674 printf(" key2=%i is out of range [1..500]\n",key2);
677 return HJJET1.kfpj[key2-1][key1-1];
680 //______________________________________________________________________________
681 Float_t TAmpt::GetPJPX(Int_t key1, Int_t key2) const
683 // Get values of array PJPX in common HIJJET1
684 if ( key1<1 || key1>300 ) {
685 printf("ERROR in TAmpt::GetPJPX(key1):\n");
686 printf(" key1=%i is out of range [1..300]\n",key1);
689 if ( key2<1 || key2>500 ) {
690 printf("ERROR in TAmpt::GetPJPX(key1,key2):\n");
691 printf(" key2=%i is out of range [1..500]\n",key2);
694 return HJJET1.pjpx[key2-1][key1-1];
697 //______________________________________________________________________________
698 Float_t TAmpt::GetPJPY(Int_t key1, Int_t key2) const
700 // Get values of array PJPY in common HIJJET1
701 if ( key1<1 || key1>300 ) {
702 printf("ERROR in TAmpt::GetPJPY(key1):\n");
703 printf(" key1=%i is out of range [1..300]\n",key1);
706 if ( key2<1 || key2>500 ) {
707 printf("ERROR in TAmpt::GetPJPY(key1,key2):\n");
708 printf(" key2=%i is out of range [1..500]\n",key2);
711 return HJJET1.pjpy[key2-1][key1-1];
714 //______________________________________________________________________________
715 Float_t TAmpt::GetPJPZ(Int_t key1, Int_t key2) const
717 // Get values of array PJPZ in common HIJJET1
718 if ( key1<1 || key1>300 ) {
719 printf("ERROR in TAmpt::GetPJPZ(key1):\n");
720 printf(" key1=%i is out of range [1..300]\n",key1);
723 if ( key2<1 || key2>500 ) {
724 printf("ERROR in TAmpt::GetPJPZ(key1,key2):\n");
725 printf(" key2=%i is out of range [1..500]\n",key2);
728 return HJJET1.pjpz[key2-1][key1-1];
731 //______________________________________________________________________________
732 Float_t TAmpt::GetPJPE(Int_t key1, Int_t key2) const
734 // Get values of array PJPE in common HIJJET1
735 if ( key1<1 || key1>300 ) {
736 printf("ERROR in TAmpt::GetPJPE(key1):\n");
737 printf(" key1=%i is out of range [1..300]\n",key1);
740 if ( key2<1 || key2>500 ) {
741 printf("ERROR in TAmpt::GetPJPE(key1,key2):\n");
742 printf(" key2=%i is out of range [1..500]\n",key2);
745 return HJJET1.pjpe[key2-1][key1-1];
748 //______________________________________________________________________________
749 Float_t TAmpt::GetPJPM(Int_t key1, Int_t key2) const
751 // Get values of array PJPM in common HIJJET1
752 if ( key1<1 || key1>300 ) {
753 printf("ERROR in TAmpt::GetPJPM(key1):\n");
754 printf(" key1=%i is out of range [1..300]\n",key1);
757 if ( key2<1 || key2>500 ) {
758 printf("ERROR in TAmpt::GetPJPM(key1,key2):\n");
759 printf(" key2=%i is out of range [1..500]\n",key2);
762 return HJJET1.pjpm[key2-1][key1-1];
765 //______________________________________________________________________________
766 Int_t TAmpt::GetNTJ(Int_t key) const
768 // Get values of array NTJ in common HIJJET1
769 if ( key<1 || key>300 ) {
770 printf("ERROR in TAmpt::GetNTJ(key):\n");
771 printf(" key=%i is out of range [1..300]\n",key);
774 return HJJET1.ntj[key-1];
777 //______________________________________________________________________________
778 Int_t TAmpt::GetKFTJ(Int_t key1, Int_t key2) const
780 // Get values of array KFTJ in common HIJJET1
781 if ( key1<1 || key1>300 ) {
782 printf("ERROR in TAmpt::GetKFTJ(key1):\n");
783 printf(" key1=%i is out of range [1..300]\n",key1);
786 if ( key2<1 || key2>500 ) {
787 printf("ERROR in TAmpt::GetKFTJ(key1,key2):\n");
788 printf(" key2=%i is out of range [1..500]\n",key2);
791 return HJJET1.kftj[key2-1][key1-1];
794 //______________________________________________________________________________
795 Float_t TAmpt::GetPJTX(Int_t key1, Int_t key2) const
797 // Get values of array PJTX in common HIJJET1
798 if ( key1<1 || key1>300 ) {
799 printf("ERROR in TAmpt::GetPJTX(key1):\n");
800 printf(" key1=%i is out of range [1..300]\n",key1);
803 if ( key2<1 || key2>500 ) {
804 printf("ERROR in TAmpt::GetPJTX(key1,key2):\n");
805 printf(" key2=%i is out of range [1..500]\n",key2);
808 return HJJET1.pjtx[key2-1][key1-1];
811 //______________________________________________________________________________
812 Float_t TAmpt::GetPJTY(Int_t key1, Int_t key2) const
814 // Get values of array PJTY in common HIJJET1
815 if ( key1<1 || key1>300 ) {
816 printf("ERROR in TAmpt::GetPJTY(key1):\n");
817 printf(" key1=%i is out of range [1..300]\n",key1);
820 if ( key2<1 || key2>500 ) {
821 printf("ERROR in TAmpt::GetPJTY(key1,key2):\n");
822 printf(" key2=%i is out of range [1..500]\n",key2);
825 return HJJET1.pjty[key2-1][key1-1];
828 //______________________________________________________________________________
829 Float_t TAmpt::GetPJTZ(Int_t key1, Int_t key2) const
831 // Get values of array PJTZ in common HIJJET1
832 if ( key1<1 || key1>300 ) {
833 printf("ERROR in TAmpt::GetPJTZ(key1):\n");
834 printf(" key1=%i is out of range [1..300]\n",key1);
837 if ( key2<1 || key2>500 ) {
838 printf("ERROR in TAmpt::GetPJTZ(key1,key2):\n");
839 printf(" key2=%i is out of range [1..500]\n",key2);
842 return HJJET1.pjtz[key2-1][key1-1];
845 //______________________________________________________________________________
846 Float_t TAmpt::GetPJTE(Int_t key1, Int_t key2) const
848 // Get values of array PJTE in common HIJJET1
849 if ( key1<1 || key1>300 ) {
850 printf("ERROR in TAmpt::GetPJTE(key1):\n");
851 printf(" key1=%i is out of range [1..300]\n",key1);
854 if ( key2<1 || key2>500 ) {
855 printf("ERROR in TAmpt::GetPJTE(key1,key2):\n");
856 printf(" key2=%i is out of range [1..500]\n",key2);
859 return HJJET1.pjte[key2-1][key1-1];
862 //______________________________________________________________________________
863 Float_t TAmpt::GetPJTM(Int_t key1, Int_t key2) const
865 // Get values of array PJTM in common HIJJET1
866 if ( key1<1 || key1>300 ) {
867 printf("ERROR in TAmpt::GetPJTM(key1):\n");
868 printf(" key1=%i is out of range [1..300]\n",key1);
871 if ( key2<1 || key2>500 ) {
872 printf("ERROR in TAmpt::GetPJTM(key1,key2):\n");
873 printf(" key2=%i is out of range [1..500]\n",key2);
876 return HJJET1.pjtm[key2-1][key1-1];
879 //====================== access to common HIJJET1 ===============================
881 //______________________________________________________________________________
882 Int_t TAmpt::GetNSG() const
884 // Get value of NSG in common HIJJET2
888 //______________________________________________________________________________
889 Int_t TAmpt::GetNJSG(Int_t key) const
891 // Get values of array NJSG in common HIJJET2
892 if ( key<1 || key>900 ) {
893 printf ("ERROR in TAmpt:GetNJSG(key): \n ");
894 printf (" key=%i is out of range [1..900]!\n",key);
897 return HJJET2.njsg[key-1];
900 //______________________________________________________________________________
901 Int_t TAmpt::GetIASG(Int_t key1, Int_t key2) const
903 // Get values of IASG in common HIJJET2
904 if ( key1<1 || key1>900 ) {
905 printf("ERROR in TAmpt::GetIASG(key1):\n");
906 printf(" key1=%i is out of range [1..900]\n",key1);
909 if ( key2<1 || key2>3 ) {
910 printf("ERROR in TAmpt::GetIASG(key1,key2):\n");
911 printf(" key2=%i is out of range [1..3]\n",key2);
914 return HJJET2.iasg[key2-1][key1-1];
917 //______________________________________________________________________________
918 Int_t TAmpt::GetK1SG(Int_t key1, Int_t key2) const
920 // Get values of K1SG in common HIJJET2
921 if ( key1<1 || key1>900 ) {
922 printf("ERROR in TAmpt::GetK1SG(key1):\n");
923 printf(" key1=%i is out of range [1..900]\n",key1);
926 if ( key2<1 || key2>100 ) {
927 printf("ERROR in TAmpt::GetK1SG(key1,key2):\n");
928 printf(" key2=%i is out of range [1..100]\n",key2);
931 return HJJET2.k1sg[key2-1][key1-1];
934 //______________________________________________________________________________
935 Int_t TAmpt::GetK2SG(Int_t key1, Int_t key2) const
937 // Get values of K2SG in common HIJJET2
938 if ( key1<1 || key1>900 ) {
939 printf("ERROR in TAmpt::GetK2SG(key1):\n");
940 printf(" key1=%i is out of range [1..900]\n",key1);
943 if ( key2<1 || key2>100 ) {
944 printf("ERROR in TAmpt::GetK2SG(key1,key2):\n");
945 printf(" key2=%i is out of range [1..100]\n",key2);
948 return HJJET2.k2sg[key2-1][key1-1];
951 //______________________________________________________________________________
952 Float_t TAmpt::GetPXSG(Int_t key1, Int_t key2) const
954 // Get values of PXSG in common HIJJET2
955 if ( key1<1 || key1>900 ) {
956 printf("ERROR in TAmpt::GetPXSG(key1):\n");
957 printf(" key1=%i is out of range [1..900]\n",key1);
960 if ( key2<1 || key2>100 ) {
961 printf("ERROR in TAmpt::GetPXSG(key1,key2):\n");
962 printf(" key2=%i is out of range [1..100]\n",key2);
965 return HJJET2.pxsg[key2-1][key1-1];
968 //______________________________________________________________________________
969 Float_t TAmpt::GetPYSG(Int_t key1, Int_t key2) const
971 // Get values of PYSG in common HIJJET2
972 if ( key1<1 || key1>900 ) {
973 printf("ERROR in TAmpt::GetPYSG(key1):\n");
974 printf(" key1=%i is out of range [1..900]\n",key1);
977 if ( key2<1 || key2>100 ) {
978 printf("ERROR in TAmpt::GetPYSG(key1,key2):\n");
979 printf(" key2=%i is out of range [1..100]\n",key2);
982 return HJJET2.pysg[key2-1][key1-1];
985 //______________________________________________________________________________
986 Float_t TAmpt::GetPZSG(Int_t key1, Int_t key2) const
988 // Get values of PZSG in common HIJJET2
989 if ( key1<1 || key1>900 ) {
990 printf("ERROR in TAmpt::GetPZSG(key1):\n");
991 printf(" key1=%i is out of range [1..900]\n",key1);
994 if ( key2<1 || key2>100 ) {
995 printf("ERROR in TAmpt::GetPZSG(key1,key2):\n");
996 printf(" key2=%i is out of range [1..100]\n",key2);
999 return HJJET2.pzsg[key2-1][key1-1];
1002 //______________________________________________________________________________
1003 Float_t TAmpt::GetPESG(Int_t key1, Int_t key2) const
1005 // Get values of PESG in common HIJJET2
1006 if ( key1<1 || key1>900 ) {
1007 printf("ERROR in TAmpt::GetPESG(key1):\n");
1008 printf(" key1=%i is out of range [1..900]\n",key1);
1011 if ( key2<1 || key2>100 ) {
1012 printf("ERROR in TAmpt::GetPESG(key1,key2):\n");
1013 printf(" key2=%i is out of range [1..100]\n",key2);
1016 return HJJET2.pesg[key2-1][key1-1];
1019 //______________________________________________________________________________
1020 Float_t TAmpt::GetPMSG(Int_t key1, Int_t key2) const
1022 // Get values of PMSG in common HIJJET2
1023 if ( key1<1 || key1>900 ) {
1024 printf("ERROR in TAmpt::GetPMSG(key1):\n");
1025 printf(" key1=%i is out of range [1..900]\n",key1);
1028 if ( key2<1 || key2>100 ) {
1029 printf("ERROR in TAmpt::GetPMSG(key1,key2):\n");
1030 printf(" key2=%i is out of range [1..100]\n",key2);
1033 return HJJET2.pmsg[key2-1][key1-1];
1036 //====================== access to common HISTRNG ===============================
1038 //______________________________________________________________________________
1039 Int_t TAmpt::GetNFP(Int_t key1, Int_t key2) const
1041 // Get values of array NFP in common HISTRNG
1042 if ( key1<1 || key1>300 ) {
1043 printf("ERROR in TAmpt::GetNFP(key1):\n");
1044 printf(" key1=%i is out of range [1..300]\n",key1);
1047 if ( key2<1 || key2>15 ) {
1048 printf("ERROR in TAmpt::GetNFP(key1,key2):\n");
1049 printf(" key2=%i is out of range [1..15]\n",key2);
1052 return HSTRNG.nfp[key2-1][key1-1];
1055 //______________________________________________________________________________
1056 Float_t TAmpt::GetPP(Int_t key1, Int_t key2) const
1058 // Get values of array PP in common HISTRNG
1059 if ( key1<1 || key1>300 ) {
1060 printf("ERROR in TAmpt::GetPP(key1):\n");
1061 printf(" key1=%i is out of range [1..300]\n",key1);
1064 if ( key2<1 || key2>15 ) {
1065 printf("ERROR in TAmpt::GetPP(key1,key2):\n");
1066 printf(" key2=%i is out of range [1..15]\n",key2);
1069 return HSTRNG.pp[key2-1][key1-1];
1072 //______________________________________________________________________________
1073 Int_t TAmpt::GetNFT(Int_t key1, Int_t key2) const
1075 // Get values of array NFT in common HISTRNG
1076 if ( key1<1 || key1>300 ) {
1077 printf("ERROR in TAmpt::GetNFT(key1):\n");
1078 printf(" key1=%i is out of range [1..300]\n",key1);
1081 if ( key2<1 || key2>15 ) {
1082 printf("ERROR in TAmpt::GetNFT(key1,key2):\n");
1083 printf(" key2=%i is out of range [1..15]\n",key2);
1086 return HSTRNG.nft[key2-1][key1-1];
1089 //______________________________________________________________________________
1090 Float_t TAmpt::GetPT(Int_t key1, Int_t key2) const
1092 // Get values of array PT in common HISTRNG
1093 if ( key1<1 || key1>300 ) {
1094 printf("ERROR in TAmpt::GetPT(key1):\n");
1095 printf(" key1=%i is out of range [1..300]\n",key1);
1098 if ( key2<1 || key2>15 ) {
1099 printf("ERROR in TAmpt::GetPT(key1,key2):\n");
1100 printf(" key2=%i is out of range [1..15]\n",key2);
1103 return HSTRNG.pt[key2-1][key1-1];
1106 void TAmpt::SetPARJ(Int_t key, Float_t parm)
1108 // Set values of array PARJ in common HISTRNG
1109 if ( key < 1 || key > 200) {
1110 printf("ERROR in TAmpt::SetPARJ(key,parm):\n");
1111 printf(" key=%i is out of range [1..200]\n",key);
1114 LUDAT1.parj[key-1] = parm;
1118 void TAmpt::SetMSTJ(Int_t key, Int_t parm)
1120 // Set values of array MSTJ in common HISTRNG
1121 if ( key < 1 || key > 200) {
1122 printf("ERROR in TAmpt::SetMSTJ(key,parm):\n");
1123 printf(" key=%i is out of range [1..200]\n",key);
1126 LUDAT1.mstj[key-1] = parm;
1129 //====================== access to Ampt subroutines =========================
1131 //______________________________________________________________________________
1132 void TAmpt::Initialize()
1134 // Calls Ampset with the either default parameters or the ones set by the user //
1135 // via SetEFRM, SetFRAME, SetPROJ, SetTARG, SetIAP, SetIZP, SetIAT, SetIZT //
1137 if ( (!strcmp(fFrame.Data(), "CMS " )) &&
1138 (!strcmp(fFrame.Data(), "LAB " ))){
1139 printf("WARNING! In TAmpt:Initialize():\n");
1140 printf(" specified frame=%s is neither CMS or LAB\n",fFrame.Data());
1141 printf(" resetting to default \"CMS\" .");
1145 if ( (!strcmp(fProj.Data(), "A " )) &&
1146 (!strcmp(fProj.Data(), "P " )) &&
1147 (!strcmp(fProj.Data(), "PBAR " ))){
1148 printf("WARNING! In TAmpt:Initialize():\n");
1149 printf(" specified projectile=%s is neither A, P or PBAR\n",fProj.Data());
1150 printf(" resetting to default \"A\" .");
1154 if ( (!strcmp(fTarg.Data(), "A " )) &&
1155 (!strcmp(fTarg.Data(), "P " )) &&
1156 (!strcmp(fTarg.Data(), "PBAR " ))){
1157 printf("WARNING! In TAmpt:Initialize():\n");
1158 printf(" specified target=%s is neither A, P or PBAR\n",fTarg.Data());
1159 printf(" resetting to default \"A\" .");
1163 //printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1164 Amptset(fEfrm,fFrame.Data(),fProj.Data(),fTarg.Data(),fIap,fIzp,fIat,fIzt);
1167 //______________________________________________________________________________
1168 void TAmpt::GenerateEvent()
1170 // Generates one event;
1172 //printf("Next event ------------------------\n");
1173 Ampt(fFrame.Data(),fBmin,fBmax);
1176 //______________________________________________________________________________
1177 void TAmpt::Amptset(double efrm, const char *frame, const char *proj,
1178 const char *targ, int iap, int izp, int iat, int izt)
1180 // Call AMPT routine HIJSET passing the parameters in a way accepted by
1183 int s1 = strlen(frame);
1184 int s2 = strlen(proj);
1185 int s3 = strlen(targ);
1186 //printf("s1 = %d s2 = %d s3 = %d\n",s1,s2,s3);
1188 amptset(efrm, frame, proj, targ, iap, izp, iat, izt, s1, s2, s3);
1190 amptset(efrm, frame, s1, proj, s2, targ, s3, iap, izp, iat, izt);
1194 //______________________________________________________________________________
1195 void TAmpt::Ampt(const char *frame, double bmin, double bmax)
1197 // Call AMPT routine HIJSET passing the parameters in a way accepted by
1200 int s1 = strlen(frame);
1203 ampt(frame, bmin, bmax, s1);
1205 ampt(frame, s1, bmin, bmax);
1209 Float_t TAmpt::Profile(float b)
1211 // Call AMPT routine PROFILE
1215 //______________________________________________________________________________
1216 void TAmpt::Rluget(Int_t lfn, Int_t move)
1218 // write seed to file
1219 rluget_ampt(lfn, move);
1222 //______________________________________________________________________________
1223 void TAmpt::Rluset(Int_t lfn, Int_t move)
1225 // read seed from file
1226 rluset_ampt(lfn, move);
1229 //______________________________________________________________________________
1230 void TAmpt::SetIsoft(Int_t i)
1236 //______________________________________________________________________________
1237 void TAmpt::SetNtMax(Int_t max)
1239 // set maximum number of timesteps
1243 //______________________________________________________________________________
1244 void TAmpt::SetIpop(Int_t pop)
1246 // set flag for popcorn mechanism(netbaryon stopping)
1250 //______________________________________________________________________________
1251 void TAmpt::SetXmu(Float_t m)
1253 // set parton screening mass in fm^-1.
1257 //______________________________________________________________________________
1258 void TAmpt::SetAlpha(Float_t alpha)
1260 // set parton screening mass in fm^-1.
1261 PARA2.alpha = alpha;
1264 //______________________________________________________________________________
1265 void TAmpt::SetStringFrag(Float_t a, Float_t b)
1267 // Set string frag parameters, f(z) = 1/z*(1-z)^a*exp(-b*mz^2/z).