#include "AliJetReader.h"
#include "AliJetReaderHeader.h"
-#include "AliJet.h"
#include "AliAODJet.h"
#include "AliAODEvent.h"
#include "AliJetFinder.h"
if ( fNPart == 0 ) { return ; } // if event empty then exit
- fJets->SetNinput ( fNPart ) ; // number of input objects
-
fVectParticle = new varContainer* [fNPart]; // container for Particles
fPtArray = new Double_t [fNPart] ; // momentum array
#include "AliFastJetHeaderV1.h"
#include "AliJetReaderHeader.h"
#include "AliJetReader.h"
-#include "AliJet.h"
#include "AliJetUnitArray.h"
#include "fastjet/PseudoJet.hh"
if(lvArray == 0) { cout << "Could not get the momentum array" << endl; return; }
Int_t nIn = lvArray->GetEntries();
if(nIn == 0) { if (debug) cout << "entries = 0 ; Event empty !!!" << endl ; return; }
- fJets->SetNinput(nIn) ; // number of input objects
Float_t px,py,pz,en;
// load input vectors
for(Int_t i = 0; i < nIn; i++){ // loop for all input particles
else {
TClonesArray* fUnit = fReader->GetUnitArray();
if(fUnit == 0) { cout << "Could not get the momentum array" << endl; return; }
- Int_t nCandidate = fReader->GetNumCandidate();
Int_t nIn = fUnit->GetEntries();
if(nIn == 0) { if (debug) cout << "entries = 0 ; Event empty !!!" << endl ; return; }
- fJets->SetNinput(nCandidate); // number of input objects // ME
// Information extracted from fUnitArray
// load input vectors and calculate total energy in array
Float_t pt,eta,phi,theta,px,py,pz,en;
#include <TFile.h>
#include "AliJetFinder.h"
-#include "AliJet.h"
#include "AliAODJet.h"
-#include "AliJetControlPlots.h"
-#include "AliLeading.h"
#include "AliAODEvent.h"
#include "AliJetUnitArray.h"
ClassImp(AliJetFinder)
AliJetFinder::AliJetFinder():
- fTreeJ(0),
- fPlotMode(kFALSE),
- fJets(0),
- fGenJets(0),
- fLeading(0),
fReader(0x0),
fHeader(0x0),
fAODjets(0x0),
- fNAODjets(0),
- fPlots(0x0),
- fOut(0x0)
-
+ fNAODjets(0)
{
//
// Constructor
//
-
- fJets = new AliJet();
- fGenJets = new AliJet();
- fLeading = new AliLeading();
fAODjets = 0;
}
//
// Destructor
//
-
- // Reset and delete jets
- fJets->ClearJets();
- delete fJets;
- fGenJets->ClearJets();
- delete fGenJets;
- // close file
- if (fOut) {
- fOut->Close();
- fOut->Delete();
- }
- delete fOut;
- // reset and delete control plots
- if (fPlots) delete fPlots;
-}
-
-////////////////////////////////////////////////////////////////////////
-void AliJetFinder::SetOutputFile(const char */*name*/)
-{
- // opens output file
- // fOut = new TFile(name,"recreate");
-}
-
-////////////////////////////////////////////////////////////////////////
-void AliJetFinder::PrintJets()
-{
- // Print jet information
- cout << " Jets found with jet algorithm:" << endl;
- fJets->PrintJets();
- cout << " Jets found by pythia:" << endl;
- fGenJets->PrintJets();
}
-////////////////////////////////////////////////////////////////////////
-void AliJetFinder::SetPlotMode(Bool_t b)
-{
- // Sets the plotting mode
- fPlotMode=b;
- if (b && !fPlots) fPlots = new AliJetControlPlots();
-}
-////////////////////////////////////////////////////////////////////////
-TTree* AliJetFinder::MakeTreeJ(char* name)
-{
- // Create the tree for reconstructed jets
- fTreeJ = new TTree(name, "AliJet");
- fTreeJ->Branch("FoundJet", &fJets, 1000);
- fTreeJ->Branch("GenJet", &fGenJets,1000);
- fTreeJ->Branch("LeadingPart",&fLeading,1000);
- return fTreeJ;
-}
////////////////////////////////////////////////////////////////////////
void AliJetFinder::WriteRHeaderToFile()
rh->Write();
}
-////////////////////////////////////////////////////////////////////////
-void AliJetFinder::Run()
-{
- // Do some initialization
- Init();
- // connect files
- fReader->OpenInputFiles();
-
- // write headers
- WriteHeaders();
- // loop over events
- Int_t nFirst, nLast, option, debug, arrayInitialised;
- nFirst = fReader->GetReaderHeader()->GetFirstEvent();
- nLast = fReader->GetReaderHeader()->GetLastEvent();
-
- option = fReader->GetReaderHeader()->GetDetector();
- debug = fReader->GetReaderHeader()->GetDebug();
- arrayInitialised = fReader->GetArrayInitialised();
-
- // loop over events
- for (Int_t i=nFirst;i<nLast;i++) {
- fReader->FillMomentumArray();
- fLeading->FindLeading(fReader);
- fReader->GetGenJets(fGenJets);
-
- if (option == 0) { // TPC with fMomentumArray
- if(debug > 1)
- printf("In FindJetsC() routine: find jets with fMomentumArray !!!\n");
- FindJetsC();
- } else {
- if(debug > 1) printf("In FindJets() routine: find jets with fUnitArray !!!\n");
- FindJets();
- }
- if (fOut) {
- fOut->cd();
- }
-
- if (fPlots) fPlots->FillHistos(fJets);
- fLeading->Reset();
- fGenJets->ClearJets();
- Reset();
- }
-
- // write out
- if (fPlots) {
- fPlots->Normalize();
- fPlots->PlotHistos();
- }
- if (fOut) {
- fOut->cd();
- fPlots->Write();
- fOut->Close();
- }
-}
-
-
-//
-// The following methods have been added to allow for event steering from the outside
-//
////////////////////////////////////////////////////////////////////////
void AliJetFinder::ConnectTree(TTree* tree, TObject* data)
Bool_t ok = fReader->FillMomentumArray();
if (!ok) return kFALSE;
-
- // Leading particles
- fLeading->FindLeading(fReader);
// Jets
FindJets(); // V1
- // FindJetsC(); // V2
-
- if (fPlots) fPlots->FillHistos(fJets);
- fLeading->Reset();
- fGenJets->ClearJets();
Reset();
return kTRUE;
}
// Delete reference pointer
if (!ok) {delete ref; return kFALSE;}
-
- // Leading particles
- fLeading->FindLeading(fReader);
// Jets
FindJets();
- Int_t nEntRef = ref->GetEntries();
+ Int_t nEntRef = ref->GetEntries();
for(Int_t i=0; i<nEntRef; i++)
{
ref->Delete();
delete ref;
- if (fPlots) fPlots->FillHistos(fJets);
- fLeading->Reset();
- fGenJets->ClearJets();
Reset();
return kTRUE;
}
-////////////////////////////////////////////////////////////////////////
-void AliJetFinder::FinishRun()
-{
- // Finish a run
- if (fPlots) {
- fPlots->Normalize();
- fPlots->PlotHistos();
- }
-
- if (fOut) {
- fOut->cd();
- if (fPlots) {
- fPlots->Write();
- }
- fOut->Close();
- }
-}
-////////////////////////////////////////////////////////////////////////
void AliJetFinder::AddJet(AliAODJet p)
{
// Add new jet to the list
new ((*fAODjets)[fNAODjets++]) AliAODJet(p);
}
-////////////////////////////////////////////////////////////////////////
void AliJetFinder::ConnectAOD(AliAODEvent* aod)
{
// Connect to the AOD
#include "AliAODJet.h"
#include "AliJetReader.h"
#include "AliJetHeader.h"
-#include "AliJet.h"
#include "AliJetReaderHeader.h"
-class TFile;
class TChain;
-//class AliJet;
-//class AliJetHeader;
-class AliJetControlPlots;
-class AliLeading;
class AliAODJet;
class AliAODEvent;
AliJetFinder();
virtual ~AliJetFinder();
- // getters
+ // Getters
virtual AliJetReader *GetReader() {return fReader;}
virtual AliJetHeader *GetHeader() {return fHeader;}
- virtual AliJet *GetJets() {return fJets;}
- virtual Bool_t GetPlotMode() const {return fPlotMode;}
- virtual TFile *GetOutputFile() {return fOut;}
- // setters
- virtual void SetPlotMode(Bool_t b);
- virtual void SetOutputFile(const char *name="jets.root");
+ // Setters
virtual void SetJetReader(AliJetReader* r) {fReader=r;}
virtual void SetJetHeader(AliJetHeader* h) {fHeader=h;}
- // others
+ // Others
virtual void AddJet(AliAODJet jet);
- virtual void PrintJets();
- virtual void Run();
virtual void WriteRHeaderToFile();
// the following have to be implemented for each specific finder
virtual void Init() {}
// some methods to allow steering from the outside
virtual Bool_t ProcessEvent();
virtual Bool_t ProcessEvent2();
- virtual void FinishRun();
virtual void ConnectTree(TTree* tree, TObject* data);
virtual void ConnectAOD(AliAODEvent* aod);
virtual void ConnectAODNonStd(AliAODEvent* aod,const char* bname);
- virtual TTree *MakeTreeJ(char* name);
virtual void WriteHeaders();
- virtual void WriteJetsToFile() const {;}
- virtual void TestJet() {;}
protected:
AliJetFinder(const AliJetFinder& rJetFinder);
AliJetFinder& operator = (const AliJetFinder& rhsf);
- TTree* fTreeJ; //! pointer to jet tree
- Bool_t fPlotMode; //! do you want control plots?
- AliJet* fJets; //! pointer to jet class
- AliJet* fGenJets; //! pointer to generated jets
- AliLeading* fLeading; //! pointer to leading particle data
AliJetReader* fReader; // pointer to reader
AliJetHeader* fHeader; // pointer to header
TClonesArray* fAODjets; //! reconstructed jets
Int_t fNAODjets; //! number of reconstructed jets
- AliJetControlPlots* fPlots; //! pointer to control plots
- TFile* fOut; //! output file
-
ClassDef(AliJetFinder,2)
};
#include "AliPxconeJetFinder.h"
#include "AliPxconeJetHeader.h"
#include "AliJetReader.h"
-#include "AliJet.h"
ClassImp(AliPxconeJetFinder)
#include <TClonesArray.h>
#include "AliHeader.h"
-#include "AliJet.h"
#include "AliJetKineReader.h"
#include "AliJetReader.h"
#include "AliJetReaderHeader.h"
return;
}
- fJets->SetNinput(nIn) ; // fJets = AliJet number of input objects
Float_t px,py,pz,en;
// Load input vectors
else {
TClonesArray* fUnit = fReader->GetUnitArray();
if(fUnit == 0) { cout << "Could not get the momentum array" << endl; return; }
- Int_t nCandidate = fReader->GetNumCandidate();
Int_t nIn = fUnit->GetEntries();
if(nIn == 0) { if (debug) cout << "entries = 0 ; Event empty !!!" << endl ; return; }
- fJets->SetNinput(nCandidate); // number of input objects // ME
- // Information extracted from fUnitArray
+ // Information extracted from fUnitArray
// load input vectors and calculate total energy in array
Float_t pt,eta,phi,theta,px,py,pz,en;
Int_t ipart = 0;
#include "AliUA1JetHeaderV1.h"
#include "AliJetReaderHeader.h"
#include "AliJetReader.h"
-#include "AliJet.h"
#include "AliAODJet.h"
#include "AliLog.h"
etbgTotal+= ptT[i];
}
- fJets->SetNinput(nIn);
-
// calculate total energy and fluctuation in map
Double_t meanpt = hPtTotal->GetMean();
Double_t ptRMS = hPtTotal->GetRMS();
py = etJet[kj] * TMath::Sin(phiJet[kj]);
pz = etJet[kj] / TMath::Tan(2.0 * TMath::ATan(TMath::Exp(-etaJet[kj])));
en = TMath::Sqrt(px * px + py * py + pz * pz);
- fJets->AddJet(px, py, pz, en);
+
AliAODJet jet(px, py, pz, en);
if (fromAod){
}
if(bflag == 0) injet[bj] = -1; // set as background particle
}
- fJets->SetNCells(ncells);
- fJets->SetPtFromSignal(percentage);
- fJets->SetMultiplicities(mult);
- fJets->SetInJet(injet);
- fJets->SetEtaIn(etaT);
- fJets->SetPhiIn(phiT);
- fJets->SetPtIn(ptT);
- fJets->SetEtAvg(etbgTotal/(4*(header->GetLegoEtaMax())*TMath::Pi()));
-
//delete
delete [] ptT;
void AliUA1JetFinderV1::Reset()
{
fLego->Reset();
- fJets->ClearJets();
AliJetFinder::Reset();
}
etbgTotal+= ptT[i];
}
- fJets->SetNinput(nIn);
// calculate total energy and fluctuation in map
Double_t meanpt = hPtTotal->GetMean();
py = etJetOk[kj] * TMath::Sin(phiJetOk[kj]);
pz = etJetOk[kj] / TMath::Tan(2.0 * TMath::ATan(TMath::Exp(-etaJetOk[kj])));
en = TMath::Sqrt(px * px + py * py + pz * pz);
- fJets->AddJet(px, py, pz, en);
AliAODJet jet(px, py, pz, en);
jet.Print("");
if(bflag == 0) injet[bj] = -1; // set as background particle
}
- fJets->SetNCells(ncells);
- fJets->SetPtFromSignal(percentage);
- fJets->SetMultiplicities(mult);
- fJets->SetInJet(injet);
- fJets->SetEtaIn(etaT);
- fJets->SetPhiIn(phiT);
- fJets->SetPtIn(ptT);
- fJets->SetEtAvg(etbgTotal/(4*(header->GetLegoEtaMax())*TMath::Pi()));
//delete
delete[] ptT;
}
} // end loop on nCandidate
- fJets->SetNinput(nCandidate);
// calculate total energy and fluctuation in map
Double_t meanpt = hPtTotal->GetMean();
py = etJetOk[kj] * TMath::Sin(phiJetOk[kj]);
pz = etJetOk[kj] / TMath::Tan(2.0 * TMath::ATan(TMath::Exp(-etaJetOk[kj])));
en = TMath::Sqrt(px * px + py * py + pz * pz);
- fJets->AddJet(px, py, pz, en);
+
AliAODJet jet(px, py, pz, en);
jet.Print("");
if(bflag == 0) injet[bj] = -1; // set as background particle
}
- fJets->SetNCells(ncells);
- fJets->SetPtFromSignal(percentage);
- fJets->SetMultiplicities(mult);
- fJets->SetInJet(injet);
- fJets->SetEtaIn(etaT);
- fJets->SetPhiIn(phiT);
- fJets->SetPtIn(ptT);
- fJets->SetTrackReferences(trackRef);
- fJets->SetDetectorFlagIn(detT);
- fJets->SetEtAvg(etbgTotal/(2*(header->GetLegoEtaMax())*(header->GetLegoPhiMax()-header->GetLegoPhiMin())));
//delete
delete ptT;
void AliUA1JetFinderV2::Reset()
{
fLego->Reset();
- fJets->ClearJets();
AliJetFinder::Reset();
}