]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
commit from Jochen
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Dec 2006 10:30:28 +0000 (10:30 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Dec 2006 10:30:28 +0000 (10:30 +0000)
- TPCDisplay library version 2
  - library version for the AliHLTGUI v 1.5
- argument scan of the AliHLTTPCDigitReaderRaw cleaned up

HLT/ChangeLog
HLT/TPCLib/AliHLTTPCClusterFinder.cxx
HLT/TPCLib/AliHLTTPCClusterFinderComponent.cxx
HLT/TPCLib/AliHLTTPCDigitReaderRaw.cxx
HLT/TPCLib/AliHLTTPCDigitReaderRaw.h
HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayFront.cxx
HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayFront.h
HLT/TPCLib/OnlineDisplay/AliHLTTPCDisplayMain.cxx
HLT/TPCLib/OnlineDisplay/Makefile.am

index 368aa38339246068c57a37bd2d8d181039d5c4e5..5ec84a630100f8435896da30c1d4f6fb4c5cfa36 100644 (file)
@@ -1,3 +1,7 @@
+2006-12-18 commit from Jochen
+       - TPCDisplay library version 2
+         - library version for the AliHLTGUI v 1.5
+       - argument scan of the AliHLTTPCDigitReaderRaw cleaned up
 2006-12-12
        - use_newio switch removed, always on
        - AliHLTTPC and AliHLTTPCClustFinderNew removed from compilation of
index 1af270dc0c551cc7ed8b44db31c9d7c78d95c58c..379f0b4e54a4f7edb2fdf2feb493c9d925508923 100644 (file)
@@ -437,7 +437,6 @@ void AliHLTTPCClusterFinder::ProcessDigits()
     Int_t padmean = seqcharge*pad;
     Int_t paderror = pad*padmean;
 
-
     //Compare with results on previous pad:
     for(UInt_t p=0; p<nprevious && p<kPadArraySize && ncurrent<kPadArraySize; p++){
       
@@ -480,7 +479,6 @@ void AliHLTTPCClusterFinder::ProcessDigits()
       } //Checking for match at previous pad
     } //Loop over results on previous pad.
 
-
     if(newcluster && ncurrent<kPadArraySize){
       //Start a new cluster. Add it to the clusterlist, and update
       //the list of pointers to clusters in current pad.
index fa990d689a0419a6de2cfb7f76694b8f6c1d14fc..1b84d34ebf3a4267adf336f6694e402d0a6f4966 100644 (file)
@@ -147,28 +147,14 @@ int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv )
          Logging( kHLTLogError, "HLT::TPCClusterFinder::DoInit", "Missing rawreadermode", "Raw Reader Mode not specified" );
          return ENOTSUP;
        }
-       
-       if ( !strcmp( argv[i+1], "sorted_1_trailerword" ) ) {
-         rawreadermode = 0;
-       }
-       else if ( !strcmp( argv[i+1], "sorted_3_trailerword" ) ) {
-         rawreadermode = 2;
-       }
-       else if ( !strcmp( argv[i+1], "unsorted_1_trailerword" ) ) {
-         rawreadermode = 1;
-       }
-       else if ( !strcmp( argv[i+1], "unsorted_3_trailerword" ) ) {
-         rawreadermode = 3;
-       }
-       else if ( !strcmp( argv[i+1], "offline" ) ) {
-         rawreadermode = -1;
-       }
-       else {
-         rawreadermode = strtoul( argv[i+1], &cpErr ,0);
-           if ( *cpErr ) {
-             Logging( kHLTLogError, "HLT::TPCClusterFinder::DoInit", "Missing rawreadermode", "Cannot convert rawreadermode specifier '%s'.", argv[i+1] );
-             return EINVAL;
-           }
+
+       // Decodes the rawreader mode: either number or string and returns the rawreadermode
+       // -1 on failure, -2 for offline
+       rawreadermode = AliHLTTPCDigitReaderRaw::DecodeMode( argv[i+1] );
+
+       if (rawreadermode == -1 ) {
+         Logging( kHLTLogError, "HLT::TPCClusterFinder::DoInit", "Missing rawreadermode", "Cannot convert rawreadermode specifier '%s'.", argv[i+1] );
+         return EINVAL;
        }
 
        i += 2;
@@ -194,7 +180,7 @@ int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv )
       }
 
       // -- pad occupancy limit
