+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
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++){
} //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.
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;
}
// -- 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]);
// Choose reader
if (fPackedSwitch) {
- if (rawreadermode == -1) {
+ if (rawreadermode == -2) {
#if defined(HAVE_ALIRAWDATA) && defined(HAVE_ALITPCRAWSTREAM_H)
fReader = new AliHLTTPCDigitReaderPacked();
fClusterFinder->SetReader(fReader);
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"
*/
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
* - 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 */
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;
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");
}// 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()){
+
+
}
//____________________________________________________________________________________________________
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();
//*-- Copyright © ALICE HLT Group
#include <TCanvas.h>
+#include <TH1F.h>
#include <TH2F.h>
#include <AliHLTTPCDisplayMain.h>
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
//____________________________________________________________________________________________________
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
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());
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 );
}
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();
# library definition
lib_LTLIBRARIES = libAliHLTTPCDisplay.la
+LIBRARY_VERSION = '2:0:0'
+
# library sources
libAliHLTTPCDisplay_la_SOURCES = AliHLTTPCDisplayMain.cxx \
AliHLTTPCDisplay.cxx \
@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