<commit_before>// $Id$

//**************************************************************************
//* This file is property of and copyright by the                          * 
//* ALICE Experiment at CERN, All rights reserved.                         *
//*                                                                        *
//* Primary Authors: <NAME> <<EMAIL>>        *
//*                                                                        *
//* 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   AliHLTTPCAgent.cxx
//  @author <NAME>
//  @date   
//  @brief  Agent of the libAliHLTTPC library
//  @note   

#include "AliHLTTPCAgent.h"
#include "AliHLTTPCDefinitions.h"
#include "AliHLTOUT.h"
#include "AliHLTOUTHandlerChain.h"
#include "AliHLTMisc.h"
#include "AliRunLoader.h"
#include "AliCDBManager.h"
#include "AliCDBEntry.h"
#include "AliTPCParam.h"
#include "AliTPCRecoParam.h"
#include "AliDAQ.h"
#include "TObject.h"
#include "AliHLTPluginBase.h"
#include "AliHLTSystem.h"

/** global instance for agent registration */
AliHLTTPCAgent gAliHLTTPCAgent;

// component headers
#include "AliHLTTPCCAInputDataCompressorComponent.h"
#include "AliHLTTPCCATrackerComponent.h"
#include "AliHLTTPCCATrackerOutputConverter.h"
#include "AliHLTTPCTrackMCMarkerComponent.h"
#include "AliHLTTPCCAGlobalMergerComponent.h"
#include "AliHLTTPCdEdxComponent.h"
#include "AliHLTTPCdEdxMonitoringComponent.h"
#include "AliHLTTPCClusterFinderComponent.h"
#include "AliHLTTPCDigitPublisherComponent.h"
#include "AliHLTTPCDigitDumpComponent.h"
#include "AliHLTTPCClusterDumpComponent.h"
#include "AliHLTTPCClusterHistoComponent.h"
#include "AliHLTTPCHistogramHandlerComponent.h"
#include "AliHLTTPCTrackHistoComponent.h"
#include "AliHLTTPCHWCFDataReverterComponent.h"
#include "AliHLTTPCCFComparisonComponent.h"
#include "AliHLTTPCDataCheckerComponent.h"
#include "AliHLTTPCHWCFEmulatorComponent.h"
#include "AliHLTTPCHWCFConsistencyControlComponent.h"
#include "AliHLTTPCDataCompressionComponent.h"
#include "AliHLTTPCDataCompressionMonitorComponent.h"
#include "AliHLTTPCDataCompressionFilterComponent.h"
#include "AliHLTTPCDataPublisherComponent.h"
#include "AliHLTTPCHWClusterDecoderComponent.h"
#include "AliHLTTPCClusterTransformationComponent.h"
#include "AliHLTTPCClusterTransformationPrepareComponent.h"
#include "AliHLTTPCOfflinePreprocessorWrapperComponent.h"

/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTTPCAgent)

AliHLTTPCAgent::AliHLTTPCAgent()
  : AliHLTModuleAgent("TPC")
  , fRawDataHandler(NULL)
  , fTracksegsDataHandler(NULL)
  , fClustersDataHandler(NULL)
  , fCompressionMonitorHandler(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
}

AliHLTTPCAgent::~AliHLTTPCAgent()
{
  // see header file for class documentation
}

UInt_t AliHLTTPCAgent::GetDetectorMask() const
{
  return AliDAQ::kTPC;
}

