if (yaxis) yaxis->SetTitle("N. of clusters");
}
- std::auto_ptr<TH2I> histoNofClustersReductionFactor(new TH2I("NofClustersvsReductionFactor",
- "Number of HLT TPC clusters vs ReductionFactor",
+ std::auto_ptr<TH2I> histoNofClustersReductionFactor(new TH2I("ReductionFactorVsNofClusters",
+ "Reduction Factor vs. Number of HLT TPC clusters",
500, 0., 1000000., 100, 0., 10.));
if (histoNofClustersReductionFactor.get()) {
TAxis* xaxis=histoNofClustersReductionFactor->GetXaxis();
, fTrackModelClusterIds()
, fCurrentClusterIds(NULL)
, fRawData(NULL)
- , fLastPadRow(-1)
+ , fCurrentCluster()
, fSector(-1)
, fBegin()
{
/// constructor
+ memset(&fCurrentCluster, 0, sizeof(AliHLTTPCRawCluster));
if (fHistograms) {
fHistograms->SetOwner(kTRUE);
fHistogramPointers.resize(kNumberOfHistograms, NULL);
const AliHLTTPCDataCompressionMonitorComponent::AliHistogramDefinition AliHLTTPCDataCompressionMonitorComponent::fgkHistogramDefinitions[] = {
{kHistogramPadrow, "padrow" , "padrow; padrow; counts" , 159, 0., 159.},
- {kHistogramPad, "pad" , "pad; pad; counts" , 140, 0., 140.},
+ {kHistogramHWCFPad, "hwcfpad" , "hwcfpad; pad; counts" , 280, 0., 140.},
+ {kHistogramPad, "pad" , "pad; pad; counts" , 280, 0., 140.},
{kHistogramTime, "timebin" , "timebin; time; counts" , 1024, 0., 1024.},
{kHistogramSigmaY2, "sigmaY2" , "sigmaY2; #sigma_{Y}^{2}; counts" , 100, 0., 1.},
{kHistogramSigmaZ2, "sigmaZ2" , "sigmaZ2; #sigma_{Z}^{2}; counts" , 100, 0., 1.},
{kHistogramCharge, "charge" , "charge; charge; counts" , 1024, 0., 65536.},
{kHistogramQMax, "qmax" , "qmax; Q_{max}; counts" , 128, 0., 1024.},
{kHistogramDeltaPadrow, "d_padrow" , "d_padrow; #Delta padrow; counts" , 1000, -1., 1.},
- {kHistogramDeltaPad, "d_pad" , "d_pad; #Delta pad; counts" , 1000, -.1, .1},
- {kHistogramDeltaTime, "d_time" , "d_time; #Delta time; counts" , 1000, -.1, .1},
+ {kHistogramDeltaPad, "d_pad" , "d_pad; #Delta pad; counts" , 1000, -1., 1.},
+ {kHistogramDeltaTime, "d_time" , "d_time; #Delta time; counts" , 1000, -1., 1.},
{kHistogramDeltaSigmaY2, "d_sigmaY2", "d_sigmaY2; #Delta #sigma_{Y}^{2}; counts", 1000, -1., 1.},
{kHistogramDeltaSigmaZ2, "d_sigmaZ2", "d_sigmaZ2; #Delta #sigma_{Z}^{2}; counts", 1000, -1., 1.},
{kHistogramDeltaCharge, "d_charge" , "d_charge; #Delta charge" , 1000, -1., 1.},
{kHistogramDeltaQMax, "d_qmax" , "d_qmax; #Delta Q_{max}" , 1000, -1., 1.},
- {kHistogramOutOfRange, "OutOfR" , "OutOfR; padrow; counts" , 159, 0., 159.},
+ {kHistogramOutOfRange, "ResError" , "Residual Error; padrow; counts" , 159, 0., 159.},
{kNumberOfHistograms, NULL, NULL, 0,0.,0.}
};
int AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::AddRawData(const AliHLTComponentBlockData* pDesc)
{
- /// add raw data bloack
+ /// add raw data bloack
+ int iResult=0;
if (pDesc->fDataType==AliHLTTPCDefinitions::HWClustersDataType()) {
if (!fRawData) fRawData=new AliHLTTPCHWCFSpacePointContainer(AliHLTTPCHWCFSpacePointContainer::kModeCreateMap);
if (!fRawData) return -ENOMEM;
- return fRawData->AddInputBlock(pDesc);
+ if ((iResult=fRawData->AddInputBlock(pDesc))<0) return iResult;
+ AliHLTSpacePointContainer::AliHLTSpacePointPropertyGrid* pSpacePointGrid=AliHLTTPCHWCFSpacePointContainer::AllocateIndexGrid();
+ if (pSpacePointGrid) {
+ fRawData->PopulateAccessGrid(pSpacePointGrid, pDesc->fSpecification);
+ fRawData->SetSpacePointPropertyGrid(pDesc->fSpecification, pSpacePointGrid);
+ }
+ return 0;
}
return -ENODATA;
}
return fCurrentClusterIds->fIds[clusterNo];
}
-void AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::FillPadRow(int row, int slice, AliHLTUInt32_t clusterId)
+AliHLTUInt32_t AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::FindNearestCluster(int slice, int partition, const AliHLTTPCRawCluster& cluster) const
+{
+ /// get the cluster id of the nearest original cluster
+ if (!fRawData) return kAliHLTVoidDataSpec;
+ AliHLTUInt32_t key=AliHLTTPCDefinitions::EncodeDataSpecification(slice, slice, partition, partition);
+ // FIXME: AliHLTIndexGrid::Index is not declared const
+ AliHLTSpacePointContainer::AliHLTSpacePointPropertyGrid* pGrid=const_cast<AliHLTSpacePointContainer::AliHLTSpacePointPropertyGrid*>(fRawData->GetSpacePointPropertyGrid(key));
+ if (!pGrid) return kAliHLTVoidDataSpec;
+ AliHLTUInt32_t clusterId=kAliHLTVoidDataSpec;
+ // search a 4x4 matrix out of the 9x9 matrix around the cell addressed by
+ // pad and time
+ float padrow=(float)cluster.GetPadRow()-AliHLTTPCTransform::GetFirstRow(partition);
+ float pad=cluster.GetPad();
+ float time=cluster.GetTime();
+ float minr2=-1.;
+ const float padpitch=AliHLTTPCTransform::GetPadPitchWidth(partition);
+ const float zwidth=AliHLTTPCTransform::GetZWidth();
+ float maxDeltaPad=AliHLTTPCDefinitions::GetMaxClusterDeltaPad();
+ float maxDeltaTime=AliHLTTPCDefinitions::GetMaxClusterDeltaTime();
+ int rowindex=pGrid->GetXIndex(padrow);
+ int padstartindex=pGrid->GetYIndex(pad);
+ int timestartindex=pGrid->GetZIndex(time);
+ int cellindex=pGrid->Index(rowindex, padstartindex, timestartindex);
+ float centerpad=pGrid->GetCenterY(cellindex);
+ float centertime=pGrid->GetCenterZ(cellindex);
+ if ((TMath::Abs(centerpad-pad)>maxDeltaPad && pad>0.) ||
+ (TMath::Abs(centertime-time)>maxDeltaTime && time>0.)) {
+ ALIHLTERRORGUARD(20, "invalid pad center calculation, please check dimensions if dimensions of index grid match the maximum possible deviation");
+ }
+
+ int paddirection=1;
+ int timedirection=1;
+ if (centerpad>pad) paddirection=-1;
+ if (centertime>time) timedirection=-1;
+ for (int padcount=0, padindex=padstartindex; padcount<2; padcount++, padindex+=paddirection) {
+ if (padindex<0) continue;
+ if (padindex>=pGrid->GetDimensionY()) break;
+ for (int timecount=0, timeindex=timestartindex; timecount<2; timecount++, timeindex+=timedirection) {
+ if (timeindex<0) continue;
+ if (timeindex>=pGrid->GetDimensionZ()) break;
+ cellindex=pGrid->Index(rowindex, padindex, timeindex);
+ float cellpad=pGrid->GetCenterY(cellindex);
+ float celltime=pGrid->GetCenterZ(cellindex);
+ for (AliHLTSpacePointContainer::AliHLTSpacePointPropertyGrid::iterator& cl=pGrid->begin((float)padrow, cellpad, celltime);
+ cl!=pGrid->end(); cl++) {
+ if (cl.Data().fTrackId>=0) continue;
+ if (fRawData->GetCharge(cl.Data().fId)!=cluster.GetCharge() ||
+ fRawData->GetQMax(cl.Data().fId)!=cluster.GetQMax()) continue;
+ if (TMath::Abs(padrow-fRawData->GetX(cl.Data().fId))>=1.) {
+ HLTError("slice %d, partition %d, cluster 0x%08x: mismatch on padrow: %f vs. cluster %f", slice, partition, cl.Data().fId, padrow, fRawData->GetX(cl.Data().fId));
+ continue;
+ }
+ float clusterpad=fRawData->GetY(cl.Data().fId);
+ float clustertime=fRawData->GetZ(cl.Data().fId);
+ clusterpad-=pad;
+ clusterpad*=padpitch;
+ clustertime-=time;
+ clustertime*=zwidth;
+ float r2=clusterpad*clusterpad+clustertime*clustertime;
+ if (minr2<0. || r2<minr2) {
+ clusterId=cl.Data().fId;
+ cl.Data().fTrackId=1;
+ minr2=r2;
+ }
+ }
+ }
+ }
+ return clusterId;
+}
+
+void AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::FillPadRow(int row, int slice, AliHLTUInt32_t /*clusterId*/)
{
/// fill padrow histogram
unsigned index=kHistogramPadrow;
- fLastPadRow=row;
+ fCurrentCluster.SetPadRow(row);
// the inner sectors consist of readout partitions 0 and 1, if the row
// is smaller than first row of readout partition 2, its an inner sector
if (row<AliHLTTPCTransform::GetFirstRow(2)) {
}
if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL)
fHistogramPointers[index]->Fill(row);
- if (clusterId!=kAliHLTVoidDataSpec) {
- index=kHistogramDeltaPadrow;
- if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData) {
- if (fRawData->Check(clusterId)) {
- fHistogramPointers[index]->Fill(row-fRawData->GetX(clusterId));
- }
- }
- }
}
-void AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::FillPad(float pad, AliHLTUInt32_t clusterId)
+void AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::FillPad(float pad, AliHLTUInt32_t /*clusterId*/)
{
/// fill pad histogram
+ fCurrentCluster.SetPad(pad);
+ int currentRow=fCurrentCluster.GetPadRow();
unsigned index=kHistogramPad;
if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL)
fHistogramPointers[index]->Fill(pad);
index=kHistogramPadrowPadSector;
if (index<fHistogram3DPointers.size() && fHistogram3DPointers[index]!=NULL)
- fHistogram3DPointers[index]->Fill(fSector,pad,fLastPadRow);
+ fHistogram3DPointers[index]->Fill(fSector,pad,currentRow);
AliTPCROC *roc=AliTPCROC::Instance();
Float_t pos[2]={0};
- roc->GetPositionGlobal(fSector, fSector>35?fLastPadRow-63:fLastPadRow, pad, pos);
+ roc->GetPositionGlobal(fSector, fSector>35?currentRow-63:currentRow, pad, pos);
index=kHistogramXY;
if (index<fHistogram2DPointers.size() && fHistogram2DPointers[index]!=NULL)
fHistogram2DPointers[index]->Fill(pos[0],pos[1]);
- if (clusterId!=kAliHLTVoidDataSpec) {
- index=kHistogramDeltaPad;
- if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData) {
- if (fRawData->Check(clusterId)) {
- float dPad=pad-fRawData->GetY(clusterId);
- fHistogramPointers[index]->Fill(dPad);
- static const float maxdPad=0.015; // better 100um for 4 and 6mm pad width
- if (TMath::Abs(dPad)>maxdPad) {
- AliHLTUInt8_t slice = AliHLTTPCSpacePointData::GetSlice(clusterId);
- AliHLTUInt8_t partition = AliHLTTPCSpacePointData::GetPatch(clusterId);
- HLTError("cluster 0x%08x slice %d partition %d: pad difference %f - max %f", clusterId, slice, partition, dPad, maxdPad);
- index=kHistogramOutOfRange;
- if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData) {
- fHistogramPointers[index]->Fill(fLastPadRow>=0?fLastPadRow:0);
- }
- }
- }
- }
- }
}
-void AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::FillTime(float time, AliHLTUInt32_t clusterId)
+void AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::FillTime(float time, AliHLTUInt32_t /*clusterId*/)
{
/// fill pad histogram
+ fCurrentCluster.SetTime(time);
unsigned index=kHistogramTime;
if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL)
fHistogramPointers[index]->Fill(time);
- if (clusterId!=kAliHLTVoidDataSpec) {
- index=kHistogramDeltaTime;
- if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData) {
- if (fRawData->Check(clusterId)) {
- float dTime=time-fRawData->GetZ(clusterId);
- fHistogramPointers[index]->Fill(dTime);
- static const float maxdTime=0.04; // corresponds to 100um
- if (TMath::Abs(dTime)>maxdTime) {
- AliHLTUInt8_t slice = AliHLTTPCSpacePointData::GetSlice(clusterId);
- AliHLTUInt8_t partition = AliHLTTPCSpacePointData::GetPatch(clusterId);
- HLTError("cluster 0x%08x slice %d partition %d: time difference %f - max %f", clusterId, slice, partition, dTime, maxdTime);
- index=kHistogramOutOfRange;
- if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData) {
- fHistogramPointers[index]->Fill(fLastPadRow>=0?fLastPadRow:0);
- }
- }
- }
- }
- }
}
-void AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::FillSigmaY2(float sigmaY2, AliHLTUInt32_t clusterId, int partition)
+void AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::FillSigmaY2(float sigmaY2, AliHLTUInt32_t /*clusterId*/, int partition)
{
/// fill sigmaY2 histogram
+ fCurrentCluster.SetSigmaY2(sigmaY2);
unsigned index=kHistogramSigmaY2;
/// take account for different pad widths
float weight=AliHLTTPCTransform::GetPadPitchWidth(partition);
if (index<fHistogram2DPointers.size() && fHistogram2DPointers[index]!=NULL)
fHistogram2DPointers[index]->Fill(fSector,sigmaY2*weight*weight);
- if (clusterId!=kAliHLTVoidDataSpec) {
- index=kHistogramDeltaSigmaY2;
- if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData) {
- if (fRawData->Check(clusterId)) {
- fHistogramPointers[index]->Fill(sigmaY2-fRawData->GetYWidth(clusterId));
- }
- }
- }
}
-void AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::FillSigmaZ2(float sigmaZ2, AliHLTUInt32_t clusterId)
+void AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::FillSigmaZ2(float sigmaZ2, AliHLTUInt32_t /*clusterId*/)
{
/// fill sigmaZ2 histogram
+ fCurrentCluster.SetSigmaZ2(sigmaZ2);
unsigned index=kHistogramSigmaZ2;
// FIXME: this is just a fixed value, to be correct the values from the global
// parameter block has to be used
if (index<fHistogram2DPointers.size() && fHistogram2DPointers[index]!=NULL)
fHistogram2DPointers[index]->Fill(fSector,sigmaZ2*weight*weight);
- if (clusterId!=kAliHLTVoidDataSpec) {
- index=kHistogramDeltaSigmaZ2;
- if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData) {
- if (fRawData->Check(clusterId)) {
- fHistogramPointers[index]->Fill(sigmaZ2-fRawData->GetZWidth(clusterId));
- }
- }
- }
}
-void AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::FillCharge(unsigned charge, AliHLTUInt32_t clusterId)
+void AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::FillCharge(unsigned charge, AliHLTUInt32_t /*clusterId*/)
{
/// fill charge histogram
+ fCurrentCluster.SetCharge(charge);
unsigned index=kHistogramCharge;
if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL)
fHistogramPointers[index]->Fill(charge);
- if (clusterId!=kAliHLTVoidDataSpec) {
- index=kHistogramDeltaCharge;
- if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData) {
- if (fRawData->Check(clusterId)) {
- fHistogramPointers[index]->Fill(charge-fRawData->GetCharge(clusterId));
- }
- }
- }
}
-void AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::FillQMax(unsigned qmax, AliHLTUInt32_t clusterId)
+void AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::FillQMax(unsigned qmax, AliHLTUInt32_t /*clusterId*/)
{
/// fill qmax histogram
+ fCurrentCluster.SetQMax(qmax);
unsigned index=kHistogramQMax;
if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL)
fHistogramPointers[index]->Fill(qmax);
index=kHistogramQMaxSector;
if (index<fHistogram2DPointers.size() && fHistogram2DPointers[index]!=NULL)
fHistogram2DPointers[index]->Fill(fSector,qmax);
+}
+
+void AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::Fill(int slice, int partition, AliHLTUInt32_t clusterId)
+{
+ /// fill cluster histograms requiring the full cluster information
+
+ // TODO: the complete filling of histograms can be moved to this function
+ // and the cluster struct be filled in the iterator
+ // The delta histograms are filled here either by using the specified
+ // cluster, or the nearest cluster on the padrow with identical charge
+ // and qmax is searched for comparison.
+ if (clusterId==kAliHLTVoidDataSpec) {
+ clusterId=FindNearestCluster(slice, partition, fCurrentCluster);
+ }
+ if (clusterId==kAliHLTVoidDataSpec) return;
+ bool bResidualError=false;
+ int currentRow=fCurrentCluster.GetPadRow();
+
+ unsigned index=kHistogramDeltaPadrow;
+ if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData) {
+ if (fRawData->Check(clusterId)) {
+ fHistogramPointers[index]->Fill(fCurrentCluster.GetPadRow()-fRawData->GetX(clusterId));
+ }
+ }
+
+ index=kHistogramDeltaPad;
+ if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData) {
+ if (fRawData->Check(clusterId)) {
+ float dPad=fCurrentCluster.GetPad()-fRawData->GetY(clusterId);
+ fHistogramPointers[index]->Fill(dPad);
+ static const float maxdPad=0.015; // better 100um for 4 and 6mm pad width
+ if (TMath::Abs(dPad)>maxdPad) {
+ //HLTError("cluster 0x%08x slice %d partition %d: pad difference %f - max %f", clusterId, slice, partition, dPad, maxdPad);
+ bResidualError=true;
+ }
+ }
+ }
+
+ index=kHistogramDeltaTime;
+ if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData) {
+ if (fRawData->Check(clusterId)) {
+ float dTime=fCurrentCluster.GetTime()-fRawData->GetZ(clusterId);
+ fHistogramPointers[index]->Fill(dTime);
+ static const float maxdTime=0.04; // corresponds to 100um
+ if (TMath::Abs(dTime)>maxdTime) {
+ //HLTError("cluster 0x%08x slice %d partition %d: time difference %f - max %f", clusterId, slice, partition, dTime, maxdTime);
+ bResidualError=true;
+ }
+ }
+ }
+
+ index=kHistogramDeltaSigmaY2;
+ if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData) {
+ if (fRawData->Check(clusterId)) {
+ fHistogramPointers[index]->Fill(fCurrentCluster.GetSigmaY2()-fRawData->GetYWidth(clusterId));
+ }
+ }
+
+ index=kHistogramDeltaSigmaZ2;
+ if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData) {
+ if (fRawData->Check(clusterId)) {
+ fHistogramPointers[index]->Fill(fCurrentCluster.GetSigmaZ2()-fRawData->GetZWidth(clusterId));
+ }
+ }
+
+ index=kHistogramDeltaCharge;
+ if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData) {
+ if (fRawData->Check(clusterId)) {
+ fHistogramPointers[index]->Fill(fCurrentCluster.GetCharge()-fRawData->GetCharge(clusterId));
+ }
+ }
- if (clusterId!=kAliHLTVoidDataSpec) {
index=kHistogramDeltaQMax;
if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData) {
if (fRawData->Check(clusterId)) {
- fHistogramPointers[index]->Fill(qmax-fRawData->GetQMax(clusterId));
+ fHistogramPointers[index]->Fill(fCurrentCluster.GetQMax()-fRawData->GetQMax(clusterId));
}
}
- }
+
+ if (bResidualError) {
+ index=kHistogramOutOfRange;
+ if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData) {
+ fHistogramPointers[index]->Fill(currentRow>=0?currentRow:0);
+ }
+ }
+
+ index=kHistogramHWCFPad;
+ if (index<fHistogramPointers.size() && fHistogramPointers[index]!=NULL && fRawData)
+ fHistogramPointers[index]->Fill(fRawData->GetY(clusterId));
}
void AliHLTTPCDataCompressionMonitorComponent::AliDataContainer::Clear(Option_t * option)