]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Updates M. Koehler
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 2 Mar 2012 12:01:28 +0000 (12:01 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 2 Mar 2012 12:01:28 +0000 (12:01 +0000)
EVGEN/AliGenPairFlat.cxx
EVGEN/AliGenPairFlat.h

index 300d336343876cdcc7ad6547c381dad50ee826da..980471bfc2a789cbc0f3bf221a35954ac2dc7f29 100644 (file)
@@ -47,13 +47,25 @@ AliGenPairFlat::AliGenPairFlat()
      fLegPdg1(11),
      fLegPdg2(-11),
      fAlpha(0.),
-     fDebug(0)
+     fDebug(0),
+     fPol(0)
 {
   //
   // Default constructor
   //
 }
 
+
+//_____________________________________________________________________________
+AliGenPairFlat::~AliGenPairFlat()
+{
+  //
+  // Destructor
+  //
+    delete fPol; 
+
+}
+
 //_____________________________________________________________________________
 void AliGenPairFlat::Generate()
 {
@@ -74,8 +86,8 @@ void AliGenPairFlat::Generate()
     TLorentzVector mother, dau1, dau2;
     Float_t random[6];
 
-    TF1* pol = new TF1("Pol","1.+[0]*x*x",-1.,1.);
-    pol->SetParameter(0, fAlpha);
+    fPol = new TF1("fPol","1.+[0]*x*x",-1.,1.);
+    fPol->SetParameter(0, fAlpha);
 
 
     for (j=0;j<3;j++) origin[j]=fOrigin[j];
@@ -86,6 +98,7 @@ void AliGenPairFlat::Generate()
        time = fTime;
      }
 
+       if(fDebug == 2){
        printf("\n\n------------------GENERATOR SETTINGS------------------\n\n");
        printf("You choosed for the mother the Mass range %f - %f     \n",fPairMassMin,fPairMassMax);
        printf("You choosed for the mother the transverse Momentum range %f - %f \n",fPairPtMin,fPairPtMax);
@@ -100,7 +113,7 @@ void AliGenPairFlat::Generate()
        printf("polarization factor is alpha == %lf \n",fAlpha);
        printf("vertex is at x == %f || y == %f || z == %f   \n",origin[0],origin[1],origin[2]);
        printf("\n----------------------------------------------------------\n");
-
+       }
 
     for(i=0;i<fPairNpart;i++) {
 
@@ -123,7 +136,7 @@ void AliGenPairFlat::Generate()
          if (fDebug == 2)    printf("p = (%+11.4e,%+11.4e,%+11.4e) GeV || pt = %+11.4e || y =  %+11.4e || weight=%+11.4e || E= %+11.4e\n",p[0],p[1],p[2],pt, y,weight,e);
 
        //decay procedure
-       if(!Decay(mother,dau1,dau2,pol))continue;
+       if(!Decay(mother,dau1,dau2,fPol))continue;
 
        pt1 = dau1.Pt();
        pt2 = dau2.Pt();
@@ -179,7 +192,6 @@ void AliGenPairFlat::Generate()
 }
 
 //_____________________________________________________________________________
-
 void AliGenPairFlat::Init()
 {
        //
@@ -192,9 +204,7 @@ void AliGenPairFlat::Init()
 
 
 //_____________________________________________________________________________
-
-
-Bool_t AliGenPairFlat::Decay(TLorentzVector& mother, TLorentzVector &dau1, TLorentzVector &dau2, TF1* polfactor)
+Bool_t AliGenPairFlat::Decay(const TLorentzVector& mother, TLorentzVector &dau1, TLorentzVector &dau2, TF1* polfactor)
 {
        //
        // decay procedure
index 0eb443cc91e2ae0bb7aa33a77df02f886b14102f..6042cf4943fbab38cdb3de8724a4f6e695d18c39 100644 (file)
@@ -18,7 +18,7 @@ class AliGenPairFlat : public AliGenerator
 {
  public:
   AliGenPairFlat();
-  virtual ~AliGenPairFlat(){ }
+  virtual ~AliGenPairFlat();
   virtual void Generate();
   virtual void Init();
 
@@ -52,8 +52,14 @@ protected:
   Int_t   fLegPdg2;            // pdg code of second daughter
   Float_t fAlpha;              // Polarization factor
   Int_t   fDebug;              // debug level
+  TF1    *fPol;                        // Polarization function
 
-  Bool_t Decay(TLorentzVector& mother, TLorentzVector &dau1, TLorentzVector &dau2 , TF1* fPol);
+  Bool_t Decay(const TLorentzVector& mother, TLorentzVector &dau1, TLorentzVector &dau2 , TF1* fPol);
+
+
+  private:
+  AliGenPairFlat(const AliGenPairFlat &pair);
+  AliGenPairFlat & operator=(const AliGenPairFlat & pair);
 
   ClassDef(AliGenPairFlat,1) // Flat random pair generator
 };