update of data structures for internal data transport for HLT TRD (Theo)
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 Dec 2009 10:41:43 +0000 (10:41 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 Dec 2009 10:41:43 +0000 (10:41 +0000)
saving the necessary TObject bits of the Clusters, Tracklets and Tracks

HLT/TRD/AliHLTTRDCluster.cxx
HLT/TRD/AliHLTTRDCluster.h
HLT/TRD/AliHLTTRDTrack.cxx
HLT/TRD/AliHLTTRDTrack.h
HLT/TRD/AliHLTTRDTracklet.cxx
HLT/TRD/AliHLTTRDTracklet.h

index c55d175..0dda8d8 100644 (file)
@@ -8,15 +8,13 @@ AliHLTTRDCluster::AliHLTTRDCluster():
   fX(0),
   fY(0),
   fZ(0),
-  fQ(0),
   fDetector(-1),
   fLocalTimeBin(0),
   fClusterMasking(0),
   fPadCol(0),
   fPadRow(0),
   fPadTime(0),
-  fIsInChamber(kFALSE),
-  fIsShared(kFALSE)
+  fBits(0)
 {
 }
 
@@ -28,18 +26,19 @@ AliHLTTRDCluster::AliHLTTRDCluster(const AliTRDcluster* const inCluster):
   fX (inCluster->GetX()),
   fY (inCluster->GetY()),
   fZ (inCluster->GetZ()),
-  fQ (inCluster->fQ),
   fDetector (inCluster->fDetector),
   fLocalTimeBin (inCluster->fLocalTimeBin),
   fClusterMasking (inCluster->fClusterMasking),
   fPadCol (inCluster->fPadCol),
   fPadRow (inCluster->fPadRow),
   fPadTime (inCluster->fPadTime),
-  fIsInChamber(inCluster->IsInChamber()),
-  fIsShared (inCluster->IsShared())
+  fBits(0)
 {
+
   for(int i=0; i<3; i++)
     fSignals[i]=inCluster->fSignals[i+2];
+
+  fBits = UInt_t(inCluster->TestBits(-1)) >> 14; 
 }
 
 
@@ -49,13 +48,9 @@ AliHLTTRDCluster::AliHLTTRDCluster(const AliTRDcluster* const inCluster):
 //============================================================================
 void AliHLTTRDCluster::ExportTRDCluster(AliTRDcluster* const outCluster) const
 {
-  //  Print();
   outCluster->SetX(fX);
   outCluster->SetY(fY);
   outCluster->SetZ(fZ);
-  outCluster->fQ=fQ;
-  outCluster->SetInChamber(fIsInChamber);
-  outCluster->SetShared(fIsShared);
   outCluster->fDetector=fDetector;
   outCluster->fLocalTimeBin=fLocalTimeBin;
   outCluster->fClusterMasking=fClusterMasking;
@@ -63,8 +58,12 @@ void AliHLTTRDCluster::ExportTRDCluster(AliTRDcluster* const outCluster) const
   outCluster->fPadRow=fPadRow;
   outCluster->fPadTime=fPadTime;
 
-  for(int i=0; i<3; i++)
+  for(int i=0; i<3; i++){
     outCluster->fSignals[i+2]=fSignals[i];
+    outCluster->fQ+=fSignals[i];
+  }
+
+  outCluster->SetBit(UInt_t(fBits)<<14);
 }
 
 /**
index dd2bb48..395ab75 100644 (file)
@@ -15,31 +15,30 @@ class AliHLTTRDCluster
  public:
   AliHLTTRDCluster();
   AliHLTTRDCluster(const AliTRDcluster* const inCluster);
+  virtual ~AliHLTTRDCluster() {};
   void ExportTRDCluster(AliTRDcluster* const outCluster) const;
-  void Print() const;      
+  void Print() const;
   
  private:
   // From AliCluster
   Float_t  fX;             // X of the cluster in the tracking c.s.
   Float_t  fY;             // Y of the cluster in the tracking c.s.
   Float_t  fZ;             // Z of the cluster in the tracking c.s.
-  Float_t  fQ;             // Amplitude 
-
-  Short_t fSignals[3];     //  Signals in the cluster
-  Short_t fDetector;       //  TRD detector number 
-  Char_t  fLocalTimeBin;   //  T0-calibrated time bin number
-  UChar_t fClusterMasking; //  Bit field containing cluster status information;
 
   // From AliTRDcluster
-  UChar_t fPadCol;         //  Central pad number in column direction 
-  UChar_t fPadRow;         //  Central pad number in row direction 
-  UChar_t fPadTime;        //  Uncalibrated time bin number 
+  Short_t  fSignals[3];     // Signals in the cluster
+  Short_t  fDetector;       // TRD detector number 
+  Char_t   fLocalTimeBin;   // T0-calibrated time bin number
+  UChar_t  fClusterMasking; // Bit field containing cluster status information;
+
+  UChar_t  fPadCol;         // Central pad number in column direction 
+  UChar_t  fPadRow;         // Central pad number in row direction 
+  UChar_t  fPadTime;        // Uncalibrated time bin number 
 
-  Bool_t fIsInChamber;
-  Bool_t fIsShared;
+  UChar_t  fBits;           // Bits of the cluster
 
-  //   UChar_t fNPads;          //  Number of pads in cluster 
-  //   Float_t fCenter;         //  Center of the cluster relative to the pad  
+  // UChar_t  fNPads;          //  Number of pads in cluster 
+  // Float_t  fCenter;         //  Center of the cluster relative to the pad  
 
 };
 
index 365927b..c8706a2 100644 (file)
@@ -10,11 +10,13 @@ AliHLTTRDTrack::AliHLTTRDTrack():
   fDE(-1),
   fFakeRatio(-1),
   fChi2(-1),
+  // fMass(-1),
   fN(-1),
   fIntegratedLength(-1),
   fX(-1),
   fAlpha(-1),
-  fSize(sizeof(AliHLTTRDTrack))
+  fSize(sizeof(AliHLTTRDTrack)),
+  fBits(0)
 {
   InitArrays();
   // not to be used
@@ -29,11 +31,13 @@ AliHLTTRDTrack::AliHLTTRDTrack(const AliTRDtrackV1* const inTrack):
   fDE(inTrack->fDE),
   fFakeRatio(inTrack->fFakeRatio),
   fChi2(inTrack->fChi2),
+  // fMass(inTrack->fMass),
   fN(inTrack->fN),
   fIntegratedLength(inTrack->GetIntegratedLength()),
   fX(inTrack->GetX()),
   fAlpha(inTrack->GetAlpha()),
-  fSize(sizeof(AliHLTTRDTrack))
+  fSize(sizeof(AliHLTTRDTrack)),
+  fBits(0)
 {
   CopyDataMembers(inTrack);
 }
@@ -61,7 +65,7 @@ void AliHLTTRDTrack::CopyDataMembers(const AliTRDtrackV1* const inTrack)
   
   for (Int_t i = 0; i < 3; i++)
     {
-      fBudget[i] = inTrack->GetBudget(i);
+      fBudget[i] = inTrack->fBudget[i];
     }
   
   const Double_t* const Ptemp = inTrack->GetParameter();
@@ -69,12 +73,16 @@ void AliHLTTRDTrack::CopyDataMembers(const AliTRDtrackV1* const inTrack)
     {
       fP[i] = Ptemp[i];
     }
+
   const Double_t* const Ctemp = inTrack->GetCovariance();
   for (Int_t i = 0; i < 15; i++)
     {
       fC[i] = Ctemp[i];
     }
 
+  UInt_t mask = inTrack->TestBits(-1);
+  fBits = mask >> 14;
+
   for (Int_t iTracklet = 0; iTracklet < AliTRDtrackV1::kNplane; iTracklet++)
     {
       AliTRDseedV1* trdTracklet = inTrack->GetTracklet(iTracklet);
@@ -99,6 +107,7 @@ void AliHLTTRDTrack::ExportTRDTrack(AliTRDtrackV1* const outTrack) const
   outTrack->fDE=fDE;
   outTrack->fFakeRatio=fFakeRatio;
   outTrack->fChi2=fChi2;
+  // outTrack->fMass=fMass;
   outTrack->fN=fN;
   outTrack->SetIntegratedLength(fIntegratedLength);
   outTrack->Set(fX, fAlpha, fP, fC);
@@ -109,9 +118,11 @@ void AliHLTTRDTrack::ExportTRDTrack(AliTRDtrackV1* const outTrack) const
     }
   for (Int_t i = 0; i < 3; i++)
     {
-      outTrack->SetBudget(i, fBudget[i]);
+      outTrack->fBudget[i]=fBudget[i];
     }
 
+  outTrack->SetBit(UInt_t(fBits)<<14);
+
   AliHLTUInt8_t *iterPtr = (AliHLTUInt8_t*)this+sizeof(*this);
   AliHLTTRDTracklet* hltTracklet;
   
index 81d6358..83e12ae 100644 (file)
@@ -31,10 +31,7 @@ class AliHLTTRDTrack
   AliHLTTRDTrack(const AliHLTTRDTrack& inTrack);
   AliHLTTRDTrack& operator=(const AliHLTTRDTrack& inTrack);
   void InitArrays();
-  
-  /* Defenitely need */
-  //UChar_t      fPIDquality;         //  No of planes used for PID calculation        
-  
+
   /* Probably need */
   Float_t      fPID[AliPID::kSPECIES];//  PID probabilities
   Float_t      fBudget[3];            //  Integrated material budget
@@ -45,8 +42,8 @@ class AliHLTTRDTrack
   /* Defenitely need */
   Float_t      fFakeRatio;            // fake ratio
   Float_t      fChi2;                 // total chi2 value for this track
-  //Float_t      fMass;                 // mass hypothesis
-  //Int_t        fLab;                  // track label
+  // Float_t      fMass;                 // mass hypothesis
+  // Int_t        fLab;                  // track label
 
   /* Probably need */
   Int_t        fN;                    // number of associated clusters
@@ -64,6 +61,7 @@ class AliHLTTRDTrack
   //  static Float_t    fgMostProbablePt; // "Most probable" pt (to be used if Bz=0)
 
   AliHLTUInt32_t fSize;               // Size of the track with tracklets and clusters in the memory
+  UChar_t      fBits;
   Bool_t       fTrackletAtPlane[AliTRDtrackV1::kNplane];   // Used positions in the original array of tracklets
 
 
index 3552157..8cfd2a1 100644 (file)
@@ -1,4 +1,5 @@
 #include "AliHLTTRDTracklet.h"
+
 /**
  * Default Constructor
  */
@@ -11,7 +12,18 @@ AliHLTTRDTracklet::AliHLTTRDTracklet():
   fX0(-1),
   fC(-1),
   fChi2(-1),
+  // fExB(-1),
+  // fVD(-1),
+  // fT0(-1),
+  // fS2PRF(-1),
+  // fDiffL(-1),
+  // fDiffT(-1),
+  // fX(-1),
+  // fY(-1),
+  // fZ(-1),
+  // fS2Z(-1),
   fDet(-1),
+  fBits(0),
   fCount(0),
 #if defined(__HP_aCC) || defined(__DECCXX) || defined(__SUNPRO_CC)
   fSize(sizeof(AliHLTTRDTracklet)-sizeof(AliHLTTRDCluster)),
@@ -34,7 +46,18 @@ AliHLTTRDTracklet::AliHLTTRDTracklet(const AliTRDseedV1* const inTracklet):
   fX0(inTracklet->fX0),
   fC(inTracklet->fC),
   fChi2(inTracklet->fChi2),
+  // fExB(inTracklet->fExB),
+  // fVD(inTracklet->fVD),
+  // fT0(inTracklet->fT0),
+  // fS2PRF(inTracklet->fS2PRF),
+  // fDiffL(inTracklet->fDiffL),
+  // fDiffT(inTracklet->fDiffT),
+  // fX(inTracklet->fX),
+  // fY(inTracklet->fY),
+  // fZ(inTracklet->fZ),
+  // fS2Z(inTracklet->fS2Z),
   fDet(inTracklet->fDet),
+  fBits(0),
   fCount(0),
 #if defined(__HP_aCC) || defined(__DECCXX) || defined(__SUNPRO_CC)
   fSize(sizeof(AliHLTTRDTracklet)-sizeof(AliHLTTRDCluster)),
@@ -51,8 +74,6 @@ AliHLTTRDTracklet::AliHLTTRDTracklet(const AliTRDseedV1* const inTracklet):
 //============================================================================  
 void AliHLTTRDTracklet::CopyDataMembers(const AliTRDseedV1* const inTracklet)
 {
-  //fChi2Z = inTracklet->GetChi2Z();
-
   for (Int_t i=0; i < 2; i++){
     fYref[i]   = inTracklet->fYref[i];
     fZref[i]   = inTracklet->fZref[i];
@@ -62,23 +83,33 @@ void AliHLTTRDTracklet::CopyDataMembers(const AliTRDseedV1* const inTracklet)
 
   for (Int_t i=0; i < 3; i++){
     fPad[i] = inTracklet->fPad[i];
+    // fCov[i] = inTracklet->fCov[i];
   }
+
+  // for (Int_t i=0; i < 7; i++){
+  //   fRefCov[i] = inTracklet->fRefCov[i];
+  // }
+
+  // for (Int_t i=0; i < AliTRDseedV1::kNslices; i++){
+  //   fdEdx[i] = inTracklet->fdEdx[i];
+  // }
   
   for (Int_t i=0; i < AliPID::kSPECIES; i++){
     fProb[i] = inTracklet->fProb[i];
   }
 
-  for (Int_t iTimeBin = 0; iTimeBin < AliTRDseedV1::kNclusters; iTimeBin++)
-    {
-      AliTRDcluster* trdCluster = inTracklet->GetClusters(iTimeBin);
-      if (trdCluster){
-       new (&fClusters[fCount]) AliHLTTRDCluster(trdCluster);
-       fCount++;
-       fSize += sizeof(AliHLTTRDCluster);
-      }
+  fBits = UInt_t(inTracklet->TestBits(-1)) >> 14;
+
+  for (Int_t iTimeBin = 0; iTimeBin < AliTRDseedV1::kNclusters; iTimeBin++){
+    AliTRDcluster* trdCluster = inTracklet->GetClusters(iTimeBin);
+    if (trdCluster){
+      fPos[fCount] = iTimeBin;
+      new (&fClusters[fCount]) AliHLTTRDCluster(trdCluster);
+      fCount++;
+      fSize += sizeof(AliHLTTRDCluster);
     }
-  
-  //if((void*)&fClusters[fCount].Index!=(void*)GetEndPointer()){printf("ERRR");return;}
+  }  
+  //if((void*)&fClusters[fCount]!=(void*)GetEndPointer()){printf("ERRR");return;}
 }
 
 /**
@@ -91,13 +122,23 @@ void AliHLTTRDTracklet::ExportTRDTracklet(AliTRDseedV1* const outTracklet) const
   outTracklet->SetBit(AliTRDseedV1::kOwner);
 
   outTracklet->fN      = fN;
-  outTracklet->fDet    = fDet;
   outTracklet->fdX     = fdX;
   outTracklet->fX0     = fX0;
   outTracklet->fS2Y    = fS2Y;
   outTracklet->fPt     = fPt;
   outTracklet->fC      = fC;
   outTracklet->fChi2   = fChi2;
+  // outTracklet->fExB    = fExB;
+  // outTracklet->fVD     = fVD;
+  // outTracklet->fT0     = fT0;
+  // outTracklet->fS2PRF  = fS2PRF;
+  // outTracklet->fDiffL  = fDiffL;
+  // outTracklet->fDiffT  = fDiffT;
+  // outTracklet->fX      = fX;
+  // outTracklet->fY      = fY;
+  // outTracklet->fZ      = fZ;
+  // outTracklet->fS2Z    = fS2Z;
+  outTracklet->fDet    = fDet;
 
   for (Int_t i=0; i < 2; i++){
     outTracklet->fYref[i]   = fYref[i];
@@ -108,17 +149,28 @@ void AliHLTTRDTracklet::ExportTRDTracklet(AliTRDseedV1* const outTracklet) const
 
   for (Int_t i=0; i < 3; i++){
     outTracklet->fPad[i] = fPad[i];
+    // outTracklet->fCov[i] = fCov[i];
   }
 
+  // for (Int_t i=0; i < 7; i++){
+  //   outTracklet->fRefCov[i] = fRefCov[i];
+  // }
+
+  // for (Int_t i=0; i < AliTRDseedV1::kNslices; i++){
+  //   outTracklet->fdEdx[i] = fdEdx[i];
+  // }
+
   for (Int_t i=0; i < AliPID::kSPECIES; i++){
     outTracklet->fProb[i] = fProb[i];
   }
 
-  for (UInt_t iCluster=0; iCluster < fCount; iCluster++){
+  outTracklet->SetBit(UInt_t(fBits)<<14);
+
+  for(Int_t iCluster=0; iCluster < fCount; iCluster++){
     AliTRDcluster *trdCluster = new AliTRDcluster();
     fClusters[iCluster].ExportTRDCluster(trdCluster);
-    outTracklet->fClusters[iCluster] = trdCluster;
-    outTracklet->fIndexes[iCluster] = iCluster;
+    outTracklet->fClusters[fPos[iCluster]] = trdCluster;
+    outTracklet->fIndexes[fPos[iCluster]] = iCluster;
   }
 }
 
index db6bb97..d27ab0b 100644 (file)
@@ -34,10 +34,10 @@ class AliHLTTRDTracklet
   /* Defenitely need */
   UInt_t         fN;                     // number of clusters attached/used/shared
   Float_t        fdX;                    // length of time bin
-  Float_t        fYref[2];               //  Reference y
-  Float_t        fZref[2];               //  Reference z
-  Float_t        fS2Y;                   //  "Robust" sigma in Y - line fit
-  Float_t        fPt;                    //  Momentum estimate for tracklet [GeV/c]
+  Float_t        fYref[2];               // Reference y
+  Float_t        fZref[2];               // Reference z
+  Float_t        fS2Y;                   // estimated resolution in the r-phi direction
+  Float_t        fPt;                    // Momentum estimate for tracklet [GeV/c]
  
   /* Probably need */
   Float_t        fPad[3];                //  local pad definition : length/width/tilt 
@@ -47,31 +47,33 @@ class AliHLTTRDTracklet
   Float_t        fC;                     //  Curvature
   Float_t        fChi2;                  //  Global chi2
   Float_t        fProb[AliPID::kSPECIES];// PID probabilities
-  Short_t        fDet;                   //  TRD detector
 
   /* Not needed */
-  //Int_t          fLabels[3];            //  Labels
-  //Float_t        fX[knTimebins];        //! X position
-  //Float_t        fY[knTimebins];        //! Y position
-  //Float_t        fZ[knTimebins];        //! Z position
-  //Float_t        fYfitR[2];             //  Y fit position +derivation
-  //Float_t        fZfitR[2];             //  Z fit position
-  //Float_t        fMeanz;                //  Mean vaue of z
-  //Float_t        fZProb;                //  Max probbable z
-  //Int_t          fFreq;                 //  Frequency
-  //Int_t          fNChange;              //  Change z counter
-  //Float_t        fMPads;                //  Mean number of pads per cluster
+  // Float_t        fExB;                    // tg(a_L) @ tracklet location
+  // Float_t        fVD;                     // drift velocity @ tracklet location
+  // Float_t        fT0;                     // time 0 @ tracklet location
+  // Float_t        fS2PRF;                  // sigma^2 PRF for xd->0 and phi=a_L 
+  // Float_t        fDiffL;                  // longitudinal diffusion coefficient
+  // Float_t        fDiffT;                  // transversal diffusion coefficient
+  // Float_t        fX;                      // radial position of the tracklet
+  // Float_t        fY;                      // r-phi position of the tracklet
+  // Float_t        fZ;                      // z position of the tracklet
+  // Float_t        fS2Z;                    // estimated resolution in the z direction 
+  // Float_t        fdEdx[AliTRDseedV1::kNslices];         // dE/dx measurements for tracklet
+  // Float_t        fRefCov[7];              // covariance matrix of the track in the yz plane + the rest of the diagonal elements
+  // Float_t        fCov[3];                 // covariance matrix of the tracklet in the xy plane
 
-  //Float_t        fCC;                   //  Curvature with constrain
-  //Float_t        fChi2Z;                //  Global chi2
+  UChar_t        fPos[AliTRDseedV1::kNclusters]; // position of the cluster in the original array
 
-  AliHLTUInt16_t fCount;                  // Number of clusters saved in the open array
-  AliHLTUInt32_t fSize;                   // Size of the tracklet with clusters in the memory
+  Short_t        fDet;                   // TRD detector
+  UChar_t        fBits;                  // Bits of the tracklet
+  AliHLTUInt8_t  fCount;                 // Number of clusters saved in the open array
+  AliHLTUInt32_t fSize;                  // Size of the tracklet with clusters in the memory
 
 #if defined(__HP_aCC) || defined(__DECCXX) || defined(__SUNPRO_CC)
-  AliHLTTRDCluster fClusters[1];                         // Open array of clusters and their index
+  AliHLTTRDCluster fClusters[1];                         // Open array of clusters
 #else
-  AliHLTTRDCluster fClusters[0];                         // Open array of clusters and their index
+  AliHLTTRDCluster fClusters[0];                         // Open array of clusters
 #endif
 
 };