]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
bugfixes run period week 22 (Kelly and Kenneth)
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 Jun 2008 08:54:13 +0000 (08:54 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 Jun 2008 08:54:13 +0000 (08:54 +0000)
- TPCClusterFinder: output of selected channels
- TPCClusterFinder bugfix: return correct output size
- TPCNoiseMapper: instantiating of histograms according to configuration

HLT/TPCLib/AliHLTTPCClusterFinder.cxx
HLT/TPCLib/AliHLTTPCClusterFinder.h
HLT/TPCLib/AliHLTTPCClusterFinderComponent.cxx
HLT/TPCLib/AliHLTTPCClusterFinderComponent.h
HLT/TPCLib/AliHLTTPCNoiseMapComponent.cxx
HLT/TPCLib/AliHLTTPCPad.cxx
HLT/TPCLib/AliHLTTPCPad.h
HLT/TPCLib/AliHLTTPCZeroSuppressionComponent.cxx

index d0747493a9fdc870903de12c67e10e1d90965933..3e8dafe97c2d44710889fc89d109463ccbd4b3f9 100644 (file)
@@ -44,6 +44,8 @@ ClassImp(AliHLTTPCClusterFinder)
 
 AliHLTTPCClusterFinder::AliHLTTPCClusterFinder()
   :
+  fClustersHWAddressVector(),
+  fRowPadVector(),
   fSpacePointData(NULL),
   fDigitReader(NULL),
   fPtr(NULL),
@@ -69,11 +71,11 @@ AliHLTTPCClusterFinder::AliHLTTPCClusterFinder()
   fOccupancyLimit(1.0),
   fUnsorted(0),
   fVectorInitialized(kFALSE),
-  fRowPadVector(),
   fClusters(),
   fNumberOfPadsInRow(NULL),
   fNumberOfRows(0),
-  fRowOfFirstCandidate(0)
+  fRowOfFirstCandidate(0),
+  fDoPadSelection(kFALSE)
 {
   //constructor  
 }
@@ -721,6 +723,26 @@ Bool_t AliHLTTPCClusterFinder::ComparePads(AliHLTTPCPad *nextPad,AliHLTTPCCluste
       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;
@@ -740,6 +762,26 @@ Bool_t AliHLTTPCClusterFinder::ComparePads(AliHLTTPCPad *nextPad,AliHLTTPCCluste
   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
index 09c7096dd3df0e9b0d72fc74dce3347bfaf8de77..5eea963763a516c0d48a68ac36a7857d4d260793 100644 (file)
@@ -155,6 +155,17 @@ class AliHLTTPCClusterFinder : public AliHLTLogging {
   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&);
@@ -194,9 +205,9 @@ class AliHLTTPCClusterFinder : public AliHLTLogging {
   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
   
@@ -204,13 +215,15 @@ class AliHLTTPCClusterFinder : public AliHLTLogging {
   
   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
index edf5ce3200c69b1bfadc804bcee6ab99220ec61b..9dee1b286c8ed2804f8509eb7536faa81be550b9 100644 (file)
@@ -122,6 +122,7 @@ int AliHLTTPCClusterFinderComponent::GetOutputDataTypes(AliHLTComponentDataTypeL
   // see header file for class documentation
   tgtList.clear();
   tgtList.push_back(AliHLTTPCDefinitions::fgkClustersDataType);
+  tgtList.push_back(kAliHLTDataTypeHwAddr16);
   return tgtList.size();
 }
 
@@ -429,6 +430,10 @@ int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponentEventData& ev
       fClusterFinder->SetOutputArray( (AliHLTTPCSpacePointData*)outPtr->fSpacePoints );
        
       if(fUnsorted){
+       if(fGetActivePads){
+         fClusterFinder->SetDoPadSelection(kTRUE);
+       }
+
        fClusterFinder->ReadDataUnsorted(iter->fPtr, iter->fSize);
 
        fClusterFinder->FindClusters();
@@ -467,6 +472,26 @@ int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponentEventData& ev
                   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;
index 27e7eb7eaafe1a00379cedf3a0edad6c76248c76..a83c54e8dc603e4cea65c26578912d92e3a2539c 100644 (file)
@@ -137,7 +137,7 @@ class AliHLTTPCClusterFinderComponent : public AliHLTProcessor
         */
        Int_t fGetActivePads;                                                          //!transient
 
-       ClassDef(AliHLTTPCClusterFinderComponent, 3)
+       ClassDef(AliHLTTPCClusterFinderComponent, 4)
 
 };
 #endif
index 5d12e0ff1a82bd4fe12e4f167a22ca7da8dac066..71becec32eb89fa65820725282dbf36aadaf7bd3 100644 (file)
@@ -232,18 +232,23 @@ int AliHLTTPCNoiseMapComponent::DoEvent(const AliHLTComponentEventData& evtData,
  
   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", 
@@ -269,8 +274,8 @@ int AliHLTTPCNoiseMapComponent::DoEvent(const AliHLTComponentEventData& evtData,
      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 
@@ -315,7 +320,8 @@ int AliHLTTPCNoiseMapComponent::DoEvent(const AliHLTComponentEventData& evtData,
          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();
@@ -349,16 +355,16 @@ void AliHLTTPCNoiseMapComponent::MakeHistosPublic() {
   //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) { 
index 0b76a1a5686e602462b1d06b3a7149092a8edfb3..996d190315f33cfb2f1ef145552b3c273d893330 100644 (file)
@@ -56,6 +56,8 @@ AliHLTTPCPad::AliHLTTPCPad()
   :
   fClusterCandidates(),
   fUsedClusterCandidates(),
+  fSelectedPad(kFALSE),
+  fHWAddress(0),
   fRowNo(-1),
   fPadNo(-1),
   fThreshold(0),
@@ -98,6 +100,8 @@ AliHLTTPCPad::AliHLTTPCPad(Int_t dummy)
   :
   fClusterCandidates(),
   fUsedClusterCandidates(),
+  fSelectedPad(kFALSE),
+  fHWAddress(0),
   fRowNo(-1),
   fPadNo(-1),
   fThreshold(0),
@@ -133,6 +137,8 @@ AliHLTTPCPad::AliHLTTPCPad(Int_t offset, Int_t nofBins)
   :
   fClusterCandidates(),
   fUsedClusterCandidates(),
+  fSelectedPad(kFALSE),
+  fHWAddress(0),
   fRowNo(-1),
   fPadNo(-1),
   fThreshold(0),
index 2e89f7e192c96a5965d2ff0bd874458790b4e526..f881fe61d2c345c937d4ed108580c01fbfa17d3d 100644 (file)
@@ -356,8 +356,10 @@ public:
   /**
    * 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&);
index b42fe2b87b5f6b976c2a687091e5490fe3da6e3e..63a1c587180c5924a442b2e0ba3357218989abb4 100755 (executable)
@@ -423,7 +423,9 @@ int AliHLTTPCZeroSuppressionComponent::DoEvent( const AliHLTComponentEventData&
 
   //  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
 
@@ -496,6 +498,8 @@ int AliHLTTPCZeroSuppressionComponent::DoEvent( const AliHLTComponentEventData&
     
     size = dataOffsetBeforeHW+sizeOfHWArray;
 
+  } else {
+    size=0;
   }
   return 0;
 }