From 8a8f459f9edae03fd3510c484d490f78b7f846b3 Mon Sep 17 00:00:00 2001 From: morsch Date: Fri, 19 Jul 2002 14:35:36 +0000 Subject: [PATCH] Count total number of trials. Print mean Q, x1, x2. --- EVGEN/AliGenPythia.cxx | 33 +++++++++++++++++++++++++++++---- EVGEN/AliGenPythia.h | 9 +++++++-- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/EVGEN/AliGenPythia.cxx b/EVGEN/AliGenPythia.cxx index afe57d7fa0a..25da29c7195 100644 --- a/EVGEN/AliGenPythia.cxx +++ b/EVGEN/AliGenPythia.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.58 2002/07/17 10:04:09 morsch +SetYHard method added. + Revision 1.57 2002/05/22 13:22:53 morsch Process kPyMbNonDiffr added. @@ -218,6 +221,7 @@ AliGenPythia::AliGenPythia(Int_t npart) SetStrucFunc(); SetForceDecay(); SetPtHard(); + SetYHard(); SetEnergyCMS(); fDecayer = new AliDecayerPythia(); // Set random number generator @@ -335,6 +339,14 @@ void AliGenPythia::Init() case kPyDirectGamma: break; } +// +// This counts the total number of calls to Pyevnt() per run. + fTrialsRun = 0; + fQ = 0.; + fX1 = 0.; + fX2 = 0.; + fNev = 0.; +// AliGenMC::Init(); } @@ -397,7 +409,7 @@ void AliGenPythia::Generate() pSelected[i] = 0; trackIt[i] = 0; } - // printf("\n **************************************************%d\n",np); + Int_t nc = 0; // Total n. of selected particles Int_t nParents = 0; // Selected parents Int_t nTkbles = 0; // Trackable particles @@ -429,7 +441,6 @@ void AliGenPythia::Generate() TParticle * mother = (TParticle *) fParticles->At(ipa); kfMo = TMath::Abs(mother->GetPdgCode()); } -// printf("\n particle (all) %d %d %d", i, pSelected[i], kf); // What to keep in Stack? Bool_t flavorOK = kFALSE; Bool_t selectOK = kFALSE; @@ -563,6 +574,15 @@ void AliGenPythia::Generate() if (jev >= fNpart || fNpart == -1) { fKineBias=Float_t(fNpart)/Float_t(fTrials); printf("\n Trials: %i %i %i\n",fTrials, fNpart, jev); + fPythia->GetVINT(41), + fPythia->GetVINT(42), + fPythia->GetVINT(51)); + + fQ += fPythia->GetVINT(51); + fX1 += fPythia->GetVINT(41); + fX2 += fPythia->GetVINT(42); + fTrialsRun += fTrials; + fNev++; MakeHeader(); break; } @@ -603,8 +623,6 @@ Int_t AliGenPythia::GenerateMB() kf = CheckPDGCode(iparticle->GetPdgCode()); Int_t ks = iparticle->GetStatusCode(); Int_t km = iparticle->GetFirstMother(); -// printf("\n Particle: %d %d %d", i, kf, ks); - if ((ks == 1 && kf!=0 && KinematicSelection(iparticle, 0)) || (ks != 1) || (fProcess == kPyJets && ks == 21 && km == 0 && i>1)) { @@ -641,6 +659,13 @@ void AliGenPythia::FinishRun() { // Print x-section summary fPythia->Pystat(1); + fQ /= fNev; + fX1 /= fNev; + fX2 /= fNev; + printf("\nTotal number of Pyevnt() calls %d\n", fTrialsRun); + printf("\nMean Q, x1, x2: %f %f %f\n", fQ, fX1, fX2); + + } void AliGenPythia::AdjustWeights() diff --git a/EVGEN/AliGenPythia.h b/EVGEN/AliGenPythia.h index 12f7b9b1aa6..b717d3c5b78 100644 --- a/EVGEN/AliGenPythia.h +++ b/EVGEN/AliGenPythia.h @@ -112,7 +112,12 @@ class AliGenPythia : public AliGenMC StrucFunc_t fStrucFunc; //Structure Function Float_t fEnergyCMS; //Centre of mass energy Float_t fKineBias; //!Bias from kinematic selection - Int_t fTrials; //!Number of trials + Int_t fTrials; //!Number of trials for current event + Int_t fTrialsRun; //!Number of trials for run + Float_t fQ; //Mean Q + Float_t fX1; //Mean x1 + Float_t fX2; //Mean x2 + Int_t fNev; //Number of events Int_t fFlavorSelect; //Heavy Flavor Selection Float_t fXsection; //Cross-section AliPythia *fPythia; //!Pythia @@ -151,7 +156,7 @@ class AliGenPythia : public AliGenMC // fCountMode = kCountTrackabless --> Only particles flagged for tracking // are counted // - ClassDef(AliGenPythia,2) // AliGenerator interface to Pythia + ClassDef(AliGenPythia,3) // AliGenerator interface to Pythia }; #endif -- 2.31.1