From fec96a66c201484ba63811afd202d9794ecc5738 Mon Sep 17 00:00:00 2001 From: kaamodt Date: Tue, 7 Oct 2008 01:40:34 +0000 Subject: [PATCH] Added functionality to the histogram handler class to ignore specification when adding histograms. Minor cleanup/bugfix in the zerosuppression component. Added qMax to the output list in the clusterfinder and added a macro to test the histogramhandler. changed back to using the decoder in activePadsTest.C --- HLT/TPCLib/AliHLTTPCClusterFinder.cxx | 2 + .../AliHLTTPCHistogramHandlerComponent.cxx | 13 +- .../AliHLTTPCHistogramHandlerComponent.h | 4 +- .../AliHLTTPCZeroSuppressionComponent.cxx | 7 +- HLT/TPCLib/macros/activePadsTest.C | 9 +- HLT/TPCLib/macros/histogramHandlerTest.C | 150 ++++++++++++++++++ 6 files changed, 175 insertions(+), 10 deletions(-) create mode 100644 HLT/TPCLib/macros/histogramHandlerTest.C diff --git a/HLT/TPCLib/AliHLTTPCClusterFinder.cxx b/HLT/TPCLib/AliHLTTPCClusterFinder.cxx index ae08c0d1004..cf01733be85 100644 --- a/HLT/TPCLib/AliHLTTPCClusterFinder.cxx +++ b/HLT/TPCLib/AliHLTTPCClusterFinder.cxx @@ -941,6 +941,8 @@ void AliHLTTPCClusterFinder::FindClusters() clusterlist[i].fLastCharge = fClusters[i].fLastCharge; clusterlist[i].fLastMergedPad = fClusters[i].fLastMergedPad; clusterlist[i].fRow = fClusters[i].fRowNumber; + clusterlist[i].fQMax = fClusters[i].fQMax; + } // PrintClusters(); WriteClusters(fClusters.size(),clusterlist); diff --git a/HLT/TPCLib/AliHLTTPCHistogramHandlerComponent.cxx b/HLT/TPCLib/AliHLTTPCHistogramHandlerComponent.cxx index 56520f351e1..e58b569f7cc 100644 --- a/HLT/TPCLib/AliHLTTPCHistogramHandlerComponent.cxx +++ b/HLT/TPCLib/AliHLTTPCHistogramHandlerComponent.cxx @@ -51,6 +51,7 @@ ClassImp(AliHLTTPCHistogramHandlerComponent) //ROOT macro for the implementation fNoiseHistograms(0), fKryptonHistograms(0), fUseGeneral(kFALSE), + fIgnoreSpecification(kFALSE), fSlice(-99), fHistTH1Tmp(NULL), @@ -177,6 +178,12 @@ int AliHLTTPCHistogramHandlerComponent::DoInit( int argc, const char** argv ) { i++; continue; } + + if (!strcmp( argv[i], "-ignore-specification")) { + fIgnoreSpecification = kTRUE; + i++; + continue; + } Logging(kHLTLogError, "HLT::TPCHistogramHandler::DoInit", "Unknown Option", "Unknown option '%s'", argv[i] ); return EINVAL; @@ -347,9 +354,9 @@ int AliHLTTPCHistogramHandlerComponent::DoEvent(const AliHLTComponentEventData&/ Bool_t histogramNotAdded = kTRUE; for(UInt_t i=0;iGetName())){ - if(minSlice==fHistogramData.at(i).fMinSlice && maxSlice == fHistogramData.at(i).fMaxSlice){ - if(minPartition==fHistogramData.at(i).fMinPartition && maxPartition == fHistogramData.at(i).fMaxPartition){ + if(histName.CompareTo(fHistogramData.at(i).fHistogram->GetName())==0){ + if(minSlice==fHistogramData.at(i).fMinSlice && maxSlice == fHistogramData.at(i).fMaxSlice || fIgnoreSpecification == kTRUE){ + if(minPartition==fHistogramData.at(i).fMinPartition && maxPartition == fHistogramData.at(i).fMaxPartition || fIgnoreSpecification == kTRUE){ fHistogramData.at(i).fHistogram->Add(tmp); histogramNotAdded = kFALSE; break; diff --git a/HLT/TPCLib/AliHLTTPCHistogramHandlerComponent.h b/HLT/TPCLib/AliHLTTPCHistogramHandlerComponent.h index 492596f4985..1904c466c04 100644 --- a/HLT/TPCLib/AliHLTTPCHistogramHandlerComponent.h +++ b/HLT/TPCLib/AliHLTTPCHistogramHandlerComponent.h @@ -107,6 +107,7 @@ private: Bool_t fNoiseHistograms; //!transient Bool_t fKryptonHistograms; //!transient Bool_t fUseGeneral; //!transient + Bool_t fIgnoreSpecification;//!transient Int_t fSlice; //!transient @@ -126,8 +127,9 @@ private: TH2 *fHistTPCSideCrms; //!transient vector fHistogramData; + - ClassDef(AliHLTTPCHistogramHandlerComponent, 3) + ClassDef(AliHLTTPCHistogramHandlerComponent, 4) }; #endif diff --git a/HLT/TPCLib/AliHLTTPCZeroSuppressionComponent.cxx b/HLT/TPCLib/AliHLTTPCZeroSuppressionComponent.cxx index bbbf7698a95..9edbd702f40 100755 --- a/HLT/TPCLib/AliHLTTPCZeroSuppressionComponent.cxx +++ b/HLT/TPCLib/AliHLTTPCZeroSuppressionComponent.cxx @@ -175,8 +175,12 @@ int AliHLTTPCZeroSuppressionComponent::DoInit( int argc, const char** argv ) } // -- number of timebins - if ( !strcmp( argv[i], "-ntimebins" ) || !strcmp( argv[i], "ntimebins" ) ) { + if ( !strcmp( argv[i], "-timebins" ) || !strcmp( argv[i], "ntimebins" ) || !strcmp( argv[i], "-ntimebins" )) { fNTimeBins = strtoul( argv[i+1], &cpErr ,0); + AliHLTTPCTransform::SetNTimeBins(fNTimeBins); + if(fEndTimeBin>AliHLTTPCTransform::GetNTimeBins()){ + fEndTimeBin = AliHLTTPCTransform::GetNTimeBins(); + } if ( *cpErr ) { HLTError("Cannot convert ntimebins specifier '%s'.", argv[i+1]); return EINVAL; @@ -297,6 +301,7 @@ int AliHLTTPCZeroSuppressionComponent::DoInit( int argc, const char** argv ) if(fSkipSendingZSData == kTRUE && fSendHWList == kFALSE){ HLTError("Component will have no output, check your configuration."); } + HLTDebug("using AliHLTTPCDigitReaderDecoder"); fDigitReader = new AliHLTTPCDigitReaderDecoder(); diff --git a/HLT/TPCLib/macros/activePadsTest.C b/HLT/TPCLib/macros/activePadsTest.C index fa90518d292..15186121087 100644 --- a/HLT/TPCLib/macros/activePadsTest.C +++ b/HLT/TPCLib/macros/activePadsTest.C @@ -1,4 +1,3 @@ -// $Id: dumpTPCDigits.C 24993 2008-04-09 00:54:41Z richterm $ //************************************************************************** //* This file is property of and copyright by the ALICE HLT Project * @@ -131,13 +130,13 @@ void activePadsTest(const char* input="./"){ } } //Dumping data (2.) - AliHLTConfiguration dump1("Dump1", "TPCDigitDump", digitDumpInput_OriginalData.Data() , "-digitreader packed -directory dump1 -unsorted -concatenate-blocks"); + AliHLTConfiguration dump1("Dump1", "TPCDigitDump", digitDumpInput_OriginalData.Data() , "-digitreader decoder -directory dump1 -unsorted -concatenate-blocks"); //Dumping data (7.) - AliHLTConfiguration dump2("Dump2", "TPCDigitDump", digitDumpInput_AfterAPSelection.Data() , "-digitreader packed -directory dump2 -unsorted -concatenate-blocks"); + AliHLTConfiguration dump2("Dump2", "TPCDigitDump", digitDumpInput_AfterAPSelection.Data() , "-digitreader decoder -directory dump2 -unsorted -concatenate-blocks"); //Dumping data (5.) - AliHLTConfiguration dump3("Dump3", "TPCDigitDump", digitDumpInput_ZeroSuppressedOriginalData.Data() , "-digitreader packed -directory dump3 -unsorted -concatenate-blocks"); + AliHLTConfiguration dump3("Dump3", "TPCDigitDump", digitDumpInput_ZeroSuppressedOriginalData.Data() , "-digitreader decoder -directory dump3 -unsorted -concatenate-blocks"); //Dumping data (9.) - AliHLTConfiguration dump4("Dump4", "TPCDigitDump", digitDumpInput_ZerosuppressedAPSelectionData.Data() , "-digitreader packed -directory dump4 -unsorted -concatenate-blocks"); + AliHLTConfiguration dump4("Dump4", "TPCDigitDump", digitDumpInput_ZerosuppressedAPSelectionData.Data() , "-digitreader decoder -directory dump4 -unsorted -concatenate-blocks"); //Dumping hw lists AliHLTConfiguration dump5("Dump5", "FileWriter", dumpHwAddressInput.Data() , "-directory hwlists"); diff --git a/HLT/TPCLib/macros/histogramHandlerTest.C b/HLT/TPCLib/macros/histogramHandlerTest.C new file mode 100644 index 00000000000..de6d0107f40 --- /dev/null +++ b/HLT/TPCLib/macros/histogramHandlerTest.C @@ -0,0 +1,150 @@ + +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors Kenneth Aamodt * +//* for The ALICE HLT Project. * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** + +/** + * @file histogramHandlerTest.C + * @author Kenneth.Aamodt@cern.ch + * @date + * @brief Test macro for histogram handler + * + * To test the histogram handler the AliHLTTPCClusterHistoComponent is used as input to the + * histogram handler. There are two clusterfinders running, each of these sends its output to + * one clusterhisto component each, which again sends its data to 2 histogram handlers. + * One of the Histogram handlers get data from one of the cluster histo components, while the + * other get the output from both. + * The content of the two rootfiles can now be compared to eachother. + * The histograms in histogramHandlerFile2... should now have double the amount of entries, and the + * height in the y-axis should be 2 times that of the histogramHandlerFile1... + */ + +void histogramHandlerTest(const char* input="./"){ + + if (!input) { + cerr << "please specify input or run without arguments" << endl; + return; + } + + + ///////////////////////////////////////////////////////////////////////////////////////////////// + // + // init the HLT system in order to define the analysis chain below + // + gSystem->Load("libHLTrec.so"); + AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance(); + + /////////////////////////////////////////////////////////////////////////////////////////////////// + // + // define the analysis chain to be run + // + + int iMinSlice=0; + int iMaxSlice=35; + int iMinPart=0; + int iMaxPart=5; + + TString histogramHandlerInput1; + TString histogramHandlerInput2; + TString histogramHandlerOutput1; + TString histogramHandlerOutput2; + TString rootFileWriterInput1; + TString rootFileWriterInput2; + + for (int slice=iMinSlice; slice<=iMaxSlice; slice++) { + for (int part=iMinPart; part<=iMaxPart; part++) { + TString clusterFinderOutput1; + TString clusterFinderOutput2; + TString clusterHistoInput1; + TString clusterHistoInput2; + TString clusterHistoOutput1; + TString clusterHistoOutput2; + TString arg, publisher; + // digit publisher components + int ddlno=768; + if (part>1) ddlno+=72+4*slice+(part-2); + else ddlno+=2*slice+part; + arg.Form("-minid %d -datatype 'DDL_RAW ' 'TPC ' -dataspec 0x%02x%02x%02x%02x", ddlno, slice, slice, part, part); + + publisher.Form("DP_%02d_%d", slice, part); + AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data()); + + // first clusterfinder + clusterFinderOutput1.Form("CF1_%02d_%d", slice, part); + AliHLTConfiguration cfconf(clusterFinderOutput1.Data(), "TPCClusterFinderDecoder", publisher.Data(), "-timebins 446");//-timebins set to simulated data + if (clusterHistoInput1.Length()>0) clusterHistoInput1+=" "; + clusterHistoInput1+=clusterFinderOutput1; + + // second clusterfinder + clusterFinderOutput2.Form("CF2_%02d_%d", slice, part); + AliHLTConfiguration cfconf(clusterFinderOutput2.Data(), "TPCClusterFinderDecoder", publisher.Data(), "-timebins 446");//-timebins set to simulated data + if (clusterHistoInput2.Length()>0) clusterHistoInput2+=" "; + clusterHistoInput2+=clusterFinderOutput2; + + + // first cluster histo component + clusterHistoOutput1.Form("CH1_%02d_%d", slice, part); + AliHLTConfiguration cfconf(clusterHistoOutput1.Data(), "TPCClusterHisto", clusterHistoInput1.Data(), ""); + if (histogramHandlerInput1.Length()>0) histogramHandlerInput1+=" "; + histogramHandlerInput1+=clusterHistoOutput1; + + //second cluster histo component + clusterHistoOutput2.Form("CH2_%02d_%d", slice, part); + AliHLTConfiguration cfconf(clusterHistoOutput2.Data(), "TPCClusterHisto", clusterHistoInput2.Data(), ""); + if (histogramHandlerInput1.Length()>0) histogramHandlerInput1+=" "; + histogramHandlerInput1+=clusterHistoOutput2; + if (histogramHandlerInput2.Length()>0) histogramHandlerInput2+=" "; + histogramHandlerInput2+=clusterHistoOutput2; + + } + } + + // first histogram handler component + histogramHandlerOutput1.Form("HH1_%02d_%d", slice, part); + AliHLTConfiguration cfconf(histogramHandlerOutput1.Data(), "TPCHistogramHandler", histogramHandlerInput1.Data(), "-use-general"); + if (rootFileWriterInput1.Length()>0) rootFileWriterInput1+=" "; + rootFileWriterInput1+=histogramHandlerOutput1; + + // second histogram handler component + histogramHandlerOutput2.Form("HH2_%02d_%d", slice, part); + AliHLTConfiguration cfconf(histogramHandlerOutput2.Data(), "TPCHistogramHandler", histogramHandlerInput2.Data(), "-use-general"); + if (rootFileWriterInput2.Length()>0) rootFileWriterInput2+=" "; + rootFileWriterInput2+=histogramHandlerOutput2; + + AliHLTConfiguration rootFileWriter1("RootFileWriter1", "ROOTFileWriter", rootFileWriterInput1.Data() , "-datafile histogramHandlerFile1"); + + AliHLTConfiguration rootFileWriter2("RootFileWriter2", "ROOTFileWriter", rootFileWriterInput2.Data() , "-datafile histogramHandlerFile2"); + + + /////////////////////////////////////////////////////////////////////////////////////////////////// + // + // Init and run the reconstruction + // All but HLT reconstruction is switched off + // + AliReconstruction rec; + rec.SetInput(input); + rec.SetRunVertexFinder(kFALSE); + rec.SetRunLocalReconstruction("HLT"); + rec.SetRunTracking(""); + rec.SetLoadAlignFromCDB(0); + rec.SetRunQA(":"); + AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG); + AliTracker::SetFieldMap(field,kTRUE); + //rec.SetFillESD("HLT"); + rec.SetFillESD(""); + rec.SetFillTriggerESD(false); + rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so loglevel=0x7c chains=RootFileWriter1,RootFileWriter2"); + rec.Run(); +} -- 2.43.0