]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Count total number of trials. Print mean Q, x1, x2.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Jul 2002 14:35:36 +0000 (14:35 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Jul 2002 14:35:36 +0000 (14:35 +0000)
EVGEN/AliGenPythia.cxx
EVGEN/AliGenPythia.h

index afe57d7fa0a4dd5039d713328bb0c5921bfa77cc..25da29c71950a00c54c3ffc3a93c1de1c07d0611 100644 (file)
@@ -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()
index 12f7b9b1aa69895494635195eddf12c6b6aed18d..b717d3c5b781d3ec7d231408dfeb42b2bbc2e3dc 100644 (file)
@@ -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