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