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;
246 if (!strcmp(option,"") || !strcmp(option,"Final")) {
247 for (Int_t i = 0; i<=numpart; i++) {
249 if (HIMAIN2.katt[3][i] == 1) {
251 // Use the common block values for the TParticle constructor
254 new(Particles[i]) TParticle(
274 else if (!strcmp(option,"All")) {
276 for (Int_t i = 0; i<=numpart; i++) {
278 Int_t iParent = HIMAIN2.katt[2][i]-1;
281 TParticle *mother = (TParticle*) (Particles.UncheckedAt(iParent));
282 mother->SetLastDaughter(i);
283 if (mother->GetFirstDaughter()==-1)
284 mother->SetFirstDaughter(i);
287 new(Particles[i]) TParticle(
309 //______________________________________________________________________________
310 void THijing::SetEFRM(Float_t efrm)
314 //______________________________________________________________________________
315 void THijing::SetFRAME(const char* frame)
319 //______________________________________________________________________________
320 void THijing::SetPROJ(const char* proj)
324 //______________________________________________________________________________
325 void THijing::SetTARG(const char* targ)
329 //______________________________________________________________________________
330 void THijing::SetIAP(Int_t iap)
334 //______________________________________________________________________________
335 void THijing::SetIZP(Int_t izp)
339 //______________________________________________________________________________
340 void THijing::SetIAT(Int_t iat)
344 //______________________________________________________________________________
345 void THijing::SetIZT(Int_t izt)
349 //______________________________________________________________________________
350 void THijing::SetBMIN(Float_t bmin)
354 //______________________________________________________________________________
355 void THijing::SetBMAX(Float_t bmax)
359 //______________________________________________________________________________
360 Float_t THijing::GetEFRM() const
364 //______________________________________________________________________________
365 const char* THijing::GetFRAME() const
367 return fFrame.Data();
369 //______________________________________________________________________________
370 const char* THijing::GetPROJ() const
374 //______________________________________________________________________________
375 const char* THijing::GetTARG() const
379 //______________________________________________________________________________
380 Int_t THijing::GetIAP() const
384 //______________________________________________________________________________
385 Int_t THijing::GetIZP() const
389 //______________________________________________________________________________
390 Int_t THijing::GetIAT() const
394 //______________________________________________________________________________
395 Int_t THijing::GetIZT() const
399 //______________________________________________________________________________
400 Float_t THijing::GetBMIN() const
404 //______________________________________________________________________________
405 Float_t THijing::GetBMAX() const
410 //====================== access to common HIPARNT ===============================
412 //______________________________________________________________________________
413 void THijing::SetHIPR1(Int_t key,Float_t value)
415 if ( key<1 || key>100 ) {
416 printf ("ERROR in THijing:SetHIPR1(key,value): \n ");
417 printf (" key=%i is out of range [1..100]!\n",key);
421 HIPARNT.hipr1[key-1]=value;
425 //______________________________________________________________________________
426 Float_t THijing::GetHIPR1(Int_t key) const
428 if ( key<1 || key>100 ) {
429 printf ("ERROR in THijing:GetHIPR1(key): \n ");
430 printf (" key=%i is out of range [1..100]!\n",key);
434 return HIPARNT.hipr1[key-1];
438 //______________________________________________________________________________
439 void THijing::SetIHPR2(Int_t key,Int_t value)
441 if ( key<1 || key>50 ) {
442 printf ("ERROR in THijing:SetIHPR2(key,value): \n ");
443 printf (" key=%i is out of range [1..50]!\n",key);
447 HIPARNT.ihpr2[key-1]=value;
451 //______________________________________________________________________________
452 Int_t THijing::GetIHPR2(Int_t key) const
454 if ( key<1 || key>50 ) {
455 printf ("ERROR in THijing:GetIHPR2(key): \n ");
456 printf (" key=%i is out of range [1..50]!\n",key);
460 return HIPARNT.ihpr2[key-1];
465 //______________________________________________________________________________
466 Float_t THijing::GetHINT1(Int_t key) const
468 if ( key<1 || key>100 ) {
469 printf ("ERROR in THijing:GetHINT1(key): \n ");
470 printf (" key=%i is out of range [1..100]!\n",key);
474 return HIPARNT.hint1[key-1];
479 //______________________________________________________________________________
480 Int_t THijing::GetIHNT2(Int_t key) const
482 if ( key<1 || key>50 ) {
483 printf ("ERROR in THijing:GetIHNT2(key): \n ");
484 printf (" key=%i is out of range [1..50]!\n",key);
488 return HIPARNT.ihnt2[key-1];
493 //====================== access to common HIMAIN1 ===============================
495 //______________________________________________________________________________
496 Int_t THijing::GetNATT() const
503 //______________________________________________________________________________
504 Float_t THijing::GetEATT() const
511 //______________________________________________________________________________
512 Int_t THijing::GetJATT() const
519 //______________________________________________________________________________
520 Int_t THijing::GetNT() const
527 //______________________________________________________________________________
528 Int_t THijing::GetNP() const
536 //______________________________________________________________________________
537 Int_t THijing::GetN0() const
543 //______________________________________________________________________________
544 Int_t THijing::GetN01() const
551 //______________________________________________________________________________
552 Int_t THijing::GetN10() const
559 //______________________________________________________________________________
560 Int_t THijing::GetN11() const
567 //______________________________________________________________________________
568 Float_t THijing::GetBB() const
575 //====================== access to common HIMAIN2 ===============================
577 //______________________________________________________________________________
578 Int_t THijing::GetKATT(Int_t key1, Int_t key2) const
580 if ( key1<1 || key1>130000 ) {
581 printf("ERROR in THijing::GetKATT(key1,key2):\n");
582 printf(" key1=%i is out of range [1..130000]\n",key1);
586 if ( key2<1 || key2>4 ) {
587 printf("ERROR in THijing::GetKATT(key1,key2):\n");
588 printf(" key2=%i is out of range [1..4]\n",key2);
592 return HIMAIN2.katt[key2-1][key1-1];
595 //______________________________________________________________________________
596 Float_t THijing::GetPATT(Int_t key1, Int_t key2) const
598 if ( key1<1 || key1>130000 ) {
599 printf("ERROR in THijing::GetPATT(key1,key2):\n");
600 printf(" key1=%i is out of range [1..130000]\n",key1);
604 if ( key2<1 || key2>4 ) {
605 printf("ERROR in THijing::GetPATT(key1,key2):\n");
606 printf(" key2=%i is out of range [1..4]\n",key2);
610 return HIMAIN2.patt[key2-1][key1-1];
613 //====================== access to common HIJJET1 ===============================
615 //______________________________________________________________________________
616 Int_t THijing::GetNPJ(Int_t key) const
618 if ( key<1 || key>300 ) {
619 printf("ERROR in THijing::GetNPJ(key):\n");
620 printf(" key=%i is out of range [1..300]\n",key);
623 return HIJJET1.npj[key-1];
626 //______________________________________________________________________________
627 Int_t THijing::GetKFPJ(Int_t key1, Int_t key2) const
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 if ( key1<1 || key1>300 ) {
647 printf("ERROR in THijing::GetPJPX(key1):\n");
648 printf(" key1=%i is out of range [1..300]\n",key1);
651 if ( key2<1 || key2>500 ) {
652 printf("ERROR in THijing::GetPJPX(key1,key2):\n");
653 printf(" key2=%i is out of range [1..500]\n",key2);
657 return HIJJET1.pjpx[key2-1][key1-1];
660 //______________________________________________________________________________
661 Float_t THijing::GetPJPY(Int_t key1, Int_t key2) const
663 if ( key1<1 || key1>300 ) {
664 printf("ERROR in THijing::GetPJPY(key1):\n");
665 printf(" key1=%i is out of range [1..300]\n",key1);
668 if ( key2<1 || key2>500 ) {
669 printf("ERROR in THijing::GetPJPY(key1,key2):\n");
670 printf(" key2=%i is out of range [1..500]\n",key2);
674 return HIJJET1.pjpy[key2-1][key1-1];
677 //______________________________________________________________________________
678 Float_t THijing::GetPJPZ(Int_t key1, Int_t key2) const
680 if ( key1<1 || key1>300 ) {
681 printf("ERROR in THijing::GetPJPZ(key1):\n");
682 printf(" key1=%i is out of range [1..300]\n",key1);
685 if ( key2<1 || key2>500 ) {
686 printf("ERROR in THijing::GetPJPZ(key1,key2):\n");
687 printf(" key2=%i is out of range [1..500]\n",key2);
691 return HIJJET1.pjpz[key2-1][key1-1];
694 //______________________________________________________________________________
695 Float_t THijing::GetPJPE(Int_t key1, Int_t key2) const
697 if ( key1<1 || key1>300 ) {
698 printf("ERROR in THijing::GetPJPE(key1):\n");
699 printf(" key1=%i is out of range [1..300]\n",key1);
702 if ( key2<1 || key2>500 ) {
703 printf("ERROR in THijing::GetPJPE(key1,key2):\n");
704 printf(" key2=%i is out of range [1..500]\n",key2);
708 return HIJJET1.pjpe[key2-1][key1-1];
711 //______________________________________________________________________________
712 Float_t THijing::GetPJPM(Int_t key1, Int_t key2) const
714 if ( key1<1 || key1>300 ) {
715 printf("ERROR in THijing::GetPJPM(key1):\n");
716 printf(" key1=%i is out of range [1..300]\n",key1);
719 if ( key2<1 || key2>500 ) {
720 printf("ERROR in THijing::GetPJPM(key1,key2):\n");
721 printf(" key2=%i is out of range [1..500]\n",key2);
725 return HIJJET1.pjpm[key2-1][key1-1];
728 //______________________________________________________________________________
729 Int_t THijing::GetNTJ(Int_t key) const
731 if ( key<1 || key>300 ) {
732 printf("ERROR in THijing::GetNTJ(key):\n");
733 printf(" key=%i is out of range [1..300]\n",key);
736 return HIJJET1.ntj[key-1];
739 //______________________________________________________________________________
740 Int_t THijing::GetKFTJ(Int_t key1, Int_t key2) const
742 if ( key1<1 || key1>300 ) {
743 printf("ERROR in THijing::GetKFTJ(key1):\n");
744 printf(" key1=%i is out of range [1..300]\n",key1);
747 if ( key2<1 || key2>500 ) {
748 printf("ERROR in THijing::GetKFTJ(key1,key2):\n");
749 printf(" key2=%i is out of range [1..500]\n",key2);
753 return HIJJET1.kftj[key2-1][key1-1];
756 //______________________________________________________________________________
757 Float_t THijing::GetPJTX(Int_t key1, Int_t key2) const
759 if ( key1<1 || key1>300 ) {
760 printf("ERROR in THijing::GetPJTX(key1):\n");
761 printf(" key1=%i is out of range [1..300]\n",key1);
764 if ( key2<1 || key2>500 ) {
765 printf("ERROR in THijing::GetPJTX(key1,key2):\n");
766 printf(" key2=%i is out of range [1..500]\n",key2);
770 return HIJJET1.pjtx[key2-1][key1-1];
773 //______________________________________________________________________________
774 Float_t THijing::GetPJTY(Int_t key1, Int_t key2) const
776 if ( key1<1 || key1>300 ) {
777 printf("ERROR in THijing::GetPJTY(key1):\n");
778 printf(" key1=%i is out of range [1..300]\n",key1);
781 if ( key2<1 || key2>500 ) {
782 printf("ERROR in THijing::GetPJTY(key1,key2):\n");
783 printf(" key2=%i is out of range [1..500]\n",key2);
787 return HIJJET1.pjty[key2-1][key1-1];
790 //______________________________________________________________________________
791 Float_t THijing::GetPJTZ(Int_t key1, Int_t key2) const
793 if ( key1<1 || key1>300 ) {
794 printf("ERROR in THijing::GetPJTZ(key1):\n");
795 printf(" key1=%i is out of range [1..300]\n",key1);
798 if ( key2<1 || key2>500 ) {
799 printf("ERROR in THijing::GetPJTZ(key1,key2):\n");
800 printf(" key2=%i is out of range [1..500]\n",key2);
804 return HIJJET1.pjtz[key2-1][key1-1];
807 //______________________________________________________________________________
808 Float_t THijing::GetPJTE(Int_t key1, Int_t key2) const
810 if ( key1<1 || key1>300 ) {
811 printf("ERROR in THijing::GetPJTE(key1):\n");
812 printf(" key1=%i is out of range [1..300]\n",key1);
815 if ( key2<1 || key2>500 ) {
816 printf("ERROR in THijing::GetPJTE(key1,key2):\n");
817 printf(" key2=%i is out of range [1..500]\n",key2);
821 return HIJJET1.pjte[key2-1][key1-1];
824 //______________________________________________________________________________
825 Float_t THijing::GetPJTM(Int_t key1, Int_t key2) const
827 if ( key1<1 || key1>300 ) {
828 printf("ERROR in THijing::GetPJTM(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::GetPJTM(key1,key2):\n");
834 printf(" key2=%i is out of range [1..500]\n",key2);
838 return HIJJET1.pjtm[key2-1][key1-1];
841 //====================== access to common HIJJET1 ===============================
843 //______________________________________________________________________________
844 Int_t THijing::GetNSG() const
849 //______________________________________________________________________________
850 Int_t THijing::GetNJSG(Int_t key) const
852 if ( key<1 || key>900 ) {
853 printf ("ERROR in THijing:GetNJSG(key): \n ");
854 printf (" key=%i is out of range [1..900]!\n",key);
858 return HIJJET2.njsg[key-1];
862 //______________________________________________________________________________
863 Int_t THijing::GetIASG(Int_t key1, Int_t key2) const
865 if ( key1<1 || key1>900 ) {
866 printf("ERROR in THijing::GetIASG(key1):\n");
867 printf(" key1=%i is out of range [1..900]\n",key1);
870 if ( key2<1 || key2>3 ) {
871 printf("ERROR in THijing::GetIASG(key1,key2):\n");
872 printf(" key2=%i is out of range [1..3]\n",key2);
876 return HIJJET2.iasg[key2-1][key1-1];
879 //______________________________________________________________________________
880 Int_t THijing::GetK1SG(Int_t key1, Int_t key2) const
882 if ( key1<1 || key1>900 ) {
883 printf("ERROR in THijing::GetK1SG(key1):\n");
884 printf(" key1=%i is out of range [1..900]\n",key1);
887 if ( key2<1 || key2>100 ) {
888 printf("ERROR in THijing::GetK1SG(key1,key2):\n");
889 printf(" key2=%i is out of range [1..100]\n",key2);
893 return HIJJET2.k1sg[key2-1][key1-1];
896 //______________________________________________________________________________
897 Int_t THijing::GetK2SG(Int_t key1, Int_t key2) const
899 if ( key1<1 || key1>900 ) {
900 printf("ERROR in THijing::GetK2SG(key1):\n");
901 printf(" key1=%i is out of range [1..900]\n",key1);
904 if ( key2<1 || key2>100 ) {
905 printf("ERROR in THijing::GetK2SG(key1,key2):\n");
906 printf(" key2=%i is out of range [1..100]\n",key2);
910 return HIJJET2.k2sg[key2-1][key1-1];
913 //______________________________________________________________________________
914 Float_t THijing::GetPXSG(Int_t key1, Int_t key2) const
916 if ( key1<1 || key1>900 ) {
917 printf("ERROR in THijing::GetPXSG(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::GetPXSG(key1,key2):\n");
923 printf(" key2=%i is out of range [1..100]\n",key2);
927 return HIJJET2.pxsg[key2-1][key1-1];
930 //______________________________________________________________________________
931 Float_t THijing::GetPYSG(Int_t key1, Int_t key2) const
933 if ( key1<1 || key1>900 ) {
934 printf("ERROR in THijing::GetPYSG(key1):\n");
935 printf(" key1=%i is out of range [1..900]\n",key1);
938 if ( key2<1 || key2>100 ) {
939 printf("ERROR in THijing::GetPYSG(key1,key2):\n");
940 printf(" key2=%i is out of range [1..100]\n",key2);
944 return HIJJET2.pysg[key2-1][key1-1];
947 //______________________________________________________________________________
948 Float_t THijing::GetPZSG(Int_t key1, Int_t key2) const
950 if ( key1<1 || key1>900 ) {
951 printf("ERROR in THijing::GetPZSG(key1):\n");
952 printf(" key1=%i is out of range [1..900]\n",key1);
955 if ( key2<1 || key2>100 ) {
956 printf("ERROR in THijing::GetPZSG(key1,key2):\n");
957 printf(" key2=%i is out of range [1..100]\n",key2);
961 return HIJJET2.pzsg[key2-1][key1-1];
964 //______________________________________________________________________________
965 Float_t THijing::GetPESG(Int_t key1, Int_t key2) const
967 if ( key1<1 || key1>900 ) {
968 printf("ERROR in THijing::GetPESG(key1):\n");
969 printf(" key1=%i is out of range [1..900]\n",key1);
972 if ( key2<1 || key2>100 ) {
973 printf("ERROR in THijing::GetPESG(key1,key2):\n");
974 printf(" key2=%i is out of range [1..100]\n",key2);
978 return HIJJET2.pesg[key2-1][key1-1];
981 //______________________________________________________________________________
982 Float_t THijing::GetPMSG(Int_t key1, Int_t key2) const
984 if ( key1<1 || key1>900 ) {
985 printf("ERROR in THijing::GetPMSG(key1):\n");
986 printf(" key1=%i is out of range [1..900]\n",key1);
989 if ( key2<1 || key2>100 ) {
990 printf("ERROR in THijing::GetPMSG(key1,key2):\n");
991 printf(" key2=%i is out of range [1..100]\n",key2);
995 return HIJJET2.pmsg[key2-1][key1-1];
998 //====================== access to common HISTRNG ===============================
1000 //______________________________________________________________________________
1001 Int_t THijing::GetNFP(Int_t key1, Int_t key2) const
1003 if ( key1<1 || key1>300 ) {
1004 printf("ERROR in THijing::GetNFP(key1):\n");
1005 printf(" key1=%i is out of range [1..300]\n",key1);
1008 if ( key2<1 || key2>15 ) {
1009 printf("ERROR in THijing::GetNFP(key1,key2):\n");
1010 printf(" key2=%i is out of range [1..15]\n",key2);
1014 return HISTRNG.nfp[key2-1][key1-1];
1017 //______________________________________________________________________________
1018 Float_t THijing::GetPP(Int_t key1, Int_t key2) const
1020 if ( key1<1 || key1>300 ) {
1021 printf("ERROR in THijing::GetPP(key1):\n");
1022 printf(" key1=%i is out of range [1..300]\n",key1);
1025 if ( key2<1 || key2>15 ) {
1026 printf("ERROR in THijing::GetPP(key1,key2):\n");
1027 printf(" key2=%i is out of range [1..15]\n",key2);
1031 return HISTRNG.pp[key2-1][key1-1];
1034 //______________________________________________________________________________
1035 Int_t THijing::GetNFT(Int_t key1, Int_t key2) const
1037 if ( key1<1 || key1>300 ) {
1038 printf("ERROR in THijing::GetNFT(key1):\n");
1039 printf(" key1=%i is out of range [1..300]\n",key1);
1042 if ( key2<1 || key2>15 ) {
1043 printf("ERROR in THijing::GetNFT(key1,key2):\n");
1044 printf(" key2=%i is out of range [1..15]\n",key2);
1048 return HISTRNG.nft[key2-1][key1-1];
1051 //______________________________________________________________________________
1052 Float_t THijing::GetPT(Int_t key1, Int_t key2) const
1054 if ( key1<1 || key1>300 ) {
1055 printf("ERROR in THijing::GetPT(key1):\n");
1056 printf(" key1=%i is out of range [1..300]\n",key1);
1059 if ( key2<1 || key2>15 ) {
1060 printf("ERROR in THijing::GetPT(key1,key2):\n");
1061 printf(" key2=%i is out of range [1..15]\n",key2);
1065 return HISTRNG.pt[key2-1][key1-1];
1070 //====================== access to Hijing subroutines =========================
1073 //______________________________________________________________________________
1074 void THijing::Initialize()
1076 //////////////////////////////////////////////////////////////////////////////////
1077 // Calls Hijset with the either default parameters or the ones set by the user //
1078 // via SetEFRM, SetFRAME, SetPROJ, SetTARG, SetIAP, SetIZP, SetIAT, SetIZT //
1079 //////////////////////////////////////////////////////////////////////////////////
1081 if ( (!strcmp(fFrame.Data(), "CMS " )) &&
1082 (!strcmp(fFrame.Data(), "LAB " ))){
1083 printf("WARNING! In THijing:Initialize():\n");
1084 printf(" specified frame=%s is neither CMS or LAB\n",fFrame.Data());
1085 printf(" resetting to default \"CMS\" .");
1089 if ( (!strcmp(fProj.Data(), "A " )) &&
1090 (!strcmp(fProj.Data(), "P " )) &&
1091 (!strcmp(fProj.Data(), "PBAR " ))){
1092 printf("WARNING! In THijing:Initialize():\n");
1093 printf(" specified projectile=%s is neither A, P or PBAR\n",fProj.Data());
1094 printf(" resetting to default \"A\" .");
1098 if ( (!strcmp(fTarg.Data(), "A " )) &&
1099 (!strcmp(fTarg.Data(), "P " )) &&
1100 (!strcmp(fTarg.Data(), "PBAR " ))){
1101 printf("WARNING! In THijing:Initialize():\n");
1102 printf(" specified target=%s is neither A, P or PBAR\n",fTarg.Data());
1103 printf(" resetting to default \"A\" .");
1107 printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1109 Hijset(fEfrm,fFrame.Data(),fProj.Data(),fTarg.Data(),fIap,fIzp,fIat,fIzt);
1111 printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
1115 //______________________________________________________________________________
1116 void THijing::GenerateEvent()
1118 // Generates one event;
1120 Hijing(fFrame.Data(),fBmin,fBmax);
1123 //______________________________________________________________________________
1124 void THijing::Hijset(float efrm, const char *frame, const char *proj,
1125 const char *targ, int iap, int izp, int iat, int izt)
1127 // Call HIJING routine HIJSET passing the parameters in a way accepted by
1130 int s1 = strlen(frame);
1131 int s2 = strlen(proj);
1132 int s3 = strlen(targ);
1133 printf("s1 = %d s2 = %d s3 = %d\n",s1,s2,s3);
1135 hijset(efrm, frame, proj, targ, iap, izp, iat, izt, s1, s2, s3);
1137 hijset(efrm, frame, s1, proj, s2, targ, s3, iap, izp, iat, izt);
1140 //______________________________________________________________________________
1141 void THijing::Hijing(const char *frame, float bmin, float bmax)
1143 // Call HIJING routine HIJSET passing the parameters in a way accepted by
1146 int s1 = strlen(frame);
1149 hijing(frame, bmin, bmax, s1);
1151 hijing(frame, s1, bmin, bmax);
1156 Float_t THijing::Profile(float b)
1158 // Call HIJING routine PROFILE
1163 void THijing::Rluget(Int_t lfn, Int_t move)
1165 // write seed to file
1166 rluget_hijing(lfn, move);
1170 void THijing::Rluset(Int_t lfn, Int_t move)
1172 // read seed from file
1173 rluset_hijing(lfn, move);