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(
278 else if (!strcmp(option,"All")) {
280 for (Int_t i = 0; i<=numpart; i++) {
282 Int_t iParent = HIMAIN2.katt[2][i]-1;
285 TParticle *mother = (TParticle*) (Particles.UncheckedAt(iParent));
286 mother->SetLastDaughter(i);
287 if (mother->GetFirstDaughter()==-1)
288 mother->SetFirstDaughter(i);
291 new(Particles[i]) TParticle(
314 //______________________________________________________________________________
315 void THijing::SetEFRM(Float_t efrm)
319 //______________________________________________________________________________
320 void THijing::SetFRAME(const char* frame)
324 //______________________________________________________________________________
325 void THijing::SetPROJ(const char* proj)
329 //______________________________________________________________________________
330 void THijing::SetTARG(const char* targ)
334 //______________________________________________________________________________
335 void THijing::SetIAP(Int_t iap)
339 //______________________________________________________________________________
340 void THijing::SetIZP(Int_t izp)
344 //______________________________________________________________________________
345 void THijing::SetIAT(Int_t iat)
349 //______________________________________________________________________________
350 void THijing::SetIZT(Int_t izt)
354 //______________________________________________________________________________
355 void THijing::SetBMIN(Float_t bmin)
359 //______________________________________________________________________________
360 void THijing::SetBMAX(Float_t bmax)
364 //______________________________________________________________________________
365 Float_t THijing::GetEFRM() const
369 //______________________________________________________________________________
370 const char* THijing::GetFRAME() const
372 return fFrame.Data();
374 //______________________________________________________________________________
375 const char* THijing::GetPROJ() const
379 //______________________________________________________________________________
380 const char* THijing::GetTARG() const
384 //______________________________________________________________________________
385 Int_t THijing::GetIAP() const
389 //______________________________________________________________________________
390 Int_t THijing::GetIZP() const
394 //______________________________________________________________________________
395 Int_t THijing::GetIAT() const
399 //______________________________________________________________________________
400 Int_t THijing::GetIZT() const
404 //______________________________________________________________________________
405 Float_t THijing::GetBMIN() const
409 //______________________________________________________________________________
410 Float_t THijing::GetBMAX() const
415 //====================== access to common HIPARNT ===============================
417 //______________________________________________________________________________
418 void THijing::SetHIPR1(Int_t key,Float_t value)
420 if ( key<1 || key>100 ) {
421 printf ("ERROR in THijing:SetHIPR1(key,value): \n ");
422 printf (" key=%i is out of range [1..100]!\n",key);
426 HIPARNT.hipr1[key-1]=value;
430 //______________________________________________________________________________
431 Float_t THijing::GetHIPR1(Int_t key) const
433 if ( key<1 || key>100 ) {
434 printf ("ERROR in THijing:GetHIPR1(key): \n ");
435 printf (" key=%i is out of range [1..100]!\n",key);
439 return HIPARNT.hipr1[key-1];
443 //______________________________________________________________________________
444 void THijing::SetIHPR2(Int_t key,Int_t value)
446 if ( key<1 || key>50 ) {
447 printf ("ERROR in THijing:SetIHPR2(key,value): \n ");
448 printf (" key=%i is out of range [1..50]!\n",key);
452 HIPARNT.ihpr2[key-1]=value;
456 //______________________________________________________________________________
457 Int_t THijing::GetIHPR2(Int_t key) const
459 if ( key<1 || key>50 ) {
460 printf ("ERROR in THijing:GetIHPR2(key): \n ");
461 printf (" key=%i is out of range [1..50]!\n",key);
465 return HIPARNT.ihpr2[key-1];
470 //______________________________________________________________________________
471 Float_t THijing::GetHINT1(Int_t key) const
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 if ( key<1 || key>50 ) {
488 printf ("ERROR in THijing:GetIHNT2(key): \n ");
489 printf (" key=%i is out of range [1..50]!\n",key);
493 return HIPARNT.ihnt2[key-1];
498 //====================== access to common HIMAIN1 ===============================
500 //______________________________________________________________________________
501 Int_t THijing::GetNATT() const
508 //______________________________________________________________________________
509 Float_t THijing::GetEATT() const
516 //______________________________________________________________________________
517 Int_t THijing::GetJATT() const
524 //______________________________________________________________________________
525 Int_t THijing::GetNT() const
532 //______________________________________________________________________________
533 Int_t THijing::GetNP() const
541 //______________________________________________________________________________
542 Int_t THijing::GetN0() const
548 //______________________________________________________________________________
549 Int_t THijing::GetN01() const
556 //______________________________________________________________________________
557 Int_t THijing::GetN10() const
564 //______________________________________________________________________________
565 Int_t THijing::GetN11() const
572 //______________________________________________________________________________
573 Float_t THijing::GetBB() const
580 //====================== access to common HIMAIN2 ===============================
582 //______________________________________________________________________________
583 Int_t THijing::GetKATT(Int_t key1, Int_t key2) const
585 if ( key1<1 || key1>200000 ) {
586 printf("ERROR in THijing::GetKATT(key1,key2):\n");
587 printf(" key1=%i is out of range [1..200000]\n",key1);
591 if ( key2<1 || key2>4 ) {
592 printf("ERROR in THijing::GetKATT(key1,key2):\n");
593 printf(" key2=%i is out of range [1..4]\n",key2);
597 return HIMAIN2.katt[key2-1][key1-1];
600 //______________________________________________________________________________
601 Float_t THijing::GetPATT(Int_t key1, Int_t key2) const
603 if ( key1<1 || key1>200000 ) {
604 printf("ERROR in THijing::GetPATT(key1,key2):\n");
605 printf(" key1=%i is out of range [1..130000]\n",key1);
609 if ( key2<1 || key2>4 ) {
610 printf("ERROR in THijing::GetPATT(key1,key2):\n");
611 printf(" key2=%i is out of range [1..4]\n",key2);
615 return HIMAIN2.patt[key2-1][key1-1];
618 Float_t THijing::GetVATT(Int_t key1, Int_t key2) const
620 if ( key1<1 || key1>200000 ) {
621 printf("ERROR in THijing::GetVATT(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::GetVATT(key1,key2):\n");
628 printf(" key2=%i is out of range [1..4]\n",key2);
632 return HIMAIN2.vatt[key2-1][key1-1];
635 //====================== access to common HIJJET1 ===============================
637 //______________________________________________________________________________
638 Int_t THijing::GetNPJ(Int_t key) const
640 if ( key<1 || key>300 ) {
641 printf("ERROR in THijing::GetNPJ(key):\n");
642 printf(" key=%i is out of range [1..300]\n",key);
645 return HIJJET1.npj[key-1];
648 //______________________________________________________________________________
649 Int_t THijing::GetKFPJ(Int_t key1, Int_t key2) const
651 if ( key1<1 || key1>300 ) {
652 printf("ERROR in THijing::GetKFPJ(key1):\n");
653 printf(" key1=%i is out of range [1..300]\n",key1);
656 if ( key2<1 || key2>500 ) {
657 printf("ERROR in THijing::GetKFPJ(key1,key2):\n");
658 printf(" key2=%i is out of range [1..500]\n",key2);
662 return HIJJET1.kfpj[key2-1][key1-1];
665 //______________________________________________________________________________
666 Float_t THijing::GetPJPX(Int_t key1, Int_t key2) const
668 if ( key1<1 || key1>300 ) {
669 printf("ERROR in THijing::GetPJPX(key1):\n");
670 printf(" key1=%i is out of range [1..300]\n",key1);
673 if ( key2<1 || key2>500 ) {
674 printf("ERROR in THijing::GetPJPX(key1,key2):\n");
675 printf(" key2=%i is out of range [1..500]\n",key2);
679 return HIJJET1.pjpx[key2-1][key1-1];
682 //______________________________________________________________________________
683 Float_t THijing::GetPJPY(Int_t key1, Int_t key2) const
685 if ( key1<1 || key1>300 ) {
686 printf("ERROR in THijing::GetPJPY(key1):\n");
687 printf(" key1=%i is out of range [1..300]\n",key1);
690 if ( key2<1 || key2>500 ) {
691 printf("ERROR in THijing::GetPJPY(key1,key2):\n");
692 printf(" key2=%i is out of range [1..500]\n",key2);
696 return HIJJET1.pjpy[key2-1][key1-1];
699 //______________________________________________________________________________
700 Float_t THijing::GetPJPZ(Int_t key1, Int_t key2) const
702 if ( key1<1 || key1>300 ) {
703 printf("ERROR in THijing::GetPJPZ(key1):\n");
704 printf(" key1=%i is out of range [1..300]\n",key1);
707 if ( key2<1 || key2>500 ) {
708 printf("ERROR in THijing::GetPJPZ(key1,key2):\n");
709 printf(" key2=%i is out of range [1..500]\n",key2);
713 return HIJJET1.pjpz[key2-1][key1-1];
716 //______________________________________________________________________________
717 Float_t THijing::GetPJPE(Int_t key1, Int_t key2) const
719 if ( key1<1 || key1>300 ) {
720 printf("ERROR in THijing::GetPJPE(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::GetPJPE(key1,key2):\n");
726 printf(" key2=%i is out of range [1..500]\n",key2);
730 return HIJJET1.pjpe[key2-1][key1-1];
733 //______________________________________________________________________________
734 Float_t THijing::GetPJPM(Int_t key1, Int_t key2) const
736 if ( key1<1 || key1>300 ) {
737 printf("ERROR in THijing::GetPJPM(key1):\n");
738 printf(" key1=%i is out of range [1..300]\n",key1);
741 if ( key2<1 || key2>500 ) {
742 printf("ERROR in THijing::GetPJPM(key1,key2):\n");
743 printf(" key2=%i is out of range [1..500]\n",key2);
747 return HIJJET1.pjpm[key2-1][key1-1];
750 //______________________________________________________________________________
751 Int_t THijing::GetNTJ(Int_t key) const
753 if ( key<1 || key>300 ) {
754 printf("ERROR in THijing::GetNTJ(key):\n");
755 printf(" key=%i is out of range [1..300]\n",key);
758 return HIJJET1.ntj[key-1];
761 //______________________________________________________________________________
762 Int_t THijing::GetKFTJ(Int_t key1, Int_t key2) const
764 if ( key1<1 || key1>300 ) {
765 printf("ERROR in THijing::GetKFTJ(key1):\n");
766 printf(" key1=%i is out of range [1..300]\n",key1);
769 if ( key2<1 || key2>500 ) {
770 printf("ERROR in THijing::GetKFTJ(key1,key2):\n");
771 printf(" key2=%i is out of range [1..500]\n",key2);
775 return HIJJET1.kftj[key2-1][key1-1];
778 //______________________________________________________________________________
779 Float_t THijing::GetPJTX(Int_t key1, Int_t key2) const
781 if ( key1<1 || key1>300 ) {
782 printf("ERROR in THijing::GetPJTX(key1):\n");
783 printf(" key1=%i is out of range [1..300]\n",key1);
786 if ( key2<1 || key2>500 ) {
787 printf("ERROR in THijing::GetPJTX(key1,key2):\n");
788 printf(" key2=%i is out of range [1..500]\n",key2);
792 return HIJJET1.pjtx[key2-1][key1-1];
795 //______________________________________________________________________________
796 Float_t THijing::GetPJTY(Int_t key1, Int_t key2) const
798 if ( key1<1 || key1>300 ) {
799 printf("ERROR in THijing::GetPJTY(key1):\n");
800 printf(" key1=%i is out of range [1..300]\n",key1);
803 if ( key2<1 || key2>500 ) {
804 printf("ERROR in THijing::GetPJTY(key1,key2):\n");
805 printf(" key2=%i is out of range [1..500]\n",key2);
809 return HIJJET1.pjty[key2-1][key1-1];
812 //______________________________________________________________________________
813 Float_t THijing::GetPJTZ(Int_t key1, Int_t key2) const
815 if ( key1<1 || key1>300 ) {
816 printf("ERROR in THijing::GetPJTZ(key1):\n");
817 printf(" key1=%i is out of range [1..300]\n",key1);
820 if ( key2<1 || key2>500 ) {
821 printf("ERROR in THijing::GetPJTZ(key1,key2):\n");
822 printf(" key2=%i is out of range [1..500]\n",key2);
826 return HIJJET1.pjtz[key2-1][key1-1];
829 //______________________________________________________________________________
830 Float_t THijing::GetPJTE(Int_t key1, Int_t key2) const
832 if ( key1<1 || key1>300 ) {
833 printf("ERROR in THijing::GetPJTE(key1):\n");
834 printf(" key1=%i is out of range [1..300]\n",key1);
837 if ( key2<1 || key2>500 ) {
838 printf("ERROR in THijing::GetPJTE(key1,key2):\n");
839 printf(" key2=%i is out of range [1..500]\n",key2);
843 return HIJJET1.pjte[key2-1][key1-1];
846 //______________________________________________________________________________
847 Float_t THijing::GetPJTM(Int_t key1, Int_t key2) const
849 if ( key1<1 || key1>300 ) {
850 printf("ERROR in THijing::GetPJTM(key1):\n");
851 printf(" key1=%i is out of range [1..300]\n",key1);
854 if ( key2<1 || key2>500 ) {
855 printf("ERROR in THijing::GetPJTM(key1,key2):\n");
856 printf(" key2=%i is out of range [1..500]\n",key2);
860 return HIJJET1.pjtm[key2-1][key1-1];
863 //====================== access to common HIJJET1 ===============================
865 //______________________________________________________________________________
866 Int_t THijing::GetNSG() const
871 //______________________________________________________________________________
872 Int_t THijing::GetNJSG(Int_t key) const
874 if ( key<1 || key>900 ) {
875 printf ("ERROR in THijing:GetNJSG(key): \n ");
876 printf (" key=%i is out of range [1..900]!\n",key);
880 return HIJJET2.njsg[key-1];
884 //______________________________________________________________________________
885 Int_t THijing::GetIASG(Int_t key1, Int_t key2) const
887 if ( key1<1 || key1>900 ) {
888 printf("ERROR in THijing::GetIASG(key1):\n");
889 printf(" key1=%i is out of range [1..900]\n",key1);
892 if ( key2<1 || key2>3 ) {
893 printf("ERROR in THijing::GetIASG(key1,key2):\n");
894 printf(" key2=%i is out of range [1..3]\n",key2);
898 return HIJJET2.iasg[key2-1][key1-1];
901 //______________________________________________________________________________
902 Int_t THijing::GetK1SG(Int_t key1, Int_t key2) const
904 if ( key1<1 || key1>900 ) {
905 printf("ERROR in THijing::GetK1SG(key1):\n");
906 printf(" key1=%i is out of range [1..900]\n",key1);
909 if ( key2<1 || key2>100 ) {
910 printf("ERROR in THijing::GetK1SG(key1,key2):\n");
911 printf(" key2=%i is out of range [1..100]\n",key2);
915 return HIJJET2.k1sg[key2-1][key1-1];
918 //______________________________________________________________________________
919 Int_t THijing::GetK2SG(Int_t key1, Int_t key2) const
921 if ( key1<1 || key1>900 ) {
922 printf("ERROR in THijing::GetK2SG(key1):\n");
923 printf(" key1=%i is out of range [1..900]\n",key1);
926 if ( key2<1 || key2>100 ) {
927 printf("ERROR in THijing::GetK2SG(key1,key2):\n");
928 printf(" key2=%i is out of range [1..100]\n",key2);
932 return HIJJET2.k2sg[key2-1][key1-1];
935 //______________________________________________________________________________
936 Float_t THijing::GetPXSG(Int_t key1, Int_t key2) const
938 if ( key1<1 || key1>900 ) {
939 printf("ERROR in THijing::GetPXSG(key1):\n");
940 printf(" key1=%i is out of range [1..900]\n",key1);
943 if ( key2<1 || key2>100 ) {
944 printf("ERROR in THijing::GetPXSG(key1,key2):\n");
945 printf(" key2=%i is out of range [1..100]\n",key2);
949 return HIJJET2.pxsg[key2-1][key1-1];
952 //______________________________________________________________________________
953 Float_t THijing::GetPYSG(Int_t key1, Int_t key2) const
955 if ( key1<1 || key1>900 ) {
956 printf("ERROR in THijing::GetPYSG(key1):\n");
957 printf(" key1=%i is out of range [1..900]\n",key1);
960 if ( key2<1 || key2>100 ) {
961 printf("ERROR in THijing::GetPYSG(key1,key2):\n");
962 printf(" key2=%i is out of range [1..100]\n",key2);
966 return HIJJET2.pysg[key2-1][key1-1];
969 //______________________________________________________________________________
970 Float_t THijing::GetPZSG(Int_t key1, Int_t key2) const
972 if ( key1<1 || key1>900 ) {
973 printf("ERROR in THijing::GetPZSG(key1):\n");
974 printf(" key1=%i is out of range [1..900]\n",key1);
977 if ( key2<1 || key2>100 ) {
978 printf("ERROR in THijing::GetPZSG(key1,key2):\n");
979 printf(" key2=%i is out of range [1..100]\n",key2);
983 return HIJJET2.pzsg[key2-1][key1-1];
986 //______________________________________________________________________________
987 Float_t THijing::GetPESG(Int_t key1, Int_t key2) const
989 if ( key1<1 || key1>900 ) {
990 printf("ERROR in THijing::GetPESG(key1):\n");
991 printf(" key1=%i is out of range [1..900]\n",key1);
994 if ( key2<1 || key2>100 ) {
995 printf("ERROR in THijing::GetPESG(key1,key2):\n");
996 printf(" key2=%i is out of range [1..100]\n",key2);
1000 return HIJJET2.pesg[key2-1][key1-1];
1003 //______________________________________________________________________________
1004 Float_t THijing::GetPMSG(Int_t key1, Int_t key2) const
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 if ( key1<1 || key1>300 ) {
1026 printf("ERROR in THijing::GetNFP(key1):\n");
1027 printf(" key1=%i is out of range [1..300]\n",key1);
1030 if ( key2<1 || key2>15 ) {
1031 printf("ERROR in THijing::GetNFP(key1,key2):\n");
1032 printf(" key2=%i is out of range [1..15]\n",key2);
1036 return HISTRNG.nfp[key2-1][key1-1];
1039 //______________________________________________________________________________
1040 Float_t THijing::GetPP(Int_t key1, Int_t key2) const
1042 if ( key1<1 || key1>300 ) {
1043 printf("ERROR in THijing::GetPP(key1):\n");
1044 printf(" key1=%i is out of range [1..300]\n",key1);
1047 if ( key2<1 || key2>15 ) {
1048 printf("ERROR in THijing::GetPP(key1,key2):\n");
1049 printf(" key2=%i is out of range [1..15]\n",key2);
1053 return HISTRNG.pp[key2-1][key1-1];
1056 //______________________________________________________________________________
1057 Int_t THijing::GetNFT(Int_t key1, Int_t key2) const
1059 if ( key1<1 || key1>300 ) {
1060 printf("ERROR in THijing::GetNFT(key1):\n");
1061 printf(" key1=%i is out of range [1..300]\n",key1);
1064 if ( key2<1 || key2>15 ) {
1065 printf("ERROR in THijing::GetNFT(key1,key2):\n");
1066 printf(" key2=%i is out of range [1..15]\n",key2);
1070 return HISTRNG.nft[key2-1][key1-1];
1073 //______________________________________________________________________________
1074 Float_t THijing::GetPT(Int_t key1, Int_t key2) const
1076 if ( key1<1 || key1>300 ) {
1077 printf("ERROR in THijing::GetPT(key1):\n");
1078 printf(" key1=%i is out of range [1..300]\n",key1);
1081 if ( key2<1 || key2>15 ) {
1082 printf("ERROR in THijing::GetPT(key1,key2):\n");
1083 printf(" key2=%i is out of range [1..15]\n",key2);
1087 return HISTRNG.pt[key2-1][key1-1];
1090 void THijing::SetPARJ(Int_t key, Float_t parm)
1092 if ( key < 1 || key > 200) {
1093 printf("ERROR in THijing::SetPARJ(key,parm):\n");
1094 printf(" key=%i is out of range [1..200]\n",key);
1097 LUDAT1_HIJING.parj[key-1] = parm;
1101 void THijing::SetMSTJ(Int_t key, Int_t parm)
1103 if ( key < 1 || key > 200) {
1104 printf("ERROR in THijing::SetMSTJ(key,parm):\n");
1105 printf(" key=%i is out of range [1..200]\n",key);
1108 LUDAT1_HIJING.mstj[key-1] = parm;
1112 //====================== access to Hijing subroutines =========================
1115 //______________________________________________________________________________
1116 void THijing::Initialize()
1118 //////////////////////////////////////////////////////////////////////////////////
1119 // Calls Hijset with the either default parameters or the ones set by the user //
1120 // via SetEFRM, SetFRAME, SetPROJ, SetTARG, SetIAP, SetIZP, SetIAT, SetIZT //
1121 //////////////////////////////////////////////////////////////////////////////////
1123 if ( (!strcmp(fFrame.Data(), "CMS " )) &&
1124 (!strcmp(fFrame.Data(), "LAB " ))){
1125 printf("WARNING! In THijing:Initialize():\n");
1126 printf(" specified frame=%s is neither CMS or LAB\n",fFrame.Data());
1127 printf(" resetting to default \"CMS\" .");
1131 if ( (!strcmp(fProj.Data(), "A " )) &&
1132 (!strcmp(fProj.Data(), "P " )) &&
1133 (!strcmp(fProj.Data(), "PBAR " ))){
1134 printf("WARNING! In THijing:Initialize():\n");
1135 printf(" specified projectile=%s is neither A, P or PBAR\n",fProj.Data());
1136 printf(" resetting to default \"A\" .");
1140 if ( (!strcmp(fTarg.Data(), "A " )) &&
1141 (!strcmp(fTarg.Data(), "P " )) &&
1142 (!strcmp(fTarg.Data(), "PBAR " ))){
1143 printf("WARNING! In THijing:Initialize():\n");
1144 printf(" specified target=%s is neither A, P or PBAR\n",fTarg.Data());
1145 printf(" resetting to default \"A\" .");
1149 printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1151 Hijset(fEfrm,fFrame.Data(),fProj.Data(),fTarg.Data(),fIap,fIzp,fIat,fIzt);
1153 printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1157 //______________________________________________________________________________
1158 void THijing::GenerateEvent()
1160 // Generates one event;
1162 Hijing(fFrame.Data(),fBmin,fBmax);
1165 //______________________________________________________________________________
1166 void THijing::Hijset(float efrm, const char *frame, const char *proj,
1167 const char *targ, int iap, int izp, int iat, int izt)
1169 // Call HIJING routine HIJSET passing the parameters in a way accepted by
1172 int s1 = strlen(frame);
1173 int s2 = strlen(proj);
1174 int s3 = strlen(targ);
1175 printf("s1 = %d s2 = %d s3 = %d\n",s1,s2,s3);
1177 hijset(efrm, frame, proj, targ, iap, izp, iat, izt, s1, s2, s3);
1179 hijset(efrm, frame, s1, proj, s2, targ, s3, iap, izp, iat, izt);
1182 //______________________________________________________________________________
1183 void THijing::Hijing(const char *frame, float bmin, float bmax)
1185 // Call HIJING routine HIJSET passing the parameters in a way accepted by
1188 int s1 = strlen(frame);
1191 hijing(frame, bmin, bmax, s1);
1193 hijing(frame, s1, bmin, bmax);
1198 Float_t THijing::Profile(float b)
1200 // Call HIJING routine PROFILE
1205 void THijing::Rluget(Int_t lfn, Int_t move)
1207 // write seed to file
1208 rluget_hijing(lfn, move);
1212 void THijing::Rluset(Int_t lfn, Int_t move)
1214 // read seed from file
1215 rluset_hijing(lfn, move);