AliHLTTPCClusterFinder::AliHLTTPCClusterFinder()
:
+ fClustersHWAddressVector(),
+ fRowPadVector(),
fSpacePointData(NULL),
fDigitReader(NULL),
fPtr(NULL),
fOccupancyLimit(1.0),
fUnsorted(0),
fVectorInitialized(kFALSE),
- fRowPadVector(),
fClusters(),
fNumberOfPadsInRow(NULL),
fNumberOfRows(0),
- fRowOfFirstCandidate(0)
+ fRowOfFirstCandidate(0),
+ fDoPadSelection(kFALSE)
{
//constructor
}
cluster->fPad+=candidate->fPad;
cluster->fPad2=candidate->fPad2;
cluster->fLastMergedPad=candidate->fPad;
+
+ //cout<<"Adding "<<candidate->fTotalCharge<<" to the pad "<<nextPad->GetPadNumber()<<" row: "<<nextPad->GetRowNumber()<<" HWAddress: "<<(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(nextPad->GetRowNumber(),nextPad->GetPadNumber())<<endl;
+
+ if(fDoPadSelection){
+ UInt_t rowNo = nextPad->GetRowNumber();
+ UInt_t padNo = nextPad->GetPadNumber();
+ if(padNo-1>0){
+ fRowPadVector[rowNo][padNo-2]->fSelectedPad=kTRUE;
+ fRowPadVector[rowNo][padNo-2]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo-2);
+ }
+ fRowPadVector[rowNo][padNo-1]->fSelectedPad=kTRUE;// quick solution to set the first pad to selected
+ fRowPadVector[rowNo][padNo-1]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo-1);
+ fRowPadVector[rowNo][padNo]->fSelectedPad=kTRUE;
+ fRowPadVector[rowNo][padNo]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo);
+ /* if(padNo+1<(Int_t)fNumberOfPadsInRow[fRowOfFirstCandidate]){
+ fRowPadVector[rowNo][padNo]->fSelectedPad=kTRUE;
+ fRowPadVector[rowNo][padNo]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo);
+ }*/
+ // cout<<"We have an active pad in row: "<<rowNo<<" pad: "<<padNo<<" hwadd: "<<(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo)<<endl;
+ }
//setting the matched pad to used
nextPad->fUsedClusterCandidates[candidateNumber]=1;
return kFALSE;
}
+Int_t AliHLTTPCClusterFinder::FillHWAddressList(AliHLTUInt16_t *hwaddlist, Int_t maxHWadd){
+ Int_t counter=0;
+ for(UInt_t row=0;row<fNumberOfRows;row++){
+ for(UInt_t pad=0;pad<fNumberOfPadsInRow[row]-1;pad++){
+ if(fRowPadVector[row][pad]->fSelectedPad){
+ if(counter<maxHWadd){
+ hwaddlist[counter]=(AliHLTUInt16_t)fRowPadVector[row][pad]->fHWAddress;
+ //cout<<"Filling the f.. hardwareaddress: "<<fRowPadVector[row][pad]->fHWAddress<<endl;
+ counter++;
+ }
+ else{
+ HLTWarning("To many hardwareaddresses, skip adding");
+ }
+
+ }
+ }
+ }
+ return counter;
+}
+
void AliHLTTPCClusterFinder::FindClusters()
{
// see header file for function documentation
void InitializePadArray();
Int_t DeInitializePadArray();
Bool_t ComparePads(AliHLTTPCPad *nextPad,AliHLTTPCClusters* candidate,Int_t nextPadToRead);
+
+ void SetDoPadSelection(Bool_t input){fDoPadSelection=input;}
+
+ Int_t FillHWAddressList(AliHLTUInt16_t *hwaddlist, Int_t maxHWAddress);
+
+ vector<AliHLTUInt16_t> fClustersHWAddressVector; //! transient
+
+ typedef vector<AliHLTTPCPad*> AliHLTTPCPadVector;
+
+ vector<AliHLTTPCPadVector> fRowPadVector; //! transient
+
protected:
/** copy constructor prohibited */
AliHLTTPCClusterFinder(const AliHLTTPCClusterFinder&);
Int_t fUnsorted; // enable for processing of unsorted digit data
Bool_t fVectorInitialized;
- typedef vector<AliHLTTPCPad*> AliHLTTPCPadVector;
+ //typedef vector<AliHLTTPCPad*> AliHLTTPCPadVector;
- vector<AliHLTTPCPadVector> fRowPadVector; //! transient
+ //vector<AliHLTTPCPadVector> fRowPadVector; //! transient
vector<AliHLTTPCClusters> fClusters; //! transient
UInt_t fNumberOfRows; //! transient
- UInt_t fRowOfFirstCandidate;
+ UInt_t fRowOfFirstCandidate; //! transient
+
+ Bool_t fDoPadSelection; //! transient
#ifdef do_mc
void GetTrackID(Int_t pad,Int_t time,Int_t *trackID);
#endif
- ClassDef(AliHLTTPCClusterFinder,4) //Fast cluster finder
+ ClassDef(AliHLTTPCClusterFinder,5) //Fast cluster finder
};
#endif
// see header file for class documentation
tgtList.clear();
tgtList.push_back(AliHLTTPCDefinitions::fgkClustersDataType);
+ tgtList.push_back(kAliHLTDataTypeHwAddr16);
return tgtList.size();
}
fClusterFinder->SetOutputArray( (AliHLTTPCSpacePointData*)outPtr->fSpacePoints );
if(fUnsorted){
+ if(fGetActivePads){
+ fClusterFinder->SetDoPadSelection(kTRUE);
+ }
+
fClusterFinder->ReadDataUnsorted(iter->fPtr, iter->fSize);
fClusterFinder->FindClusters();
tSize, size );
return EMSGSIZE;
}
+
+ if(fUnsorted && fGetActivePads){
+ Int_t maxNumberOfHW=(Int_t)((size-tSize)/sizeof(AliHLTUInt16_t)-1);
+ AliHLTUInt16_t* outputHWPtr= (AliHLTUInt16_t*)(outputPtr+tSize);
+ Int_t nHWAdd = fClusterFinder->FillHWAddressList(outputHWPtr, maxNumberOfHW);
+
+ //cout<<"Number of hardwareaddresses: "<<nHWAdd<<endl;
+ for(AliHLTUInt16_t test=0;test<nHWAdd;test++){
+ //cout<<"The HW address is: "<<(AliHLTUInt16_t)outputHWPtr[test]<<endl;
+ }
+ AliHLTComponentBlockData bdHW;
+ FillBlockData( bdHW );
+ bdHW.fOffset = tSize ;
+ bdHW.fSize = nHWAdd*sizeof(AliHLTUInt16_t);
+ bdHW.fSpecification = iter->fSpecification;
+ bdHW.fDataType = kAliHLTDataTypeHwAddr16;
+ outputBlocks.push_back( bdHW );
+
+ tSize+=nHWAdd*sizeof(AliHLTUInt16_t);
+ }
}
size = tSize;
*/
Int_t fGetActivePads; //!transient
- ClassDef(AliHLTTPCClusterFinderComponent, 3)
+ ClassDef(AliHLTTPCClusterFinderComponent, 4)
};
#endif
if(GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR )) return 0;
- fHistSideA = new TH2F("fHistSideA","TPC Side A",250,-250,250,250,-250,250);
- fHistSideA->SetXTitle("global X (cm)"); fHistSideA->SetYTitle("global Y (cm)");
-
- fHistSideC = new TH2F("fHistSideC","TPC Side C",250,-250,250,250,-250,250);
- fHistSideC->SetXTitle("global X (cm)"); fHistSideC->SetYTitle("global Y (cm)");
-
+ if(fPlotSideA){
+ fHistSideA = new TH2F("fHistSideA","TPC Side A",250,-250,250,250,-250,250);
+ fHistSideA->SetXTitle("global X (cm)"); fHistSideA->SetYTitle("global Y (cm)");
+ }
+
+ if(fPlotSideC){
+ fHistSideC = new TH2F("fHistSideC","TPC Side C",250,-250,250,250,-250,250);
+ fHistSideC->SetXTitle("global X (cm)"); fHistSideC->SetYTitle("global Y (cm)");
+ }
+
const AliHLTComponentBlockData *iter = NULL;
- char name[100];
Float_t xyz[3];
Int_t thissector, thisrow;
-
+
+ fHistPartition = new TH2F("fHistPartition","fHistPartition",250,-250,250,250,-250,250);
+
for(iter = GetFirstInputBlock(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTPC); iter != NULL; iter = GetNextInputBlock()){
HLTInfo("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
pDigitReader->InitBlock(iter->fPtr,iter->fSize,partition,slice);
if(!pDigitReader) break;
- sprintf(name,"hMaxSignal_slice%d_partition%d", slice, partition);
- fHistPartition = new TH2F(name,name,250,-250,250,250,-250,250);
+ //sprintf(name,"hMaxSignal_slice%d_partition%d", slice, partition);
+ //fHistPartition = new TH2F(name,name,250,-250,250,250,-250,250);
while( pDigitReader->Next() ){
//while( pDigitReader->NextChannel()) { // pad loop
if(slice<18) fHistSideA->Fill(xyz[0],xyz[1],maxSignal);
else fHistSideC->Fill(xyz[0],xyz[1],maxSignal);
} // end if plotting sides
- } // end of while loop
+ } // end of while loop
+ delete pDigitReader;
} // end of for loop over data blocks
if(fResetHistograms) ResetHistograms();
//PushBack( (TObject*) &histos, kAliHLTDataTypeHistogram, fSpecification);
delete fHistPartition;
- delete fHistSideA;
- delete fHistSideC;
+ if(fHistSideA) delete fHistSideA; fHistSideA=NULL;
+ if(fHistSideC) delete fHistSideC; fHistSideC=NULL;
}
void AliHLTTPCNoiseMapComponent::ResetHistograms(){
// see header file for class documentation
fHistPartition->Reset();
- fHistSideA->Reset();
- fHistSideC->Reset();
+ if(fHistSideA) fHistSideA->Reset();
+ if(fHistSideC) fHistSideC->Reset();
}
int AliHLTTPCNoiseMapComponent::Configure(const char* arguments) {
:
fClusterCandidates(),
fUsedClusterCandidates(),
+ fSelectedPad(kFALSE),
+ fHWAddress(0),
fRowNo(-1),
fPadNo(-1),
fThreshold(0),
:
fClusterCandidates(),
fUsedClusterCandidates(),
+ fSelectedPad(kFALSE),
+ fHWAddress(0),
fRowNo(-1),
fPadNo(-1),
fThreshold(0),
:
fClusterCandidates(),
fUsedClusterCandidates(),
+ fSelectedPad(kFALSE),
+ fHWAddress(0),
fRowNo(-1),
fPadNo(-1),
fThreshold(0),
/**
* Vector of used clustercandidates, used so one do not use candidates multiple times
*/
- vector<Int_t> fUsedClusterCandidates; //! transient
-
+ vector<Int_t> fUsedClusterCandidates; //! transient
+ Bool_t fSelectedPad; //! transient
+ AliHLTUInt16_t fHWAddress; //! transient
+
private:
/** copy constructor prohibited */
AliHLTTPCPad(const AliHLTTPCPad&);
// HLTDebug("Max number of signals: %d",size/sizeof(Int_t));
- if(wasInput && fHwAddressList.size()>0){
+ if(wasInput>0){
+ //if(wasInput && fHwAddressList.size()>0){
+
AliHLTAltroEncoder altroEncoder;
altroEncoder.SetBuffer(outputPtr,size); //tests if one overwrite the buffer is done in the encoder
size = dataOffsetBeforeHW+sizeOfHWArray;
+ } else {
+ size=0;
}
return 0;
}