]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Modifications needed by the HBT analysis (P.Skowronski)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Jan 2004 18:10:26 +0000 (18:10 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Jan 2004 18:10:26 +0000 (18:10 +0000)
STEER/AliESD.cxx
STEER/AliESD.h
STEER/AliESDtest.C
STEER/AliESDtrack.cxx
STEER/AliESDtrack.h
STEER/AliReconstruction.cxx

index 4defb6d49634fc9d63a11f5324ad2dd232d88a54..b51e2fed36672516697380e2d3a8ce7f52c1bd7b 100644 (file)
@@ -32,6 +32,7 @@ AliESD::AliESD():
   fRunNumber(0),
   fTrigger(0),
   fRecoVersion(0),
+  fMagneticField(0),
   fTracks("AliESDtrack",15000),
   fCaloTracks("AliESDCaloTrack",500),
   fMuonTracks("AliESDMuonTrack",30),
index 458cc2a7f69c582dac3df6e4953bbe964888f21e..715f5079b78fbda7784599464f190f5efed30d74 100644 (file)
@@ -34,7 +34,9 @@ public:
 
   void SetEventNumber(Int_t n) {fEventNumber=n;}
   void SetRunNumber(Int_t n) {fRunNumber=n;}
-
+  void SetMagneticField(Float_t mf){fMagneticField = mf;}
+  Float_t GetMagneticField() const {return fMagneticField;}
+  
   AliESDtrack *GetTrack(Int_t i) const {
     return (AliESDtrack *)fTracks.UncheckedAt(i);
   }
@@ -89,6 +91,7 @@ protected:
   Int_t        fRunNumber;       // Run Number
   Long_t       fTrigger;         // Trigger Type
   Int_t        fRecoVersion;     // Version of reconstruction 
+  Float_t      fMagneticField;   // Solenoid Magnetic Field in kG : for compatibility with AliMagF
 
   Double_t fVtx[3];              // Primary vertex position
   Double_t fCovVtx[6];           // Cov. matrix of the primary vertex position
@@ -99,7 +102,8 @@ protected:
   TClonesArray  fV0s;            // V0 vertices
   TClonesArray  fCascades;       // Cascade vertices
   
-  ClassDef(AliESD,1)  //ESD class 
+  ClassDef(AliESD,2)  //ESD class 
+                      //ver. 2: Magnetic Field Added; skowron
 };
 
 #endif 
index 84554e708944ae7c1a5f9130fc52e9e042ef3ad5..045a4c86f656db50a2fd3e974a03e54c79692bc0 100644 (file)
@@ -227,7 +227,8 @@ Int_t AliESDtest(Int_t nev=1,Int_t run=0) {
      AliESD *event=new AliESD(); 
      event->SetRunNumber(run);
      event->SetEventNumber(i);
-
+     event->SetMagneticField(gAlice->Field()->SolenoidField());
+     
      rl->GetEvent(i);
  
 //***** Primary vertex reconstruction (MC vertex position, for the moment)
index aabab660761026cdb9b1604cd601ad3df87f23e9..11c5bbe5fbbd422d62687323bc4cda633d56c3b2 100644 (file)
@@ -36,12 +36,19 @@ fTrackLength(0),
 fStopVertex(0),
 fRalpha(0),
 fRx(0),
+fCalpha(0),
+fCx(0),
 fCchi2(1e10),
+fIalpha(0),
+fIx(0),
+fOalpha(0),
+fOx(0),
 fITSchi2(0),
 fITSncls(0),
 fITSsignal(0),
 fTPCchi2(0),
 fTPCncls(0),
+fTPCClusterMap(159),//number of padrows
 fTPCsignal(0),
 fTRDchi2(0),
 fTRDncls(0),
@@ -62,10 +69,11 @@ fTOFsignal(-1)
     fTOFr[i]=0;
   }
   Int_t i;
