<commit_before>#include <TFile.h>
#include "AliGeomManager.h"
#include "AliHeader.h"
#include "AliITSDetTypeRec.h"
#include "AliITSInitGeometry.h"
#include "AliITSMeanVertexer.h"
#include "AliITSLoader.h"
#include "AliLog.h"
#include "AliRawReader.h"
#include "AliRawReaderDate.h"
#include "AliRawReaderRoot.h"
#include "AliRunLoader.h"
#include "AliITSVertexer3D.h"
#include "AliESDVertex.h"
#include "AliMeanVertex.h"
#include "AliMultiplicity.h"

const TString AliITSMeanVertexer::fgkMVFileNameDefault = "MeanVertex.root";


ClassImp(AliITSMeanVertexer)

///////////////////////////////////////////////////////////////////////
//                                                                   //
// Class to compute vertex position using SPD local reconstruction   //
// An average vertex position using all the events                   //
// is built and saved                                                //
// Individual vertices can be optionally stored                      //
// Origin: M.Masera  (<EMAIL>)                             //
// Usage:
// AliITSMeanVertexer mv("RawDataFileName");
// mv.SetGeometryFileName("FileWithGeometry.root"); // def. geometry.root
// ....  optional setters ....
// mv.Reconstruct();  // SPD local reconstruction
// mv.DoVertices(); 
// Resulting AliMeanVertex object is stored in a file named fMVFileName
///////////////////////////////////////////////////////////////////////

/* $Id$ */

//______________________________________________________________________
AliITSMeanVertexer::AliITSMeanVertexer():TObject(),
fLoaderFileName(),
fGeometryFileName(),
fMVFileName(),
fRawReader(),
fRunLoader(),
fNoEventsContr(0),
fTotTracklets(0.),
fAverTracklets(0.),
fSigmaOnAverTracks(0.), 
fFilterOnContributors(0),
fFilterOnTracklets(0),
fWriteVertices(kFALSE)
{
  // Default Constructor
  for(Int_t i=0;i<3;i++){
    fWeighPos[i] = 0.;
    fWeighSig[i] = 0.;
    fAverPos[i] = 0.;
    for(Int_t j=0; j<3;j++)fAverPosSq[i][j] = 0.;
  }
  
}

//______________________________________________________________________
AliITSMeanVertexer::AliITSMeanVertexer(TString &filename):TObject(),
fLoaderFileName(),
fGeometryFileName(),
fMVFileName(fgkMVFileNameDefault),
fRawReader(),
fRunLoader(),
fNoEventsContr(0),
fTotTracklets(0.),
fAverTracklets(0.),
fSigmaOnAverTracks(0.), 
fFilterOnContributors(0),
fFilterOnTracklets(0),
fWriteVertices(kTRUE)
{
  // Standard constructor

  for(Int_t i=0;i<3;i++){
    fWeighPos[i] = 0.;
    fWeighSig[i] = 0.;
    fAverPos[i] = 0.;
    for(Int_t j=0; j<3;j++)fAverPosSq[i][j] = 0.;
  }
  SetLoaderFileName();
  SetGeometryFileName();

  Init(filename);
}
//______________________________________________________________________
AliITSMeanVertexer::AliITSMeanVertexer(TString &filename, 
                                       TString &loaderfilename, 
				       TString &geometryfilename):TObject(),
fLoaderFileName(),
fGeometryFileName(),
fMVFileName(fgkMVFileNameDefault),
fRawReader(),
fRunLoader(),
fNoEventsContr(0), 
fTotTracklets(0.),
fAverTracklets(0.),
fSigmaOnAverTracks(0.), 
fFilterOnContributors(0),
fFilterOnTracklets(0),
fWriteVertices(kTRUE)
{
  // Standard constructor with explicit geometry file name assignment
  for(Int_t i=0;i<3;i++){
    fWeighPos[i] = 0.;
    fWeighSig[i] = 0.;
    fAverPos[i] = 0.;
    for(Int_t j=0; j<3;j++)fAverPosSq[i][j] = 0.;
  }
  SetLoaderFileName(loaderfilename);
  SetGeometryFileName(geometryfilename);
  Init(filename);
}

