<commit_before>// $Id$
/**************************************************************************
 * This file is property of and copyright by the ALICE HLT Project        *
 * ALICE Experiment at CERN, All rights reserved.                         *
 *                                                                        *
 * Primary Authors: <NAME> <<EMAIL>>                   *
 *                  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   AliHLTGlobalTriggerDecision.cxx
/// @author <NAME> <<EMAIL>>
/// @date   26 Nov 2008
/// @brief  Implementation of the AliHLTGlobalTriggerDecision class.
/// 
/// The global trigger decision class stores the global HLT decision.

#include "AliHLTGlobalTriggerDecision.h"
#include "Riostream.h"

ClassImp(AliHLTGlobalTriggerDecision)


AliHLTGlobalTriggerDecision::AliHLTGlobalTriggerDecision() :
AliHLTTriggerDecision(0, "HLTGlobalTrigger"),
  fContributingTriggers(AliHLTTriggerDecision::Class()),
  fInputObjects(),
  fCounters()
{
  // Default constructor.
}


AliHLTGlobalTriggerDecision::AliHLTGlobalTriggerDecision(
    bool result, const AliHLTTriggerDomain& triggerDomain, const char* description
  ) :
  AliHLTTriggerDecision(result, "HLTGlobalTrigger", triggerDomain, description),
  fContributingTriggers(AliHLTTriggerDecision::Class()),
  fInputObjects(),
  fCounters()
{
  // Constructor specifying multiple information fields.
  
  Result(result);
  fInputObjects.SetOwner(kTRUE);
}


AliHLTGlobalTriggerDecision::~AliHLTGlobalTriggerDecision()
{
  // Default destructor.
}


void AliHLTGlobalTriggerDecision::Print(Option_t* option) const
{
  // Prints the contents of the trigger decision.
  
  TString opt(option);
  if (opt.Contains("compact"))
  {
    cout << "Global ";
    AliHLTTriggerDecision::Print("");
  }
  else if (opt.Contains("short"))
  {
    cout << "Global ";
    AliHLTTriggerDecision::Print(option);
    cout << "#################### Input trigger decisions ####################" << endl;
    for (Int_t i = 0; i < NumberOfTriggerInputs(); i++)
    {
      TriggerInput(i)->Print(option);
    }
    if (NumberOfTriggerInputs() == 0)
    {
      cout << "(none)" << endl;
    }
  }
  else if (opt.Contains("counters"))
  {
    cout << "Counter\tValue" << endl;
    for (Int_t i = 0; i < fCounters.GetSize(); i++)
    {
      cout << i << "\t" << fCounters[i] << endl;
    }
    if (fCounters.GetSize() == 0)
    {
      cout << "(none)" << endl;
    }
  }
  else
  {
    cout << "Global ";
    AliHLTTriggerDecision::Print(option);
    cout << "#################### Input trigger decisions ####################" << endl;
    for (Int_t i = 0; i < NumberOfTriggerInputs(); i++)
    {
      cout << "-------------------- Input trigger decision " << i << " --------------------" << endl;
      TriggerInput(i)->Print(option);
    }
    if (NumberOfTriggerInputs() == 0)
    {
      cout << "(none)" << endl;
    }
    cout << "###################### Other input objects ######################" << endl;
    for (Int_t i = 0; i < NumberOfInputObjects(); i++)
    {
      cout << "------------------------ Input object " << i << " ------------------------" << endl;
      InputObject(i)->Print(option);
    }
    if (NumberOfInputObjects() == 0)
    {
      cout << "(none)" << endl;
    }
    cout << "#################### Event class counters ####################" << endl;
    cout << "Counter\tValue" << endl;
    for (Int_t i = 0; i < fCounters.GetSize(); i++)
    {
      cout << i << "\t" << fCounters[i] << endl;
    }
    if (fCounters.GetSize() == 0)
    {
      cout << "(none)" << endl;
    }
  }
}

void AliHLTGlobalTriggerDecision::Copy(TObject &object) const
{
  // copy this to the specified object

  AliHLTGlobalTriggerDecision* pDecision=dynamic_cast<AliHLTGlobalTriggerDecision*>(&object);
  if (pDecision)
  {
    // copy members if target is a AliHLTGlobalTriggerDecision<commit_msg>adding some additional protection in the Print() function input objects might not be known, especially when they are defined in component libraries not necessarily loaded<commit_after>// $Id$
/**************************************************************************
 * This file is property of and copyright by the ALICE HLT Project        *
 * ALICE Experiment at CERN, All rights reserved.                         *
 *                                                                        *
 * Primary Authors: <NAME> <<EMAIL>>                   *
 *                  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   AliHLTGlobalTriggerDecision.cxx
/// @author <NAME> <<EMAIL>>
/// @date   26 Nov 2008
/// @brief  Implementation of the AliHLTGlobalTriggerDecision class.
/// 
/// The global trigger decision class stores the global HLT decision.

#include "AliHLTGlobalTriggerDecision.h"
#include "Riostream.h"

ClassImp(AliHLTGlobalTriggerDecision)


AliHLTGlobalTriggerDecision::AliHLTGlobalTriggerDecision() :
AliHLTTriggerDecision(0, "HLTGlobalTrigger"),
  fContributingTriggers(AliHLTTriggerDecision::Class()),
  fInputObjects(),
  fCounters()
{
  // Default constructor.
}


AliHLTGlobalTriggerDecision::AliHLTGlobalTriggerDecision(
    bool result, const AliHLTTriggerDomain& triggerDomain, const char* description
  ) :
  AliHLTTriggerDecision(result, "HLTGlobalTrigger", triggerDomain, description),
  fContributingTriggers(AliHLTTriggerDecision::Class()),
  fInputObjects(),
  fCounters()
{
  // Constructor specifying multiple information fields.
  
  Result(result);
  fInputObjects.SetOwner(kTRUE);
}


AliHLTGlobalTriggerDecision::~AliHLTGlobalTriggerDecision()
{
  // Default destructor.
}


void AliHLTGlobalTriggerDecision::Print(Option_t* option) const
{
  // Prints the contents of the trigger decision.
  
  TString opt(option);
  if (opt.Contains("compact"))
  {
    cout << "Global ";
    AliHLTTriggerDecision::Print("");
  }
  else if (opt.Contains("short"))
  {
    cout << "Global ";
    AliHLTTriggerDecision::Print(option);
    cout << "#################### Input trigger decisions ####################" << endl;
    for (Int_t i = 0; i < NumberOfTriggerInputs(); i++)
    {
      if (TriggerInput(i)) TriggerInput(i)->Print(option);
    }
    if (NumberOfTriggerInputs() == 0)
    {
      cout << "(none)" << endl;
    }
  }
  else if (opt.Contains("counters"))
  {
    cout << "Counter\tValue" << endl;
    for (Int_t i = 0; i < fCounters.GetSize(); i++)
    {
      cout << i << "\t" << fCounters[i] << endl;
    }
    if (fCounters.GetSize() == 0)
    {
      cout << "(none)" << endl;
    }
  }
  else
  {
    cout << "Global ";
    AliHLTTriggerDecision::Print(option);
    cout << "#################### Input trigger decisions ####################" << endl;
    for (Int_t i = 0; i < NumberOfTriggerInputs(); i++)
    {
      cout << "-------------------- Input trigger decision " << i << " --------------------" << endl;
      if (TriggerInput(i)) TriggerInput(i)->Print(option);
    }
    if (NumberOfTriggerInputs() == 0)
    {
      cout << "(none)" << endl;
    }
    cout << "###################### Other input objects ######################" << endl;
    for (Int_t i = 0; i < NumberOfInputObjects(); i++)
    {
      cout << "------------------------ Input object " << i << " ------------------------" << endl;
      if (InputObject(i)) InputObject(i)->Print(option);
    }
    if (NumberOfInputObjects() == 0)
    {
      cout << "(none)" << endl;
    }
    cout << "#################### Event class counters ####################" << endl;
    cout << "Counter\tValue" << endl;
    for (Int_t i = 0; i < fCounters.GetSize(); i++)
    {
      cout << i << "\t" << fCounters[i] << endl;
    }
    if (fCounters.GetSize() == 0)
    {
      cout << "(none)" << endl;
    }
  }
}

void AliHLTGlobalTriggerDecision::Copy(TObject &object) const
{
  // copy this to the specified object

  AliHLTGlobalTriggerDecision* pDecision=dynamic_cast<AliHLTGlobalTriggerDecision*>(&object);
  if (pDecision)
  {
    // copy members if target is a AliHLTGlobalTriggerDecision
{'fraction_non_alphanumeric': 0.2011060299904286, 'fraction_numerical': 0.0036158672764011485, 'mean_word_length': 2.6863974911799295, 'pattern_counts': {'":': 0, '<': 191, '<?xml version=': 0, '>': 23, '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': '6257638', 'n_tokens_mistral': 2658, 'n_tokens_neox': 2591, 'n_words': 691}