]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCseed.cxx
New method to get the ratio between the expected and actual cluster shape. Will be...
[u/mrichter/AliRoot.git] / TPC / AliTPCseed.cxx
index 77b7b39fa9ae59c9bb541c188479657120459584..b52f020b4302f3b21d4caf830f6a7917e9165421 100644 (file)
@@ -68,8 +68,11 @@ AliTPCseed::AliTPCseed():
     fNCDEDX[i] = 0;
   }
   for (Int_t i=0;i<12;i++) fOverlapLabels[i] = -1;
-  for (Int_t i=0;i<160;i++) fClusterMap[i]=kFALSE;
-  for (Int_t i=0;i<160;i++) fSharedMap[i]=kFALSE;
+  //  for (Int_t i=0;i<160;i++) fClusterMap[i]=kFALSE;
+  //for (Int_t i=0;i<160;i++) fSharedMap[i]=kFALSE;
+  fClusterMap.ResetAllBits(kFALSE);
+  fSharedMap.ResetAllBits(kFALSE);
+
 }
 
 AliTPCseed::AliTPCseed(const AliTPCseed &s, Bool_t clusterOwner):
@@ -174,8 +177,12 @@ AliTPCseed::AliTPCseed(const AliTPCtrack &t):
     fNCDEDX[i] = 0;
   }
   for (Int_t i=0;i<12;i++) fOverlapLabels[i] = -1;
-  for (Int_t i=0;i<160;i++) fClusterMap[i]=kFALSE;
-  for (Int_t i=0;i<160;i++) fSharedMap[i]=kFALSE;
+  
+  //for (Int_t i=0;i<160;i++) fClusterMap[i]=kFALSE;
+  //for (Int_t i=0;i<160;i++) fSharedMap[i]=kFALSE;
+  fClusterMap.ResetAllBits(kFALSE);
+  fSharedMap.ResetAllBits(kFALSE);
+
 }
 
 AliTPCseed::AliTPCseed(Double_t xr, Double_t alpha, const Double_t xx[5],
@@ -235,16 +242,54 @@ AliTPCseed::~AliTPCseed(){
       delete fClusterPointer[icluster];
     }
   }
-  for (Int_t i=0;i<160;i++) fClusterMap[i]=kFALSE;
-  for (Int_t i=0;i<160;i++) fSharedMap[i]=kFALSE;
+
 }
 //_________________________________________________
-AliTPCseed & AliTPCseed::operator =(const AliTPCseed & param)
+AliTPCseed & AliTPCseed::operator=(const AliTPCseed &param)
 {
   //
-  // assignment operator - dummy
+  // assignment operator 
   //
-  fRow=param.fRow;
+  if(this!=&param){
+    AliTPCtrack::operator=(param);
+    fEsd =param.fEsd; 
+    for(Int_t i = 0;i<160;++i)fClusterPointer[i] = param.fClusterPointer[i]; // this is not allocated by AliTPCSeed
+    fClusterOwner = param.fClusterOwner;
+    // leave out fPoint, they are also not copied in the copy ctor...
+    // but deleted in the dtor... strange...
+    // fPoints =
+    // fEPoints =
+    fRow            = param.fRow;
+    fSector         = param.fSector;
+    fRelativeSector = param.fRelativeSector;
+    fCurrentSigmaY2 = param.fCurrentSigmaY2;
+    fCurrentSigmaZ2 = param.fCurrentSigmaZ2;
+    fErrorY2        = param.fErrorY2;
+    fErrorZ2        = param.fErrorZ2;
+    fCurrentCluster = param.fCurrentCluster; // this is not allocated by AliTPCSeed
+    fCurrentClusterIndex1 = param.fCurrentClusterIndex1; 
+    fInDead         = param.fInDead;
+    fIsSeeding      = param.fIsSeeding;
+    fNoCluster      = param.fNoCluster;
+    fSort           = param.fSort;
+    fBSigned        = param.fBSigned;
+    for(Int_t i = 0;i<4;++i){
+      fDEDX[i]   = param.fDEDX[i];
+      fSDEDX[i]  = param.fSDEDX[i];
+      fNCDEDX[i] = param.fNCDEDX[i];
+    }
+    for(Int_t i = 0;i<AliPID::kSPECIES;++i)fTPCr[i] = param.fTPCr[i];
+    
+    fSeedType = param.fSeedType;
+    fSeed1    = param.fSeed1;
+    fSeed2    = param.fSeed2;
+    for(Int_t i = 0;i<12;++i)fOverlapLabels[i] = param.fOverlapLabels[i];
+    fMAngular = param.fMAngular;
+    fCircular = param.fCircular;
+    for(int i = 0;i<160;++i)fTrackPoints[i] =  param.fTrackPoints[i];
+    fClusterMap = param.fClusterMap;
+    fSharedMap = param.fSharedMap;
+  }
   return (*this);
 }
 //____________________________________________________
@@ -309,6 +354,7 @@ void AliTPCseed::GetClusterStatistic(Int_t first, Int_t last, Int_t &found, Int_
   for (Int_t i=first;i<last; i++){
     Int_t index = GetClusterIndex2(i);
     if (index!=-1) foundable++;
+    if (index&0x8000) continue;
     if (fClusterPointer[i]) {
       found++;
     }
@@ -987,3 +1033,32 @@ Bool_t AliTPCseed::GetSharedMapBit(int ibit)
 {
   return fSharedMap[ibit];
 }
+
+
+Float_t  AliTPCseed::CookShape(Int_t type){
+  //
+  //
+  //
+ //-----------------------------------------------------------------
+  // This funtion calculates dE/dX within the "low" and "up" cuts.
+  //-----------------------------------------------------------------
+  Float_t means=0;
+  Float_t meanc=0;
+  for (Int_t i =0; i<160;i++)    {
+    AliTPCTrackerPoint * point = GetTrackPoint(i);
+    if (point==0) continue;
+
+    AliTPCclusterMI * cl = fClusterPointer[i];
+    if (cl==0) continue;       
+    
+    Float_t rsigmay =  TMath::Sqrt(point->GetSigmaY());
+    Float_t rsigmaz =  TMath::Sqrt(point->GetSigmaZ());
+    Float_t rsigma =   (rsigmay+rsigmaz)*0.5;
+    if (type==0) means+=rsigma;
+    if (type==1) means+=rsigmay;
+    if (type==2) means+=rsigmaz;
+    meanc++;
+  }
+  Float_t mean = (meanc>0)? means/meanc:0;
+  return mean;
+}