<commit_before>/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * 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.                  *
 **************************************************************************/

/* $Id$ */
///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// class for running the QA makers                                           //
//                                                                           //
//   AliQADataMakerSteer qas;                                                //
//   qas.Run(AliQA::kRAWS, rawROOTFileName);                                 //
//   qas.Run(AliQA::kHITS);                                                  //
//   qas.Run(AliQA::kSDIGITS);                                               //
//   qas.Run(AliQA::kDIGITS);                                                //
//   qas.Run(AliQA::kRECPOINTS);                                             //
//   qas.Run(AliQA::kESDS);                                                  //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////

#include <TKey.h>
#include <TFile.h>
#include <TFileMerger.h>
#include <TPluginManager.h>
#include <TROOT.h>
#include <TString.h>
#include <TSystem.h>

#include "AliCDBManager.h"
#include "AliCDBEntry.h"
#include "AliCDBId.h"
#include "AliCDBMetaData.h"
#include "AliESDEvent.h"
#include "AliGeomManager.h"
#include "AliGlobalQADataMaker.h"
#include "AliHeader.h"
#include "AliLog.h"
#include "AliModule.h"
#include "AliQA.h"
#include "AliQADataMakerRec.h"
#include "AliQADataMakerSim.h"
#include "AliQADataMakerSteer.h" 
#include "AliRawReaderDate.h"
#include "AliRawReaderFile.h"
#include "AliRawReaderRoot.h"
#include "AliRun.h"
#include "AliRunLoader.h"

ClassImp(AliQADataMakerSteer) 

//_____________________________________________________________________________
AliQADataMakerSteer::AliQADataMakerSteer(char * mode, const char* gAliceFilename, const char * name, const char * title) :
	TNamed(name, title), 
	fCurrentEvent(0),  
	fCycleSame(kFALSE),
	fDetectors("ALL"), 
	fDetectorsW("ALL"), 
	fESD(NULL), 
	fESDTree(NULL),
	fGAliceFileName(gAliceFilename), 
	fFirstEvent(0),        
	fMaxEvents(0),   
  fMode(mode), 
	fNumberOfEvents(999999), 
	fRunNumber(0), 
	fRawReader(NULL), 
	fRawReaderDelete(kTRUE), 
	fRunLoader(NULL)
{
	// default ctor
	fMaxEvents = fNumberOfEvents ; 
	for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
		if (IsSelected(AliQA::GetDetName(iDet))) {
			fLoader[iDet]      = NULL ;
			fQADataMaker[iDet] = NULL ;
			fQACycles[iDet]    = 999999 ;
		}
	}	
}

//_____________________________________________________________________________
AliQADataMakerSteer::AliQADataMakerSteer(const AliQADataMakerSteer & qas) : 
	TNamed(qas), 
	fCurrentEvent(qas.fCurrentEvent),  
	fCycleSame(kFALSE),
	fDetectors(qas.fDetectors), 
	fDetectorsW(qas.fDetectorsW), 
	fESD(NULL), 
	fESDTree(NULL), 
	fGAliceFileName(qas.fGAliceFileName), 
	fFirstEvent(qas.fFirstEvent),        
	fMaxEvents(qas.fMaxEvents),    
	fMode(qas.fMode), 
	fNumberOfEvents(qas.fNumberOfEvents), 
    fRunNumber(qas.fRunNumber), 
	fRawReader(NULL), 
	fRawReaderDelete(kTRUE), 
	fRunLoader(NULL)
{
	// cpy ctor
	for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
		fLoader[iDet]      = qas.fLoader[iDet] ;
		fQADataMaker[iDet] = qas.fQADataMaker[iDet] ;
		fQACycles[iDet]    = qas.fQACycles[iDet] ;	
	}
}

//_____________________________________________________________________________
AliQADataMakerSteer & AliQADataMakerSteer::operator = (const AliQADataMakerSteer & qas) 
{
	// assignment operator
  this->~AliQADataMakerSteer() ;
  new(this) AliQADataMakerSteer(qas) ;
  return *this ;
}

//_____________________________________________________________________________
AliQADataMakerSteer::~AliQADataMakerSteer() 
{
	// dtor
	for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
		if (IsSelected(AliQA::GetDetName(iDet))) {
		  fLoader[iDet] = NULL;
		  if (fQADataMaker[iDet]) {
			  (fQADataMaker[iDet])->Finish() ; 
		  }
		}
		if (fQADataMaker[iDet])
			delete fQADataMaker[iDet] ;
	}
	if (fRawReaderDelete) { 
		fRunLoader = NULL ;
		delete fRawReader ;
		fRawReader = NULL ;
	}
}

