]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TDPMjet/AliGenDPMjet.cxx
Do not include from subdirectories
[u/mrichter/AliRoot.git] / TDPMjet / AliGenDPMjet.cxx
CommitLineData
1a52e0ed 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16
17// Generator using DPMJET as an external generator
18// The main DPMJET options are accessable for the user through this interface.
19// Uses the TDPMjet implementation of TGenerator.
20
21#include <TDPMjet.h>
60e3ddb0 22#include "DPMcommon.h"
1a52e0ed 23#include <TRandom.h>
24#include <TArrayI.h>
25#include <TParticle.h>
26#include <TGraph.h>
27#include <TDatabasePDG.h>
28#include <TParticlePDG.h>
29#include <TParticleClassPDG.h>
30#include <TPDGCode.h>
31#include <TLorentzVector.h>
07c71c2e 32#include <TClonesArray.h>
9dcc0beb 33#include "AliRunLoader.h"
1a52e0ed 34#include "AliGenDPMjet.h"
35#include "AliGenDPMjetEventHeader.h"
1a52e0ed 36#include "AliRun.h"
f2ba02a4 37#include "AliDpmJetRndm.h"
3f1688cf 38#include "AliIonPDGCodes.h"
9dcc0beb 39#include "AliHeader.h"
40#include "AliStack.h"
41#include "AliMC.h"
c5dfa3e4 42#include "AliLog.h"
1a52e0ed 43
f97d4a8e 44ClassImp(AliGenDPMjet)
1a52e0ed 45
46//______________________________________________________________________________
47AliGenDPMjet::AliGenDPMjet()
f97d4a8e 48 :AliGenMC(),
7cbda79e 49 fBeamEn(0.),
f97d4a8e 50 fMinImpactParam(0.),
7cbda79e 51 fMaxImpactParam(100.),
f97d4a8e 52 fICentr(0),
53 fSelectAll(0),
54 fFlavor(0),
55 fTrials(0),
74471936 56 fNprimaries(0),
f97d4a8e 57 fSpectators(1),
58 fSpecn(0),
59 fSpecp(0),
60 fDPMjet(0),
f97d4a8e 61 fNoGammas(0),
62 fLHC(0),
9c97cedd 63 fPi0Decay(1),
717765ce 64 fDecayAll(0),
f97d4a8e 65 fGenImpPar(0.),
3b50c39e 66 fProcess(kDpmMb),
631cb555 67 fTriggerParticle(0),
68 fTriggerEta(0.9),
69 fTriggerMinPt(-1),
70 fTriggerMaxPt(1000),
3b50c39e 71 fTriggerMultiplicity(0),
72 fTriggerMultiplicityEta(0),
19896767 73 fTriggerMultiplicityPtMin(0),
74 fkTuneForDiff(0),
5fed2e29 75 fProcDiff(0),
7cbda79e 76 fFragmentation(kFALSE),
77 fHeader(AliGenDPMjetEventHeader("DPMJET"))
78
1a52e0ed 79{
80// Constructor
e7c989e4 81 fEnergyCMS = 5500.;
f2ba02a4 82 AliDpmJetRndm::SetDpmJetRandom(GetRandom());
1a52e0ed 83}
84
85
86//______________________________________________________________________________
87AliGenDPMjet::AliGenDPMjet(Int_t npart)
f97d4a8e 88 :AliGenMC(npart),
7cbda79e 89 fBeamEn(0.),
f97d4a8e 90 fMinImpactParam(0.),
7cbda79e 91 fMaxImpactParam(100.),
f97d4a8e 92 fICentr(0),
93 fSelectAll(0),
94 fFlavor(0),
95 fTrials(0),
74471936 96 fNprimaries(0),
f97d4a8e 97 fSpectators(1),
98 fSpecn(0),
99 fSpecp(0),
100 fDPMjet(0),
f97d4a8e 101 fNoGammas(0),
102 fLHC(0),
9c97cedd 103 fPi0Decay(1),
717765ce 104 fDecayAll(0),
f97d4a8e 105 fGenImpPar(0.),
3b50c39e 106 fProcess(kDpmMb),
631cb555 107 fTriggerParticle(0),
108 fTriggerEta(0.9),
109 fTriggerMinPt(-1),
110 fTriggerMaxPt(1000),
3b50c39e 111 fTriggerMultiplicity(0),
112 fTriggerMultiplicityEta(0),
19896767 113 fTriggerMultiplicityPtMin(0),
114 fkTuneForDiff(0),
5fed2e29 115 fProcDiff(0),
7cbda79e 116 fFragmentation(kFALSE),
117 fHeader(AliGenDPMjetEventHeader("DPMJET"))
118
5fed2e29 119
1a52e0ed 120{
121// Default PbPb collisions at 5. 5 TeV
122//
e7c989e4 123 fEnergyCMS = 5500.;
1a52e0ed 124 fName = "DPMJET";
125 fTitle= "Particle Generator using DPMJET";
1a52e0ed 126 SetTarget();
127 SetProjectile();
f2ba02a4 128 fVertex.Set(3);
f2ba02a4 129 AliDpmJetRndm::SetDpmJetRandom(GetRandom());
1a52e0ed 130}
131
ba758f5a 132AliGenDPMjet::AliGenDPMjet(const AliGenDPMjet &/*Dpmjet*/)
f97d4a8e 133 :AliGenMC(),
7cbda79e 134 fBeamEn(0.),
f97d4a8e 135 fMinImpactParam(0.),
7cbda79e 136 fMaxImpactParam(100.),
f97d4a8e 137 fICentr(0),
138 fSelectAll(0),
139 fFlavor(0),
140 fTrials(0),
74471936 141 fNprimaries(0),
f97d4a8e 142 fSpectators(1),
143 fSpecn(0),
144 fSpecp(0),
145 fDPMjet(0),
f97d4a8e 146 fNoGammas(0),
147 fLHC(0),
9c97cedd 148 fPi0Decay(1),
717765ce 149 fDecayAll(0),
f97d4a8e 150 fGenImpPar(0.),
3b50c39e 151 fProcess(kDpmMb),
631cb555 152 fTriggerParticle(0),
153 fTriggerEta(0.9),
154 fTriggerMinPt(-1),
155 fTriggerMaxPt(1000),
3b50c39e 156 fTriggerMultiplicity(0),
157 fTriggerMultiplicityEta(0),
19896767 158 fTriggerMultiplicityPtMin(0),
159 fkTuneForDiff(0),
5fed2e29 160 fProcDiff(0),
7cbda79e 161 fFragmentation(kFALSE),
162 fHeader(0x0)
163
5fed2e29 164
ba758f5a 165{
f97d4a8e 166 // Dummy copy constructor
e7c989e4 167 fEnergyCMS = 5500.;
ba758f5a 168}
1a52e0ed 169
170//______________________________________________________________________________
171AliGenDPMjet::~AliGenDPMjet()
172{
173// Destructor
1a52e0ed 174}
1a52e0ed 175//______________________________________________________________________________
176void AliGenDPMjet::Init()
177{
178// Initialization
179
7cbda79e 180 if(fEnergyCMS>0. && fBeamEn<0.1) fBeamEn = fEnergyCMS/2;
e67e0fb7 181 SetMC(new TDPMjet(fProcess, fAProjectile, fZProjectile, fATarget, fZTarget,
1a52e0ed 182 fBeamEn,fEnergyCMS));
183
35c87559 184 fDPMjet=(TDPMjet*) fMCEvGen;
7cbda79e 185 if (fAProjectile == 1 && TMath::Abs(fZProjectile == 1)) fDPMjet->SetfIdp(1);
186
1a52e0ed 187 // **** Flag to force central production
188 // fICentr=1. central production forced
189 // fICentr<0 && fICentr>-100 -> bmin = fMinImpactParam, bmax = fMaxImpactParam
190 // fICentr<-99 -> fraction of x-sec. = XSFRAC
191 // fICentr=-1. -> evaporation/fzc suppressed
7cbda79e 192 // fICentr<-1. -> evaporation/fzc allowed
1a52e0ed 193 fDPMjet->SetfFCentr(fICentr);
7cbda79e 194
e67e0fb7 195 fDPMjet->SetbRange(fMinImpactParam, fMaxImpactParam);
f97d4a8e 196 fDPMjet->SetPi0Decay(fPi0Decay);
717765ce 197 fDPMjet->SetDecayAll(fDecayAll);
5fed2e29 198 fDPMjet->SetFragmentProd(fFragmentation);
e2b2a1dd 199
1a52e0ed 200//
201// Initialize DPMjet
202//
203 fDPMjet->Initialize();
1a52e0ed 204}
205
206
207//______________________________________________________________________________
208void AliGenDPMjet::Generate()
209{
210// Generate one event
211
c0d429ef 212 Double_t polar[3] = {0,0,0};
213 Double_t origin[3] = {0,0,0};
214 Double_t p[4] = {0};
1a52e0ed 215 Float_t tof;
216
217// converts from mm/c to s
218 const Float_t kconv = 0.001/2.999792458e8;
219 Int_t nt = 0;
220 Int_t jev = 0;
e67e0fb7 221 Int_t kf, ks, imo;
1a52e0ed 222 kf = 0;
1a52e0ed 223 fTrials = 0;
74471936 224 fNprimaries = 0;
e67e0fb7 225 // Set collision vertex position
226 if (fVertexSmear == kPerEvent) Vertex();
1a52e0ed 227
228 while(1)
229 {
230// Generate one event
231// --------------------------------------------------------------------------
232 fSpecn = 0;
233 fSpecp = 0;
234// --------------------------------------------------------------------------
235 fDPMjet->GenerateEvent();
9c97cedd 236
1a52e0ed 237 fTrials++;
238
8507138f 239 fDPMjet->ImportParticles(&fParticles,"All");
1a52e0ed 240 if (fLHC) Boost();
241
242 // Temporaneo
243 fGenImpPar = fDPMjet->GetBImpac();
41cc7c18 244
245 if(TMath::Abs(fXingAngleY) > 1.e-10) BeamCrossAngle();
246
8507138f 247 Int_t np = fParticles.GetEntriesFast();
3b50c39e 248 //
249 // Multiplicity Trigger
250 if (fTriggerMultiplicity > 0) {
251 Int_t multiplicity = 0;
252 for (Int_t i = 0; i < np; i++) {
253 TParticle * iparticle = (TParticle *) fParticles.At(i);
254
255 Int_t statusCode = iparticle->GetStatusCode();
256
257 // Initial state particle
258 if (statusCode != 1)
259 continue;
260 // eta cut
261 if (fTriggerMultiplicityEta > 0 && TMath::Abs(iparticle->Eta()) > fTriggerMultiplicityEta)
262 continue;
263 // pt cut
264 if (iparticle->Pt() < fTriggerMultiplicityPtMin)
265 continue;
266
267 TParticlePDG* pdgPart = iparticle->GetPDG();
268 if (pdgPart && pdgPart->Charge() == 0)
269 continue;
270 ++multiplicity;
271 }
272 //
273 //
274 if (multiplicity < fTriggerMultiplicity) continue;
275 Printf("Triggered on event with multiplicity of %d >= %d", multiplicity, fTriggerMultiplicity);
276 }
277
631cb555 278 //Trigger on the presence of a given particle in some phase space
279 if (fTriggerParticle) {
280 Bool_t triggered = kFALSE;
281 for (Long_t i = 0; i < np; i++) {
282 TParticle * iparticle = (TParticle *) fParticles.At(i);
283 kf = CheckPDGCode(iparticle->GetPdgCode());
284 if (kf != fTriggerParticle) continue;
285 if (iparticle->Pt() == 0.) continue;
286 if (TMath::Abs(iparticle->Eta()) > fTriggerEta) continue;
287 if ( iparticle->Pt() > fTriggerMaxPt || iparticle->Pt() < fTriggerMinPt ) continue;
288 triggered = kTRUE;
289 break;
290 }
291 if (!triggered) continue;
292 }
19896767 293
c5dfa3e4 294 if(fkTuneForDiff && ( (TMath::Abs(fEnergyCMS - 900) < 1) || (TMath::Abs(fEnergyCMS - 2760) < 1) || (TMath::Abs(fEnergyCMS - 7000) < 1)) ) {
19896767 295 if(!CheckDiffraction() ) continue;
296 }
297
298
3b50c39e 299 Int_t nc = 0;
300 if (np == 0) continue;
301
1a52e0ed 302 Int_t i;
303 Int_t* newPos = new Int_t[np];
304 Int_t* pSelected = new Int_t[np];
305
306 for (i = 0; i<np; i++) {
307 newPos[i] = i;
308 pSelected[i] = 0;
309 }
310
1a52e0ed 311// First select parent particles
312
313 for (i = 0; i<np; i++) {
8507138f 314 TParticle *iparticle = (TParticle *) fParticles.At(i);
1a52e0ed 315
316// Is this a parent particle ?
317
318 if (Stable(iparticle)) continue;
319
320 Bool_t selected = kTRUE;
321 Bool_t hasSelectedDaughters = kFALSE;
322
323 kf = iparticle->GetPdgCode();
cd19c617 324 if (kf == 92 || kf == 99999) continue;
1a52e0ed 325 ks = iparticle->GetStatusCode();
326// No initial state partons
327 if (ks==21) continue;
1a52e0ed 328 if (!fSelectAll) selected = KinematicSelection(iparticle, 0) &&
329 SelectFlavor(kf);
9c97cedd 330
331
1a52e0ed 332 hasSelectedDaughters = DaughtersSelection(iparticle);
333
9c97cedd 334
1a52e0ed 335// Put particle on the stack if it is either selected or
336// it is the mother of at least one seleted particle
337
338 if (selected || hasSelectedDaughters) {
339 nc++;
340 pSelected[i] = 1;
341 } // selected
342 } // particle loop parents
343
344// Now select the final state particles
345
346
347 for (i=0; i<np; i++) {
8507138f 348 TParticle *iparticle = (TParticle *) fParticles.At(i);
1a52e0ed 349
350// Is this a final state particle ?
351
352 if (!Stable(iparticle)) continue;
353
354 Bool_t selected = kTRUE;
355 kf = iparticle->GetPdgCode();
356 ks = iparticle->GetStatusCode();
357
358// --------------------------------------------------------------------------
359// Count spectator neutrons and protons (ks == 13, 14)
360 if(ks == 13 || ks == 14){
361 if(kf == kNeutron) fSpecn += 1;
362 if(kf == kProton) fSpecp += 1;
363 }
364// --------------------------------------------------------------------------
365
366 if (!fSelectAll) {
367 selected = KinematicSelection(iparticle,0)&&SelectFlavor(kf);
368 if (!fSpectators && selected) selected = (ks == 13 || ks == 14);
369 }
370
371// Put particle on the stack if selected
372
373 if (selected) {
374 nc++;
375 pSelected[i] = 1;
376 } // selected
377 } // particle loop final state
378
379// Write particles to stack
380
381 for (i = 0; i<np; i++) {
8507138f 382 TParticle * iparticle = (TParticle *) fParticles.At(i);
1a52e0ed 383 Bool_t hasMother = (iparticle->GetFirstMother()>=0);
1a52e0ed 384 if (pSelected[i]) {
385
386 kf = iparticle->GetPdgCode();
1a52e0ed 387 ks = iparticle->GetStatusCode();
388
389 p[0] = iparticle->Px();
390 p[1] = iparticle->Py();
391 p[2] = iparticle->Pz();
c0d429ef 392 p[3] = iparticle->Energy();
e67e0fb7 393 origin[0] = fVertex[0]+iparticle->Vx()/10; // [cm]
394 origin[1] = fVertex[1]+iparticle->Vy()/10; // [cm]
395 origin[2] = fVertex[2]+iparticle->Vz()/10; // [cm]
396
21391258 397 tof = fTime + kconv*iparticle->T();
1a52e0ed 398
399 imo = -1;
400 TParticle* mother = 0;
401 if (hasMother) {
402 imo = iparticle->GetFirstMother();
8507138f 403 mother = (TParticle *) fParticles.At(imo);
cd19c617 404 imo = (mother->GetPdgCode() != 92 && mother->GetPdgCode() != 99999) ? newPos[imo] : -1;
1a52e0ed 405 } // if has mother
406
9c97cedd 407
408
3f1688cf 409 Bool_t tFlag = (fTrackIt && (ks==1 || ks==-1));
410 //printf(" AliGemDPMJet->PushTrack: kf %d ks %d flag %d\n",kf,ks,tFlag);
411 if(kf>10000 && (ks==-1 || ks==1000 || ks==1001)) kf += 1000000000;
c0d429ef 412 PushTrack(tFlag, imo, kf,
413 p[0], p[1], p[2], p[3],
414 origin[0], origin[1], origin[2], tof,
415 polar[0], polar[1], polar[2],
416 kPNoProcess, nt, 1., ks);
1a52e0ed 417 KeepTrack(nt);
74471936 418 fNprimaries++;
1a52e0ed 419 newPos[i] = nt;
420 } // if selected
421 } // particle loop
422 delete[] newPos;
423 delete[] pSelected;
1a52e0ed 424 if (nc>0) {
425 jev += nc;
426 if (jev >= fNpart || fNpart == -1) {
1a52e0ed 427 break;
428 }
1a52e0ed 429 }
430 } // event loop
431 MakeHeader();
432 SetHighWaterMark(nt);
433}
434
1a52e0ed 435//______________________________________________________________________________
436Bool_t AliGenDPMjet::DaughtersSelection(TParticle* iparticle)
437{
438//
439// Looks recursively if one of the daughters has been selected
440//
441// printf("\n Consider daughters %d:",iparticle->GetPdgCode());
442 Int_t imin = -1;
443 Int_t imax = -1;
444 Int_t i;
445 Bool_t hasDaughters = (iparticle->GetFirstDaughter() >=0);
446 Bool_t selected = kFALSE;
447 if (hasDaughters) {
448 imin = iparticle->GetFirstDaughter();
449 imax = iparticle->GetLastDaughter();
450 for (i = imin; i <= imax; i++){
8507138f 451 TParticle * jparticle = (TParticle *) fParticles.At(i);
1a52e0ed 452 Int_t ip = jparticle->GetPdgCode();
453 if (KinematicSelection(jparticle,0)&&SelectFlavor(ip)) {
454 selected=kTRUE; break;
455 }
456 if (DaughtersSelection(jparticle)) {selected=kTRUE; break; }
457 }
458 } else {
459 return kFALSE;
460 }
461 return selected;
462}
463
464
465
466//______________________________________________________________________________
467Bool_t AliGenDPMjet::SelectFlavor(Int_t pid)
468{
469// Select flavor of particle
470// 0: all
471// 4: charm and beauty
472// 5: beauty
473 Bool_t res = 0;
474
475 if (fFlavor == 0) {
476 res = kTRUE;
477 } else {
478 Int_t ifl = TMath::Abs(pid/100);
479 if (ifl > 10) ifl/=10;
480 res = (fFlavor == ifl);
481 }
482//
483// This part if gamma writing is inhibited
484 if (fNoGammas)
485 res = res && (pid != kGamma && pid != kPi0);
486//
487 return res;
488}
489
490//______________________________________________________________________________
491Bool_t AliGenDPMjet::Stable(TParticle* particle)
492{
493// Return true for a stable particle
494//
3f1688cf 495 int st = particle->GetStatusCode();
496 if(st == 1 || st == -1) return kTRUE;
1a52e0ed 497 else return kFALSE;
498
499}
500
1a52e0ed 501//______________________________________________________________________________
502void AliGenDPMjet::MakeHeader()
503{
504// Builds the event header, to be called after each event
74471936 505 fHeader.SetNProduced(fNprimaries);
7cbda79e 506 fHeader.SetImpactParameter(fDPMjet->GetBImpac());
507 fHeader.SetTotalEnergy(fDPMjet->GetTotEnergy());
508 fHeader.SetParticipants(fDPMjet->GetProjParticipants(),
509 fDPMjet->GetTargParticipants());
510
511 fHeader.SetCollisions(DTGLCP.ncp, DTGLCP.nct,
512 fDPMjet->GetProjWounded(),fDPMjet->GetTargWounded());
513
514 if(fProcDiff>0) fHeader.SetProcessType(fProcDiff);
515 else fHeader.SetProcessType(fDPMjet->GetProcessCode());
19896767 516
3c349853 517 // Bookkeeping for kinematic bias
7cbda79e 518 fHeader.SetTrials(fTrials);
3c349853 519 // Event Vertex
7cbda79e 520 fHeader.SetPrimaryVertex(fVertex);
521 fHeader.SetInteractionTime(fTime);
522 fHeader.SetNDiffractive(POEVT1.nsd1, POEVT1.nsd2, POEVT1.ndd);
523// gAlice->SetGenEventHeader(fHeader);
524 AddHeader(&fHeader);
525 fCollisionGeometry = &fHeader;
1a52e0ed 526}
527
7cbda79e 528//______________________________________________________________________________
529/*void AliGenDPMjet::AddHeader(AliGenEventHeader* fHeader)
9dcc0beb 530{
7cbda79e 531 // Add fHeader to container or runloader
9dcc0beb 532 if (fContainer) {
7cbda79e 533 fContainer->AddHeader(fHeader);
9dcc0beb 534 } else {
7cbda79e 535 AliRunLoader::Instance()->GetHeader()->SetGenEventHeader(fHeader);
9dcc0beb 536 }
7cbda79e 537}*/
1a52e0ed 538
539
540//______________________________________________________________________________
ba758f5a 541AliGenDPMjet& AliGenDPMjet::operator=(const AliGenDPMjet& /*rhs*/)
1a52e0ed 542{
543// Assignment operator
544 return *this;
545}
546
547
e2b2a1dd 548//______________________________________________________________________________
d2593e7a 549void AliGenDPMjet::FinishRun()
550{
551 // Print run statistics
552 fDPMjet->Dt_Dtuout();
553}
554
19896767 555
e2b2a1dd 556//______________________________________________________________________________
19896767 557Bool_t AliGenDPMjet::CheckDiffraction()
558{
559
560 // printf("AAA\n");
561
562 Int_t np = fParticles.GetEntriesFast();
563
564 Int_t iPart1=-1;
565 Int_t iPart2=-1;
566
567 Double_t y1 = 1e10;
568 Double_t y2 = -1e10;
569
570 const Int_t kNstable=20;
571 const Int_t pdgStable[20] = {
572 22, // Photon
573 11, // Electron
574 12, // Electron Neutrino
575 13, // Muon
576 14, // Muon Neutrino
577 15, // Tau
578 16, // Tau Neutrino
579 211, // Pion
580 321, // Kaon
581 311, // K0
582 130, // K0s
583 310, // K0l
584 2212, // Proton
585 2112, // Neutron
586 3122, // Lambda_0
587 3112, // Sigma Minus
588 3222, // Sigma Plus
589 3312, // Xsi Minus
590 3322, // Xsi0
591 3334 // Omega
592 };
d2593e7a 593
19896767 594 for (Int_t i = 0; i < np; i++) {
595 TParticle * part = (TParticle *) fParticles.At(i);
596
597 Int_t statusCode = part->GetStatusCode();
598
599 // Initial state particle
600 if (statusCode != 1)
601 continue;
602
603 Int_t pdg = TMath::Abs(part->GetPdgCode());
604 Bool_t isStable = kFALSE;
605 for (Int_t i1 = 0; i1 < kNstable; i1++) {
606 if (pdg == pdgStable[i1]) {
607 isStable = kTRUE;
608 break;
609 }
610 }
611 if(!isStable)
612 continue;
613
614 Double_t y = part->Y();
615
616 if (y < y1)
617 {
618 y1 = y;
619 iPart1 = i;
620 }
621 if (y > y2)
622 {
623 y2 = y;
624 iPart2 = i;
625 }
626 }
627
628 if(iPart1<0 || iPart2<0) return kFALSE;
629
630 y1=TMath::Abs(y1);
631 y2=TMath::Abs(y2);
632
633 TParticle * part1 = (TParticle *) fParticles.At(iPart1);
634 TParticle * part2 = (TParticle *) fParticles.At(iPart2);
635
636 Int_t pdg1 = part1->GetPdgCode();
637 Int_t pdg2 = part2->GetPdgCode();
638
639
640 Int_t iPart = -1;
641 if (pdg1 == 2212 && pdg2 == 2212)
642 {
643 if(y1 > y2)
644 iPart = iPart1;
645 else if(y1 < y2)
646 iPart = iPart2;
647 else {
648 iPart = iPart1;
649 if((AliDpmJetRndm::GetDpmJetRandom())->Uniform(0.,1.)>0.5) iPart = iPart2;
650 }
651 }
652 else if (pdg1 == 2212)
653 iPart = iPart1;
654 else if (pdg2 == 2212)
655 iPart = iPart2;
656
657
658
659
660
661 Double_t M=-1.;
662 if(iPart>0) {
663 TParticle * part = (TParticle *) fParticles.At(iPart);
664 Double_t E= part->Energy();
665 Double_t P= part->P();
4f813e90 666 Double_t M2 = (fEnergyCMS-E-P)*(fEnergyCMS-E+P);
667 if(M2<0) return kFALSE;
668 M= TMath::Sqrt(M2);
19896767 669 }
670
c5dfa3e4 671 Double_t Mmin, Mmax, wSD, wDD, wND;
672
673 if(!GetWeightsDiffraction(M, Mmin, Mmax, wSD, wDD, wND)) return kFALSE;
674 if(M>-1 && M<Mmin) return kFALSE;
675 if(M>Mmax) M=-1;
676
19896767 677
678 Int_t procType=fDPMjet->GetProcessCode();//fPythia->GetMSTI(1);
c5dfa3e4 679 if(procType== 4) return kFALSE;
19896767 680 Int_t proc0=2;
681 if(procType== 7) proc0=1;
682 if(procType== 5 || procType== 6) proc0=0;
683
684
19896767 685 Int_t proc=2;
686 if(M>0) proc=0;
687 else if(proc0==1) proc=1;
688
19896767 689 if(proc==1 && (AliDpmJetRndm::GetDpmJetRandom())->Uniform(0.,1.) > wDD) return kFALSE;
690 if(proc==2 && (AliDpmJetRndm::GetDpmJetRandom())->Uniform(0.,1.) > wND) return kFALSE;
691
692
19896767 693
694 if(proc!=0) {
695 if(proc0!=0) fProcDiff = procType;
696 else fProcDiff = 1;
697 return kTRUE;
698 }
699
c5dfa3e4 700 if(wSD<0) AliError("wSD<0 ! \n");
19896767 701
c5dfa3e4 702 if((AliDpmJetRndm::GetDpmJetRandom())->Uniform(0.,1.)> wSD) return kFALSE;
19896767 703
704 // printf("iPart = %d\n", iPart);
705
706 if(iPart==iPart1) fProcDiff=5;
707 else if(iPart==iPart2) fProcDiff=6;
708 else {
709 printf("EROOR: iPart!=iPart1 && iPart!=iPart2\n");
710
711 }
712
713 return kTRUE;
714}
715
3f1688cf 716// -------------------------------------------------------
717void AliGenDPMjet::SetIonPDGCodes()
718{
719 // Defining PDG codes for the ions
720 AliIonPDGCodes *pdgcodes = new AliIonPDGCodes();
721 pdgcodes->AddParticlesToPdgDataBase();
722}
1a52e0ed 723
3f1688cf 724// -------------------------------------------------------
c5dfa3e4 725Bool_t AliGenDPMjet::GetWeightsDiffraction(Double_t M, Double_t &Mmin, Double_t &Mmax,
726 Double_t &wSD, Double_t &wDD, Double_t &wND)
727{
728
729 if(TMath::Abs(fEnergyCMS-900)<1 ){
730const Int_t nbin=400;
731Double_t bin[]={
7321.080000, 1.577300, 2.074600, 2.571900, 3.069200, 3.566500,
7334.063800, 4.561100, 5.058400, 5.555700, 6.053000, 6.550300,
7347.047600, 7.544900, 8.042200, 8.539500, 9.036800, 9.534100,
73510.031400, 10.528700, 11.026000, 11.523300, 12.020600, 12.517900,
73613.015200, 13.512500, 14.009800, 14.507100, 15.004400, 15.501700,
73715.999000, 16.496300, 16.993600, 17.490900, 17.988200, 18.485500,
73818.982800, 19.480100, 19.977400, 20.474700, 20.972000, 21.469300,
73921.966600, 22.463900, 22.961200, 23.458500, 23.955800, 24.453100,
74024.950400, 25.447700, 25.945000, 26.442300, 26.939600, 27.436900,
74127.934200, 28.431500, 28.928800, 29.426100, 29.923400, 30.420700,
74230.918000, 31.415300, 31.912600, 32.409900, 32.907200, 33.404500,
74333.901800, 34.399100, 34.896400, 35.393700, 35.891000, 36.388300,
74436.885600, 37.382900, 37.880200, 38.377500, 38.874800, 39.372100,
74539.869400, 40.366700, 40.864000, 41.361300, 41.858600, 42.355900,
74642.853200, 43.350500, 43.847800, 44.345100, 44.842400, 45.339700,
74745.837000, 46.334300, 46.831600, 47.328900, 47.826200, 48.323500,
74848.820800, 49.318100, 49.815400, 50.312700, 50.810000, 51.307300,
74951.804600, 52.301900, 52.799200, 53.296500, 53.793800, 54.291100,
75054.788400, 55.285700, 55.783000, 56.280300, 56.777600, 57.274900,
75157.772200, 58.269500, 58.766800, 59.264100, 59.761400, 60.258700,
75260.756000, 61.253300, 61.750600, 62.247900, 62.745200, 63.242500,
75363.739800, 64.237100, 64.734400, 65.231700, 65.729000, 66.226300,
75466.723600, 67.220900, 67.718200, 68.215500, 68.712800, 69.210100,
75569.707400, 70.204700, 70.702000, 71.199300, 71.696600, 72.193900,
75672.691200, 73.188500, 73.685800, 74.183100, 74.680400, 75.177700,
75775.675000, 76.172300, 76.669600, 77.166900, 77.664200, 78.161500,
75878.658800, 79.156100, 79.653400, 80.150700, 80.648000, 81.145300,
75981.642600, 82.139900, 82.637200, 83.134500, 83.631800, 84.129100,
76084.626400, 85.123700, 85.621000, 86.118300, 86.615600, 87.112900,
76187.610200, 88.107500, 88.604800, 89.102100, 89.599400, 90.096700,
76290.594000, 91.091300, 91.588600, 92.085900, 92.583200, 93.080500,
76393.577800, 94.075100, 94.572400, 95.069700, 95.567000, 96.064300,
76496.561600, 97.058900, 97.556200, 98.053500, 98.550800, 99.048100,
76599.545400, 100.042700, 100.540000, 101.037300, 101.534600, 102.031900,
766102.529200, 103.026500, 103.523800, 104.021100, 104.518400, 105.015700,
767105.513000, 106.010300, 106.507600, 107.004900, 107.502200, 107.999500,
768108.496800, 108.994100, 109.491400, 109.988700, 110.486000, 110.983300,
769111.480600, 111.977900, 112.475200, 112.972500, 113.469800, 113.967100,
770114.464400, 114.961700, 115.459000, 115.956300, 116.453600, 116.950900,
771117.448200, 117.945500, 118.442800, 118.940100, 119.437400, 119.934700,
772120.432000, 120.929300, 121.426600, 121.923900, 122.421200, 122.918500,
773123.415800, 123.913100, 124.410400, 124.907700, 125.405000, 125.902300,
774126.399600, 126.896900, 127.394200, 127.891500, 128.388800, 128.886100,
775129.383400, 129.880700, 130.378000, 130.875300, 131.372600, 131.869900,
776132.367200, 132.864500, 133.361800, 133.859100, 134.356400, 134.853700,
777135.351000, 135.848300, 136.345600, 136.842900, 137.340200, 137.837500,
778138.334800, 138.832100, 139.329400, 139.826700, 140.324000, 140.821300,
779141.318600, 141.815900, 142.313200, 142.810500, 143.307800, 143.805100,
780144.302400, 144.799700, 145.297000, 145.794300, 146.291600, 146.788900,
781147.286200, 147.783500, 148.280800, 148.778100, 149.275400, 149.772700,
782150.270000, 150.767300, 151.264600, 151.761900, 152.259200, 152.756500,
783153.253800, 153.751100, 154.248400, 154.745700, 155.243000, 155.740300,
784156.237600, 156.734900, 157.232200, 157.729500, 158.226800, 158.724100,
785159.221400, 159.718700, 160.216000, 160.713300, 161.210600, 161.707900,
786162.205200, 162.702500, 163.199800, 163.697100, 164.194400, 164.691700,
787165.189000, 165.686300, 166.183600, 166.680900, 167.178200, 167.675500,
788168.172800, 168.670100, 169.167400, 169.664700, 170.162000, 170.659300,
789171.156600, 171.653900, 172.151200, 172.648500, 173.145800, 173.643100,
790174.140400, 174.637700, 175.135000, 175.632300, 176.129600, 176.626900,
791177.124200, 177.621500, 178.118800, 178.616100, 179.113400, 179.610700,
792180.108000, 180.605300, 181.102600, 181.599900, 182.097200, 182.594500,
793183.091800, 183.589100, 184.086400, 184.583700, 185.081000, 185.578300,
794186.075600, 186.572900, 187.070200, 187.567500, 188.064800, 188.562100,
795189.059400, 189.556700, 190.054000, 190.551300, 191.048600, 191.545900,
796192.043200, 192.540500, 193.037800, 193.535100, 194.032400, 194.529700,
797195.027000, 195.524300, 196.021600, 196.518900, 197.016200, 197.513500,
798198.010800, 198.508100, 199.005400, 199.502700, 200.000000};
799Double_t w[]={
8001.000000, 0.389079, 0.326612, 0.356363, 0.310726, 0.264037,
8010.253810, 0.224655, 0.207990, 0.198149, 0.186803, 0.180209,
8020.178928, 0.161772, 0.162314, 0.158409, 0.148379, 0.143557,
8030.140357, 0.136272, 0.136957, 0.136606, 0.129376, 0.127671,
8040.128406, 0.132239, 0.119311, 0.130227, 0.130233, 0.123312,
8050.115257, 0.120105, 0.119733, 0.117116, 0.110096, 0.117509,
8060.109149, 0.114372, 0.100322, 0.106227, 0.108696, 0.110352,
8070.106748, 0.101475, 0.101837, 0.098585, 0.094433, 0.100148,
8080.096505, 0.100155, 0.103526, 0.098161, 0.093647, 0.100121,
8090.097426, 0.093414, 0.090241, 0.097228, 0.098098, 0.098340,
8100.096779, 0.099265, 0.095101, 0.090342, 0.097469, 0.090663,
8110.093422, 0.093103, 0.089648, 0.096923, 0.088079, 0.089360,
8120.097772, 0.092932, 0.093554, 0.085784, 0.096395, 0.096304,
8130.090183, 0.089255, 0.090265, 0.086262, 0.087044, 0.088965,
8140.085825, 0.095073, 0.085933, 0.091005, 0.091707, 0.092428,
8150.091689, 0.091224, 0.095256, 0.083407, 0.087983, 0.090320,
8160.081580, 0.088077, 0.083478, 0.091309, 0.083734, 0.089906,
8170.100155, 0.092728, 0.086542, 0.078091, 0.085261, 0.094302,
8180.078063, 0.090070, 0.086566, 0.095020, 0.082124, 0.084791,
8190.090624, 0.090236, 0.086344, 0.085706, 0.085913, 0.083107,
8200.092557, 0.081144, 0.091254, 0.096139, 0.079458, 0.088124,
8210.088777, 0.076652, 0.085168, 0.082326, 0.080435, 0.085022,
8220.085693, 0.093957, 0.088134, 0.082347, 0.082139, 0.090980,
8230.078397, 0.093595, 0.091562, 0.081789, 0.085026, 0.080868,
8240.083455, 0.084590, 0.084124, 0.081486, 0.087242, 0.080928,
8250.096392, 0.078324, 0.092093, 0.074267, 0.082925, 0.090717,
8260.081467, 0.080435, 0.078825, 0.075843, 0.088940, 0.081451,
8270.096047, 0.088102, 0.091710, 0.095208, 0.086160, 0.091305,
8280.085406, 0.094432, 0.078227, 0.099870, 0.094140, 0.080130,
8290.090707, 0.083268, 0.082222, 0.088767, 0.084477, 0.088069,
8300.089382, 0.086164, 0.089123, 0.092799, 0.076710, 0.090727,
8310.077097, 0.099905, 0.089733, 0.088101, 0.093705, 0.089215,
8320.085110, 0.086032, 0.083719, 0.079693, 0.088116, 0.090519,
8330.091150, 0.090855, 0.090547, 0.077773, 0.081914, 0.080864,
8340.082935, 0.092952, 0.079390, 0.080255, 0.091123, 0.091331,
8350.095160, 0.089343, 0.083353, 0.087445, 0.094036, 0.084719,
8360.099665, 0.085104, 0.100912, 0.085958, 0.083972, 0.098284,
8370.078318, 0.082042, 0.088007, 0.085469, 0.089984, 0.081181,
8380.098850, 0.086409, 0.089070, 0.081579, 0.089622, 0.089396,
8390.093922, 0.089472, 0.090806, 0.075034, 0.090346, 0.083871,
8400.086931, 0.089207, 0.094425, 0.087830, 0.079537, 0.097316,
8410.096513, 0.092264, 0.082211, 0.083841, 0.081861, 0.092591,
8420.077785, 0.079646, 0.093721, 0.090735, 0.086910, 0.075837,
8430.090729, 0.092800, 0.098704, 0.092441, 0.086404, 0.089344,
8440.083650, 0.082569, 0.085753, 0.091430, 0.085460, 0.095210,
8450.083226, 0.094882, 0.084856, 0.093350, 0.084579, 0.096744,
8460.099211, 0.085142, 0.085499, 0.083395, 0.088352, 0.110418,
8470.093788, 0.096140, 0.082758, 0.097145, 0.089170, 0.090720,
8480.084708, 0.095927, 0.090330, 0.074239, 0.089532, 0.090514,
8490.089823, 0.089709, 0.101840, 0.082676, 0.087157, 0.079221,
8500.096460, 0.108192, 0.088904, 0.084510, 0.096624, 0.099242,
8510.094470, 0.092473, 0.091745, 0.090439, 0.095316, 0.087963,
8520.096400, 0.089479, 0.094880, 0.085964, 0.092775, 0.083200,
8530.095133, 0.090079, 0.088828, 0.087600, 0.094123, 0.089135,
8540.082617, 0.085109, 0.114091, 0.096331, 0.108465, 0.080318,
8550.106576, 0.089671, 0.092023, 0.090722, 0.086603, 0.091788,
8560.098375, 0.082712, 0.102681, 0.098869, 0.089051, 0.109972,
8570.080440, 0.097860, 0.093074, 0.097028, 0.107826, 0.117152,
8580.090968, 0.096790, 0.096725, 0.094641, 0.089535, 0.092561,
8590.095828, 0.084320, 0.089942, 0.105476, 0.087495, 0.089805,
8600.092238, 0.094141, 0.104390, 0.082958, 0.097449, 0.099594,
8610.092640, 0.097332, 0.093223, 0.100183, 0.092511, 0.087035,
8620.088741, 0.097856, 0.116682, 0.091732, 0.097753, 0.094283,
8630.094235, 0.082016, 0.098370, 0.085676, 0.104529, 0.087319,
8640.090289, 0.105314, 0.103634, 0.101261, 0.092764, 0.098217,
8650.098939, 0.096071, 0.096071, 0.094027, 0.092713, 0.089542,
8660.112293, 0.112293, 0.089531, 0.087752};
867wDD = 0.188264;
868wND = 0.102252;
869wSD = -1;
870
871 Mmin = bin[0];
872 Mmax = bin[nbin];
873 if(M<Mmin || M>Mmax) return kTRUE;
874
875 Int_t ibin=nbin-1;
876 for(Int_t i=1; i<=nbin; i++)
877 if(M<=bin[i]) {
878 ibin=i-1;
879 // printf("Mi> %f && Mi< %f\n", bin[i-1], bin[i]);
880 break;
881 }
882 wSD=w[ibin];
883 return kTRUE;
884
885 }
886 else if(TMath::Abs(fEnergyCMS-2760)<1 ){
887
888const Int_t nbin=400;
889Double_t bin[]={
8901.080000, 1.577300, 2.074600, 2.571900, 3.069200, 3.566500,
8914.063800, 4.561100, 5.058400, 5.555700, 6.053000, 6.550300,
8927.047600, 7.544900, 8.042200, 8.539500, 9.036800, 9.534100,
89310.031400, 10.528700, 11.026000, 11.523300, 12.020600, 12.517900,
89413.015200, 13.512500, 14.009800, 14.507100, 15.004400, 15.501700,
89515.999000, 16.496300, 16.993600, 17.490900, 17.988200, 18.485500,
89618.982800, 19.480100, 19.977400, 20.474700, 20.972000, 21.469300,
89721.966600, 22.463900, 22.961200, 23.458500, 23.955800, 24.453100,
89824.950400, 25.447700, 25.945000, 26.442300, 26.939600, 27.436900,
89927.934200, 28.431500, 28.928800, 29.426100, 29.923400, 30.420700,
90030.918000, 31.415300, 31.912600, 32.409900, 32.907200, 33.404500,
90133.901800, 34.399100, 34.896400, 35.393700, 35.891000, 36.388300,
90236.885600, 37.382900, 37.880200, 38.377500, 38.874800, 39.372100,
90339.869400, 40.366700, 40.864000, 41.361300, 41.858600, 42.355900,
90442.853200, 43.350500, 43.847800, 44.345100, 44.842400, 45.339700,
90545.837000, 46.334300, 46.831600, 47.328900, 47.826200, 48.323500,
90648.820800, 49.318100, 49.815400, 50.312700, 50.810000, 51.307300,
90751.804600, 52.301900, 52.799200, 53.296500, 53.793800, 54.291100,
90854.788400, 55.285700, 55.783000, 56.280300, 56.777600, 57.274900,
90957.772200, 58.269500, 58.766800, 59.264100, 59.761400, 60.258700,
91060.756000, 61.253300, 61.750600, 62.247900, 62.745200, 63.242500,
91163.739800, 64.237100, 64.734400, 65.231700, 65.729000, 66.226300,
91266.723600, 67.220900, 67.718200, 68.215500, 68.712800, 69.210100,
91369.707400, 70.204700, 70.702000, 71.199300, 71.696600, 72.193900,
91472.691200, 73.188500, 73.685800, 74.183100, 74.680400, 75.177700,
91575.675000, 76.172300, 76.669600, 77.166900, 77.664200, 78.161500,
91678.658800, 79.156100, 79.653400, 80.150700, 80.648000, 81.145300,
91781.642600, 82.139900, 82.637200, 83.134500, 83.631800, 84.129100,
91884.626400, 85.123700, 85.621000, 86.118300, 86.615600, 87.112900,
91987.610200, 88.107500, 88.604800, 89.102100, 89.599400, 90.096700,
92090.594000, 91.091300, 91.588600, 92.085900, 92.583200, 93.080500,
92193.577800, 94.075100, 94.572400, 95.069700, 95.567000, 96.064300,
92296.561600, 97.058900, 97.556200, 98.053500, 98.550800, 99.048100,
92399.545400, 100.042700, 100.540000, 101.037300, 101.534600, 102.031900,
924102.529200, 103.026500, 103.523800, 104.021100, 104.518400, 105.015700,
925105.513000, 106.010300, 106.507600, 107.004900, 107.502200, 107.999500,
926108.496800, 108.994100, 109.491400, 109.988700, 110.486000, 110.983300,
927111.480600, 111.977900, 112.475200, 112.972500, 113.469800, 113.967100,
928114.464400, 114.961700, 115.459000, 115.956300, 116.453600, 116.950900,
929117.448200, 117.945500, 118.442800, 118.940100, 119.437400, 119.934700,
930120.432000, 120.929300, 121.426600, 121.923900, 122.421200, 122.918500,
931123.415800, 123.913100, 124.410400, 124.907700, 125.405000, 125.902300,
932126.399600, 126.896900, 127.394200, 127.891500, 128.388800, 128.886100,
933129.383400, 129.880700, 130.378000, 130.875300, 131.372600, 131.869900,
934132.367200, 132.864500, 133.361800, 133.859100, 134.356400, 134.853700,
935135.351000, 135.848300, 136.345600, 136.842900, 137.340200, 137.837500,
936138.334800, 138.832100, 139.329400, 139.826700, 140.324000, 140.821300,
937141.318600, 141.815900, 142.313200, 142.810500, 143.307800, 143.805100,
938144.302400, 144.799700, 145.297000, 145.794300, 146.291600, 146.788900,
939147.286200, 147.783500, 148.280800, 148.778100, 149.275400, 149.772700,
940150.270000, 150.767300, 151.264600, 151.761900, 152.259200, 152.756500,
941153.253800, 153.751100, 154.248400, 154.745700, 155.243000, 155.740300,
942156.237600, 156.734900, 157.232200, 157.729500, 158.226800, 158.724100,
943159.221400, 159.718700, 160.216000, 160.713300, 161.210600, 161.707900,
944162.205200, 162.702500, 163.199800, 163.697100, 164.194400, 164.691700,
945165.189000, 165.686300, 166.183600, 166.680900, 167.178200, 167.675500,
946168.172800, 168.670100, 169.167400, 169.664700, 170.162000, 170.659300,
947171.156600, 171.653900, 172.151200, 172.648500, 173.145800, 173.643100,
948174.140400, 174.637700, 175.135000, 175.632300, 176.129600, 176.626900,
949177.124200, 177.621500, 178.118800, 178.616100, 179.113400, 179.610700,
950180.108000, 180.605300, 181.102600, 181.599900, 182.097200, 182.594500,
951183.091800, 183.589100, 184.086400, 184.583700, 185.081000, 185.578300,
952186.075600, 186.572900, 187.070200, 187.567500, 188.064800, 188.562100,
953189.059400, 189.556700, 190.054000, 190.551300, 191.048600, 191.545900,
954192.043200, 192.540500, 193.037800, 193.535100, 194.032400, 194.529700,
955195.027000, 195.524300, 196.021600, 196.518900, 197.016200, 197.513500,
956198.010800, 198.508100, 199.005400, 199.502700, 200.000000};
957Double_t w[]={
9581.000000, 0.402402, 0.347976, 0.386866, 0.304413, 0.275746,
9590.256941, 0.250439, 0.228486, 0.219225, 0.203368, 0.196124,
9600.180551, 0.169230, 0.159021, 0.157136, 0.154743, 0.160522,
9610.153993, 0.143448, 0.148062, 0.136337, 0.130853, 0.127798,
9620.137576, 0.137530, 0.124175, 0.120225, 0.120774, 0.123584,
9630.121883, 0.114522, 0.118338, 0.119587, 0.106017, 0.125802,
9640.106256, 0.101585, 0.097737, 0.100817, 0.102279, 0.110935,
9650.101429, 0.107629, 0.105802, 0.095688, 0.096617, 0.100985,
9660.101521, 0.100450, 0.111836, 0.088828, 0.102264, 0.101012,
9670.097673, 0.097634, 0.091720, 0.096167, 0.084537, 0.104443,
9680.091966, 0.097204, 0.089456, 0.088273, 0.098220, 0.095151,
9690.088201, 0.085570, 0.088431, 0.077625, 0.088314, 0.084582,
9700.091545, 0.083774, 0.086183, 0.089195, 0.086255, 0.077167,
9710.096118, 0.089881, 0.086206, 0.086968, 0.079827, 0.082002,
9720.083081, 0.076587, 0.081820, 0.092382, 0.082964, 0.080901,
9730.093512, 0.082907, 0.086691, 0.093639, 0.089010, 0.082857,
9740.090795, 0.082403, 0.078602, 0.087284, 0.079638, 0.082905,
9750.077189, 0.084329, 0.075900, 0.082559, 0.084210, 0.070053,
9760.068453, 0.083369, 0.077659, 0.073286, 0.075396, 0.073946,
9770.083293, 0.076235, 0.082184, 0.080104, 0.073755, 0.077369,
9780.068281, 0.084593, 0.074923, 0.069467, 0.072094, 0.077973,
9790.067034, 0.080314, 0.087441, 0.071728, 0.072302, 0.076783,
9800.079931, 0.075557, 0.076318, 0.079029, 0.075126, 0.076859,
9810.080253, 0.074344, 0.083387, 0.087553, 0.084437, 0.076322,
9820.077748, 0.087559, 0.075649, 0.076615, 0.077098, 0.074559,
9830.075540, 0.085883, 0.079269, 0.079866, 0.068922, 0.069770,
9840.068024, 0.077783, 0.086620, 0.086769, 0.068433, 0.078059,
9850.084463, 0.072790, 0.073889, 0.079090, 0.081759, 0.069576,
9860.069160, 0.071695, 0.078569, 0.075727, 0.088055, 0.082395,
9870.079915, 0.075150, 0.073580, 0.069968, 0.071141, 0.065823,
9880.077270, 0.076229, 0.071735, 0.079271, 0.078209, 0.069503,
9890.064732, 0.076312, 0.088579, 0.087271, 0.080566, 0.073527,
9900.071376, 0.068785, 0.071812, 0.072680, 0.067252, 0.059543,
9910.072818, 0.071856, 0.083427, 0.080664, 0.077315, 0.066060,
9920.078772, 0.065442, 0.067255, 0.077676, 0.068306, 0.071578,
9930.059728, 0.073526, 0.078932, 0.070316, 0.067620, 0.067323,
9940.078316, 0.080366, 0.091194, 0.066739, 0.076238, 0.070382,
9950.077118, 0.073822, 0.072830, 0.062947, 0.077375, 0.076284,
9960.070951, 0.086127, 0.071074, 0.076621, 0.070502, 0.070897,
9970.058764, 0.065322, 0.073620, 0.062051, 0.074548, 0.083770,
9980.072502, 0.066823, 0.074192, 0.081570, 0.067340, 0.081896,
9990.080680, 0.072835, 0.069675, 0.078881, 0.072826, 0.069616,
10000.082744, 0.069138, 0.073333, 0.080881, 0.069091, 0.064266,
10010.062849, 0.072846, 0.067462, 0.067229, 0.071319, 0.071099,
10020.069381, 0.073799, 0.076106, 0.075006, 0.073074, 0.092589,
10030.074277, 0.061324, 0.069788, 0.070310, 0.063160, 0.073077,
10040.075447, 0.081013, 0.074102, 0.076565, 0.060192, 0.058326,
10050.071508, 0.072974, 0.065098, 0.060432, 0.062077, 0.075644,
10060.075417, 0.066947, 0.066744, 0.065111, 0.075468, 0.078185,
10070.073216, 0.066502, 0.079582, 0.065405, 0.069828, 0.072165,
10080.071112, 0.064656, 0.080396, 0.066505, 0.063419, 0.066128,
10090.080616, 0.071463, 0.064867, 0.074782, 0.063103, 0.068179,
10100.064911, 0.073029, 0.075746, 0.062264, 0.099126, 0.067890,
10110.074940, 0.070090, 0.073583, 0.056904, 0.063745, 0.063780,
10120.076876, 0.066519, 0.067164, 0.068668, 0.075065, 0.070983,
10130.075751, 0.066317, 0.077520, 0.073139, 0.073961, 0.085492,
10140.074629, 0.059555, 0.081026, 0.059274, 0.055448, 0.084269,
10150.066222, 0.078874, 0.062021, 0.075156, 0.090478, 0.066265,
10160.067845, 0.076653, 0.086671, 0.082362, 0.067246, 0.075975,
10170.072594, 0.068570, 0.095034, 0.065644, 0.070945, 0.066190,
10180.075906, 0.055154, 0.075575, 0.058078, 0.071004, 0.070850,
10190.064374, 0.058251, 0.069430, 0.072293, 0.065484, 0.084197,
10200.090119, 0.091619, 0.067620, 0.079462, 0.063025, 0.068128,
10210.056927, 0.076351, 0.073869, 0.061597, 0.083741, 0.063762,
10220.064489, 0.074269, 0.068832, 0.058648, 0.069536, 0.074824,
10230.081009, 0.073389, 0.076792, 0.084855, 0.075280, 0.061473,
10240.063840, 0.062891, 0.071328, 0.065250};
1025wDD = 0.077845;
1026wND = 0.066355;
1027wSD = -1;
1028
1029 Mmin = bin[0];
1030 Mmax = bin[nbin];
1031 if(M<Mmin || M>Mmax) return kTRUE;
1032
1033 Int_t ibin=nbin-1;
1034 for(Int_t i=1; i<=nbin; i++)
1035 if(M<=bin[i]) {
1036 ibin=i-1;
1037 // printf("Mi> %f && Mi< %f\n", bin[i-1], bin[i]);
1038 break;
1039 }
1040 wSD=w[ibin];
1041 return kTRUE;
1042
1043 }
1044 else if(TMath::Abs(fEnergyCMS-7000)<1 ){
1045
1046const Int_t nbin=400;
1047Double_t bin[]={
10481.080000, 1.577300, 2.074600, 2.571900, 3.069200, 3.566500,
10494.063800, 4.561100, 5.058400, 5.555700, 6.053000, 6.550300,
10507.047600, 7.544900, 8.042200, 8.539500, 9.036800, 9.534100,
105110.031400, 10.528700, 11.026000, 11.523300, 12.020600, 12.517900,
105213.015200, 13.512500, 14.009800, 14.507100, 15.004400, 15.501700,
105315.999000, 16.496300, 16.993600, 17.490900, 17.988200, 18.485500,
105418.982800, 19.480100, 19.977400, 20.474700, 20.972000, 21.469300,
105521.966600, 22.463900, 22.961200, 23.458500, 23.955800, 24.453100,
105624.950400, 25.447700, 25.945000, 26.442300, 26.939600, 27.436900,
105727.934200, 28.431500, 28.928800, 29.426100, 29.923400, 30.420700,
105830.918000, 31.415300, 31.912600, 32.409900, 32.907200, 33.404500,
105933.901800, 34.399100, 34.896400, 35.393700, 35.891000, 36.388300,
106036.885600, 37.382900, 37.880200, 38.377500, 38.874800, 39.372100,
106139.869400, 40.366700, 40.864000, 41.361300, 41.858600, 42.355900,
106242.853200, 43.350500, 43.847800, 44.345100, 44.842400, 45.339700,
106345.837000, 46.334300, 46.831600, 47.328900, 47.826200, 48.323500,
106448.820800, 49.318100, 49.815400, 50.312700, 50.810000, 51.307300,
106551.804600, 52.301900, 52.799200, 53.296500, 53.793800, 54.291100,
106654.788400, 55.285700, 55.783000, 56.280300, 56.777600, 57.274900,
106757.772200, 58.269500, 58.766800, 59.264100, 59.761400, 60.258700,
106860.756000, 61.253300, 61.750600, 62.247900, 62.745200, 63.242500,
106963.739800, 64.237100, 64.734400, 65.231700, 65.729000, 66.226300,
107066.723600, 67.220900, 67.718200, 68.215500, 68.712800, 69.210100,
107169.707400, 70.204700, 70.702000, 71.199300, 71.696600, 72.193900,
107272.691200, 73.188500, 73.685800, 74.183100, 74.680400, 75.177700,
107375.675000, 76.172300, 76.669600, 77.166900, 77.664200, 78.161500,
107478.658800, 79.156100, 79.653400, 80.150700, 80.648000, 81.145300,
107581.642600, 82.139900, 82.637200, 83.134500, 83.631800, 84.129100,
107684.626400, 85.123700, 85.621000, 86.118300, 86.615600, 87.112900,
107787.610200, 88.107500, 88.604800, 89.102100, 89.599400, 90.096700,
107890.594000, 91.091300, 91.588600, 92.085900, 92.583200, 93.080500,
107993.577800, 94.075100, 94.572400, 95.069700, 95.567000, 96.064300,
108096.561600, 97.058900, 97.556200, 98.053500, 98.550800, 99.048100,
108199.545400, 100.042700, 100.540000, 101.037300, 101.534600, 102.031900,
1082102.529200, 103.026500, 103.523800, 104.021100, 104.518400, 105.015700,
1083105.513000, 106.010300, 106.507600, 107.004900, 107.502200, 107.999500,
1084108.496800, 108.994100, 109.491400, 109.988700, 110.486000, 110.983300,
1085111.480600, 111.977900, 112.475200, 112.972500, 113.469800, 113.967100,
1086114.464400, 114.961700, 115.459000, 115.956300, 116.453600, 116.950900,
1087117.448200, 117.945500, 118.442800, 118.940100, 119.437400, 119.934700,
1088120.432000, 120.929300, 121.426600, 121.923900, 122.421200, 122.918500,
1089123.415800, 123.913100, 124.410400, 124.907700, 125.405000, 125.902300,
1090126.399600, 126.896900, 127.394200, 127.891500, 128.388800, 128.886100,
1091129.383400, 129.880700, 130.378000, 130.875300, 131.372600, 131.869900,
1092132.367200, 132.864500, 133.361800, 133.859100, 134.356400, 134.853700,
1093135.351000, 135.848300, 136.345600, 136.842900, 137.340200, 137.837500,
1094138.334800, 138.832100, 139.329400, 139.826700, 140.324000, 140.821300,
1095141.318600, 141.815900, 142.313200, 142.810500, 143.307800, 143.805100,
1096144.302400, 144.799700, 145.297000, 145.794300, 146.291600, 146.788900,
1097147.286200, 147.783500, 148.280800, 148.778100, 149.275400, 149.772700,
1098150.270000, 150.767300, 151.264600, 151.761900, 152.259200, 152.756500,
1099153.253800, 153.751100, 154.248400, 154.745700, 155.243000, 155.740300,
1100156.237600, 156.734900, 157.232200, 157.729500, 158.226800, 158.724100,
1101159.221400, 159.718700, 160.216000, 160.713300, 161.210600, 161.707900,
1102162.205200, 162.702500, 163.199800, 163.697100, 164.194400, 164.691700,
1103165.189000, 165.686300, 166.183600, 166.680900, 167.178200, 167.675500,
1104168.172800, 168.670100, 169.167400, 169.664700, 170.162000, 170.659300,
1105171.156600, 171.653900, 172.151200, 172.648500, 173.145800, 173.643100,
1106174.140400, 174.637700, 175.135000, 175.632300, 176.129600, 176.626900,
1107177.124200, 177.621500, 178.118800, 178.616100, 179.113400, 179.610700,
1108180.108000, 180.605300, 181.102600, 181.599900, 182.097200, 182.594500,
1109183.091800, 183.589100, 184.086400, 184.583700, 185.081000, 185.578300,
1110186.075600, 186.572900, 187.070200, 187.567500, 188.064800, 188.562100,
1111189.059400, 189.556700, 190.054000, 190.551300, 191.048600, 191.545900,
1112192.043200, 192.540500, 193.037800, 193.535100, 194.032400, 194.529700,
1113195.027000, 195.524300, 196.021600, 196.518900, 197.016200, 197.513500,
1114198.010800, 198.508100, 199.005400, 199.502700, 200.000000};
1115Double_t w[]={
11161.000000, 0.526293, 0.446686, 0.437789, 0.366854, 0.333320,
11170.291931, 0.266464, 0.253870, 0.248706, 0.232788, 0.220736,
11180.209886, 0.202741, 0.188617, 0.182767, 0.178748, 0.169039,
11190.175911, 0.169098, 0.171256, 0.146728, 0.144543, 0.159470,
11200.153171, 0.151883, 0.144693, 0.136307, 0.140226, 0.135388,
11210.141317, 0.151121, 0.131209, 0.144039, 0.124688, 0.128020,
11220.119122, 0.121868, 0.122332, 0.119561, 0.115744, 0.102504,
11230.114726, 0.109518, 0.115418, 0.114860, 0.110026, 0.107693,
11240.103005, 0.115985, 0.108629, 0.105937, 0.101056, 0.101228,
11250.113305, 0.110302, 0.104696, 0.107447, 0.099095, 0.107378,
11260.103090, 0.111384, 0.090821, 0.109806, 0.093639, 0.096655,
11270.110416, 0.104446, 0.098530, 0.095105, 0.106641, 0.101804,
11280.091798, 0.094775, 0.104130, 0.088436, 0.119692, 0.099160,
11290.086163, 0.089250, 0.101898, 0.091786, 0.087346, 0.095312,
11300.107186, 0.085671, 0.093283, 0.091992, 0.114654, 0.086172,
11310.084559, 0.097862, 0.079417, 0.094737, 0.089678, 0.105265,
11320.099092, 0.087901, 0.086828, 0.084756, 0.077769, 0.084254,
11330.083262, 0.092935, 0.088858, 0.093377, 0.083569, 0.084771,
11340.084957, 0.084033, 0.095007, 0.076690, 0.087726, 0.097913,
11350.084119, 0.076361, 0.084172, 0.091068, 0.094564, 0.091406,
11360.088405, 0.090355, 0.085388, 0.084586, 0.085752, 0.084298,
11370.091294, 0.081491, 0.075024, 0.082543, 0.088048, 0.074621,
11380.078514, 0.077249, 0.078378, 0.092945, 0.075859, 0.077602,
11390.074592, 0.078181, 0.081527, 0.080865, 0.078854, 0.078237,
11400.085506, 0.089823, 0.072738, 0.078430, 0.077162, 0.081495,
11410.090878, 0.099417, 0.100966, 0.087960, 0.085556, 0.081661,
11420.078066, 0.089059, 0.073564, 0.092704, 0.073148, 0.098057,
11430.067906, 0.079452, 0.090567, 0.082454, 0.077851, 0.079694,
11440.091272, 0.078628, 0.096906, 0.098779, 0.088906, 0.070174,
11450.083822, 0.084241, 0.093237, 0.071062, 0.075771, 0.096405,
11460.098441, 0.086007, 0.069599, 0.078400, 0.083481, 0.081054,
11470.085552, 0.069582, 0.071336, 0.073207, 0.087913, 0.080125,
11480.075189, 0.067217, 0.073509, 0.099694, 0.080781, 0.073943,
11490.062822, 0.076611, 0.087672, 0.077632, 0.063959, 0.077754,
11500.084651, 0.097348, 0.063909, 0.055053, 0.087616, 0.074428,
11510.101165, 0.078446, 0.070683, 0.071162, 0.091516, 0.069641,
11520.070969, 0.069778, 0.083318, 0.066703, 0.074027, 0.067589,
11530.070620, 0.081307, 0.094406, 0.076188, 0.061663, 0.077561,
11540.076159, 0.071851, 0.074417, 0.076136, 0.069073, 0.075450,
11550.070218, 0.089709, 0.079974, 0.082077, 0.076979, 0.070497,
11560.076296, 0.087347, 0.073508, 0.088073, 0.067186, 0.059898,
11570.085495, 0.100152, 0.079468, 0.093783, 0.082680, 0.077272,
11580.081995, 0.068240, 0.071881, 0.073737, 0.072346, 0.079034,
11590.078721, 0.067518, 0.068196, 0.081738, 0.082814, 0.082480,
11600.069072, 0.066853, 0.081523, 0.073588, 0.082308, 0.091641,
11610.072747, 0.084317, 0.072190, 0.079372, 0.067424, 0.077450,
11620.062343, 0.090708, 0.065470, 0.086588, 0.071172, 0.066705,
11630.070670, 0.070407, 0.096111, 0.066738, 0.081249, 0.072882,
11640.075144, 0.060331, 0.074589, 0.076968, 0.085913, 0.072561,
11650.064645, 0.078742, 0.075670, 0.065984, 0.080932, 0.069898,
11660.065303, 0.096856, 0.057690, 0.065720, 0.066545, 0.068521,
11670.068278, 0.069245, 0.086643, 0.063401, 0.070933, 0.070752,
11680.066978, 0.058891, 0.070073, 0.078031, 0.082691, 0.101414,
11690.075814, 0.072790, 0.057622, 0.093002, 0.084660, 0.079216,
11700.070371, 0.070141, 0.076944, 0.067285, 0.078016, 0.077807,
11710.066668, 0.066459, 0.059962, 0.062774, 0.083450, 0.064554,
11720.067887, 0.064165, 0.072782, 0.067285, 0.052710, 0.096824,
11730.071931, 0.064190, 0.074442, 0.082647, 0.055797, 0.078632,
11740.061116, 0.063092, 0.049131, 0.074517, 0.069915, 0.079021,
11750.088656, 0.101045, 0.090432, 0.076460, 0.067451, 0.071381,
11760.069790, 0.077330, 0.077115, 0.084403, 0.065138, 0.056436,
11770.088024, 0.069893, 0.055985, 0.089655, 0.062911, 0.075311,
11780.086679, 0.093645, 0.068632, 0.064498, 0.057677, 0.081391,
11790.062781, 0.075467, 0.061314, 0.073394, 0.084462, 0.068470,
11800.071267, 0.060556, 0.072487, 0.063785, 0.079164, 0.070406,
11810.073394, 0.063168, 0.066968, 0.064125, 0.063954, 0.072504,
11820.058948, 0.057740, 0.083383, 0.067262};
1183wDD = 0.098024;
1184wND = 0.053452;
1185wSD = -1;
1186
1187 Mmin = bin[0];
1188 Mmax = bin[nbin];
1189 if(M<Mmin || M>Mmax) return kTRUE;
1190
1191 Int_t ibin=nbin-1;
1192 for(Int_t i=1; i<=nbin; i++)
1193 if(M<=bin[i]) {
1194 ibin=i-1;
1195 // printf("Mi> %f && Mi< %f\n", bin[i-1], bin[i]);
1196 break;
1197 }
1198 wSD=w[ibin];
1199 return kTRUE;
1200
1201 }
1202
1203 return kFALSE;
1204}
1205
1206
1a52e0ed 1207//______________________________________________________________________________