From: morsch Date: Tue, 28 Jan 2003 16:08:11 +0000 (+0000) Subject: Particle loading according to generator type. X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=220d7b7b4e3eab373c40be1d19f65ab61c15a249 Particle loading according to generator type. --- diff --git a/EMCAL/AliEMCALJetFinder.cxx b/EMCAL/AliEMCALJetFinder.cxx index 12618dd122b..9e60107c2c5 100644 --- a/EMCAL/AliEMCALJetFinder.cxx +++ b/EMCAL/AliEMCALJetFinder.cxx @@ -15,6 +15,11 @@ /* $Log$ +Revision 1.37 2003/01/23 11:50:04 morsch +- option for adding energy of all particles (ich == 2) +- provisions for principle component analysis +(M. Horner) + Revision 1.36 2003/01/15 19:05:44 morsch Updated selection in ReadFromTracks() @@ -171,7 +176,7 @@ Revision 1.3 2002/01/18 05:07:56 morsch #include "AliMagF.h" #include "AliMagFCM.h" #include "AliRun.h" - +#include "AliGenerator.h" // Interface to FORTRAN #include "Ecommon.h" @@ -208,6 +213,8 @@ AliEMCALJetFinder::AliEMCALJetFinder() fInFile = 0; fEvent = 0; + fRandomBg = 0; + SetParametersForBgSubtraction(); } @@ -256,6 +263,7 @@ AliEMCALJetFinder::AliEMCALJetFinder(const char* name, const char *title) SetHadronCorrection(); SetIncludeK0andN(); + fRandomBg = 0; SetParametersForBgSubtraction(); } @@ -359,6 +367,8 @@ void AliEMCALJetFinder::Init() // // I/O if (fOutFileName) fOutFile = new TFile(fOutFileName, "recreate"); +// +// } void AliEMCALJetFinder::Find(Int_t ncell, Int_t ncell_tot, Float_t etc[30000], @@ -768,16 +778,23 @@ void AliEMCALJetFinder::DumpLego() Float_t e, eH; for (Int_t i = 1; i <= fNbinEta; i++) { for (Int_t j = 1; j <= fNbinPhi; j++) { + e = fLego->GetBinContent(i,j); - if (e > 0.0) { - Float_t eta = Xaxis->GetBinCenter(i); - Float_t phi = Yaxis->GetBinCenter(j); - fEtCell[fNcell] = e; - fEtaCell[fNcell] = eta; - fPhiCell[fNcell] = phi; - fNcell++; - fhCellEt->Fill(e); - } + if (fRandomBg) { + if (gRandom->Rndm() < 0.5) { + Float_t ebg = 0.28 * TMath::Abs(gRandom->Gaus(0.,1.)); + e += ebg; + } + } + if (e > 0.0) e -= fMinCellEt; + if (e < 0.0) e = 0.; + Float_t eta = Xaxis->GetBinCenter(i); + Float_t phi = Yaxis->GetBinCenter(j); + fEtCell[fNcell] = e; + fEtaCell[fNcell] = eta; + fPhiCell[fNcell] = phi; + fNcell++; + fhCellEt->Fill(e); if(fhLegoEMCAL) { eH = fhLegoEMCAL->GetBinContent(i,j); if(eH > 0.0) fhCellEMCALEt->Fill(eH); @@ -804,6 +821,23 @@ void AliEMCALJetFinder::ResetMap() void AliEMCALJetFinder::FillFromTracks(Int_t flag, Int_t ich) { +// Which generator +// + const char* name = gAlice->Generator()->GetName(); + enum {kPythia, kHijing, kHijingPara}; + Int_t genType = 0; + + if (!strcmp(name, "Hijing")){ + genType = kHijing; + } else if (!strcmp(name, "Pythia")) { + genType = kPythia; + } else if (!strcmp(name, "HIJINGpara") ||!strcmp(name, "HIGINGpara")) { + genType = kHijingPara; + } + if (fDebug>=2) + printf("Fill tracks generated by %s %d\n", name, genType); + + // // Fill Cells with track information // @@ -861,7 +895,7 @@ void AliEMCALJetFinder::FillFromTracks(Int_t flag, Int_t ich) part, mpart, child1, MPart->GetLastDaughter(), MPart->GetStatusCode()); } - if (fDebug >= 2) { + if (fDebug >= 2 && genType == kPythia) { if (part == 6 || part == 7) { printf("\n Simulated Jet (pt, eta, phi): %d %f %f %f\n", @@ -875,8 +909,14 @@ void AliEMCALJetFinder::FillFromTracks(Int_t flag, Int_t ich) fPhiT[part] = phi; fPdgT[part] = mpart; -// if (part < 2) continue; - if (MPart->GetStatusCode() != 1) continue; +// final state particles only + + if (genType == kPythia) { + if (MPart->GetStatusCode() != 1) continue; + } else if (genType == kHijing) { + if (child1 >= 0 && child1 < npart) continue; + } + TParticlePDG* pdgP = 0; // charged or neutral