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_
58 # define lulist_hijing lulist_hijing_
61 # define hijset HIJSET
62 # define hijing HIJING
63 # define profile PROFILE
64 # define rluget_hijing RLUGET_HIJING
65 # define rluset_hijing RLUSET_HIJING
66 # define lulist_hijing LULIST_HIJING
67 # define type_of_call _stdcall
71 extern "C" void type_of_call hijset(Float_t & , const char *,
72 const char *, const char *,
73 Int_t & , Int_t &, Int_t &,
75 const int, const int);
76 extern "C" float type_of_call profile(Float_t &);
77 extern "C" void type_of_call hijing(const char *, Float_t &,
78 Float_t &, const int);
79 extern "C" void type_of_call rluget_hijing(Int_t & lfn, Int_t & move);
81 extern "C" void type_of_call rluset_hijing(Int_t & lfn, Int_t & move);
82 extern "C" void type_of_call lulist_hijing(Int_t &);
93 TGenerator("Hijing","Hijing"),
105 // Default constructor
108 //______________________________________________________________________________
109 THijing::THijing(Float_t efrm, const char *frame="CMS",
110 const char *proj="A", const char *targ="A",
111 Int_t iap=207, Int_t izp=82, Int_t iat=207, Int_t izt=82,
112 Float_t bmin=0, Float_t bmax=20):
113 TGenerator("Hijing","Hijing"),
125 // THijing constructor:
126 // Note that there may be only one functional THijing object
127 // at a time, so it's not use to create more than one instance of it.
130 //______________________________________________________________________________
137 TObjArray* THijing::ImportParticles(Option_t *option)
140 // Default primary creation method. It reads the /HEPEVT/ common block which
141 // has been filled by the GenerateEvent method. If the event generator does
142 // not use the HEPEVT common block, This routine has to be overloaded by
144 // The function loops on the generated particles and store them in
145 // the TClonesArray pointed by the argument particles.
146 // The default action is to store only the stable particles (ISTHEP = 1)
147 // This can be demanded explicitly by setting the option = "Final"
148 // If the option = "All", all the particles are stored.
151 Int_t numpart = HIMAIN1.natt;
152 printf("\n THijing: HIJING stack contains %d particles.", numpart);
153 printf("\n THijing: Total energy: %f ", HIMAIN1.eatt);
154 printf("\n THijing: Number of hard scatterings: %d ", HIMAIN1.jatt);
156 if (!strcmp(option,"") || !strcmp(option,"Final")) {
157 for (Int_t i = 0; i < numpart; i++) {
159 if (HIMAIN2.katt[3][i] == 1) {
161 // Use the common block values for the TParticle constructor
164 TParticle* p = new TParticle(
165 HIMAIN2.katt[0][i], HIMAIN2.katt[3][i] ,
167 HIMAIN2.patt[0][i], HIMAIN2.patt[1][i], HIMAIN2.patt[2][i], HIMAIN2.patt[3][i] ,
168 HIMAIN2.vatt[0][i], HIMAIN2.vatt[1][i], HIMAIN2.vatt[2][i], HIMAIN2.vatt[3][i]
170 p->SetUniqueID(HIMAIN2.katt[1][i]);
175 else if (!strcmp(option,"All")) {
177 for (Int_t i = 0; i < numpart; i++) {
179 Int_t iParent = HIMAIN2.katt[2][i]-1;
182 TParticle *mother = (TParticle*) (fParticles->UncheckedAt(iParent));
183 mother->SetLastDaughter(i);
184 if (mother->GetFirstDaughter()==-1)
185 mother->SetFirstDaughter(i);
188 TParticle* p = new TParticle(
189 HIMAIN2.katt[0][i], HIMAIN2.katt[3][i], iParent,
191 HIMAIN2.patt[0][i], HIMAIN2.patt[1][i], HIMAIN2.patt[2][i], HIMAIN2.patt[3][i] ,
192 HIMAIN2.vatt[0][i], HIMAIN2.vatt[1][i], HIMAIN2.vatt[2][i], HIMAIN2.vatt[3][i]
194 p->SetUniqueID(HIMAIN2.katt[1][i]);
201 Int_t THijing::ImportParticles(TClonesArray *particles, Option_t *option)
204 // Default primary creation method. It reads the /HEPEVT/ common block which
205 // has been filled by the GenerateEvent method. If the event generator does
206 // not use the HEPEVT common block, This routine has to be overloaded by
208 // The function loops on the generated particles and store them in
209 // the TClonesArray pointed by the argument particles.
210 // The default action is to store only the stable particles (ISTHEP = 1)
211 // This can be demanded explicitly by setting the option = "Final"
212 // If the option = "All", all the particles are stored.
214 if (particles == 0) return 0;
215 TClonesArray &particlesR = *particles;
217 Int_t numpart = HIMAIN1.natt;
218 printf("\n THijing: HIJING stack contains %d particles.", numpart);
219 printf("\n THijing: Total energy: %f ", HIMAIN1.eatt);
220 printf("\n THijing: Number of hard scatterings: %d ", HIMAIN1.jatt);
222 if (!strcmp(option,"") || !strcmp(option,"Final")) {
223 for (Int_t i = 0; i < numpart; i++) {
225 if (HIMAIN2.katt[3][i] == 1) {
227 // Use the common block values for the TParticle constructor
230 new(particlesR[i]) TParticle(
248 particlesR[i]->SetUniqueID(HIMAIN2.katt[1][i]);
252 else if (!strcmp(option,"All")) {
254 for (Int_t i = 0; i < numpart; i++) {
256 Int_t iParent = HIMAIN2.katt[2][i]-1;
259 TParticle *mother = (TParticle*) (particlesR.UncheckedAt(iParent));
260 mother->SetLastDaughter(i);
261 if (mother->GetFirstDaughter()==-1)
262 mother->SetFirstDaughter(i);
265 new(particlesR[i]) TParticle(
283 particlesR[i]->SetUniqueID(HIMAIN2.katt[1][i]);
289 //______________________________________________________________________________
290 void THijing::SetEFRM(Float_t efrm)
292 // Set the centre of mass (CMS) or lab-energy (LAB)
295 //______________________________________________________________________________
296 void THijing::SetFRAME(const char* frame)
298 // Set the frame type ("CMS" or "LAB")
301 //______________________________________________________________________________
302 void THijing::SetPROJ(const char* proj)
304 // Set the projectile type
307 //______________________________________________________________________________
308 void THijing::SetTARG(const char* targ)
310 // Set the target type
313 //______________________________________________________________________________
314 void THijing::SetIAP(Int_t iap)
316 // Set the projectile atomic number
319 //______________________________________________________________________________
320 void THijing::SetIZP(Int_t izp)
322 // Set the projectile charge number
325 //______________________________________________________________________________
326 void THijing::SetIAT(Int_t iat)
328 // Set the target atomic number
331 //______________________________________________________________________________
332 void THijing::SetIZT(Int_t izt)
334 // Set the target charge number
337 //______________________________________________________________________________
338 void THijing::SetBMIN(Float_t bmin)
340 // Set the minimum impact parameter
343 //______________________________________________________________________________
344 void THijing::SetBMAX(Float_t bmax)
346 // Set the maximum impact parameter
349 //______________________________________________________________________________
350 Float_t THijing::GetEFRM() const
352 // Get the centre of mass (CMS) or lab-energy (LAB)
355 //______________________________________________________________________________
356 const char* THijing::GetFRAME() const
358 // Get the frame type ("CMS" or "LAB")
359 return fFrame.Data();
361 //______________________________________________________________________________
362 const char* THijing::GetPROJ() const
364 // Get the projectile type
367 //______________________________________________________________________________
368 const char* THijing::GetTARG() const
370 // Set the target type
373 //______________________________________________________________________________
374 Int_t THijing::GetIAP() const
376 // Get the projectile atomic number
379 //______________________________________________________________________________
380 Int_t THijing::GetIZP() const
382 // Get the projectile charge number
385 //______________________________________________________________________________
386 Int_t THijing::GetIAT() const
388 // Get the target atomic number
391 //______________________________________________________________________________
392 Int_t THijing::GetIZT() const
394 // Get the target charge number
397 //______________________________________________________________________________
398 Float_t THijing::GetBMIN() const
400 // Get the minimum impact parameter
403 //______________________________________________________________________________
404 Float_t THijing::GetBMAX() const
406 // Get the maximum impact parameter
410 //====================== access to common HIPARNT ===============================
412 //______________________________________________________________________________
413 void THijing::SetHIPR1(Int_t key,Float_t value)
415 // Set the values of array HIPR1 in common HIPARNT
416 if ( key<1 || key>100 ) {
417 printf ("ERROR in THijing:SetHIPR1(key,value): \n ");
418 printf (" key=%i is out of range [1..100]!\n",key);
422 HIPARNT.hipr1[key-1]=value;
426 //______________________________________________________________________________
427 Float_t THijing::GetHIPR1(Int_t key) const
429 // Get the values of array HIPR1 in common HIPARNT
430 if ( key<1 || key>100 ) {
431 printf ("ERROR in THijing:GetHIPR1(key): \n ");
432 printf (" key=%i is out of range [1..100]!\n",key);
436 return HIPARNT.hipr1[key-1];
440 //______________________________________________________________________________
441 void THijing::SetIHPR2(Int_t key,Int_t value)
443 // Set the values of array HIPR2 in common HIPARNT
444 if ( key<1 || key>50 ) {
445 printf ("ERROR in THijing:SetIHPR2(key,value): \n ");
446 printf (" key=%i is out of range [1..50]!\n",key);
450 HIPARNT.ihpr2[key-1]=value;
454 //______________________________________________________________________________
455 Int_t THijing::GetIHPR2(Int_t key) const
457 // Get the values of array HIPR2 in common HIPARNT
458 if ( key<1 || key>50 ) {
459 printf ("ERROR in THijing:GetIHPR2(key): \n ");
460 printf (" key=%i is out of range [1..50]!\n",key);
464 return HIPARNT.ihpr2[key-1];
469 //______________________________________________________________________________
470 Float_t THijing::GetHINT1(Int_t key) const
472 // Get the values of array HINT1 in common HIPARNT
473 if ( key<1 || key>100 ) {
474 printf ("ERROR in THijing:GetHINT1(key): \n ");
475 printf (" key=%i is out of range [1..100]!\n",key);
479 return HIPARNT.hint1[key-1];
484 //______________________________________________________________________________
485 Int_t THijing::GetIHNT2(Int_t key) const
487 // Get the values of array HINT2 in common HIPARNT
488 if ( key<1 || key>50 ) {
489 printf ("ERROR in THijing:GetIHNT2(key): \n ");
490 printf (" key=%i is out of range [1..50]!\n",key);
494 return HIPARNT.ihnt2[key-1];
499 //====================== access to common HIMAIN1 ===============================
501 //______________________________________________________________________________
502 Int_t THijing::GetNATT() const
504 // Get the number of particles produces
509 //______________________________________________________________________________
510 Float_t THijing::GetEATT() const
512 // Get total energy of particles
518 //______________________________________________________________________________
519 Int_t THijing::GetJATT() const
521 // Get number of hard scatterings
527 //______________________________________________________________________________
528 Int_t THijing::GetNT() const
530 // Get number of target participants
536 //______________________________________________________________________________
537 Int_t THijing::GetNP() const
539 // Get number of projectile participants
545 //______________________________________________________________________________
546 Int_t THijing::GetN0() const
548 // Get number of N-N collisions
552 //______________________________________________________________________________
553 Int_t THijing::GetN01() const
555 // Get number of N-wounded collisions
561 //______________________________________________________________________________
562 Int_t THijing::GetN10() const
564 // Get number of wounded-N collisions
570 //______________________________________________________________________________
571 Int_t THijing::GetN11() const
573 // Get number of wounded-wounded collisions
579 //______________________________________________________________________________
580 Float_t THijing::GetBB() const
582 // Get impact parameter
588 //====================== access to common HIMAIN2 ===============================
590 //______________________________________________________________________________
591 Int_t THijing::GetKATT(Int_t key1, Int_t key2) const
593 // Get values of array KATT in common HIMAIN2
594 if ( key1<1 || key1>200000 ) {
595 printf("ERROR in THijing::GetKATT(key1,key2):\n");
596 printf(" key1=%i is out of range [1..200000]\n",key1);
600 if ( key2<1 || key2>4 ) {
601 printf("ERROR in THijing::GetKATT(key1,key2):\n");
602 printf(" key2=%i is out of range [1..4]\n",key2);
606 return HIMAIN2.katt[key2-1][key1-1];
609 //______________________________________________________________________________
610 Float_t THijing::GetPATT(Int_t key1, Int_t key2) const
612 // Get values of array PATT in common HIMAIN2
613 if ( key1<1 || key1>200000 ) {
614 printf("ERROR in THijing::GetPATT(key1,key2):\n");
615 printf(" key1=%i is out of range [1..130000]\n",key1);
619 if ( key2<1 || key2>4 ) {
620 printf("ERROR in THijing::GetPATT(key1,key2):\n");
621 printf(" key2=%i is out of range [1..4]\n",key2);
625 return HIMAIN2.patt[key2-1][key1-1];
628 Float_t THijing::GetVATT(Int_t key1, Int_t key2) const
630 // Get values of array VATT in common HIMAIN2
631 if ( key1<1 || key1>200000 ) {
632 printf("ERROR in THijing::GetVATT(key1,key2):\n");
633 printf(" key1=%i is out of range [1..130000]\n",key1);
637 if ( key2<1 || key2>4 ) {
638 printf("ERROR in THijing::GetVATT(key1,key2):\n");
639 printf(" key2=%i is out of range [1..4]\n",key2);
643 return HIMAIN2.vatt[key2-1][key1-1];
646 //====================== access to common HIJJET1 ===============================
648 //______________________________________________________________________________
649 Int_t THijing::GetNPJ(Int_t key) const
651 // Get values of array NPJ of common HIJJET1
652 if ( key<1 || key>300 ) {
653 printf("ERROR in THijing::GetNPJ(key):\n");
654 printf(" key=%i is out of range [1..300]\n",key);
657 return HIJJET1.npj[key-1];
660 //______________________________________________________________________________
661 Int_t THijing::GetKFPJ(Int_t key1, Int_t key2) const
663 // Get values of array KFPJ in common HIJJET1
664 if ( key1<1 || key1>300 ) {
665 printf("ERROR in THijing::GetKFPJ(key1):\n");
666 printf(" key1=%i is out of range [1..300]\n",key1);
669 if ( key2<1 || key2>500 ) {
670 printf("ERROR in THijing::GetKFPJ(key1,key2):\n");
671 printf(" key2=%i is out of range [1..500]\n",key2);
675 return HIJJET1.kfpj[key2-1][key1-1];
678 //______________________________________________________________________________
679 Float_t THijing::GetPJPX(Int_t key1, Int_t key2) const
681 // Get values of array PJPX in common HIJJET1
682 if ( key1<1 || key1>300 ) {
683 printf("ERROR in THijing::GetPJPX(key1):\n");
684 printf(" key1=%i is out of range [1..300]\n",key1);
687 if ( key2<1 || key2>500 ) {
688 printf("ERROR in THijing::GetPJPX(key1,key2):\n");
689 printf(" key2=%i is out of range [1..500]\n",key2);
693 return HIJJET1.pjpx[key2-1][key1-1];
696 //______________________________________________________________________________
697 Float_t THijing::GetPJPY(Int_t key1, Int_t key2) const
699 // Get values of array PJPY in common HIJJET1
700 if ( key1<1 || key1>300 ) {
701 printf("ERROR in THijing::GetPJPY(key1):\n");
702 printf(" key1=%i is out of range [1..300]\n",key1);
705 if ( key2<1 || key2>500 ) {
706 printf("ERROR in THijing::GetPJPY(key1,key2):\n");
707 printf(" key2=%i is out of range [1..500]\n",key2);
711 return HIJJET1.pjpy[key2-1][key1-1];
714 //______________________________________________________________________________
715 Float_t THijing::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 THijing::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 THijing::GetPJPZ(key1,key2):\n");
725 printf(" key2=%i is out of range [1..500]\n",key2);
729 return HIJJET1.pjpz[key2-1][key1-1];
732 //______________________________________________________________________________
733 Float_t THijing::GetPJPE(Int_t key1, Int_t key2) const
735 // Get values of array PJPE in common HIJJET1
736 if ( key1<1 || key1>300 ) {
737 printf("ERROR in THijing::GetPJPE(key1):\n");
738 printf(" key1=%i is out of range [1..300]\n",key1);
741 if ( key2<1 || key2>500 ) {
742 printf("ERROR in THijing::GetPJPE(key1,key2):\n");
743 printf(" key2=%i is out of range [1..500]\n",key2);
747 return HIJJET1.pjpe[key2-1][key1-1];
750 //______________________________________________________________________________
751 Float_t THijing::GetPJPM(Int_t key1, Int_t key2) const
753 // Get values of array PJPM in common HIJJET1
754 if ( key1<1 || key1>300 ) {
755 printf("ERROR in THijing::GetPJPM(key1):\n");
756 printf(" key1=%i is out of range [1..300]\n",key1);
759 if ( key2<1 || key2>500 ) {
760 printf("ERROR in THijing::GetPJPM(key1,key2):\n");
761 printf(" key2=%i is out of range [1..500]\n",key2);
765 return HIJJET1.pjpm[key2-1][key1-1];
768 //______________________________________________________________________________
769 Int_t THijing::GetNTJ(Int_t key) const
771 // Get values of array NTJ in common HIJJET1
772 if ( key<1 || key>300 ) {
773 printf("ERROR in THijing::GetNTJ(key):\n");
774 printf(" key=%i is out of range [1..300]\n",key);
777 return HIJJET1.ntj[key-1];
780 //______________________________________________________________________________
781 Int_t THijing::GetKFTJ(Int_t key1, Int_t key2) const
783 // Get values of array KFTJ in common HIJJET1
784 if ( key1<1 || key1>300 ) {
785 printf("ERROR in THijing::GetKFTJ(key1):\n");
786 printf(" key1=%i is out of range [1..300]\n",key1);
789 if ( key2<1 || key2>500 ) {
790 printf("ERROR in THijing::GetKFTJ(key1,key2):\n");
791 printf(" key2=%i is out of range [1..500]\n",key2);
795 return HIJJET1.kftj[key2-1][key1-1];
798 //______________________________________________________________________________
799 Float_t THijing::GetPJTX(Int_t key1, Int_t key2) const
801 // Get values of array PJTX in common HIJJET1
802 if ( key1<1 || key1>300 ) {
803 printf("ERROR in THijing::GetPJTX(key1):\n");
804 printf(" key1=%i is out of range [1..300]\n",key1);
807 if ( key2<1 || key2>500 ) {
808 printf("ERROR in THijing::GetPJTX(key1,key2):\n");
809 printf(" key2=%i is out of range [1..500]\n",key2);
813 return HIJJET1.pjtx[key2-1][key1-1];
816 //______________________________________________________________________________
817 Float_t THijing::GetPJTY(Int_t key1, Int_t key2) const
819 // Get values of array PJTY in common HIJJET1
820 if ( key1<1 || key1>300 ) {
821 printf("ERROR in THijing::GetPJTY(key1):\n");
822 printf(" key1=%i is out of range [1..300]\n",key1);
825 if ( key2<1 || key2>500 ) {
826 printf("ERROR in THijing::GetPJTY(key1,key2):\n");
827 printf(" key2=%i is out of range [1..500]\n",key2);
831 return HIJJET1.pjty[key2-1][key1-1];
834 //______________________________________________________________________________
835 Float_t THijing::GetPJTZ(Int_t key1, Int_t key2) const
837 // Get values of array PJTZ in common HIJJET1
838 if ( key1<1 || key1>300 ) {
839 printf("ERROR in THijing::GetPJTZ(key1):\n");
840 printf(" key1=%i is out of range [1..300]\n",key1);
843 if ( key2<1 || key2>500 ) {
844 printf("ERROR in THijing::GetPJTZ(key1,key2):\n");
845 printf(" key2=%i is out of range [1..500]\n",key2);
849 return HIJJET1.pjtz[key2-1][key1-1];
852 //______________________________________________________________________________
853 Float_t THijing::GetPJTE(Int_t key1, Int_t key2) const
855 // Get values of array PJTE in common HIJJET1
856 if ( key1<1 || key1>300 ) {
857 printf("ERROR in THijing::GetPJTE(key1):\n");
858 printf(" key1=%i is out of range [1..300]\n",key1);
861 if ( key2<1 || key2>500 ) {
862 printf("ERROR in THijing::GetPJTE(key1,key2):\n");
863 printf(" key2=%i is out of range [1..500]\n",key2);
867 return HIJJET1.pjte[key2-1][key1-1];
870 //______________________________________________________________________________
871 Float_t THijing::GetPJTM(Int_t key1, Int_t key2) const
873 // Get values of array PJTM in common HIJJET1
874 if ( key1<1 || key1>300 ) {
875 printf("ERROR in THijing::GetPJTM(key1):\n");
876 printf(" key1=%i is out of range [1..300]\n",key1);
879 if ( key2<1 || key2>500 ) {
880 printf("ERROR in THijing::GetPJTM(key1,key2):\n");
881 printf(" key2=%i is out of range [1..500]\n",key2);
885 return HIJJET1.pjtm[key2-1][key1-1];
888 //====================== access to common HIJJET1 ===============================
890 //______________________________________________________________________________
891 Int_t THijing::GetNSG() const
893 // Get value of NSG in common HIJJET2
897 //______________________________________________________________________________
898 Int_t THijing::GetNJSG(Int_t key) const
900 // Get values of array NJSG in common HIJJET2
901 if ( key<1 || key>900 ) {
902 printf ("ERROR in THijing:GetNJSG(key): \n ");
903 printf (" key=%i is out of range [1..900]!\n",key);
907 return HIJJET2.njsg[key-1];
911 //______________________________________________________________________________
912 Int_t THijing::GetIASG(Int_t key1, Int_t key2) const
914 // Get values of IASG in common HIJJET2
915 if ( key1<1 || key1>900 ) {
916 printf("ERROR in THijing::GetIASG(key1):\n");
917 printf(" key1=%i is out of range [1..900]\n",key1);
920 if ( key2<1 || key2>3 ) {
921 printf("ERROR in THijing::GetIASG(key1,key2):\n");
922 printf(" key2=%i is out of range [1..3]\n",key2);
926 return HIJJET2.iasg[key2-1][key1-1];
929 //______________________________________________________________________________
930 Int_t THijing::GetK1SG(Int_t key1, Int_t key2) const
932 // Get values of K1SG in common HIJJET2
933 if ( key1<1 || key1>900 ) {
934 printf("ERROR in THijing::GetK1SG(key1):\n");
935 printf(" key1=%i is out of range [1..900]\n",key1);
938 if ( key2<1 || key2>100 ) {
939 printf("ERROR in THijing::GetK1SG(key1,key2):\n");
940 printf(" key2=%i is out of range [1..100]\n",key2);
944 return HIJJET2.k1sg[key2-1][key1-1];
947 //______________________________________________________________________________
948 Int_t THijing::GetK2SG(Int_t key1, Int_t key2) const
950 // Get values of K2SG in common HIJJET2
951 if ( key1<1 || key1>900 ) {
952 printf("ERROR in THijing::GetK2SG(key1):\n");
953 printf(" key1=%i is out of range [1..900]\n",key1);
956 if ( key2<1 || key2>100 ) {
957 printf("ERROR in THijing::GetK2SG(key1,key2):\n");
958 printf(" key2=%i is out of range [1..100]\n",key2);
962 return HIJJET2.k2sg[key2-1][key1-1];
965 //______________________________________________________________________________
966 Float_t THijing::GetPXSG(Int_t key1, Int_t key2) const
968 // Get values of PXSG in common HIJJET2
969 if ( key1<1 || key1>900 ) {
970 printf("ERROR in THijing::GetPXSG(key1):\n");
971 printf(" key1=%i is out of range [1..900]\n",key1);
974 if ( key2<1 || key2>100 ) {
975 printf("ERROR in THijing::GetPXSG(key1,key2):\n");
976 printf(" key2=%i is out of range [1..100]\n",key2);
980 return HIJJET2.pxsg[key2-1][key1-1];
983 //______________________________________________________________________________
984 Float_t THijing::GetPYSG(Int_t key1, Int_t key2) const
986 // Get values of PYSG in common HIJJET2
987 if ( key1<1 || key1>900 ) {
988 printf("ERROR in THijing::GetPYSG(key1):\n");
989 printf(" key1=%i is out of range [1..900]\n",key1);
992 if ( key2<1 || key2>100 ) {
993 printf("ERROR in THijing::GetPYSG(key1,key2):\n");
994 printf(" key2=%i is out of range [1..100]\n",key2);
998 return HIJJET2.pysg[key2-1][key1-1];
1001 //______________________________________________________________________________
1002 Float_t THijing::GetPZSG(Int_t key1, Int_t key2) const
1004 // Get values of PZSG in common HIJJET2
1005 if ( key1<1 || key1>900 ) {
1006 printf("ERROR in THijing::GetPZSG(key1):\n");
1007 printf(" key1=%i is out of range [1..900]\n",key1);
1010 if ( key2<1 || key2>100 ) {
1011 printf("ERROR in THijing::GetPZSG(key1,key2):\n");
1012 printf(" key2=%i is out of range [1..100]\n",key2);
1016 return HIJJET2.pzsg[key2-1][key1-1];
1019 //______________________________________________________________________________
1020 Float_t THijing::GetPESG(Int_t key1, Int_t key2) const
1022 // Get values of PESG in common HIJJET2
1023 if ( key1<1 || key1>900 ) {
1024 printf("ERROR in THijing::GetPESG(key1):\n");
1025 printf(" key1=%i is out of range [1..900]\n",key1);
1028 if ( key2<1 || key2>100 ) {
1029 printf("ERROR in THijing::GetPESG(key1,key2):\n");
1030 printf(" key2=%i is out of range [1..100]\n",key2);
1034 return HIJJET2.pesg[key2-1][key1-1];
1037 //______________________________________________________________________________
1038 Float_t THijing::GetPMSG(Int_t key1, Int_t key2) const
1040 // Get values of PMSG in common HIJJET2
1041 if ( key1<1 || key1>900 ) {
1042 printf("ERROR in THijing::GetPMSG(key1):\n");
1043 printf(" key1=%i is out of range [1..900]\n",key1);
1046 if ( key2<1 || key2>100 ) {
1047 printf("ERROR in THijing::GetPMSG(key1,key2):\n");
1048 printf(" key2=%i is out of range [1..100]\n",key2);
1052 return HIJJET2.pmsg[key2-1][key1-1];
1055 //====================== access to common HISTRNG ===============================
1057 //______________________________________________________________________________
1058 Int_t THijing::GetNFP(Int_t key1, Int_t key2) const
1060 // Get values of array NFP in common HISTRNG
1061 if ( key1<1 || key1>300 ) {
1062 printf("ERROR in THijing::GetNFP(key1):\n");
1063 printf(" key1=%i is out of range [1..300]\n",key1);
1066 if ( key2<1 || key2>15 ) {
1067 printf("ERROR in THijing::GetNFP(key1,key2):\n");
1068 printf(" key2=%i is out of range [1..15]\n",key2);
1072 return HISTRNG.nfp[key2-1][key1-1];
1075 //______________________________________________________________________________
1076 Float_t THijing::GetPP(Int_t key1, Int_t key2) const
1078 // Get values of array PP in common HISTRNG
1079 if ( key1<1 || key1>300 ) {
1080 printf("ERROR in THijing::GetPP(key1):\n");
1081 printf(" key1=%i is out of range [1..300]\n",key1);
1084 if ( key2<1 || key2>15 ) {
1085 printf("ERROR in THijing::GetPP(key1,key2):\n");
1086 printf(" key2=%i is out of range [1..15]\n",key2);
1090 return HISTRNG.pp[key2-1][key1-1];
1093 //______________________________________________________________________________
1094 Int_t THijing::GetNFT(Int_t key1, Int_t key2) const
1096 // Get values of array NFT in common HISTRNG
1097 if ( key1<1 || key1>300 ) {
1098 printf("ERROR in THijing::GetNFT(key1):\n");
1099 printf(" key1=%i is out of range [1..300]\n",key1);
1102 if ( key2<1 || key2>15 ) {
1103 printf("ERROR in THijing::GetNFT(key1,key2):\n");
1104 printf(" key2=%i is out of range [1..15]\n",key2);
1108 return HISTRNG.nft[key2-1][key1-1];
1111 //______________________________________________________________________________
1112 Float_t THijing::GetPT(Int_t key1, Int_t key2) const
1114 // Get values of array PT in common HISTRNG
1115 if ( key1<1 || key1>300 ) {
1116 printf("ERROR in THijing::GetPT(key1):\n");
1117 printf(" key1=%i is out of range [1..300]\n",key1);
1120 if ( key2<1 || key2>15 ) {
1121 printf("ERROR in THijing::GetPT(key1,key2):\n");
1122 printf(" key2=%i is out of range [1..15]\n",key2);
1126 return HISTRNG.pt[key2-1][key1-1];
1129 void THijing::SetPARJ(Int_t key, Float_t parm)
1131 // Set values of array PARJ in common HISTRNG
1132 if ( key < 1 || key > 200) {
1133 printf("ERROR in THijing::SetPARJ(key,parm):\n");
1134 printf(" key=%i is out of range [1..200]\n",key);
1136 LUDAT1_HIJING.parj[key-1] = parm;
1141 void THijing::SetMSTJ(Int_t key, Int_t parm)
1143 // Set values of array MSTJ in common HISTRNG
1144 if ( key < 1 || key > 200) {
1145 printf("ERROR in THijing::SetMSTJ(key,parm):\n");
1146 printf(" key=%i is out of range [1..200]\n",key);
1148 LUDAT1_HIJING.mstj[key-1] = parm;
1152 void THijing::SetMDCY(Int_t key1, Int_t key2, Int_t parm)
1154 // Set value of array MDCY
1155 if ( key1 < 1 || key1 > 500) {
1156 printf("ERROR in THijing::SetMDCY(key1, key2, parm):\n");
1157 printf(" key1=%i is out of range [1..200]\n", key1);
1158 } else if ( key2 < 1 || key2 > 3) {
1159 printf("ERROR in THijing::SetMDCY(key1, key2, parm):\n");
1160 printf(" key2=%i is out of range [1..200]\n", key2);
1162 LUDAT3_HIJING.mdcy[key2-1][key1-1] = parm;
1167 Int_t THijing::GetMDCY(Int_t key1, Int_t key2)
1169 // Get value of array MDCY
1170 if ( key1 < 1 || key1 > 500) {
1171 printf("ERROR in THijing::GetMDCY(key1, key2, parm):\n");
1172 printf(" key1=%i is out of range [1..200]\n", key1);
1174 } else if ( key2 < 1 || key2 > 3) {
1175 printf("ERROR in THijing::GetMDCY(key1, key2, parm):\n");
1176 printf(" key2=%i is out of range [1..200]\n", key2);
1179 return (LUDAT3_HIJING.mdcy[key2-1][key1-1]);
1183 //====================== access to Hijing subroutines =========================
1186 //______________________________________________________________________________
1187 void THijing::Initialize()
1189 //////////////////////////////////////////////////////////////////////////////////
1190 // Calls Hijset with the either default parameters or the ones set by the user //
1191 // via SetEFRM, SetFRAME, SetPROJ, SetTARG, SetIAP, SetIZP, SetIAT, SetIZT //
1192 //////////////////////////////////////////////////////////////////////////////////
1194 if ( (!strcmp(fFrame.Data(), "CMS " )) &&
1195 (!strcmp(fFrame.Data(), "LAB " ))){
1196 printf("WARNING! In THijing:Initialize():\n");
1197 printf(" specified frame=%s is neither CMS or LAB\n",fFrame.Data());
1198 printf(" resetting to default \"CMS\" .");
1202 if ( (!strcmp(fProj.Data(), "A " )) &&
1203 (!strcmp(fProj.Data(), "P " )) &&
1204 (!strcmp(fProj.Data(), "PBAR " ))){
1205 printf("WARNING! In THijing:Initialize():\n");
1206 printf(" specified projectile=%s is neither A, P or PBAR\n",fProj.Data());
1207 printf(" resetting to default \"A\" .");
1211 if ( (!strcmp(fTarg.Data(), "A " )) &&
1212 (!strcmp(fTarg.Data(), "P " )) &&
1213 (!strcmp(fTarg.Data(), "PBAR " ))){
1214 printf("WARNING! In THijing:Initialize():\n");
1215 printf(" specified target=%s is neither A, P or PBAR\n",fTarg.Data());
1216 printf(" resetting to default \"A\" .");
1220 printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1222 Hijset(fEfrm,fFrame.Data(),fProj.Data(),fTarg.Data(),fIap,fIzp,fIat,fIzt);
1224 printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1228 //______________________________________________________________________________
1229 void THijing::GenerateEvent()
1231 // Generates one event;
1233 Hijing(fFrame.Data(),fBmin,fBmax);
1236 //______________________________________________________________________________
1237 void THijing::Hijset(float efrm, const char *frame, const char *proj,
1238 const char *targ, int iap, int izp, int iat, int izt)
1240 // Call HIJING routine HIJSET passing the parameters in a way accepted by
1243 int s1 = strlen(frame);
1244 int s2 = strlen(proj);
1245 int s3 = strlen(targ);
1246 printf("s1 = %d s2 = %d s3 = %d\n",s1,s2,s3);
1248 hijset(efrm, frame, proj, targ, iap, izp, iat, izt, s1, s2, s3);
1250 hijset(efrm, frame, s1, proj, s2, targ, s3, iap, izp, iat, izt);
1253 //______________________________________________________________________________
1254 void THijing::Hijing(const char *frame, float bmin, float bmax)
1256 // Call HIJING routine HIJSET passing the parameters in a way accepted by
1259 int s1 = strlen(frame);
1262 hijing(frame, bmin, bmax, s1);
1264 hijing(frame, s1, bmin, bmax);
1269 Float_t THijing::Profile(float b)
1271 // Call HIJING routine PROFILE
1276 void THijing::Rluget(Int_t lfn, Int_t move)
1278 // write seed to file
1279 rluget_hijing(lfn, move);
1283 void THijing::Rluset(Int_t lfn, Int_t move)
1285 // read seed from file
1286 rluset_hijing(lfn, move);
1289 void THijing::Pylist(Int_t flag)
1292 lulist_hijing(flag);