- adding data structure for raw clusters
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 16 Jun 2011 23:00:11 +0000 (23:00 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 16 Jun 2011 23:00:11 +0000 (23:00 +0000)
- defining new data type for raw clusters {CLUSTRAW:TPC }
- new option '-publish-raw' added to software CF
- enabled option '-publish-raw' in the TPC agent
- defining a configuration TPC-raw-clusters in the agent
- handle the {CLUSTRAW:TPC } data block in the interface AliHLTTPCClusterAccessHLTOUT

M    TPCLib/AliHLTTPCDefinitions.cxx
M    TPCLib/AliHLTTPCDefinitions.h
M    TPCLib/AliHLTTPCClusterFinder.cxx
M    TPCLib/AliHLTTPCClusterFinderComponent.h
M    TPCLib/AliHLTTPCClusterFinder.h
M    TPCLib/AliHLTTPCClusterFinderComponent.cxx
M    TPCLib/AliHLTTPCAgent.cxx
M    TPCLib/AliHLTTPCClusterAccessHLTOUT.cxx
AM   TPCLib/AliHLTTPCRawCluster.h
M    TPCLib/AliHLTTPCClusterAccessHLTOUT.h

HLT/TPCLib/AliHLTTPCAgent.cxx
HLT/TPCLib/AliHLTTPCClusterAccessHLTOUT.cxx
HLT/TPCLib/AliHLTTPCClusterAccessHLTOUT.h
HLT/TPCLib/AliHLTTPCClusterFinder.cxx
HLT/TPCLib/AliHLTTPCClusterFinder.h
HLT/TPCLib/AliHLTTPCClusterFinderComponent.cxx
HLT/TPCLib/AliHLTTPCClusterFinderComponent.h
HLT/TPCLib/AliHLTTPCDefinitions.cxx
HLT/TPCLib/AliHLTTPCDefinitions.h
HLT/TPCLib/AliHLTTPCRawCluster.h [new file with mode: 0644]

index c7e2a26..faebc46 100644 (file)
@@ -140,18 +140,12 @@ int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
 
        // cluster finder components
        cf.Form("TPC-CF_%02d_%d", slice, part);
-       arg="-release-memory";
+       arg="-release-memory -publish-raw";
        if (!rawReader && runloader) {
          arg+=" -do-mc";
          handler->CreateConfiguration(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), arg.Data());
        } else {
-#ifndef HAVE_NOT_ALTRORAWSTREAMV3
          handler->CreateConfiguration(cf.Data(), "TPCClusterFinder32Bit", publisher.Data(),arg.Data());
-#else
-         // using the AltroDecoder if the official V3 decoder is not
-         // available in the offline code
-         handler->CreateConfiguration(cf.Data(), "TPCClusterFinderDecoder", publisher.Data(), arg.Data());
-#endif 
        }
        if (trackerInput.Length()>0) trackerInput+=" ";
        trackerInput+=cf;
@@ -163,7 +157,7 @@ int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
       TString tracker;
       // tracker finder components
       tracker.Form("TPC-TR_%02d", slice);
-      handler->CreateConfiguration(tracker.Data(), "TPCCATracker", trackerInput.Data(), "");
+      handler->CreateConfiguration(tracker.Data(), "TPCCATracker", trackerInput.Data(), "-minTrackPt 0.0");
 
       if (mergerInput.Length()>0) mergerInput+=" ";
       mergerInput+=tracker;
@@ -190,7 +184,8 @@ int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
     handler->CreateConfiguration("TPC-esd-converter", "TPCEsdConverter"   , converterInput.Data(), "");
 
     // cluster dump collection
-    handler->CreateConfiguration("TPC-clusters", "BlockFilter"   , sinkClusterInput.Data(), "-datatype 'CLUSTERS' 'TPC '");
+    handler->CreateConfiguration("TPC-clusters", "BlockFilter"   , sinkClusterInput.Data(), "-datatype 'CLUSTERS' 'TPC ' -datatype 'CLMCINFO' 'TPC '");
+    handler->CreateConfiguration("TPC-raw-clusters", "BlockFilter"   , sinkClusterInput.Data(), "-datatype 'CLUSTRAW' 'TPC ' -datatype 'CLMCINFO' 'TPC '");
 
     /////////////////////////////////////////////////////////////////////////////////////
     //
@@ -342,6 +337,18 @@ int AliHLTTPCAgent::GetHandlerDescription(AliHLTComponentDataType dt,
       return 1;
   }
 