-      if ( !strcmp( argv[i], "occupancy-threshold" ) ) {
+      if ( !strcmp( argv[i], "occupancy-limit" ) ) {
        occulimit = strtof( argv[i+1], &cpErr);
        if ( *cpErr ) {
          HLTError("Cannot convert occupancy specifier '%s'.", argv[i+1]);
@@ -212,7 +198,7 @@ int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv )
     // Choose reader
 
     if (fPackedSwitch) { 
-      if (rawreadermode == -1) {
+      if (rawreadermode == -2) {
 #if defined(HAVE_ALIRAWDATA) && defined(HAVE_ALITPCRAWSTREAM_H)
        fReader = new AliHLTTPCDigitReaderPacked();
        fClusterFinder->SetReader(fReader);
index a53f59c3e464972055791b08ed6f15659317dad8..473388eec418d3cac48b0dcc61f05b9ea29625e2 100644 (file)
@@ -635,6 +635,60 @@ unsigned AliHLTTPCDigitReaderRaw::GetMaxHWA( unsigned patch )
   return fMaxHWA[patch];
 }
 
+Int_t AliHLTTPCDigitReaderRaw::DecodeMode(Int_t mode) {
+  Int_t decodedMode;
+
+  if ( mode >= kNofRawReaderModes ) 
+    decodedMode = -1;
+  else
+    decodedMode = mode;
+
+  return decodedMode;
+}
+
+Int_t AliHLTTPCDigitReaderRaw::DecodeMode(const Char_t *mode) {
+  Int_t decodedMode;
+  Char_t *cpErr;
+
+  // Check if String is convertible to Int_t
+  // if not decode the string, otherwise, check if Int_t is valid
+  Int_t intMode = strtoul( mode, &cpErr ,0);
+
+  if ( *cpErr ) {
+    if ( !strcmp( mode, "sorted_3_trailerword" ) ) 
+      decodedMode = kSorted3Trailerword;
+    
+    else if ( !strcmp( mode, "sorted_2_trailerword" ) ) 
+      decodedMode = kSorted2Trailerword;
+    
+    else if ( !strcmp( mode, "sorted_1_trailerword" ) ) 
+      decodedMode = kSorted1Trailerword;
+    
+    else if ( !strcmp( mode, "unsorted_3_trailerword" ) ) 
+      decodedMode = kUnsorted3Trailerword;
+    
+    else if ( !strcmp( mode, "unsorted_2_trailerword" ) ) 
+      decodedMode = kUnsorted2Trailerword;
+    
+    else if ( !strcmp( mode, "unsorted_1_trailerword" ) ) 
+      decodedMode = kUnsorted1Trailerword;
+    
+    else if ( ! strcmp( mode, "offline" ) )
+      decodedMode = -2;
+    
+    else 
+      decodedMode = -1;
+  }  // END if ( *cpErr ) {
+  else {
+    if ( intMode >= kNofRawReaderModes ) 
+      decodedMode = -1;
+    else
+      decodedMode = intMode;
+  }
+
+  return decodedMode;
+}
+
 
 // ----- MAPPING ARRAYS
 #include "mapping_array_out.inc"
index df82b2b3608550d55efc339042c5af03c0155390..e8ed992489844f8b2f715fb84c61927928f68f0a 100644 (file)
  */
 class AliHLTTPCDigitReaderRaw : public AliHLTTPCDigitReader  {
 public:
+
+  /** decode mode of the reader */
+  enum RawReaderMode {
+    /** 0: RCU Data format as delivered during TPC commissioning, pads/padrows
+     *  are sorted, RCU trailer is one 32 bit word. */
+    kSorted1Trailerword=0,
+    /** 1: As 0, but pads/padrows are delivered "as is", without sorting */
+    kUnsorted1Trailerword,
+    /** 2: As 0, but RCU trailer is 3 32 bit words. */
+    kSorted3Trailerword,
+    /** 3: As 1, but RCU trailer is 3 32 bit words. */
+    kUnsorted3Trailerword,
+    /** 4: As 0, but RCU trailer is 2 32 bit words. */
+    kSorted2Trailerword,
+    /** 5: As 1, but RCU trailer is 2 32 bit words. */
+    kUnsorted2Trailerword,
+    /** number of modes */
+    kNofRawReaderModes
+  };
+
   /** standard constructor
    * @param formatVersion  Data Format version numbers:
    *  - 0: RCU Data format as delivered during TPC commissioning, pads/padrows
@@ -43,6 +63,8 @@ public:
    *  - 1: As 0, but pads/padrows are delivered "as is", without sorting
    *  - 2: As 0, but RCU trailer is 3 32 bit words.
    *  - 3: As 1, but RCU trailer is 3 32 bit words.
+   *  - 4: As 0, but RCU trailer is 2 32 bit words.
+   *  - 5: As 1, but RCU trailer is 2 32 bit words.
    */
   AliHLTTPCDigitReaderRaw( unsigned formatVersion );
   /** not a valid copy constructor, defined according to effective C++ style */
@@ -129,6 +151,29 @@ public:
   Int_t GetPad( unsigned patch, unsigned hw_addr );
   unsigned GetMaxHWA( unsigned patch );
 
+  /**
+   * This function decodes the rawreadermode set in HLT***Components
+   * or the AliHLTGUI and returns the integer value of @ref RawReaderMode.
+   * @param mode const Char_t * argument <br>
+   *    sorted_3_trailerword -> @ref kSorted3Trailerword <br>
+   *    sorted_2_trailerword -> @ref kSorted2Trailerword <br>
+   *    sorted_1_trailerword -> @ref kSorted1Trailerword <br>
+   *    unsorted_3_trailerword -> @ref kUnsorted3Trailerword <br>
+   *    unsorted_2_trailerword -> @ref kUnsorted2Trailerword <br>
+   *    unsorted_1_trailerword -> @ref kUnsorted1Trailerword <br>
+   * @return rawreadermode @ref RawReaderMode and -1 if decoding fails
+   */
+  static Int_t DecodeMode(const Char_t *mode);
+
+  /**
+   * This function sets the rawreadermode from an enum.
+   * The name was chosen in order to use the two methods with either
+   * a Char_t array or an Int_t.
+   * @param mode mode enum @ref RawReaderMode
+   * @return rawreadermode @ref RawReaderMode and -1 if decoding fails
+   */
+  static Int_t DecodeMode(Int_t mode);
+
 protected:
 
     AliHLTUInt8_t* fBuffer;
index 85b0eeab1bcbcb1245188a9d5a8198431512cdd6..452bef288f9e6ecd361995b2f5710103ade22f6c 100644 (file)
@@ -73,6 +73,8 @@ AliHLTTPCDisplayFront::AliHLTTPCDisplayFront(AliHLTTPCDisplayMain* display) {
     fHistfront = new TH2F("fHistfront","FrontView of selected slice;Pad #;Padrow #",Bins,fBinX[0],fBinX[1],fBinY[1]+1,fBinY[0],fBinY[1]);
 #else
     fHistfront = new TH2F("fHistfront","FrontView of selected slice;Pad #;Padrow #",fBinX[1]+1,fBinX[0],fBinX[1],fBinY[1]+1,fBinY[0],fBinY[1]);
+    fHistfrontcl = new TH1F("fHistfrontcl","cvcv;ddd;kkk",fBinX[1]+1,fBinX[0],fBinX[1]);
+    gStyle->SetPalette(1);
 #endif
 
     fHistfront->SetOption("COLZ");  
@@ -250,6 +252,32 @@ void AliHLTTPCDisplayFront::Fill(Int_t patch, ULong_t dataBlock, ULong_t dataLen
     }// end use maximum
   } // end - else of  if ( fDisplay->GetZeroSuppression() ){
 
+
+  if (fDisplay->ExistsClusterData()){
+    for (patch=0; patch < 6; patch++){
+      AliHLTTPCSpacePointData *points = fDisplay->GetSpacePointDataPointer(fDisplay->GetSlicePadRow(),patch);
+      if(!points) return;
+
+      cout << "fill" << patch << endl;
+
+      Float_t xyz[3];
+      for(Int_t i=0; i< fDisplay->GetNumberSpacePoints(fDisplay->GetSlicePadRow(),patch); i++){
+       xyz[0] = points[i].fX;
+       xyz[1] = points[i].fY;
+       xyz[2] = points[i].fZ;
+       Int_t padRow = AliHLTTPCTransform::GetPadRow(xyz[0]);
+       
+
+       // select padrow to fill in histogramm
+       //      if (padRow == AliHLTTPCTransform::GetPadRow(xyz[0])){
+       AliHLTTPCTransform::LocHLT2Raw(xyz, 0, padRow);
+       fHistfrontcl->Fill(xyz[1],padRow);
+       //      }
+      }
+    }
+  } // END if (fDisplay->ExistsClusterData()){
+
+
 }
 
 //____________________________________________________________________________________________________
@@ -280,6 +308,18 @@ void AliHLTTPCDisplayFront::Draw(){
     fHistfront->SetStats(kFALSE);
     fHistfront->Draw("COLZ");
 
+    if ( fDisplay->ExistsClusterData() ){
+       fHistfrontcl->SetAxisRange(fBinX[0],fBinX[1]);
+       fHistfrontcl->SetAxisRange(fBinY[0],fBinY[1],"Y");
+       fHistfrontcl->SetStats(kFALSE);
+       fHistfrontcl->SetMarkerStyle(28);
+       fHistfrontcl->SetMarkerSize(2);
+       fHistfrontcl->SetMarkerColor(1);
+       fHistfrontcl->Draw("psame");
+
+       cout << "draw" << endl;
+    }
+
     if (fDisplay->GetSplitFront()){
       fDisplay->GetCanvasFront()->cd(2);
       fDisplay->GetPadPointer()->fHistpad2->Draw();
index e8f9249806485dbfcb33967a9e2bb0022ec8e11f..4106e41a5cb48020c5debe1b81352a8b49744ac5 100644 (file)
@@ -15,6 +15,7 @@
 //*-- Copyright &copy ALICE HLT Group 
 
 #include <TCanvas.h>
+#include <TH1F.h>
 #include <TH2F.h>
 #include <AliHLTTPCDisplayMain.h>
 
@@ -35,7 +36,7 @@ class AliHLTTPCDisplayFront : public AliHLTLogging  {
     TCanvas * fCanvas;
 
     TH2F *fHistfront;              // histogram for front view of one slice
-
+  TH1F *fHistfrontcl;              // histogram for cluster in front
     Int_t fNTimes;
 
     Int_t fBinX[2];                // Minimum / Maximum - Bin on X Axis
index 4281fbbf88bb1155d87876616c4bc3b2b2e12529..98c05782c3a3077005d6e863e2e3a3a591b234ef 100644 (file)
@@ -203,6 +203,26 @@ AliHLTTPCDisplayMain::~AliHLTTPCDisplayMain() {
 //____________________________________________________________________________________________________
 Int_t AliHLTTPCDisplayMain::Connect( unsigned int cnt, const char** hostnames, unsigned short* ports, Char_t *gfile){
 
+    Char_t* defaultGeometry=NULL;
+#if defined(DEFAULT_GEOMETRY)
+    defaultGeometry=DEFAULT_GEOMETRY;
+#endif
+    if (gfile!=NULL) {
+      HLTDebug("probing geometry file %s", gfile);
+      ifstream test(gfile);
+      if (test.fail()) {
+       HLTWarning("unable to find geometry file %s, using default file", gfile);
+       gfile=defaultGeometry;
+      }
+      test.close();
+    } else {
+      HLTDebug("using default geometry file %s", gfile, defaultGeometry);
+      gfile=defaultGeometry;
+    }
+    if (gfile==NULL) {
+      HLTError("geometry file missing");
+      return -EINVAL;
+    }
 #if defined(HAVE_HOMERREADER) 
   // -- input datatypes , reverse
   Char_t* spptID="SRETSULC";       // CLUSTERS
@@ -825,7 +845,7 @@ void AliHLTTPCDisplayMain::ReadRawData(){
          
          if (!pCurrentPad->IsStarted()) {
            
-           HLTDebug("reading data for pad %d, padrow %d", digitReader.GetPad(), digitReader.GetRow()+rowOffset);
+           //      HLTDebug("reading data for pad %d, padrow %d", digitReader.GetPad(), digitReader.GetRow()+rowOffset);
            
            pCurrentPad->SetID(digitReader.GetRow()+rowOffset,digitReader.GetPad());
            
@@ -836,7 +856,7 @@ void AliHLTTPCDisplayMain::ReadRawData(){
                if ( digitReader.GetPad() != pCurrentPad->GetPadNumber() ) break;
                pCurrentPad->SetRawData( digitReader.GetTime(), digitReader.GetSignal() );
                
-               HLTDebug("set raw data to pad: bin %d charge %d", digitReader.GetTime(), digitReader.GetSignal());
+               //      HLTDebug("set raw data to pad: bin %d charge %d", digitReader.GetTime(), digitReader.GetSignal());
                
              } while ( (readValue = digitReader.Next()) != 0 );
            }
@@ -845,7 +865,7 @@ void AliHLTTPCDisplayMain::ReadRawData(){
            pCurrentPad->CalculateBaseLine( GetNTimeBins() / 2);
            
            if ( pCurrentPad->Next(kTRUE/*do zero suppression*/) == 0 ) {
-             HLTDebug("no data available after zero suppression");
+             //              HLTDebug("no data available after zero suppression");
              
              pCurrentPad->StopEvent();
              pCurrentPad->ResetHistory();
index 02ba6055dfc9fcff20aca75590366d692bbbe9d3..8efed577e6fee1b11f154ea40c6c6e3dcf595b34 100644 (file)
@@ -11,6 +11,8 @@ AM_CPPFLAGS                   = @ALIROOT_CPPFLAGS@         \
 # library definition
 lib_LTLIBRARIES                        =  libAliHLTTPCDisplay.la
 
+LIBRARY_VERSION                        = '2:0:0'
+
 # library sources
 libAliHLTTPCDisplay_la_SOURCES = AliHLTTPCDisplayMain.cxx \
                                  AliHLTTPCDisplay.cxx  \
@@ -48,7 +50,7 @@ libAliHLTTPCDisplay_la_LDFLAGS        = -L@ROOTLIBDIR@ \
                                  @ALIROOT_LIBS@ \
                                  @HOMER_LDFLAGS@ \
                                  @HOMER_LIBS@ \
-                                 -version-info 1:1:0
+                                 -version-info $(LIBRARY_VERSION)
 
 # automatic generation of data and time of library build
 COMPILE_INFO                   =  AliHLTTPCDisplayCompileInfo.cxx