<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   AliHLTRawReaderPublisherComponent.cxx
/// @author <NAME>
/// @date   
/// @brief  Publisher component for raw data blocks through the AliRawReader
///         of the offline environment

#include "AliHLTRawReaderPublisherComponent.h"
#include "AliRawReader.h"
#include "AliDAQ.h"
#include "AliLog.h"
#include <cerrno>
#include <cassert>
#include <list>

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

AliHLTRawReaderPublisherComponent::AliHLTRawReaderPublisherComponent()
  :
  fMaxSize(5000000),
  fDetector(),
  fMinEquId(-1),
  fMaxEquId(-1),
  fVerbosity(0),
  fDataType(kAliHLTVoidDataType),
  fSpecification(kAliHLTVoidDataSpec),
  fSkipEmpty(kFALSE)
{
  // contructor
}

AliHLTRawReaderPublisherComponent::~AliHLTRawReaderPublisherComponent()
{
  // destructor
}

const char* AliHLTRawReaderPublisherComponent::GetComponentID()
{
  /// inherited from AliHLTComponent: id of the component
  return "AliRawReaderPublisher";
}

AliHLTComponentDataType AliHLTRawReaderPublisherComponent::GetOutputDataType()
{
  /// inherited from AliHLTComponent: output data type of the component.
  return fDataType;
}

void AliHLTRawReaderPublisherComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
{
  /// inherited from AliHLTComponent: output data size estimator
  constBase=fMaxSize;
  inputMultiplier=1;
}

AliHLTComponent* AliHLTRawReaderPublisherComponent::Spawn()
{
  /// inherited from AliHLTComponent: spawn function.
  return new AliHLTRawReaderPublisherComponent;
}

int AliHLTRawReaderPublisherComponent::DoInit( int argc, const char** argv )
{
  /// inherited from AliHLTComponent: component initialisation and argument scan.
  int iResult=0;

  // scan arguments
  if (argc && (iResult = ConfigureFromArgumentString(argc, argv)) < 0)
    return iResult;

  if (!fDetector.IsNull()) {
    int ddloffset=-1;
    int ddlcount=-1;
    if ((ddloffset=AliDAQ::DdlIDOffset(fDetector))<0 || 
	(ddlcount=AliDAQ::NumberOfDdls(fDetector))<0) {
      return -EINVAL;
    }
    if (fMinEquId<0) fMinEquId=ddloffset;
    else fMinEquId+=ddloffset;

    if (fMaxEquId<0 || fMaxEquId>ddlcount) fMaxEquId=ddloffset+ddlcount;
    else fMaxEquId+=ddloffset;
  }

  if (fMinEquId>fMaxEquId) fMaxEquId=fMinEquId;<commit_msg>bugfix: correct range of DDL for specified detector<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   AliHLTRawReaderPublisherComponent.cxx
/// @author <NAME>
/// @date   
/// @brief  Publisher component for raw data blocks through the AliRawReader
///         of the offline environment

#include "AliHLTRawReaderPublisherComponent.h"
#include "AliRawReader.h"
#include "AliDAQ.h"
#include "AliLog.h"
#include <cerrno>
#include <cassert>
#include <list>

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

AliHLTRawReaderPublisherComponent::AliHLTRawReaderPublisherComponent()
  :
  fMaxSize(5000000),
  fDetector(),
  fMinEquId(-1),
  fMaxEquId(-1),
  fVerbosity(0),
  fDataType(kAliHLTVoidDataType),
  fSpecification(kAliHLTVoidDataSpec),
  fSkipEmpty(kFALSE)
{
  // contructor
}

AliHLTRawReaderPublisherComponent::~AliHLTRawReaderPublisherComponent()
{
  // destructor
}

const char* AliHLTRawReaderPublisherComponent::GetComponentID()
{
  /// inherited from AliHLTComponent: id of the component
  return "AliRawReaderPublisher";
}

AliHLTComponentDataType AliHLTRawReaderPublisherComponent::GetOutputDataType()
{
  /// inherited from AliHLTComponent: output data type of the component.
  return fDataType;
}

void AliHLTRawReaderPublisherComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
{
  /// inherited from AliHLTComponent: output data size estimator
  constBase=fMaxSize;
  inputMultiplier=1;
}

AliHLTComponent* AliHLTRawReaderPublisherComponent::Spawn()
{
  /// inherited from AliHLTComponent: spawn function.
  return new AliHLTRawReaderPublisherComponent;
}

int AliHLTRawReaderPublisherComponent::DoInit( int argc, const char** argv )
{
  /// inherited from AliHLTComponent: component initialisation and argument scan.
  int iResult=0;

  // scan arguments
  if (argc && (iResult = ConfigureFromArgumentString(argc, argv)) < 0)
    return iResult;

  if (!fDetector.IsNull()) {
    int ddloffset=-1;
    int ddlcount=-1;
    if ((ddloffset=AliDAQ::DdlIDOffset(fDetector))<0 || 
	(ddlcount=AliDAQ::NumberOfDdls(fDetector))<0) {
      return -EINVAL;
    }
    if (fMinEquId<0) fMinEquId=ddloffset;
    else fMinEquId+=ddloffset;

    if (fMaxEquId<0 || fMaxEquId>ddlcount) fMaxEquId=ddloffset+ddlcount-1;
    else fMaxEquId+=ddloffset;
  }

  if (fMinEquId>fMaxEquId) fMaxEquId=fMinEquId;
{'fraction_non_alphanumeric': 0.14169096209912538, 'fraction_numerical': 0.005685131195335277, 'mean_word_length': 3.361729179910998, 'pattern_counts': {'":': 0, '<': 27, '<?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': '524268', 'n_tokens_mistral': 2027, 'n_tokens_neox': 1923, 'n_words': 508}