-  for (i=0; i<5; i++)   fRp[i]=0.;
-  for (i=0; i<15; i++)  fRc[i]=0.;
-  for (i=0; i<6; i++)   fITSindex[i]=0;
-  for (i=0; i<180; i++) fTPCindex[i]=0;
+  for (i=0; i<5; i++)  { fRp[i]=0.; fCp[i]=0.; fIp[i]=0.; fOp[i]=0.;}
+  for (i=0; i<15; i++) { fRc[i]=0.; fCc[i]=0.; fIc[i]=0.; fOc[i]=0.;   }
+  for (i=0; i<6; i++)  { fITSindex[i]=0; }
+  for (i=0; i<180; i++){ fTPCindex[i]=0; }
+  for (i=0; i<90; i++) { fTRDindex[i]=0; }
 }
 
 //_______________________________________________________________________
@@ -121,14 +129,64 @@ Bool_t AliESDtrack::UpdateTrackParams(AliKalmanTrack *t, ULong_t flags) {
       for (i=0; i<15;i++) fIc[i]=fRc[i];
     }
   case kTPCout:
+  
     fTPCncls=t->GetNumberOfClusters();
     fTPCchi2=t->GetChi2();
-    for (Int_t i=0;i<fTPCncls;i++) fTPCindex[i]=t->GetClusterIndex(i);
+    
+     {//prevrow must be declared in separate namespace, otherwise compiler cries:
+      //"jump to case label crosses initialization of `Int_t prevrow'"
+       Int_t prevrow = -1;
+       for (Int_t i=0;i<fTPCncls;i++) 
+        {
+          fTPCindex[i]=t->GetClusterIndex(i);
+
+          // Piotr's Cluster Map for HBT  
+          // ### please change accordingly if cluster array is changing 
+          // to "New TPC Tracking" style (with gaps in array) 
+          Int_t idx = fTPCindex[i];
+          Int_t sect = (idx&0xff000000)>>24;
+          Int_t row = (idx&0x00ff0000)>>16;
+          if (sect > 18) row +=63; //if it is outer sector, add number of inner sectors
+
+          fTPCClusterMap.SetBitNumber(row,kTRUE);
+
+          //Fill the gap between previous row and this row with 0 bits
+          //In case  ###  pleas change it as well - just set bit 0 in case there 
+          //is no associated clusters for current "i"
+          if (prevrow < 0) 
+           {
+             prevrow = row;//if previous bit was not assigned yet == this is the first one
+           }
+          else
+           { //we don't know the order (inner to outer or reverse)
+             //just to be save in case it is going to change
+             Int_t n = 0, m = 0;
+             if (prevrow < row)
+              {
+                n = prevrow;
+                m = row;
+              }
+             else
+              {
+                n = row;
+                m = prevrow;
+              }
+
+             for (Int_t j = n+1; j < m; j++)
+              {
+                fTPCClusterMap.SetBitNumber(j,kFALSE);
+              }
+             prevrow = row; 
+           }
+          // End Of Piotr's Cluster Map for HBT
+        }
+     }
     fTPCsignal=t->GetPIDsignal();
     {Double_t mass=t->GetMass();    // preliminary mass setting 
     if (mass>0.5) fR[4]=1.;         //        used by
     else if (mass<0.4) fR[2]=1.;    // the ITS reconstruction
-    else fR[3]=1.;}                 //
+    else fR[3]=1.;}
+                     //
     break;
 
   case kTRDout:
@@ -178,11 +236,11 @@ void AliESDtrack::GetExternalParameters(Double_t &x, Double_t p[5]) const {
   for (Int_t i=0; i<5; i++) p[i]=fRp[i];
 }
 //_______________________________________________________________________
