+// $Id$
#ifndef ALIHLTTPCHWCFDATATYPES_H
#define ALIHLTTPCHWCFDATATYPES_H
//* This file is property of and copyright by the ALICE HLT Project *
{
//* 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
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
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
+// $Id$
//****************************************************************************
//* This file is property of and copyright by the ALICE HLT Project *
//* ALICE Experiment at CERN, All rights reserved. *
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;
+//-*- 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 *
+// $Id$
//****************************************************************************
//* This file is property of and copyright by the ALICE HLT Project *
//* ALICE Experiment at CERN, All rights reserved. *
#include "AliHLTTPCHWCFDataTypes.h"
#include "AliHLTTPCHWCFEmulator.h"
#include "AliHLTTPCClusterMCData.h"
+#include "AliHLTTPCHWCFData.h"
#include <iostream>
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;
}
+//-*- Mode: C++ -*-
+// $Id$
#ifndef ALIHLTTPCHWCFEMULATOR_H
#define ALIHLTTPCHWCFEMULATOR_H
+// $Id$
//****************************************************************************
//* This file is property of and copyright by the ALICE HLT Project *
//* ALICE Experiment at CERN, All rights reserved. *
#include "AliHLTTPCDefinitions.h"
#include "AliHLTTPCHWCFDataTypes.h"
#include "AliHLTTPCClusterMCData.h"
+#include "AliHLTTPCHWCFData.h"
#include "AliGRPObject.h"
#include "AliCDBEntry.h"
// 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);
}
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
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
);
}
}
+//-*- Mode: C++ -*-
+// $Id$
#ifndef ALIHLTTPCHWCFEMULATORCOMPONENT_H
#define ALIHLTTPCHWCFEMULATORCOMPONENT_H
+// $Id$
//****************************************************************************
//* This file is property of and copyright by the ALICE HLT Project *
//* ALICE Experiment at CERN, All rights reserved. *
+//-*- Mode: C++ -*-
+// $Id$
#ifndef ALIHLTTPCHWCFEXTRACTORUNIT_H
#define ALIHLTTPCHWCFEXTRACTORUNIT_H
//* This file is property of and copyright by the ALICE HLT Project *
+// $Id$
//****************************************************************************
//* This file is property of and copyright by the ALICE HLT Project *
//* ALICE Experiment at CERN, All rights reserved. *
}
// 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;
+//-*- Mode: C++ -*-
+// $Id$
#ifndef ALIHLTTPCHWCFMERGERUNIT_H
#define ALIHLTTPCHWCFMERGERUNIT_H
+// $Id$
//****************************************************************************
//* This file is property of and copyright by the ALICE HLT Project *
//* ALICE Experiment at CERN, All rights reserved. *
fOutput.fPad = fkBunch->fPad;
fOutput.fBranch = fkBunch->fBranch;
fOutput.fBorder = fkBunch->fBorder;
+ fOutput.fQmax = 0;
fOutput.fQ = 0;
fOutput.fT = 0;
fOutput.fT2 = 0;
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;
}
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;
+//-*- Mode: C++ -*-
+// $Id$
#ifndef ALIHLTTPCHWCFPROCESSORUNIT_H
#define ALIHLTTPCHWCFPROCESSORUNIT_H
+// $Id$
//****************************************************************************
//* This file is property of and copyright by the ALICE HLT Project *
//* ALICE Experiment at CERN, All rights reserved. *
+//-*- 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 *