<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 TRD reconstruction                                              //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////

#include <TFile.h>

#include "AliRunLoader.h"
#include "AliRawReader.h"
#include "AliLog.h"
#include "AliESDTrdTrack.h"
#include "AliESDEvent.h"

#include "AliTRDReconstructor.h"
#include "AliTRDclusterizerV1.h"
#include "AliTRDclusterizerV2.h"
#include "AliTRDtracker.h"
#include "AliTRDpidESD.h"
#include "AliTRDgtuTrack.h"
#include "AliTRDrawData.h"
#include "AliTRDdigitsManager.h"

ClassImp(AliTRDReconstructor)

Bool_t AliTRDReconstructor::fgkSeedingOn  = kFALSE;
Int_t  AliTRDReconstructor::fgStreamLevel = 0;      // Stream (debug) level

//_____________________________________________________________________________
void AliTRDReconstructor::ConvertDigits(AliRawReader *rawReader
				      , TTree *digitsTree) const
{
  //
  // Convert raw data digits into digit objects in a root tree
  //

  AliInfo("Convert raw data digits into digit objects [RawReader -> Digit TTree]");

  AliTRDrawData rawData;
  rawReader->Reset();
  rawReader->Select("TRD");
  AliTRDdigitsManager *manager = rawData.Raw2Digits(rawReader);
  manager->MakeBranch(digitsTree);
  manager->WriteDigits();
  delete manager;

}

//_____________________________________________________________________________
void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader
                                    , AliRawReader *rawReader) const
{
  //
  // Reconstruct clusters
  //

  AliInfo("Reconstruct TRD clusters from RAW data [RunLoader, RawReader]");

  AliLoader *loader = runLoader->GetLoader("TRDLoader");
  loader->LoadRecPoints("recreate");

  runLoader->CdGAFile();
  Int_t nEvents = runLoader->GetNumberOfEvents();

  rawReader->Reset();
  rawReader->Select("TRD");

  for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {

    if (!rawReader->NextEvent()) break;

    // Old (slow) cluster finder
    //AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
    //clusterer.Open(runLoader->GetFileName(),iEvent);
    //clusterer.ReadDigits(rawReader);
    //clusterer.MakeClusters();

    // New (fast) cluster finder
    AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
    clusterer.Open(runLoader->GetFileName(),iEvent);
    clusterer.Raw2ClustersChamber(rawReader);

    clusterer.WriteClusters(-1);

  }

  loader->UnloadRecPoints();

}

//_____________________________________________________________________________
void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader
                                    , TTree *clusterTree) const
{
  //
  // Reconstruct clusters
  //

  AliInfo("Reconstruct TRD clusters from RAW data [RawReader -> Cluster TTree]");

  rawReader->Reset();
  rawReader->Select("TRD");

  // Old (slow) cluster finder
  //AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
  //clusterer.OpenOutput(clusterTree);
  //clusterer.ReadDigits(rawReader);
  //clusterer.MakeClusters();

  // New (fast) cluster finder
  AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
  clusterer.OpenOutput(clusterTree);
  clusterer.SetAddLabels(kFALSE);
  clusterer.Raw2ClustersChamber(rawReader);
}

//_____________________________________________________________________________
void AliTRDReconstructor::Reconstruct(TTree *digitsTree
                                    , TTree *clusterTree) const
{
  //
  // Reconstruct clusters
  //
  AliInfo("Reconstruct TRD clusters from Digits [Digit TTree -> Cluster TTree]");

  //AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
  AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
  clusterer.OpenOutput(clusterTree);
  clusterer.ReadDigits(digitsTree);
  clusterer.MakeClusters();
}

//_____________________________________________________________________________
void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader) const
{
  //
  // Reconstruct clusters
  //

  AliInfo("Reconstruct TRD clusters [AliRunLoader]");
  AliLoader *loader = runLoader->GetLoader("TRDLoader");
  loader->LoadRecPoints("recreate");

  runLoader->CdGAFile();
  Int_t nEvents = runLoader->GetNumberOfEvents();

  for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
    AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
    //AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
    clusterer.Open(runLoader->GetFileName(),iEvent);
    clusterer.ReadDigits();
    clusterer.MakeClusters();
    clusterer.WriteClusters(-1);
  }
