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 //****************************************************************************//
31 //#include "TMCParticle.h"
32 //*KEEP,TParticle,T=C++.
33 #include "TParticle.h"
37 //#include "TCanvas.h"
43 //#include "TPaveText.h"
47 # define hijset hijset_
48 # define hijing hijing_
49 # define profile profile_
50 # define rluget_hijing rluget_hijing_
51 # define rluset_hijing rluset_hijing_
54 # define hijset HIJSET
55 # define hijing HIJING
56 # define profile PROFILE
57 # define rluget_hijing RLUGET_HIJING
58 # define rluset_hijing RLUSET_HIJING
59 # define type_of_call _stdcall
63 //extern "C" void type_of_call hijset(float &efrm, const char *frame,
64 // const char *proj, const char *targ,
65 // int &iap, int &izp, int &iat,
66 // int &izt, Long_t l_frame,
67 // Long_t l_proj, Long_t l_targ);
68 extern "C" void type_of_call hijset(Float_t & , const char *,
69 const char *, const char *,
70 Int_t & , Int_t &, Int_t &,
72 const int, const int);
73 extern "C" float type_of_call profile(Float_t &);
75 //extern "C" void type_of_call hijing(const char *frame, float &bmin,
76 // float &bmax, Long_t l_frame);
77 extern "C" void type_of_call hijing(const char *, Float_t &,
78 Float_t &, const int);
80 extern "C" void type_of_call rluget_hijing(Int_t & lfn, Int_t & move);
82 extern "C" void type_of_call rluset_hijing(Int_t & lfn, Int_t & move);
85 //extern "C" void type_of_call hijset(float &efrm, const char *frame,
86 // Long_t l_frame, const char *proj,
87 // Long_t l_proj, const char *targ,
89 // int &iap, int &izp, int &iat,
91 //extern "C" void type_of_call hijing(const char *frame, Long_t l_frame,
92 // float &bmin, float &bmax);
99 // void THijing::Streamer(TBuffer &R__b){}
100 //______________________________________________________________________________
101 THijing::THijing() : TGenerator("Hijing","Hijing")
103 // THijing constructor: creates a TClonesArray in which it will store all
104 // particles. Note that there may be only one functional THijing object
105 // at a time, so it's not use to create more than one instance of it.
107 // delete fParticles; // was allocated as TObjArray in TGenerator
109 // fParticles = new TClonesArray("TMCParticle",50);
113 //______________________________________________________________________________
114 THijing::THijing(Float_t efrm, const char *frame="CMS",
115 const char *proj="A", const char *targ="A", Int_t iap=207,
116 Int_t izp=82, Int_t iat=207, Int_t izt=82, Float_t bmin=0,
117 Float_t bmax=20) : TGenerator("Hijing","Hijing")
119 // THijing constructor: creates a TClonesArray in which it will store all
120 // particles. Note that there may be only one functional THijing object
121 // at a time, so it's not use to create more than one instance of it.
123 // delete fParticles; // was allocated as TObjArray in TGenerator
125 // fParticles = new TClonesArray("TMCParticle",50);
139 //______________________________________________________________________________
142 // Destroys the object, deletes and disposes all TMCParticles currently on list.
145 // fParticles->Delete();
146 // delete fParticles;
151 //______________________________________________________________________________
152 //void THijing::Draw(Option_t *option)
154 // Event display - not supported for THijing yet.
157 // if (!gROOT->GetMakeDefCanvas()) return;
158 // (gROOT->GetMakeDefCanvas())();
159 // gPad->GetCanvas()->SetFillColor(13);
162 // static Float_t rbox = 1000;
163 // Float_t rmin[3],rmax[3];
164 // TView *view = gPad->GetView();
165 // if (!strstr(option,"same")) {
166 // if (view) { view->GetRange(rmin,rmax); rbox = rmax[2];}
170 // AppendPad(option);
172 // view = gPad->GetView();
173 // // compute 3D view
175 // view->GetRange(rmin,rmax);
178 // view = new TView(1);
179 // view->SetRange(-rbox,-rbox,-rbox, rbox,rbox,rbox );
182 // TPaveText *pt = new TPaveText(-0.94,0.85,-0.25,0.98,"br");
183 // pt->AddText((char*)GetName());
184 // pt->AddText((char*)GetTitle());
185 // pt->SetFillColor(42);
189 //______________________________________________________________________________
190 //TObjArray *THijing::ImportParticles(Option_t *)
192 // Fills TClonesArray fParticles list with particles from common LUJETS.
193 // Old contents of a list are cleared. This function should be called after
194 // any change in common LUJETS, however GetParticles() method calls it
195 // automatically - user don't need to care about it. In case you make a call
196 // to LuExec() you must call this method yourself to transfer new data from
197 // common LUJETS to the fParticles list.
199 // fParticles->Clear();
201 // Int_t numpart = LUJETS.n;
202 // TClonesArray &a = *((TClonesArray*)fParticles);
204 // for (Int_t i = 0; i < numpart; i++) {
205 // new(a[i]) TMCParticle(LUJETS.k[0][i] ,
224 // return fParticles;
227 //______________________________________________________________________________
228 Int_t THijing::ImportParticles(TClonesArray *particles, Option_t *option)
231 // Default primary creation method. It reads the /HEPEVT/ common block which
232 // has been filled by the GenerateEvent method. If the event generator does
233 // not use the HEPEVT common block, This routine has to be overloaded by
235 // The function loops on the generated particles and store them in
236 // the TClonesArray pointed by the argument particles.
237 // The default action is to store only the stable particles (ISTHEP = 1)
238 // This can be demanded explicitly by setting the option = "Final"
239 // If the option = "All", all the particles are stored.
241 if (particles == 0) return 0;
242 TClonesArray &Particles = *particles;
244 Int_t numpart = HIMAIN1.natt;
245 printf("\n THijing: HIJING stack contains %d particles.", numpart);
246 printf("\n THijing: Total energy: %f ", HIMAIN1.eatt);
247 printf("\n THijing: Number of hard scatterings: %d ", HIMAIN1.jatt);
249 if (!strcmp(option,"") || !strcmp(option,"Final")) {
250 for (Int_t i = 0; i<=numpart; i++) {
252 if (HIMAIN2.katt[3][i] == 1) {
254 // Use the common block values for the TParticle constructor
257 new(Particles[i]) TParticle(
277 else if (!strcmp(option,"All")) {
279 for (Int_t i = 0; i<=numpart; i++) {
281 Int_t iParent = HIMAIN2.katt[2][i]-1;
284 TParticle *mother = (TParticle*) (Particles.UncheckedAt(iParent));
285 mother->SetLastDaughter(i);
286 if (mother->GetFirstDaughter()==-1)
287 mother->SetFirstDaughter(i);
290 new(Particles[i]) TParticle(
312 //______________________________________________________________________________
313 void THijing::SetEFRM(Float_t efrm)
317 //______________________________________________________________________________
318 void THijing::SetFRAME(const char* frame)
322 //______________________________________________________________________________
323 void THijing::SetPROJ(const char* proj)
327 //______________________________________________________________________________
328 void THijing::SetTARG(const char* targ)
332 //______________________________________________________________________________
333 void THijing::SetIAP(Int_t iap)
337 //______________________________________________________________________________
338 void THijing::SetIZP(Int_t izp)
342 //______________________________________________________________________________
343 void THijing::SetIAT(Int_t iat)
347 //______________________________________________________________________________
348 void THijing::SetIZT(Int_t izt)
352 //______________________________________________________________________________
353 void THijing::SetBMIN(Float_t bmin)
357 //______________________________________________________________________________
358 void THijing::SetBMAX(Float_t bmax)
362 //______________________________________________________________________________
363 Float_t THijing::GetEFRM() const
367 //______________________________________________________________________________
368 const char* THijing::GetFRAME() const
370 return fFrame.Data();
372 //______________________________________________________________________________
373 const char* THijing::GetPROJ() const
377 //______________________________________________________________________________
378 const char* THijing::GetTARG() const
382 //______________________________________________________________________________
383 Int_t THijing::GetIAP() const
387 //______________________________________________________________________________
388 Int_t THijing::GetIZP() const
392 //______________________________________________________________________________
393 Int_t THijing::GetIAT() const
397 //______________________________________________________________________________
398 Int_t THijing::GetIZT() const
402 //______________________________________________________________________________
403 Float_t THijing::GetBMIN() const
407 //______________________________________________________________________________
408 Float_t THijing::GetBMAX() const
413 //====================== access to common HIPARNT ===============================
415 //______________________________________________________________________________
416 void THijing::SetHIPR1(Int_t key,Float_t value)
418 if ( key<1 || key>100 ) {
419 printf ("ERROR in THijing:SetHIPR1(key,value): \n ");
420 printf (" key=%i is out of range [1..100]!\n",key);
424 HIPARNT.hipr1[key-1]=value;
428 //______________________________________________________________________________
429 Float_t THijing::GetHIPR1(Int_t key) const
431 if ( key<1 || key>100 ) {
432 printf ("ERROR in THijing:GetHIPR1(key): \n ");
433 printf (" key=%i is out of range [1..100]!\n",key);
437 return HIPARNT.hipr1[key-1];
441 //______________________________________________________________________________
442 void THijing::SetIHPR2(Int_t key,Int_t value)
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 if ( key<1 || key>50 ) {
458 printf ("ERROR in THijing:GetIHPR2(key): \n ");
459 printf (" key=%i is out of range [1..50]!\n",key);
463 return HIPARNT.ihpr2[key-1];
468 //______________________________________________________________________________
469 Float_t THijing::GetHINT1(Int_t key) const
471 if ( key<1 || key>100 ) {
472 printf ("ERROR in THijing:GetHINT1(key): \n ");
473 printf (" key=%i is out of range [1..100]!\n",key);
477 return HIPARNT.hint1[key-1];
482 //______________________________________________________________________________
483 Int_t THijing::GetIHNT2(Int_t key) const
485 if ( key<1 || key>50 ) {
486 printf ("ERROR in THijing:GetIHNT2(key): \n ");
487 printf (" key=%i is out of range [1..50]!\n",key);
491 return HIPARNT.ihnt2[key-1];
496 //====================== access to common HIMAIN1 ===============================
498 //______________________________________________________________________________
499 Int_t THijing::GetNATT() const
506 //______________________________________________________________________________
507 Float_t THijing::GetEATT() const
514 //______________________________________________________________________________
515 Int_t THijing::GetJATT() const
522 //______________________________________________________________________________
523 Int_t THijing::GetNT() const
530 //______________________________________________________________________________
531 Int_t THijing::GetNP() const
539 //______________________________________________________________________________
540 Int_t THijing::GetN0() const
546 //______________________________________________________________________________
547 Int_t THijing::GetN01() const
554 //______________________________________________________________________________
555 Int_t THijing::GetN10() const
562 //______________________________________________________________________________
563 Int_t THijing::GetN11() const
570 //______________________________________________________________________________
571 Float_t THijing::GetBB() const
578 //====================== access to common HIMAIN2 ===============================
580 //______________________________________________________________________________
581 Int_t THijing::GetKATT(Int_t key1, Int_t key2) const
583 if ( key1<1 || key1>200000 ) {
584 printf("ERROR in THijing::GetKATT(key1,key2):\n");
585 printf(" key1=%i is out of range [1..200000]\n",key1);
589 if ( key2<1 || key2>4 ) {
590 printf("ERROR in THijing::GetKATT(key1,key2):\n");
591 printf(" key2=%i is out of range [1..4]\n",key2);
595 return HIMAIN2.katt[key2-1][key1-1];
598 //______________________________________________________________________________
599 Float_t THijing::GetPATT(Int_t key1, Int_t key2) const
601 if ( key1<1 || key1>130000 ) {
602 printf("ERROR in THijing::GetPATT(key1,key2):\n");
603 printf(" key1=%i is out of range [1..130000]\n",key1);
607 if ( key2<1 || key2>4 ) {
608 printf("ERROR in THijing::GetPATT(key1,key2):\n");
609 printf(" key2=%i is out of range [1..4]\n",key2);
613 return HIMAIN2.patt[key2-1][key1-1];
616 //====================== access to common HIJJET1 ===============================
618 //______________________________________________________________________________
619 Int_t THijing::GetNPJ(Int_t key) const
621 if ( key<1 || key>300 ) {
622 printf("ERROR in THijing::GetNPJ(key):\n");
623 printf(" key=%i is out of range [1..300]\n",key);
626 return HIJJET1.npj[key-1];
629 //______________________________________________________________________________
630 Int_t THijing::GetKFPJ(Int_t key1, Int_t key2) const
632 if ( key1<1 || key1>300 ) {
633 printf("ERROR in THijing::GetKFPJ(key1):\n");
634 printf(" key1=%i is out of range [1..300]\n",key1);
637 if ( key2<1 || key2>500 ) {
638 printf("ERROR in THijing::GetKFPJ(key1,key2):\n");
639 printf(" key2=%i is out of range [1..500]\n",key2);
643 return HIJJET1.kfpj[key2-1][key1-1];
646 //______________________________________________________________________________
647 Float_t THijing::GetPJPX(Int_t key1, Int_t key2) const
649 if ( key1<1 || key1>300 ) {
650 printf("ERROR in THijing::GetPJPX(key1):\n");
651 printf(" key1=%i is out of range [1..300]\n",key1);
654 if ( key2<1 || key2>500 ) {
655 printf("ERROR in THijing::GetPJPX(key1,key2):\n");
656 printf(" key2=%i is out of range [1..500]\n",key2);
660 return HIJJET1.pjpx[key2-1][key1-1];
663 //______________________________________________________________________________
664 Float_t THijing::GetPJPY(Int_t key1, Int_t key2) const
666 if ( key1<1 || key1>300 ) {
667 printf("ERROR in THijing::GetPJPY(key1):\n");
668 printf(" key1=%i is out of range [1..300]\n",key1);
671 if ( key2<1 || key2>500 ) {
672 printf("ERROR in THijing::GetPJPY(key1,key2):\n");
673 printf(" key2=%i is out of range [1..500]\n",key2);
677 return HIJJET1.pjpy[key2-1][key1-1];
680 //______________________________________________________________________________
681 Float_t THijing::GetPJPZ(Int_t key1, Int_t key2) const
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 if ( key1<1 || key1>300 ) {
701 printf("ERROR in THijing::GetPJPE(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::GetPJPE(key1,key2):\n");
707 printf(" key2=%i is out of range [1..500]\n",key2);
711 return HIJJET1.pjpe[key2-1][key1-1];
714 //______________________________________________________________________________
715 Float_t THijing::GetPJPM(Int_t key1, Int_t key2) const
717 if ( key1<1 || key1>300 ) {
718 printf("ERROR in THijing::GetPJPM(key1):\n");
719 printf(" key1=%i is out of range [1..300]\n",key1);
722 if ( key2<1 || key2>500 ) {
723 printf("ERROR in THijing::GetPJPM(key1,key2):\n");
724 printf(" key2=%i is out of range [1..500]\n",key2);
728 return HIJJET1.pjpm[key2-1][key1-1];
731 //______________________________________________________________________________
732 Int_t THijing::GetNTJ(Int_t key) const
734 if ( key<1 || key>300 ) {
735 printf("ERROR in THijing::GetNTJ(key):\n");
736 printf(" key=%i is out of range [1..300]\n",key);
739 return HIJJET1.ntj[key-1];
742 //______________________________________________________________________________
743 Int_t THijing::GetKFTJ(Int_t key1, Int_t key2) const
745 if ( key1<1 || key1>300 ) {
746 printf("ERROR in THijing::GetKFTJ(key1):\n");
747 printf(" key1=%i is out of range [1..300]\n",key1);
750 if ( key2<1 || key2>500 ) {
751 printf("ERROR in THijing::GetKFTJ(key1,key2):\n");
752 printf(" key2=%i is out of range [1..500]\n",key2);
756 return HIJJET1.kftj[key2-1][key1-1];
759 //______________________________________________________________________________
760 Float_t THijing::GetPJTX(Int_t key1, Int_t key2) const
762 if ( key1<1 || key1>300 ) {
763 printf("ERROR in THijing::GetPJTX(key1):\n");
764 printf(" key1=%i is out of range [1..300]\n",key1);
767 if ( key2<1 || key2>500 ) {
768 printf("ERROR in THijing::GetPJTX(key1,key2):\n");
769 printf(" key2=%i is out of range [1..500]\n",key2);
773 return HIJJET1.pjtx[key2-1][key1-1];
776 //______________________________________________________________________________
777 Float_t THijing::GetPJTY(Int_t key1, Int_t key2) const
779 if ( key1<1 || key1>300 ) {
780 printf("ERROR in THijing::GetPJTY(key1):\n");
781 printf(" key1=%i is out of range [1..300]\n",key1);
784 if ( key2<1 || key2>500 ) {
785 printf("ERROR in THijing::GetPJTY(key1,key2):\n");
786 printf(" key2=%i is out of range [1..500]\n",key2);
790 return HIJJET1.pjty[key2-1][key1-1];
793 //______________________________________________________________________________
794 Float_t THijing::GetPJTZ(Int_t key1, Int_t key2) const
796 if ( key1<1 || key1>300 ) {
797 printf("ERROR in THijing::GetPJTZ(key1):\n");
798 printf(" key1=%i is out of range [1..300]\n",key1);
801 if ( key2<1 || key2>500 ) {
802 printf("ERROR in THijing::GetPJTZ(key1,key2):\n");
803 printf(" key2=%i is out of range [1..500]\n",key2);
807 return HIJJET1.pjtz[key2-1][key1-1];
810 //______________________________________________________________________________
811 Float_t THijing::GetPJTE(Int_t key1, Int_t key2) const
813 if ( key1<1 || key1>300 ) {
814 printf("ERROR in THijing::GetPJTE(key1):\n");
815 printf(" key1=%i is out of range [1..300]\n",key1);
818 if ( key2<1 || key2>500 ) {
819 printf("ERROR in THijing::GetPJTE(key1,key2):\n");
820 printf(" key2=%i is out of range [1..500]\n",key2);
824 return HIJJET1.pjte[key2-1][key1-1];
827 //______________________________________________________________________________
828 Float_t THijing::GetPJTM(Int_t key1, Int_t key2) const
830 if ( key1<1 || key1>300 ) {
831 printf("ERROR in THijing::GetPJTM(key1):\n");
832 printf(" key1=%i is out of range [1..300]\n",key1);
835 if ( key2<1 || key2>500 ) {
836 printf("ERROR in THijing::GetPJTM(key1,key2):\n");
837 printf(" key2=%i is out of range [1..500]\n",key2);
841 return HIJJET1.pjtm[key2-1][key1-1];
844 //====================== access to common HIJJET1 ===============================
846 //______________________________________________________________________________
847 Int_t THijing::GetNSG() const
852 //______________________________________________________________________________
853 Int_t THijing::GetNJSG(Int_t key) const
855 if ( key<1 || key>900 ) {
856 printf ("ERROR in THijing:GetNJSG(key): \n ");
857 printf (" key=%i is out of range [1..900]!\n",key);
861 return HIJJET2.njsg[key-1];
865 //______________________________________________________________________________
866 Int_t THijing::GetIASG(Int_t key1, Int_t key2) const
868 if ( key1<1 || key1>900 ) {
869 printf("ERROR in THijing::GetIASG(key1):\n");
870 printf(" key1=%i is out of range [1..900]\n",key1);
873 if ( key2<1 || key2>3 ) {
874 printf("ERROR in THijing::GetIASG(key1,key2):\n");
875 printf(" key2=%i is out of range [1..3]\n",key2);
879 return HIJJET2.iasg[key2-1][key1-1];
882 //______________________________________________________________________________
883 Int_t THijing::GetK1SG(Int_t key1, Int_t key2) const
885 if ( key1<1 || key1>900 ) {
886 printf("ERROR in THijing::GetK1SG(key1):\n");
887 printf(" key1=%i is out of range [1..900]\n",key1);
890 if ( key2<1 || key2>100 ) {
891 printf("ERROR in THijing::GetK1SG(key1,key2):\n");
892 printf(" key2=%i is out of range [1..100]\n",key2);
896 return HIJJET2.k1sg[key2-1][key1-1];
899 //______________________________________________________________________________
900 Int_t THijing::GetK2SG(Int_t key1, Int_t key2) const
902 if ( key1<1 || key1>900 ) {
903 printf("ERROR in THijing::GetK2SG(key1):\n");
904 printf(" key1=%i is out of range [1..900]\n",key1);
907 if ( key2<1 || key2>100 ) {
908 printf("ERROR in THijing::GetK2SG(key1,key2):\n");
909 printf(" key2=%i is out of range [1..100]\n",key2);
913 return HIJJET2.k2sg[key2-1][key1-1];
916 //______________________________________________________________________________
917 Float_t THijing::GetPXSG(Int_t key1, Int_t key2) const
919 if ( key1<1 || key1>900 ) {
920 printf("ERROR in THijing::GetPXSG(key1):\n");
921 printf(" key1=%i is out of range [1..900]\n",key1);
924 if ( key2<1 || key2>100 ) {
925 printf("ERROR in THijing::GetPXSG(key1,key2):\n");
926 printf(" key2=%i is out of range [1..100]\n",key2);
930 return HIJJET2.pxsg[key2-1][key1-1];
933 //______________________________________________________________________________
934 Float_t THijing::GetPYSG(Int_t key1, Int_t key2) const
936 if ( key1<1 || key1>900 ) {
937 printf("ERROR in THijing::GetPYSG(key1):\n");
938 printf(" key1=%i is out of range [1..900]\n",key1);
941 if ( key2<1 || key2>100 ) {
942 printf("ERROR in THijing::GetPYSG(key1,key2):\n");
943 printf(" key2=%i is out of range [1..100]\n",key2);
947 return HIJJET2.pysg[key2-1][key1-1];
950 //______________________________________________________________________________
951 Float_t THijing::GetPZSG(Int_t key1, Int_t key2) const
953 if ( key1<1 || key1>900 ) {
954 printf("ERROR in THijing::GetPZSG(key1):\n");
955 printf(" key1=%i is out of range [1..900]\n",key1);
958 if ( key2<1 || key2>100 ) {
959 printf("ERROR in THijing::GetPZSG(key1,key2):\n");
960 printf(" key2=%i is out of range [1..100]\n",key2);
964 return HIJJET2.pzsg[key2-1][key1-1];
967 //______________________________________________________________________________
968 Float_t THijing::GetPESG(Int_t key1, Int_t key2) const
970 if ( key1<1 || key1>900 ) {
971 printf("ERROR in THijing::GetPESG(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::GetPESG(key1,key2):\n");
977 printf(" key2=%i is out of range [1..100]\n",key2);
981 return HIJJET2.pesg[key2-1][key1-1];
984 //______________________________________________________________________________
985 Float_t THijing::GetPMSG(Int_t key1, Int_t key2) const
987 if ( key1<1 || key1>900 ) {
988 printf("ERROR in THijing::GetPMSG(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::GetPMSG(key1,key2):\n");
994 printf(" key2=%i is out of range [1..100]\n",key2);
998 return HIJJET2.pmsg[key2-1][key1-1];
1001 //====================== access to common HISTRNG ===============================
1003 //______________________________________________________________________________
1004 Int_t THijing::GetNFP(Int_t key1, Int_t key2) const
1006 if ( key1<1 || key1>300 ) {
1007 printf("ERROR in THijing::GetNFP(key1):\n");
1008 printf(" key1=%i is out of range [1..300]\n",key1);
1011 if ( key2<1 || key2>15 ) {
1012 printf("ERROR in THijing::GetNFP(key1,key2):\n");
1013 printf(" key2=%i is out of range [1..15]\n",key2);
1017 return HISTRNG.nfp[key2-1][key1-1];
1020 //______________________________________________________________________________
1021 Float_t THijing::GetPP(Int_t key1, Int_t key2) const
1023 if ( key1<1 || key1>300 ) {
1024 printf("ERROR in THijing::GetPP(key1):\n");
1025 printf(" key1=%i is out of range [1..300]\n",key1);
1028 if ( key2<1 || key2>15 ) {
1029 printf("ERROR in THijing::GetPP(key1,key2):\n");
1030 printf(" key2=%i is out of range [1..15]\n",key2);
1034 return HISTRNG.pp[key2-1][key1-1];
1037 //______________________________________________________________________________
1038 Int_t THijing::GetNFT(Int_t key1, Int_t key2) const
1040 if ( key1<1 || key1>300 ) {
1041 printf("ERROR in THijing::GetNFT(key1):\n");
1042 printf(" key1=%i is out of range [1..300]\n",key1);
1045 if ( key2<1 || key2>15 ) {
1046 printf("ERROR in THijing::GetNFT(key1,key2):\n");
1047 printf(" key2=%i is out of range [1..15]\n",key2);
1051 return HISTRNG.nft[key2-1][key1-1];
1054 //______________________________________________________________________________
1055 Float_t THijing::GetPT(Int_t key1, Int_t key2) const
1057 if ( key1<1 || key1>300 ) {
1058 printf("ERROR in THijing::GetPT(key1):\n");
1059 printf(" key1=%i is out of range [1..300]\n",key1);
1062 if ( key2<1 || key2>15 ) {
1063 printf("ERROR in THijing::GetPT(key1,key2):\n");
1064 printf(" key2=%i is out of range [1..15]\n",key2);
1068 return HISTRNG.pt[key2-1][key1-1];
1073 //====================== access to Hijing subroutines =========================
1076 //______________________________________________________________________________
1077 void THijing::Initialize()
1079 //////////////////////////////////////////////////////////////////////////////////
1080 // Calls Hijset with the either default parameters or the ones set by the user //
1081 // via SetEFRM, SetFRAME, SetPROJ, SetTARG, SetIAP, SetIZP, SetIAT, SetIZT //
1082 //////////////////////////////////////////////////////////////////////////////////
1084 if ( (!strcmp(fFrame.Data(), "CMS " )) &&
1085 (!strcmp(fFrame.Data(), "LAB " ))){
1086 printf("WARNING! In THijing:Initialize():\n");
1087 printf(" specified frame=%s is neither CMS or LAB\n",fFrame.Data());
1088 printf(" resetting to default \"CMS\" .");
1092 if ( (!strcmp(fProj.Data(), "A " )) &&
1093 (!strcmp(fProj.Data(), "P " )) &&
1094 (!strcmp(fProj.Data(), "PBAR " ))){
1095 printf("WARNING! In THijing:Initialize():\n");
1096 printf(" specified projectile=%s is neither A, P or PBAR\n",fProj.Data());
1097 printf(" resetting to default \"A\" .");
1101 if ( (!strcmp(fTarg.Data(), "A " )) &&
1102 (!strcmp(fTarg.Data(), "P " )) &&
1103 (!strcmp(fTarg.Data(), "PBAR " ))){
1104 printf("WARNING! In THijing:Initialize():\n");
1105 printf(" specified target=%s is neither A, P or PBAR\n",fTarg.Data());
1106 printf(" resetting to default \"A\" .");
1110 printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1112 Hijset(fEfrm,fFrame.Data(),fProj.Data(),fTarg.Data(),fIap,fIzp,fIat,fIzt);
1114 printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1118 //______________________________________________________________________________
1119 void THijing::GenerateEvent()
1121 // Generates one event;
1123 Hijing(fFrame.Data(),fBmin,fBmax);
1126 //______________________________________________________________________________
1127 void THijing::Hijset(float efrm, const char *frame, const char *proj,
1128 const char *targ, int iap, int izp, int iat, int izt)
1130 // Call HIJING routine HIJSET passing the parameters in a way accepted by
1133 int s1 = strlen(frame);
1134 int s2 = strlen(proj);
1135 int s3 = strlen(targ);
1136 printf("s1 = %d s2 = %d s3 = %d\n",s1,s2,s3);
1138 hijset(efrm, frame, proj, targ, iap, izp, iat, izt, s1, s2, s3);
1140 hijset(efrm, frame, s1, proj, s2, targ, s3, iap, izp, iat, izt);
1143 //______________________________________________________________________________
1144 void THijing::Hijing(const char *frame, float bmin, float bmax)
1146 // Call HIJING routine HIJSET passing the parameters in a way accepted by
1149 int s1 = strlen(frame);
1152 hijing(frame, bmin, bmax, s1);
1154 hijing(frame, s1, bmin, bmax);
1159 Float_t THijing::Profile(float b)
1161 // Call HIJING routine PROFILE
1166 void THijing::Rluget(Int_t lfn, Int_t move)
1168 // write seed to file
1169 rluget_hijing(lfn, move);
1173 void THijing::Rluset(Int_t lfn, Int_t move)
1175 // read seed from file
1176 rluset_hijing(lfn, move);