+  // {'CLUSTRAW':'TPC '} 
+  if (dt==AliHLTTPCDefinitions::fgkRawClustersDataType) {
+      desc=AliHLTOUTHandlerDesc(kProprietary, dt, GetModuleId());
+      return 1;
+  }
+
+  // {'CLMCINFO':'TPC '} 
+  if (dt==AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo) {
+      desc=AliHLTOUTHandlerDesc(kProprietary, dt, GetModuleId());
+      return 1;
+  }
+
   // afterburner for {'TRAKSEGS':'TPC '} blocks to be converted to ESD format
   if (dt==AliHLTTPCDefinitions::fgkTrackSegmentsDataType) {
       desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId());
index fcfb8ae..2dbf369 100644 (file)
@@ -25,6 +25,7 @@
 #include "AliHLTTPCClusterAccessHLTOUT.h"
 #include "AliHLTTPCDefinitions.h"
 #include "AliHLTTPCClusterDataFormat.h"
+#include "AliHLTTPCRawCluster.h"
 #include "AliHLTOUT.h"
 #include "AliHLTComponent.h"
 #include "AliLog.h"
@@ -172,8 +173,10 @@ int AliHLTTPCClusterAccessHLTOUT::ProcessClusters(const char* params)
        iResult=ReadAliHLTTPCClusterMCData(pHLTOUT, tpcClusterLabels);
       }
 
-      if (pHLTOUT->SelectFirstDataBlock(AliHLTTPCDefinitions::fgkClustersDataType, spec)>=0) {
-       iResult=ReadAliHLTTPCClusterData(pHLTOUT, fClusters);
+      if (pHLTOUT->SelectFirstDataBlock(AliHLTTPCDefinitions::fgkRawClustersDataType, spec)>=0) {
+       iResult=ReadAliHLTTPCRawClusterData(pHLTOUT, fClusters, &tpcClusterLabels);
+      } else if (pHLTOUT->SelectFirstDataBlock(AliHLTTPCDefinitions::fgkClustersDataType, spec)>=0) {
+       iResult=ReadAliHLTTPCClusterData(pHLTOUT, fClusters, &tpcClusterLabels);
       }
     }
   }
@@ -271,8 +274,8 @@ int AliHLTTPCClusterAccessHLTOUT::ReadAliHLTTPCClusterData(AliHLTOUT* pHLTOUT, T
        break; // this is a problem of all objects
       }
       pCluster->SetRow(clusters[i].fPadRow);
-      pCluster->SetTimeBin(clusters[i].fZ);
       pCluster->SetPad(clusters[i].fY);
+      pCluster->SetTimeBin(clusters[i].fZ);
       pCluster->SetSigmaY2(clusters[i].fSigmaY2);
       pCluster->SetSigmaZ2(clusters[i].fSigmaZ2);
       pCluster->SetQ(clusters[i].fCharge);
@@ -294,3 +297,71 @@ int AliHLTTPCClusterAccessHLTOUT::ReadAliHLTTPCClusterData(AliHLTOUT* pHLTOUT, T
   } while (pHLTOUT->SelectNextDataBlock()>=0);
   return iResult;
 }
