changes to include AliPerformanceMach component (Michael Knichel)
[u/mrichter/AliRoot.git] / THijing / AliGenHijing.cxx
CommitLineData
36b81802 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
7cdba479 16/* $Id$ */
36b81802 17
18// Generator using HIJING as an external generator
19// The main HIJING options are accessable for the user through this interface.
20// Uses the THijing implementation of TGenerator.
14cae7e9 21// Author:
22// Andreas Morsch (andreas.morsch@cern.ch)
36b81802 23//
36b81802 24
3010c308 25#include <TClonesArray.h>
36b81802 26#include <TGraph.h>
27#include <THijing.h>
28#include <TLorentzVector.h>
29#include <TPDGCode.h>
30#include <TParticle.h>
31
32#include "AliGenHijing.h"
33#include "AliGenHijingEventHeader.h"
7cdba479 34#include "AliHijingRndm.h"
3f4e7ad8 35#include "AliLog.h"
36#include "AliRun.h"
36b81802 37
7cdba479 38ClassImp(AliGenHijing)
36b81802 39
40AliGenHijing::AliGenHijing()
9d89c88d 41 :AliGenMC(),
42 fFrame("CMS"),
43 fMinImpactParam(0.),
44 fMaxImpactParam(5.),
45 fKeep(0),
46 fQuench(1),
47 fShadowing(1),
48 fDecaysOff(1),
49 fTrigger(0),
50 fEvaluate(0),
51 fSelectAll(0),
52 fFlavor(0),
9d89c88d 53 fKineBias(0.),
54 fTrials(0),
55 fXsection(0.),
56 fHijing(0),
5bfd0cb7 57 fPtHardMin(2.0),
58 fPtHardMax(-1),
9d89c88d 59 fSpectators(1),
60 fDsigmaDb(0),
61 fDnDb(0),
62 fPtMinJet(-2.5),
63 fEtaMinJet(-20.),
64 fEtaMaxJet(+20.),
65 fPhiMinJet(0.),
66 fPhiMaxJet(2. * TMath::Pi()),
67 fRadiation(3),
68 fSimpleJet(kFALSE),
69 fNoGammas(kFALSE),
70 fProjectileSpecn(0),
71 fProjectileSpecp(0),
72 fTargetSpecn(0),
73 fTargetSpecp(0),
74 fLHC(kFALSE),
75 fRandomPz(kFALSE),
d07f0af2 76 fNoHeavyQuarks(kFALSE),
68f18c58 77 fEventTime(0.),
f2f240a9 78 fHeader(AliGenHijingEventHeader("Hijing"))
36b81802 79{
fc7e1b1c 80 // Constructor
e7c989e4 81 fEnergyCMS = 5500.;
fc7e1b1c 82 AliHijingRndm::SetHijingRandom(GetRandom());
36b81802 83}
84
85AliGenHijing::AliGenHijing(Int_t npart)
9d89c88d 86 :AliGenMC(npart),
87 fFrame("CMS"),
88 fMinImpactParam(0.),
89 fMaxImpactParam(5.),
90 fKeep(0),
91 fQuench(1),
92 fShadowing(1),
93 fDecaysOff(1),
94 fTrigger(0),
95 fEvaluate(0),
96 fSelectAll(0),
97 fFlavor(0),
9d89c88d 98 fKineBias(0.),
99 fTrials(0),
100 fXsection(0.),
101 fHijing(0),
5bfd0cb7 102 fPtHardMin(2.0),
103 fPtHardMax(-1),
9d89c88d 104 fSpectators(1),
105 fDsigmaDb(0),
106 fDnDb(0),
107 fPtMinJet(-2.5),
108 fEtaMinJet(-20.),
109 fEtaMaxJet(+20.),
110 fPhiMinJet(0.),
111 fPhiMaxJet(2. * TMath::Pi()),
112 fRadiation(3),
113 fSimpleJet(kFALSE),
114 fNoGammas(kFALSE),
115 fProjectileSpecn(0),
116 fProjectileSpecp(0),
117 fTargetSpecn(0),
118 fTargetSpecp(0),
119 fLHC(kFALSE),
120 fRandomPz(kFALSE),
d07f0af2 121 fNoHeavyQuarks(kFALSE),
68f18c58 122 fEventTime(0.),
f2f240a9 123 fHeader(AliGenHijingEventHeader("Hijing"))
36b81802 124{
125// Default PbPb collisions at 5. 5 TeV
126//
e7c989e4 127 fEnergyCMS = 5500.;
36b81802 128 fName = "Hijing";
129 fTitle= "Particle Generator using HIJING";
36b81802 130//
36b81802 131//
132// Set random number generator
7cdba479 133 AliHijingRndm::SetHijingRandom(GetRandom());
f2f240a9 134
36b81802 135}
136
36b81802 137AliGenHijing::~AliGenHijing()
138{
139// Destructor
140 if ( fDsigmaDb) delete fDsigmaDb;
141 if ( fDnDb) delete fDnDb;
36b81802 142}
143
144void AliGenHijing::Init()
145{
146// Initialisation
9071ae63 147 fFrame.Resize(8);
148 fTarget.Resize(8);
149 fProjectile.Resize(8);
36b81802 150
151 SetMC(new THijing(fEnergyCMS, fFrame, fProjectile, fTarget,
152 fAProjectile, fZProjectile, fATarget, fZTarget,
153 fMinImpactParam, fMaxImpactParam));
154
b88f5cea 155 fHijing=(THijing*) fMCEvGen;
36b81802 156 fHijing->SetIHPR2(2, fRadiation);
157 fHijing->SetIHPR2(3, fTrigger);
158 fHijing->SetIHPR2(6, fShadowing);
159 fHijing->SetIHPR2(12, fDecaysOff);
160 fHijing->SetIHPR2(21, fKeep);
5bfd0cb7 161 fHijing->SetHIPR1(8, fPtHardMin);
162 fHijing->SetHIPR1(9, fPtHardMax);
36b81802 163 fHijing->SetHIPR1(10, fPtMinJet);
164 fHijing->SetHIPR1(50, fSimpleJet);
165//
166// Quenching
167//
168//
169// fQuench = 0: no quenching
170// fQuench = 1: hijing default
171// fQuench = 2: new LHC parameters for HIPR1(11) and HIPR1(14)
172// fQuench = 3: new RHIC parameters for HIPR1(11) and HIPR1(14)
173// fQuench = 4: new LHC parameters with log(e) dependence
174// fQuench = 5: new RHIC parameters with log(e) dependence
175 fHijing->SetIHPR2(50, 0);
176 if (fQuench > 0)
177 fHijing->SetIHPR2(4, 1);
178 else
179 fHijing->SetIHPR2(4, 0);
180// New LHC parameters from Xin-Nian Wang
181 if (fQuench == 2) {
182 fHijing->SetHIPR1(14, 1.1);
183 fHijing->SetHIPR1(11, 3.7);
184 } else if (fQuench == 3) {
185 fHijing->SetHIPR1(14, 0.20);
186 fHijing->SetHIPR1(11, 2.5);
187 } else if (fQuench == 4) {
188 fHijing->SetIHPR2(50, 1);
189 fHijing->SetHIPR1(14, 4.*0.34);
190 fHijing->SetHIPR1(11, 3.7);
191 } else if (fQuench == 5) {
192 fHijing->SetIHPR2(50, 1);
193 fHijing->SetHIPR1(14, 0.34);
194 fHijing->SetHIPR1(11, 2.5);
195 }
196
f82795ff 197//
198// Heavy quarks
199//
200 if (fNoHeavyQuarks) {
201 fHijing->SetIHPR2(49, 1);
202 } else {
203 fHijing->SetIHPR2(49, 0);
204 }
205
36b81802 206
cc463e4a 207 AliGenMC::Init();
36b81802 208
209//
210// Initialize Hijing
211//
212 fHijing->Initialize();
213//
214 if (fEvaluate) EvaluateCrossSections();
215//
216}
217
218void AliGenHijing::Generate()
219{
220// Generate one event
221
222 Float_t polar[3] = {0,0,0};
223 Float_t origin[3] = {0,0,0};
224 Float_t origin0[3] = {0,0,0};
0c0c6204 225 Float_t p[3];
36b81802 226 Float_t tof;
227
228// converts from mm/c to s
14bca1e5 229 const Float_t kconv = 0.001/2.99792458e8;
36b81802 230//
231 Int_t nt = 0;
232 Int_t jev = 0;
2d677e30 233 Int_t j, kf, ks, ksp, imo;
36b81802 234 kf = 0;
235
236
237
238 fTrials = 0;
e60d2969 239
36b81802 240 for (j = 0;j < 3; j++) origin0[j] = fOrigin[j];
16a37f16 241
36b81802 242 if(fVertexSmear == kPerEvent) {
0c0c6204 243 Vertex();
244 for (j=0; j < 3; j++) origin0[j] = fVertex[j];
245 }
246
b25b821e 247
248 Float_t sign = (fRandomPz && (Rndm() < 0.5))? -1. : 1.;
16a37f16 249
36b81802 250 while(1)
251 {
252// Generate one event
253// --------------------------------------------------------------------------
f0c86dd6 254 fProjectileSpecn = 0;
255 fProjectileSpecp = 0;
b25b821e 256 fTargetSpecn = 0;
257 fTargetSpecp = 0;
36b81802 258// --------------------------------------------------------------------------
259 fHijing->GenerateEvent();
260 fTrials++;
e60d2969 261 fNprimaries = 0;
8507138f 262 fHijing->ImportParticles(&fParticles,"All");
36b81802 263 if (fTrigger != kNoTrigger) {
264 if (!CheckTrigger()) continue;
265 }
71ea527c 266 if (fLHC) Boost();
36b81802 267
268
8507138f 269 Int_t np = fParticles.GetEntriesFast();
36b81802 270 Int_t nc = 0;
271 if (np == 0 ) continue;
272 Int_t i;
273 Int_t* newPos = new Int_t[np];
274 Int_t* pSelected = new Int_t[np];
275
276 for (i = 0; i < np; i++) {
277 newPos[i] = i;
278 pSelected[i] = 0;
279 }
280
281// Get event vertex
282//
0c0c6204 283 fVertex[0] = origin0[0];
284 fVertex[1] = origin0[1];
285 fVertex[2] = origin0[2];
36b81802 286
287//
288// First select parent particles
289//
8f64c44f 290 TParticle * iparticle = 0;
36b81802 291 for (i = 0; i < np; i++) {
8507138f 292 iparticle = (TParticle *) fParticles.At(i);
36b81802 293
294// Is this a parent particle ?
295 if (Stable(iparticle)) continue;
296//
297 Bool_t selected = kTRUE;
298 Bool_t hasSelectedDaughters = kFALSE;
299
300
301 kf = iparticle->GetPdgCode();
302 ks = iparticle->GetStatusCode();
303 if (kf == 92) continue;
304
305 if (!fSelectAll) selected = KinematicSelection(iparticle, 0) &&
306 SelectFlavor(kf);
307 hasSelectedDaughters = DaughtersSelection(iparticle);
308//
309// Put particle on the stack if it is either selected or
310// it is the mother of at least one seleted particle
311//
312 if (selected || hasSelectedDaughters) {
313 nc++;
314 pSelected[i] = 1;
315 } // selected
316 } // particle loop parents
317//
318// Now select the final state particles
319//
320
321 for (i = 0; i<np; i++) {
c4998efa 322 iparticle = (TParticle *) fParticles.At(i);
36b81802 323// Is this a final state particle ?
324 if (!Stable(iparticle)) continue;
325
326 Bool_t selected = kTRUE;
327 kf = iparticle->GetPdgCode();
328 ks = iparticle->GetStatusCode();
2d677e30 329 ksp = iparticle->GetUniqueID();
36b81802 330
331// --------------------------------------------------------------------------
332// Count spectator neutrons and protons
2d677e30 333 if(ksp == 0 || ksp == 1){
f0c86dd6 334 if(kf == kNeutron) fProjectileSpecn += 1;
335 if(kf == kProton) fProjectileSpecp += 1;
336 }
2d677e30 337 else if(ksp == 10 || ksp == 11){
f0c86dd6 338 if(kf == kNeutron) fTargetSpecn += 1;
339 if(kf == kProton) fTargetSpecp += 1;
36b81802 340 }
341// --------------------------------------------------------------------------
342//
343 if (!fSelectAll) {
344 selected = KinematicSelection(iparticle,0)&&SelectFlavor(kf);
2d677e30 345 if (!fSpectators && selected) selected = (ksp != 0 && ksp != 1 && ksp != 10
346 && ksp != 11);
36b81802 347 }
348//
349// Put particle on the stack if selected
350//
351 if (selected) {
352 nc++;
353 pSelected[i] = 1;
354 } // selected
355 } // particle loop final state
3439da17 356
36b81802 357//
3439da17 358// Time of the interactions
359 Float_t tInt = 0.;
360 if (fPileUpTimeWindow > 0.) tInt = fPileUpTimeWindow * (2. * gRandom->Rndm() - 1.);
361
36b81802 362//
3439da17 363// Write particles to stack
364
36b81802 365 for (i = 0; i<np; i++) {
c4998efa 366 iparticle = (TParticle *) fParticles.At(i);
36b81802 367 Bool_t hasMother = (iparticle->GetFirstMother() >=0);
368 Bool_t hasDaughter = (iparticle->GetFirstDaughter() >=0);
36b81802 369 if (pSelected[i]) {
370 kf = iparticle->GetPdgCode();
371 ks = iparticle->GetStatusCode();
372 p[0] = iparticle->Px();
373 p[1] = iparticle->Py();
b25b821e 374 p[2] = iparticle->Pz() * sign;
36b81802 375 origin[0] = origin0[0]+iparticle->Vx()/10;
376 origin[1] = origin0[1]+iparticle->Vy()/10;
377 origin[2] = origin0[2]+iparticle->Vz()/10;
d07f0af2 378 fEventTime = 0.;
379
16a37f16 380 if (TestBit(kVertexRange)) {
d07f0af2 381 fEventTime = sign * origin0[2] / 2.99792458e10;
382 tof = kconv * iparticle->T() + fEventTime;
16a37f16 383 } else {
384 tof = kconv * iparticle->T();
d07f0af2 385 fEventTime = tInt;
16a37f16 386 if (fPileUpTimeWindow > 0.) tof += tInt;
387 }
36b81802 388 imo = -1;
389 TParticle* mother = 0;
390 if (hasMother) {
391 imo = iparticle->GetFirstMother();
8507138f 392 mother = (TParticle *) fParticles.At(imo);
e57522c0 393 imo = (mother->GetPdgCode() != 92) ? newPos[imo] : -1;
36b81802 394 } // if has mother
395 Bool_t tFlag = (fTrackIt && !hasDaughter);
3439da17 396 PushTrack(tFlag,imo,kf,p,origin,polar,tof,kPNoProcess,nt, 1., ks);
e60d2969 397 fNprimaries++;
36b81802 398 KeepTrack(nt);
399 newPos[i] = nt;
400 } // if selected
401 } // particle loop
402 delete[] newPos;
403 delete[] pSelected;
404
3f4e7ad8 405 AliInfo(Form("\n I've put %i particles on the stack \n",nc));
36b81802 406 if (nc > 0) {
407 jev += nc;
408 if (jev >= fNpart || fNpart == -1) {
409 fKineBias = Float_t(fNpart)/Float_t(fTrials);
3f4e7ad8 410 AliInfo(Form("\n Trials: %i %i %i\n",fTrials, fNpart, jev));
36b81802 411 break;
412 }
413 }
414 } // event loop
415 MakeHeader();
416 SetHighWaterMark(nt);
417}
418
419void AliGenHijing::KeepFullEvent()
420{
421 fKeep=1;
422}
423
424void AliGenHijing::EvaluateCrossSections()
425{
426// Glauber Calculation of geometrical x-section
427//
428 Float_t xTot = 0.; // barn
429 Float_t xTotHard = 0.; // barn
430 Float_t xPart = 0.; // barn
431 Float_t xPartHard = 0.; // barn
432 Float_t sigmaHard = 0.1; // mbarn
433 Float_t bMin = 0.;
434 Float_t bMax = fHijing->GetHIPR1(34)+fHijing->GetHIPR1(35);
435 const Float_t kdib = 0.2;
436 Int_t kMax = Int_t((bMax-bMin)/kdib)+1;
437
438
439 printf("\n Projectile Radius (fm): %f \n",fHijing->GetHIPR1(34));
440 printf("\n Target Radius (fm): %f \n",fHijing->GetHIPR1(35));
441 Int_t i;
442 Float_t oldvalue= 0.;
443
444 Float_t* b = new Float_t[kMax];
445 Float_t* si1 = new Float_t[kMax];
446 Float_t* si2 = new Float_t[kMax];
8f64c44f 447 for (i = 0; i < kMax; i++){
448 b[i] = 0.;
449 si1[i] = 0.;
450 si2[i] = 0.;
451 }
452
36b81802 453 for (i = 0; i < kMax; i++)
454 {
455 Float_t xb = bMin+i*kdib;
456 Float_t ov;
457 ov=fHijing->Profile(xb);
458 Float_t gb = 2.*0.01*fHijing->GetHIPR1(40)*kdib*xb*(1.-TMath::Exp(-fHijing->GetHINT1(12)*ov));
459 Float_t gbh = 2.*0.01*fHijing->GetHIPR1(40)*kdib*xb*sigmaHard*ov;
460 xTot+=gb;
461 xTotHard += gbh;
462 printf("profile %f %f %f\n", xb, ov, fHijing->GetHINT1(12));
463
464 if (xb > fMinImpactParam && xb < fMaxImpactParam)
465 {
466 xPart += gb;
467 xPartHard += gbh;
468 }
469
470 if(oldvalue) if ((xTot-oldvalue)/oldvalue<0.0001) break;
471 oldvalue = xTot;
472 printf("\n Total cross section (barn): %d %f %f \n",i, xb, xTot);
473 printf("\n Hard cross section (barn): %d %f %f \n\n",i, xb, xTotHard);
474 if (i>0) {
475 si1[i] = gb/kdib;
476 si2[i] = gbh/gb;
477 b[i] = xb;
478 }
479 }
480
481 printf("\n Total cross section (barn): %f \n",xTot);
482 printf("\n Hard cross section (barn): %f \n \n",xTotHard);
483 printf("\n Partial cross section (barn): %f %f \n",xPart, xPart/xTot*100.);
484 printf("\n Partial hard cross section (barn): %f %f \n",xPartHard, xPartHard/xTotHard*100.);
485
486// Store result as a graph
487 b[0] = 0;
488 si1[0] = 0;
489 si2[0]=si2[1];
490
491 fDsigmaDb = new TGraph(i, b, si1);
492 fDnDb = new TGraph(i, b, si2);
493}
494
495Bool_t AliGenHijing::DaughtersSelection(TParticle* iparticle)
496{
497//
498// Looks recursively if one of the daughters has been selected
499//
500// printf("\n Consider daughters %d:",iparticle->GetPdgCode());
501 Int_t imin = -1;
502 Int_t imax = -1;
503 Int_t i;
504 Bool_t hasDaughters = (iparticle->GetFirstDaughter() >=0);
505 Bool_t selected = kFALSE;
506 if (hasDaughters) {
507 imin = iparticle->GetFirstDaughter();
508 imax = iparticle->GetLastDaughter();
509 for (i = imin; i <= imax; i++){
8507138f 510 TParticle * jparticle = (TParticle *) fParticles.At(i);
36b81802 511 Int_t ip = jparticle->GetPdgCode();
512 if (KinematicSelection(jparticle,0)&&SelectFlavor(ip)) {
513 selected=kTRUE; break;
514 }
515 if (DaughtersSelection(jparticle)) {selected=kTRUE; break; }
516 }
517 } else {
518 return kFALSE;
519 }
520 return selected;
521}
522
523
524Bool_t AliGenHijing::SelectFlavor(Int_t pid)
525{
526// Select flavor of particle
527// 0: all
528// 4: charm and beauty
529// 5: beauty
530 Bool_t res = 0;
531
532 if (fFlavor == 0) {
533 res = kTRUE;
534 } else {
535 Int_t ifl = TMath::Abs(pid/100);
536 if (ifl > 10) ifl/=10;
537 res = (fFlavor == ifl);
538 }
539//
540// This part if gamma writing is inhibited
541 if (fNoGammas)
542 res = res && (pid != kGamma && pid != kPi0);
543//
544 return res;
545}
546
14cae7e9 547Bool_t AliGenHijing::Stable(TParticle* particle) const
36b81802 548{
549// Return true for a stable particle
550//
551
552 if (particle->GetFirstDaughter() < 0 )
553 {
554 return kTRUE;
555 } else {
556 return kFALSE;
557 }
558}
559
560
36b81802 561
562void AliGenHijing::MakeHeader()
563{
564// Builds the event header, to be called after each event
f2f240a9 565 fHeader.SetNProduced(fNprimaries);
566 fHeader.SetImpactParameter(fHijing->GetHINT1(19));
567 fHeader.SetTotalEnergy(fHijing->GetEATT());
568 fHeader.SetHardScatters(fHijing->GetJATT());
569 fHeader.SetParticipants(fHijing->GetNP(), fHijing->GetNT());
570 fHeader.SetCollisions(fHijing->GetN0(),
571 fHijing->GetN01(),
572 fHijing->GetN10(),
573 fHijing->GetN11());
574 fHeader.SetSpectators(fProjectileSpecn, fProjectileSpecp,
575 fTargetSpecn,fTargetSpecp);
576 fHeader.SetReactionPlaneAngle(fHijing->GetHINT1(20));
36b81802 577
578// 4-momentum vectors of the triggered jets.
579//
580// Before final state gluon radiation.
581 TLorentzVector* jet1 = new TLorentzVector(fHijing->GetHINT1(21),
582 fHijing->GetHINT1(22),
583 fHijing->GetHINT1(23),
584 fHijing->GetHINT1(24));
585
586 TLorentzVector* jet2 = new TLorentzVector(fHijing->GetHINT1(31),
587 fHijing->GetHINT1(32),
588 fHijing->GetHINT1(33),
589 fHijing->GetHINT1(34));
590// After final state gluon radiation.
591 TLorentzVector* jet3 = new TLorentzVector(fHijing->GetHINT1(26),
592 fHijing->GetHINT1(27),
593 fHijing->GetHINT1(28),
594 fHijing->GetHINT1(29));
595
596 TLorentzVector* jet4 = new TLorentzVector(fHijing->GetHINT1(36),
597 fHijing->GetHINT1(37),
598 fHijing->GetHINT1(38),
599 fHijing->GetHINT1(39));
f2f240a9 600 fHeader.SetJets(jet1, jet2, jet3, jet4);
36b81802 601// Bookkeeping for kinematic bias
f2f240a9 602 fHeader.SetTrials(fTrials);
36b81802 603// Event Vertex
f2f240a9 604 fHeader.SetPrimaryVertex(fVertex);
605 fHeader.SetInteractionTime(fEventTime);
606 AddHeader(&fHeader);
607 fCollisionGeometry = &fHeader;
36b81802 608}
609
cf57b268 610
36b81802 611Bool_t AliGenHijing::CheckTrigger()
612{
613// Check the kinematic trigger condition
614//
615 Bool_t triggered = kFALSE;
616
617 if (fTrigger == 1) {
618//
619// jet-jet Trigger
620
621 TLorentzVector* jet1 = new TLorentzVector(fHijing->GetHINT1(26),
622 fHijing->GetHINT1(27),
623 fHijing->GetHINT1(28),
624 fHijing->GetHINT1(29));
625
626 TLorentzVector* jet2 = new TLorentzVector(fHijing->GetHINT1(36),
627 fHijing->GetHINT1(37),
628 fHijing->GetHINT1(38),
629 fHijing->GetHINT1(39));
630 Double_t eta1 = jet1->Eta();
631 Double_t eta2 = jet2->Eta();
632 Double_t phi1 = jet1->Phi();
633 Double_t phi2 = jet2->Phi();
634// printf("\n Trigger: %f %f %f %f",
635// fEtaMinJet, fEtaMaxJet, fPhiMinJet, fPhiMaxJet);
636 if (
637 (eta1 < fEtaMaxJet && eta1 > fEtaMinJet &&
638 phi1 < fPhiMaxJet && phi1 > fPhiMinJet)
639 ||
640 (eta2 < fEtaMaxJet && eta2 > fEtaMinJet &&
641 phi2 < fPhiMaxJet && phi2 > fPhiMinJet)
642 )
643 triggered = kTRUE;
644 } else if (fTrigger == 2) {
645// Gamma Jet
646//
8507138f 647 Int_t np = fParticles.GetEntriesFast();
36b81802 648 for (Int_t i = 0; i < np; i++) {
8507138f 649 TParticle* part = (TParticle*) fParticles.At(i);
36b81802 650 Int_t kf = part->GetPdgCode();
2d677e30 651 Int_t ksp = part->GetUniqueID();
652 if (kf == 22 && ksp == 40) {
36b81802 653 Float_t phi = part->Phi();
654 Float_t eta = part->Eta();
655 if (eta < fEtaMaxJet &&
656 eta > fEtaMinJet &&
657 phi < fPhiMaxJet &&
658 phi > fPhiMinJet) {
659 triggered = 1;
660 break;
661 } // check phi,eta within limits
662 } // direct gamma ?
663 } // particle loop
664 } // fTrigger == 2
665 return triggered;
666}