]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVGEN/AliGenHijing.cxx
Allow for triggered jets with simplified topology: Exact pT, back-to-back
[u/mrichter/AliRoot.git] / EVGEN / AliGenHijing.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /*
17 $Log$
18 Revision 1.35  2001/12/13 07:56:25  hristov
19 Set pointers to zero in the default constructor
20
21 Revision 1.34  2001/12/11 16:55:42  morsch
22 Correct initialization for jet phi-range.
23
24 Revision 1.33  2001/12/05 10:18:51  morsch
25 Possibility of kinematic biasing of jet phi range. (J. Klay)
26
27 Revision 1.32  2001/11/28 13:51:11  morsch
28 Introduce kinematic biasing (etamin, etamax) of jet trigger. Bookkeeping
29 (number of trials) done in AliGenHijingEventHeader.
30
31 Revision 1.31  2001/11/06 12:30:34  morsch
32 Add Boost() method to boost all particles to LHC lab frame. Needed for asymmetric collision systems.
33
34 Revision 1.30  2001/10/21 18:35:56  hristov
35 Several pointers were set to zero in the default constructors to avoid memory management problems
36
37 Revision 1.29  2001/10/15 08:12:24  morsch
38 - Vertex smearing with truncated gaussian.
39 - Store triggered jet info before and after final state radiation into mc-heade
40
41 Revision 1.28  2001/10/08 11:55:25  morsch
42 Store 4-momenta of trigegred jets in event header.
43 Possibility to switch of initial and final state radiation.
44
45 Revision 1.27  2001/10/08 07:13:14  morsch
46 Add setter for minimum transverse momentum of triggered jet.
47
48 Revision 1.26  2001/10/04 08:12:24  morsch
49 Redefinition of stable condition.
50
51 Revision 1.25  2001/07/27 17:09:36  morsch
52 Use local SetTrack, KeepTrack and SetHighWaterMark methods
53 to delegate either to local stack or to stack owned by AliRun.
54 (Piotr Skowronski, A.M.)
55
56 Revision 1.24  2001/07/20 09:34:56  morsch
57 Count the number of spectator neutrons and protons and add information
58 to the event header. (Chiara Oppedisano)
59
60 Revision 1.23  2001/07/13 17:30:22  morsch
61 Derive from AliGenMC.
62
63 Revision 1.22  2001/06/11 13:09:23  morsch
64 - Store cross-Section and number of binary collisions as a function of impact parameter
65 - Pass AliGenHijingEventHeader to gAlice.
66
67 Revision 1.21  2001/02/28 17:35:24  morsch
68 Consider elastic interactions (ks = 1 and ks = 11) as spectator (Chiara Oppedisano)
69
70 Revision 1.20  2001/02/14 15:50:40  hristov
71 The last particle in event marked using SetHighWaterMark
72
73 Revision 1.19  2000/12/21 16:24:06  morsch
74 Coding convention clean-up
75
76 Revision 1.18  2000/12/06 17:46:30  morsch
77 Avoid random numbers 1 and 0.
78
79 Revision 1.17  2000/12/04 11:22:03  morsch
80 Init of sRandom as in 1.15
81
82 Revision 1.16  2000/12/02 11:41:39  morsch
83 Use SetRandom() to initialize random number generator in constructor.
84
85 Revision 1.15  2000/11/30 20:29:02  morsch
86 Initialise static variable sRandom in constructor: sRandom = fRandom;
87
88 Revision 1.14  2000/11/30 07:12:50  alibrary
89 Introducing new Rndm and QA classes
90
91 Revision 1.13  2000/11/09 17:40:27  morsch
92 Possibility to select/unselect spectator protons and neutrons.
93 Method SetSpectators(Int_t spect) added. (FCA, Ch. Oppedisano)
94
95 Revision 1.12  2000/10/20 13:38:38  morsch
96 Debug printouts commented.
97
98 Revision 1.11  2000/10/20 13:22:26  morsch
99 - skip particle type 92 (string)
100 - Charmed and beauty baryions (5122, 4122) are considered as stable consistent with
101   mesons.
102
103 Revision 1.10  2000/10/17 15:10:20  morsch
104 Write first all the parent particles to the stack and then the final state particles.
105
106 Revision 1.9  2000/10/17 13:38:59  morsch
107 Protection against division by zero in EvaluateCrossSection() and KinematicSelection(..)     (FCA)
108
109 Revision 1.8  2000/10/17 12:46:31  morsch
110 Protect EvaluateCrossSections() against division by zero.
111
112 Revision 1.7  2000/10/02 21:28:06  fca
113 Removal of useless dependecies via forward declarations
114
115 Revision 1.6  2000/09/11 13:23:37  morsch
116 Write last seed to file (fortran lun 50) and reed back from same lun using calls to
117 luget_hijing and luset_hijing.
118
119 Revision 1.5  2000/09/07 16:55:40  morsch
120 fHijing->Initialize(); after change of parameters. (Dmitri Yurevitch Peressounko)
121
122 Revision 1.4  2000/07/11 18:24:56  fca
123 Coding convention corrections + few minor bug fixes
124
125 Revision 1.3  2000/06/30 12:08:36  morsch
126 In member data: char* replaced by TString, Init takes care of resizing the strings to
127 8 characters required by Hijing.
128
129 Revision 1.2  2000/06/15 14:15:05  morsch
130 Add possibility for heavy flavor selection: charm and beauty.
131
132 Revision 1.1  2000/06/09 20:47:27  morsch
133 AliGenerator interface class to HIJING using THijing (test version)
134
135 */
136
137
138
139 // Generator using HIJING as an external generator
140 // The main HIJING options are accessable for the user through this interface.
141 // Uses the THijing implementation of TGenerator.
142 //
143 // andreas.morsch@cern.ch
144
145 #include "AliGenHijing.h"
146 #include "AliGenHijingEventHeader.h"
147 #include "AliRun.h"
148 #include "AliPDG.h"
149
150 #include <TArrayI.h>
151 #include <TParticle.h>
152 #include <THijing.h>
153 #include <TGraph.h>
154 #include <TLorentzVector.h>
155
156
157  ClassImp(AliGenHijing)
158
159 AliGenHijing::AliGenHijing()
160                  :AliGenMC()
161 {
162 // Constructor
163   fHijing = 0;
164   fDsigmaDb = 0;
165   fDnDb = 0;
166 }
167
168 AliGenHijing::AliGenHijing(Int_t npart)
169     :AliGenMC(npart)
170 {
171 // Default PbPb collisions at 5. 5 TeV
172 //
173     SetEnergyCMS();
174     SetImpactParameterRange();
175     SetTarget();
176     SetProjectile();
177     SetBoostLHC();
178     SetJetEtaRange();
179     SetJetPhiRange();
180     
181     fKeep       =  0;
182     fQuench     =  1;
183     fShadowing  =  1;
184     fTrigger    =  0;
185     fDecaysOff  =  1;
186     fEvaluate   =  0;
187     fSelectAll  =  0;
188     fFlavor     =  0;
189     fSpectators =  1;
190     fDsigmaDb   =  0;
191     fDnDb       =  0;
192     fPtMinJet   = -2.5;         
193     fRadiation  =  1;
194     fEventVertex.Set(3);
195 //
196     SetSimpleJets();
197     
198 //
199 // Set random number generator   
200     sRandom = fRandom;
201     fHijing = 0;
202
203 }
204
205 AliGenHijing::AliGenHijing(const AliGenHijing & Hijing)
206 {
207 // copy constructor
208 }
209
210
211 AliGenHijing::~AliGenHijing()
212 {
213 // Destructor
214     if ( fDsigmaDb) delete  fDsigmaDb;  
215     if ( fDnDb)     delete  fDnDb;  
216 }
217
218 void AliGenHijing::Init()
219 {
220 // Initialisation
221     fFrame.Resize(8);
222     fTarget.Resize(8);
223     fProjectile.Resize(8);
224     
225     SetMC(new THijing(fEnergyCMS, fFrame, fProjectile, fTarget, 
226                       fAProjectile, fZProjectile, fATarget, fZTarget, 
227                       fMinImpactParam, fMaxImpactParam));
228
229     fHijing=(THijing*) fgMCEvGen;
230     fHijing->SetIHPR2(2,  fRadiation);
231     fHijing->SetIHPR2(3,  fTrigger);
232     fHijing->SetIHPR2(4,  fQuench);
233     fHijing->SetIHPR2(6,  fShadowing);
234     fHijing->SetIHPR2(12, fDecaysOff);    
235     fHijing->SetIHPR2(21, fKeep);
236     fHijing->SetHIPR1(10, fPtMinJet);   
237     fHijing->SetHIPR1(50, fSimpleJet);
238     fHijing->Initialize();
239 //
240     if (fEvaluate) EvaluateCrossSections();
241 //
242 //
243 //  Initialize random generator
244 }
245
246 void AliGenHijing::Generate()
247 {
248 // Generate one event
249
250   Float_t polar[3]    =   {0,0,0};
251   Float_t origin[3]   =   {0,0,0};
252   Float_t origin0[3]  =   {0,0,0};
253   Float_t p[3], random[6];
254   Float_t tof;
255
256   static TClonesArray *particles;
257 //  converts from mm/c to s
258   const Float_t kconv = 0.001/2.999792458e8;
259 //
260   Int_t nt  = 0;
261   Int_t jev = 0;
262   Int_t j, kf, ks, imo;
263   kf = 0;
264     
265   if(!particles) particles = new TClonesArray("TParticle",10000);
266     
267   fTrials = 0;
268   for (j = 0;j < 3; j++) origin0[j] = fOrigin[j];
269   if(fVertexSmear == kPerEvent) {
270       Float_t dv[3];
271       dv[2] = 1.e10;
272       while(TMath::Abs(dv[2]) > fCutVertexZ*fOsigma[2]) {
273           Rndm(random,6);
274           for (j=0; j < 3; j++) {
275               dv[j] = fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
276                   TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
277           }
278       }
279       for (j=0; j < 3; j++) origin0[j] += dv[j];
280   } else if (fVertexSmear == kPerTrack) {
281 //          fHijing->SetMSTP(151,0);
282       for (j = 0; j < 3; j++) {
283 //            fHijing->SetPARP(151+j, fOsigma[j]*10.);
284       }
285   }
286   while(1)
287   {
288 //    Generate one event
289 // --------------------------------------------------------------------------
290       fSpecn    = 0;  
291       fSpecp    = 0;
292 // --------------------------------------------------------------------------
293       fHijing->GenerateEvent();
294       fTrials++;
295       if (fTrigger != kNoTrigger) {
296           if (!CheckTrigger()) continue;
297       }
298
299       fHijing->ImportParticles(particles,"All");
300       if (fLHC) Boost(particles);
301       
302       
303       Int_t np = particles->GetEntriesFast();
304       printf("\n **************************************************%d\n",np);
305       Int_t nc = 0;
306       if (np == 0 ) continue;
307       Int_t i;
308       Int_t * newPos = new Int_t[np];
309
310       for (i = 0; i < np; i++) *(newPos+i) = i;
311 //      Get event vertex
312 //
313       TParticle *  iparticle = (TParticle *) particles->At(0);
314       fEventVertex[0] = origin0[0];
315       fEventVertex[1] = origin0[1];     
316       fEventVertex[2] = origin0[2];
317       
318 //
319 //      First write parent particles
320 //
321
322       for (i = 0; i < np; i++) {
323           iparticle       = (TParticle *) particles->At(i);
324 // Is this a parent particle ?
325           if (Stable(iparticle)) continue;
326 //
327         Bool_t  hasMother            =  (iparticle->GetFirstMother()   >=0);
328         Bool_t  selected             =  kTRUE;
329         Bool_t  hasSelectedDaughters =  kFALSE;
330             
331             
332         kf        = iparticle->GetPdgCode();
333         ks        = iparticle->GetStatusCode();
334         if (kf == 92) continue;
335             
336         if (!fSelectAll) selected = KinematicSelection(iparticle, 0)&&SelectFlavor(kf);
337         hasSelectedDaughters = DaughtersSelection(iparticle, particles);
338 //
339 // Put particle on the stack if it is either selected or it is the mother of at least one seleted particle
340 //
341         if (selected || hasSelectedDaughters) {
342             nc++;
343             p[0] = iparticle->Px();
344             p[1] = iparticle->Py();
345             p[2] = iparticle->Pz();
346             origin[0] = origin0[0]+iparticle->Vx()/10;
347             origin[1] = origin0[1]+iparticle->Vy()/10;
348             origin[2] = origin0[2]+iparticle->Vz()/10;
349             tof = kconv*iparticle->T();
350             imo = -1;
351             TParticle* mother = 0;
352             if (hasMother) {
353                 imo = iparticle->GetFirstMother();
354                 mother = (TParticle *) particles->At(imo);
355                 imo = (mother->GetPdgCode() != 92) ? imo =* (newPos+imo) : -1;
356                 
357             }
358 // Put particle on the stack ... 
359 //              printf("\n set track mother: %d %d %d %d %d %d ",i,imo, kf, nt+1, selected, hasSelectedDaughters);
360             
361             SetTrack(0,imo,kf,p,origin,polar, tof,kPPrimary,nt);
362 // ... and keep it there
363             KeepTrack(nt);
364 //
365             *(newPos+i)=nt;
366         } // selected
367       } // particle loop parents
368 //
369 // Now write the final state particles
370 //
371
372       for (i = 0; i<np; i++) {
373         TParticle *  iparticle       = (TParticle *) particles->At(i);
374 // Is this a final state particle ?
375         if (!Stable(iparticle)) continue;
376
377         Bool_t  hasMother            =  (iparticle->GetFirstMother()   >=0);
378         Bool_t  selected             =  kTRUE;
379         kf        = iparticle->GetPdgCode();
380         ks        = iparticle->GetStatusCode();
381 // --------------------------------------------------------------------------
382 // Count spectator neutrons and protons
383         if(ks == 0 || ks == 1 || ks == 10 || ks == 11){
384           if(kf == kNeutron) fSpecn += 1;
385           if(kf == kProton)  fSpecp += 1;
386         }
387 // --------------------------------------------------------------------------
388 //          
389         if (!fSelectAll) {
390             selected = KinematicSelection(iparticle,0)&&SelectFlavor(kf);
391             if (!fSpectators && selected) selected = (ks != 0 && ks != 1 && ks != 10
392                                                       && ks != 11);
393         }
394 //
395 // Put particle on the stack if selected
396 //
397         if (selected) {
398             nc++;
399             p[0] = iparticle->Px();
400             p[1] = iparticle->Py();
401             p[2] = iparticle->Pz();
402             origin[0] = origin0[0]+iparticle->Vx()/10;
403             origin[1] = origin0[1]+iparticle->Vy()/10;
404             origin[2] = origin0[2]+iparticle->Vz()/10;
405             tof = kconv*iparticle->T();
406             imo = -1;
407             TParticle* mother = 0;
408             if (hasMother) {
409                 imo = iparticle->GetFirstMother();
410                 mother = (TParticle *) particles->At(imo);
411                 imo = (mother->GetPdgCode() != 92) ? imo=*(newPos+imo) : -1;
412             }   
413 // Put particle on the stack
414             SetTrack(fTrackIt,imo,kf,p,origin,polar,
415                                                      tof,kPNoProcess,nt);
416             KeepTrack(nt);
417             *(newPos+i)=nt;
418         } // selected
419       } // particle loop final state
420  
421       delete[] newPos;
422
423       printf("\n I've put %i particles on the stack \n",nc);
424       if (nc > 0) {
425           jev += nc;
426           if (jev >= fNpart || fNpart == -1) {
427               fKineBias = Float_t(fNpart)/Float_t(fTrials);
428               printf("\n Trials: %i %i %i\n",fTrials, fNpart, jev);
429               break;
430           }
431       }
432   } // event loop
433   MakeHeader();
434   
435   SetHighWaterMark(nt);
436 }
437
438 void AliGenHijing::KeepFullEvent()
439 {
440     fKeep=1;
441 }
442
443 void AliGenHijing::EvaluateCrossSections()
444 {
445 //     Glauber Calculation of geometrical x-section
446 //
447     Float_t xTot       = 0.;          // barn
448     Float_t xTotHard   = 0.;          // barn 
449     Float_t xPart      = 0.;          // barn
450     Float_t xPartHard  = 0.;          // barn 
451     Float_t sigmaHard  = 0.1;         // mbarn
452     Float_t bMin       = 0.;
453     Float_t bMax       = fHijing->GetHIPR1(34)+fHijing->GetHIPR1(35);
454     const Float_t kdib = 0.2;
455     Int_t   kMax       = Int_t((bMax-bMin)/kdib)+1;
456
457
458     printf("\n Projectile Radius (fm): %f \n",fHijing->GetHIPR1(34));
459     printf("\n Target     Radius (fm): %f \n",fHijing->GetHIPR1(35));    
460     Int_t i;
461     Float_t oldvalue= 0.;
462
463     Float_t* b   = new Float_t[kMax];
464     Float_t* si1 = new Float_t[kMax];    
465     Float_t* si2 = new Float_t[kMax];    
466     
467     for (i = 0; i < kMax; i++)
468     {
469         Float_t xb  = bMin+i*kdib;
470         Float_t ov;
471         ov=fHijing->Profile(xb);
472         Float_t gb  =  2.*0.01*fHijing->GetHIPR1(40)*kdib*xb*(1.-TMath::Exp(-fHijing->GetHINT1(12)*ov));
473         Float_t gbh =  2.*0.01*fHijing->GetHIPR1(40)*kdib*xb*sigmaHard*ov;
474         xTot+=gb;
475         xTotHard += gbh;
476         if (xb > fMinImpactParam && xb < fMaxImpactParam)
477         {
478             xPart += gb;
479             xPartHard += gbh;
480         }
481         
482         if(oldvalue) if ((xTot-oldvalue)/oldvalue<0.0001) break;
483         oldvalue = xTot;
484         printf("\n Total cross section (barn): %d %f %f \n",i, xb, xTot);
485         printf("\n Hard  cross section (barn): %d %f %f \n\n",i, xb, xTotHard);
486         if (i>0) {
487             si1[i] = gb/kdib;
488             si2[i] = gbh/gb;
489             b[i]  = xb;
490         }
491     }
492
493     printf("\n Total cross section (barn): %f \n",xTot);
494     printf("\n Hard  cross section (barn): %f \n \n",xTotHard);
495     printf("\n Partial       cross section (barn): %f %f \n",xPart, xPart/xTot*100.);
496     printf("\n Partial  hard cross section (barn): %f %f \n",xPartHard, xPartHard/xTotHard*100.);
497
498 //  Store result as a graph
499     b[0] = 0;
500     si1[0] = 0;
501     si2[0]=si2[1];
502     
503     fDsigmaDb  = new TGraph(i, b, si1);
504     fDnDb      = new TGraph(i, b, si2);
505 }
506
507 Bool_t AliGenHijing::DaughtersSelection(TParticle* iparticle, TClonesArray* particles)
508 {
509 //
510 // Looks recursively if one of the daughters has been selected
511 //
512 //    printf("\n Consider daughters %d:",iparticle->GetPdgCode());
513     Int_t imin = -1;
514     Int_t imax = -1;
515     Int_t i;
516     Bool_t hasDaughters = (iparticle->GetFirstDaughter() >=0);
517     Bool_t selected = kFALSE;
518     if (hasDaughters) {
519         imin = iparticle->GetFirstDaughter();
520         imax = iparticle->GetLastDaughter();       
521         for (i = imin; i <= imax; i++){
522             TParticle *  jparticle = (TParticle *) particles->At(i);    
523             Int_t ip = jparticle->GetPdgCode();
524             if (KinematicSelection(jparticle,0)&&SelectFlavor(ip)) {
525                 selected=kTRUE; break;
526             }
527             if (DaughtersSelection(jparticle, particles)) {selected=kTRUE; break; }
528         }
529     } else {
530         return kFALSE;
531     }
532     return selected;
533 }
534
535
536 Bool_t AliGenHijing::SelectFlavor(Int_t pid)
537 {
538 // Select flavor of particle
539 // 0: all
540 // 4: charm and beauty
541 // 5: beauty
542     if (fFlavor == 0) return kTRUE;
543     
544     Int_t ifl = TMath::Abs(pid/100);
545     if (ifl > 10) ifl/=10;
546     return (fFlavor == ifl);
547 }
548
549 Bool_t AliGenHijing::Stable(TParticle*  particle)
550 {
551 // Return true for a stable particle
552 //
553     if (particle->GetFirstDaughter() < 0 )
554     {
555         return kTRUE;
556     } else {
557         return kFALSE;
558     }
559 }
560
561
562 void AliGenHijing::Boost(TClonesArray* particles)
563 {
564 //
565 // Boost cms into LHC lab frame
566 //
567     Double_t dy    = - 0.5 * TMath::Log(Double_t(fZProjectile) * Double_t(fATarget) / 
568                                       (Double_t(fZTarget)    * Double_t(fAProjectile)));
569     Double_t beta  = TMath::TanH(dy);
570     Double_t gamma = 1./TMath::Sqrt(1.-beta*beta);
571     Double_t gb    = gamma * beta;
572
573     printf("\n Boosting particles to lab frame %f %f %f", dy, beta, gamma);
574     
575     Int_t i;
576     Int_t np = particles->GetEntriesFast();
577     for (i = 0; i < np; i++) 
578     {
579         TParticle* iparticle = (TParticle*) particles->At(i);
580
581         Double_t e   = iparticle->Energy();
582         Double_t px  = iparticle->Px();
583         Double_t py  = iparticle->Py();
584         Double_t pz  = iparticle->Pz();
585
586         Double_t eb  = gamma * e -      gb * pz;
587         Double_t pzb =   -gb * e +   gamma * pz;
588
589         iparticle->SetMomentum(px, py, pzb, eb);
590     }
591 }
592
593
594 void AliGenHijing::MakeHeader()
595 {
596 // Builds the event header, to be called after each event
597     AliGenEventHeader* header = new AliGenHijingEventHeader("Hijing");
598     ((AliGenHijingEventHeader*) header)->SetNProduced(fHijing->GetNATT());
599     ((AliGenHijingEventHeader*) header)->SetImpactParameter(fHijing->GetHINT1(19));
600     ((AliGenHijingEventHeader*) header)->SetTotalEnergy(fHijing->GetEATT());
601     ((AliGenHijingEventHeader*) header)->SetHardScatters(fHijing->GetJATT());
602     ((AliGenHijingEventHeader*) header)->SetParticipants(fHijing->GetNP(), fHijing->GetNT());
603     ((AliGenHijingEventHeader*) header)->SetCollisions(fHijing->GetN0(),
604                                                        fHijing->GetN01(),
605                                                        fHijing->GetN10(),
606                                                        fHijing->GetN11());
607     ((AliGenHijingEventHeader*) header)->SetSpectators(fSpecn, fSpecp);
608
609 // 4-momentum vectors of the triggered jets.
610 //
611 // Before final state gluon radiation.
612     TLorentzVector* jet1 = new TLorentzVector(fHijing->GetHINT1(21), 
613                                               fHijing->GetHINT1(22),
614                                               fHijing->GetHINT1(23),
615                                               fHijing->GetHINT1(24));
616
617     TLorentzVector* jet2 = new TLorentzVector(fHijing->GetHINT1(31), 
618                                               fHijing->GetHINT1(32),
619                                               fHijing->GetHINT1(33),
620                                               fHijing->GetHINT1(34));
621 // After final state gluon radiation.
622     TLorentzVector* jet3 = new TLorentzVector(fHijing->GetHINT1(26), 
623                                               fHijing->GetHINT1(27),
624                                               fHijing->GetHINT1(28),
625                                               fHijing->GetHINT1(29));
626
627     TLorentzVector* jet4 = new TLorentzVector(fHijing->GetHINT1(36), 
628                                               fHijing->GetHINT1(37),
629                                               fHijing->GetHINT1(38),
630                                               fHijing->GetHINT1(39));
631     ((AliGenHijingEventHeader*) header)->SetJets(jet1, jet2, jet3, jet4);
632 // Bookkeeping for kinematic bias
633     ((AliGenHijingEventHeader*) header)->SetTrials(fTrials);
634 // Event Vertex
635     header->SetPrimaryVertex(fEventVertex);
636     gAlice->SetGenEventHeader(header);    
637 }
638
639 Bool_t AliGenHijing::CheckTrigger()
640 {
641 // Check the kinematic trigger condition
642 // 
643     TLorentzVector* jet1 = new TLorentzVector(fHijing->GetHINT1(26), 
644                                               fHijing->GetHINT1(27),
645                                               fHijing->GetHINT1(28),
646                                               fHijing->GetHINT1(29));
647
648     TLorentzVector* jet2 = new TLorentzVector(fHijing->GetHINT1(36), 
649                                               fHijing->GetHINT1(37),
650                                               fHijing->GetHINT1(38),
651                                               fHijing->GetHINT1(39));
652     Double_t eta1      = jet1->Eta();
653     Double_t eta2      = jet2->Eta();
654     Double_t phi1      = jet1->Phi();
655     Double_t phi2      = jet2->Phi();
656     Bool_t   triggered = kFALSE;
657     //Check eta range first...    
658     if ((eta1 < fEtaMaxJet && eta1 > fEtaMinJet) ||
659         (eta2 < fEtaMaxJet && eta2 > fEtaMinJet))
660     {
661         //Eta is okay, now check phi range
662         if ((phi1 < fPhiMaxJet && phi1 > fPhiMinJet) ||
663             (phi2 < fPhiMaxJet && phi2 > fPhiMinJet))
664         {
665             triggered = kTRUE;
666         }
667     }
668     return triggered;
669 }
670
671
672
673
674 AliGenHijing& AliGenHijing::operator=(const  AliGenHijing& rhs)
675 {
676 // Assignment operator
677     return *this;
678 }
679
680 #ifndef WIN32
681 # define rluget_hijing rluget_hijing_
682 # define rluset_hijing rluset_hijing_
683 # define rlu_hijing    rlu_hijing_
684 # define type_of_call
685 #else
686 # define rluget_hijing RLUGET_HIJING
687 # define rluset_hijing RLUSET_HIJING
688 # define rlu_hijing    RLU_HIJING
689 # define type_of_call _stdcall
690 #endif
691
692
693 extern "C" {
694   void type_of_call rluget_hijing(Int_t & /*lfn*/, Int_t & /*move*/)
695   {printf("Dummy version of rluget_hijing reached\n");}
696
697   void type_of_call rluset_hijing(Int_t & /*lfn*/, Int_t & /*move*/)
698   {printf("Dummy version of rluset_hijing reached\n");}
699
700   Double_t type_of_call rlu_hijing(Int_t & /*idum*/) 
701   {
702       Float_t r;
703       do r=sRandom->Rndm(); while(0 >= r || r >= 1);
704       return r;
705   }
706 }