+
+int AliHLTTPCClusterAccessHLTOUT::ReadAliHLTTPCRawClusterData(AliHLTOUT* pHLTOUT, TClonesArray* pClusters, const AliHLTTPCClusterMCDataList *tpcClusterLabels)
+{
+  // read cluster data from AliHLTTPCClusterData
+
+  // FIXME: this is in large parts like ReadAliHLTTPCClusterData,
+  // make a common method
+  int iResult=0;
+  if (!pHLTOUT || !pClusters) return -EINVAL;
+  do {
+    const AliHLTUInt8_t* pBuffer=NULL;
+    AliHLTUInt32_t size=0;
+    if ((iResult=pHLTOUT->GetDataBuffer(pBuffer, size))<0) {
+      continue;
+    }
+    if (pBuffer==NULL || size<4) {
+      AliError("invalid cluster data block");
+      continue;
+    }
+    AliHLTComponentDataType dt=kAliHLTVoidDataType;
+    AliHLTUInt32_t specification=kAliHLTVoidDataSpec;
+    if (pHLTOUT->GetDataBlockDescription(dt, specification)<0) {
+      AliError("failed to retrieve data block description, skipping mc cluster data block ...");
+      continue;
+    }
+    const AliHLTTPCRawClusterData* clusterData = reinterpret_cast<const AliHLTTPCRawClusterData*>(pBuffer);
+    Int_t nCount = (Int_t) clusterData->fCount;
+    if (nCount*sizeof(AliHLTTPCRawCluster) + sizeof(AliHLTTPCRawClusterData) != size) {
+      AliError("inconsistent cluster data block size, skipping block");
+      continue;
+    }
+    const AliHLTTPCRawCluster *clusters = clusterData->fClusters;
+    int offset=pClusters->GetEntries();
+    pClusters->ExpandCreate(offset+nCount);
+    for (int i=0; i<nCount; i++) {
+      if (!pClusters->At(offset+i)) continue;
+      AliTPCclusterMI* pCluster=dynamic_cast<AliTPCclusterMI*>(pClusters->At(offset+i));
+      if (!pCluster) {
+       AliError("invalid object type, expecting AliTPCclusterMI");
+       break; // this is a problem of all objects
+      }
+      pCluster->SetRow(clusters[i].GetPadRow());
+      pCluster->SetPad(clusters[i].GetPad());
+      pCluster->SetTimeBin(clusters[i].GetTime());
+      pCluster->SetSigmaY2(clusters[i].GetSigmaY2());
+      pCluster->SetSigmaZ2(clusters[i].GetSigmaZ2());
+      pCluster->SetQ(clusters[i].GetCharge());
+      pCluster->SetMax(clusters[i].GetQMax());
+      if (tpcClusterLabels) {
+       AliHLTUInt8_t slice = AliHLTTPCDefinitions::GetMinSliceNr(specification);
+       AliHLTUInt8_t partition = AliHLTTPCDefinitions::GetMinPatchNr(specification);
+       UInt_t clusterID=AliHLTTPCSpacePointData::GetID(slice, partition, i);
+       if (tpcClusterLabels->find(clusterID)!=tpcClusterLabels->end()) {
+         const AliHLTTPCClusterMCWeight* mcWeights=tpcClusterLabels->find(clusterID)->second.fClusterID;
+         for (int k=0; k<3; k++) {
+           // TODO: sort the labels according to the weight in order to assign the most likely mc label
+           // to the first component 
+           pCluster->SetLabel(mcWeights[k].fMCID, k);
+         }
+       } else {
+         AliError(Form("can not find mc label of cluster with id %0x08x", clusterID));
+       }
+      }
+    }
+    if (fVerbosity>0) AliInfo(Form("converted %d cluster(s) from block %s 0x%08x", nCount, AliHLTComponent::DataType2Text(dt).c_str(), specification));
+  } while (pHLTOUT->SelectNextDataBlock()>=0);
+  return iResult;
+}
index 06c45a7..aef7e7a 100644 (file)
@@ -98,6 +98,9 @@ class AliHLTTPCClusterAccessHLTOUT : public TObject
   /// process the cluster data block {CLUSTERS:TPC } from HLTOUT
   int ReadAliHLTTPCClusterData(AliHLTOUT* pHLTOUT, TClonesArray* pClusters, const AliHLTTPCClusterMCDataList *tpcClusterLabels=NULL) const;
 
+  /// process the cluster data block {CLUSTRAW:TPC } from HLTOUT
+  int ReadAliHLTTPCRawClusterData(AliHLTOUT* pHLTOUT, TClonesArray* pClusters, const AliHLTTPCClusterMCDataList *tpcClusterLabels);
+
  private:
   /// copy constructor prohibited
   AliHLTTPCClusterAccessHLTOUT(const AliHLTTPCClusterAccessHLTOUT&);
index a093d31..b0ea3c3 100644 (file)
@@ -57,7 +57,7 @@ AliHLTTPCClusterFinder::AliHLTTPCClusterFinder()
   fDeconvPad(kFALSE),
   fStdout(kFALSE),
   fCalcerr(kTRUE),
-  fRawSP(kFALSE),
+  fFillRawClusters(kFALSE),
   fFirstRow(0),
   fLastRow(0),
   fCurrentRow(0),
@@ -75,6 +75,7 @@ AliHLTTPCClusterFinder::AliHLTTPCClusterFinder()
   fClusters(),
   fClustersMCInfo(),
   fMCDigits(),
+  fRawClusters(),
   fNumberOfPadsInRow(NULL),
   fNumberOfRows(0),
   fRowOfFirstCandidate(0),
@@ -142,6 +143,7 @@ void AliHLTTPCClusterFinder::InitSlice(Int_t slice,Int_t patch,Int_t nmaxpoints)
   fClustersMCInfo.clear();
   fMCDigits.clear();
   fClusterMCVector.clear();   