//_____________________________________________________________________________
Bool_t AliQADataMakerSteer::DoIt(const AliQA::TASKINDEX_t taskIndex)
{
	// Runs all the QA data Maker for every detector
		<commit_msg>removed unnecessary loop<commit_after>/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * 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.                  *
 **************************************************************************/

/* $Id$ */
///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// class for running the QA makers                                           //
//                                                                           //
//   AliQADataMakerSteer qas;                                                //
//   qas.Run(AliQA::kRAWS, rawROOTFileName);                                 //
//   qas.Run(AliQA::kHITS);                                                  //
//   qas.Run(AliQA::kSDIGITS);                                               //
//   qas.Run(AliQA::kDIGITS);                                                //
//   qas.Run(AliQA::kRECPOINTS);                                             //
//   qas.Run(AliQA::kESDS);                                                  //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////

#include <TKey.h>
#include <TFile.h>
#include <TFileMerger.h>
#include <TPluginManager.h>
#include <TROOT.h>
#include <TString.h>
#include <TSystem.h>

#include "AliCDBManager.h"
#include "AliCDBEntry.h"
#include "AliCDBId.h"
#include "AliCDBMetaData.h"
#include "AliESDEvent.h"
#include "AliGeomManager.h"
#include "AliGlobalQADataMaker.h"
#include "AliHeader.h"
#include "AliLog.h"
#include "AliModule.h"
#include "AliQA.h"
#include "AliQADataMakerRec.h"
#include "AliQADataMakerSim.h"
#include "AliQADataMakerSteer.h" 
#include "AliRawReaderDate.h"
#include "AliRawReaderFile.h"
#include "AliRawReaderRoot.h"
#include "AliRun.h"
#include "AliRunLoader.h"

ClassImp(AliQADataMakerSteer) 

//_____________________________________________________________________________
AliQADataMakerSteer::AliQADataMakerSteer(char * mode, const char* gAliceFilename, const char * name, const char * title) :
	TNamed(name, title), 
	fCurrentEvent(0),  
	fCycleSame(kFALSE),
	fDetectors("ALL"), 
	fDetectorsW("ALL"), 
	fESD(NULL), 
	fESDTree(NULL),
	fGAliceFileName(gAliceFilename), 
	fFirstEvent(0),        
	fMaxEvents(0),   
  fMode(mode), 
	fNumberOfEvents(999999), 
	fRunNumber(0), 
	fRawReader(NULL), 
	fRawReaderDelete(kTRUE), 
	fRunLoader(NULL)
{
	// default ctor
	fMaxEvents = fNumberOfEvents ; 
	for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
		if (IsSelected(AliQA::GetDetName(iDet))) {
			fLoader[iDet]      = NULL ;
			fQADataMaker[iDet] = NULL ;
			fQACycles[iDet]    = 999999 ;
		}
	}	
}

//_____________________________________________________________________________
AliQADataMakerSteer::AliQADataMakerSteer(const AliQADataMakerSteer & qas) : 
	TNamed(qas), 
	fCurrentEvent(qas.fCurrentEvent),  
	fCycleSame(kFALSE),
	fDetectors(qas.fDetectors), 
	fDetectorsW(qas.fDetectorsW), 
	fESD(NULL), 
	fESDTree(NULL), 
	fGAliceFileName(qas.fGAliceFileName), 
	fFirstEvent(qas.fFirstEvent),        
	fMaxEvents(qas.fMaxEvents),    
	fMode(qas.fMode), 
	fNumberOfEvents(qas.fNumberOfEvents), 
    fRunNumber(qas.fRunNumber), 
	fRawReader(NULL), 
	fRawReaderDelete(kTRUE), 
	fRunLoader(NULL)
{
	// cpy ctor
	for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
		fLoader[iDet]      = qas.fLoader[iDet] ;
		fQADataMaker[iDet] = qas.fQADataMaker[iDet] ;
		fQACycles[iDet]    = qas.fQACycles[iDet] ;	
	}
}

//_____________________________________________________________________________
AliQADataMakerSteer & AliQADataMakerSteer::operator = (const AliQADataMakerSteer & qas) 
{
	// assignment operator
  this->~AliQADataMakerSteer() ;
  new(this) AliQADataMakerSteer(qas) ;
  return *this ;
}

//_____________________________________________________________________________
AliQADataMakerSteer::~AliQADataMakerSteer() 
{
	// dtor
	for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
		if (IsSelected(AliQA::GetDetName(iDet))) {
		  fLoader[iDet] = NULL;
		  if (fQADataMaker[iDet]) {
			  (fQADataMaker[iDet])->Finish() ; 
				delete fQADataMaker[iDet] ;
		  }
		}
	}
	if (fRawReaderDelete) { 
		fRunLoader = NULL ;
		delete fRawReader ;
		fRawReader = NULL ;
	}
}

//_____________________________________________________________________________
Bool_t AliQADataMakerSteer::DoIt(const AliQA::TASKINDEX_t taskIndex)
{
	// Runs all the QA data Maker for every detector
		
{'fraction_non_alphanumeric': 0.15693497881746177, 'fraction_numerical': 0.004973291582243507, 'mean_word_length': 2.145712630359212, 'pattern_counts': {'":': 0, '<': 23, '<?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': 60, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3840185', 'n_tokens_mistral': 3407, 'n_tokens_neox': 3198, 'n_words': 592}