]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDseedV1.cxx
totEt updates from Christine
[u/mrichter/AliRoot.git] / TRD / AliTRDseedV1.cxx
index 91ad433cfda87739c2cab0073dd0e704db441e3f..fd53b09399eba2e5a26ae952875a6ee589e188a2 100644 (file)
@@ -420,22 +420,22 @@ void AliTRDseedV1::CookdEdx(Int_t nslices)
   for(int ic=0; ic<AliTRDtrackerV1::GetNTimeBins(); ic++){
     if(!(c = fClusters[ic]) && !(c = fClusters[ic+kNtb])) continue;
     Float_t dx = TMath::Abs(fX0 - c->GetX());
-    
+
     // Filter clusters for dE/dx calculation
-    
+
     // 1.consider calibration effects for slice determination
     Int_t slice;
-    if(dx<kDriftLength){ // TODO should be replaced by c->IsInChamber() 
+    if(dx<kDriftLength){ // TODO should be replaced by c->IsInChamber()
       slice = Int_t(dx * nslices / kDriftLength);
     } else slice = c->GetX() < fX0 ? nslices-1 : 0;
 
 
     // 2. take sharing into account
     Float_t w = /*c->IsShared() ? .5 :*/ 1.;
-    
+
     // 3. take into account large clusters TODO
     //w *= c->GetNPads() > 3 ? .8 : 1.;
-    
+
     //CHECK !!!
     fdEdx[slice]   += w * GetdQdl(ic); //fdQdl[ic];
   } // End of loop over clusters
@@ -482,6 +482,21 @@ Float_t AliTRDseedV1::GetAnodeWireOffset(Float_t zt)
 }
 
 
+//____________________________________________________________________
+Float_t AliTRDseedV1::GetCharge(Bool_t useOutliers)
+{
+// Computes total charge attached to tracklet. If "useOutliers" is set clusters 
+// which are not in chamber are also used (default false)
+
+  AliTRDcluster *c(NULL); Float_t qt(0.);
+  for(int ic=0; ic<kNclusters; ic++){
+    if(!(c=fClusters[ic])) continue;
+    if(c->IsInChamber() && !useOutliers) continue;
+    qt += TMath::Abs(c->GetQ());
+  }
+  return qt;
+}
+
 //____________________________________________________________________
 Float_t AliTRDseedV1::GetdQdl(Int_t ic, Float_t *dl) const
 {
@@ -511,7 +526,8 @@ Float_t AliTRDseedV1::GetdQdl(Int_t ic, Float_t *dl) const
   if(fClusters[ic] && fClusters[ic]->IsInChamber()){
     hasClusterInChamber = kTRUE;
     dq += TMath::Abs(fClusters[ic]->GetQ());
-  }else if(fClusters[ic+kNtb] && fClusters[ic+kNtb]->IsInChamber()){
+  }
+  if(fClusters[ic+kNtb] && fClusters[ic+kNtb]->IsInChamber()){
     hasClusterInChamber = kTRUE;
     dq += TMath::Abs(fClusters[ic+kNtb]->GetQ());
   }