+  fRawClusters.clear();
 }
 
 void AliHLTTPCClusterFinder::InitializePadArray(){
@@ -558,6 +560,17 @@ Int_t AliHLTTPCClusterFinder::FillOutputMCInfo(AliHLTTPCClusterMCLabel * outputM
   return counter;
 }
 
+Int_t AliHLTTPCClusterFinder::FillOutputRaw(AliHLTTPCRawCluster* rawClusters, unsigned sizeInByte) const
+{
+  // fill the raw clusters
+  if (fRawClusters.size()*sizeof(AliHLTTPCRawCluster)>sizeInByte) {
+    HLTError("not enough space to write raw clusters");
+    return 0;
+  }
+  memcpy(rawClusters, &fRawClusters[0], fRawClusters.size()*sizeof(AliHLTTPCRawCluster));
+  return fRawClusters.size();
+}
+
 void AliHLTTPCClusterFinder::FindClusters(){
   // see header file for function documentation
 
@@ -1088,6 +1101,10 @@ void AliHLTTPCClusterFinder::WriteClusters(Int_t nclusters,AliClusterData *list)
   Int_t thisrow=-1,thissector=-1;
   UInt_t counter = fNClusters;
   
+  if (fFillRawClusters) {
+    fRawClusters.resize(nclusters);
+  }
+
   for(int j=0; j<nclusters; j++)
     {
 
@@ -1138,14 +1155,14 @@ void AliHLTTPCClusterFinder::WriteClusters(Int_t nclusters,AliClusterData *list)
              <<"SigmaY2 negative "<<sy2<<" on row "<<fCurrentRow<<" "<<fpad<<" "<<ftime<<ENDLOG;
            continue;
        } else {
-         if(!fRawSP){
+         {
            fpad2 = (sy2 + 1./12)*AliHLTTPCTransform::GetPadPitchWidth(patch)*AliHLTTPCTransform::GetPadPitchWidth(patch);
            if(sy2 != 0){
              fpad2*=0.108; //constants are from offline studies
              if(patch<2)
                fpad2*=2.07;
            }
-         } else fpad2=sy2; //take the width not the error
+         }
        }
        //      Float_t sz2=list[j].fTime2*list[j].fTotalCharge - list[j].fTime*list[j].fTime;
        Float_t sz2=(Float_t)list[j].fTime2*list[j].fTotalCharge - (Float_t)list[j].fTime*list[j].fTime;
@@ -1155,20 +1172,25 @@ void AliHLTTPCClusterFinder::WriteClusters(Int_t nclusters,AliClusterData *list)
            <<"SigmaZ2 negative "<<sz2<<" on row "<<fCurrentRow<<" "<<fpad<<" "<<ftime<<ENDLOG;
          continue;
        } else {
-         if(!fRawSP){
+         {
            ftime2 = (sz2 + 1./12)*AliHLTTPCTransform::GetZWidth()*AliHLTTPCTransform::GetZWidth();
            if(sz2 != 0) {
              ftime2 *= 0.169; //constants are from offline studies
              if(patch<2)
                ftime2 *= 1.77;
            }
-         } else ftime2=sz2; //take the width, not the error
+         }
        }
       }
       if(fStdout==kTRUE)
        HLTInfo("WriteCluster: padrow %d pad %d +- %d time +- %d charge %d",fCurrentRow, fpad, fpad2, ftime, ftime2, list[j].fTotalCharge);
       