-void AliESDtrack::GetExternalCovariance(Double_t c[15]) const {
+void AliESDtrack::GetExternalCovariance(Double_t cov[15]) const {
   //---------------------------------------------------------------------
   // This function returns external representation of the cov. matrix
   //---------------------------------------------------------------------
-  for (Int_t i=0; i<15; i++) c[i]=fRc[i];
+  for (Int_t i=0; i<15; i++) cov[i]=fRc[i];
 }
 
 
@@ -269,6 +327,25 @@ void AliESDtrack::GetInnerXYZ(Double_t *xyz) const {
   xyz[0]=r*TMath::Cos(phi); xyz[1]=r*TMath::Sin(phi); xyz[2]=fIp[1]; 
 }
 
+void AliESDtrack::GetInnerExternalParameters(Double_t &x, Double_t p[5]) const 
+{
+  //skowron
+ //---------------------------------------------------------------------
+  // This function returns external representation of the track parameters at Inner Layer of TPC
+  //---------------------------------------------------------------------
+  x=fIx;
+  for (Int_t i=0; i<5; i++) p[i]=fIp[i];
+}
+void AliESDtrack::GetInnerExternalCovariance(Double_t cov[15]) const
+{
+ //skowron
+ //---------------------------------------------------------------------
+ // This function returns external representation of the cov. matrix at Inner Layer of TPC
+ //---------------------------------------------------------------------
+ for (Int_t i=0; i<15; i++) cov[i]=fIc[i];
+}
+
 void AliESDtrack::GetOuterPxPyPz(Double_t *p) const {
   //---------------------------------------------------------------------
   // This function returns the global track momentum components
index 687128d9cd2d10e7a3b4678eedbea811a46da002..c51e5aade0ca447ecab3fbb6031e517490c54810 100644 (file)
@@ -10,6 +10,7 @@
 //         Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch 
 //-------------------------------------------------------------------------
 #include "TObject.h"
+#include <TBits.h>
 
 class AliKalmanTrack;
 
@@ -50,7 +51,11 @@ public:
 
   void GetInnerPxPyPz(Double_t *p) const;
   void GetInnerXYZ(Double_t *r) const;
-
+  void GetInnerExternalParameters(Double_t &x, Double_t p[5]) const;//skowron
+  void GetInnerExternalCovariance(Double_t cov[15]) const;//skowron
+  Double_t GetInnerAlpha() const {return fIalpha;}
+  
+  
   void GetOuterPxPyPz(Double_t *p) const;
   void GetOuterXYZ(Double_t *r) const;
 
@@ -65,7 +70,8 @@ public:
   Float_t GetTPCsignal() const {return fTPCsignal;}
   Float_t GetTPCchi2() const {return fTPCchi2;}
   Int_t GetTPCclusters(Int_t *idx) const;
-
+  const TBits& GetTPCClusterMap(){return fTPCClusterMap;}
+  
   void SetTRDpid(const Double_t *p);
   void GetTRDpid(Double_t *p) const;
   Float_t GetTRDsignal() const {return fTRDsignal;}
@@ -129,6 +135,7 @@ protected:
   Float_t fTPCchi2;        // chi2 in the TPC
   Int_t   fTPCncls;        // number of clusters assigned in the TPC
   UInt_t  fTPCindex[180];  //! indices of the assigned TPC clusters
+  TBits   fTPCClusterMap;  // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow
   Float_t fTPCsignal;      // detector's PID signal
   Float_t fTPCr[kSPECIES]; // "detector response probabilities" (for the PID)
 
index ea359524f2a98d4c45979cd93d3ee2a22010ba29..424bd089360ac9f072b3c12b2190cf9b98ab02db 100644 (file)
@@ -66,6 +66,7 @@
 #include "AliHeader.h"
 #include "AliGenEventHeader.h"
 #include "AliESDpid.h"
+#include "AliMagF.h"
 #include <TArrayF.h>
 
 
@@ -238,6 +239,7 @@ Bool_t AliReconstruction::Run()
     fRunLoader->GetEvent(iEvent);
     esd->SetRunNumber(gAlice->GetRunNumber());
     esd->SetEventNumber(gAlice->GetEvNumber());
+    esd->SetMagneticField(fRunLoader->GetAliRun()->Field()->SolenoidField());
 
     // barrel tracking
     if (fRunTracking) {