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 Int_t THijing::GetNPART() const
511 // Get true number of participants
512 return HIMAIN1.npart;
516 //______________________________________________________________________________
517 Float_t THijing::GetEATT() const
519 // Get total energy of particles
525 //______________________________________________________________________________
526 Int_t THijing::GetJATT() const
528 // Get number of hard scatterings
534 //______________________________________________________________________________
535 Int_t THijing::GetNT() const
537 // Get number of target participants
543 //______________________________________________________________________________
544 Int_t THijing::GetNP() const
546 // Get number of projectile participants
552 //______________________________________________________________________________
553 Int_t THijing::GetN0() const
555 // Get number of N-N collisions
559 //______________________________________________________________________________
560 Int_t THijing::GetN01() const
562 // Get number of N-wounded collisions
568 //______________________________________________________________________________
569 Int_t THijing::GetN10() const
571 // Get number of wounded-N collisions
577 //______________________________________________________________________________
578 Int_t THijing::GetN11() const
580 // Get number of wounded-wounded collisions
586 //______________________________________________________________________________
587 Float_t THijing::GetBB() const
589 // Get impact parameter
595 //====================== access to common HIMAIN2 ===============================
597 //______________________________________________________________________________
598 Int_t THijing::GetKATT(Int_t key1, Int_t key2) const
600 // Get values of array KATT in common HIMAIN2
601 if ( key1<1 || key1>200000 ) {
602 printf("ERROR in THijing::GetKATT(key1,key2):\n");
603 printf(" key1=%i is out of range [1..200000]\n",key1);
607 if ( key2<1 || key2>4 ) {
608 printf("ERROR in THijing::GetKATT(key1,key2):\n");
609 printf(" key2=%i is out of range [1..4]\n",key2);
613 return HIMAIN2.katt[key2-1][key1-1];
616 //______________________________________________________________________________
617 Float_t THijing::GetPATT(Int_t key1, Int_t key2) const
619 // Get values of array PATT in common HIMAIN2
620 if ( key1<1 || key1>200000 ) {
621 printf("ERROR in THijing::GetPATT(key1,key2):\n");
622 printf(" key1=%i is out of range [1..130000]\n",key1);
626 if ( key2<1 || key2>4 ) {
627 printf("ERROR in THijing::GetPATT(key1,key2):\n");
628 printf(" key2=%i is out of range [1..4]\n",key2);
632 return HIMAIN2.patt[key2-1][key1-1];
635 Float_t THijing::GetVATT(Int_t key1, Int_t key2) const
637 // Get values of array VATT in common HIMAIN2
638 if ( key1<1 || key1>200000 ) {
639 printf("ERROR in THijing::GetVATT(key1,key2):\n");
640 printf(" key1=%i is out of range [1..130000]\n",key1);
644 if ( key2<1 || key2>4 ) {
645 printf("ERROR in THijing::GetVATT(key1,key2):\n");
646 printf(" key2=%i is out of range [1..4]\n",key2);
650 return HIMAIN2.vatt[key2-1][key1-1];
653 //====================== access to common HIJJET1 ===============================
655 //______________________________________________________________________________
656 Int_t THijing::GetNPJ(Int_t key) const
658 // Get values of array NPJ of common HIJJET1
659 if ( key<1 || key>300 ) {
660 printf("ERROR in THijing::GetNPJ(key):\n");
661 printf(" key=%i is out of range [1..300]\n",key);
664 return HIJJET1.npj[key-1];
667 //______________________________________________________________________________
668 Int_t THijing::GetKFPJ(Int_t key1, Int_t key2) const
670 // Get values of array KFPJ in common HIJJET1
671 if ( key1<1 || key1>300 ) {
672 printf("ERROR in THijing::GetKFPJ(key1):\n");
673 printf(" key1=%i is out of range [1..300]\n",key1);
676 if ( key2<1 || key2>500 ) {
677 printf("ERROR in THijing::GetKFPJ(key1,key2):\n");
678 printf(" key2=%i is out of range [1..500]\n",key2);
682 return HIJJET1.kfpj[key2-1][key1-1];
685 //______________________________________________________________________________
686 Float_t THijing::GetPJPX(Int_t key1, Int_t key2) const
688 // Get values of array PJPX in common HIJJET1
689 if ( key1<1 || key1>300 ) {
690 printf("ERROR in THijing::GetPJPX(key1):\n");
691 printf(" key1=%i is out of range [1..300]\n",key1);
694 if ( key2<1 || key2>500 ) {
695 printf("ERROR in THijing::GetPJPX(key1,key2):\n");
696 printf(" key2=%i is out of range [1..500]\n",key2);
700 return HIJJET1.pjpx[key2-1][key1-1];
703 //______________________________________________________________________________
704 Float_t THijing::GetPJPY(Int_t key1, Int_t key2) const
706 // Get values of array PJPY in common HIJJET1
707 if ( key1<1 || key1>300 ) {
708 printf("ERROR in THijing::GetPJPY(key1):\n");
709 printf(" key1=%i is out of range [1..300]\n",key1);
712 if ( key2<1 || key2>500 ) {
713 printf("ERROR in THijing::GetPJPY(key1,key2):\n");
714 printf(" key2=%i is out of range [1..500]\n",key2);
718 return HIJJET1.pjpy[key2-1][key1-1];
721 //______________________________________________________________________________
722 Float_t THijing::GetPJPZ(Int_t key1, Int_t key2) const
724 // Get values of array PJPZ in common HIJJET1
725 if ( key1<1 || key1>300 ) {
726 printf("ERROR in THijing::GetPJPZ(key1):\n");
727 printf(" key1=%i is out of range [1..300]\n",key1);
730 if ( key2<1 || key2>500 ) {
731 printf("ERROR in THijing::GetPJPZ(key1,key2):\n");
732 printf(" key2=%i is out of range [1..500]\n",key2);
736 return HIJJET1.pjpz[key2-1][key1-1];
739 //______________________________________________________________________________
740 Float_t THijing::GetPJPE(Int_t key1, Int_t key2) const
742 // Get values of array PJPE in common HIJJET1
743 if ( key1<1 || key1>300 ) {
744 printf("ERROR in THijing::GetPJPE(key1):\n");
745 printf(" key1=%i is out of range [1..300]\n",key1);
748 if ( key2<1 || key2>500 ) {
749 printf("ERROR in THijing::GetPJPE(key1,key2):\n");
750 printf(" key2=%i is out of range [1..500]\n",key2);
754 return HIJJET1.pjpe[key2-1][key1-1];
757 //______________________________________________________________________________
758 Float_t THijing::GetPJPM(Int_t key1, Int_t key2) const
760 // Get values of array PJPM in common HIJJET1
761 if ( key1<1 || key1>300 ) {
762 printf("ERROR in THijing::GetPJPM(key1):\n");
763 printf(" key1=%i is out of range [1..300]\n",key1);
766 if ( key2<1 || key2>500 ) {
767 printf("ERROR in THijing::GetPJPM(key1,key2):\n");
768 printf(" key2=%i is out of range [1..500]\n",key2);
772 return HIJJET1.pjpm[key2-1][key1-1];
775 //______________________________________________________________________________
776 Int_t THijing::GetNTJ(Int_t key) const
778 // Get values of array NTJ in common HIJJET1
779 if ( key<1 || key>300 ) {
780 printf("ERROR in THijing::GetNTJ(key):\n");
781 printf(" key=%i is out of range [1..300]\n",key);
784 return HIJJET1.ntj[key-1];
787 //______________________________________________________________________________
788 Int_t THijing::GetKFTJ(Int_t key1, Int_t key2) const
790 // Get values of array KFTJ in common HIJJET1
791 if ( key1<1 || key1>300 ) {
792 printf("ERROR in THijing::GetKFTJ(key1):\n");
793 printf(" key1=%i is out of range [1..300]\n",key1);
796 if ( key2<1 || key2>500 ) {
797 printf("ERROR in THijing::GetKFTJ(key1,key2):\n");
798 printf(" key2=%i is out of range [1..500]\n",key2);
802 return HIJJET1.kftj[key2-1][key1-1];
805 //______________________________________________________________________________
806 Float_t THijing::GetPJTX(Int_t key1, Int_t key2) const
808 // Get values of array PJTX in common HIJJET1
809 if ( key1<1 || key1>300 ) {
810 printf("ERROR in THijing::GetPJTX(key1):\n");
811 printf(" key1=%i is out of range [1..300]\n",key1);
814 if ( key2<1 || key2>500 ) {
815 printf("ERROR in THijing::GetPJTX(key1,key2):\n");
816 printf(" key2=%i is out of range [1..500]\n",key2);
820 return HIJJET1.pjtx[key2-1][key1-1];
823 //______________________________________________________________________________
824 Float_t THijing::GetPJTY(Int_t key1, Int_t key2) const
826 // Get values of array PJTY in common HIJJET1
827 if ( key1<1 || key1>300 ) {
828 printf("ERROR in THijing::GetPJTY(key1):\n");
829 printf(" key1=%i is out of range [1..300]\n",key1);
832 if ( key2<1 || key2>500 ) {
833 printf("ERROR in THijing::GetPJTY(key1,key2):\n");
834 printf(" key2=%i is out of range [1..500]\n",key2);
838 return HIJJET1.pjty[key2-1][key1-1];
841 //______________________________________________________________________________
842 Float_t THijing::GetPJTZ(Int_t key1, Int_t key2) const
844 // Get values of array PJTZ in common HIJJET1
845 if ( key1<1 || key1>300 ) {
846 printf("ERROR in THijing::GetPJTZ(key1):\n");
847 printf(" key1=%i is out of range [1..300]\n",key1);
850 if ( key2<1 || key2>500 ) {
851 printf("ERROR in THijing::GetPJTZ(key1,key2):\n");
852 printf(" key2=%i is out of range [1..500]\n",key2);
856 return HIJJET1.pjtz[key2-1][key1-1];
859 //______________________________________________________________________________
860 Float_t THijing::GetPJTE(Int_t key1, Int_t key2) const
862 // Get values of array PJTE in common HIJJET1
863 if ( key1<1 || key1>300 ) {
864 printf("ERROR in THijing::GetPJTE(key1):\n");
865 printf(" key1=%i is out of range [1..300]\n",key1);
868 if ( key2<1 || key2>500 ) {
869 printf("ERROR in THijing::GetPJTE(key1,key2):\n");
870 printf(" key2=%i is out of range [1..500]\n",key2);
874 return HIJJET1.pjte[key2-1][key1-1];
877 //______________________________________________________________________________
878 Float_t THijing::GetPJTM(Int_t key1, Int_t key2) const
880 // Get values of array PJTM in common HIJJET1
881 if ( key1<1 || key1>300 ) {
882 printf("ERROR in THijing::GetPJTM(key1):\n");
883 printf(" key1=%i is out of range [1..300]\n",key1);
886 if ( key2<1 || key2>500 ) {
887 printf("ERROR in THijing::GetPJTM(key1,key2):\n");
888 printf(" key2=%i is out of range [1..500]\n",key2);
892 return HIJJET1.pjtm[key2-1][key1-1];
895 //====================== access to common HIJJET1 ===============================
897 //______________________________________________________________________________
898 Int_t THijing::GetNSG() const
900 // Get value of NSG in common HIJJET2
904 //______________________________________________________________________________
905 Int_t THijing::GetNJSG(Int_t key) const
907 // Get values of array NJSG in common HIJJET2
908 if ( key<1 || key>900 ) {
909 printf ("ERROR in THijing:GetNJSG(key): \n ");
910 printf (" key=%i is out of range [1..900]!\n",key);
914 return HIJJET2.njsg[key-1];
918 //______________________________________________________________________________
919 Int_t THijing::GetIASG(Int_t key1, Int_t key2) const
921 // Get values of IASG in common HIJJET2
922 if ( key1<1 || key1>900 ) {
923 printf("ERROR in THijing::GetIASG(key1):\n");
924 printf(" key1=%i is out of range [1..900]\n",key1);
927 if ( key2<1 || key2>3 ) {
928 printf("ERROR in THijing::GetIASG(key1,key2):\n");
929 printf(" key2=%i is out of range [1..3]\n",key2);
933 return HIJJET2.iasg[key2-1][key1-1];
936 //______________________________________________________________________________
937 Int_t THijing::GetK1SG(Int_t key1, Int_t key2) const
939 // Get values of K1SG in common HIJJET2
940 if ( key1<1 || key1>900 ) {
941 printf("ERROR in THijing::GetK1SG(key1):\n");
942 printf(" key1=%i is out of range [1..900]\n",key1);
945 if ( key2<1 || key2>100 ) {
946 printf("ERROR in THijing::GetK1SG(key1,key2):\n");
947 printf(" key2=%i is out of range [1..100]\n",key2);
951 return HIJJET2.k1sg[key2-1][key1-1];
954 //______________________________________________________________________________
955 Int_t THijing::GetK2SG(Int_t key1, Int_t key2) const
957 // Get values of K2SG in common HIJJET2
958 if ( key1<1 || key1>900 ) {
959 printf("ERROR in THijing::GetK2SG(key1):\n");
960 printf(" key1=%i is out of range [1..900]\n",key1);
963 if ( key2<1 || key2>100 ) {
964 printf("ERROR in THijing::GetK2SG(key1,key2):\n");
965 printf(" key2=%i is out of range [1..100]\n",key2);
969 return HIJJET2.k2sg[key2-1][key1-1];
972 //______________________________________________________________________________
973 Float_t THijing::GetPXSG(Int_t key1, Int_t key2) const
975 // Get values of PXSG in common HIJJET2
976 if ( key1<1 || key1>900 ) {
977 printf("ERROR in THijing::GetPXSG(key1):\n");
978 printf(" key1=%i is out of range [1..900]\n",key1);
981 if ( key2<1 || key2>100 ) {
982 printf("ERROR in THijing::GetPXSG(key1,key2):\n");
983 printf(" key2=%i is out of range [1..100]\n",key2);
987 return HIJJET2.pxsg[key2-1][key1-1];
990 //______________________________________________________________________________
991 Float_t THijing::GetPYSG(Int_t key1, Int_t key2) const
993 // Get values of PYSG in common HIJJET2
994 if ( key1<1 || key1>900 ) {
995 printf("ERROR in THijing::GetPYSG(key1):\n");
996 printf(" key1=%i is out of range [1..900]\n",key1);
999 if ( key2<1 || key2>100 ) {
1000 printf("ERROR in THijing::GetPYSG(key1,key2):\n");
1001 printf(" key2=%i is out of range [1..100]\n",key2);
1005 return HIJJET2.pysg[key2-1][key1-1];
1008 //______________________________________________________________________________
1009 Float_t THijing::GetPZSG(Int_t key1, Int_t key2) const
1011 // Get values of PZSG in common HIJJET2
1012 if ( key1<1 || key1>900 ) {
1013 printf("ERROR in THijing::GetPZSG(key1):\n");
1014 printf(" key1=%i is out of range [1..900]\n",key1);
1017 if ( key2<1 || key2>100 ) {
1018 printf("ERROR in THijing::GetPZSG(key1,key2):\n");
1019 printf(" key2=%i is out of range [1..100]\n",key2);
1023 return HIJJET2.pzsg[key2-1][key1-1];
1026 //______________________________________________________________________________
1027 Float_t THijing::GetPESG(Int_t key1, Int_t key2) const
1029 // Get values of PESG in common HIJJET2
1030 if ( key1<1 || key1>900 ) {
1031 printf("ERROR in THijing::GetPESG(key1):\n");
1032 printf(" key1=%i is out of range [1..900]\n",key1);
1035 if ( key2<1 || key2>100 ) {
1036 printf("ERROR in THijing::GetPESG(key1,key2):\n");
1037 printf(" key2=%i is out of range [1..100]\n",key2);
1041 return HIJJET2.pesg[key2-1][key1-1];
1044 //______________________________________________________________________________
1045 Float_t THijing::GetPMSG(Int_t key1, Int_t key2) const
1047 // Get values of PMSG in common HIJJET2
1048 if ( key1<1 || key1>900 ) {
1049 printf("ERROR in THijing::GetPMSG(key1):\n");
1050 printf(" key1=%i is out of range [1..900]\n",key1);
1053 if ( key2<1 || key2>100 ) {
1054 printf("ERROR in THijing::GetPMSG(key1,key2):\n");
1055 printf(" key2=%i is out of range [1..100]\n",key2);
1059 return HIJJET2.pmsg[key2-1][key1-1];
1062 //====================== access to common HISTRNG ===============================
1064 //______________________________________________________________________________
1065 Int_t THijing::GetNFP(Int_t key1, Int_t key2) const
1067 // Get values of array NFP in common HISTRNG
1068 if ( key1<1 || key1>300 ) {
1069 printf("ERROR in THijing::GetNFP(key1):\n");
1070 printf(" key1=%i is out of range [1..300]\n",key1);
1073 if ( key2<1 || key2>15 ) {
1074 printf("ERROR in THijing::GetNFP(key1,key2):\n");
1075 printf(" key2=%i is out of range [1..15]\n",key2);
1079 return HISTRNG.nfp[key2-1][key1-1];
1082 //______________________________________________________________________________
1083 Float_t THijing::GetPP(Int_t key1, Int_t key2) const
1085 // Get values of array PP in common HISTRNG
1086 if ( key1<1 || key1>300 ) {
1087 printf("ERROR in THijing::GetPP(key1):\n");
1088 printf(" key1=%i is out of range [1..300]\n",key1);
1091 if ( key2<1 || key2>15 ) {
1092 printf("ERROR in THijing::GetPP(key1,key2):\n");
1093 printf(" key2=%i is out of range [1..15]\n",key2);
1097 return HISTRNG.pp[key2-1][key1-1];
1100 //______________________________________________________________________________
1101 Int_t THijing::GetNFT(Int_t key1, Int_t key2) const
1103 // Get values of array NFT in common HISTRNG
1104 if ( key1<1 || key1>300 ) {
1105 printf("ERROR in THijing::GetNFT(key1):\n");
1106 printf(" key1=%i is out of range [1..300]\n",key1);
1109 if ( key2<1 || key2>15 ) {
1110 printf("ERROR in THijing::GetNFT(key1,key2):\n");
1111 printf(" key2=%i is out of range [1..15]\n",key2);
1115 return HISTRNG.nft[key2-1][key1-1];
1118 //______________________________________________________________________________
1119 Float_t THijing::GetPT(Int_t key1, Int_t key2) const
1121 // Get values of array PT in common HISTRNG
1122 if ( key1<1 || key1>300 ) {
1123 printf("ERROR in THijing::GetPT(key1):\n");
1124 printf(" key1=%i is out of range [1..300]\n",key1);
1127 if ( key2<1 || key2>15 ) {
1128 printf("ERROR in THijing::GetPT(key1,key2):\n");
1129 printf(" key2=%i is out of range [1..15]\n",key2);
1133 return HISTRNG.pt[key2-1][key1-1];
1136 void THijing::SetPARJ(Int_t key, Float_t parm)
1138 // Set values of array PARJ in common HISTRNG
1139 if ( key < 1 || key > 200) {
1140 printf("ERROR in THijing::SetPARJ(key,parm):\n");
1141 printf(" key=%i is out of range [1..200]\n",key);
1143 LUDAT1_HIJING.parj[key-1] = parm;
1148 void THijing::SetMSTJ(Int_t key, Int_t parm)
1150 // Set values of array MSTJ in common HISTRNG
1151 if ( key < 1 || key > 200) {
1152 printf("ERROR in THijing::SetMSTJ(key,parm):\n");
1153 printf(" key=%i is out of range [1..200]\n",key);
1155 LUDAT1_HIJING.mstj[key-1] = parm;
1159 void THijing::SetMDCY(Int_t key1, Int_t key2, Int_t parm)
1161 // Set value of array MDCY
1162 if ( key1 < 1 || key1 > 500) {
1163 printf("ERROR in THijing::SetMDCY(key1, key2, parm):\n");
1164 printf(" key1=%i is out of range [1..200]\n", key1);
1165 } else if ( key2 < 1 || key2 > 3) {
1166 printf("ERROR in THijing::SetMDCY(key1, key2, parm):\n");
1167 printf(" key2=%i is out of range [1..200]\n", key2);
1169 LUDAT3_HIJING.mdcy[key2-1][key1-1] = parm;
1174 Int_t THijing::GetMDCY(Int_t key1, Int_t key2)
1176 // Get value of array MDCY
1177 if ( key1 < 1 || key1 > 500) {
1178 printf("ERROR in THijing::GetMDCY(key1, key2, parm):\n");
1179 printf(" key1=%i is out of range [1..200]\n", key1);
1181 } else if ( key2 < 1 || key2 > 3) {
1182 printf("ERROR in THijing::GetMDCY(key1, key2, parm):\n");
1183 printf(" key2=%i is out of range [1..200]\n", key2);
1186 return (LUDAT3_HIJING.mdcy[key2-1][key1-1]);
1190 //====================== access to Hijing subroutines =========================
1193 //______________________________________________________________________________
1194 void THijing::Initialize()
1196 //////////////////////////////////////////////////////////////////////////////////
1197 // Calls Hijset with the either default parameters or the ones set by the user //
1198 // via SetEFRM, SetFRAME, SetPROJ, SetTARG, SetIAP, SetIZP, SetIAT, SetIZT //
1199 //////////////////////////////////////////////////////////////////////////////////
1201 if ( (!strcmp(fFrame.Data(), "CMS " )) &&
1202 (!strcmp(fFrame.Data(), "LAB " ))){
1203 printf("WARNING! In THijing:Initialize():\n");
1204 printf(" specified frame=%s is neither CMS or LAB\n",fFrame.Data());
1205 printf(" resetting to default \"CMS\" .");
1209 if ( (!strcmp(fProj.Data(), "A " )) &&
1210 (!strcmp(fProj.Data(), "P " )) &&
1211 (!strcmp(fProj.Data(), "PBAR " ))){
1212 printf("WARNING! In THijing:Initialize():\n");
1213 printf(" specified projectile=%s is neither A, P or PBAR\n",fProj.Data());
1214 printf(" resetting to default \"A\" .");
1218 if ( (!strcmp(fTarg.Data(), "A " )) &&
1219 (!strcmp(fTarg.Data(), "P " )) &&
1220 (!strcmp(fTarg.Data(), "PBAR " ))){
1221 printf("WARNING! In THijing:Initialize():\n");
1222 printf(" specified target=%s is neither A, P or PBAR\n",fTarg.Data());
1223 printf(" resetting to default \"A\" .");
1227 printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1229 Hijset(fEfrm,fFrame.Data(),fProj.Data(),fTarg.Data(),fIap,fIzp,fIat,fIzt);
1231 printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1235 //______________________________________________________________________________
1236 void THijing::GenerateEvent()
1238 // Generates one event;
1240 Hijing(fFrame.Data(),fBmin,fBmax);
1243 //______________________________________________________________________________
1244 void THijing::Hijset(float efrm, const char *frame, const char *proj,
1245 const char *targ, int iap, int izp, int iat, int izt)
1247 // Call HIJING routine HIJSET passing the parameters in a way accepted by
1250 int s1 = strlen(frame);
1251 int s2 = strlen(proj);
1252 int s3 = strlen(targ);
1253 printf("s1 = %d s2 = %d s3 = %d\n",s1,s2,s3);
1255 hijset(efrm, frame, proj, targ, iap, izp, iat, izt, s1, s2, s3);
1257 hijset(efrm, frame, s1, proj, s2, targ, s3, iap, izp, iat, izt);
1260 //______________________________________________________________________________
1261 void THijing::Hijing(const char *frame, float bmin, float bmax)
1263 // Call HIJING routine HIJSET passing the parameters in a way accepted by
1266 int s1 = strlen(frame);
1269 hijing(frame, bmin, bmax, s1);
1271 hijing(frame, s1, bmin, bmax);
1276 Float_t THijing::Profile(float b)
1278 // Call HIJING routine PROFILE
1283 void THijing::Rluget(Int_t lfn, Int_t move)
1285 // write seed to file
1286 rluget_hijing(lfn, move);
1290 void THijing::Rluset(Int_t lfn, Int_t move)
1292 // read seed from file
1293 rluset_hijing(lfn, move);
1296 void THijing::Pylist(Int_t flag)
1299 lulist_hijing(flag);