-      if(!fRawSP){
+      if (fFillRawClusters && fRawClusters.size()>(unsigned)counter) {
+       fRawClusters[counter].SetPadRow(fCurrentRow);
+       fRawClusters[counter].SetPad(fpad);  
+       fRawClusters[counter].SetTime(ftime);
+      }
+      {
        AliHLTTPCTransform::Slice2Sector(fCurrentSlice,fCurrentRow,thissector,thisrow);
 
        if(fOfflineTransform == NULL){
@@ -1210,11 +1232,6 @@ void AliHLTTPCClusterFinder::WriteClusters(Int_t nclusters,AliClusterData *list)
        }
 
       } 
-      else {
-       fSpacePointData[counter].fX = fCurrentRow;
-       fSpacePointData[counter].fY = fpad;
-       fSpacePointData[counter].fZ = ftime;
-      }
       
       fSpacePointData[counter].fCharge = list[j].fTotalCharge;
       fSpacePointData[counter].fPadRow = fCurrentRow;
@@ -1230,6 +1247,13 @@ void AliHLTTPCClusterFinder::WriteClusters(Int_t nclusters,AliClusterData *list)
       if(patch==-1) patch=0; //never store negative patch number
       fSpacePointData[counter].SetID( fCurrentSlice, patch, counter );
 
+      if (fFillRawClusters && fRawClusters.size()>(unsigned)counter) {
+       fRawClusters[counter].SetSigmaY2(fSpacePointData[counter].fSigmaY2);
+       fRawClusters[counter].SetSigmaZ2(fSpacePointData[counter].fSigmaZ2);
+       fRawClusters[counter].SetCharge(fSpacePointData[counter].fCharge);
+       fRawClusters[counter].SetQMax(fSpacePointData[counter].fQMax);
+      }
+
 #ifdef do_mc
       Int_t trackID[3];
       GetTrackID((Int_t)rint(fpad),(Int_t)rint(ftime),trackID);
@@ -1286,6 +1310,10 @@ void AliHLTTPCClusterFinder::WriteClusters(Int_t nclusters,AliHLTTPCClusters *li
   //write cluster to output pointer
   Int_t thisrow,thissector;
   UInt_t counter = fNClusters;
+
+  if (fFillRawClusters) {
+    fRawClusters.resize(nclusters);
+  }
   
   for(int j=0; j<nclusters; j++)
     {
@@ -1309,14 +1337,14 @@ void AliHLTTPCClusterFinder::WriteClusters(Int_t nclusters,AliHLTTPCClusters *li
              <<"SigmaY2 negative "<<sy2<<" on row "<<fCurrentRow<<" "<<fpad<<" "<<ftime<<ENDLOG;
            continue;
        } else {
-         if(!fRawSP){
+         {
            fpad2 = (sy2 + 1./12)*AliHLTTPCTransform::GetPadPitchWidth(patch)*AliHLTTPCTransform::GetPadPitchWidth(patch);
            if(sy2 != 0){
              fpad2*=0.108; //constants are from offline studies
              if(patch<2)
                fpad2*=2.07;
            }
-         } else fpad2=sy2; //take the width not the error
+         }
        }
        Float_t sz2=list[j].fTime2*list[j].fTotalCharge - list[j].fTime*list[j].fTime;
        sz2/=q2;
@@ -1325,20 +1353,25 @@ void AliHLTTPCClusterFinder::WriteClusters(Int_t nclusters,AliHLTTPCClusters *li
            <<"SigmaZ2 negative "<<sz2<<" on row "<<fCurrentRow<<" "<<fpad<<" "<<ftime<<ENDLOG;
          continue;
        } else {
-         if(!fRawSP){
+         {
            ftime2 = (sz2 + 1./12)*AliHLTTPCTransform::GetZWidth()*AliHLTTPCTransform::GetZWidth();
            if(sz2 != 0) {
              ftime2 *= 0.169; //constants are from offline studies
              if(patch<2)
                ftime2 *= 1.77;
            }
-         } else ftime2=sz2; //take the width, not the error
+         }
        }
       }
       if(fStdout==kTRUE)
        HLTInfo("WriteCluster: padrow %d pad %d +- %d time +- %d charge %d",fCurrentRow, fpad, fpad2, ftime, ftime2, list[j].fTotalCharge);
 
-      if(!fRawSP){
+      if (fFillRawClusters && fRawClusters.size()>(unsigned)counter) {
+       fRawClusters[counter].SetPadRow(fCurrentRow);
+       fRawClusters[counter].SetPad(fpad);  
+       fRawClusters[counter].SetTime(ftime);
+      }
+      {
        AliHLTTPCTransform::Slice2Sector(fCurrentSlice,fCurrentRow,thissector,thisrow);
        AliHLTTPCTransform::Raw2Local(xyz,thissector,thisrow,fpad,ftime);
        
@@ -1361,10 +1394,6 @@ void AliHLTTPCClusterFinder::WriteClusters(Int_t nclusters,AliHLTTPCClusters *li
        }
        fSpacePointData[counter].fZ = xyz[2];
        
-      } else {
-       fSpacePointData[counter].fX = fCurrentRow;
-       fSpacePointData[counter].fY = fpad;
-       fSpacePointData[counter].fZ = ftime;
       }
       
       fSpacePointData[counter].fCharge = list[j].fTotalCharge;
@@ -1381,6 +1410,13 @@ void AliHLTTPCClusterFinder::WriteClusters(Int_t nclusters,AliHLTTPCClusters *li
       if(patch==-1) patch=0; //never store negative patch number
       fSpacePointData[counter].SetID( fCurrentSlice, patch, counter );
 
+      if (fFillRawClusters && fRawClusters.size()>(unsigned)counter) {
+       fRawClusters[counter].SetSigmaY2(fSpacePointData[counter].fSigmaY2);
+       fRawClusters[counter].SetSigmaZ2(fSpacePointData[counter].fSigmaZ2);
+       fRawClusters[counter].SetCharge(fSpacePointData[counter].fCharge);
+       fRawClusters[counter].SetQMax(fSpacePointData[counter].fQMax);
+      }
+
 #ifdef do_mc
       Int_t trackID[3];
       GetTrackID((Int_t)rint(fpad),(Int_t)rint(ftime),trackID);
index 84cfd7c..d16f525 100644 (file)
@@ -1,5 +1,5 @@
-// @(#) $Id$
-// Original: AliHLTClustFinderNew.h,v 1.13 2004/06/18 10:55:26 loizides 
+//-*- Mode: C++ -*-
+// $Id$
 
 #ifndef ALIHLTTPCCLUSTERFINDER_H
 #define ALIHLTTPCCLUSTERFINDER_H
@@ -20,6 +20,7 @@
 #include "AliHLTTPCDigitReader.h"
 #include "AliTPCRecoParam.h"
 #include "AliHLTTPCClusterMCData.h"
+#include "AliHLTTPCRawCluster.h"
 
 class AliHLTTPCPad;
 class AliHLTTPCSpacePointData;
@@ -161,6 +162,8 @@ class AliHLTTPCClusterFinder : public AliHLTLogging {
  /**  Fills the mc info */
   Int_t FillOutputMCInfo(AliHLTTPCClusterMCLabel * outputMCInfo, Int_t maxNumberOfClusterMCInfo);
 
+  Int_t FillOutputRaw(AliHLTTPCRawCluster* rawClusters, unsigned sizeInByte) const;
+
   /** Set the pointer to the outputbuffer */
   void SetOutputArray(AliHLTTPCSpacePointData *pt);
 
@@ -195,7 +198,7 @@ class AliHLTTPCClusterFinder : public AliHLTLogging {
   void SetMatchWidth(UInt_t i) {fMatch=i;}
   void SetSTDOutput(Bool_t f=kFALSE) {fStdout=f;}  
   void SetCalcErr(Bool_t f=kTRUE) {fCalcerr=f;}
-  void SetRawSP(Bool_t f=kFALSE) {fRawSP=f;}
+  void SetFillRawClusters(Bool_t f=kFALSE) {fFillRawClusters=f;}
   void SetReader(AliHLTTPCDigitReader* f){fDigitReader = f;}
 
   void Set32BitFormat(Bool_t flag){f32BitFormat = flag;}
@@ -229,7 +232,7 @@ class AliHLTTPCClusterFinder : public AliHLTLogging {
   Bool_t fDeconvPad;       //! deconv in pad direction
   Bool_t fStdout;          //! have print out in write clusters
   Bool_t fCalcerr;         //! calculate centroid sigmas
-  Bool_t fRawSP;           //! store centroids in raw system
+  Bool_t fFillRawClusters; //! store centroids in raw system in separate array
 
 
   Int_t fFirstRow;       //! first row
@@ -254,6 +257,8 @@ class AliHLTTPCClusterFinder : public AliHLTLogging {
   vector<AliHLTTPCClusterMCLabel> fClustersMCInfo;                           //! transient
 
   vector<AliHLTTPCDigitData> fMCDigits;                            //! transient
+
+  vector<AliHLTTPCRawCluster> fRawClusters;                        //! transient
   
   UInt_t* fNumberOfPadsInRow;                                      //! transient
   
index 8f3ef5f..d7d8e12 100644 (file)
@@ -81,6 +81,7 @@ AliHLTTPCClusterFinderComponent::AliHLTTPCClusterFinderComponent(int mode)
   fLastTimeBin(-1),
   fDoMC(kFALSE),
   fReleaseMemory( kFALSE ),
+  fPublishRawClusters(kFALSE),
   fBenchmark("TPCClusterFinder")
 {
   // see header file for class documentation
@@ -444,6 +445,7 @@ int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponentEventData& ev
 
       maxPoints = (size-tSize-sizeof(AliHLTTPCClusterData))/sizeof(AliHLTTPCSpacePointData);
 
+      fClusterFinder->SetFillRawClusters(fPublishRawClusters);
       fClusterFinder->InitSlice( slice, patch, maxPoints );
       fClusterFinder->SetOutputArray( (AliHLTTPCSpacePointData*)outPtr->fSpacePoints );
        
@@ -570,6 +572,21 @@ int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponentEventData& ev
          tSize+=bdMCInfo.fSize;
        }
       }
+
+      if (fPublishRawClusters) {
+       AliHLTTPCRawClusterData* outputRaw= (AliHLTTPCRawClusterData*)(outputPtr+tSize);
+       outputRaw->fCount = fClusterFinder->FillOutputRaw(outputRaw->fClusters, size-tSize);
+
+       AliHLTComponentBlockData bdRawClusters;
+       FillBlockData( bdRawClusters );
+       bdRawClusters.fOffset = tSize;
+       bdRawClusters.fSize = sizeof(AliHLTTPCRawClusterData)+outputRaw->fCount*sizeof(AliHLTTPCRawCluster);
+       bdRawClusters.fSpecification = iter->fSpecification;
+       bdRawClusters.fDataType = AliHLTTPCDefinitions::fgkRawClustersDataType;
+       outputBlocks.push_back( bdRawClusters );
+       fBenchmark.AddOutput(bdRawClusters.fSize);
+       tSize+=bdRawClusters.fSize;
+      }
     }
 
   if (iResult>=0)
@@ -680,6 +697,11 @@ int AliHLTTPCClusterFinderComponent::ScanConfigurationArgument(int argc, const c
     HLTDebug("Setting fReleaseMemory to true.");
     return 1;
   }
+  if (argument.CompareTo("-publish-raw")==0) {
+    fPublishRawClusters=kTRUE;
+    fClusterFinder->SetFillRawClusters(fPublishRawClusters);
+    return 1;
+  }
 
   if (argument.CompareTo("-active-pads")==0 || argument.CompareTo("activepads")==0){
     if(argument.CompareTo("activepads" )==0){
index ece6e85..49ae612 100644 (file)
@@ -1,3 +1,4 @@
+//-*- Mode: C++ -*-
 // $Id$
 
 #ifndef ALIHLTTPCCLUSTERFINDERCOMPONENT_H
@@ -227,6 +228,7 @@ class AliHLTTPCClusterFinderComponent : public AliHLTProcessor
 
        Bool_t fDoMC; // flag to provide MC labels
        Bool_t fReleaseMemory; // flag to release the memory after each event
+       Bool_t fPublishRawClusters; // publish raw clusters in addition
        AliHLTComponentBenchmark fBenchmark; // benchmark
 
        ClassDef(AliHLTTPCClusterFinderComponent, 0)
index d8cd5c2..c0bf2a5 100644 (file)
@@ -35,6 +35,7 @@ const AliHLTComponentDataType AliHLTTPCDefinitions::fgkDDLEncodedEntropyRawDataT
 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkPackedRawDataType = AliHLTComponentDataTypeInitializer("RAWPAKED", kAliHLTDataOriginTPC);
 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkUnpackedRawDataType = AliHLTComponentDataTypeInitializer("RAWUNPAK", kAliHLTDataOriginTPC);
 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkClustersDataType = AliHLTComponentDataTypeInitializer("CLUSTERS", kAliHLTDataOriginTPC);
+const AliHLTComponentDataType AliHLTTPCDefinitions::fgkRawClustersDataType = AliHLTComponentDataTypeInitializer("CLUSTRAW", kAliHLTDataOriginTPC);
 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkHWClustersDataType = AliHLTComponentDataTypeInitializer("HWCLUST1", kAliHLTDataOriginTPC);
 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkAlterClustersDataType = AliHLTComponentDataTypeInitializer("HWCL_ALT", kAliHLTDataOriginTPC);
 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkVertexDataType = AliHLTComponentDataTypeInitializer("VERTEX  ", kAliHLTDataOriginTPC);
index ef6fcca..272aed7 100644 (file)
@@ -95,6 +95,8 @@ public:
   static const AliHLTComponentDataType fgkUnpackedRawDataType;          // see above
   /** cluster data */
   static const AliHLTComponentDataType fgkClustersDataType;             // see above
+  /** raw cluster data (not transformed) */
+  static const AliHLTComponentDataType fgkRawClustersDataType;          // see above
   /** HW cluster data */
   static const AliHLTComponentDataType fgkHWClustersDataType;           // see above
   /** HW alternative output cluster data */
diff --git a/HLT/TPCLib/AliHLTTPCRawCluster.h b/HLT/TPCLib/AliHLTTPCRawCluster.h
new file mode 100644 (file)
index 0000000..1f5a1f1
--- /dev/null
@@ -0,0 +1,84 @@
+// $Id$
+#ifndef ALIHLTTPCRAWCLUSTER_H
+#define ALIHLTTPCRAWCLUSTER_H
+
+#include "AliHLTTPCRootTypes.h"
+
+/**
+ * @struct AliHLTTPCRawCluster
+ * Primitive data of a TPC cluster in raw coordinates. The plan is to store the
+ * data in a compressed format by limiting the resolution of the float values.
+ * @ingroup alihlt_tpc_datastructs
+ */
+struct AliHLTTPCRawCluster {
+  /* UInt_t fP0;       // First  4 bytes of the packed data */
+  /* UInt_t fP1;       // Second 4 bytes of the packed data */
+  /* UInt_t fP2;       // Third  4 bytes of the packed data */
+  /* UInt_t fP3;       // Last   4 bytes of the packed data */
+  short fPadRow;
+  float fPad;
+  float fTime;
+  float fSigmaY2;
+  float fSigmaZ2;
+  short fCharge;
+  short fQMax;
+
+  Int_t   GetPadRow()  const {return fPadRow;}
+  Float_t GetPad()     const {return fPad;}
+  Float_t GetTime()    const {return fTime;}
+  Float_t GetSigmaY2() const {return fSigmaY2;}
+  Float_t GetSigmaZ2() const {return fSigmaZ2;}
+  Int_t   GetCharge()  const {return fCharge;}
+  Int_t   GetQMax()    const {return fQMax;}
+
+  void SetPadRow(Short_t padrow)  {fPadRow=padrow;}
+  void SetPad(Float_t pad)     {fPad=pad;}
+  void SetTime(Float_t time)    {fTime=time;}
+  void SetSigmaY2(Float_t sigmaY2) {fSigmaY2=sigmaY2;}
+  void SetSigmaZ2(Float_t sigmaZ2) {fSigmaZ2=sigmaZ2;}
+  void SetCharge(Short_t charge)  {fCharge=charge;}
+  void SetQMax(Short_t qmax)    {fQMax=qmax;}
+
+  /* Int_t GetPadRow()    const {return        (fP0>>24) &     0xff;} */
+  /* Float_t GetPad()     const {return (float( fP0      & 0xffffff)-8388608.)*1.e-4;} */
+  /* Float_t GetTime()    const {return (float( fP1      & 0xffffff)-8388608.)*1.e-4;} */
+  /* Float_t GetSigmaY2() const {return (float( fP2      &   0xffff)-32768.)*1.e-4;} */
+  /* Float_t GetSigmaZ2() const {return (float((fP2>>16) &   0xffff)-32768.)*1.e-4;} */
+  /* Int_t   GetCharge()  const {return         fP3      &  0xfffff;} */
+  /* Int_t   GetQMax()    const {return        (fP3>>20) &    0x3ff;} */
+
+  /* void SetPadRow(Int_t padrow)       { fP0&=0x00ffffff; fP0|=(padrow & 0xff)<<24;} */
+  /* void SetPad(Float_t pad)         { fP0&=0xff000000; float v=pad*1.e4+8388608.; */
+  /*                                       if( v<0 ) v=0; else if( v>0x00FFFFFF ) v=0x00FFFFFF; */
+  /*                                   UInt_t iv=(UInt_t) v; fP0|=iv; */
+  /* } */
+  /* void SetTime(Float_t time)       { fP1&=0xff000000; float v=time*1.e4+8388608.; */
+  /*                                       if( v<0 ) v=0; else if( v>0x00FFFFFF ) v=0x00FFFFFF; */
+  /*                                   UInt_t iv=(UInt_t) v; fP1|=iv; */
+  /* } */
+  /* void SetSigmaY2(Float_t sigmaY2) { fP2&=0xffff0000; float v=sigmaY2*1.e4+32768.; */
+  /*                                       if( v<0 ) v=0; else if( v>0x0000FFFF ) v=0x0000FFFF; */
+  /*                                   UInt_t iv=(UInt_t) v; fP2|=iv; */
+  /* } */
+  /* void SetSigmaZ2(Float_t sigmaZ2) { fP2&=0x0000ffff; float v=sigmaZ2*1.e4+32768.; */
+  /*                                       if( v<0 ) v=0; else if( v>0x0000FFFF ) v=0x0000FFFF; */
+  /*                                   UInt_t iv=(UInt_t) v; fP2|=iv<<16; */
+  /* } */
+  /* void SetCharge(Int_t charge)     { fP3&=0xfff00000; fP3|=charge&0xfffff;} */
+  /* void SetQMax(Int_t qmax)         { fP3&=0x000fffff; fP3|=(qmax&0x3ff)<<20;} */
+};
+typedef struct AliHLTTPCRawCluster AliHLTTPCRawCluster;
+
+struct AliHLTTPCRawClusterData
+{
+  UInt_t fVersion; // version number
+  UInt_t fCount;   // number of clusters
+#if defined(__HP_aCC) || defined(__DECCXX) || defined(__SUNPRO_CC)
+  AliHLTTPCRawCluster  fClusters[1]; // array of clusters  
+#else
+  AliHLTTPCRawCluster  fClusters[0]; // array of clusters 
+#endif
+};
+typedef struct AliHLTTPCRawClusterData AliHLTTPCRawClusterData;
+
+#endif