]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
extended HWCF emulation to include Qmax in the output
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Aug 2011 06:18:41 +0000 (06:18 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Aug 2011 06:18:41 +0000 (06:18 +0000)
15 files changed:
HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFDataTypes.h
HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFDivisionUnit.cxx
HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFDivisionUnit.h
HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.cxx
HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.h
HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.cxx
HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.h
HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFExtractorUnit.cxx
HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFExtractorUnit.h
HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFMergerUnit.cxx
HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFMergerUnit.h
HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFProcessorUnit.cxx
HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFProcessorUnit.h
HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFSupport.cxx
HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFSupport.h

index 58db171ad3472e1e20a13b31d904ae06da91029f..4f67c5cb83a2808d1f5a4beebaed93c050629c87 100644 (file)
@@ -1,3 +1,4 @@
+// $Id$
 #ifndef ALIHLTTPCHWCFDATATYPES_H
 #define ALIHLTTPCHWCFDATATYPES_H
 //* This file is property of and copyright by the ALICE HLT Project        * 
@@ -49,7 +50,7 @@ struct AliHLTTPCHWCFClusterFragment
 {
   //* constructor **/
   AliHLTTPCHWCFClusterFragment():  fFlag(0), fRow(0), fPad(0), fBranch(0), fBorder(0),
-       fQ(0), fT(0), fP(0), fT2(0), fP2(0), fTMean(0),fLastQ(0), fSlope(0), fMC()
+       fQmax(0), fQ(0), fT(0), fP(0), fT2(0), fP2(0), fTMean(0),fLastQ(0), fSlope(0), fMC()
   {}
 
   AliHLTUInt32_t fFlag; // 0 - Off, 1 - data, 2 - RCU trailer, 3 - end of data
@@ -57,6 +58,7 @@ struct AliHLTTPCHWCFClusterFragment
   AliHLTUInt32_t fPad;  // pad number
   bool fBranch;         // 0  - pad belongs to branch A, 1 - pad belongs to branch B
   bool fBorder;         // is the pad at the border of its branch
+  AliHLTUInt64_t fQmax; // total charge, fixed point integer
   AliHLTUInt64_t fQ;    // total charge, fixed point integer
   AliHLTUInt64_t fT;    // sum of time*charge , fixed point integer
   AliHLTUInt64_t fP;    // sum of pad*charge  , fixed point integer
@@ -74,14 +76,15 @@ typedef struct AliHLTTPCHWCFClusterFragment AliHLTTPCHWCFClusterFragment;
 struct AliHLTTPCHWCFCluster
 {
   //* constructor **/
-  AliHLTTPCHWCFCluster(): fFlag(0), fRowQ(0), fT(0), fP(0), fT2(0), fP2(0), fMC()
+  AliHLTTPCHWCFCluster(): fFlag(0), fRowQ(0), fQ(0), fT(0), fP(0), fT2(0), fP2(0), fMC()
   {}
 
   AliHLTUInt32_t fFlag; // 0 - Off, 1 - data, 2 - RCU trailer, 3 - end of data
   AliHLTUInt32_t fRowQ; // bits 30-31 = 0x3
                         // bits 24-29 = row number
-                        // bits 0 -23 = total charge as fixed point integer,
+                        // bits 0 -23 = max adc value as fixed point integer,
                         //              with 6 bits after the point
+  AliHLTUInt32_t fQ;    // total charge as fixed point integer, 12 bits after the point
   AliHLTUInt32_t fT;    // mean time, 32-bit float stored as 32-bit integer
   AliHLTUInt32_t fP;    // mean pad,  32-bit float stored as 32-bit integer
   AliHLTUInt32_t fT2;   // mean time^2, 32-bit float stored as 32-bit integer
index 1b232eee5329d847b6420aa6d20ff98e0380c7b2..8271350db8f49beb31771e83368ecc25321c5f4d 100644 (file)
@@ -1,3 +1,4 @@
+// $Id$
 //****************************************************************************
 //* This file is property of and copyright by the ALICE HLT Project          * 
 //* ALICE Experiment at CERN, All rights reserved.                           *
@@ -110,7 +111,8 @@ const AliHLTTPCHWCFCluster *AliHLTTPCHWCFDivisionUnit::OutputStream()
   AliHLTFloat32_t q = fkInput->fQ;
   
   fOutput.fFlag = 1;
-  fOutput.fRowQ = (((AliHLTUInt32_t) 0x3)<<30) + ((fkInput->fRow &0x3f)<<24) + ((fkInput->fQ>>(AliHLTTPCHWCFDefinitions::kFixedPoint-6))&0xFFFFFF);              
+  fOutput.fRowQ = (((AliHLTUInt32_t) 0x3)<<30) + ((fkInput->fRow &0x3f)<<24) + ((fkInput->fQmax>>(AliHLTTPCHWCFDefinitions::kFixedPoint-6))&0xFFFFFF);           
+  fOutput.fQ = fkInput->fQ;
   *((AliHLTFloat32_t*)&fOutput.fP) = (float)fkInput->fP/q;
   *((AliHLTFloat32_t*)&fOutput.fT) = (float)fkInput->fT/q;
   *((AliHLTFloat32_t*)&fOutput.fP2) = (float)fkInput->fP2/q;
index 757e4479f6301a80dee7b6e3fc7b162cf08528c9..d9afeba5e85c9bc4a77499a7a2f44ad1974920f0 100644 (file)
@@ -1,3 +1,5 @@
+//-*- Mode: C++ -*-
+// $Id$
 //* This file is property of and copyright by the ALICE HLT Project        * 
 //* ALICE Experiment at CERN, All rights reserved.                         *
 //* See cxx source for full Copyright notice                               *
index 3b7906940fc32807d5ff8b50b0a855d14251d9fb..d1ed1ffd641d6e2eec1b42e2528925553e066a42 100644 (file)
@@ -1,3 +1,4 @@
+// $Id$
 //****************************************************************************
 //* This file is property of and copyright by the ALICE HLT Project          * 
 //* ALICE Experiment at CERN, All rights reserved.                           *
@@ -26,6 +27,7 @@
 #include "AliHLTTPCHWCFDataTypes.h"
 #include "AliHLTTPCHWCFEmulator.h"
 #include "AliHLTTPCClusterMCData.h"
+#include "AliHLTTPCHWCFData.h"
 
 #include <iostream>
 
@@ -133,17 +135,19 @@ int AliHLTTPCHWCFEmulator::FindClusters( const AliHLTUInt32_t *rawEvent,
          fDivisionUnit.InputStream(candidate);
          while( (cluster = fDivisionUnit.OutputStream()) ){        
            if( cluster->fFlag==1 ){
-             if( outputSize32+5 > maxOutputSize32 ){ // No space in the output buffer
+             if( outputSize32+AliHLTTPCHWCFData::fgkAliHLTTPCHWClusterSize > maxOutputSize32 ){ // No space in the output buffer
                ret = -2;
                break;
              }       
              AliHLTUInt32_t *co = &output[outputSize32];
-             co[0] = WriteBigEndian(cluster->fRowQ);
-             co[1] = cluster->fP;
-             co[2] = cluster->fT;
-             co[3] = cluster->fP2;
-             co[4] = cluster->fT2;
-             outputSize32+=5;
+             int i=0;
+             co[i++] = WriteBigEndian(cluster->fRowQ);
+             co[i++] = WriteBigEndian(cluster->fQ);
+             co[i++] = cluster->fP;
+             co[i++] = cluster->fT;
+             co[i++] = cluster->fP2;
+             co[i++] = cluster->fT2;
+             outputSize32+=AliHLTTPCHWCFData::fgkAliHLTTPCHWClusterSize;
              if( mcLabels && outputMC && outputMC->fCount < maxNMCLabels){
                outputMC->fLabels[outputMC->fCount++] = cluster->fMC;
              }
index 2004d348647fdff46fc89ef07e807de48f23f587..19be2829389c2f82ee076bd1154c8c6969576ba3 100644 (file)
@@ -1,3 +1,5 @@
+//-*- Mode: C++ -*-
+// $Id$
 #ifndef ALIHLTTPCHWCFEMULATOR_H
 #define ALIHLTTPCHWCFEMULATOR_H
 
index 4cf99e5f523820b9a68fd013bbd5d900a8231d83..c8e949a1ab291e86f5061882af0d4afd3663cc71 100644 (file)
@@ -1,3 +1,4 @@
+// $Id$
 //****************************************************************************
 //* This file is property of and copyright by the ALICE HLT Project          * 
 //* ALICE Experiment at CERN, All rights reserved.                           *
@@ -32,6 +33,7 @@ using namespace std;
 #include "AliHLTTPCDefinitions.h"
 #include "AliHLTTPCHWCFDataTypes.h"
 #include "AliHLTTPCClusterMCData.h"
+#include "AliHLTTPCHWCFData.h"
 
 #include "AliGRPObject.h"
 #include "AliCDBEntry.h"
@@ -444,7 +446,7 @@ int AliHLTTPCHWCFEmulatorComponent::DoEvent( const AliHLTComponentEventData& evt
       // book memory for the output
       
       AliHLTUInt32_t maxNClusters = rawEventSize32 + 1; // N 32-bit words in input
-      AliHLTUInt32_t clustersSize32 = maxNClusters*5;
+      AliHLTUInt32_t clustersSize32 = maxNClusters*AliHLTTPCHWCFData::fgkAliHLTTPCHWClusterSize;
       AliHLTUInt32_t nOutputMC = maxNClusters;
 
       AliHLTUInt32_t headerSize = sizeof(AliRawDataHeader);                   
@@ -487,8 +489,9 @@ int AliHLTTPCHWCFEmulatorComponent::DoEvent( const AliHLTComponentEventData& evt
       }
 
       if( fDebug ){
+       int elsize=AliHLTTPCHWCFData::fgkAliHLTTPCHWClusterSize;
        printf("\nHWCF Emulator: output clusters for slice%d patch %d:\n",slice,patch);
-       for( AliHLTUInt32_t i=0; i<clustersSize32; i+=5 ){
+       for( AliHLTUInt32_t i=0; i<clustersSize32; i+=elsize ){
          AliHLTUInt32_t *c = outClusters+i;
          AliHLTUInt32_t flag = (c[0]>>30);       
          if( flag == 0x3){ //beginning of a cluster
@@ -499,13 +502,13 @@ int AliHLTTPCHWCFEmulatorComponent::DoEvent( const AliHLTComponentEventData& evt
            AliHLTFloat32_t p2 = *((AliHLTFloat32_t*)&c[3]);
            AliHLTFloat32_t t2 = *((AliHLTFloat32_t*)&c[4]);
            printf("N: %3d    R: %3d    C: %4d    P:  %7.4f    T:  %8.4f    DP: %6.4f    DT: %6.4f\n", 
-                  i/5+1, padRow, q, p, t, sqrt(fabs(p2-p*p)), sqrt(fabs(t2-t*t)));
+                  i/elsize+1, padRow, q, p, t, sqrt(fabs(p2-p*p)), sqrt(fabs(t2-t*t)));
 
            if( outMC && outMC->fCount>0 ){
              printf("        MC: (%3d,%6.1f) (%3d,%6.1f) (%3d,%6.1f)\n",
-                    outMC->fLabels[i/5].fClusterID[0].fMCID,outMC->fLabels[i/5].fClusterID[0].fWeight,
-                    outMC->fLabels[i/5].fClusterID[1].fMCID,outMC->fLabels[i/5].fClusterID[1].fWeight,
-                    outMC->fLabels[i/5].fClusterID[2].fMCID,outMC->fLabels[i/5].fClusterID[2].fWeight
+                    outMC->fLabels[i/elsize].fClusterID[0].fMCID,outMC->fLabels[i/elsize].fClusterID[0].fWeight,
+                    outMC->fLabels[i/elsize].fClusterID[1].fMCID,outMC->fLabels[i/elsize].fClusterID[1].fWeight,
+                    outMC->fLabels[i/elsize].fClusterID[2].fMCID,outMC->fLabels[i/elsize].fClusterID[2].fWeight
                     );
            }
          }
index ed7f7836b65e8293c92e4e4130466f076b810508..7b7ebd6af8927da43e30a9bbd49dd0ba9fc7c8c3 100644 (file)
@@ -1,3 +1,5 @@
+//-*- Mode: C++ -*-
+// $Id$
 #ifndef ALIHLTTPCHWCFEMULATORCOMPONENT_H
 #define ALIHLTTPCHWCFEMULATORCOMPONENT_H
 
index 1f49d716441fac003f5b45743a775989daa80022..08c40f268b158e3309578683b1082cba6e837503 100644 (file)
@@ -1,3 +1,4 @@
+// $Id$
 //****************************************************************************
 //* This file is property of and copyright by the ALICE HLT Project          * 
 //* ALICE Experiment at CERN, All rights reserved.                           *
index 6414c414f41aab3c840b55615b6c6a54f7756511..49f28e699bf9f7b01be5f84fd705a6d79604b4f1 100644 (file)
@@ -1,3 +1,5 @@
+//-*- Mode: C++ -*-
+// $Id$
 #ifndef ALIHLTTPCHWCFEXTRACTORUNIT_H
 #define ALIHLTTPCHWCFEXTRACTORUNIT_H
 //* This file is property of and copyright by the ALICE HLT Project        * 
index 3c1f7d0192aa9a065bac648e6714d54684a79b5a..de91b19f5735457601c5c0e829fd76f244259b95 100644 (file)
@@ -1,3 +1,4 @@
+// $Id$
 //****************************************************************************
 //* This file is property of and copyright by the ALICE HLT Project          * 
 //* ALICE Experiment at CERN, All rights reserved.                           *
@@ -209,6 +210,7 @@ const AliHLTTPCHWCFClusterFragment *AliHLTTPCHWCFMergerUnit::OutputStream()
     }
     // cout<<"merge search range at "<<fSearchStart-1<<" of "<<fSearchEnd<<endl;
     if( !fInput.fSlope && s.fLastQ > fInput.fQ ) fInput.fSlope = 1;
+    if (fInput.fQmax < s.fQmax) fInput.fQmax = s.fQmax;
     fInput.fQ += s.fQ;
     fInput.fT += s.fT;
     fInput.fT2 += s.fT2;
index a2000a0300111a708d276bb63e7de3fa00aa4e6e..0c23509a6bc658cf5817fa0c5876c80d60e65185 100644 (file)
@@ -1,3 +1,5 @@
+//-*- Mode: C++ -*-
+// $Id$
 #ifndef ALIHLTTPCHWCFMERGERUNIT_H
 #define ALIHLTTPCHWCFMERGERUNIT_H
 
index 577525174e71c57e86810dc47f650f69310b4e06..686a20527798dcd0e089a49ec10aa4939cf546e3 100644 (file)
@@ -1,3 +1,4 @@
+// $Id$
 //****************************************************************************
 //* This file is property of and copyright by the ALICE HLT Project          * 
 //* ALICE Experiment at CERN, All rights reserved.                           *
@@ -108,6 +109,7 @@ const AliHLTTPCHWCFClusterFragment *AliHLTTPCHWCFProcessorUnit::OutputStream()
   fOutput.fPad = fkBunch->fPad;
   fOutput.fBranch = fkBunch->fBranch;
   fOutput.fBorder = fkBunch->fBorder;  
+  fOutput.fQmax = 0;
   fOutput.fQ = 0;
   fOutput.fT = 0;
   fOutput.fT2 = 0;
@@ -142,6 +144,7 @@ const AliHLTTPCHWCFClusterFragment *AliHLTTPCHWCFProcessorUnit::OutputStream()
     if( fDeconvolute && slope && q>qLast ){
       //cout<<"deconvolution time!!!"<<endl;
       if( length==1 && fOutput.fQ<fSingleSeqLimit ){
+       fOutput.fQmax = 0;
        fOutput.fQ = 0;
        fOutput.fT = 0;
        fOutput.fT2 = 0;
@@ -158,6 +161,7 @@ const AliHLTTPCHWCFClusterFragment *AliHLTTPCHWCFProcessorUnit::OutputStream()
     }
     if( q<qLast ) slope = 1;
     qLast = q;
+    if (fOutput.fQmax < q) fOutput.fQmax = q;
     fOutput.fQ += q;
     fOutput.fT += q*bunchTime;
     fOutput.fT2+= q*bunchTime*bunchTime;
index d8e6838582133ba0607924db2388197cd77d1c22..9a238aead66915ec049642c83a657a1d600937d0 100644 (file)
@@ -1,3 +1,5 @@
+//-*- Mode: C++ -*-
+// $Id$
 #ifndef ALIHLTTPCHWCFPROCESSORUNIT_H
 #define ALIHLTTPCHWCFPROCESSORUNIT_H
 
index ed1c579ca7df46e04f6d88c5f5df6ad05d77c8b0..fff57bbd281ea6fb4d1c1e0166bc8f3228db5673 100644 (file)
@@ -1,3 +1,4 @@
+// $Id$
 //****************************************************************************
 //* This file is property of and copyright by the ALICE HLT Project          * 
 //* ALICE Experiment at CERN, All rights reserved.                           *
index 95eaf6d408db9963b916d1a76712587b83b99156..c5a125197d64397396154e4d3b2910cc9cac77fc 100644 (file)
@@ -1,3 +1,5 @@
+//-*- Mode: C++ -*-
+// $Id$
 //* This file is property of and copyright by the ALICE HLT Project        * 
 //* ALICE Experiment at CERN, All rights reserved.                         *
 //* See cxx source for full Copyright notice                               *