int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
					 AliRawReader* rawReader,
					 AliRunLoader* runloader) const
{
  // see header file for class documentation
  if (handler) {
    // AliSimulation: use the AliRawReaderPublisher if the raw reader is available
    // AliReconstruction: indicated by runloader==NULL, run always on raw data
    bool bPublishRaw=rawReader!=NULL || runloader==NULL;

    AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance();
    int tpcInputMode = 0;
    if( pHLT ){
      TString hltoptions = pHLT->GetConfigurationString();
      TObjArray* pTokens=hltoptions.Tokenize(" ");
      if( pTokens ){
	int iEntries=pTokens->GetEntriesFast();
	for (int i=0; i<iEntries; i++) {
	  if (!pTokens->At(i)) continue;
	  TString token = pTokens->At(i)->GetName();
	  if (token.Contains("TPC-input=")) {
	    TString param=token.ReplaceAll("TPC-input=", "");
	    if (param == "default") {
	      tpcInputMode = 0;
	    } else if (param == "raw") {
	      tpcInputMode = 1;
	    } else if (param == "compressed") {
	      tpcInputMode = 2;
	    } else {
	      HLTWarning("wrong parameter \'%s\' for option \'TPC-input=\', expected \'default\'/\'raw\'/\'compressed\'",param.Data() );
	    }
	  }
	}
	delete pTokens;
      }
    }

    // This the tracking configuration for the full TPC
    // - 216 clusterfinders (1 per partition)
    // - 36 slice trackers
    // - one global merger
    // - the esd converter
    // The ESD is shipped embedded into a TTree
    int iMinSlice=0; <commit_msg>temporary suppress new option to run HLT on compressed clusters, because it produces duplicated cluster blocks in HLTOut<commit_after>// $Id$

//**************************************************************************
//* This file is property of and copyright by the                          * 
//* ALICE Experiment at CERN, All rights reserved.                         *
//*                                                                        *
//* Primary Authors: <NAME> <<EMAIL>>        *
//*                                                                        *
//* 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   AliHLTTPCAgent.cxx
//  @author <NAME>
//  @date   
//  @brief  Agent of the libAliHLTTPC library
//  @note   

#include "AliHLTTPCAgent.h"
#include "AliHLTTPCDefinitions.h"
#include "AliHLTOUT.h"
#include "AliHLTOUTHandlerChain.h"
#include "AliHLTMisc.h"
#include "AliRunLoader.h"
#include "AliCDBManager.h"
#include "AliCDBEntry.h"
#include "AliTPCParam.h"
#include "AliTPCRecoParam.h"
#include "AliDAQ.h"
#include "TObject.h"
#include "AliHLTPluginBase.h"
#include "AliHLTSystem.h"

/** global instance for agent registration */
AliHLTTPCAgent gAliHLTTPCAgent;

// component headers
#include "AliHLTTPCCAInputDataCompressorComponent.h"
#include "AliHLTTPCCATrackerComponent.h"
#include "AliHLTTPCCATrackerOutputConverter.h"
#include "AliHLTTPCTrackMCMarkerComponent.h"
#include "AliHLTTPCCAGlobalMergerComponent.h"
#include "AliHLTTPCdEdxComponent.h"
#include "AliHLTTPCdEdxMonitoringComponent.h"
#include "AliHLTTPCClusterFinderComponent.h"
#include "AliHLTTPCDigitPublisherComponent.h"
#include "AliHLTTPCDigitDumpComponent.h"
#include "AliHLTTPCClusterDumpComponent.h"
#include "AliHLTTPCClusterHistoComponent.h"
#include "AliHLTTPCHistogramHandlerComponent.h"
#include "AliHLTTPCTrackHistoComponent.h"
#include "AliHLTTPCHWCFDataReverterComponent.h"
#include "AliHLTTPCCFComparisonComponent.h"
#include "AliHLTTPCDataCheckerComponent.h"
#include "AliHLTTPCHWCFEmulatorComponent.h"
#include "AliHLTTPCHWCFConsistencyControlComponent.h"
#include "AliHLTTPCDataCompressionComponent.h"
#include "AliHLTTPCDataCompressionMonitorComponent.h"
#include "AliHLTTPCDataCompressionFilterComponent.h"
#include "AliHLTTPCDataPublisherComponent.h"
#include "AliHLTTPCHWClusterDecoderComponent.h"
#include "AliHLTTPCClusterTransformationComponent.h"
#include "AliHLTTPCClusterTransformationPrepareComponent.h"
#include "AliHLTTPCOfflinePreprocessorWrapperComponent.h"

/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTTPCAgent)

AliHLTTPCAgent::AliHLTTPCAgent()
  : AliHLTModuleAgent("TPC")
  , fRawDataHandler(NULL)
  , fTracksegsDataHandler(NULL)
  , fClustersDataHandler(NULL)
  , fCompressionMonitorHandler(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
}

AliHLTTPCAgent::~AliHLTTPCAgent()
{
  // see header file for class documentation
}

UInt_t AliHLTTPCAgent::GetDetectorMask() const
{
  return AliDAQ::kTPC;
}

int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
					 AliRawReader* rawReader,
					 AliRunLoader* runloader) const
{
  // see header file for class documentation
  if (handler) {
    // AliSimulation: use the AliRawReaderPublisher if the raw reader is available
    // AliReconstruction: indicated by runloader==NULL, run always on raw data
    bool bPublishRaw=rawReader!=NULL || runloader==NULL;

    AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance();
    int tpcInputMode = 0;
    if( pHLT ){
      TString hltoptions = pHLT->GetConfigurationString();
      TObjArray* pTokens=hltoptions.Tokenize(" ");
      if( pTokens ){
	int iEntries=pTokens->GetEntriesFast();
	for (int i=0; i<iEntries; i++) {
	  if (!pTokens->At(i)) continue;
	  TString token = pTokens->At(i)->GetName();
	  if (token.Contains("TPC-input=")) {
	    TString param=token.ReplaceAll("TPC-input=", "");
	    if (param == "default") {
	      tpcInputMode = 0;
	    } else if (param == "raw") {
	      tpcInputMode = 1;
	    } else if (param == "compressed") {
	      tpcInputMode = 2;
	    } else {
	      HLTWarning("wrong parameter \'%s\' for option \'TPC-input=\', expected \'default\'/\'raw\'/\'compressed\'",param.Data() );
	    }
	  }
	}
	delete pTokens;
      }
    }

    //
    //  Temporary: only run on raw data
    //  at the moment, running on compressed clusters causes inconsistency in hltout
    //  due to duplicated cluster blocks
    //
    tpcInputMode = 1; 

    // This the tracking configuration for the full TPC
    // - 216 clusterfinders (1 per partition)
    // - 36 slice trackers
    // - one global merger
    // - the esd converter
    // The ESD is shipped embedded into a TTree
    int iMinSlice=0; 
{'fraction_non_alphanumeric': 0.13327617414499382, 'fraction_numerical': 0.0023816328474802325, 'mean_word_length': 3.6595650244118954, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3840115', 'n_tokens_mistral': 3327, 'n_tokens_neox': 3175, 'n_words': 779}