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 ////////////////////////////////////////////////////////////////////////////////
22 // THijing is an interface class to F77 version of Hijing 1.36 //
23 // event generator, written by X.N. Wang and M. Gyulassy. //
24 // For details see http://nta2.lbl.gov/~xnwang //
26 // ************************************************** //
27 // * | _______ / ------/ * //
28 // * ----- ------ |_____| /_/ / * //
29 // * || / |_____| / / * //
30 // * /| /_/ /_______ /_ / _ * //
31 // * / | / / / / / | ------- * //
32 // * | / / / / | / | * //
33 // * | / / / / _| / ------- * //
35 // ************************************************** //
37 // Heavy Ion Jet INteraction Generator //
39 // X. N. Wang and M. Gyulassy //
40 // Lawrence Berkeley Laboratory //
41 //****************************************************************************//
44 #include <TClonesArray.h>
45 #include <TObjArray.h>
46 #include <TParticle.h>
53 # define hijset hijset_
54 # define hijing hijing_
55 # define profile profile_
56 # define rluget_hijing rluget_hijing_
57 # define rluset_hijing rluset_hijing_
60 # define hijset HIJSET
61 # define hijing HIJING
62 # define profile PROFILE
63 # define rluget_hijing RLUGET_HIJING
64 # define rluset_hijing RLUSET_HIJING
65 # define type_of_call _stdcall
69 extern "C" void type_of_call hijset(Float_t & , const char *,
70 const char *, const char *,
71 Int_t & , Int_t &, Int_t &,
73 const int, const int);
74 extern "C" float type_of_call profile(Float_t &);
75 extern "C" void type_of_call hijing(const char *, Float_t &,
76 Float_t &, const int);
77 extern "C" void type_of_call rluget_hijing(Int_t & lfn, Int_t & move);
79 extern "C" void type_of_call rluset_hijing(Int_t & lfn, Int_t & move);
90 TGenerator("Hijing","Hijing"),
102 // Default constructor
105 //______________________________________________________________________________
106 THijing::THijing(Float_t efrm, const char *frame="CMS",
107 const char *proj="A", const char *targ="A",
108 Int_t iap=207, Int_t izp=82, Int_t iat=207, Int_t izt=82,
109 Float_t bmin=0, Float_t bmax=20):
110 TGenerator("Hijing","Hijing"),
122 // THijing constructor:
123 // Note that there may be only one functional THijing object
124 // at a time, so it's not use to create more than one instance of it.
127 //______________________________________________________________________________
134 TObjArray* THijing::ImportParticles(Option_t *option)
137 // Default primary creation method. It reads the /HEPEVT/ common block which
138 // has been filled by the GenerateEvent method. If the event generator does
139 // not use the HEPEVT common block, This routine has to be overloaded by
141 // The function loops on the generated particles and store them in
142 // the TClonesArray pointed by the argument particles.
143 // The default action is to store only the stable particles (ISTHEP = 1)
144 // This can be demanded explicitly by setting the option = "Final"
145 // If the option = "All", all the particles are stored.
148 Int_t numpart = HIMAIN1.natt;
149 printf("\n THijing: HIJING stack contains %d particles.", numpart);
150 printf("\n THijing: Total energy: %f ", HIMAIN1.eatt);
151 printf("\n THijing: Number of hard scatterings: %d ", HIMAIN1.jatt);
153 if (!strcmp(option,"") || !strcmp(option,"Final")) {
154 for (Int_t i = 0; i < numpart; i++) {
156 if (HIMAIN2.katt[3][i] == 1) {
158 // Use the common block values for the TParticle constructor
161 TParticle* p = new TParticle(
162 HIMAIN2.katt[0][i], HIMAIN2.katt[3][i] ,
164 HIMAIN2.patt[0][i], HIMAIN2.patt[1][i], HIMAIN2.patt[2][i], HIMAIN2.patt[3][i] ,
165 HIMAIN2.vatt[0][i], HIMAIN2.vatt[1][i], HIMAIN2.vatt[2][i], HIMAIN2.vatt[3][i]
167 p->SetUniqueID(HIMAIN2.katt[1][i]);
172 else if (!strcmp(option,"All")) {
174 for (Int_t i = 0; i < numpart; i++) {
176 Int_t iParent = HIMAIN2.katt[2][i]-1;
179 TParticle *mother = (TParticle*) (fParticles->UncheckedAt(iParent));
180 mother->SetLastDaughter(i);
181 if (mother->GetFirstDaughter()==-1)
182 mother->SetFirstDaughter(i);
185 TParticle* p = new TParticle(
186 HIMAIN2.katt[0][i], HIMAIN2.katt[3][i], iParent,
188 HIMAIN2.patt[0][i], HIMAIN2.patt[1][i], HIMAIN2.patt[2][i], HIMAIN2.patt[3][i] ,
189 HIMAIN2.vatt[0][i], HIMAIN2.vatt[1][i], HIMAIN2.vatt[2][i], HIMAIN2.vatt[3][i]
191 p->SetUniqueID(HIMAIN2.katt[1][i]);
198 Int_t THijing::ImportParticles(TClonesArray *particles, Option_t *option)
201 // Default primary creation method. It reads the /HEPEVT/ common block which
202 // has been filled by the GenerateEvent method. If the event generator does
203 // not use the HEPEVT common block, This routine has to be overloaded by
205 // The function loops on the generated particles and store them in
206 // the TClonesArray pointed by the argument particles.
207 // The default action is to store only the stable particles (ISTHEP = 1)
208 // This can be demanded explicitly by setting the option = "Final"
209 // If the option = "All", all the particles are stored.
211 if (particles == 0) return 0;
212 TClonesArray &particlesR = *particles;
214 Int_t numpart = HIMAIN1.natt;
215 printf("\n THijing: HIJING stack contains %d particles.", numpart);
216 printf("\n THijing: Total energy: %f ", HIMAIN1.eatt);
217 printf("\n THijing: Number of hard scatterings: %d ", HIMAIN1.jatt);
219 if (!strcmp(option,"") || !strcmp(option,"Final")) {
220 for (Int_t i = 0; i < numpart; i++) {
222 if (HIMAIN2.katt[3][i] == 1) {
224 // Use the common block values for the TParticle constructor
227 new(particlesR[i]) TParticle(
245 particlesR[i]->SetUniqueID(HIMAIN2.katt[1][i]);
249 else if (!strcmp(option,"All")) {
251 for (Int_t i = 0; i < numpart; i++) {
253 Int_t iParent = HIMAIN2.katt[2][i]-1;
256 TParticle *mother = (TParticle*) (particlesR.UncheckedAt(iParent));
257 mother->SetLastDaughter(i);
258 if (mother->GetFirstDaughter()==-1)
259 mother->SetFirstDaughter(i);
262 new(particlesR[i]) TParticle(
280 particlesR[i]->SetUniqueID(HIMAIN2.katt[1][i]);
286 //______________________________________________________________________________
287 void THijing::SetEFRM(Float_t efrm)
289 // Set the centre of mass (CMS) or lab-energy (LAB)
292 //______________________________________________________________________________
293 void THijing::SetFRAME(const char* frame)
295 // Set the frame type ("CMS" or "LAB")
298 //______________________________________________________________________________
299 void THijing::SetPROJ(const char* proj)
301 // Set the projectile type
304 //______________________________________________________________________________
305 void THijing::SetTARG(const char* targ)
307 // Set the target type
310 //______________________________________________________________________________
311 void THijing::SetIAP(Int_t iap)
313 // Set the projectile atomic number
316 //______________________________________________________________________________
317 void THijing::SetIZP(Int_t izp)
319 // Set the projectile charge number
322 //______________________________________________________________________________
323 void THijing::SetIAT(Int_t iat)
325 // Set the target atomic number
328 //______________________________________________________________________________
329 void THijing::SetIZT(Int_t izt)
331 // Set the target charge number
334 //______________________________________________________________________________
335 void THijing::SetBMIN(Float_t bmin)
337 // Set the minimum impact parameter
340 //______________________________________________________________________________
341 void THijing::SetBMAX(Float_t bmax)
343 // Set the maximum impact parameter
346 //______________________________________________________________________________
347 Float_t THijing::GetEFRM() const
349 // Get the centre of mass (CMS) or lab-energy (LAB)
352 //______________________________________________________________________________
353 const char* THijing::GetFRAME() const
355 // Get the frame type ("CMS" or "LAB")
356 return fFrame.Data();
358 //______________________________________________________________________________
359 const char* THijing::GetPROJ() const
361 // Get the projectile type
364 //______________________________________________________________________________
365 const char* THijing::GetTARG() const
367 // Set the target type
370 //______________________________________________________________________________
371 Int_t THijing::GetIAP() const
373 // Get the projectile atomic number
376 //______________________________________________________________________________
377 Int_t THijing::GetIZP() const
379 // Get the projectile charge number
382 //______________________________________________________________________________
383 Int_t THijing::GetIAT() const
385 // Get the target atomic number
388 //______________________________________________________________________________
389 Int_t THijing::GetIZT() const
391 // Get the target charge number
394 //______________________________________________________________________________
395 Float_t THijing::GetBMIN() const
397 // Get the minimum impact parameter
400 //______________________________________________________________________________
401 Float_t THijing::GetBMAX() const
403 // Get the maximum impact parameter
407 //====================== access to common HIPARNT ===============================
409 //______________________________________________________________________________
410 void THijing::SetHIPR1(Int_t key,Float_t value)
412 // Set the values of array HIPR1 in common HIPARNT
413 if ( key<1 || key>100 ) {
414 printf ("ERROR in THijing:SetHIPR1(key,value): \n ");
415 printf (" key=%i is out of range [1..100]!\n",key);
419 HIPARNT.hipr1[key-1]=value;
423 //______________________________________________________________________________
424 Float_t THijing::GetHIPR1(Int_t key) const
426 // Get the values of array HIPR1 in common HIPARNT
427 if ( key<1 || key>100 ) {
428 printf ("ERROR in THijing:GetHIPR1(key): \n ");
429 printf (" key=%i is out of range [1..100]!\n",key);
433 return HIPARNT.hipr1[key-1];
437 //______________________________________________________________________________
438 void THijing::SetIHPR2(Int_t key,Int_t value)
440 // Set the values of array HIPR2 in common HIPARNT
441 if ( key<1 || key>50 ) {
442 printf ("ERROR in THijing:SetIHPR2(key,value): \n ");
443 printf (" key=%i is out of range [1..50]!\n",key);
447 HIPARNT.ihpr2[key-1]=value;
451 //______________________________________________________________________________
452 Int_t THijing::GetIHPR2(Int_t key) const
454 // Get the values of array HIPR2 in common HIPARNT
455 if ( key<1 || key>50 ) {
456 printf ("ERROR in THijing:GetIHPR2(key): \n ");
457 printf (" key=%i is out of range [1..50]!\n",key);
461 return HIPARNT.ihpr2[key-1];
466 //______________________________________________________________________________
467 Float_t THijing::GetHINT1(Int_t key) const
469 // Get the values of array HINT1 in common HIPARNT
470 if ( key<1 || key>100 ) {
471 printf ("ERROR in THijing:GetHINT1(key): \n ");
472 printf (" key=%i is out of range [1..100]!\n",key);
476 return HIPARNT.hint1[key-1];
481 //______________________________________________________________________________
482 Int_t THijing::GetIHNT2(Int_t key) const
484 // Get the values of array HINT2 in common HIPARNT
485 if ( key<1 || key>50 ) {
486 printf ("ERROR in THijing:GetIHNT2(key): \n ");
487 printf (" key=%i is out of range [1..50]!\n",key);
491 return HIPARNT.ihnt2[key-1];
496 //====================== access to common HIMAIN1 ===============================
498 //______________________________________________________________________________
499 Int_t THijing::GetNATT() const
501 // Get the number of particles produces
506 //______________________________________________________________________________
507 Float_t THijing::GetEATT() const
509 // Get total energy of particles
515 //______________________________________________________________________________
516 Int_t THijing::GetJATT() const
518 // Get number of hard scatterings
524 //______________________________________________________________________________
525 Int_t THijing::GetNT() const
527 // Get number of target participants
533 //______________________________________________________________________________
534 Int_t THijing::GetNP() const
536 // Get number of projectile participants
542 //______________________________________________________________________________
543 Int_t THijing::GetN0() const
545 // Get number of N-N collisions
549 //______________________________________________________________________________
550 Int_t THijing::GetN01() const
552 // Get number of N-wounded collisions
558 //______________________________________________________________________________
559 Int_t THijing::GetN10() const
561 // Get number of wounded-N collisions
567 //______________________________________________________________________________
568 Int_t THijing::GetN11() const
570 // Get number of wounded-wounded collisions
576 //______________________________________________________________________________
577 Float_t THijing::GetBB() const
579 // Get impact parameter
585 //====================== access to common HIMAIN2 ===============================
587 //______________________________________________________________________________
588 Int_t THijing::GetKATT(Int_t key1, Int_t key2) const
590 // Get values of array KATT in common HIMAIN2
591 if ( key1<1 || key1>200000 ) {
592 printf("ERROR in THijing::GetKATT(key1,key2):\n");
593 printf(" key1=%i is out of range [1..200000]\n",key1);
597 if ( key2<1 || key2>4 ) {
598 printf("ERROR in THijing::GetKATT(key1,key2):\n");
599 printf(" key2=%i is out of range [1..4]\n",key2);
603 return HIMAIN2.katt[key2-1][key1-1];
606 //______________________________________________________________________________
607 Float_t THijing::GetPATT(Int_t key1, Int_t key2) const
609 // Get values of array PATT in common HIMAIN2
610 if ( key1<1 || key1>200000 ) {
611 printf("ERROR in THijing::GetPATT(key1,key2):\n");
612 printf(" key1=%i is out of range [1..130000]\n",key1);
616 if ( key2<1 || key2>4 ) {
617 printf("ERROR in THijing::GetPATT(key1,key2):\n");
618 printf(" key2=%i is out of range [1..4]\n",key2);
622 return HIMAIN2.patt[key2-1][key1-1];
625 Float_t THijing::GetVATT(Int_t key1, Int_t key2) const
627 // Get values of array VATT in common HIMAIN2
628 if ( key1<1 || key1>200000 ) {
629 printf("ERROR in THijing::GetVATT(key1,key2):\n");
630 printf(" key1=%i is out of range [1..130000]\n",key1);
634 if ( key2<1 || key2>4 ) {
635 printf("ERROR in THijing::GetVATT(key1,key2):\n");
636 printf(" key2=%i is out of range [1..4]\n",key2);
640 return HIMAIN2.vatt[key2-1][key1-1];
643 //====================== access to common HIJJET1 ===============================
645 //______________________________________________________________________________
646 Int_t THijing::GetNPJ(Int_t key) const
648 // Get values of array NPJ of common HIJJET1
649 if ( key<1 || key>300 ) {
650 printf("ERROR in THijing::GetNPJ(key):\n");
651 printf(" key=%i is out of range [1..300]\n",key);
654 return HIJJET1.npj[key-1];
657 //______________________________________________________________________________
658 Int_t THijing::GetKFPJ(Int_t key1, Int_t key2) const
660 // Get values of array KFPJ in common HIJJET1
661 if ( key1<1 || key1>300 ) {
662 printf("ERROR in THijing::GetKFPJ(key1):\n");
663 printf(" key1=%i is out of range [1..300]\n",key1);
666 if ( key2<1 || key2>500 ) {
667 printf("ERROR in THijing::GetKFPJ(key1,key2):\n");
668 printf(" key2=%i is out of range [1..500]\n",key2);
672 return HIJJET1.kfpj[key2-1][key1-1];
675 //______________________________________________________________________________
676 Float_t THijing::GetPJPX(Int_t key1, Int_t key2) const
678 // Get values of array PJPX in common HIJJET1
679 if ( key1<1 || key1>300 ) {
680 printf("ERROR in THijing::GetPJPX(key1):\n");
681 printf(" key1=%i is out of range [1..300]\n",key1);
684 if ( key2<1 || key2>500 ) {
685 printf("ERROR in THijing::GetPJPX(key1,key2):\n");
686 printf(" key2=%i is out of range [1..500]\n",key2);
690 return HIJJET1.pjpx[key2-1][key1-1];
693 //______________________________________________________________________________
694 Float_t THijing::GetPJPY(Int_t key1, Int_t key2) const
696 // Get values of array PJPY in common HIJJET1
697 if ( key1<1 || key1>300 ) {
698 printf("ERROR in THijing::GetPJPY(key1):\n");
699 printf(" key1=%i is out of range [1..300]\n",key1);
702 if ( key2<1 || key2>500 ) {
703 printf("ERROR in THijing::GetPJPY(key1,key2):\n");
704 printf(" key2=%i is out of range [1..500]\n",key2);
708 return HIJJET1.pjpy[key2-1][key1-1];
711 //______________________________________________________________________________
712 Float_t THijing::GetPJPZ(Int_t key1, Int_t key2) const
714 // Get values of array PJPZ in common HIJJET1
715 if ( key1<1 || key1>300 ) {
716 printf("ERROR in THijing::GetPJPZ(key1):\n");
717 printf(" key1=%i is out of range [1..300]\n",key1);
720 if ( key2<1 || key2>500 ) {
721 printf("ERROR in THijing::GetPJPZ(key1,key2):\n");
722 printf(" key2=%i is out of range [1..500]\n",key2);
726 return HIJJET1.pjpz[key2-1][key1-1];
729 //______________________________________________________________________________
730 Float_t THijing::GetPJPE(Int_t key1, Int_t key2) const
732 // Get values of array PJPE in common HIJJET1
733 if ( key1<1 || key1>300 ) {
734 printf("ERROR in THijing::GetPJPE(key1):\n");
735 printf(" key1=%i is out of range [1..300]\n",key1);
738 if ( key2<1 || key2>500 ) {
739 printf("ERROR in THijing::GetPJPE(key1,key2):\n");
740 printf(" key2=%i is out of range [1..500]\n",key2);
744 return HIJJET1.pjpe[key2-1][key1-1];
747 //______________________________________________________________________________
748 Float_t THijing::GetPJPM(Int_t key1, Int_t key2) const
750 // Get values of array PJPM in common HIJJET1
751 if ( key1<1 || key1>300 ) {
752 printf("ERROR in THijing::GetPJPM(key1):\n");
753 printf(" key1=%i is out of range [1..300]\n",key1);
756 if ( key2<1 || key2>500 ) {
757 printf("ERROR in THijing::GetPJPM(key1,key2):\n");
758 printf(" key2=%i is out of range [1..500]\n",key2);
762 return HIJJET1.pjpm[key2-1][key1-1];
765 //______________________________________________________________________________
766 Int_t THijing::GetNTJ(Int_t key) const
768 // Get values of array NTJ in common HIJJET1
769 if ( key<1 || key>300 ) {
770 printf("ERROR in THijing::GetNTJ(key):\n");
771 printf(" key=%i is out of range [1..300]\n",key);
774 return HIJJET1.ntj[key-1];
777 //______________________________________________________________________________
778 Int_t THijing::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 THijing::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 THijing::GetKFTJ(key1,key2):\n");
788 printf(" key2=%i is out of range [1..500]\n",key2);
792 return HIJJET1.kftj[key2-1][key1-1];
795 //______________________________________________________________________________
796 Float_t THijing::GetPJTX(Int_t key1, Int_t key2) const
798 // Get values of array PJTX in common HIJJET1
799 if ( key1<1 || key1>300 ) {
800 printf("ERROR in THijing::GetPJTX(key1):\n");
801 printf(" key1=%i is out of range [1..300]\n",key1);
804 if ( key2<1 || key2>500 ) {
805 printf("ERROR in THijing::GetPJTX(key1,key2):\n");
806 printf(" key2=%i is out of range [1..500]\n",key2);
810 return HIJJET1.pjtx[key2-1][key1-1];
813 //______________________________________________________________________________
814 Float_t THijing::GetPJTY(Int_t key1, Int_t key2) const
816 // Get values of array PJTY in common HIJJET1
817 if ( key1<1 || key1>300 ) {
818 printf("ERROR in THijing::GetPJTY(key1):\n");
819 printf(" key1=%i is out of range [1..300]\n",key1);
822 if ( key2<1 || key2>500 ) {
823 printf("ERROR in THijing::GetPJTY(key1,key2):\n");
824 printf(" key2=%i is out of range [1..500]\n",key2);
828 return HIJJET1.pjty[key2-1][key1-1];
831 //______________________________________________________________________________
832 Float_t THijing::GetPJTZ(Int_t key1, Int_t key2) const
834 // Get values of array PJTZ in common HIJJET1
835 if ( key1<1 || key1>300 ) {
836 printf("ERROR in THijing::GetPJTZ(key1):\n");
837 printf(" key1=%i is out of range [1..300]\n",key1);
840 if ( key2<1 || key2>500 ) {
841 printf("ERROR in THijing::GetPJTZ(key1,key2):\n");
842 printf(" key2=%i is out of range [1..500]\n",key2);
846 return HIJJET1.pjtz[key2-1][key1-1];
849 //______________________________________________________________________________
850 Float_t THijing::GetPJTE(Int_t key1, Int_t key2) const
852 // Get values of array PJTE in common HIJJET1
853 if ( key1<1 || key1>300 ) {
854 printf("ERROR in THijing::GetPJTE(key1):\n");
855 printf(" key1=%i is out of range [1..300]\n",key1);
858 if ( key2<1 || key2>500 ) {
859 printf("ERROR in THijing::GetPJTE(key1,key2):\n");
860 printf(" key2=%i is out of range [1..500]\n",key2);
864 return HIJJET1.pjte[key2-1][key1-1];
867 //______________________________________________________________________________
868 Float_t THijing::GetPJTM(Int_t key1, Int_t key2) const
870 // Get values of array PJTM in common HIJJET1
871 if ( key1<1 || key1>300 ) {
872 printf("ERROR in THijing::GetPJTM(key1):\n");
873 printf(" key1=%i is out of range [1..300]\n",key1);
876 if ( key2<1 || key2>500 ) {
877 printf("ERROR in THijing::GetPJTM(key1,key2):\n");
878 printf(" key2=%i is out of range [1..500]\n",key2);
882 return HIJJET1.pjtm[key2-1][key1-1];
885 //====================== access to common HIJJET1 ===============================
887 //______________________________________________________________________________
888 Int_t THijing::GetNSG() const
890 // Get value of NSG in common HIJJET2
894 //______________________________________________________________________________
895 Int_t THijing::GetNJSG(Int_t key) const
897 // Get values of array NJSG in common HIJJET2
898 if ( key<1 || key>900 ) {
899 printf ("ERROR in THijing:GetNJSG(key): \n ");
900 printf (" key=%i is out of range [1..900]!\n",key);
904 return HIJJET2.njsg[key-1];
908 //______________________________________________________________________________
909 Int_t THijing::GetIASG(Int_t key1, Int_t key2) const
911 // Get values of IASG in common HIJJET2
912 if ( key1<1 || key1>900 ) {
913 printf("ERROR in THijing::GetIASG(key1):\n");
914 printf(" key1=%i is out of range [1..900]\n",key1);
917 if ( key2<1 || key2>3 ) {
918 printf("ERROR in THijing::GetIASG(key1,key2):\n");
919 printf(" key2=%i is out of range [1..3]\n",key2);
923 return HIJJET2.iasg[key2-1][key1-1];
926 //______________________________________________________________________________
927 Int_t THijing::GetK1SG(Int_t key1, Int_t key2) const
929 // Get values of K1SG in common HIJJET2
930 if ( key1<1 || key1>900 ) {
931 printf("ERROR in THijing::GetK1SG(key1):\n");
932 printf(" key1=%i is out of range [1..900]\n",key1);
935 if ( key2<1 || key2>100 ) {
936 printf("ERROR in THijing::GetK1SG(key1,key2):\n");
937 printf(" key2=%i is out of range [1..100]\n",key2);
941 return HIJJET2.k1sg[key2-1][key1-1];
944 //______________________________________________________________________________
945 Int_t THijing::GetK2SG(Int_t key1, Int_t key2) const
947 // Get values of K2SG in common HIJJET2
948 if ( key1<1 || key1>900 ) {
949 printf("ERROR in THijing::GetK2SG(key1):\n");
950 printf(" key1=%i is out of range [1..900]\n",key1);
953 if ( key2<1 || key2>100 ) {
954 printf("ERROR in THijing::GetK2SG(key1,key2):\n");
955 printf(" key2=%i is out of range [1..100]\n",key2);
959 return HIJJET2.k2sg[key2-1][key1-1];
962 //______________________________________________________________________________
963 Float_t THijing::GetPXSG(Int_t key1, Int_t key2) const
965 // Get values of PXSG in common HIJJET2
966 if ( key1<1 || key1>900 ) {
967 printf("ERROR in THijing::GetPXSG(key1):\n");
968 printf(" key1=%i is out of range [1..900]\n",key1);
971 if ( key2<1 || key2>100 ) {
972 printf("ERROR in THijing::GetPXSG(key1,key2):\n");
973 printf(" key2=%i is out of range [1..100]\n",key2);
977 return HIJJET2.pxsg[key2-1][key1-1];
980 //______________________________________________________________________________
981 Float_t THijing::GetPYSG(Int_t key1, Int_t key2) const
983 // Get values of PYSG in common HIJJET2
984 if ( key1<1 || key1>900 ) {
985 printf("ERROR in THijing::GetPYSG(key1):\n");
986 printf(" key1=%i is out of range [1..900]\n",key1);
989 if ( key2<1 || key2>100 ) {
990 printf("ERROR in THijing::GetPYSG(key1,key2):\n");
991 printf(" key2=%i is out of range [1..100]\n",key2);
995 return HIJJET2.pysg[key2-1][key1-1];
998 //______________________________________________________________________________
999 Float_t THijing::GetPZSG(Int_t key1, Int_t key2) const
1001 // Get values of PZSG in common HIJJET2
1002 if ( key1<1 || key1>900 ) {
1003 printf("ERROR in THijing::GetPZSG(key1):\n");
1004 printf(" key1=%i is out of range [1..900]\n",key1);
1007 if ( key2<1 || key2>100 ) {
1008 printf("ERROR in THijing::GetPZSG(key1,key2):\n");
1009 printf(" key2=%i is out of range [1..100]\n",key2);
1013 return HIJJET2.pzsg[key2-1][key1-1];
1016 //______________________________________________________________________________
1017 Float_t THijing::GetPESG(Int_t key1, Int_t key2) const
1019 // Get values of PESG in common HIJJET2
1020 if ( key1<1 || key1>900 ) {
1021 printf("ERROR in THijing::GetPESG(key1):\n");
1022 printf(" key1=%i is out of range [1..900]\n",key1);
1025 if ( key2<1 || key2>100 ) {
1026 printf("ERROR in THijing::GetPESG(key1,key2):\n");
1027 printf(" key2=%i is out of range [1..100]\n",key2);
1031 return HIJJET2.pesg[key2-1][key1-1];
1034 //______________________________________________________________________________
1035 Float_t THijing::GetPMSG(Int_t key1, Int_t key2) const
1037 // Get values of PMSG in common HIJJET2
1038 if ( key1<1 || key1>900 ) {
1039 printf("ERROR in THijing::GetPMSG(key1):\n");
1040 printf(" key1=%i is out of range [1..900]\n",key1);
1043 if ( key2<1 || key2>100 ) {
1044 printf("ERROR in THijing::GetPMSG(key1,key2):\n");
1045 printf(" key2=%i is out of range [1..100]\n",key2);
1049 return HIJJET2.pmsg[key2-1][key1-1];
1052 //====================== access to common HISTRNG ===============================
1054 //______________________________________________________________________________
1055 Int_t THijing::GetNFP(Int_t key1, Int_t key2) const
1057 // Get values of array NFP in common HISTRNG
1058 if ( key1<1 || key1>300 ) {
1059 printf("ERROR in THijing::GetNFP(key1):\n");
1060 printf(" key1=%i is out of range [1..300]\n",key1);
1063 if ( key2<1 || key2>15 ) {
1064 printf("ERROR in THijing::GetNFP(key1,key2):\n");
1065 printf(" key2=%i is out of range [1..15]\n",key2);
1069 return HISTRNG.nfp[key2-1][key1-1];
1072 //______________________________________________________________________________
1073 Float_t THijing::GetPP(Int_t key1, Int_t key2) const
1075 // Get values of array PP in common HISTRNG
1076 if ( key1<1 || key1>300 ) {
1077 printf("ERROR in THijing::GetPP(key1):\n");
1078 printf(" key1=%i is out of range [1..300]\n",key1);
1081 if ( key2<1 || key2>15 ) {
1082 printf("ERROR in THijing::GetPP(key1,key2):\n");
1083 printf(" key2=%i is out of range [1..15]\n",key2);
1087 return HISTRNG.pp[key2-1][key1-1];
1090 //______________________________________________________________________________
1091 Int_t THijing::GetNFT(Int_t key1, Int_t key2) const
1093 // Get values of array NFT in common HISTRNG
1094 if ( key1<1 || key1>300 ) {
1095 printf("ERROR in THijing::GetNFT(key1):\n");
1096 printf(" key1=%i is out of range [1..300]\n",key1);
1099 if ( key2<1 || key2>15 ) {
1100 printf("ERROR in THijing::GetNFT(key1,key2):\n");
1101 printf(" key2=%i is out of range [1..15]\n",key2);
1105 return HISTRNG.nft[key2-1][key1-1];
1108 //______________________________________________________________________________
1109 Float_t THijing::GetPT(Int_t key1, Int_t key2) const
1111 // Get values of array PT in common HISTRNG
1112 if ( key1<1 || key1>300 ) {
1113 printf("ERROR in THijing::GetPT(key1):\n");
1114 printf(" key1=%i is out of range [1..300]\n",key1);
1117 if ( key2<1 || key2>15 ) {
1118 printf("ERROR in THijing::GetPT(key1,key2):\n");
1119 printf(" key2=%i is out of range [1..15]\n",key2);
1123 return HISTRNG.pt[key2-1][key1-1];
1126 void THijing::SetPARJ(Int_t key, Float_t parm)
1128 // Set values of array PARJ in common HISTRNG
1129 if ( key < 1 || key > 200) {
1130 printf("ERROR in THijing::SetPARJ(key,parm):\n");
1131 printf(" key=%i is out of range [1..200]\n",key);
1134 LUDAT1_HIJING.parj[key-1] = parm;
1138 void THijing::SetMSTJ(Int_t key, Int_t parm)
1140 // Set values of array MSTJ in common HISTRNG
1141 if ( key < 1 || key > 200) {
1142 printf("ERROR in THijing::SetMSTJ(key,parm):\n");
1143 printf(" key=%i is out of range [1..200]\n",key);
1146 LUDAT1_HIJING.mstj[key-1] = parm;
1150 //====================== access to Hijing subroutines =========================
1153 //______________________________________________________________________________
1154 void THijing::Initialize()
1156 //////////////////////////////////////////////////////////////////////////////////
1157 // Calls Hijset with the either default parameters or the ones set by the user //
1158 // via SetEFRM, SetFRAME, SetPROJ, SetTARG, SetIAP, SetIZP, SetIAT, SetIZT //
1159 //////////////////////////////////////////////////////////////////////////////////
1161 if ( (!strcmp(fFrame.Data(), "CMS " )) &&
1162 (!strcmp(fFrame.Data(), "LAB " ))){
1163 printf("WARNING! In THijing:Initialize():\n");
1164 printf(" specified frame=%s is neither CMS or LAB\n",fFrame.Data());
1165 printf(" resetting to default \"CMS\" .");
1169 if ( (!strcmp(fProj.Data(), "A " )) &&
1170 (!strcmp(fProj.Data(), "P " )) &&
1171 (!strcmp(fProj.Data(), "PBAR " ))){
1172 printf("WARNING! In THijing:Initialize():\n");
1173 printf(" specified projectile=%s is neither A, P or PBAR\n",fProj.Data());
1174 printf(" resetting to default \"A\" .");
1178 if ( (!strcmp(fTarg.Data(), "A " )) &&
1179 (!strcmp(fTarg.Data(), "P " )) &&
1180 (!strcmp(fTarg.Data(), "PBAR " ))){
1181 printf("WARNING! In THijing:Initialize():\n");
1182 printf(" specified target=%s is neither A, P or PBAR\n",fTarg.Data());
1183 printf(" resetting to default \"A\" .");
1187 printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1189 Hijset(fEfrm,fFrame.Data(),fProj.Data(),fTarg.Data(),fIap,fIzp,fIat,fIzt);
1191 printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1195 //______________________________________________________________________________
1196 void THijing::GenerateEvent()
1198 // Generates one event;
1200 Hijing(fFrame.Data(),fBmin,fBmax);
1203 //______________________________________________________________________________
1204 void THijing::Hijset(float efrm, const char *frame, const char *proj,
1205 const char *targ, int iap, int izp, int iat, int izt)
1207 // Call HIJING routine HIJSET passing the parameters in a way accepted by
1210 int s1 = strlen(frame);
1211 int s2 = strlen(proj);
1212 int s3 = strlen(targ);
1213 printf("s1 = %d s2 = %d s3 = %d\n",s1,s2,s3);
1215 hijset(efrm, frame, proj, targ, iap, izp, iat, izt, s1, s2, s3);
1217 hijset(efrm, frame, s1, proj, s2, targ, s3, iap, izp, iat, izt);
1220 //______________________________________________________________________________
1221 void THijing::Hijing(const char *frame, float bmin, float bmax)
1223 // Call HIJING routine HIJSET passing the parameters in a way accepted by
1226 int s1 = strlen(frame);
1229 hijing(frame, bmin, bmax, s1);
1231 hijing(frame, s1, bmin, bmax);
1236 Float_t THijing::Profile(float b)
1238 // Call HIJING routine PROFILE
1243 void THijing::Rluget(Int_t lfn, Int_t move)
1245 // write seed to file
1246 rluget_hijing(lfn, move);
1250 void THijing::Rluset(Int_t lfn, Int_t move)
1252 // read seed from file
1253 rluset_hijing(lfn, move);