<commit_msg>Remove AliTRDclusterizerV1<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 TRD reconstruction                                              //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////

#include <TFile.h>

#include "AliRunLoader.h"
#include "AliRawReader.h"
#include "AliLog.h"
#include "AliESDTrdTrack.h"
#include "AliESDEvent.h"

#include "AliTRDReconstructor.h"
#include "AliTRDclusterizerV2.h"
#include "AliTRDtracker.h"
#include "AliTRDpidESD.h"
#include "AliTRDgtuTrack.h"
#include "AliTRDrawData.h"
#include "AliTRDdigitsManager.h"

ClassImp(AliTRDReconstructor)

Bool_t AliTRDReconstructor::fgkSeedingOn  = kFALSE;
Int_t  AliTRDReconstructor::fgStreamLevel = 0;      // Stream (debug) level

//_____________________________________________________________________________
void AliTRDReconstructor::ConvertDigits(AliRawReader *rawReader
				      , TTree *digitsTree) const
{
  //
  // Convert raw data digits into digit objects in a root tree
  //

  AliInfo("Convert raw data digits into digit objects [RawReader -> Digit TTree]");

  AliTRDrawData rawData;
  rawReader->Reset();
  rawReader->Select("TRD");
  AliTRDdigitsManager *manager = rawData.Raw2Digits(rawReader);
  manager->MakeBranch(digitsTree);
  manager->WriteDigits();
  delete manager;

}

//_____________________________________________________________________________
void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader
                                    , AliRawReader *rawReader) const
{
  //
  // Reconstruct clusters
  //

  AliInfo("Reconstruct TRD clusters from RAW data [RunLoader, RawReader]");

  AliLoader *loader = runLoader->GetLoader("TRDLoader");
  loader->LoadRecPoints("recreate");

  runLoader->CdGAFile();
  Int_t nEvents = runLoader->GetNumberOfEvents();

  rawReader->Reset();
  rawReader->Select("TRD");

  for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {

    if (!rawReader->NextEvent()) break;

    // New (fast) cluster finder
    AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
    clusterer.Open(runLoader->GetFileName(),iEvent);
    clusterer.Raw2ClustersChamber(rawReader);

    clusterer.WriteClusters(-1);

  }

  loader->UnloadRecPoints();

}

//_____________________________________________________________________________
void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader
                                    , TTree *clusterTree) const
{
  //
  // Reconstruct clusters
  //

  AliInfo("Reconstruct TRD clusters from RAW data [RawReader -> Cluster TTree]");

  rawReader->Reset();
  rawReader->Select("TRD");

  // New (fast) cluster finder
  AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
  clusterer.OpenOutput(clusterTree);
  clusterer.SetAddLabels(kFALSE);
  clusterer.Raw2ClustersChamber(rawReader);

}

//_____________________________________________________________________________
void AliTRDReconstructor::Reconstruct(TTree *digitsTree
                                    , TTree *clusterTree) const
{
  //
  // Reconstruct clusters
  //
  AliInfo("Reconstruct TRD clusters from Digits [Digit TTree -> Cluster TTree]");

  AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
  clusterer.OpenOutput(clusterTree);
  clusterer.ReadDigits(digitsTree);
  clusterer.MakeClusters();

}

//_____________________________________________________________________________
void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader) const
{
  //
  // Reconstruct clusters
  //

  AliInfo("Reconstruct TRD clusters [AliRunLoader]");
  AliLoader *loader = runLoader->GetLoader("TRDLoader");
  loader->LoadRecPoints("recreate");

  runLoader->CdGAFile();
  Int_t nEvents = runLoader->GetNumberOfEvents();

  for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
    AliTRDclusterizerV2 clusterer("clusterer","TRD clusterizer");
    clusterer.Open(runLoader->GetFileName(),iEvent);
    clusterer.ReadDigits();
    clusterer.MakeClusters();
    clusterer.WriteClusters(-1);
  }

{'fraction_non_alphanumeric': 0.15320409262250942, 'fraction_numerical': 0.004308023694130318, 'mean_word_length': 2.797886843899114, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 52, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 36, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4596226', 'n_tokens_mistral': 2929, 'n_tokens_neox': 2908, 'n_words': 635}