--- /dev/null
+// $Id$
+
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Primary Authors: Kalliopi Kanaki <Kalliopi.Kanaki@ift.uib.no> *
+ * 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 AliHLTTPCClusterConverterComponent.cxx
+ @author Kalliopi Kanaki
+ @date
+ @brief The TPC cluster format conversion component.
+*/
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#if __GNUC__>= 3
+using namespace std;
+#endif
+
+#include "AliHLTTPCClusterConverterComponent.h"
+#include "AliHLTTPCOfflineCluster.h"
+#include "AliTPCclusterMI.h"
+
+#include "AliHLTTPCClusterDataFormat.h"
+
+#include "AliHLTTPCTrackSegmentData.h"
+#include "AliHLTTPCTrackletDataFormat.h"
+
+#include "AliCDBEntry.h"
+#include "AliCDBManager.h"
+
+#include "AliHLTTPCMemHandler.h"
+#include "AliHLTTPCDefinitions.h"
+
+#include "TString.h"
+#include "TObjString.h"
+#include "TObjArray.h"
+//#include "AliHLTTPC.h"
+//#include <stdlib.h>
+//#include <cerrno>
+
+/** ROOT macro for the implementation of ROOT specific class methods */
+ClassImp(AliHLTTPCClusterConverterComponent)
+
+AliHLTTPCClusterConverterComponent::AliHLTTPCClusterConverterComponent()
+:
+fClusters(0),
+fTracks(0),
+fOffArray(0)
+{ // see header file for class documentation
+ // or
+ // refer to README to build package
+ // or
+ // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+}
+
+AliHLTTPCClusterConverterComponent::~AliHLTTPCClusterConverterComponent(){
+ // see header file for class documentation
+}
+
+// Public functions to implement AliHLTComponent's interface.
+// These functions are required for the registration process
+
+const char* AliHLTTPCClusterConverterComponent::GetComponentID(){
+// see header file for class documentation
+ return "TPCClusterConverter";
+}
+
+void AliHLTTPCClusterConverterComponent::GetInputDataTypes(AliHLTComponentDataTypeList& list){
+// see header file for class documentation
+
+ list.clear();
+ list.push_back(AliHLTTPCDefinitions::fgkTrackSegmentsDataType);
+}
+
+AliHLTComponentDataType AliHLTTPCClusterConverterComponent::GetOutputDataType(){
+// see header file for class documentation
+ return kAliHLTDataTypeTObject;
+}
+
+int AliHLTTPCClusterConverterComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList){
+// see header file for class documentation
+
+ tgtList.clear();
+ tgtList.push_back(kAliHLTDataTypeTObject);
+ return tgtList.size();
+}
+
+void AliHLTTPCClusterConverterComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ){
+// see header file for class documentation
+
+ constBase = 0;
+ inputMultiplier = 1;
+}
+
+AliHLTComponent* AliHLTTPCClusterConverterComponent::Spawn(){
+// see header file for class documentation
+ return new AliHLTTPCClusterConverterComponent;
+}
+
+
+int AliHLTTPCClusterConverterComponent::DoInit( int argc, const char** argv ){
+// see header file for class documentation
+
+ //Int_t i = 0;
+ //Char_t* cpErr;
+ int iResult = 0;
+
+ TString configuration = "";
+ TString argument = "";
+
+ for (int i=0; i<argc && iResult>=0; i++) {
+ argument=argv[i];
+ if (!configuration.IsNull()) configuration+=" ";
+ configuration+=argument;
+ }
+
+ if (!configuration.IsNull()) {
+ iResult=Configure(configuration.Data());
+ } else {
+ iResult=Reconfigure(NULL, NULL);
+ }
+
+
+// while ( i < argc ) {
+// if (!strcmp( argv[i], "-apply-noisemap")) {
+// fApplyNoiseMap = strtoul( argv[i+1], &cpErr ,0);
+//
+// if ( *cpErr ) {
+// HLTError("Cannot convert apply-noisemap specifier '%s'.", argv[i+1]);
+// return EINVAL;
+// }
+// i+=2;
+// continue;
+// }
+//
+// if (!strcmp( argv[i], "-plot-side-a")) {
+// fPlotSideA = strtoul( argv[i+1], &cpErr ,0);
+//
+// if ( *cpErr ) {
+// HLTError("Cannot convert plot-side-a specifier '%s'.", argv[i+1]);
+// return EINVAL;
+// }
+// i+=2;
+// continue;
+// }
+//
+// if (!strcmp( argv[i], "-plot-side-c")) {
+// fPlotSideC = strtoul( argv[i+1], &cpErr ,0);
+//
+// if ( *cpErr ) {
+// HLTError("Cannot convert plot-side-c specifier '%s'.", argv[i+1]);
+// return EINVAL;
+// }
+// i+=2;
+// continue;
+// }
+//
+// if (!strcmp( argv[i], "-reset-histograms")) {
+// fResetHistograms = strtoul( argv[i+1], &cpErr ,0);
+//
+// if ( *cpErr ) {
+// HLTError("Cannot convert reset-histograms specifier '%s'.", argv[i+1]);
+// return EINVAL;
+// }
+// i+=2;
+// continue;
+// }
+//
+// Logging(kHLTLogError, "HLT::TPCNoiseMap::DoInit", "Unknown Option", "Unknown option '%s'", argv[i] );
+// return EINVAL;
+//
+// } // end while
+
+ return 0;
+} // end DoInit()
+
+int AliHLTTPCClusterConverterComponent::DoDeinit(){
+// see header file for class documentation
+ return 0;
+}
+
+int AliHLTTPCClusterConverterComponent::DoEvent(const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData){
+// see header file for class documentation
+
+ //Logging(kHLTLogDebug, "HLT::TPCClusterConverter::DoEvent", "DoEvent", "DoEvent()");
+ HLTInfo("--- Entering DoEvent() in TPCClusterConverter ---");
+
+ if(GetFirstInputBlock(kAliHLTDataTypeSOR) || GetFirstInputBlock(kAliHLTDataTypeEOR)) return 0;
+
+ Int_t numOfTotalTracks = 0;
+ Int_t numOfTotalSpacePoints = 0 ;
+ const AliHLTComponentBlockData *iter = NULL;
+
+
+ // ========== LOOP OVER CLUSTER DATA =====================//
+
+ for(iter = GetFirstInputBlock(AliHLTTPCDefinitions::fgkClustersDataType); iter != NULL; iter = GetNextInputBlock()){
+ //AliHLTUInt8_t slice = AliHLTTPCDefinitions::GetMinSliceNr( *iter );
+ //AliHLTUInt8_t patch = AliHLTTPCDefinitions::GetMinPatchNr( *iter );
+
+ const AliHLTTPCClusterData *clusterData = (const AliHLTTPCClusterData*)iter->fPtr;
+ numOfTotalSpacePoints+= (Int_t)clusterData->fSpacePointCnt;
+
+ AliHLTTPCSpacePointData *clusters = (AliHLTTPCSpacePointData*)clusterData->fSpacePoints;
+
+ for(Int_t i=0; i<(Int_t)clusterData->fSpacePointCnt; i++){ fClusters.push_back(clusters[i]); }
+ }
+
+
+
+
+// // ========== LOOP OVER TRACKS =====================//
+//
+// for(iter = GetFirstInputBlock(AliHLTTPCDefinitions::fgkTracksDataType); iter != NULL; iter = GetNextInputBlock()){
+// AliHLTUInt8_t slice = AliHLTTPCDefinitions::GetMinSliceNr( *iter );
+// AliHLTUInt8_t patch = AliHLTTPCDefinitions::GetMinPatchNr( *iter );
+//
+// const AliHLTTPCTrackletData* trackData = (const AliHLTTPCTrackletData*)iter->fPtr;
+// numOfTotalTracks += (Int_t)trackData->fTrackletCnt;
+//
+// AliHLTTPCTrackSegmentData *tracks = (AliHLTTPCTrackSegmentData*)trackData->fTracklets;
+//
+// for(int i=0;i<(Int_t)trackData->fTrackletCnt;i++){ fTracks.push_back(tracks[i]); }
+// }
+
+
+
+ // ========== LOOP OVER TRACK SEGMENTS =====================//
+
+ for(iter = GetFirstInputBlock(AliHLTTPCDefinitions::fgkTrackSegmentsDataType); iter != NULL; iter = GetNextInputBlock()){
+
+ HLTInfo("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
+ evtData.fEventID, evtData.fEventID,
+ DataType2Text(iter->fDataType).c_str(),
+ DataType2Text(AliHLTTPCDefinitions::fgkTrackSegmentsDataType | kAliHLTDataOriginTPC).c_str());
+
+ if(iter->fDataType == AliHLTTPCDefinitions::fgkTrackSegmentsDataType && GetEventCount()<2){
+ HLTWarning("data type %s is depricated, use %s (fgkTrackSegmentsDataType)!",
+ DataType2Text(AliHLTTPCDefinitions::fgkTrackSegmentsDataType).c_str(),
+ DataType2Text(AliHLTTPCDefinitions::fgkTrackSegmentsDataType | kAliHLTDataOriginTPC).c_str());
+ }
+
+ if(iter->fDataType != (AliHLTTPCDefinitions::fgkTrackSegmentsDataType | kAliHLTDataOriginTPC)) continue;
+
+ if(iter->fDataType!=AliHLTTPCDefinitions::fgkTrackSegmentsDataType){
+ HLTDebug("Data block type is not of type AliHLTTPCDefinitions::fgkTrackSegmentsDataType"); continue;
+ } // endif
+
+ const AliHLTTPCTrackletData *trackData = (const AliHLTTPCTrackletData*)iter->fPtr;
+ numOfTotalTracks += (Int_t)trackData->fTrackletCnt;
+
+ AliHLTTPCTrackSegmentData *tracks = (AliHLTTPCTrackSegmentData*)trackData->fTracklets;
+ for(Int_t i=0; i<(Int_t)trackData->fTrackletCnt; i++){ fTracks.push_back(tracks[i]); }
+
+ } // end of loop over track segments
+
+
+
+ // ========== TRIPLE LOOP FOR SETTING THE fUsed CLUSTERS =====================//
+
+ Int_t nClustersUsed = 0;
+ for(Int_t tr=0; tr<numOfTotalTracks; tr++){
+ Int_t nHits = fTracks[tr].fNPoints;
+ UInt_t *hitnum = fTracks[tr].fPointIDs;
+ //HLTInfo("Hits %d ", nHits);
+
+ for(Int_t h=0; h<nHits; h++){
+ UInt_t idTrack = hitnum[h];
+ Int_t sliceTrack = (idTrack>>25) & 0x7f;
+ Int_t partitionTrack = (idTrack>>22) & 0x7;
+ UInt_t posTrack = idTrack&0x3fffff;
+
+ fOffArray->Clear();
+ for(Int_t cl=0; cl<numOfTotalSpacePoints; cl++){
+ UInt_t idCluster = fClusters[cl].fID;
+ Int_t sliceCluster = (idCluster>>25) & 0x7f;
+ Int_t partitionCluster = (idCluster>>22) & 0x7;
+ UInt_t posCluster = idCluster&0x3fffff;
+
+
+ if(sliceCluster==sliceTrack && partitionCluster==partitionTrack && posCluster==posTrack){
+ fClusters[cl].fUsed = kTRUE;
+ fClusters[cl].fTrackN = tr;
+ nClustersUsed++;
+ fOffArray->Add(new AliHLTTPCOfflineCluster(fClusters[cl]));
+ } // end if
+ } // end for clusters
+ PushBack((TObject*)fOffArray, kAliHLTDataTypeTObject, 0);
+ } // end for hits
+ } // end for loop over track segments
+ return 0;
+} // end DoEvent()
+
+int AliHLTTPCClusterConverterComponent::Configure(const char* arguments){
+// see header file for class documentation
+
+ int iResult=0;
+ if (!arguments) return iResult;
+ HLTInfo("parsing configuration string \'%s\'", arguments);
+
+ TString allArgs=arguments;
+ TString argument;
+ int bMissingParam=0;
+
+ TObjArray* pTokens = allArgs.Tokenize(" ");
+ if (pTokens) {
+ for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) {
+ argument=((TObjString*)pTokens->At(i))->GetString();
+ if (argument.IsNull()) continue;
+
+ if (argument.CompareTo("-apply-noisemap")==0) {
+ if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
+ HLTInfo("got \'-apply-noisemap\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
+
+ }
+ else if (argument.CompareTo("-plot-side-c")==0) {
+ if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
+ HLTInfo("got \'-plot-side-c\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
+
+ }
+ else if (argument.CompareTo("-plot-side-a")==0) {
+ if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
+ HLTInfo("got \'-plot-side-a\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
+
+ }
+ else {
+ HLTError("unknown argument %s", argument.Data());
+ iResult=-EINVAL;
+ break;
+ }
+ } // end for
+
+ delete pTokens;
+
+ } // end if pTokens
+
+ if (bMissingParam) {
+ HLTError("missing parameter for argument %s", argument.Data());
+ iResult=-EINVAL;
+ }
+ return iResult;
+}
+
+int AliHLTTPCClusterConverterComponent::Reconfigure(const char* cdbEntry, const char* chainId){
+// see header file for class documentation
+
+ int iResult=0;
+ const char* path="HLT/ConfigTPC/ClusterConverterComponent";
+ const char* defaultNotify="";
+ if (cdbEntry) {
+ path=cdbEntry;
+ defaultNotify=" (default)";
+ }
+ if (path) {
+ HLTInfo("reconfigure from entry %s%s, chain id %s", path, defaultNotify,(chainId!=NULL && chainId[0]!=0)?chainId:"<none>");
+ AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/);
+ if (pEntry) {
+ TObjString* pString=dynamic_cast<TObjString*>(pEntry->GetObject());
+ if (pString) {
+ HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data());
+ iResult=Configure(pString->GetString().Data());
+ } else {
+ HLTError("configuration object \"%s\" has wrong type, required TObjString", path);
+ }
+ } else {
+ HLTError("can not fetch object \"%s\" from CDB", path);
+ }
+ }
+
+ return iResult;
+ }
--- /dev/null
+// XEmacs -*-C++-*-
+// $Id$
+
+#ifndef ALIHLTTPCCLUSTERCONVERTERCOMPONENT_H
+#define ALIHLTTPCCLUSTERCONVERTERCOMPONENT_H
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* See cxx source for full Copyright notice *
+
+/** @file AliHLTTPCClusterConverterComponent.h
+ @author Kalliopi Kanaki
+ @date
+ @brief The TPC cluster format conversion component.
+*/
+
+#include "AliHLTProcessor.h"
+
+class AliHLTTPCSpacePointData;
+class AliHLTTPCTrackSegmentData;
+class TObjArray;
+
+/**
+ * @class AliHLTTPCClusterConverterComponent
+ * The TPC cluster format conversion component
+ *
+ * The purpose of the component is publishing the
+ * USED clusters of the tracks, translating them to
+ * the offline format. For this reason, it subscribes
+ * to the cluster finder, the slice tracker and the
+ * global merger.
+ *
+ * @ingroup alihlt_tpc_components
+ */
+
+class AliHLTTPCClusterConverterComponent : public AliHLTProcessor{
+
+public:
+ /** default constructor */
+ AliHLTTPCClusterConverterComponent();
+ /** destructor */
+ virtual ~AliHLTTPCClusterConverterComponent();
+
+ // Public functions to implement AliHLTComponent's interface.
+ // These functions are required for the registration process
+
+ /** interface function, see @ref AliHLTComponent for description */
+ const char* GetComponentID();
+ /** interface function, see @ref AliHLTComponent for description */
+ void GetInputDataTypes(AliHLTComponentDataTypeList& list);
+ /** interface function, see @ref AliHLTComponent for description */
+ AliHLTComponentDataType GetOutputDataType();
+ /** interface function, see @ref AliHLTComponent for description */
+ int GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList);
+ /** interface function, see @ref AliHLTComponent for description */
+ virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
+ /** interface function, see @ref AliHLTComponent for description */
+ AliHLTComponent* Spawn();
+
+protected:
+
+ /** interface function, see @ref AliHLTComponent for description */
+ int DoInit( int argc, const char** argv );
+ /** interface function, see @ref AliHLTComponent for description */
+ int DoDeinit();
+ /** interface function, see @ref AliHLTComponent for description */
+ int DoEvent(const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& trigData);
+
+ int Reconfigure(const char* cdbEntry, const char* chainId);
+
+ using AliHLTProcessor::DoEvent;
+
+private:
+ /** copy constructor prohibited */
+ AliHLTTPCClusterConverterComponent(const AliHLTTPCClusterConverterComponent&);
+ /** assignment operator prohibited */
+ AliHLTTPCClusterConverterComponent& operator=(const AliHLTTPCClusterConverterComponent&);
+ /**
+ * Configure the component.
+ * Parse a string for the configuration arguments and set the component
+ * properties.
+ */
+ int Configure(const char* arguments);
+
+ vector<AliHLTTPCSpacePointData> fClusters; //! transient
+ vector<AliHLTTPCTrackSegmentData> fTracks; //!transient
+ TObjArray *fOffArray; //!transient
+
+ ClassDef(AliHLTTPCClusterConverterComponent, 0);
+
+};
+#endif
--- /dev/null
+// $Id$
+
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* *
+//* Primary Authors: Kalliopi Kanaki <Kalliopi.Kanaki@ift.uib.no> *
+//* 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 AliHLTTPCHistogramHandlerComponent.cxx
+ @author Kalliopi Kanaki
+ @date
+ @brief The Histogram Handler component
+*/
+
+#if __GNUC__>= 3
+using namespace std;
+#endif
+#include "AliHLTTPCHistogramHandlerComponent.h"
+#include "AliHLTTPCDefinitions.h"
+#include "AliCDBEntry.h"
+#include "AliCDBManager.h"
+
+#include <cstdlib>
+#include <cerrno>
+#include "TString.h"
+#include "TFile.h"
+#include "TObjArray.h"
+#include "TObjString.h"
+#include <sys/time.h>
+#include "TH1.h"
+#include "TH2.h"
+#include "TLine.h"
+#include "TMath.h"
+
+
+AliHLTTPCHistogramHandlerComponent gAliHLTTPCHistogramHandlerComponent;
+
+ClassImp(AliHLTTPCHistogramHandlerComponent) //ROOT macro for the implementation of ROOT specific class methods
+
+AliHLTTPCHistogramHandlerComponent::AliHLTTPCHistogramHandlerComponent()
+ :
+ fNoiseHistograms(0),
+ fKryptonHistograms(0),
+ fSpecificationTPCA(0),
+ fSpecificationTPCC(0),
+ fSlice(-99),
+ fHistTH1Tmp(NULL),
+ fHistTH2Tmp(NULL),
+ fHistTPCSideA(NULL),
+ fHistTPCSideC(NULL)
+{
+ // see header file for class documentation
+ // or
+ // refer to README to build package
+ // or
+ // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+}
+
+AliHLTTPCHistogramHandlerComponent::~AliHLTTPCHistogramHandlerComponent() {
+// see header file for class documentation
+
+}
+
+// Public functions to implement AliHLTComponent's interface.
+// These functions are required for the registration process
+
+const char* AliHLTTPCHistogramHandlerComponent::GetComponentID() {
+// see header file for class documentation
+
+ return "TPCHistogramHandler";
+}
+
+void AliHLTTPCHistogramHandlerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list) {
+// see header file for class documentation
+
+ list.clear();
+ list.push_back( kAliHLTDataTypeHistogram );
+}
+
+AliHLTComponentDataType AliHLTTPCHistogramHandlerComponent::GetOutputDataType() {
+// see header file for class documentation
+
+ return kAliHLTDataTypeHistogram;
+}
+
+int AliHLTTPCHistogramHandlerComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList) {
+// see header file for class documentation
+
+ tgtList.clear();
+ tgtList.push_back(kAliHLTDataTypeHistogram);
+ return tgtList.size();
+}
+
+void AliHLTTPCHistogramHandlerComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) {
+// see header file for class documentation
+
+ constBase=0;
+ inputMultiplier=2.0;
+}
+
+AliHLTComponent* AliHLTTPCHistogramHandlerComponent::Spawn() {
+// see header file for class documentation
+
+ return new AliHLTTPCHistogramHandlerComponent();
+}
+
+int AliHLTTPCHistogramHandlerComponent::DoInit( int argc, const char** argv ) {
+// see header file for class documentation
+
+ Int_t i = 0;
+ Char_t* cpErr;
+
+ int iResult=0;
+
+ TString configuration="";
+ TString argument="";
+ for (int i=0; i<argc && iResult>=0; i++) {
+
+ argument=argv[i];
+ if (!configuration.IsNull()) configuration+=" ";
+ configuration+=argument;
+ }
+
+ if (!configuration.IsNull()) {
+ iResult=Configure(configuration.Data());
+ } else {
+ iResult=Reconfigure(NULL, NULL);
+ }
+
+
+ while ( i < argc ) {
+ if (!strcmp( argv[i], "-sum-noise-histograms")) {
+ fNoiseHistograms = strtoul( argv[i+1], &cpErr ,0);
+
+ if ( *cpErr ) {
+ HLTError("Cannot convert sum-noise-histograms specifier '%s'.", argv[i+1]);
+ return EINVAL;
+ }
+ i+=2;
+ continue;
+ }
+
+ if (!strcmp( argv[i], "-sum-krypton-histograms")) {
+ fKryptonHistograms = strtoul( argv[i+1], &cpErr ,0);
+
+ if ( *cpErr ) {
+ HLTError("Cannot convert sum-krypton-histograms specifier '%s'.", argv[i+1]);
+ return EINVAL;
+ }
+ i+=2;
+ continue;
+ }
+
+ Logging(kHLTLogError, "HLT::TPCHistogramHandler::DoInit", "Unknown Option", "Unknown option '%s'", argv[i] );
+ return EINVAL;
+
+ } // end while
+
+ return 0;
+} // end DoInit()
+
+int AliHLTTPCHistogramHandlerComponent::DoDeinit() {
+// see header file for class documentation
+
+ return 0;
+}
+
+int AliHLTTPCHistogramHandlerComponent::DoEvent(const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData){
+// see header file for class documentation
+
+ HLTInfo("--- Entering DoEvent() in TPCHistogramHandler ---");
+
+ if(GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR )) return 0;
+
+ fHistTH2Tmp = new TH2F("fHistTH2Tmp","fHistTH2Tmp",250,-250,250,250,-250,250);
+ fHistTPCSideA = new TH2F("fHistTPCSideA","TPC side A (max signal)",250,-250,250,250,-250,250);
+ fHistTPCSideA->SetXTitle("global X (cm)"); fHistTPCSideA->SetYTitle("global Y (cm)");
+ fHistTPCSideC = new TH2F("fHistTPCSideC","TPC side C (max signal)",250,-250,250,250,-250,250);
+ fHistTPCSideC->SetXTitle("global X (cm)"); fHistTPCSideC->SetYTitle("global Y (cm)");
+
+ const TObject *iter = NULL;
+
+ for(iter = GetFirstInputObject(kAliHLTDataTypeHistogram|kAliHLTDataOriginTPC); iter != NULL; iter = GetNextInputObject()){
+
+ HLTInfo("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
+ evtData.fEventID, evtData.fEventID,
+ DataType2Text(GetDataType(iter)).c_str(),
+ DataType2Text(kAliHLTDataTypeHistogram | kAliHLTDataOriginTPC).c_str());
+
+ if (GetDataType(iter) == (kAliHLTDataTypeHistogram | kAliHLTDataOriginTPC) && GetEventCount()<2){
+ HLTWarning("data type %s is depricated, use %s (kAliHLTDataTypeHistogram)!",
+ DataType2Text(kAliHLTDataTypeHistogram).c_str(),
+ DataType2Text(kAliHLTDataTypeHistogram | kAliHLTDataOriginTPC).c_str());
+ }
+
+ if (GetDataType(iter) != (kAliHLTDataTypeHistogram | kAliHLTDataOriginTPC)) continue;
+
+ // Summing the output histograms of the TPCNoiseMapComponent (from partition to TPC sides)
+ if(fNoiseHistograms){
+
+ fHistTH2Tmp = (TH2F*)iter;
+ UInt_t minSlice = AliHLTTPCDefinitions::GetMinSliceNr(GetSpecification(iter));
+ UInt_t maxSlice = AliHLTTPCDefinitions::GetMaxSliceNr(GetSpecification(iter));
+ UInt_t minPartition = AliHLTTPCDefinitions::GetMinPatchNr(GetSpecification(iter));
+ UInt_t maxPartition = AliHLTTPCDefinitions::GetMaxPatchNr(GetSpecification(iter));
+
+ if((minSlice!=maxSlice) || (minPartition!=maxPartition)){
+ HLTWarning("TPCHistogramHandler::The Noise Map component is not running on partition level!");
+ }
+
+ if(minSlice<18) fHistTPCSideA->Add(fHistTPCSideA,fHistTH2Tmp,1,1);
+ else fHistTPCSideC->Add(fHistTPCSideC,fHistTH2Tmp,1,1);
+ // minSlice=maxSlice, when the Noise Map component runs on partition level (as it should)
+
+ fSpecificationTPCA = AliHLTTPCDefinitions::EncodeDataSpecification( 17, 0, 5, 0 );
+ fSpecificationTPCC = AliHLTTPCDefinitions::EncodeDataSpecification( 35, 18, 5, 0 );
+
+ } // endif fNoiseHistograms==kTRUE
+
+
+// Summing the output of TPCKryptonClusterFinderComponent
+// if(fKryptonHistograms){
+//
+// } //endif fKryptonHistograms==kTRUE
+ } // end for loop over histogram blocks
+
+ MakeHistosPublic();
+
+ return 0;
+} // end DoEvent()
+
+void AliHLTTPCHistogramHandlerComponent::MakeHistosPublic() {
+// see header file for class documentation
+
+
+ if(fNoiseHistograms){
+ PushBack( (TObject*) fHistTPCSideA, kAliHLTDataTypeHistogram, fSpecificationTPCA);
+ PushBack( (TObject*) fHistTPCSideC, kAliHLTDataTypeHistogram, fSpecificationTPCC);
+ delete fHistTH2Tmp;
+ delete fHistTPCSideA;
+ delete fHistTPCSideC;
+ }
+
+// TObjArray histos;
+
+// if(fPlotSideA) histos.Add(fHistSideA);
+// if(fPlotSideC) histos.Add(fHistSideC);
+// if(fApplyNoiseMap) histos.Add(fHistCDBMap);
+//
+// TIter iterator(&histos);
+// while(TObject *pObj=iterator.Next()){
+//
+// PushBack(pObj, kAliHLTDataTypeHistogram|kAliHLTDataOriginTPC, fSpecification);
+// }
+//
+//
+// //PushBack( (TObject*) &histos, kAliHLTDataTypeHistogram, fSpecification);
+}
+
+int AliHLTTPCHistogramHandlerComponent::Configure(const char* arguments) {
+// see header file for class documentation
+
+ int iResult=0;
+ if (!arguments) return iResult;
+ HLTInfo("parsing configuration string \'%s\'", arguments);
+
+ TString allArgs=arguments;
+ TString argument;
+ int bMissingParam=0;
+
+ TObjArray* pTokens=allArgs.Tokenize(" ");
+ if (pTokens) {
+ for (int i=0; i<pTokens->GetEntries() && iResult>=0; i++) {
+ argument=((TObjString*)pTokens->At(i))->GetString();
+ if (argument.IsNull()) continue;
+
+ if (argument.CompareTo("-sum-noise-histograms")==0) {
+ if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
+ HLTInfo("got \'-sum-noise-histograms\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
+
+ } else if (argument.CompareTo("-sum-krypton-histograms")==0) {
+ if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
+ HLTInfo("got \'-sum-krypton-histograms\': %s", ((TObjString*)pTokens->At(i))->GetString().Data());
+
+ }
+ else {
+ HLTError("unknown argument %s", argument.Data());
+ iResult=-EINVAL;
+ break;
+ }
+ } // end for
+
+ delete pTokens;
+
+ } // end if pTokens
+
+ if (bMissingParam) {
+ HLTError("missing parameter for argument %s", argument.Data());
+ iResult=-EINVAL;
+ }
+ return iResult;
+}
+
+int AliHLTTPCHistogramHandlerComponent::Reconfigure(const char* cdbEntry, const char* chainId) {
+// see header file for class documentation
+
+ int iResult=0;
+ const char* path="HLT/ConfigTPC/TPCHistogramHandlerComponent";
+ const char* defaultNotify="";
+ if (cdbEntry) {
+ path=cdbEntry;
+ defaultNotify=" (default)";
+ }
+
+ if (path) {
+ HLTInfo("reconfigure from entry %s%s, chain id %s", path, defaultNotify,(chainId!=NULL && chainId[0]!=0)?chainId:"<none>");
+ AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/);
+ if (pEntry) {
+ TObjString* pString=dynamic_cast<TObjString*>(pEntry->GetObject());
+ if (pString) {
+ HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data());
+ iResult=Configure(pString->GetString().Data());
+ } else {
+ HLTError("configuration object \"%s\" has wrong type, required TObjString", path);
+ }
+ } else {
+ HLTError("cannot fetch object \"%s\" from CDB", path);
+ }
+ }
+ return iResult;
+}
--- /dev/null
+// -*- Mode: C++ -*-
+// $Id$
+
+#ifndef ALIHLTTPCHISTOGRAMHANDLERCOMPONENT_H
+#define ALIHLTTPCHISTOGRAMHANDLERCOMPONENT_H
+
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* See cxx source for full Copyright notice *
+
+/** @file AliHLTTPCHistogramHandlerComponent.h
+ @author Kalliopi Kanaki
+ @date
+ @brief Component for acting upon histograms
+*/
+
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#include "AliHLTProcessor.h"
+
+class TH1;
+class TH2;
+
+/**
+ * @class AliHLTTPCHistogramHandlerComponent
+ * Implementation of the component to read histograms from other
+ * components and add, divide etc.
+ * The component implements the interface methods of the @ref AliHLTProcessor.
+ *
+ * The component has the following component arguments:
+ *
+ * -sum-noise-histograms Loops over the output of TPCNoiseMap and adds the histograms
+ *
+ * It loops over histogram input and sums up the TPC histograms per side (at the moment).
+ *
+ * @ingroup alihlt_tpc
+ */
+class AliHLTTPCHistogramHandlerComponent : public AliHLTProcessor {
+
+ public:
+
+ /** standard constructor */
+ AliHLTTPCHistogramHandlerComponent();
+ /** destructor */
+ virtual ~AliHLTTPCHistogramHandlerComponent();
+
+ // Public functions to implement AliHLTComponent's interface.
+ // These functions are required for the registration process
+
+ /** interface function, see @ref AliHLTComponent for description */
+ const char* GetComponentID();
+ /** interface function, see @ref AliHLTComponent for description */
+ void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
+ /** interface function, see @ref AliHLTComponent for description */
+ AliHLTComponentDataType GetOutputDataType();
+ /** interface function, see @ref AliHLTComponent for description */
+ int GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList);
+ /** interface function, see @ref AliHLTComponent for description */
+ virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
+ /** interface function, see @ref AliHLTComponent for description */
+ AliHLTComponent* Spawn();
+ /** function for acting on the saving and cleaning histograms, after they are filled */
+ void MakeHistosPublic();
+
+ protected:
+
+ // Protected functions to implement AliHLTComponent's interface.
+ // These functions provide initialization as well as the actual processing capabilities of the component.
+
+ int DoInit( int argc, const char** argv );
+ int DoDeinit();
+ int DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData );
+ int Reconfigure(const char* cdbEntry, const char* chainId);
+
+ using AliHLTProcessor::DoEvent;
+
+ private:
+
+ int Configure(const char* arguments);
+
+ /** copy constructor prohibited */
+ AliHLTTPCHistogramHandlerComponent(const AliHLTTPCHistogramHandlerComponent&);
+
+ /** assignment operator prohibited */
+ AliHLTTPCHistogramHandlerComponent& operator=(const AliHLTTPCHistogramHandlerComponent&);
+
+ /** the reader object for data decoding */
+ AliHLTUInt32_t fSpecification; //!transient
+
+
+ Bool_t fNoiseHistograms; //!transient
+ Bool_t fKryptonHistograms; //!transient
+
+ AliHLTUInt32_t fSpecificationTPCA; //!transient
+ AliHLTUInt32_t fSpecificationTPCC; //!transient
+
+ Int_t fSlice; //!transient
+
+ TH1 *fHistTH1Tmp; //!transient
+ TH2 *fHistTH2Tmp; //!transient
+ TH2 *fHistTPCSideA; //!transient
+ TH2 *fHistTPCSideC; //!transient
+
+
+ ClassDef(AliHLTTPCHistogramHandlerComponent, 0)
+ };
+
+#endif
--- /dev/null
+// $Id$
+
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* *
+//* Primary Authors: Kalliopi Kanaki<Kalliopi.Kanaki@ift.uib.no> *
+//* 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 AliHLTTPCOfflineCluster.cxx
+ @author Kalliopi Kanaki
+ @date
+ @brief Cluster converter from offline to HLT format and back
+*/
+
+#include "AliHLTTPCOfflineCluster.h"
+#include "AliHLTTPCTransform.h"
+#include "TObjArray.h"
+#include <sys/time.h>
+
+#if __GNUC__ >= 3
+using namespace std;
+#endif
+
+ClassImp(AliHLTTPCOfflineCluster)
+
+AliHLTTPCOfflineCluster::AliHLTTPCOfflineCluster()
+{
+//constructor
+}
+
+AliHLTTPCOfflineCluster::AliHLTTPCOfflineCluster(const AliHLTTPCSpacePointData& hltCluster){
+
+}
+
+AliHLTTPCOfflineCluster::AliHLTTPCOfflineCluster(const AliTPCclusterMI& offCluster){
+
+}
+
+AliHLTTPCOfflineCluster& AliHLTTPCOfflineCluster::operator=(const AliTPCclusterMI& offCluster){
+
+}
+
+AliHLTTPCOfflineCluster::~AliHLTTPCOfflineCluster(){
+
+
+ //destructor
+}
+
+AliTPCclusterMI* AliHLTTPCOfflineCluster::ConvertHLTToOffline(AliHLTTPCSpacePointData spacePoint){
+
+ AliTPCclusterMI *offCluster = new AliTPCclusterMI();
+
+ offCluster->SetPad(spacePoint.fX); // pad
+ offCluster->SetRow((Int_t)spacePoint.fPadRow); // row
+ offCluster->SetTimeBin(spacePoint.fZ); // time bin
+ offCluster->SetQ(spacePoint.fCharge); // charge
+ offCluster->SetMax(spacePoint.fMaxQ); // max Q (amplitude)
+ offCluster->SetDetector(0); // detector/slice
+ offCluster->SetType(0); // default from constructor
+ offCluster->IsUsed(0); // default from constructor
+ offCluster->SetInfo(NULL); // default from constructor
+
+ return offCluster;
+ delete offCluster;
+
+}
+
+
+AliHLTTPCSpacePointData AliHLTTPCOfflineCluster::ConvertOfflineToHLT(AliTPCclusterMI *offCluster){
+
+
+ AliHLTTPCSpacePointData spacePoint = { 0.,0.,0.,0,0,0.,0.,0,0,kFALSE,0 };
+
+ spacePoint.fX = offCluster->GetPad();
+ spacePoint.fPadRow = offCluster->GetRow();
+ spacePoint.fZ = offCluster->GetTimeBin();
+ spacePoint.fCharge = offCluster->GetQ();
+ spacePoint.fMaxQ = offCluster->GetMax();
+
+ return spacePoint;
+
+}
--- /dev/null
+// XEmacs -*-C++-*-
+// $Id$
+
+#ifndef AliHLTTPC_OFFLINECLUSTER_H
+#define AliHLTTPC_OFFLINECLUSTER_H
+
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* See cxx source for full Copyright notice *
+
+/** @file AliHLTTPCOfflineCluster.h
+ @author Kalliopi Kanaki
+ @brief Conversion of HLT cluster format to offline format and back
+*/
+
+#include "AliHLTLogging.h"
+
+#include "AliTPCclusterMI.h"
+#include "AliHLTTPCClusterDataFormat.h"
+#include "AliHLTTPCSpacePointData.h"
+
+
+/**
+ * @class AliHLTTPCOfflineCluster
+ *
+ * The conversion of HLT cluster format to offline one
+ *
+ * The conversion takes place cluster per cluster. The array
+ * with the offline clusters is filled in the respective
+ * conversion component (AliHLTTPCClusterConverter).
+ * The same is valid for the transformation of the cluster
+ * coordinates. This class only translates from the AliHLTTPCSpacePoint
+ * data struct to the offline AliTPCclusterMI class.
+ *
+ */
+
+class AliHLTTPCOfflineCluster : public AliTPCclusterMI {
+
+ public:
+
+ /** standard constructor */
+ AliHLTTPCOfflineCluster();
+ /** overloading the constructor */
+ AliHLTTPCOfflineCluster(const AliHLTTPCSpacePointData& hltCluster);
+ AliHLTTPCOfflineCluster(const AliTPCclusterMI& offCluster);
+ /** assignment operator */
+ AliHLTTPCOfflineCluster& operator=(const AliTPCclusterMI& offCluster);
+ /** destructor */
+ virtual ~AliHLTTPCOfflineCluster();
+
+ AliTPCclusterMI* ConvertHLTToOffline(AliHLTTPCSpacePointData spacePoint);
+ AliHLTTPCSpacePointData ConvertOfflineToHLT(AliTPCclusterMI *offCluster);
+
+ ClassDef(AliHLTTPCOfflineCluster,0)
+};
+#endif
--- /dev/null
+// $Id$
+
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project *
+ * ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Primary Authors: Kalliopi Kanaki <Kalliopi.Kanaki@ift.uib.no> *
+ * 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 testAliHLTTPCOfflineCluster.C
+ @author Kalliopi Kanaki
+ @date
+ @brief Test macro/program for the AliHLTTPCOfflineCluster class
+ */
+
+#ifndef __CINT__
+#include "TSystem.h"
+
+#include "AliHLTTPCTransform.h"
+#include "AliHLTTPCClusterData.h"
+#include "AliHLTTPCSpacePointData.h"
+#include "AliHLTTPCOfflineCluster.h"
+#include "TObjArray.h"
+
+#include <ostream>
+#include <istream>
+#endif //__CINT__
+
+using namespace std;
+
+/////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////
+//
+// configuration of the test program
+//
+/////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////
+
+
+
+#include "/scratch/prog/HLT/TPCLib/AliHLTTPCSpacePointData.h";
+
+int testAliHLTTPCOfflineCluster(){
+//#ifdef __CINT__
+ //gSystem->Load("libAliHLTUtil.so");
+ gSystem->Load("libAliHLTTPC.so");
+//#endif
+
+ int iResult=0;
+
+
+
+
+
+ AliHLTTPCSpacePointData spacePoint1 = { 5.,3.,2.,7,8,11.2,5.4.,1,0,kFALSE,0 };
+
+// AliHLTTPCSpacePointData *spacePoint = new AliHLTTPCSpacePointData(); //[1];
+// spacePoint->fX = 3.;
+// spacePoint->fY = 2.;
+// spacePoint->fZ = 5.;
+
+ cout << "hlt X: " << spacePoint1.fX << endl;
+ cout << "hlt padrow: " << (Int_t)spacePoint1.fPadRow << endl;
+ cout << "hlt Z: " << spacePoint1.fZ << endl;
+
+
+ //Float_t xyz[3] = {spacePoint1.fX , spacePoint1.fPadRow, spacePoint1.fZ };
+ //AliHLTTPCTransform::Local2Global(xyz,36);
+ //cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << endl;
+
+ AliTPCclusterMI *offCl1 = new AliTPCclusterMI();
+ AliHLTTPCOfflineCluster *p1 = new AliHLTTPCOfflineCluster();
+
+ offCl1 = p1->ConvertHLTToOffline(spacePoint1);
+ //offCl1 = new AliHLTTPCOfflineCluster(spacePoint1); // ??? to be tested
+
+ cout << "off pad: " << offCl1->GetPad() << endl;
+ cout << "off row: " << offCl1->GetRow() << endl;
+ cout << "off time bin: " << offCl1->GetTimeBin() << endl;
+
+ cout << "================================" << endl;
+
+ AliTPCclusterMI *offCl2 = new AliTPCclusterMI();
+ offCl2->SetPad(2.5);
+ offCl2->SetRow(4);
+
+ cout << "off pad: " << offCl2->GetPad() << endl;
+ cout << "off row: " << offCl2->GetRow() << endl;
+
+ AliHLTTPCOfflineCluster *p2 = new AliHLTTPCOfflineCluster();
+ AliHLTTPCSpacePointData spacePoint2 = p2->ConvertOfflineToHLT(offCl2);
+
+ cout << "hlt X: " << spacePoint2.fX << endl;
+ cout << "hlt padrow: " << (Int_t)spacePoint2.fPadRow << endl;
+
+ return iResult;
+ //delete [] spacePoint;
+
+}
+
+int main(int /*argc*/, const char** /*argv*/){
+
+ return testAliHLTTPCOfflineCluster();
+}
offline/AliHLTTPCDigitPublisherComponent.h \
offline/AliHLTTPCOfflineClustererComponent.h \
offline/AliHLTTPCOfflineTrackerComponent.h \
+ offline/AliHLTTPCOfflineCluster.h \
AliHLTTPCClusters.h \
AliHLTTPCConfMapFit.h \
AliHLTTPCConfMapTrack.h \
AliHLTTPCSliceTrackerComponent.h \
AliHLTTPCGlobalMergerComponent.h \
AliHLTTPCEsdWriterComponent.h \
+ AliHLTTPCHistogramHandlerComponent.h \
+ AliHLTTPCClusterConverterComponent.h \
tracking-ca/AliHLTTPCCACell.h \
tracking-ca/AliHLTTPCCADisplay.h \
tracking-ca/AliHLTTPCCAHit.h \