]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PYTHIA6/AliPythia.cxx
EffC++ warnings corrected.
[u/mrichter/AliRoot.git] / PYTHIA6 / AliPythia.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 #include "AliPythia.h"
19 #include "AliPythiaRndm.h"
20 #include "../FASTSIM/AliFastGlauber.h"
21 #include "../FASTSIM/AliQuenchingWeights.h"
22 #include "TVector3.h"
23
24 ClassImp(AliPythia)
25
26 #ifndef WIN32
27 # define pyclus pyclus_
28 # define pycell pycell_
29 # define pyshow pyshow_
30 # define pyrobo pyrobo_
31 # define pyquen pyquen_
32 # define pyevnw pyevnw_
33 # define type_of_call
34 #else
35 # define pyclus PYCLUS
36 # define pycell PYCELL
37 # define pyrobo PYROBO
38 # define pyquen PYQUEN
39 # define pyevnw PYEVNW
40 # define type_of_call _stdcall
41 #endif
42
43 extern "C" void type_of_call pyclus(Int_t & );
44 extern "C" void type_of_call pycell(Int_t & );
45 extern "C" void type_of_call pyshow(Int_t &, Int_t &, Double_t &);
46 extern "C" void type_of_call pyrobo(Int_t &, Int_t &, Double_t &, Double_t &, Double_t &, Double_t &, Double_t &);
47 extern "C" void type_of_call pyquen(Double_t &, Int_t &, Double_t &);
48 extern "C" void type_of_call pyevnw(){;}
49
50 //_____________________________________________________________________________
51
52 AliPythia* AliPythia::fgAliPythia=NULL;
53
54 AliPythia::AliPythia():
55     fProcess(kPyMb),
56     fEcms(0.),
57     fStrucFunc(kCTEQ5L),
58     fXJet(0.),
59     fYJet(0.),
60     fGlauber(0),
61     fQuenchingWeights(0)
62 {
63 // Default Constructor
64 //
65 //  Set random number
66     if (!AliPythiaRndm::GetPythiaRandom()) 
67       AliPythiaRndm::SetPythiaRandom(GetRandom());
68     fGlauber          = 0;
69     fQuenchingWeights = 0;
70 }
71
72 AliPythia::AliPythia(const AliPythia& pythia):
73     fProcess(kPyMb),
74     fEcms(0.),
75     fStrucFunc(kCTEQ5L),
76     fXJet(0.),
77     fYJet(0.),
78     fGlauber(0),
79     fQuenchingWeights(0)
80 {
81     // Copy Constructor
82     pythia.Copy(*this);
83 }
84
85 void AliPythia::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfunc)
86 {
87 // Initialise the process to generate 
88     if (!AliPythiaRndm::GetPythiaRandom()) 
89       AliPythiaRndm::SetPythiaRandom(GetRandom());
90     
91     fProcess = process;
92     fEcms = energy;
93     fStrucFunc = strucfunc;
94 //...Switch off decay of pi0, K0S, Lambda, Sigma+-, Xi0-, Omega-.
95     SetMDCY(Pycomp(111) ,1,0);
96     SetMDCY(Pycomp(310) ,1,0);
97     SetMDCY(Pycomp(3122),1,0);
98     SetMDCY(Pycomp(3112),1,0);
99     SetMDCY(Pycomp(3212),1,0);
100     SetMDCY(Pycomp(3222),1,0);
101     SetMDCY(Pycomp(3312),1,0);
102     SetMDCY(Pycomp(3322),1,0);
103     SetMDCY(Pycomp(3334),1,0);
104     // Select structure function 
105     SetMSTP(52,2);
106     SetMSTP(51,strucfunc);
107     // Particles produced in string fragmentation point directly to either of the two endpoints
108     // of the string (depending in the side they were generated from).
109     SetMSTU(16,2);
110
111 //
112 // Pythia initialisation for selected processes//
113 //
114 // Make MSEL clean
115 //
116     for (Int_t i=1; i<= 200; i++) {
117         SetMSUB(i,0);
118     }
119 //  select charm production
120     switch (process) 
121     {
122     case kPyOldUEQ2ordered:  //Old underlying events with Q2 ordered QCD processes
123 //        Multiple interactions on.
124         SetMSTP(81,1);
125 // Double Gaussian matter distribution.
126         SetMSTP(82,4);
127         SetPARP(83,0.5);
128         SetPARP(84,0.4);
129 //  pT0.
130         SetPARP(82,2.0);
131 //  Reference energy for pT0 and energy rescaling pace.
132         SetPARP(89,1800);
133         SetPARP(90,0.25);
134 //  String drawing almost completely minimizes string length.
135         SetPARP(85,0.9);
136         SetPARP(86,0.95);
137 // ISR and FSR activity.
138         SetPARP(67,4);
139         SetPARP(71,4);
140 // Lambda_FSR scale.
141         SetPARJ(81,0.29);
142         break;
143     case kPyOldUEQ2ordered2:   
144 // Old underlying events with Q2 ordered QCD processes
145 // Multiple interactions on.
146         SetMSTP(81,1);
147 // Double Gaussian matter distribution.
148         SetMSTP(82,4);
149         SetPARP(83,0.5);
150         SetPARP(84,0.4);
151 // pT0.
152         SetPARP(82,2.0);
153 // Reference energy for pT0 and energy rescaling pace.
154         SetPARP(89,1800);
155         SetPARP(90,0.16);  // here is the difference with  kPyOldUEQ2ordered
156 // String drawing almost completely minimizes string length.
157         SetPARP(85,0.9);
158         SetPARP(86,0.95);
159 // ISR and FSR activity.
160         SetPARP(67,4);
161         SetPARP(71,4);
162 // Lambda_FSR scale.
163         SetPARJ(81,0.29);       
164         break;
165     case kPyOldPopcorn:  
166 // Old production mechanism: Old Popcorn
167         SetMSEL(1);
168         SetMSTJ(12,3); 
169 // (D=2) Like MSTJ(12)=2 but added prod ofthe 1er rank baryon
170         SetMSTP(88,2); 
171 // (D=1)see can be used to form  baryons (BARYON JUNCTION)
172         SetMSTJ(1,1);  
173         AtlasTuning();
174         break;
175     case kPyCharm:
176         SetMSEL(4);
177 //  heavy quark masses
178
179         SetPMAS(4,1,1.2);
180 //
181 //    primordial pT
182         SetMSTP(91,1);
183         SetPARP(91,1.);
184         SetPARP(93,5.);
185 //
186         break;
187     case kPyBeauty:
188         SetMSEL(5);
189         SetPMAS(5,1,4.75);
190         break;
191     case kPyJpsi:
192         SetMSEL(0);
193 // gg->J/Psi g
194         SetMSUB(86,1);
195         break;
196     case kPyJpsiChi:
197         SetMSEL(0);
198 // gg->J/Psi g
199         SetMSUB(86,1);
200 // gg-> chi_0c g
201         SetMSUB(87,1);
202 // gg-> chi_1c g
203         SetMSUB(88,1);
204 // gg-> chi_2c g
205         SetMSUB(89,1);  
206         break;
207     case kPyCharmUnforced:
208         SetMSEL(0);
209 // gq->qg   
210         SetMSUB(28,1);
211 // gg->qq
212         SetMSUB(53,1);
213 // gg->gg
214         SetMSUB(68,1);
215         break;
216     case kPyBeautyUnforced:
217         SetMSEL(0);
218 // gq->qg   
219         SetMSUB(28,1);
220 // gg->qq
221         SetMSUB(53,1);
222 // gg->gg
223         SetMSUB(68,1);
224         break;
225     case kPyMb:
226 // Minimum Bias pp-Collisions
227 //
228 //   
229 //      select Pythia min. bias model
230         SetMSEL(0);
231         SetMSUB(92,1);             // single diffraction AB-->XB
232         SetMSUB(93,1);             // single diffraction AB-->AX
233         SetMSUB(94,1);             // double diffraction
234         SetMSUB(95,1);             // low pt production
235
236         AtlasTuning();
237         break;
238     case kPyMbNonDiffr:
239 // Minimum Bias pp-Collisions
240 //
241 //   
242 //      select Pythia min. bias model
243         SetMSEL(0);
244         SetMSUB(95,1);             // low pt production
245
246         AtlasTuning();
247         break;
248     case kPyMbMSEL1:
249         ConfigHeavyFlavor();
250 // Intrinsic <kT^2>
251         SetMSTP(91,1);// Width (1=gaussian) primordial kT dist. inside hadrons
252         SetPARP(91,1.);     // <kT^2> = PARP(91,1.)^2
253         SetPARP(93,5.);     // Upper cut-off
254 // Set Q-quark mass
255         SetPMAS(4,1,1.2);   // Charm quark mass
256         SetPMAS(5,1,4.78);  // Beauty quark mass
257         SetPARP(71,4.);     // Defaut value
258 // Atlas Tuning
259         AtlasTuning();
260         break;
261     case kPyJets:
262 //
263 //  QCD Jets
264 //
265         SetMSEL(1);
266  // Pythia Tune A (CDF)
267  //
268        SetPARP(67,4.);            // Regulates Initial State Radiation
269        SetMSTP(82,4);             // Double Gaussian Model
270        SetPARP(82,2.0);           // [GeV]    PT_min at Ref. energy
271        SetPARP(84,0.4);           // Core radius
272        SetPARP(85,0.90) ;         // Regulates gluon prod. mechanism
273        SetPARP(86,0.95);          // Regulates gluon prod. mechanism
274        SetPARP(89,1800.);         // [GeV]   Ref. energy
275        SetPARP(90,0.25);          // 2*epsilon (exponent in power law)
276        break;
277     case kPyDirectGamma:
278         SetMSEL(10);
279         break;
280     case kPyCharmPbPbMNR:
281     case kPyD0PbPbMNR:
282     case kPyDPlusPbPbMNR:
283     case kPyDPlusStrangePbPbMNR:
284       // Tuning of Pythia parameters aimed to get a resonable agreement
285       // between with the NLO calculation by Mangano, Nason, Ridolfi for the
286       // c-cbar single inclusive and double differential distributions.
287       // This parameter settings are meant to work with Pb-Pb collisions
288       // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
289       // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
290       // has to be set to 2.1GeV. Example in ConfigCharmPPR.C.
291         ConfigHeavyFlavor();
292       // Intrinsic <kT>
293       SetMSTP(91,1);
294       SetPARP(91,1.304);
295       SetPARP(93,6.52);
296       // Set c-quark mass
297       SetPMAS(4,1,1.2);
298       break;
299     case kPyCharmpPbMNR:
300     case kPyD0pPbMNR:
301     case kPyDPluspPbMNR:
302     case kPyDPlusStrangepPbMNR:
303       // Tuning of Pythia parameters aimed to get a resonable agreement
304       // between with the NLO calculation by Mangano, Nason, Ridolfi for the
305       // c-cbar single inclusive and double differential distributions.
306       // This parameter settings are meant to work with p-Pb collisions
307       // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
308       // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
309       // has to be set to 2.1GeV. Example in ConfigCharmPPR.C.
310         ConfigHeavyFlavor();
311       // Intrinsic <kT>
312         SetMSTP(91,1);
313         SetPARP(91,1.16);
314         SetPARP(93,5.8);
315         
316       // Set c-quark mass
317         SetPMAS(4,1,1.2);
318       break;
319     case kPyCharmppMNR:
320     case kPyD0ppMNR:
321     case kPyDPlusppMNR:
322     case kPyDPlusStrangeppMNR:
323       // Tuning of Pythia parameters aimed to get a resonable agreement
324       // between with the NLO calculation by Mangano, Nason, Ridolfi for the
325       // c-cbar single inclusive and double differential distributions.
326       // This parameter settings are meant to work with pp collisions
327       // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
328       // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
329       // has to be set to 2.1GeV. Example in ConfigCharmPPR.C.
330         ConfigHeavyFlavor();
331       // Intrinsic <kT^2>
332         SetMSTP(91,1);
333         SetPARP(91,1.);
334         SetPARP(93,5.);
335         
336       // Set c-quark mass
337         SetPMAS(4,1,1.2);
338       break;
339     case kPyCharmppMNRwmi:
340       // Tuning of Pythia parameters aimed to get a resonable agreement
341       // between with the NLO calculation by Mangano, Nason, Ridolfi for the
342       // c-cbar single inclusive and double differential distributions.
343       // This parameter settings are meant to work with pp collisions
344       // and with kCTEQ5L PDFs.
345       // Added multiple interactions according to ATLAS tune settings.
346       // To get a "reasonable" agreement with MNR results, events have to be 
347       // generated with the minimum ptHard (AliGenPythia::SetPtHard)
348       // set to 2.76 GeV.
349       // To get a "perfect" agreement with MNR results, events have to be 
350       // generated in four ptHard bins with the following relative 
351       // normalizations:
352       // 2.76-3 GeV: 25%
353       //    3-4 GeV: 40%
354       //    4-8 GeV: 29%
355       //     >8 GeV:  6%
356         ConfigHeavyFlavor();
357       // Intrinsic <kT^2>
358         SetMSTP(91,1);
359         SetPARP(91,1.);
360         SetPARP(93,5.);
361
362       // Set c-quark mass
363         SetPMAS(4,1,1.2);
364         AtlasTuning();
365         break;
366     case kPyBeautyPbPbMNR:
367       // Tuning of Pythia parameters aimed to get a resonable agreement
368       // between with the NLO calculation by Mangano, Nason, Ridolfi for the
369       // b-bbar single inclusive and double differential distributions.
370       // This parameter settings are meant to work with Pb-Pb collisions
371       // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
372       // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
373       // has to be set to 2.75GeV. Example in ConfigBeautyPPR.C.
374         ConfigHeavyFlavor();
375       // QCD scales
376         SetPARP(67,1.0);
377         SetPARP(71,1.0);
378       // Intrinsic <kT>
379         SetMSTP(91,1);
380         SetPARP(91,2.035);
381         SetPARP(93,10.17);
382       // Set b-quark mass
383         SetPMAS(5,1,4.75);
384       break;
385     case kPyBeautypPbMNR:
386       // Tuning of Pythia parameters aimed to get a resonable agreement
387       // between with the NLO calculation by Mangano, Nason, Ridolfi for the
388       // b-bbar single inclusive and double differential distributions.
389       // This parameter settings are meant to work with p-Pb collisions
390       // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
391       // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
392       // has to be set to 2.75GeV. Example in ConfigBeautyPPR.C.
393         ConfigHeavyFlavor();
394       // QCD scales
395         SetPARP(67,1.0);
396         SetPARP(71,1.0);
397       // Intrinsic <kT>
398         SetMSTP(91,1);
399         SetPARP(91,1.60);
400         SetPARP(93,8.00);
401       // Set b-quark mass
402         SetPMAS(5,1,4.75);
403       break;
404     case kPyBeautyppMNR:
405       // Tuning of Pythia parameters aimed to get a resonable agreement
406       // between with the NLO calculation by Mangano, Nason, Ridolfi for the
407       // b-bbar single inclusive and double differential distributions.
408       // This parameter settings are meant to work with pp collisions
409       // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
410       // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
411       // has to be set to 2.75GeV. Example in ConfigBeautyPPR.C.
412         ConfigHeavyFlavor();
413       // QCD scales
414         SetPARP(67,1.0);
415         SetPARP(71,1.0);
416         
417         // Intrinsic <kT>
418         SetMSTP(91,1);
419         SetPARP(91,1.);
420         SetPARP(93,5.);
421         
422         // Set b-quark mass
423         SetPMAS(5,1,4.75);
424       break;
425      case kPyBeautyppMNRwmi:
426       // Tuning of Pythia parameters aimed to get a resonable agreement
427       // between with the NLO calculation by Mangano, Nason, Ridolfi for the
428       // b-bbar single inclusive and double differential distributions.
429       // This parameter settings are meant to work with pp collisions
430       // and with kCTEQ5L PDFs.
431       // Added multiple interactions according to ATLAS tune settings.
432       // To get a "reasonable" agreement with MNR results, events have to be 
433       // generated with the minimum ptHard (AliGenPythia::SetPtHard)
434       // set to 2.76 GeV.
435       // To get a "perfect" agreement with MNR results, events have to be 
436       // generated in four ptHard bins with the following relative 
437       // normalizations:
438       // 2.76-4 GeV:  5% 
439       //    4-6 GeV: 31%
440       //    6-8 GeV: 28%
441       //     >8 GeV: 36%
442          ConfigHeavyFlavor();
443       // QCD scales
444          SetPARP(67,1.0);
445          SetPARP(71,1.0);
446          
447          // Intrinsic <kT>
448          SetMSTP(91,1);
449          SetPARP(91,1.);
450          SetPARP(93,5.);
451
452       // Set b-quark mass
453          SetPMAS(5,1,4.75);
454
455          AtlasTuning();
456          break; 
457     case kPyW:
458
459       //Inclusive production of W+/-
460       SetMSEL(0);
461       //f fbar -> W+ 
462       SetMSUB(2,1);
463       //        //f fbar -> g W+
464       //        SetMSUB(16,1);
465       //        //f fbar -> gamma W+
466       //        SetMSUB(20,1);
467       //        //f g -> f W+  
468       //        SetMSUB(31,1);
469       //        //f gamma -> f W+
470       //        SetMSUB(36,1);
471       
472       // Initial/final parton shower on (Pythia default)
473       // With parton showers on we are generating "W inclusive process"
474       SetMSTP(61,1); //Initial QCD & QED showers on
475       SetMSTP(71,1); //Final QCD & QED showers on
476       
477       break;  
478
479     case kPyZ:
480
481       //Inclusive production of Z
482       SetMSEL(0);
483       //f fbar -> Z/gamma
484       SetMSUB(1,1);
485       
486       //       // f fbar -> g Z/gamma
487       //       SetMSUB(15,1);
488       //       // f fbar -> gamma Z/gamma
489       //       SetMSUB(19,1);
490       //       // f g -> f Z/gamma
491       //       SetMSUB(30,1);
492       //       // f gamma -> f Z/gamma
493       //       SetMSUB(35,1);
494       
495       //only Z included, not gamma
496       SetMSTP(43,2);
497       
498       // Initial/final parton shower on (Pythia default)
499       // With parton showers on we are generating "Z inclusive process"
500       SetMSTP(61,1); //Initial QCD & QED showers on
501       SetMSTP(71,1); //Final QCD & QED showers on
502       
503       break;  
504
505     }
506 //
507 //  Initialize PYTHIA
508     SetMSTP(41,1);   // all resonance decays switched on
509
510     Initialize("CMS","p","p",fEcms);
511
512 }
513
514 Int_t AliPythia::CheckedLuComp(Int_t kf)
515 {
516 // Check Lund particle code (for debugging)
517     Int_t kc=Pycomp(kf);
518     printf("\n Lucomp kf,kc %d %d",kf,kc);
519     return kc;
520 }
521
522 void AliPythia::SetNuclei(Int_t a1, Int_t a2)
523 {
524 // Treat protons as inside nuclei with mass numbers a1 and a2  
525 //    The MSTP array in the PYPARS common block is used to enable and 
526 //    select the nuclear structure functions. 
527 //    MSTP(52)  : (D=1) choice of proton and nuclear structure-function library
528 //            =1: internal PYTHIA acording to MSTP(51) 
529 //            =2: PDFLIB proton  s.f., with MSTP(51)  = 1000xNGROUP+NSET
530 //    If the following mass number both not equal zero, nuclear corrections of the stf are used.
531 //    MSTP(192) : Mass number of nucleus side 1
532 //    MSTP(193) : Mass number of nucleus side 2
533     SetMSTP(52,2);
534     SetMSTP(192, a1);
535     SetMSTP(193, a2);  
536 }
537         
538
539 AliPythia* AliPythia::Instance()
540
541 // Set random number generator 
542     if (fgAliPythia) {
543         return fgAliPythia;
544     } else {
545         fgAliPythia = new AliPythia();
546         return fgAliPythia;
547     }
548 }
549
550 void AliPythia::PrintParticles()
551
552 // Print list of particl properties
553     Int_t np = 0;
554     char*   name = new char[16];    
555     for (Int_t kf=0; kf<1000000; kf++) {
556         for (Int_t c = 1;  c > -2; c-=2) {
557             Int_t kc = Pycomp(c*kf);
558             if (kc) {
559                 Float_t mass  = GetPMAS(kc,1);
560                 Float_t width = GetPMAS(kc,2);  
561                 Float_t tau   = GetPMAS(kc,4);
562
563                 Pyname(kf,name);
564         
565                 np++;
566                 
567                 printf("\n mass, width, tau: %6d %s %10.3f %10.3e %10.3e", 
568                        c*kf, name, mass, width, tau);
569             }
570         }
571     }
572     printf("\n Number of particles %d \n \n", np);
573 }
574
575 void  AliPythia::ResetDecayTable()
576 {
577 //  Set default values for pythia decay switches
578     Int_t i;
579     for (i = 1; i <  501; i++) SetMDCY(i,1,fDefMDCY[i]);
580     for (i = 1; i < 2001; i++) SetMDME(i,1,fDefMDME[i]);
581 }
582
583 void  AliPythia::SetDecayTable()
584 {
585 //  Set default values for pythia decay switches
586 //
587     Int_t i;
588     for (i = 1; i <  501; i++) fDefMDCY[i] = GetMDCY(i,1);
589     for (i = 1; i < 2001; i++) fDefMDME[i] = GetMDME(i,1);
590 }
591
592 void  AliPythia::Pyclus(Int_t& njet)
593 {
594 //  Call Pythia clustering algorithm
595 //
596     pyclus(njet);
597 }
598
599 void  AliPythia::Pycell(Int_t& njet)
600 {
601 //  Call Pythia jet reconstruction algorithm
602 //
603     pycell(njet);
604 }
605
606 void  AliPythia::Pyshow(Int_t ip1, Int_t ip2, Double_t qmax)
607 {
608 //  Call Pythia jet reconstruction algorithm
609 //
610     pyshow(ip1, ip2, qmax);
611 }
612
613 void AliPythia::Pyrobo(Int_t imi, Int_t ima, Double_t the, Double_t phi, Double_t bex, Double_t bey, Double_t bez)
614 {
615     pyrobo(imi, ima, the, phi, bex, bey, bez);
616 }
617
618
619
620 void AliPythia::InitQuenching(Float_t cMin, Float_t cMax, Float_t k, Int_t iECMethod)
621 {
622 // Initializes 
623 // (1) The quenching model using quenching weights according to C. Salgado and U. Wiedemann
624 // (2) The nuclear geometry using the Glauber Model
625 //     
626
627
628     fGlauber = new AliFastGlauber();
629     fGlauber->Init(2);
630     fGlauber->SetCentralityClass(cMin, cMax); 
631
632     fQuenchingWeights = new AliQuenchingWeights();
633     fQuenchingWeights->InitMult();
634     fQuenchingWeights->SetK(k);
635     fQuenchingWeights->SetECMethod(AliQuenchingWeights::kECMethod(iECMethod));
636 }
637
638
639 void  AliPythia::Quench()
640 {
641 //
642 //
643 //  Simple Jet Quenching routine:
644 //  =============================
645 //  The jet formed by all final state partons radiated by the parton created 
646 //  in the hard collisions is quenched by a factor (1-z) using light cone variables in 
647 //  the initial parton reference frame:
648 //  (E + p_z)new = (1-z) (E + p_z)old
649 //
650 //
651 //
652 //
653 //   The lost momentum is first balanced by one gluon with virtuality > 0.   
654 //   Subsequently the gluon splits to yield two gluons with E = p.
655 //
656 //
657 // 
658     static Float_t eMean = 0.;
659     static Int_t   icall = 0;
660     
661     Double_t p0[4][5];
662     Double_t p1[4][5];
663     Double_t p2[4][5];
664     Int_t   klast[4] = {-1, -1, -1, -1};
665
666     Int_t numpart   = fPyjets->N;
667     Double_t px = 0., py = 0., pz = 0., e = 0., m = 0., p = 0., pt = 0., theta = 0., phi = 0.;
668     Double_t pxq[4], pyq[4], pzq[4], eq[4], yq[4], mq[4], pq[4], phiq[4], thetaq[4], ptq[4];
669     Bool_t  quenched[4];
670     Double_t wjtKick[4];
671     Int_t nGluon[4];
672     Int_t qPdg[4];
673     Int_t   imo, kst, pdg;
674     
675 //
676 //  Sore information about Primary partons
677 //
678 //  j =
679 //  0, 1 partons from hard scattering
680 //  2, 3 partons from initial state radiation
681 // 
682     for (Int_t i = 2; i <= 7; i++) {
683         Int_t j = 0;
684         // Skip gluons that participate in hard scattering
685         if (i == 4 || i == 5) continue;
686         // Gluons from hard Scattering
687         if (i == 6 || i == 7) {
688             j = i - 6;
689             pxq[j]    = fPyjets->P[0][i];
690             pyq[j]    = fPyjets->P[1][i];
691             pzq[j]    = fPyjets->P[2][i];
692             eq[j]     = fPyjets->P[3][i];
693             mq[j]     = fPyjets->P[4][i];
694         } else {
695             // Gluons from initial state radiation
696             //
697             // Obtain 4-momentum vector from difference between original parton and parton after gluon 
698             // radiation. Energy is calculated independently because initial state radition does not 
699             // conserve strictly momentum and energy for each partonic system independently.
700             //
701             // Not very clean. Should be improved !
702             //
703             //
704             j = i;
705             pxq[j]    = fPyjets->P[0][i] - fPyjets->P[0][i+2];
706             pyq[j]    = fPyjets->P[1][i] - fPyjets->P[1][i+2];
707             pzq[j]    = fPyjets->P[2][i] - fPyjets->P[2][i+2];
708             mq[j]     = fPyjets->P[4][i];
709             eq[j]     = TMath::Sqrt(pxq[j] * pxq[j] + pyq[j] * pyq[j] + pzq[j] * pzq[j] + mq[j] * mq[j]);
710         }
711 //
712 //  Calculate some kinematic variables
713 //
714         yq[j]     = 0.5 * TMath::Log((eq[j] + pzq[j] + 1.e-14) / (eq[j] - pzq[j] + 1.e-14));
715         pq[j]     = TMath::Sqrt(pxq[j] * pxq[j] + pyq[j] * pyq[j] + pzq[j] * pzq[j]);
716         phiq[j]   = TMath::Pi()+TMath::ATan2(-pyq[j], -pxq[j]);
717         ptq[j]    = TMath::Sqrt(pxq[j] * pxq[j] + pyq[j] * pyq[j]);
718         thetaq[j] = TMath::ATan2(ptq[j], pzq[j]);
719         qPdg[j]   =  fPyjets->K[1][i];
720     }
721   
722     Double_t int0[4];
723     Double_t int1[4];
724     
725     fGlauber->GetI0I1ForPythiaAndXY(4, phiq, int0, int1, fXJet, fYJet, 15.);
726
727     for (Int_t j = 0; j < 4; j++) {
728         //
729         // Quench only central jets and with E > 10.
730         //
731
732
733         Int_t itype = (qPdg[j] == 21) ? 2 : 1;
734         Double_t eloss = fQuenchingWeights->GetELossRandomKFast(itype, int0[j], int1[j], eq[j]);
735
736         if (TMath::Abs(yq[j]) > 2.5 || eq[j] < 10.) {
737             fZQuench[j] = 0.;
738         } else {
739             if (eq[j] > 40. && TMath::Abs(yq[j]) < 0.5) {
740                 icall ++;
741                 eMean += eloss;
742             }
743             //
744             // Extra pt
745             Double_t l =   fQuenchingWeights->CalcLk(int0[j], int1[j]);     
746             wjtKick[j] = TMath::Sqrt(l *  fQuenchingWeights->CalcQk(int0[j], int1[j]));
747             //
748             // Fractional energy loss
749             fZQuench[j] = eloss / eq[j];
750             //
751             // Avoid complete loss
752             //
753             if (fZQuench[j] == 1.) fZQuench[j] = 0.95;
754             //
755             // Some debug printing
756
757             
758 //          printf("Initial parton # %3d, Type %3d Energy %10.3f Phi %10.3f Length %10.3f Loss %10.3f Kick %10.3f Mean: %10.3f %10.3f\n", 
759 //                 j, itype, eq[j], phiq[j], l, eloss, wjtKick[j], eMean / Float_t(icall+1), yq[j]);
760             
761 //          fZQuench[j] = 0.8;
762 //          while (fZQuench[j] >= 0.95)  fZQuench[j] = gRandom->Exp(0.2);
763         }
764         
765         quenched[j] = (fZQuench[j] > 0.01);
766     } // primary partons
767     
768     
769
770     Double_t pNew[1000][4];
771     Int_t    kNew[1000];
772     Int_t icount = 0;
773     Double_t zquench[4];
774     
775 //
776 //  System Loop    
777     for (Int_t isys = 0; isys < 4; isys++) {
778 //      Skip to next system if not quenched.
779         if (!quenched[isys]) continue;
780         
781         nGluon[isys]   = 1 + Int_t(fZQuench[isys] / (1. - fZQuench[isys]));
782         if (nGluon[isys] > 6) nGluon[isys] = 6;
783         zquench[isys] = 1. - TMath::Power(1. - fZQuench[isys], 1./Double_t(nGluon[isys]));
784         wjtKick[isys]  = wjtKick[isys] / TMath::Sqrt(Double_t(nGluon[isys]));
785
786
787         
788         Int_t igMin = -1;
789         Int_t igMax = -1;
790         Double_t pg[4] = {0., 0., 0., 0.};
791         
792 //
793 // Loop on radiation events
794
795         for (Int_t iglu = 0; iglu < nGluon[isys]; iglu++) {
796             while (1) {
797                 icount = 0;
798                 for (Int_t k = 0; k < 4; k++)
799                 {
800                     p0[isys][k] = 0.;
801                     p1[isys][k] = 0.;
802                     p2[isys][k] = 0.;
803                 }
804 //      Loop over partons
805                 for (Int_t i = 0; i < numpart; i++)
806                 {
807                     imo =  fPyjets->K[2][i];
808                     kst =  fPyjets->K[0][i];
809                     pdg =  fPyjets->K[1][i];
810                     
811                 
812                 
813 //      Quarks and gluons only
814                     if (pdg != 21 && TMath::Abs(pdg) > 6) continue;
815 //      Particles from hard scattering only
816                     
817                     if (imo > 8 && imo < 1000) imo = fPyjets->K[2][imo - 1];
818                     Int_t imom = imo % 1000;
819                     if ((isys == 0 || isys == 1) && ((imom != (isys + 7)))) continue;
820                     if ((isys == 2 || isys == 3) && ((imom != (isys + 1)))) continue;               
821                     
822                     
823 //      Skip comment lines
824                     if (kst != 1 && kst != 2) continue;
825 //
826 //      Parton kinematic
827                     px    = fPyjets->P[0][i];
828                     py    = fPyjets->P[1][i];
829                     pz    = fPyjets->P[2][i];
830                     e     = fPyjets->P[3][i];
831                     m     = fPyjets->P[4][i];
832                     pt    = TMath::Sqrt(px * px + py * py);
833                     p     = TMath::Sqrt(px * px + py * py + pz * pz); 
834                     phi   = TMath::Pi() + TMath::ATan2(-py, -px);
835                     theta = TMath::ATan2(pt, pz);
836                 
837 //
838 //      Save 4-momentum sum for balancing
839                     Int_t index = isys;
840                     
841                     p0[index][0] += px;
842                     p0[index][1] += py;
843                     p0[index][2] += pz;
844                     p0[index][3] += e;
845                 
846                     klast[index] = i;
847                     
848 //
849 //      Fractional energy loss
850                     Double_t z = zquench[index];
851                     
852                     
853 //      Don't fully quench radiated gluons
854 //
855                     if (imo > 1000) {
856 //      This small factor makes sure that the gluons are not too close in phase space to avoid recombination
857 //
858
859                         z = 0.02;
860                     }
861 //                  printf("z: %d %f\n", imo, z);
862                     
863
864 //
865                     
866                     //
867                     //
868                     //      Transform into frame in which initial parton is along z-axis
869                     //
870                     TVector3 v(px, py, pz);
871                     v.RotateZ(-phiq[index]);  v.RotateY(-thetaq[index]);
872                     Double_t pxs = v.X(); Double_t pys = v.Y(); Double_t pl  = v.Z();
873
874                     Double_t jt  = TMath::Sqrt(pxs * pxs + pys * pys);
875                     Double_t mt2 = jt * jt + m * m;
876                     Double_t zmax = 1.;     
877                     //
878                     // Kinematic limit on z
879                     //
880                     if (m > 0.) zmax = 1. - m / TMath::Sqrt(m * m + jt * jt);
881                     //
882                     // Change light-cone kinematics rel. to initial parton
883                     //  
884                     Double_t eppzOld = e + pl;
885                     Double_t empzOld = e - pl;
886                     
887                     Double_t eppzNew = (1. - z) * eppzOld;
888                     Double_t empzNew = empzOld - mt2 * z / eppzOld;
889                     Double_t eNew    = 0.5 * (eppzNew + empzNew);
890                     Double_t plNew   = 0.5 * (eppzNew - empzNew);
891                     
892                     Double_t jtNew;
893                     //
894                     // if mt very small (or sometimes even < 0 for numerical reasons) set it to 0
895                     Double_t mt2New = eppzNew * empzNew;
896                     if (mt2New < 1.e-8) mt2New = 0.;
897                     if (z < zmax) {
898                         if (m * m > mt2New) {
899                             //
900                             // This should not happen 
901                             //
902                             Fatal("Quench()", "This should never happen %e %e %e!", m, eppzNew, empzNew);
903                             jtNew = 0;
904                         } else {
905                             jtNew    = TMath::Sqrt(mt2New - m * m);
906                         }
907                     } else {
908                         // If pT is to small (probably a leading massive particle) we scale only the energy
909                         // This can cause negative masses of the radiated gluon
910                         // Let's hope for the best ...
911                         jtNew = jt;
912                         eNew  = TMath::Sqrt(plNew * plNew + mt2);
913                         
914                     }
915                     //
916                     //     Calculate new px, py
917                     //
918                     Double_t pxNew   = jtNew / jt * pxs;
919                     Double_t pyNew   = jtNew / jt * pys;        
920                     
921 //                  Double_t dpx = pxs - pxNew;
922 //                  Double_t dpy = pys - pyNew;
923 //                  Double_t dpz = pl  - plNew;
924 //                  Double_t de  = e   - eNew;
925 //                  Double_t dmass2 = de * de  - dpx * dpx - dpy * dpy - dpz * dpz;
926 //                  printf("New mass (1) %e %e %e %e %e %e %e \n", dmass2, jt, jtNew, pl, plNew, e, eNew);
927 //                  printf("New mass (2) %e %e \n", pxNew, pyNew);
928                     //
929                     //      Rotate back
930                     //  
931                     TVector3 w(pxNew, pyNew, plNew);
932                     w.RotateY(thetaq[index]); w.RotateZ(phiq[index]);
933                     pxNew = w.X(); pyNew = w.Y(); plNew = w.Z();
934                 
935                     p1[index][0] += pxNew;
936                     p1[index][1] += pyNew;
937                     p1[index][2] += plNew;
938                     p1[index][3] += eNew;       
939                     //
940                     // Updated 4-momentum vectors
941                     //
942                     pNew[icount][0]  = pxNew;
943                     pNew[icount][1]  = pyNew;
944                     pNew[icount][2]  = plNew;
945                     pNew[icount][3]  = eNew;
946                     kNew[icount]     = i;
947                     icount++;
948                 } // parton loop
949                 //
950                 // Check if there was phase-space for quenching
951                 //
952
953                 if (icount == 0) quenched[isys] = kFALSE;
954                 if (!quenched[isys]) break;
955                 
956                 for (Int_t j = 0; j < 4; j++) 
957                 {
958                     p2[isys][j] = p0[isys][j] - p1[isys][j];
959                 }
960                 p2[isys][4] = p2[isys][3] * p2[isys][3] - p2[isys][0] * p2[isys][0] - p2[isys][1] * p2[isys][1] - p2[isys][2] * p2[isys][2];
961                 if (p2[isys][4] > 0.) {
962                     p2[isys][4] = TMath::Sqrt(p2[isys][4]);
963                     break;
964                 } else {
965                     printf("Warning negative mass squared in system %d %f ! \n", isys, zquench[isys]);
966                     printf("4-Momentum: %10.3e %10.3e %10.3e %10.3e %10.3e \n", p2[isys][0], p2[isys][1], p2[isys][2], p2[isys][3], p2[isys][4]);
967                     if (p2[isys][4] < -0.01) {
968                         printf("Negative mass squared !\n");
969                         // Here we have to put the gluon back to mass shell
970                         // This will lead to a small energy imbalance
971                         p2[isys][4]  = 0.;
972                         p2[isys][3]  = TMath::Sqrt(p2[isys][0] * p2[isys][0] + p2[isys][1] * p2[isys][1] + p2[isys][2] * p2[isys][2]);
973                         break;
974                     } else {
975                         p2[isys][4] = 0.;
976                         break;
977                     }
978                 }
979                 /*
980                 zHeavy *= 0.98;
981                 printf("zHeavy lowered to %f\n", zHeavy);
982                 if (zHeavy < 0.01) {
983                     printf("No success ! \n");
984                     icount = 0;
985                     quenched[isys] = kFALSE;
986                     break;
987                 }
988                 */
989             } // iteration on z (while)
990             
991 //          Update  event record
992             for (Int_t k = 0; k < icount; k++) {
993 //              printf("%6d %6d %10.3e %10.3e %10.3e %10.3e\n", k, kNew[k], pNew[k][0],pNew[k][1], pNew[k][2], pNew[k][3] );
994                 fPyjets->P[0][kNew[k]] = pNew[k][0];
995                 fPyjets->P[1][kNew[k]] = pNew[k][1];
996                 fPyjets->P[2][kNew[k]] = pNew[k][2];
997                 fPyjets->P[3][kNew[k]] = pNew[k][3];
998             }
999             //
1000             // Add the gluons
1001             //
1002             Int_t ish = 0;    
1003             Int_t iGlu;
1004             if (!quenched[isys]) continue;
1005 //
1006 //      Last parton from shower i
1007             Int_t in = klast[isys];
1008 //
1009 //      Continue if no parton in shower i selected
1010             if (in == -1) continue;
1011 //  
1012 //      If this is the second initial parton and it is behind the first move pointer by previous ish
1013             if (isys == 1 && klast[1] > klast[0]) in += ish;
1014 //
1015 //      Starting index
1016             
1017 //          jmin = in - 1;
1018 // How many additional gluons will be generated
1019             ish  = 1;
1020             if (p2[isys][4] > 0.05) ish = 2;
1021 //
1022 //      Position of gluons
1023             iGlu = numpart;
1024             if (iglu == 0) igMin = iGlu;
1025             igMax = iGlu;
1026             numpart += ish;
1027             (fPyjets->N) += ish;
1028             
1029             if (ish == 1) {
1030                 fPyjets->P[0][iGlu] = p2[isys][0];
1031                 fPyjets->P[1][iGlu] = p2[isys][1];
1032                 fPyjets->P[2][iGlu] = p2[isys][2];
1033                 fPyjets->P[3][iGlu] = p2[isys][3];
1034                 fPyjets->P[4][iGlu] = p2[isys][4];
1035                 
1036                 fPyjets->K[0][iGlu] = 1;
1037                 if (iglu == nGluon[isys] - 1) fPyjets->K[0][iGlu] = 1;
1038                 fPyjets->K[1][iGlu] = 21;       
1039                 fPyjets->K[2][iGlu] = fPyjets->K[2][in] + 1000;
1040                 fPyjets->K[3][iGlu] = -1;       
1041                 fPyjets->K[4][iGlu] = -1;
1042                 
1043                 pg[0] += p2[isys][0];
1044                 pg[1] += p2[isys][1];
1045                 pg[2] += p2[isys][2];
1046                 pg[3] += p2[isys][3];
1047             } else {
1048                 //
1049                 // Split gluon in rest frame.
1050                 //
1051                 Double_t bx   =  p2[isys][0] / p2[isys][3];
1052                 Double_t by   =  p2[isys][1] / p2[isys][3];
1053                 Double_t bz   =  p2[isys][2] / p2[isys][3];
1054                 Double_t pst  =  p2[isys][4] / 2.;
1055                 //
1056                 // Isotropic decay ????
1057                 Double_t cost = 2. * gRandom->Rndm() - 1.;
1058                 Double_t sint = TMath::Sqrt(1. - cost * cost);
1059                 Double_t phi =  2. * TMath::Pi() * gRandom->Rndm();
1060                 
1061                 Double_t pz1 =   pst * cost;
1062                 Double_t pz2 =  -pst * cost;
1063                 Double_t pt1 =   pst * sint;
1064                 Double_t pt2 =  -pst * sint;
1065                 Double_t px1 =   pt1 * TMath::Cos(phi);
1066                 Double_t py1 =   pt1 * TMath::Sin(phi);     
1067                 Double_t px2 =   pt2 * TMath::Cos(phi);
1068                 Double_t py2 =   pt2 * TMath::Sin(phi);     
1069                 
1070                 fPyjets->P[0][iGlu] = px1;
1071                 fPyjets->P[1][iGlu] = py1;
1072                 fPyjets->P[2][iGlu] = pz1;
1073                 fPyjets->P[3][iGlu] = pst;
1074                 fPyjets->P[4][iGlu] = 0.;
1075                 
1076                 fPyjets->K[0][iGlu] = 1 ;
1077                 fPyjets->K[1][iGlu] = 21;       
1078                 fPyjets->K[2][iGlu] = fPyjets->K[2][in] + 1000;
1079                 fPyjets->K[3][iGlu] = -1;       
1080                 fPyjets->K[4][iGlu] = -1;
1081                 
1082                 fPyjets->P[0][iGlu+1] = px2;
1083                 fPyjets->P[1][iGlu+1] = py2;
1084                 fPyjets->P[2][iGlu+1] = pz2;
1085                 fPyjets->P[3][iGlu+1] = pst;
1086                 fPyjets->P[4][iGlu+1] = 0.;
1087                 
1088                 fPyjets->K[0][iGlu+1] = 1;
1089                 if (iglu == nGluon[isys] - 1) fPyjets->K[0][iGlu+1] = 1;
1090                 fPyjets->K[1][iGlu+1] = 21;     
1091                 fPyjets->K[2][iGlu+1] = fPyjets->K[2][in] + 1000;
1092                 fPyjets->K[3][iGlu+1] = -1;     
1093                 fPyjets->K[4][iGlu+1] = -1;
1094                 SetMSTU(1,0);
1095                 SetMSTU(2,0);
1096                 //
1097                 // Boost back
1098                 //
1099                 Pyrobo(iGlu + 1, iGlu + 2, 0., 0., bx, by, bz);
1100             }
1101 /*    
1102             for (Int_t ig = iGlu; ig < iGlu+ish; ig++) {
1103                 Double_t px, py, pz;
1104                 px = fPyjets->P[0][ig]; 
1105                 py = fPyjets->P[1][ig]; 
1106                 pz = fPyjets->P[2][ig]; 
1107                 TVector3 v(px, py, pz);
1108                 v.RotateZ(-phiq[isys]);
1109                 v.RotateY(-thetaq[isys]);
1110                 Double_t pxs     = v.X(); Double_t pys = v.Y(); Double_t pzs  = v.Z();     
1111                 Double_t r       = AliPythiaRndm::GetPythiaRandom()->Rndm();
1112                 Double_t jtKick  = 0.3 * TMath::Sqrt(-TMath::Log(r));
1113                 if (ish == 2)   jtKick  = wjtKick[i] * TMath::Sqrt(-TMath::Log(r)) / TMath::Sqrt(2.);
1114                 Double_t phiKick = 2. * TMath::Pi() * AliPythiaRndm::GetPythiaRandom()->Rndm();
1115                 pxs += jtKick * TMath::Cos(phiKick);
1116                 pys += jtKick * TMath::Sin(phiKick);
1117                 TVector3 w(pxs, pys, pzs);
1118                 w.RotateY(thetaq[isys]);
1119                 w.RotateZ(phiq[isys]);
1120                 fPyjets->P[0][ig] = w.X(); 
1121                 fPyjets->P[1][ig] = w.Y(); 
1122                 fPyjets->P[2][ig] = w.Z(); 
1123                 fPyjets->P[2][ig] = w.Mag();
1124             }
1125 */
1126         } // kGluon         
1127         
1128         
1129     // Check energy conservation
1130         Double_t pxs = 0.;
1131         Double_t pys = 0.;
1132         Double_t pzs = 0.;      
1133         Double_t es  = 14000.;
1134         
1135         for (Int_t i = 0; i < numpart; i++)
1136         {
1137             kst =  fPyjets->K[0][i];
1138             if (kst != 1 && kst != 2) continue;
1139             pxs += fPyjets->P[0][i];
1140             pys += fPyjets->P[1][i];
1141             pzs += fPyjets->P[2][i];        
1142             es  -= fPyjets->P[3][i];        
1143         }
1144         if (TMath::Abs(pxs) > 1.e-2 ||
1145             TMath::Abs(pys) > 1.e-2 ||
1146             TMath::Abs(pzs) > 1.e-1) {
1147             printf("%e %e %e %e\n", pxs, pys, pzs, es);
1148 //              Fatal("Quench()", "4-Momentum non-conservation");
1149         }
1150         
1151     } // end quenching loop (systems)
1152 // Clean-up
1153     for (Int_t i = 0; i < numpart; i++)
1154     {
1155         imo =  fPyjets->K[2][i];
1156         if (imo > 1000) {
1157             fPyjets->K[2][i] = fPyjets->K[2][i] % 1000;
1158         }
1159     }
1160 //      this->Pylist(1);
1161 } // end quench
1162
1163
1164 void AliPythia::Pyquen(Double_t a, Int_t ibf, Double_t b)
1165 {
1166     // Igor Lokthine's quenching routine
1167     pyquen(a, ibf, b);
1168 }
1169
1170 void AliPythia::Pyevnw()
1171 {
1172     // New multiple interaction scenario
1173     pyevnw();
1174 }
1175
1176 void AliPythia::GetQuenchingParameters(Double_t& xp, Double_t& yp, Double_t z[4])
1177 {
1178     // Return event specific quenching parameters
1179     xp = fXJet;
1180     yp = fYJet;
1181     for (Int_t i = 0; i < 4; i++) z[i] = fZQuench[i];
1182
1183 }
1184
1185 void AliPythia::ConfigHeavyFlavor()
1186 {
1187     //
1188     // Default configuration for Heavy Flavor production
1189     //
1190     // All QCD processes
1191     //
1192     SetMSEL(1);
1193     
1194     // No multiple interactions
1195     SetMSTP(81,0);
1196     // Initial/final parton shower on (Pythia default)
1197     SetMSTP(61,1);
1198     SetMSTP(71,1);
1199     
1200     // 2nd order alpha_s
1201     SetMSTP(2,2);
1202     
1203     // QCD scales
1204     SetMSTP(32,2);
1205     SetPARP(34,1.0);
1206 }
1207
1208 void AliPythia::AtlasTuning()
1209 {
1210     //
1211     // Configuration for the ATLAS tuning
1212         SetMSTP(51, kCTEQ5L);      // CTEQ5L pdf
1213         SetMSTP(81,1);             // Multiple Interactions ON
1214         SetMSTP(82,4);             // Double Gaussian Model
1215         SetPARP(82,1.8);           // [GeV]    PT_min at Ref. energy
1216         SetPARP(89,1000.);         // [GeV]   Ref. energy
1217         SetPARP(90,0.16);          // 2*epsilon (exponent in power law)
1218         SetPARP(83,0.5);           // Core density in proton matter distribution (def.value)
1219         SetPARP(84,0.5);           // Core radius
1220         SetPARP(85,0.33);          // Regulates gluon prod. mechanism
1221         SetPARP(86,0.66);          // Regulates gluon prod. mechanism
1222         SetPARP(67,1);             // Regulates Initial State Radiation
1223 }
1224
1225 AliPythia& AliPythia::operator=(const  AliPythia& rhs)
1226 {
1227 // Assignment operator
1228     rhs.Copy(*this);
1229     return *this;
1230 }
1231
1232  void AliPythia::Copy(TObject&) const
1233 {
1234     //
1235     // Copy 
1236     //
1237     Fatal("Copy","Not implemented!\n");
1238 }