]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
temporary fix for bug http://savannah.cern.ch/bugs/?89730 (Ben & Alex)
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 12 Dec 2011 14:08:20 +0000 (14:08 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 12 Dec 2011 14:08:20 +0000 (14:08 +0000)
EVE/EveDet/AliEveTRDData.cxx
EVE/EveDet/AliEveTRDModuleImp.cxx

index 1b0e11b66bbc91965418d580b0610e3205bbdd9d..e3376638d59c18d8d1b35addc0b27d76c99dcb7d 100644 (file)
@@ -313,6 +313,11 @@ AliEveTRDTracklet::AliEveTRDTracklet(AliTRDseedV1 *trklt):TEveLine()
     AliInfo(Form("gGeo[%p] Closed[%c]", (void*)gGeoManager, gGeoManager->IsClosed()?'y':'n'));
   }
   SetUserData(trklt);
+  // init tracklet line
+  Int_t sec = AliTRDgeometry::GetSector(trklt->GetDetector());
+  Float_t alpha((0.5+sec)*AliTRDgeometry::GetAlpha()),
+          cphi(TMath::Cos(alpha)),
+          sphi(TMath::Sin(alpha));
   Float_t dx;
   Float_t x0   = trklt->GetX0();
   Float_t y0   = trklt->GetYref(0);
@@ -331,7 +336,20 @@ AliEveTRDTracklet::AliEveTRDTracklet(AliTRDseedV1 *trklt):TEveLine()
     // backup yc - for testing purposes
     Float_t yc = c->GetY(); 
     c->SetY(yc-tilt*(c->GetZ()-zt));
-    c->GetGlobalXYZ(g); 
+    
+    // Ben: Temporary(?) fix -> Issue with wrongly set flag "fIsMisaligned" of AliCluster
+    // Changes can be undone ofter the issue with the flag has been solved
+    //c->GetGlobalXYZ(g);
+    
+    // The following code for the trasformation local-to-global is just adapted from
+    // AliTRDgeometry::RotateBack(...)
+  
+    // tracking to global coordinates transformation
+    Float_t loc[3] = { c->GetX(), c->GetY(), c->GetZ() }; 
+    g[0] = loc[0] * cphi - loc[1] * sphi;
+    g[1] = loc[0] * sphi + loc[1] * cphi;
+    g[2] = loc[2];
+    // Ben: End of fix
     Int_t id = fClusters->SetNextPoint(g[0], g[1], g[2]);
     c->SetY(yc);
     fClusters->SetPointId(id, new AliTRDcluster(*c));
@@ -346,15 +364,11 @@ AliEveTRDTracklet::AliEveTRDTracklet(AliTRDseedV1 *trklt):TEveLine()
   SetLineColor(kRed);
   //SetOwnIds(kTRUE);
   
-  // init tracklet line
-  Int_t sec = AliTRDgeometry::GetSector(trklt->GetDetector());
-  Double_t alpha = AliTRDgeometry::GetAlpha() * (sec<9 ? sec + .5 : sec - 17.5); 
-
   //trklt->Fit(kTRUE);
   y0   = trklt->GetYfit(0);
   dydx = trklt->GetYfit(1);
-  Double_t xg =  x0 * TMath::Cos(alpha) - y0 * TMath::Sin(alpha); 
-  Double_t yg = x0 * TMath::Sin(alpha) + y0 * TMath::Cos(alpha);
+  Double_t xg(x0 * cphi - y0 * sphi),
+           yg(x0 * sphi + y0 * cphi);
   SetPoint(0, xg, yg, z0); 
   //SetPoint(0, x0, y0, z0);
 
@@ -363,8 +377,8 @@ AliEveTRDTracklet::AliEveTRDTracklet(AliTRDseedV1 *trklt):TEveLine()
   x0 -= dx; 
   y0 -= dydx*dx,
   z0 -= dzdx*dx; 
-  xg = x0 * TMath::Cos(alpha) - y0 * TMath::Sin(alpha); 
-  yg = x0 * TMath::Sin(alpha) + y0 * TMath::Cos(alpha);
+  xg = x0 * cphi - y0 * sphi;
+  yg = x0 * sphi + y0 * cphi;
   SetPoint(1, xg, yg, z0);
   //SetPoint(1, x0, y0, z0);
 }
index 443f99e041ca0db61765ff557b40823788a5acb6..8e81631d8fe90b7430e122237883004cabf6827c 100644 (file)
@@ -266,15 +266,24 @@ void AliEveTRDChamber::LoadClusters(TObjArray *clusters)
   }
   fRecPoints->Reset();
 
+  // get rotation parameters
+  Int_t sec = AliTRDgeometry::GetSector(GetID());
+  Float_t alpha((0.5+sec)*AliTRDgeometry::GetAlpha()),
+          cphi(TMath::Cos(alpha)),
+          sphi(TMath::Sin(alpha));
   Float_t q;
   Float_t g[3]; //global coordinates
-  AliTRDcluster *c=0x0;
+  AliTRDcluster *c(NULL);
   Int_t nc = clusters->GetEntriesFast();
   for(int iclus=0; iclus<nc; iclus++){
-    c = (AliTRDcluster*)clusters->UncheckedAt(iclus);
-    c->GetGlobalXYZ(g); 
+    if(!(c = (AliTRDcluster*)clusters->UncheckedAt(iclus))) continue;
     q = c->GetQ();
-    Int_t id = fRecPoints->SetNextPoint(g[0], g[1], g[2]);    
+    // Temorary fix related to bug http://savannah.cern.ch/bugs/?89730
+    // c->GetGlobalXYZ(g);
+    g[0] = c->GetX() * cphi - c->GetY() * sphi;
+    g[1] = c->GetX() * sphi + c->GetY() * cphi;
+    g[2] = c->GetZ();
+    Int_t id = fRecPoints->SetNextPoint(g[0], g[1], g[2]);
     fRecPoints->SetPointId(id, new AliTRDcluster(*c));
   }
   fRecPoints->StampObjProps();
@@ -296,15 +305,24 @@ void AliEveTRDChamber::LoadClusters(AliTRDtrackingChamber *tc)
   }
   fRecPoints->Reset();
 
+  // get rotation parameters
+  Int_t sec = AliTRDgeometry::GetSector(fDet);
+  Float_t alpha((0.5+sec)*AliTRDgeometry::GetAlpha()),
+          cphi(TMath::Cos(alpha)),
+          sphi(TMath::Sin(alpha));
   Float_t g[3]; //global coordinates
-  const AliTRDchamberTimeBin *tb = 0x0;
+  const AliTRDchamberTimeBin *tb(NULL);
   for(int itb=0; itb<AliTRDseedV1::kNtb; itb++){
     tb = tc->GetTB(itb);
     if(!(Int_t(*tb))) continue;
-    const AliTRDcluster *c= 0x0; Int_t ic = 0;
+    const AliTRDcluster *c(NULL); Int_t ic = 0;
     while((c=tb->GetCluster(ic))){
-      c->GetGlobalXYZ(g); 
-      Int_t id = fRecPoints->SetNextPoint(g[0], g[1], g[2]);    
+      // Temorary fix related to bug http://savannah.cern.ch/bugs/?89730
+      // c->GetGlobalXYZ(g);
+      g[0] = c->GetX() * cphi - c->GetY() * sphi;
+      g[1] = c->GetX() * sphi + c->GetY() * cphi;
+      g[2] = c->GetZ();
+      Int_t id = fRecPoints->SetNextPoint(g[0], g[1], g[2]);
       fRecPoints->SetPointId(id, new AliTRDcluster(*c));
       ic++;
     }