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);
69 THijing::THijing() : TGenerator("Hijing","Hijing")
71 // Default constructor
74 //______________________________________________________________________________
75 THijing::THijing(Float_t efrm, const char *frame="CMS",
76 const char *proj="A", const char *targ="A", Int_t iap=207,
77 Int_t izp=82, Int_t iat=207, Int_t izt=82, Float_t bmin=0,
78 Float_t bmax=20) : TGenerator("Hijing","Hijing")
80 // THijing constructor:
81 // Note that there may be only one functional THijing object
82 // at a time, so it's not use to create more than one instance of it.
95 //______________________________________________________________________________
102 TObjArray* THijing::ImportParticles(Option_t *option)
105 // Default primary creation method. It reads the /HEPEVT/ common block which
106 // has been filled by the GenerateEvent method. If the event generator does
107 // not use the HEPEVT common block, This routine has to be overloaded by
109 // The function loops on the generated particles and store them in
110 // the TClonesArray pointed by the argument particles.
111 // The default action is to store only the stable particles (ISTHEP = 1)
112 // This can be demanded explicitly by setting the option = "Final"
113 // If the option = "All", all the particles are stored.
116 Int_t numpart = HIMAIN1.natt;
117 printf("\n THijing: HIJING stack contains %d particles.", numpart);
118 printf("\n THijing: Total energy: %f ", HIMAIN1.eatt);
119 printf("\n THijing: Number of hard scatterings: %d ", HIMAIN1.jatt);
121 if (!strcmp(option,"") || !strcmp(option,"Final")) {
122 for (Int_t i = 0; i < numpart; i++) {
124 if (HIMAIN2.katt[3][i] == 1) {
126 // Use the common block values for the TParticle constructor
129 TParticle* p = new TParticle(
130 HIMAIN2.katt[0][i], HIMAIN2.katt[3][i] ,
132 HIMAIN2.patt[0][i], HIMAIN2.patt[1][i], HIMAIN2.patt[2][i], HIMAIN2.patt[3][i] ,
133 HIMAIN2.vatt[0][i], HIMAIN2.vatt[1][i], HIMAIN2.vatt[2][i], HIMAIN2.vatt[3][i]
135 p->SetUniqueID(HIMAIN2.katt[1][i]);
140 else if (!strcmp(option,"All")) {
142 for (Int_t i = 0; i < numpart; i++) {
144 Int_t iParent = HIMAIN2.katt[2][i]-1;
147 TParticle *mother = (TParticle*) (fParticles->UncheckedAt(iParent));
148 mother->SetLastDaughter(i);
149 if (mother->GetFirstDaughter()==-1)
150 mother->SetFirstDaughter(i);
153 TParticle* p = new TParticle(
154 HIMAIN2.katt[0][i], HIMAIN2.katt[3][i], iParent,
156 HIMAIN2.patt[0][i], HIMAIN2.patt[1][i], HIMAIN2.patt[2][i], HIMAIN2.patt[3][i] ,
157 HIMAIN2.vatt[0][i], HIMAIN2.vatt[1][i], HIMAIN2.vatt[2][i], HIMAIN2.vatt[3][i]
159 p->SetUniqueID(HIMAIN2.katt[1][i]);
166 Int_t THijing::ImportParticles(TClonesArray *particles, Option_t *option)
169 // Default primary creation method. It reads the /HEPEVT/ common block which
170 // has been filled by the GenerateEvent method. If the event generator does
171 // not use the HEPEVT common block, This routine has to be overloaded by
173 // The function loops on the generated particles and store them in
174 // the TClonesArray pointed by the argument particles.
175 // The default action is to store only the stable particles (ISTHEP = 1)
176 // This can be demanded explicitly by setting the option = "Final"
177 // If the option = "All", all the particles are stored.
179 if (particles == 0) return 0;
180 TClonesArray &particlesR = *particles;
182 Int_t numpart = HIMAIN1.natt;
183 printf("\n THijing: HIJING stack contains %d particles.", numpart);
184 printf("\n THijing: Total energy: %f ", HIMAIN1.eatt);
185 printf("\n THijing: Number of hard scatterings: %d ", HIMAIN1.jatt);
187 if (!strcmp(option,"") || !strcmp(option,"Final")) {
188 for (Int_t i = 0; i < numpart; i++) {
190 if (HIMAIN2.katt[3][i] == 1) {
192 // Use the common block values for the TParticle constructor
195 new(particlesR[i]) TParticle(
213 particlesR[i]->SetUniqueID(HIMAIN2.katt[1][i]);
217 else if (!strcmp(option,"All")) {
219 for (Int_t i = 0; i < numpart; i++) {
221 Int_t iParent = HIMAIN2.katt[2][i]-1;
224 TParticle *mother = (TParticle*) (particlesR.UncheckedAt(iParent));
225 mother->SetLastDaughter(i);
226 if (mother->GetFirstDaughter()==-1)
227 mother->SetFirstDaughter(i);
230 new(particlesR[i]) TParticle(
248 particlesR[i]->SetUniqueID(HIMAIN2.katt[1][i]);
254 //______________________________________________________________________________
255 void THijing::SetEFRM(Float_t efrm)
257 // Set the centre of mass (CMS) or lab-energy (LAB)
260 //______________________________________________________________________________
261 void THijing::SetFRAME(const char* frame)
263 // Set the frame type ("CMS" or "LAB")
266 //______________________________________________________________________________
267 void THijing::SetPROJ(const char* proj)
269 // Set the projectile type
272 //______________________________________________________________________________
273 void THijing::SetTARG(const char* targ)
275 // Set the target type
278 //______________________________________________________________________________
279 void THijing::SetIAP(Int_t iap)
281 // Set the projectile atomic number
284 //______________________________________________________________________________
285 void THijing::SetIZP(Int_t izp)
287 // Set the projectile charge number
290 //______________________________________________________________________________
291 void THijing::SetIAT(Int_t iat)
293 // Set the target atomic number
296 //______________________________________________________________________________
297 void THijing::SetIZT(Int_t izt)
299 // Set the target charge number
302 //______________________________________________________________________________
303 void THijing::SetBMIN(Float_t bmin)
305 // Set the minimum impact parameter
308 //______________________________________________________________________________
309 void THijing::SetBMAX(Float_t bmax)
311 // Set the maximum impact parameter
314 //______________________________________________________________________________
315 Float_t THijing::GetEFRM() const
317 // Get the centre of mass (CMS) or lab-energy (LAB)
320 //______________________________________________________________________________
321 const char* THijing::GetFRAME() const
323 // Get the frame type ("CMS" or "LAB")
324 return fFrame.Data();
326 //______________________________________________________________________________
327 const char* THijing::GetPROJ() const
329 // Get the projectile type
332 //______________________________________________________________________________
333 const char* THijing::GetTARG() const
335 // Set the target type
338 //______________________________________________________________________________
339 Int_t THijing::GetIAP() const
341 // Get the projectile atomic number
344 //______________________________________________________________________________
345 Int_t THijing::GetIZP() const
347 // Get the projectile charge number
350 //______________________________________________________________________________
351 Int_t THijing::GetIAT() const
353 // Get the target atomic number
356 //______________________________________________________________________________
357 Int_t THijing::GetIZT() const
359 // Get the target charge number
362 //______________________________________________________________________________
363 Float_t THijing::GetBMIN() const
365 // Get the minimum impact parameter
368 //______________________________________________________________________________
369 Float_t THijing::GetBMAX() const
371 // Get the maximum impact parameter
375 //====================== access to common HIPARNT ===============================
377 //______________________________________________________________________________
378 void THijing::SetHIPR1(Int_t key,Float_t value)
380 // Set the values of array HIPR1 in common HIPARNT
381 if ( key<1 || key>100 ) {
382 printf ("ERROR in THijing:SetHIPR1(key,value): \n ");
383 printf (" key=%i is out of range [1..100]!\n",key);
387 HIPARNT.hipr1[key-1]=value;
391 //______________________________________________________________________________
392 Float_t THijing::GetHIPR1(Int_t key) const
394 // Get the values of array HIPR1 in common HIPARNT
395 if ( key<1 || key>100 ) {
396 printf ("ERROR in THijing:GetHIPR1(key): \n ");
397 printf (" key=%i is out of range [1..100]!\n",key);
401 return HIPARNT.hipr1[key-1];
405 //______________________________________________________________________________
406 void THijing::SetIHPR2(Int_t key,Int_t value)
408 // Set the values of array HIPR2 in common HIPARNT
409 if ( key<1 || key>50 ) {
410 printf ("ERROR in THijing:SetIHPR2(key,value): \n ");
411 printf (" key=%i is out of range [1..50]!\n",key);
415 HIPARNT.ihpr2[key-1]=value;
419 //______________________________________________________________________________
420 Int_t THijing::GetIHPR2(Int_t key) const
422 // Get the values of array HIPR2 in common HIPARNT
423 if ( key<1 || key>50 ) {
424 printf ("ERROR in THijing:GetIHPR2(key): \n ");
425 printf (" key=%i is out of range [1..50]!\n",key);
429 return HIPARNT.ihpr2[key-1];
434 //______________________________________________________________________________
435 Float_t THijing::GetHINT1(Int_t key) const
437 // Get the values of array HINT1 in common HIPARNT
438 if ( key<1 || key>100 ) {
439 printf ("ERROR in THijing:GetHINT1(key): \n ");
440 printf (" key=%i is out of range [1..100]!\n",key);
444 return HIPARNT.hint1[key-1];
449 //______________________________________________________________________________
450 Int_t THijing::GetIHNT2(Int_t key) const
452 // Get the values of array HINT2 in common HIPARNT
453 if ( key<1 || key>50 ) {
454 printf ("ERROR in THijing:GetIHNT2(key): \n ");
455 printf (" key=%i is out of range [1..50]!\n",key);
459 return HIPARNT.ihnt2[key-1];
464 //====================== access to common HIMAIN1 ===============================
466 //______________________________________________________________________________
467 Int_t THijing::GetNATT() const
469 // Get the number of particles produces
474 //______________________________________________________________________________
475 Float_t THijing::GetEATT() const
477 // Get total energy of particles
483 //______________________________________________________________________________
484 Int_t THijing::GetJATT() const
486 // Get number of hard scatterings
492 //______________________________________________________________________________
493 Int_t THijing::GetNT() const
495 // Get number of target participants
501 //______________________________________________________________________________
502 Int_t THijing::GetNP() const
504 // Get number of projectile participants
510 //______________________________________________________________________________
511 Int_t THijing::GetN0() const
513 // Get number of N-N collisions
517 //______________________________________________________________________________
518 Int_t THijing::GetN01() const
520 // Get number of N-wounded collisions
526 //______________________________________________________________________________
527 Int_t THijing::GetN10() const
529 // Get number of wounded-N collisions
535 //______________________________________________________________________________
536 Int_t THijing::GetN11() const
538 // Get number of wounded-wounded collisions
544 //______________________________________________________________________________
545 Float_t THijing::GetBB() const
547 // Get impact parameter
553 //====================== access to common HIMAIN2 ===============================
555 //______________________________________________________________________________
556 Int_t THijing::GetKATT(Int_t key1, Int_t key2) const
558 // Get values of array KATT in common HIMAIN2
559 if ( key1<1 || key1>200000 ) {
560 printf("ERROR in THijing::GetKATT(key1,key2):\n");
561 printf(" key1=%i is out of range [1..200000]\n",key1);
565 if ( key2<1 || key2>4 ) {
566 printf("ERROR in THijing::GetKATT(key1,key2):\n");
567 printf(" key2=%i is out of range [1..4]\n",key2);
571 return HIMAIN2.katt[key2-1][key1-1];
574 //______________________________________________________________________________
575 Float_t THijing::GetPATT(Int_t key1, Int_t key2) const
577 // Get values of array PATT in common HIMAIN2
578 if ( key1<1 || key1>200000 ) {
579 printf("ERROR in THijing::GetPATT(key1,key2):\n");
580 printf(" key1=%i is out of range [1..130000]\n",key1);
584 if ( key2<1 || key2>4 ) {
585 printf("ERROR in THijing::GetPATT(key1,key2):\n");
586 printf(" key2=%i is out of range [1..4]\n",key2);
590 return HIMAIN2.patt[key2-1][key1-1];
593 Float_t THijing::GetVATT(Int_t key1, Int_t key2) const
595 // Get values of array VATT in common HIMAIN2
596 if ( key1<1 || key1>200000 ) {
597 printf("ERROR in THijing::GetVATT(key1,key2):\n");
598 printf(" key1=%i is out of range [1..130000]\n",key1);
602 if ( key2<1 || key2>4 ) {
603 printf("ERROR in THijing::GetVATT(key1,key2):\n");
604 printf(" key2=%i is out of range [1..4]\n",key2);
608 return HIMAIN2.vatt[key2-1][key1-1];
611 //====================== access to common HIJJET1 ===============================
613 //______________________________________________________________________________
614 Int_t THijing::GetNPJ(Int_t key) const
616 // Get values of array NPJ of common HIJJET1
617 if ( key<1 || key>300 ) {
618 printf("ERROR in THijing::GetNPJ(key):\n");
619 printf(" key=%i is out of range [1..300]\n",key);
622 return HIJJET1.npj[key-1];
625 //______________________________________________________________________________
626 Int_t THijing::GetKFPJ(Int_t key1, Int_t key2) const
628 // Get values of array KFPJ in common HIJJET1
629 if ( key1<1 || key1>300 ) {
630 printf("ERROR in THijing::GetKFPJ(key1):\n");
631 printf(" key1=%i is out of range [1..300]\n",key1);
634 if ( key2<1 || key2>500 ) {
635 printf("ERROR in THijing::GetKFPJ(key1,key2):\n");
636 printf(" key2=%i is out of range [1..500]\n",key2);
640 return HIJJET1.kfpj[key2-1][key1-1];
643 //______________________________________________________________________________
644 Float_t THijing::GetPJPX(Int_t key1, Int_t key2) const
646 // Get values of array PJPX in common HIJJET1
647 if ( key1<1 || key1>300 ) {
648 printf("ERROR in THijing::GetPJPX(key1):\n");
649 printf(" key1=%i is out of range [1..300]\n",key1);
652 if ( key2<1 || key2>500 ) {
653 printf("ERROR in THijing::GetPJPX(key1,key2):\n");
654 printf(" key2=%i is out of range [1..500]\n",key2);
658 return HIJJET1.pjpx[key2-1][key1-1];
661 //______________________________________________________________________________
662 Float_t THijing::GetPJPY(Int_t key1, Int_t key2) const
664 // Get values of array PJPY in common HIJJET1
665 if ( key1<1 || key1>300 ) {
666 printf("ERROR in THijing::GetPJPY(key1):\n");
667 printf(" key1=%i is out of range [1..300]\n",key1);
670 if ( key2<1 || key2>500 ) {
671 printf("ERROR in THijing::GetPJPY(key1,key2):\n");
672 printf(" key2=%i is out of range [1..500]\n",key2);
676 return HIJJET1.pjpy[key2-1][key1-1];
679 //______________________________________________________________________________
680 Float_t THijing::GetPJPZ(Int_t key1, Int_t key2) const
682 // Get values of array PJPZ in common HIJJET1
683 if ( key1<1 || key1>300 ) {
684 printf("ERROR in THijing::GetPJPZ(key1):\n");
685 printf(" key1=%i is out of range [1..300]\n",key1);
688 if ( key2<1 || key2>500 ) {
689 printf("ERROR in THijing::GetPJPZ(key1,key2):\n");
690 printf(" key2=%i is out of range [1..500]\n",key2);
694 return HIJJET1.pjpz[key2-1][key1-1];
697 //______________________________________________________________________________
698 Float_t THijing::GetPJPE(Int_t key1, Int_t key2) const
700 // Get values of array PJPE in common HIJJET1
701 if ( key1<1 || key1>300 ) {
702 printf("ERROR in THijing::GetPJPE(key1):\n");
703 printf(" key1=%i is out of range [1..300]\n",key1);
706 if ( key2<1 || key2>500 ) {
707 printf("ERROR in THijing::GetPJPE(key1,key2):\n");
708 printf(" key2=%i is out of range [1..500]\n",key2);
712 return HIJJET1.pjpe[key2-1][key1-1];
715 //______________________________________________________________________________
716 Float_t THijing::GetPJPM(Int_t key1, Int_t key2) const
718 // Get values of array PJPM in common HIJJET1
719 if ( key1<1 || key1>300 ) {
720 printf("ERROR in THijing::GetPJPM(key1):\n");
721 printf(" key1=%i is out of range [1..300]\n",key1);
724 if ( key2<1 || key2>500 ) {
725 printf("ERROR in THijing::GetPJPM(key1,key2):\n");
726 printf(" key2=%i is out of range [1..500]\n",key2);
730 return HIJJET1.pjpm[key2-1][key1-1];
733 //______________________________________________________________________________
734 Int_t THijing::GetNTJ(Int_t key) const
736 // Get values of array NTJ in common HIJJET1
737 if ( key<1 || key>300 ) {
738 printf("ERROR in THijing::GetNTJ(key):\n");
739 printf(" key=%i is out of range [1..300]\n",key);
742 return HIJJET1.ntj[key-1];
745 //______________________________________________________________________________
746 Int_t THijing::GetKFTJ(Int_t key1, Int_t key2) const
748 // Get values of array KFTJ in common HIJJET1
749 if ( key1<1 || key1>300 ) {
750 printf("ERROR in THijing::GetKFTJ(key1):\n");
751 printf(" key1=%i is out of range [1..300]\n",key1);
754 if ( key2<1 || key2>500 ) {
755 printf("ERROR in THijing::GetKFTJ(key1,key2):\n");
756 printf(" key2=%i is out of range [1..500]\n",key2);
760 return HIJJET1.kftj[key2-1][key1-1];
763 //______________________________________________________________________________
764 Float_t THijing::GetPJTX(Int_t key1, Int_t key2) const
766 // Get values of array PJTX in common HIJJET1
767 if ( key1<1 || key1>300 ) {
768 printf("ERROR in THijing::GetPJTX(key1):\n");
769 printf(" key1=%i is out of range [1..300]\n",key1);
772 if ( key2<1 || key2>500 ) {
773 printf("ERROR in THijing::GetPJTX(key1,key2):\n");
774 printf(" key2=%i is out of range [1..500]\n",key2);
778 return HIJJET1.pjtx[key2-1][key1-1];
781 //______________________________________________________________________________
782 Float_t THijing::GetPJTY(Int_t key1, Int_t key2) const
784 // Get values of array PJTY in common HIJJET1
785 if ( key1<1 || key1>300 ) {
786 printf("ERROR in THijing::GetPJTY(key1):\n");
787 printf(" key1=%i is out of range [1..300]\n",key1);
790 if ( key2<1 || key2>500 ) {
791 printf("ERROR in THijing::GetPJTY(key1,key2):\n");
792 printf(" key2=%i is out of range [1..500]\n",key2);
796 return HIJJET1.pjty[key2-1][key1-1];
799 //______________________________________________________________________________
800 Float_t THijing::GetPJTZ(Int_t key1, Int_t key2) const
802 // Get values of array PJTZ in common HIJJET1
803 if ( key1<1 || key1>300 ) {
804 printf("ERROR in THijing::GetPJTZ(key1):\n");
805 printf(" key1=%i is out of range [1..300]\n",key1);
808 if ( key2<1 || key2>500 ) {
809 printf("ERROR in THijing::GetPJTZ(key1,key2):\n");
810 printf(" key2=%i is out of range [1..500]\n",key2);
814 return HIJJET1.pjtz[key2-1][key1-1];
817 //______________________________________________________________________________
818 Float_t THijing::GetPJTE(Int_t key1, Int_t key2) const
820 // Get values of array PJTE in common HIJJET1
821 if ( key1<1 || key1>300 ) {
822 printf("ERROR in THijing::GetPJTE(key1):\n");
823 printf(" key1=%i is out of range [1..300]\n",key1);
826 if ( key2<1 || key2>500 ) {
827 printf("ERROR in THijing::GetPJTE(key1,key2):\n");
828 printf(" key2=%i is out of range [1..500]\n",key2);
832 return HIJJET1.pjte[key2-1][key1-1];
835 //______________________________________________________________________________
836 Float_t THijing::GetPJTM(Int_t key1, Int_t key2) const
838 // Get values of array PJTM in common HIJJET1
839 if ( key1<1 || key1>300 ) {
840 printf("ERROR in THijing::GetPJTM(key1):\n");
841 printf(" key1=%i is out of range [1..300]\n",key1);
844 if ( key2<1 || key2>500 ) {
845 printf("ERROR in THijing::GetPJTM(key1,key2):\n");
846 printf(" key2=%i is out of range [1..500]\n",key2);
850 return HIJJET1.pjtm[key2-1][key1-1];
853 //====================== access to common HIJJET1 ===============================
855 //______________________________________________________________________________
856 Int_t THijing::GetNSG() const
858 // Get value of NSG in common HIJJET2
862 //______________________________________________________________________________
863 Int_t THijing::GetNJSG(Int_t key) const
865 // Get values of array NJSG in common HIJJET2
866 if ( key<1 || key>900 ) {
867 printf ("ERROR in THijing:GetNJSG(key): \n ");
868 printf (" key=%i is out of range [1..900]!\n",key);
872 return HIJJET2.njsg[key-1];
876 //______________________________________________________________________________
877 Int_t THijing::GetIASG(Int_t key1, Int_t key2) const
879 // Get values of IASG in common HIJJET2
880 if ( key1<1 || key1>900 ) {
881 printf("ERROR in THijing::GetIASG(key1):\n");
882 printf(" key1=%i is out of range [1..900]\n",key1);
885 if ( key2<1 || key2>3 ) {
886 printf("ERROR in THijing::GetIASG(key1,key2):\n");
887 printf(" key2=%i is out of range [1..3]\n",key2);
891 return HIJJET2.iasg[key2-1][key1-1];
894 //______________________________________________________________________________
895 Int_t THijing::GetK1SG(Int_t key1, Int_t key2) const
897 // Get values of K1SG in common HIJJET2
898 if ( key1<1 || key1>900 ) {
899 printf("ERROR in THijing::GetK1SG(key1):\n");
900 printf(" key1=%i is out of range [1..900]\n",key1);
903 if ( key2<1 || key2>100 ) {
904 printf("ERROR in THijing::GetK1SG(key1,key2):\n");
905 printf(" key2=%i is out of range [1..100]\n",key2);
909 return HIJJET2.k1sg[key2-1][key1-1];
912 //______________________________________________________________________________
913 Int_t THijing::GetK2SG(Int_t key1, Int_t key2) const
915 // Get values of K2SG in common HIJJET2
916 if ( key1<1 || key1>900 ) {
917 printf("ERROR in THijing::GetK2SG(key1):\n");
918 printf(" key1=%i is out of range [1..900]\n",key1);
921 if ( key2<1 || key2>100 ) {
922 printf("ERROR in THijing::GetK2SG(key1,key2):\n");
923 printf(" key2=%i is out of range [1..100]\n",key2);
927 return HIJJET2.k2sg[key2-1][key1-1];
930 //______________________________________________________________________________
931 Float_t THijing::GetPXSG(Int_t key1, Int_t key2) const
933 // Get values of PXSG in common HIJJET2
934 if ( key1<1 || key1>900 ) {
935 printf("ERROR in THijing::GetPXSG(key1):\n");
936 printf(" key1=%i is out of range [1..900]\n",key1);
939 if ( key2<1 || key2>100 ) {
940 printf("ERROR in THijing::GetPXSG(key1,key2):\n");
941 printf(" key2=%i is out of range [1..100]\n",key2);
945 return HIJJET2.pxsg[key2-1][key1-1];
948 //______________________________________________________________________________
949 Float_t THijing::GetPYSG(Int_t key1, Int_t key2) const
951 // Get values of PYSG in common HIJJET2
952 if ( key1<1 || key1>900 ) {
953 printf("ERROR in THijing::GetPYSG(key1):\n");
954 printf(" key1=%i is out of range [1..900]\n",key1);
957 if ( key2<1 || key2>100 ) {
958 printf("ERROR in THijing::GetPYSG(key1,key2):\n");
959 printf(" key2=%i is out of range [1..100]\n",key2);
963 return HIJJET2.pysg[key2-1][key1-1];
966 //______________________________________________________________________________
967 Float_t THijing::GetPZSG(Int_t key1, Int_t key2) const
969 // Get values of PZSG in common HIJJET2
970 if ( key1<1 || key1>900 ) {
971 printf("ERROR in THijing::GetPZSG(key1):\n");
972 printf(" key1=%i is out of range [1..900]\n",key1);
975 if ( key2<1 || key2>100 ) {
976 printf("ERROR in THijing::GetPZSG(key1,key2):\n");
977 printf(" key2=%i is out of range [1..100]\n",key2);
981 return HIJJET2.pzsg[key2-1][key1-1];
984 //______________________________________________________________________________
985 Float_t THijing::GetPESG(Int_t key1, Int_t key2) const
987 // Get values of PESG in common HIJJET2
988 if ( key1<1 || key1>900 ) {
989 printf("ERROR in THijing::GetPESG(key1):\n");
990 printf(" key1=%i is out of range [1..900]\n",key1);
993 if ( key2<1 || key2>100 ) {
994 printf("ERROR in THijing::GetPESG(key1,key2):\n");
995 printf(" key2=%i is out of range [1..100]\n",key2);
999 return HIJJET2.pesg[key2-1][key1-1];
1002 //______________________________________________________________________________
1003 Float_t THijing::GetPMSG(Int_t key1, Int_t key2) const
1005 // Get values of PMSG in common HIJJET2
1006 if ( key1<1 || key1>900 ) {
1007 printf("ERROR in THijing::GetPMSG(key1):\n");
1008 printf(" key1=%i is out of range [1..900]\n",key1);
1011 if ( key2<1 || key2>100 ) {
1012 printf("ERROR in THijing::GetPMSG(key1,key2):\n");
1013 printf(" key2=%i is out of range [1..100]\n",key2);
1017 return HIJJET2.pmsg[key2-1][key1-1];
1020 //====================== access to common HISTRNG ===============================
1022 //______________________________________________________________________________
1023 Int_t THijing::GetNFP(Int_t key1, Int_t key2) const
1025 // Get values of array NFP in common HISTRNG
1026 if ( key1<1 || key1>300 ) {
1027 printf("ERROR in THijing::GetNFP(key1):\n");
1028 printf(" key1=%i is out of range [1..300]\n",key1);
1031 if ( key2<1 || key2>15 ) {
1032 printf("ERROR in THijing::GetNFP(key1,key2):\n");
1033 printf(" key2=%i is out of range [1..15]\n",key2);
1037 return HISTRNG.nfp[key2-1][key1-1];
1040 //______________________________________________________________________________
1041 Float_t THijing::GetPP(Int_t key1, Int_t key2) const
1043 // Get values of array PP in common HISTRNG
1044 if ( key1<1 || key1>300 ) {
1045 printf("ERROR in THijing::GetPP(key1):\n");
1046 printf(" key1=%i is out of range [1..300]\n",key1);
1049 if ( key2<1 || key2>15 ) {
1050 printf("ERROR in THijing::GetPP(key1,key2):\n");
1051 printf(" key2=%i is out of range [1..15]\n",key2);
1055 return HISTRNG.pp[key2-1][key1-1];
1058 //______________________________________________________________________________
1059 Int_t THijing::GetNFT(Int_t key1, Int_t key2) const
1061 // Get values of array NFT in common HISTRNG
1062 if ( key1<1 || key1>300 ) {
1063 printf("ERROR in THijing::GetNFT(key1):\n");
1064 printf(" key1=%i is out of range [1..300]\n",key1);
1067 if ( key2<1 || key2>15 ) {
1068 printf("ERROR in THijing::GetNFT(key1,key2):\n");
1069 printf(" key2=%i is out of range [1..15]\n",key2);
1073 return HISTRNG.nft[key2-1][key1-1];
1076 //______________________________________________________________________________
1077 Float_t THijing::GetPT(Int_t key1, Int_t key2) const
1079 // Get values of array PT in common HISTRNG
1080 if ( key1<1 || key1>300 ) {
1081 printf("ERROR in THijing::GetPT(key1):\n");
1082 printf(" key1=%i is out of range [1..300]\n",key1);
1085 if ( key2<1 || key2>15 ) {
1086 printf("ERROR in THijing::GetPT(key1,key2):\n");
1087 printf(" key2=%i is out of range [1..15]\n",key2);
1091 return HISTRNG.pt[key2-1][key1-1];
1094 void THijing::SetPARJ(Int_t key, Float_t parm)
1096 // Set values of array PARJ in common HISTRNG
1097 if ( key < 1 || key > 200) {
1098 printf("ERROR in THijing::SetPARJ(key,parm):\n");
1099 printf(" key=%i is out of range [1..200]\n",key);
1102 LUDAT1_HIJING.parj[key-1] = parm;
1106 void THijing::SetMSTJ(Int_t key, Int_t parm)
1108 // Set values of array MSTJ in common HISTRNG
1109 if ( key < 1 || key > 200) {
1110 printf("ERROR in THijing::SetMSTJ(key,parm):\n");
1111 printf(" key=%i is out of range [1..200]\n",key);
1114 LUDAT1_HIJING.mstj[key-1] = parm;
1118 //====================== access to Hijing subroutines =========================
1121 //______________________________________________________________________________
1122 void THijing::Initialize()
1124 //////////////////////////////////////////////////////////////////////////////////
1125 // Calls Hijset with the either default parameters or the ones set by the user //
1126 // via SetEFRM, SetFRAME, SetPROJ, SetTARG, SetIAP, SetIZP, SetIAT, SetIZT //
1127 //////////////////////////////////////////////////////////////////////////////////
1129 if ( (!strcmp(fFrame.Data(), "CMS " )) &&
1130 (!strcmp(fFrame.Data(), "LAB " ))){
1131 printf("WARNING! In THijing:Initialize():\n");
1132 printf(" specified frame=%s is neither CMS or LAB\n",fFrame.Data());
1133 printf(" resetting to default \"CMS\" .");
1137 if ( (!strcmp(fProj.Data(), "A " )) &&
1138 (!strcmp(fProj.Data(), "P " )) &&
1139 (!strcmp(fProj.Data(), "PBAR " ))){
1140 printf("WARNING! In THijing:Initialize():\n");
1141 printf(" specified projectile=%s is neither A, P or PBAR\n",fProj.Data());
1142 printf(" resetting to default \"A\" .");
1146 if ( (!strcmp(fTarg.Data(), "A " )) &&
1147 (!strcmp(fTarg.Data(), "P " )) &&
1148 (!strcmp(fTarg.Data(), "PBAR " ))){
1149 printf("WARNING! In THijing:Initialize():\n");
1150 printf(" specified target=%s is neither A, P or PBAR\n",fTarg.Data());
1151 printf(" resetting to default \"A\" .");
1155 printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1157 Hijset(fEfrm,fFrame.Data(),fProj.Data(),fTarg.Data(),fIap,fIzp,fIat,fIzt);
1159 printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1163 //______________________________________________________________________________
1164 void THijing::GenerateEvent()
1166 // Generates one event;
1168 Hijing(fFrame.Data(),fBmin,fBmax);
1171 //______________________________________________________________________________
1172 void THijing::Hijset(float efrm, const char *frame, const char *proj,
1173 const char *targ, int iap, int izp, int iat, int izt)
1175 // Call HIJING routine HIJSET passing the parameters in a way accepted by
1178 int s1 = strlen(frame);
1179 int s2 = strlen(proj);
1180 int s3 = strlen(targ);
1181 printf("s1 = %d s2 = %d s3 = %d\n",s1,s2,s3);
1183 hijset(efrm, frame, proj, targ, iap, izp, iat, izt, s1, s2, s3);
1185 hijset(efrm, frame, s1, proj, s2, targ, s3, iap, izp, iat, izt);
1188 //______________________________________________________________________________
1189 void THijing::Hijing(const char *frame, float bmin, float bmax)
1191 // Call HIJING routine HIJSET passing the parameters in a way accepted by
1194 int s1 = strlen(frame);
1197 hijing(frame, bmin, bmax, s1);
1199 hijing(frame, s1, bmin, bmax);
1204 Float_t THijing::Profile(float b)
1206 // Call HIJING routine PROFILE
1211 void THijing::Rluget(Int_t lfn, Int_t move)
1213 // write seed to file
1214 rluget_hijing(lfn, move);
1218 void THijing::Rluset(Int_t lfn, Int_t move)
1220 // read seed from file
1221 rluset_hijing(lfn, move);