X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=JETAN%2FAliUA1JetFinderV1.cxx;h=378c8c6d6d7a0502cb980bf38befad725732b139;hb=412f4f3d9dc35f0802c5eba8cf044c6a9a1787cb;hp=b96977fce31dc54385cd16b385967d69b6faaf88;hpb=1eef1eb4c3cb2d7b9720fff48a3f0488eabcf3e9;p=u%2Fmrichter%2FAliRoot.git diff --git a/JETAN/AliUA1JetFinderV1.cxx b/JETAN/AliUA1JetFinderV1.cxx index b96977fce31..378c8c6d6d7 100644 --- a/JETAN/AliUA1JetFinderV1.cxx +++ b/JETAN/AliUA1JetFinderV1.cxx @@ -33,8 +33,11 @@ #include "AliUA1JetHeaderV1.h" #include "AliJetReaderHeader.h" #include "AliJetReader.h" -#include "AliJet.h" +#include "AliJetHeader.h" + + #include "AliAODJet.h" +#include "AliLog.h" ClassImp(AliUA1JetFinderV1) @@ -103,8 +106,6 @@ void AliUA1JetFinderV1::FindJets() etbgTotal+= ptT[i]; } - fJets->SetNinput(nIn); - // calculate total energy and fluctuation in map Double_t meanpt = hPtTotal->GetMean(); Double_t ptRMS = hPtTotal->GetRMS(); @@ -161,12 +162,32 @@ void AliUA1JetFinderV1::FindJets() etbgTotal = etbgTotalN; // update with new background estimation } //end while + // add tracks to the jet if it wasn't yet done + if (header->GetBackgMode() == 0){ + Float_t rc= header->GetRadius(); + for(Int_t jpart = 0; jpart < nIn; jpart++){ // loop for all particles in array + for(Int_t ijet=0; ijet TMath::Pi()) dphi = 2.0 * TMath::Pi() - dphi; + Float_t dr = TMath::Sqrt(deta * deta + dphi * dphi); + if(dr <= rc){ // particles inside this cone + injet[jpart] = ijet; + break; + } + }// end jets loop + } //end particle loop + } + // add jets to list Int_t* idxjets = new Int_t[nj]; Int_t nselectj = 0; // printf("Found %d jets \n", nj); - TRefArray *refs = fReader->GetReferences(); + TRefArray *refs = 0; + Bool_t fromAod = !strcmp(fReader->ClassName(),"AliJetAODReader"); + if (fromAod) refs = fReader->GetReferences(); for(Int_t kj=0; kj (header->GetJetEtaMax())) || (etaJet[kj] < (header->GetJetEtaMin())) || @@ -176,12 +197,14 @@ void AliUA1JetFinderV1::FindJets() 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); - for(Int_t jpart = 0; jpart < nIn; jpart++) // loop for all particles in array - if (injet[jpart] == kj && fReader->GetCutFlag(jpart) == 1) - jet.AddTrack(refs->At(jpart)); // check if the particle belongs to the jet and add the ref + if (fromAod){ + for(Int_t jpart = 0; jpart < nIn; jpart++) // loop for all particles in array + if (injet[jpart] == kj && fReader->GetCutFlag(jpart) == 1) + jet.AddTrack(refs->At(jpart)); // check if the particle belongs to the jet and add the ref + } //jet.Print(""); @@ -213,15 +236,6 @@ void AliUA1JetFinderV1::FindJets() } 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; @@ -252,21 +266,26 @@ void AliUA1JetFinderV1::RunAlgoritm(Float_t etbgTotal, Double_t dEtTotal, Int_t& { //dump lego - // check enough space! *to be done* AliUA1JetHeaderV1* header = (AliUA1JetHeaderV1*) fHeader; - const Int_t nBinsMax = 70000; + const Int_t nBinsMax = 120000; // we use a fixed array not to fragment memory + const Int_t nBinEta = header->GetLegoNbinEta(); + const Int_t nBinPhi = header->GetLegoNbinPhi(); + if((nBinPhi*nBinEta)>nBinsMax){ + AliError("Too many bins of the ETA-PHI histogram"); + } + Float_t etCell[nBinsMax]; //! Cell Energy Float_t etaCell[nBinsMax]; //! Cell eta Float_t phiCell[nBinsMax]; //! Cell phi - Int_t flagCell[nBinsMax]; //! Cell flag + Short_t flagCell[nBinsMax]; //! Cell flag Int_t nCell = 0; TAxis* xaxis = fLego->GetXaxis(); TAxis* yaxis = fLego->GetYaxis(); Float_t e = 0.0; - for (Int_t i = 1; i <= header->GetLegoNbinEta(); i++) { - for (Int_t j = 1; j <= header->GetLegoNbinPhi(); j++) { + for (Int_t i = 1; i <= nBinEta; i++) { + for (Int_t j = 1; j <= nBinPhi; j++) { e = fLego->GetBinContent(i,j); if (e < 0.0) continue; // don't include this cells Float_t eta = xaxis->GetBinCenter(i); @@ -448,10 +467,10 @@ void AliUA1JetFinderV1::RunAlgoritm(Float_t etbgTotal, Double_t dEtTotal, Int_t& } //////////////////////////////////////////////////////////////////////// -void AliUA1JetFinderV1::SubtractBackg(Int_t& nIn, Int_t&nJ, Float_t&etbgTotalN, - Float_t* ptT, Float_t* etaT, Float_t* phiT, - Float_t* etJet,Float_t* etaJet, Float_t* phiJet, Float_t* etsigJet, - Int_t* multJet, Int_t* injet) +void AliUA1JetFinderV1::SubtractBackg(const Int_t& nIn, const Int_t&nJ, Float_t&etbgTotalN, + const Float_t* ptT, const Float_t* etaT, const Float_t* phiT, + Float_t* etJet, const Float_t* etaJet, const Float_t* phiJet, Float_t* etsigJet, + Int_t* multJet, Int_t* injet) { //background subtraction using cone method but without correction in dE/deta distribution @@ -515,10 +534,10 @@ void AliUA1JetFinderV1::SubtractBackg(Int_t& nIn, Int_t&nJ, Float_t&etbgTotalN, //////////////////////////////////////////////////////////////////////// -void AliUA1JetFinderV1::SubtractBackgStat(Int_t& nIn, Int_t&nJ,Float_t&etbgTotalN, - Float_t* ptT, Float_t* etaT, Float_t* phiT, - Float_t* etJet,Float_t* etaJet, Float_t* phiJet, Float_t* etsigJet, - Int_t* multJet, Int_t* injet) +void AliUA1JetFinderV1::SubtractBackgStat(const Int_t& nIn, const Int_t&nJ,Float_t&etbgTotalN, + const Float_t* ptT, const Float_t* etaT, const Float_t* phiT, + Float_t* etJet, const Float_t* etaJet, const Float_t* phiJet, Float_t* etsigJet, + Int_t* multJet, Int_t* injet) { //background subtraction using statistical method @@ -579,10 +598,10 @@ void AliUA1JetFinderV1::SubtractBackgStat(Int_t& nIn, Int_t&nJ,Float_t&etbgTotal //////////////////////////////////////////////////////////////////////// -void AliUA1JetFinderV1::SubtractBackgCone(Int_t& nIn, Int_t&nJ,Float_t& etbgTotalN, - Float_t* ptT, Float_t* etaT, Float_t* phiT, - Float_t* etJet,Float_t* etaJet, Float_t* phiJet, Float_t* etsigJet, - Int_t* multJet, Int_t* injet) +void AliUA1JetFinderV1::SubtractBackgCone(const Int_t& nIn, const Int_t&nJ,Float_t& etbgTotalN, + const Float_t* ptT, const Float_t* etaT, const Float_t* phiT, + Float_t* etJet, const Float_t* etaJet, const Float_t* phiJet, Float_t* etsigJet, + Int_t* multJet, Int_t* injet) { // Cone background subtraction method taking into acount dEt/deta distribution AliUA1JetHeaderV1* header = (AliUA1JetHeaderV1*) fHeader; @@ -694,10 +713,10 @@ void AliUA1JetFinderV1::SubtractBackgCone(Int_t& nIn, Int_t&nJ,Float_t& etbgTota //////////////////////////////////////////////////////////////////////// -void AliUA1JetFinderV1::SubtractBackgRatio(Int_t& nIn, Int_t&nJ,Float_t& etbgTotalN, - Float_t* ptT, Float_t* etaT, Float_t* phiT, - Float_t* etJet,Float_t* etaJet, Float_t* phiJet, Float_t* etsigJet, - Int_t* multJet, Int_t* injet) +void AliUA1JetFinderV1::SubtractBackgRatio(const Int_t& nIn, const Int_t&nJ, Float_t& etbgTotalN, + const Float_t* ptT, const Float_t* etaT, const Float_t* phiT, + Float_t* etJet, const Float_t* etaJet, const Float_t* phiJet, Float_t* etsigJet, + Int_t* multJet, Int_t* injet) { // Ratio background subtraction method taking into acount dEt/deta distribution AliUA1JetHeaderV1* header = (AliUA1JetHeaderV1*) fHeader; @@ -816,7 +835,6 @@ void AliUA1JetFinderV1::SubtractBackgRatio(Int_t& nIn, Int_t&nJ,Float_t& etbgTot void AliUA1JetFinderV1::Reset() { fLego->Reset(); - fJets->ClearJets(); AliJetFinder::Reset(); }