//______________________________________________________________________
void AliITSMeanVertexer::Init(TString &filename){
  // Initialization part common to different constructors
  if(filename.IsNull()){
    AliFatal("Please, provide a valid file name for raw data file\n");
  }
  // if file name ends with root a raw reader ROOT is assumed
  if(filename.EndsWith(".root")){
    fRawReader = new AliRawReaderRoot(filename);
  }
  else {  // DATE raw reader is assumed
    fRawReader = new AliRawReaderDate(filename);
    fRawReader->SelectEvents(7);
  }
  fRunLoader = AliRunLoader::Open(fLoaderFileName.Data(),AliConfig::GetDefaultEventFolderName(),"recreate");
  fRunLoader->MakeTree("E");
  Int_t iEvent = 0;
  while (fRawReader->NextEvent()) {
    fRunLoader->SetEventNumber(iEvent);
    fRunLoader->GetHeader()->Reset(fRawReader->GetRunNumber(), 
				   iEvent, iEvent);
    fRunLoader->MakeTree("H");<commit_msg>Remove wrong selction: lost in 27435<commit_after>#include <TFile.h>
#include "AliGeomManager.h"
#include "AliHeader.h"
#include "AliITSDetTypeRec.h"
#include "AliITSInitGeometry.h"
#include "AliITSMeanVertexer.h"
#include "AliITSLoader.h"
#include "AliLog.h"
#include "AliRawReader.h"
#include "AliRawReaderDate.h"
#include "AliRawReaderRoot.h"
#include "AliRunLoader.h"
#include "AliITSVertexer3D.h"
#include "AliESDVertex.h"
#include "AliMeanVertex.h"
#include "AliMultiplicity.h"

const TString AliITSMeanVertexer::fgkMVFileNameDefault = "MeanVertex.root";


ClassImp(AliITSMeanVertexer)

///////////////////////////////////////////////////////////////////////
//                                                                   //
// Class to compute vertex position using SPD local reconstruction   //
// An average vertex position using all the events                   //
// is built and saved                                                //
// Individual vertices can be optionally stored                      //
// Origin: M.Masera  (<EMAIL>)                             //
// Usage:
// AliITSMeanVertexer mv("RawDataFileName");
// mv.SetGeometryFileName("FileWithGeometry.root"); // def. geometry.root
// ....  optional setters ....
// mv.Reconstruct();  // SPD local reconstruction
// mv.DoVertices(); 
// Resulting AliMeanVertex object is stored in a file named fMVFileName
///////////////////////////////////////////////////////////////////////

/* $Id$ */

//______________________________________________________________________
AliITSMeanVertexer::AliITSMeanVertexer():TObject(),
fLoaderFileName(),
fGeometryFileName(),
fMVFileName(),
fRawReader(),
fRunLoader(),
fNoEventsContr(0),
fTotTracklets(0.),
fAverTracklets(0.),
fSigmaOnAverTracks(0.), 
fFilterOnContributors(0),
fFilterOnTracklets(0),
fWriteVertices(kFALSE)
{
  // Default Constructor
  for(Int_t i=0;i<3;i++){
    fWeighPos[i] = 0.;
    fWeighSig[i] = 0.;
    fAverPos[i] = 0.;
    for(Int_t j=0; j<3;j++)fAverPosSq[i][j] = 0.;
  }
  
}

//______________________________________________________________________
AliITSMeanVertexer::AliITSMeanVertexer(TString &filename):TObject(),
fLoaderFileName(),
fGeometryFileName(),
fMVFileName(fgkMVFileNameDefault),
fRawReader(),
fRunLoader(),
fNoEventsContr(0),
fTotTracklets(0.),
fAverTracklets(0.),
fSigmaOnAverTracks(0.), 
fFilterOnContributors(0),
fFilterOnTracklets(0),
fWriteVertices(kTRUE)
{
  // Standard constructor

  for(Int_t i=0;i<3;i++){
    fWeighPos[i] = 0.;
    fWeighSig[i] = 0.;
    fAverPos[i] = 0.;
    for(Int_t j=0; j<3;j++)fAverPosSq[i][j] = 0.;
  }
  SetLoaderFileName();
  SetGeometryFileName();

  Init(filename);
}
//______________________________________________________________________
AliITSMeanVertexer::AliITSMeanVertexer(TString &filename, 
                                       TString &loaderfilename, 
				       TString &geometryfilename):TObject(),
fLoaderFileName(),
fGeometryFileName(),
fMVFileName(fgkMVFileNameDefault),
fRawReader(),
fRunLoader(),
fNoEventsContr(0), 
fTotTracklets(0.),
fAverTracklets(0.),
fSigmaOnAverTracks(0.), 
fFilterOnContributors(0),
fFilterOnTracklets(0),
fWriteVertices(kTRUE)
{
  // Standard constructor with explicit geometry file name assignment
  for(Int_t i=0;i<3;i++){
    fWeighPos[i] = 0.;
    fWeighSig[i] = 0.;
    fAverPos[i] = 0.;
    for(Int_t j=0; j<3;j++)fAverPosSq[i][j] = 0.;
  }
  SetLoaderFileName(loaderfilename);
  SetGeometryFileName(geometryfilename);
  Init(filename);
}

//______________________________________________________________________
void AliITSMeanVertexer::Init(TString &filename){
  // Initialization part common to different constructors
  if(filename.IsNull()){
    AliFatal("Please, provide a valid file name for raw data file\n");
  }
  // if file name ends with root a raw reader ROOT is assumed
  if(filename.EndsWith(".root")){
    fRawReader = new AliRawReaderRoot(filename);
  }
  else {  // DATE raw reader is assumed
    fRawReader = new AliRawReaderDate(filename);
  }
  fRunLoader = AliRunLoader::Open(fLoaderFileName.Data(),AliConfig::GetDefaultEventFolderName(),"recreate");
  fRunLoader->MakeTree("E");
  Int_t iEvent = 0;
  while (fRawReader->NextEvent()) {
    fRunLoader->SetEventNumber(iEvent);
    fRunLoader->GetHeader()->Reset(fRawReader->GetRunNumber(), 
				   iEvent, iEvent);
    fRunLoader->MakeTree("H");
{'fraction_non_alphanumeric': 0.1634989695443096, 'fraction_numerical': 0.010762537210899932, 'mean_word_length': 3.4475560081466394, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4522171', 'n_tokens_mistral': 2808, 'n_tokens_neox': 2687, 'n_words': 501}