]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TAmpt/TAmpt.cxx
Using detector quality flag (taken from ALICE logbook) to decide whether to rpodcue...
[u/mrichter/AliRoot.git] / TAmpt / TAmpt.cxx
index aa8325661df36652fc0a739a0616be3d14b35209..93e60c4d688555630dfb73c67750d3993b882c6b 100644 (file)
@@ -65,6 +65,7 @@ extern "C" void type_of_call rluset_ampt(Int_t & lfn, Int_t & move);
 
 ClassImp(TAmpt)
 
+
 //______________________________________________________________________________
 TAmpt::TAmpt()
   : TGenerator("Ampt","Ampt"),
@@ -77,7 +78,8 @@ TAmpt::TAmpt()
     fIat(208),
     fIzt(82),
     fBmin(0.),
-    fBmax(5.)
+    fBmax(5.),
+    fPsi(0.)
 {
   // Default constructor 
   amptsetdef();
@@ -98,7 +100,8 @@ TAmpt::TAmpt(Double_t efrm, const char *frame="CMS",
     fIat(iat),
     fIzt(izt),
     fBmin(bmin),
-    fBmax(bmax)
+    fBmax(bmax),
+    fPsi(0.)
 {
   // TAmpt constructor: 
   // Note that there may be only one functional TAmpt object
@@ -128,14 +131,21 @@ TObjArray* TAmpt::ImportParticles(Option_t */*option*/)
     Double_t py = HBT.plast[i][1];//GeV/c
     Double_t pz = HBT.plast[i][2];//GeV/c
     Double_t ma = HBT.plast[i][3];//GeV/c/c
-//    Double_t vx = 0;//HBT.xlast[i][0]*1e-12;//mm
-//    Double_t vy = 0;//HBT.xlast[i][1]*1e-12;//mm
-//    Double_t vz = 0;//HBT.xlast[i][2]*1e-12;//mm
-//    Double_t vt = 0;//HBT.xlast[i][3]*1e-12;//mm/c
-    Double_t vx = HBT.xlast[i][0]*1e-12;//mm
-    Double_t vy = HBT.xlast[i][1]*1e-12;//mm
-    Double_t vz = HBT.xlast[i][2]*1e-12;//mm
-    Double_t vt = HBT.xlast[i][3]*1e-12;//mm/c
+    Double_t vx = 0;//HBT.xlast[i][0]*1e-12;//mm
+    Double_t vy = 0;//HBT.xlast[i][1]*1e-12;//mm
+    Double_t vz = 0;//HBT.xlast[i][2]*1e-12;//mm
+    Double_t vt = 0;//HBT.xlast[i][3]*1e-12;//mm/c
+    //Double_t vx = HBT.xlast[i][0]*1e-12;//mm
+    //Double_t vy = HBT.xlast[i][1]*1e-12;//mm
+    //Double_t vz = HBT.xlast[i][2]*1e-12;//mm
+    //Double_t vt = HBT.xlast[i][3]*1e-12;//mm/c
+
+    // Rotate xy components of vectors to new reaction plane:
+    Double_t pxp=TMath::Cos(fPsi)*px - TMath::Sin(fPsi)*py;
+    Double_t pyp=TMath::Sin(fPsi)*px + TMath::Cos(fPsi)*py;
+    Double_t vxp=TMath::Cos(fPsi)*vx - TMath::Sin(fPsi)*vy;
+    Double_t vyp=TMath::Sin(fPsi)*vx + TMath::Cos(fPsi)*vy;
+
     Int_t pdg   = invflv(HBT.lblast[i]);
     TParticle *p = new TParticle(pdg,
                                  status,
@@ -143,12 +153,12 @@ TObjArray* TAmpt::ImportParticles(Option_t */*option*/)
                                  -1,
                                  -1,
                                  -1,
-                                 px,
-                                 py,
+                                 pxp,
+                                 pyp,
                                  pz,
                                  TMath::Sqrt(ma*ma+px*px+py*py+pz*pz),
-                                 vx,
-                                 vy,
+                                 vxp,
+                                 vyp,
                                  vz,
                                  vt);
     if((px==0)&&(py==0)) {
@@ -184,14 +194,21 @@ Int_t TAmpt::ImportParticles(TClonesArray *particles, Option_t */*option*/)
     Double_t py = HBT.plast[i][1];//GeV/c
     Double_t pz = HBT.plast[i][2];//GeV/c
     Double_t ma = HBT.plast[i][3];//GeV/c/c
-//    Double_t vx = 0;//HBT.xlast[i][0]*1e-12;//mm
-//    Double_t vy = 0;//HBT.xlast[i][1]*1e-12;//mm
-//    Double_t vz = 0;//HBT.xlast[i][2]*1e-12;//mm
-//    Double_t vt = 0;//HBT.xlast[i][3]*1e-12;//mm/c
-    Double_t vx = HBT.xlast[i][0]*1e-12;//mm
-    Double_t vy = HBT.xlast[i][1]*1e-12;//mm
-    Double_t vz = HBT.xlast[i][2]*1e-12;//mm
-    Double_t vt = HBT.xlast[i][3]*1e-12;//mm/c
+    Double_t vx = 0;//HBT.xlast[i][0]*1e-12;//mm
+    Double_t vy = 0;//HBT.xlast[i][1]*1e-12;//mm
+    Double_t vz = 0;//HBT.xlast[i][2]*1e-12;//mm
+    Double_t vt = 0;//HBT.xlast[i][3]*1e-12;//mm/c
+    //Double_t vx = HBT.xlast[i][0]*1e-12;//mm
+    //Double_t vy = HBT.xlast[i][1]*1e-12;//mm
+    //Double_t vz = HBT.xlast[i][2]*1e-12;//mm
+    //Double_t vt = HBT.xlast[i][3]*1e-12;//mm/c
+
+    // Rotate xy components of vectors to new reaction plane:
+    Double_t pxp=TMath::Cos(fPsi)*px - TMath::Sin(fPsi)*py;
+    Double_t pyp=TMath::Sin(fPsi)*px + TMath::Cos(fPsi)*py;
+    Double_t vxp=TMath::Cos(fPsi)*vx - TMath::Sin(fPsi)*vy;
+    Double_t vyp=TMath::Sin(fPsi)*vx + TMath::Cos(fPsi)*vy;
+
     Int_t pdg  = invflv(HBT.lblast[i]);
     //printf("i %d pdg %d px %f py %f pz %f vx %f vy %f vz %f vt %f\n", i, pdg, px, py, pz, vx, vy, vz, vt);
     new(particlesR[i]) TParticle(pdg,
@@ -200,12 +217,12 @@ Int_t TAmpt::ImportParticles(TClonesArray *particles, Option_t */*option*/)
                                  -1,
                                  -1,
                                  -1,
-                                 px,
-                                 py,
+                                 pxp,
+                                 pyp,
                                  pz,
                                  TMath::Sqrt(ma*ma+px*px+py*py+pz*pz),
-                                 vx,
-                                 vy,
+                                 vxp,
+                                 vyp,
                                  vz,
                                  vt);
     if((px==0)&&(py==0)){
@@ -235,6 +252,11 @@ Int_t TAmpt::ImportNucleons(TClonesArray *nucleons, Option_t */*option*/)
     Double_t x = HJCRDN.yp[i][0] + 0.5*GetBB();
     Double_t y = HJCRDN.yp[i][1];
     Double_t z = HJCRDN.yp[i][2];
+
+    // Rotate xy components of vectors to new reaction plane:
+    Double_t xp=TMath::Cos(fPsi)*x - TMath::Sin(fPsi)*y;
+    Double_t yp=TMath::Sin(fPsi)*x + TMath::Cos(fPsi)*y;
+
     Int_t    p = HSTRNG.nfp[3][i];
     Int_t    s = HSTRNG.nfp[4][i];
     new(nucleonsR[i]) TParticle(p,
@@ -247,8 +269,8 @@ Int_t TAmpt::ImportNucleons(TClonesArray *nucleons, Option_t */*option*/)
                                  0,
                                  0,
                                  0,
-                                 x,
-                                 y,
+                                 xp,
+                                 yp,
                                  z,
                                  0);
     nucleonsR[i]->SetUniqueID(1);
@@ -258,6 +280,11 @@ Int_t TAmpt::ImportNucleons(TClonesArray *nucleons, Option_t */*option*/)
     Double_t x = HJCRDN.yt[i][0] - 0.5*HPARNT.hint1[18];
     Double_t y = HJCRDN.yt[i][1];
     Double_t z = HJCRDN.yt[i][2];
+
+    // Rotate xy components of vectors to new reaction plane:
+    Double_t xp=TMath::Cos(fPsi)*x - TMath::Sin(fPsi)*y;
+    Double_t yp=TMath::Sin(fPsi)*x + TMath::Cos(fPsi)*y;
+
     Int_t    p = HSTRNG.nft[3][i];
     Int_t    s = HSTRNG.nft[4][i];
     new(nucleonsR[nA+i]) TParticle(p,
@@ -270,8 +297,8 @@ Int_t TAmpt::ImportNucleons(TClonesArray *nucleons, Option_t */*option*/)
                                    0,
                                    0,
                                    0,
-                                   x,
-                                   y,
+                                   xp,
+                                   yp,
                                    z,
                                    0);
     nucleonsR[nA+i]->SetUniqueID(-1);
@@ -572,9 +599,9 @@ Float_t  TAmpt::GetBB() const
 Int_t TAmpt::GetKATT(Int_t key1, Int_t key2) const
 {
   // Get values of array KATT in common HMAIN2
-  if ( key1<1 || key1>200000 ) {
+  if ( key1<1 || key1> _MAXNPARTICLE_ ) {
     printf("ERROR in TAmpt::GetKATT(key1,key2):\n");
-    printf("      key1=%i is out of range [1..200000]\n",key1);
+    printf("      key1=%i is out of range [1..%d]\n",key1,_MAXNPARTICLE_);
     return 0;
   }
   if ( key2<1 || key2>4 ) {
@@ -589,7 +616,7 @@ Int_t TAmpt::GetKATT(Int_t key1, Int_t key2) const
 Float_t TAmpt::GetPATT(Int_t key1, Int_t key2) const
 {
   // Get values of array PATT in common HMAIN2
-  if ( key1<1 || key1>200000 ) {
+  if ( key1<1 || key1>_MAXNPARTICLE_ ) {
     printf("ERROR in TAmpt::GetPATT(key1,key2):\n");
     printf("      key1=%i is out of range [1..130000]\n",key1);
     return 0;
@@ -606,7 +633,7 @@ Float_t TAmpt::GetPATT(Int_t key1, Int_t key2) const
 Float_t TAmpt::GetVATT(Int_t key1, Int_t key2) const
 {
   // Get values of array VATT in common HMAIN2
-  if ( key1<1 || key1>200000 ) {
+  if ( key1<1 || key1>_MAXNPARTICLE_ ) {
     printf("ERROR in TAmpt::GetVATT(key1,key2):\n");
     printf("      key1=%i is out of range [1..130000]\n",key1);
     return 0;