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