1 ////////////////////////////////////////////////////////////////////////////////
5 // THijing is an interface class to F77 version of Hijing 1.36 //
6 // event generator, written by X.N. Wang and M. Gyulassy. //
7 // For details see http://nta2.lbl.gov/~xnwang //
9 // ************************************************** //
10 // * | _______ / ------/ * //
11 // * ----- ------ |_____| /_/ / * //
12 // * || / |_____| / / * //
13 // * /| /_/ /_______ /_ / _ * //
14 // * / | / / / / / | ------- * //
15 // * | / / / / | / | * //
16 // * | / / / / _| / ------- * //
18 // ************************************************** //
20 // Heavy Ion Jet INteraction Generator //
22 // X. N. Wang and M. Gyulassy //
23 // Lawrence Berkeley Laboratory //
24 //****************************************************************************//
28 #include "TObjArray.h"
30 #include "TParticle.h"
34 # define hijset hijset_
35 # define hijing hijing_
36 # define profile profile_
37 # define rluget_hijing rluget_hijing_
38 # define rluset_hijing rluset_hijing_
41 # define hijset HIJSET
42 # define hijing HIJING
43 # define profile PROFILE
44 # define rluget_hijing RLUGET_HIJING
45 # define rluset_hijing RLUSET_HIJING
46 # define type_of_call _stdcall
50 extern "C" void type_of_call hijset(Float_t & , const char *,
51 const char *, const char *,
52 Int_t & , Int_t &, Int_t &,
54 const int, const int);
55 extern "C" float type_of_call profile(Float_t &);
56 extern "C" void type_of_call hijing(const char *, Float_t &,
57 Float_t &, const int);
58 extern "C" void type_of_call rluget_hijing(Int_t & lfn, Int_t & move);
60 extern "C" void type_of_call rluset_hijing(Int_t & lfn, Int_t & move);
71 TGenerator("Hijing","Hijing"),
83 // Default constructor
86 //______________________________________________________________________________
87 THijing::THijing(Float_t efrm, const char *frame="CMS",
88 const char *proj="A", const char *targ="A",
89 Int_t iap=207, Int_t izp=82, Int_t iat=207, Int_t izt=82,
90 Float_t bmin=0, Float_t bmax=20):
91 TGenerator("Hijing","Hijing"),
103 // THijing constructor:
104 // Note that there may be only one functional THijing object
105 // at a time, so it's not use to create more than one instance of it.
108 //______________________________________________________________________________
115 TObjArray* THijing::ImportParticles(Option_t *option)
118 // Default primary creation method. It reads the /HEPEVT/ common block which
119 // has been filled by the GenerateEvent method. If the event generator does
120 // not use the HEPEVT common block, This routine has to be overloaded by
122 // The function loops on the generated particles and store them in
123 // the TClonesArray pointed by the argument particles.
124 // The default action is to store only the stable particles (ISTHEP = 1)
125 // This can be demanded explicitly by setting the option = "Final"
126 // If the option = "All", all the particles are stored.
129 Int_t numpart = HIMAIN1.natt;
130 printf("\n THijing: HIJING stack contains %d particles.", numpart);
131 printf("\n THijing: Total energy: %f ", HIMAIN1.eatt);
132 printf("\n THijing: Number of hard scatterings: %d ", HIMAIN1.jatt);
134 if (!strcmp(option,"") || !strcmp(option,"Final")) {
135 for (Int_t i = 0; i < numpart; i++) {
137 if (HIMAIN2.katt[3][i] == 1) {
139 // Use the common block values for the TParticle constructor
142 TParticle* p = new TParticle(
143 HIMAIN2.katt[0][i], HIMAIN2.katt[3][i] ,
145 HIMAIN2.patt[0][i], HIMAIN2.patt[1][i], HIMAIN2.patt[2][i], HIMAIN2.patt[3][i] ,
146 HIMAIN2.vatt[0][i], HIMAIN2.vatt[1][i], HIMAIN2.vatt[2][i], HIMAIN2.vatt[3][i]
148 p->SetUniqueID(HIMAIN2.katt[1][i]);
153 else if (!strcmp(option,"All")) {
155 for (Int_t i = 0; i < numpart; i++) {
157 Int_t iParent = HIMAIN2.katt[2][i]-1;
160 TParticle *mother = (TParticle*) (fParticles->UncheckedAt(iParent));
161 mother->SetLastDaughter(i);
162 if (mother->GetFirstDaughter()==-1)
163 mother->SetFirstDaughter(i);
166 TParticle* p = new TParticle(
167 HIMAIN2.katt[0][i], HIMAIN2.katt[3][i], iParent,
169 HIMAIN2.patt[0][i], HIMAIN2.patt[1][i], HIMAIN2.patt[2][i], HIMAIN2.patt[3][i] ,
170 HIMAIN2.vatt[0][i], HIMAIN2.vatt[1][i], HIMAIN2.vatt[2][i], HIMAIN2.vatt[3][i]
172 p->SetUniqueID(HIMAIN2.katt[1][i]);
179 Int_t THijing::ImportParticles(TClonesArray *particles, Option_t *option)
182 // Default primary creation method. It reads the /HEPEVT/ common block which
183 // has been filled by the GenerateEvent method. If the event generator does
184 // not use the HEPEVT common block, This routine has to be overloaded by
186 // The function loops on the generated particles and store them in
187 // the TClonesArray pointed by the argument particles.
188 // The default action is to store only the stable particles (ISTHEP = 1)
189 // This can be demanded explicitly by setting the option = "Final"
190 // If the option = "All", all the particles are stored.
192 if (particles == 0) return 0;
193 TClonesArray &particlesR = *particles;
195 Int_t numpart = HIMAIN1.natt;
196 printf("\n THijing: HIJING stack contains %d particles.", numpart);
197 printf("\n THijing: Total energy: %f ", HIMAIN1.eatt);
198 printf("\n THijing: Number of hard scatterings: %d ", HIMAIN1.jatt);
200 if (!strcmp(option,"") || !strcmp(option,"Final")) {
201 for (Int_t i = 0; i < numpart; i++) {
203 if (HIMAIN2.katt[3][i] == 1) {
205 // Use the common block values for the TParticle constructor
208 new(particlesR[i]) TParticle(
226 particlesR[i]->SetUniqueID(HIMAIN2.katt[1][i]);
230 else if (!strcmp(option,"All")) {
232 for (Int_t i = 0; i < numpart; i++) {
234 Int_t iParent = HIMAIN2.katt[2][i]-1;
237 TParticle *mother = (TParticle*) (particlesR.UncheckedAt(iParent));
238 mother->SetLastDaughter(i);
239 if (mother->GetFirstDaughter()==-1)
240 mother->SetFirstDaughter(i);
243 new(particlesR[i]) TParticle(
261 particlesR[i]->SetUniqueID(HIMAIN2.katt[1][i]);
267 //______________________________________________________________________________
268 void THijing::SetEFRM(Float_t efrm)
270 // Set the centre of mass (CMS) or lab-energy (LAB)
273 //______________________________________________________________________________
274 void THijing::SetFRAME(const char* frame)
276 // Set the frame type ("CMS" or "LAB")
279 //______________________________________________________________________________
280 void THijing::SetPROJ(const char* proj)
282 // Set the projectile type
285 //______________________________________________________________________________
286 void THijing::SetTARG(const char* targ)
288 // Set the target type
291 //______________________________________________________________________________
292 void THijing::SetIAP(Int_t iap)
294 // Set the projectile atomic number
297 //______________________________________________________________________________
298 void THijing::SetIZP(Int_t izp)
300 // Set the projectile charge number
303 //______________________________________________________________________________
304 void THijing::SetIAT(Int_t iat)
306 // Set the target atomic number
309 //______________________________________________________________________________
310 void THijing::SetIZT(Int_t izt)
312 // Set the target charge number
315 //______________________________________________________________________________
316 void THijing::SetBMIN(Float_t bmin)
318 // Set the minimum impact parameter
321 //______________________________________________________________________________
322 void THijing::SetBMAX(Float_t bmax)
324 // Set the maximum impact parameter
327 //______________________________________________________________________________
328 Float_t THijing::GetEFRM() const
330 // Get the centre of mass (CMS) or lab-energy (LAB)
333 //______________________________________________________________________________
334 const char* THijing::GetFRAME() const
336 // Get the frame type ("CMS" or "LAB")
337 return fFrame.Data();
339 //______________________________________________________________________________
340 const char* THijing::GetPROJ() const
342 // Get the projectile type
345 //______________________________________________________________________________
346 const char* THijing::GetTARG() const
348 // Set the target type
351 //______________________________________________________________________________
352 Int_t THijing::GetIAP() const
354 // Get the projectile atomic number
357 //______________________________________________________________________________
358 Int_t THijing::GetIZP() const
360 // Get the projectile charge number
363 //______________________________________________________________________________
364 Int_t THijing::GetIAT() const
366 // Get the target atomic number
369 //______________________________________________________________________________
370 Int_t THijing::GetIZT() const
372 // Get the target charge number
375 //______________________________________________________________________________
376 Float_t THijing::GetBMIN() const
378 // Get the minimum impact parameter
381 //______________________________________________________________________________
382 Float_t THijing::GetBMAX() const
384 // Get the maximum impact parameter
388 //====================== access to common HIPARNT ===============================
390 //______________________________________________________________________________
391 void THijing::SetHIPR1(Int_t key,Float_t value)
393 // Set the values of array HIPR1 in common HIPARNT
394 if ( key<1 || key>100 ) {
395 printf ("ERROR in THijing:SetHIPR1(key,value): \n ");
396 printf (" key=%i is out of range [1..100]!\n",key);
400 HIPARNT.hipr1[key-1]=value;
404 //______________________________________________________________________________
405 Float_t THijing::GetHIPR1(Int_t key) const
407 // Get the values of array HIPR1 in common HIPARNT
408 if ( key<1 || key>100 ) {
409 printf ("ERROR in THijing:GetHIPR1(key): \n ");
410 printf (" key=%i is out of range [1..100]!\n",key);
414 return HIPARNT.hipr1[key-1];
418 //______________________________________________________________________________
419 void THijing::SetIHPR2(Int_t key,Int_t value)
421 // Set the values of array HIPR2 in common HIPARNT
422 if ( key<1 || key>50 ) {
423 printf ("ERROR in THijing:SetIHPR2(key,value): \n ");
424 printf (" key=%i is out of range [1..50]!\n",key);
428 HIPARNT.ihpr2[key-1]=value;
432 //______________________________________________________________________________
433 Int_t THijing::GetIHPR2(Int_t key) const
435 // Get the values of array HIPR2 in common HIPARNT
436 if ( key<1 || key>50 ) {
437 printf ("ERROR in THijing:GetIHPR2(key): \n ");
438 printf (" key=%i is out of range [1..50]!\n",key);
442 return HIPARNT.ihpr2[key-1];
447 //______________________________________________________________________________
448 Float_t THijing::GetHINT1(Int_t key) const
450 // Get the values of array HINT1 in common HIPARNT
451 if ( key<1 || key>100 ) {
452 printf ("ERROR in THijing:GetHINT1(key): \n ");
453 printf (" key=%i is out of range [1..100]!\n",key);
457 return HIPARNT.hint1[key-1];
462 //______________________________________________________________________________
463 Int_t THijing::GetIHNT2(Int_t key) const
465 // Get the values of array HINT2 in common HIPARNT
466 if ( key<1 || key>50 ) {
467 printf ("ERROR in THijing:GetIHNT2(key): \n ");
468 printf (" key=%i is out of range [1..50]!\n",key);
472 return HIPARNT.ihnt2[key-1];
477 //====================== access to common HIMAIN1 ===============================
479 //______________________________________________________________________________
480 Int_t THijing::GetNATT() const
482 // Get the number of particles produces
487 //______________________________________________________________________________
488 Float_t THijing::GetEATT() const
490 // Get total energy of particles
496 //______________________________________________________________________________
497 Int_t THijing::GetJATT() const
499 // Get number of hard scatterings
505 //______________________________________________________________________________
506 Int_t THijing::GetNT() const
508 // Get number of target participants
514 //______________________________________________________________________________
515 Int_t THijing::GetNP() const
517 // Get number of projectile participants
523 //______________________________________________________________________________
524 Int_t THijing::GetN0() const
526 // Get number of N-N collisions
530 //______________________________________________________________________________
531 Int_t THijing::GetN01() const
533 // Get number of N-wounded collisions
539 //______________________________________________________________________________
540 Int_t THijing::GetN10() const
542 // Get number of wounded-N collisions
548 //______________________________________________________________________________
549 Int_t THijing::GetN11() const
551 // Get number of wounded-wounded collisions
557 //______________________________________________________________________________
558 Float_t THijing::GetBB() const
560 // Get impact parameter
566 //====================== access to common HIMAIN2 ===============================
568 //______________________________________________________________________________
569 Int_t THijing::GetKATT(Int_t key1, Int_t key2) const
571 // Get values of array KATT in common HIMAIN2
572 if ( key1<1 || key1>200000 ) {
573 printf("ERROR in THijing::GetKATT(key1,key2):\n");
574 printf(" key1=%i is out of range [1..200000]\n",key1);
578 if ( key2<1 || key2>4 ) {
579 printf("ERROR in THijing::GetKATT(key1,key2):\n");
580 printf(" key2=%i is out of range [1..4]\n",key2);
584 return HIMAIN2.katt[key2-1][key1-1];
587 //______________________________________________________________________________
588 Float_t THijing::GetPATT(Int_t key1, Int_t key2) const
590 // Get values of array PATT in common HIMAIN2
591 if ( key1<1 || key1>200000 ) {
592 printf("ERROR in THijing::GetPATT(key1,key2):\n");
593 printf(" key1=%i is out of range [1..130000]\n",key1);
597 if ( key2<1 || key2>4 ) {
598 printf("ERROR in THijing::GetPATT(key1,key2):\n");
599 printf(" key2=%i is out of range [1..4]\n",key2);
603 return HIMAIN2.patt[key2-1][key1-1];
606 Float_t THijing::GetVATT(Int_t key1, Int_t key2) const
608 // Get values of array VATT in common HIMAIN2
609 if ( key1<1 || key1>200000 ) {
610 printf("ERROR in THijing::GetVATT(key1,key2):\n");
611 printf(" key1=%i is out of range [1..130000]\n",key1);
615 if ( key2<1 || key2>4 ) {
616 printf("ERROR in THijing::GetVATT(key1,key2):\n");
617 printf(" key2=%i is out of range [1..4]\n",key2);
621 return HIMAIN2.vatt[key2-1][key1-1];
624 //====================== access to common HIJJET1 ===============================
626 //______________________________________________________________________________
627 Int_t THijing::GetNPJ(Int_t key) const
629 // Get values of array NPJ of common HIJJET1
630 if ( key<1 || key>300 ) {
631 printf("ERROR in THijing::GetNPJ(key):\n");
632 printf(" key=%i is out of range [1..300]\n",key);
635 return HIJJET1.npj[key-1];
638 //______________________________________________________________________________
639 Int_t THijing::GetKFPJ(Int_t key1, Int_t key2) const
641 // Get values of array KFPJ in common HIJJET1
642 if ( key1<1 || key1>300 ) {
643 printf("ERROR in THijing::GetKFPJ(key1):\n");
644 printf(" key1=%i is out of range [1..300]\n",key1);
647 if ( key2<1 || key2>500 ) {
648 printf("ERROR in THijing::GetKFPJ(key1,key2):\n");
649 printf(" key2=%i is out of range [1..500]\n",key2);
653 return HIJJET1.kfpj[key2-1][key1-1];
656 //______________________________________________________________________________
657 Float_t THijing::GetPJPX(Int_t key1, Int_t key2) const
659 // Get values of array PJPX in common HIJJET1
660 if ( key1<1 || key1>300 ) {
661 printf("ERROR in THijing::GetPJPX(key1):\n");
662 printf(" key1=%i is out of range [1..300]\n",key1);
665 if ( key2<1 || key2>500 ) {
666 printf("ERROR in THijing::GetPJPX(key1,key2):\n");
667 printf(" key2=%i is out of range [1..500]\n",key2);
671 return HIJJET1.pjpx[key2-1][key1-1];
674 //______________________________________________________________________________
675 Float_t THijing::GetPJPY(Int_t key1, Int_t key2) const
677 // Get values of array PJPY in common HIJJET1
678 if ( key1<1 || key1>300 ) {
679 printf("ERROR in THijing::GetPJPY(key1):\n");
680 printf(" key1=%i is out of range [1..300]\n",key1);
683 if ( key2<1 || key2>500 ) {
684 printf("ERROR in THijing::GetPJPY(key1,key2):\n");
685 printf(" key2=%i is out of range [1..500]\n",key2);
689 return HIJJET1.pjpy[key2-1][key1-1];
692 //______________________________________________________________________________
693 Float_t THijing::GetPJPZ(Int_t key1, Int_t key2) const
695 // Get values of array PJPZ in common HIJJET1
696 if ( key1<1 || key1>300 ) {
697 printf("ERROR in THijing::GetPJPZ(key1):\n");
698 printf(" key1=%i is out of range [1..300]\n",key1);
701 if ( key2<1 || key2>500 ) {
702 printf("ERROR in THijing::GetPJPZ(key1,key2):\n");
703 printf(" key2=%i is out of range [1..500]\n",key2);
707 return HIJJET1.pjpz[key2-1][key1-1];
710 //______________________________________________________________________________
711 Float_t THijing::GetPJPE(Int_t key1, Int_t key2) const
713 // Get values of array PJPE in common HIJJET1
714 if ( key1<1 || key1>300 ) {
715 printf("ERROR in THijing::GetPJPE(key1):\n");
716 printf(" key1=%i is out of range [1..300]\n",key1);
719 if ( key2<1 || key2>500 ) {
720 printf("ERROR in THijing::GetPJPE(key1,key2):\n");
721 printf(" key2=%i is out of range [1..500]\n",key2);
725 return HIJJET1.pjpe[key2-1][key1-1];
728 //______________________________________________________________________________
729 Float_t THijing::GetPJPM(Int_t key1, Int_t key2) const
731 // Get values of array PJPM in common HIJJET1
732 if ( key1<1 || key1>300 ) {
733 printf("ERROR in THijing::GetPJPM(key1):\n");
734 printf(" key1=%i is out of range [1..300]\n",key1);
737 if ( key2<1 || key2>500 ) {
738 printf("ERROR in THijing::GetPJPM(key1,key2):\n");
739 printf(" key2=%i is out of range [1..500]\n",key2);
743 return HIJJET1.pjpm[key2-1][key1-1];
746 //______________________________________________________________________________
747 Int_t THijing::GetNTJ(Int_t key) const
749 // Get values of array NTJ in common HIJJET1
750 if ( key<1 || key>300 ) {
751 printf("ERROR in THijing::GetNTJ(key):\n");
752 printf(" key=%i is out of range [1..300]\n",key);
755 return HIJJET1.ntj[key-1];
758 //______________________________________________________________________________
759 Int_t THijing::GetKFTJ(Int_t key1, Int_t key2) const
761 // Get values of array KFTJ in common HIJJET1
762 if ( key1<1 || key1>300 ) {
763 printf("ERROR in THijing::GetKFTJ(key1):\n");
764 printf(" key1=%i is out of range [1..300]\n",key1);
767 if ( key2<1 || key2>500 ) {
768 printf("ERROR in THijing::GetKFTJ(key1,key2):\n");
769 printf(" key2=%i is out of range [1..500]\n",key2);
773 return HIJJET1.kftj[key2-1][key1-1];
776 //______________________________________________________________________________
777 Float_t THijing::GetPJTX(Int_t key1, Int_t key2) const
779 // Get values of array PJTX in common HIJJET1
780 if ( key1<1 || key1>300 ) {
781 printf("ERROR in THijing::GetPJTX(key1):\n");
782 printf(" key1=%i is out of range [1..300]\n",key1);
785 if ( key2<1 || key2>500 ) {
786 printf("ERROR in THijing::GetPJTX(key1,key2):\n");
787 printf(" key2=%i is out of range [1..500]\n",key2);
791 return HIJJET1.pjtx[key2-1][key1-1];
794 //______________________________________________________________________________
795 Float_t THijing::GetPJTY(Int_t key1, Int_t key2) const
797 // Get values of array PJTY in common HIJJET1
798 if ( key1<1 || key1>300 ) {
799 printf("ERROR in THijing::GetPJTY(key1):\n");
800 printf(" key1=%i is out of range [1..300]\n",key1);
803 if ( key2<1 || key2>500 ) {
804 printf("ERROR in THijing::GetPJTY(key1,key2):\n");
805 printf(" key2=%i is out of range [1..500]\n",key2);
809 return HIJJET1.pjty[key2-1][key1-1];
812 //______________________________________________________________________________
813 Float_t THijing::GetPJTZ(Int_t key1, Int_t key2) const
815 // Get values of array PJTZ in common HIJJET1
816 if ( key1<1 || key1>300 ) {
817 printf("ERROR in THijing::GetPJTZ(key1):\n");
818 printf(" key1=%i is out of range [1..300]\n",key1);
821 if ( key2<1 || key2>500 ) {
822 printf("ERROR in THijing::GetPJTZ(key1,key2):\n");
823 printf(" key2=%i is out of range [1..500]\n",key2);
827 return HIJJET1.pjtz[key2-1][key1-1];
830 //______________________________________________________________________________
831 Float_t THijing::GetPJTE(Int_t key1, Int_t key2) const
833 // Get values of array PJTE in common HIJJET1
834 if ( key1<1 || key1>300 ) {
835 printf("ERROR in THijing::GetPJTE(key1):\n");
836 printf(" key1=%i is out of range [1..300]\n",key1);
839 if ( key2<1 || key2>500 ) {
840 printf("ERROR in THijing::GetPJTE(key1,key2):\n");
841 printf(" key2=%i is out of range [1..500]\n",key2);
845 return HIJJET1.pjte[key2-1][key1-1];
848 //______________________________________________________________________________
849 Float_t THijing::GetPJTM(Int_t key1, Int_t key2) const
851 // Get values of array PJTM in common HIJJET1
852 if ( key1<1 || key1>300 ) {
853 printf("ERROR in THijing::GetPJTM(key1):\n");
854 printf(" key1=%i is out of range [1..300]\n",key1);
857 if ( key2<1 || key2>500 ) {
858 printf("ERROR in THijing::GetPJTM(key1,key2):\n");
859 printf(" key2=%i is out of range [1..500]\n",key2);
863 return HIJJET1.pjtm[key2-1][key1-1];
866 //====================== access to common HIJJET1 ===============================
868 //______________________________________________________________________________
869 Int_t THijing::GetNSG() const
871 // Get value of NSG in common HIJJET2
875 //______________________________________________________________________________
876 Int_t THijing::GetNJSG(Int_t key) const
878 // Get values of array NJSG in common HIJJET2
879 if ( key<1 || key>900 ) {
880 printf ("ERROR in THijing:GetNJSG(key): \n ");
881 printf (" key=%i is out of range [1..900]!\n",key);
885 return HIJJET2.njsg[key-1];
889 //______________________________________________________________________________
890 Int_t THijing::GetIASG(Int_t key1, Int_t key2) const
892 // Get values of IASG in common HIJJET2
893 if ( key1<1 || key1>900 ) {
894 printf("ERROR in THijing::GetIASG(key1):\n");
895 printf(" key1=%i is out of range [1..900]\n",key1);
898 if ( key2<1 || key2>3 ) {
899 printf("ERROR in THijing::GetIASG(key1,key2):\n");
900 printf(" key2=%i is out of range [1..3]\n",key2);
904 return HIJJET2.iasg[key2-1][key1-1];
907 //______________________________________________________________________________
908 Int_t THijing::GetK1SG(Int_t key1, Int_t key2) const
910 // Get values of K1SG in common HIJJET2
911 if ( key1<1 || key1>900 ) {
912 printf("ERROR in THijing::GetK1SG(key1):\n");
913 printf(" key1=%i is out of range [1..900]\n",key1);
916 if ( key2<1 || key2>100 ) {
917 printf("ERROR in THijing::GetK1SG(key1,key2):\n");
918 printf(" key2=%i is out of range [1..100]\n",key2);
922 return HIJJET2.k1sg[key2-1][key1-1];
925 //______________________________________________________________________________
926 Int_t THijing::GetK2SG(Int_t key1, Int_t key2) const
928 // Get values of K2SG in common HIJJET2
929 if ( key1<1 || key1>900 ) {
930 printf("ERROR in THijing::GetK2SG(key1):\n");
931 printf(" key1=%i is out of range [1..900]\n",key1);
934 if ( key2<1 || key2>100 ) {
935 printf("ERROR in THijing::GetK2SG(key1,key2):\n");
936 printf(" key2=%i is out of range [1..100]\n",key2);
940 return HIJJET2.k2sg[key2-1][key1-1];
943 //______________________________________________________________________________
944 Float_t THijing::GetPXSG(Int_t key1, Int_t key2) const
946 // Get values of PXSG in common HIJJET2
947 if ( key1<1 || key1>900 ) {
948 printf("ERROR in THijing::GetPXSG(key1):\n");
949 printf(" key1=%i is out of range [1..900]\n",key1);
952 if ( key2<1 || key2>100 ) {
953 printf("ERROR in THijing::GetPXSG(key1,key2):\n");
954 printf(" key2=%i is out of range [1..100]\n",key2);
958 return HIJJET2.pxsg[key2-1][key1-1];
961 //______________________________________________________________________________
962 Float_t THijing::GetPYSG(Int_t key1, Int_t key2) const
964 // Get values of PYSG in common HIJJET2
965 if ( key1<1 || key1>900 ) {
966 printf("ERROR in THijing::GetPYSG(key1):\n");
967 printf(" key1=%i is out of range [1..900]\n",key1);
970 if ( key2<1 || key2>100 ) {
971 printf("ERROR in THijing::GetPYSG(key1,key2):\n");
972 printf(" key2=%i is out of range [1..100]\n",key2);
976 return HIJJET2.pysg[key2-1][key1-1];
979 //______________________________________________________________________________
980 Float_t THijing::GetPZSG(Int_t key1, Int_t key2) const
982 // Get values of PZSG in common HIJJET2
983 if ( key1<1 || key1>900 ) {
984 printf("ERROR in THijing::GetPZSG(key1):\n");
985 printf(" key1=%i is out of range [1..900]\n",key1);
988 if ( key2<1 || key2>100 ) {
989 printf("ERROR in THijing::GetPZSG(key1,key2):\n");
990 printf(" key2=%i is out of range [1..100]\n",key2);
994 return HIJJET2.pzsg[key2-1][key1-1];
997 //______________________________________________________________________________
998 Float_t THijing::GetPESG(Int_t key1, Int_t key2) const
1000 // Get values of PESG in common HIJJET2
1001 if ( key1<1 || key1>900 ) {
1002 printf("ERROR in THijing::GetPESG(key1):\n");
1003 printf(" key1=%i is out of range [1..900]\n",key1);
1006 if ( key2<1 || key2>100 ) {
1007 printf("ERROR in THijing::GetPESG(key1,key2):\n");
1008 printf(" key2=%i is out of range [1..100]\n",key2);
1012 return HIJJET2.pesg[key2-1][key1-1];
1015 //______________________________________________________________________________
1016 Float_t THijing::GetPMSG(Int_t key1, Int_t key2) const
1018 // Get values of PMSG in common HIJJET2
1019 if ( key1<1 || key1>900 ) {
1020 printf("ERROR in THijing::GetPMSG(key1):\n");
1021 printf(" key1=%i is out of range [1..900]\n",key1);
1024 if ( key2<1 || key2>100 ) {
1025 printf("ERROR in THijing::GetPMSG(key1,key2):\n");
1026 printf(" key2=%i is out of range [1..100]\n",key2);
1030 return HIJJET2.pmsg[key2-1][key1-1];
1033 //====================== access to common HISTRNG ===============================
1035 //______________________________________________________________________________
1036 Int_t THijing::GetNFP(Int_t key1, Int_t key2) const
1038 // Get values of array NFP in common HISTRNG
1039 if ( key1<1 || key1>300 ) {
1040 printf("ERROR in THijing::GetNFP(key1):\n");
1041 printf(" key1=%i is out of range [1..300]\n",key1);
1044 if ( key2<1 || key2>15 ) {
1045 printf("ERROR in THijing::GetNFP(key1,key2):\n");
1046 printf(" key2=%i is out of range [1..15]\n",key2);
1050 return HISTRNG.nfp[key2-1][key1-1];
1053 //______________________________________________________________________________
1054 Float_t THijing::GetPP(Int_t key1, Int_t key2) const
1056 // Get values of array PP in common HISTRNG
1057 if ( key1<1 || key1>300 ) {
1058 printf("ERROR in THijing::GetPP(key1):\n");
1059 printf(" key1=%i is out of range [1..300]\n",key1);
1062 if ( key2<1 || key2>15 ) {
1063 printf("ERROR in THijing::GetPP(key1,key2):\n");
1064 printf(" key2=%i is out of range [1..15]\n",key2);
1068 return HISTRNG.pp[key2-1][key1-1];
1071 //______________________________________________________________________________
1072 Int_t THijing::GetNFT(Int_t key1, Int_t key2) const
1074 // Get values of array NFT in common HISTRNG
1075 if ( key1<1 || key1>300 ) {
1076 printf("ERROR in THijing::GetNFT(key1):\n");
1077 printf(" key1=%i is out of range [1..300]\n",key1);
1080 if ( key2<1 || key2>15 ) {
1081 printf("ERROR in THijing::GetNFT(key1,key2):\n");
1082 printf(" key2=%i is out of range [1..15]\n",key2);
1086 return HISTRNG.nft[key2-1][key1-1];
1089 //______________________________________________________________________________
1090 Float_t THijing::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 THijing::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 THijing::GetPT(key1,key2):\n");
1100 printf(" key2=%i is out of range [1..15]\n",key2);
1104 return HISTRNG.pt[key2-1][key1-1];
1107 void THijing::SetPARJ(Int_t key, Float_t parm)
1109 // Set values of array PARJ in common HISTRNG
1110 if ( key < 1 || key > 200) {
1111 printf("ERROR in THijing::SetPARJ(key,parm):\n");
1112 printf(" key=%i is out of range [1..200]\n",key);
1115 LUDAT1_HIJING.parj[key-1] = parm;
1119 void THijing::SetMSTJ(Int_t key, Int_t parm)
1121 // Set values of array MSTJ in common HISTRNG
1122 if ( key < 1 || key > 200) {
1123 printf("ERROR in THijing::SetMSTJ(key,parm):\n");
1124 printf(" key=%i is out of range [1..200]\n",key);
1127 LUDAT1_HIJING.mstj[key-1] = parm;
1131 //====================== access to Hijing subroutines =========================
1134 //______________________________________________________________________________
1135 void THijing::Initialize()
1137 //////////////////////////////////////////////////////////////////////////////////
1138 // Calls Hijset with the either default parameters or the ones set by the user //
1139 // via SetEFRM, SetFRAME, SetPROJ, SetTARG, SetIAP, SetIZP, SetIAT, SetIZT //
1140 //////////////////////////////////////////////////////////////////////////////////
1142 if ( (!strcmp(fFrame.Data(), "CMS " )) &&
1143 (!strcmp(fFrame.Data(), "LAB " ))){
1144 printf("WARNING! In THijing:Initialize():\n");
1145 printf(" specified frame=%s is neither CMS or LAB\n",fFrame.Data());
1146 printf(" resetting to default \"CMS\" .");
1150 if ( (!strcmp(fProj.Data(), "A " )) &&
1151 (!strcmp(fProj.Data(), "P " )) &&
1152 (!strcmp(fProj.Data(), "PBAR " ))){
1153 printf("WARNING! In THijing:Initialize():\n");
1154 printf(" specified projectile=%s is neither A, P or PBAR\n",fProj.Data());
1155 printf(" resetting to default \"A\" .");
1159 if ( (!strcmp(fTarg.Data(), "A " )) &&
1160 (!strcmp(fTarg.Data(), "P " )) &&
1161 (!strcmp(fTarg.Data(), "PBAR " ))){
1162 printf("WARNING! In THijing:Initialize():\n");
1163 printf(" specified target=%s is neither A, P or PBAR\n",fTarg.Data());
1164 printf(" resetting to default \"A\" .");
1168 printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1170 Hijset(fEfrm,fFrame.Data(),fProj.Data(),fTarg.Data(),fIap,fIzp,fIat,fIzt);
1172 printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1176 //______________________________________________________________________________
1177 void THijing::GenerateEvent()
1179 // Generates one event;
1181 Hijing(fFrame.Data(),fBmin,fBmax);
1184 //______________________________________________________________________________
1185 void THijing::Hijset(float efrm, const char *frame, const char *proj,
1186 const char *targ, int iap, int izp, int iat, int izt)
1188 // Call HIJING routine HIJSET passing the parameters in a way accepted by
1191 int s1 = strlen(frame);
1192 int s2 = strlen(proj);
1193 int s3 = strlen(targ);
1194 printf("s1 = %d s2 = %d s3 = %d\n",s1,s2,s3);
1196 hijset(efrm, frame, proj, targ, iap, izp, iat, izt, s1, s2, s3);
1198 hijset(efrm, frame, s1, proj, s2, targ, s3, iap, izp, iat, izt);
1201 //______________________________________________________________________________
1202 void THijing::Hijing(const char *frame, float bmin, float bmax)
1204 // Call HIJING routine HIJSET passing the parameters in a way accepted by
1207 int s1 = strlen(frame);
1210 hijing(frame, bmin, bmax, s1);
1212 hijing(frame, s1, bmin, bmax);
1217 Float_t THijing::Profile(float b)
1219 // Call HIJING routine PROFILE
1224 void THijing::Rluget(Int_t lfn, Int_t move)
1226 // write seed to file
1227 rluget_hijing(lfn, move);
1231 void THijing::Rluset(Int_t lfn, Int_t move)
1233 // read seed from file
1234 rluset_hijing(lfn, move);