]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
adding methods for memory allocation and conversion to space points; adding info...
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 26 Jul 2011 09:51:35 +0000 (09:51 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 26 Jul 2011 09:51:35 +0000 (09:51 +0000)
HLT/BASE/AliHLTSpacePointContainer.cxx
HLT/BASE/AliHLTSpacePointContainer.h
HLT/BASE/AliHLTTrackGeometry.cxx
HLT/BASE/AliHLTTrackGeometry.h

index 12816d7b6c102771c28f39b3a8d96738bdc04a12..0c6080fbcac2a393ff5541f11fc0ace295575012 100644 (file)
@@ -161,6 +161,17 @@ int AliHLTSpacePointContainer::AddInputBlocks(const char* listfile, AliHLTCompon
   return count;
 }
 
+AliHLTUInt8_t* AliHLTSpacePointContainer::Alloc(int size)
+{
+  /// alloc memory for a space point data block
+  TArrayC* buffer=new TArrayC;
+  if (!buffer) return NULL;
+
+  buffer->Set(size);
+  fBuffers.push_back(buffer);
+  return reinterpret_cast<AliHLTUInt8_t*>(buffer->GetArray());
+}
+
 AliHLTSpacePointContainer* AliHLTSpacePointContainer::SelectByTrack(int /*trackId*/, bool /*bAlloc*/) const
 {
   /// create a collection of clusters for a specific track
@@ -348,6 +359,7 @@ void AliHLTSpacePointContainer::Draw(Option_t *option)
     float sinphi=TMath::Sin(clusterphi);
     float clusterx=GetX(*clusterID);
     float clustery=GetY(*clusterID);
+    cout << " " << *clusterID << " " << clusterx << " " << clustery << " " << clusterphi << endl;
     // rotate
     float pointx= clusterx*sinphi + clustery*cosphi;
     float pointy=-clusterx*cosphi + clustery*sinphi;
index 2688f07fa498751c497b9bcefda60868e7cc6ccd..7276c74db64db3e230e49102d2f1c07dace11994 100644 (file)
@@ -90,6 +90,9 @@ class AliHLTSpacePointContainer : public TObject, public AliHLTLogging
   /// add input block from list of blank separated files to collection
   int AddInputBlocks(const char* filenames, AliHLTComponentDataType dt);
 
+  /// alloc memory for a space point data block
+  AliHLTUInt8_t* Alloc(int size);
+
   /// inherited from TObject: clear the object and reset pointer references
   virtual void Clear(Option_t * /*option*/ ="");
 
index 580202c912a72dea83cb15bc55af7d8c80ff42c4..e5b5c2c78ae99b07c321da13d31cc02fa6e69cc9 100644 (file)
@@ -102,6 +102,7 @@ void AliHLTTrackGeometry::Draw(Option_t *option)
   float center[2]={0.5,0.5};
   int markerColor=1;
   int markerSize=1;
+  int verbosity=0;
 
   TString strOption(option);
   std::auto_ptr<TObjArray> tokens(strOption.Tokenize(" "));
@@ -143,6 +144,13 @@ void AliHLTTrackGeometry::Draw(Option_t *option)
       markerSize=arg.Atoi();
       continue;
     }
+
+    key="verbosity=";
+    if (arg.BeginsWith(key)) {
+      arg.ReplaceAll(key, "");
+      verbosity=arg.Atoi();
+      continue;
+    }
   }
 
   bool bFirstPoint=true;
@@ -156,6 +164,9 @@ void AliHLTTrackGeometry::Draw(Option_t *option)
     float sina=TMath::Sin(alpha);
     float x = r*sina + point->GetU()*cosa;
     float y =-r*cosa + point->GetU()*sina;
+    if (verbosity>0) {
+      HLTInfo("ID 0x%08x: x=% .4f y=% .4f alpha=% .4f", point->GetId(), r, point->GetU(), alpha);
+    }
     int color=markerColor;
     if (bFirstPoint) {
       bFirstPoint=false;
@@ -209,6 +220,13 @@ AliHLTTrackGeometry::AliHLTTrackPoint* AliHLTTrackGeometry::GetTrackPoint(AliHLT
   return &(*element);
 }
 
+AliHLTSpacePointContainer* AliHLTTrackGeometry::ConvertToSpacePoints() const
+{
+  /// create a collection of all points
+  HLTError("implementation of child method missing");
+  return NULL;
+}
+
 int AliHLTTrackGeometry::AssociateSpacePoints(AliHLTSpacePointContainer& points)
 {
   /// associate the track space points to the calculated track points
index 66ac40c124f097cf897f61a0baaf7833a26461b8..96354102bf44be6fb9394d1b85c10ebad2b63806 100644 (file)
@@ -210,6 +210,9 @@ class AliHLTTrackGeometry : public TObject, public AliHLTLogging
   /// get track point of id
   AliHLTTrackPoint* GetTrackPoint(AliHLTUInt32_t id);
 
+  /// create a collection of all points
+  virtual AliHLTSpacePointContainer* ConvertToSpacePoints() const;
+
   /// set the spacepoint associated with a track point
   /// @param  planeId       track point
   /// @param  spacepointId  space point id to be associated with track point
@@ -239,6 +242,8 @@ class AliHLTTrackGeometry : public TObject, public AliHLTLogging
  protected:
   int AddTrackPoint(const AliHLTTrackPoint& point);
 
+  const vector<AliHLTTrackPoint>& TrackPoints() const {return fTrackPoints;}
+
  private:
   vector<AliHLTTrackPoint> fTrackPoints; // list of points