ROOT logo
/**************************************************************************
 * 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 input particles
// manages the search for jets
// Authors: Elena Bruna elena.bruna@yale.edu
//
// ** 2011 magali.estienne@subatech.in2p3.fr &  alexandre.shabetai@cern.ch
// Modified accordingly to reader/finder splitting and new handling of neutral information
//---------------------------------------------------------------------

#include <Riostream.h> 

#include "AliJetHeader.h"
#include "AliFastJetHeaderV1.h"
#include "AliFastJetInput.h"
#include "AliJetCalTrk.h"

#include "fastjet/PseudoJet.hh"

#include<vector> 

using namespace std;

ClassImp(AliFastJetInput)

////////////////////////////////////////////////////////////////////////

AliFastJetInput::AliFastJetInput():
  fHeader(0x0),
  fCalTrkEvent(0x0),
  fInputParticles(0),
  fInputParticlesCh(0)
{
  // Default constructor
}

//______________________________________________________________________
AliFastJetInput::AliFastJetInput(const AliFastJetInput &input):
  TObject(input),
  fHeader(input.fHeader),
  fCalTrkEvent(input.fCalTrkEvent),
  fInputParticles(input.fInputParticles),
  fInputParticlesCh(input.fInputParticlesCh)
{
  // copy constructor
}

//______________________________________________________________________
AliFastJetInput& AliFastJetInput::operator=(const AliFastJetInput& source)
{
  // Assignment operator. 
  if(this!=&source){
   TObject::operator=(source);
   fHeader = source.fHeader;
   fCalTrkEvent = source.fCalTrkEvent;
   fInputParticles = source.fInputParticles;
   fInputParticlesCh = source.fInputParticlesCh;
  }

  return *this;

}

//___________________________________________________________
void AliFastJetInput::FillInput()
{
  // fills input particles for FASTJET based analysis
  
  AliFastJetHeaderV1 *header = (AliFastJetHeaderV1*)fHeader;
  Int_t debug  = header->GetDebug();     // debug option

  if(debug>0) cout<<"-------- AliFastJetInput::FillInput()  ----------------"<<endl;

  fInputParticles.clear();
  fInputParticlesCh.clear();

  // RUN ALGORITHM  
  // read input particles -----------------------------
  vector<fastjet::PseudoJet> inputParticles;

  if(fCalTrkEvent == 0) { cout << "Could not get the CalTrk Event" << endl; return; }
  Int_t nIn =  fCalTrkEvent->GetNCalTrkTracks() ;
  if(nIn == 0) { if (debug>0) cout << "entries = 0 ; Event empty !!!" << endl ; return; }

  // Information extracted from fCalTrkEvent
  // load input vectors and calculate total energy in array
  Float_t px = -999., py = -999., pz = -999., en = -999.; 
 
  // Fill charged tracks
  for(Int_t i = 0; i < fCalTrkEvent->GetNCalTrkTracks(); i++)
    { // loop for all input particles
      if (fCalTrkEvent->GetCalTrkTrack(i)->GetCutFlag() != 1) continue;
      px =  fCalTrkEvent->GetCalTrkTrack(i)->GetPx();
      py =  fCalTrkEvent->GetCalTrkTrack(i)->GetPy();
      pz =  fCalTrkEvent->GetCalTrkTrack(i)->GetPz();
      en =  fCalTrkEvent->GetCalTrkTrack(i)->GetP();

      fastjet::PseudoJet inputPart(px,py,pz,en);  // create PseudoJet object
      inputPart.set_user_index(i);      //label the particle into Fastjet algortihm
      fInputParticles.push_back(inputPart);       // back of the inputParticles vector
 
      // only for charged particles (TPC+ITS)
      fastjet::PseudoJet inputPartCh(px,py,pz,en); // create PseudoJet object
      inputPartCh.set_user_index(i);               //label the particle into Fastjet algortihm
      fInputParticlesCh.push_back(inputPartCh);    // back of the inputParticles vector
    } // End loop on CalTrk

}

//_____________________________________________________________________
Double_t AliFastJetInput::Thermalspectrum(const Double_t *x, const Double_t *par)
{
  // compute an exponential function
  return x[0]*TMath::Exp(-x[0]/par[0]);

}
 AliFastJetInput.cxx:1
 AliFastJetInput.cxx:2
 AliFastJetInput.cxx:3
 AliFastJetInput.cxx:4
 AliFastJetInput.cxx:5
 AliFastJetInput.cxx:6
 AliFastJetInput.cxx:7
 AliFastJetInput.cxx:8
 AliFastJetInput.cxx:9
 AliFastJetInput.cxx:10
 AliFastJetInput.cxx:11
 AliFastJetInput.cxx:12
 AliFastJetInput.cxx:13
 AliFastJetInput.cxx:14
 AliFastJetInput.cxx:15
 AliFastJetInput.cxx:16
 AliFastJetInput.cxx:17
 AliFastJetInput.cxx:18
 AliFastJetInput.cxx:19
 AliFastJetInput.cxx:20
 AliFastJetInput.cxx:21
 AliFastJetInput.cxx:22
 AliFastJetInput.cxx:23
 AliFastJetInput.cxx:24
 AliFastJetInput.cxx:25
 AliFastJetInput.cxx:26
 AliFastJetInput.cxx:27
 AliFastJetInput.cxx:28
 AliFastJetInput.cxx:29
 AliFastJetInput.cxx:30
 AliFastJetInput.cxx:31
 AliFastJetInput.cxx:32
 AliFastJetInput.cxx:33
 AliFastJetInput.cxx:34
 AliFastJetInput.cxx:35
 AliFastJetInput.cxx:36
 AliFastJetInput.cxx:37
 AliFastJetInput.cxx:38
 AliFastJetInput.cxx:39
 AliFastJetInput.cxx:40
 AliFastJetInput.cxx:41
 AliFastJetInput.cxx:42
 AliFastJetInput.cxx:43
 AliFastJetInput.cxx:44
 AliFastJetInput.cxx:45
 AliFastJetInput.cxx:46
 AliFastJetInput.cxx:47
 AliFastJetInput.cxx:48
 AliFastJetInput.cxx:49
 AliFastJetInput.cxx:50
 AliFastJetInput.cxx:51
 AliFastJetInput.cxx:52
 AliFastJetInput.cxx:53
 AliFastJetInput.cxx:54
 AliFastJetInput.cxx:55
 AliFastJetInput.cxx:56
 AliFastJetInput.cxx:57
 AliFastJetInput.cxx:58
 AliFastJetInput.cxx:59
 AliFastJetInput.cxx:60
 AliFastJetInput.cxx:61
 AliFastJetInput.cxx:62
 AliFastJetInput.cxx:63
 AliFastJetInput.cxx:64
 AliFastJetInput.cxx:65
 AliFastJetInput.cxx:66
 AliFastJetInput.cxx:67
 AliFastJetInput.cxx:68
 AliFastJetInput.cxx:69
 AliFastJetInput.cxx:70
 AliFastJetInput.cxx:71
 AliFastJetInput.cxx:72
 AliFastJetInput.cxx:73
 AliFastJetInput.cxx:74
 AliFastJetInput.cxx:75
 AliFastJetInput.cxx:76
 AliFastJetInput.cxx:77
 AliFastJetInput.cxx:78
 AliFastJetInput.cxx:79
 AliFastJetInput.cxx:80
 AliFastJetInput.cxx:81
 AliFastJetInput.cxx:82
 AliFastJetInput.cxx:83
 AliFastJetInput.cxx:84
 AliFastJetInput.cxx:85
 AliFastJetInput.cxx:86
 AliFastJetInput.cxx:87
 AliFastJetInput.cxx:88
 AliFastJetInput.cxx:89
 AliFastJetInput.cxx:90
 AliFastJetInput.cxx:91
 AliFastJetInput.cxx:92
 AliFastJetInput.cxx:93
 AliFastJetInput.cxx:94
 AliFastJetInput.cxx:95
 AliFastJetInput.cxx:96
 AliFastJetInput.cxx:97
 AliFastJetInput.cxx:98
 AliFastJetInput.cxx:99
 AliFastJetInput.cxx:100
 AliFastJetInput.cxx:101
 AliFastJetInput.cxx:102
 AliFastJetInput.cxx:103
 AliFastJetInput.cxx:104
 AliFastJetInput.cxx:105
 AliFastJetInput.cxx:106
 AliFastJetInput.cxx:107
 AliFastJetInput.cxx:108
 AliFastJetInput.cxx:109
 AliFastJetInput.cxx:110
 AliFastJetInput.cxx:111
 AliFastJetInput.cxx:112
 AliFastJetInput.cxx:113
 AliFastJetInput.cxx:114
 AliFastJetInput.cxx:115
 AliFastJetInput.cxx:116
 AliFastJetInput.cxx:117
 AliFastJetInput.cxx:118
 AliFastJetInput.cxx:119
 AliFastJetInput.cxx:120
 AliFastJetInput.cxx:121
 AliFastJetInput.cxx:122
 AliFastJetInput.cxx:123
 AliFastJetInput.cxx:124
 AliFastJetInput.cxx:125
 AliFastJetInput.cxx:126
 AliFastJetInput.cxx:127
 AliFastJetInput.cxx:128
 AliFastJetInput.cxx:129
 AliFastJetInput.cxx:130
 AliFastJetInput.cxx:131
 AliFastJetInput.cxx:132