]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ALIFAST/AliFFruit.cxx
This commit was generated by cvs2svn to compensate for changes in r1018,
[u/mrichter/AliRoot.git] / ALIFAST / AliFFruit.cxx
diff --git a/ALIFAST/AliFFruit.cxx b/ALIFAST/AliFFruit.cxx
new file mode 100644 (file)
index 0000000..7335bd6
--- /dev/null
@@ -0,0 +1,93 @@
+
+//////////////////////////////////////////////////////////////////////////
+//                                                                      //
+// AliFFruit                                                            //
+//                                                                      //
+// Utility class to draw Electrons, photons, Jets, Clusters,etc         //
+//                                                                      //
+//////////////////////////////////////////////////////////////////////////
+
+#include <TROOT.h>
+#include <TMath.h>
+
+#include "AliFDisplay.h"
+#include "AliFFruit.h"
+#include "AliFast.h"
+
+ClassImp(AliFFruit)
+
+
+//_____________________________________________________________________________
+AliFFruit::AliFFruit(TObject *obj, Float_t eta, Float_t phi, Float_t pt, Int_t type)
+          : TPolyLine3D(2)
+{
+  // Create a fruit object.
+  // Current implementation uses a 3-d polyline to visualize this fruit
+
+   fFruit = obj;
+   SetBit(kCanDelete);
+
+   const Int_t color[7] = {0,7,3,2,6,4,0};
+   const Int_t width[7] = {8,8,8,8,8,8,8};
+   Int_t lwidth = width[type];
+   AliFDisplay *display = (AliFDisplay*)gAliFast->Display();
+   if (display->AllViews()) lwidth /= 2;
+   const Float_t PTMAX = 100;
+   if (pt <= 0) return;
+   Float_t rin    = display->Rin();
+   Float_t rout   = display->Rout();
+   Float_t theta  = 2*TMath::ATan(TMath::Exp(-eta));
+   Float_t tantet = TMath::Tan(theta);
+   Float_t cosphi = TMath::Cos(phi);
+   Float_t sinphi = TMath::Sin(phi);
+   Float_t zz = pt/PTMAX;
+   if (zz > 3) zz = 3;
+   Float_t rex = rin + 3*zz*(rout - rin);
+   Float_t z1,z2;
+   if (eta != 0) {
+      z1 = rin/tantet;
+      z2 = rex/tantet;
+   } else {
+      z1 = z2 = 0;
+   }
+   SetPoint(0, rin*cosphi,rin*sinphi, z1);
+   SetPoint(1, rex*cosphi,rex*sinphi, z2);
+   SetLineColor(color[type]);
+   SetLineWidth(width[type]);
+}
+
+//_____________________________________________________________________________
+void AliFFruit::Delete(Option_t *)
+{
+//    Dummy
+
+}
+
+//______________________________________________________________________________
+char *AliFFruit::GetObjectInfo(Int_t px, Int_t py)
+{
+   return fFruit->GetObjectInfo(px, py);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+