//*-- Authors: Andreas Morsch (CERN)
//* J.L. Klay (LBL)
//* Aleksei Pavlinov (WSU)
+//--
+//--
+//
#include <stdio.h>
// From root ...
#include "AliEMCALGetter.h"
// Interface to FORTRAN
#include "Ecommon.h"
+#include "AliMC.h"
ClassImp(AliEMCALJetFinder)
//
}
-void AliEMCALJetFinder::Find(Int_t ncell, Int_t ncell_tot, Float_t etc[30000],
+void AliEMCALJetFinder::Find(Int_t ncell, Int_t ncelltot, Float_t etc[30000],
Float_t etac[30000], Float_t phic[30000],
- Float_t min_move, Float_t max_move, Int_t mode,
- Float_t prec_bg, Int_t ierror)
+ Float_t minmove, Float_t maxmove, Int_t mode,
+ Float_t precbg, Int_t ierror)
{
// Wrapper for fortran coded jet finder
// Full argument list
- jet_finder_ua1(ncell, ncell_tot, etc, etac, phic,
- min_move, max_move, mode, prec_bg, ierror);
+ jet_finder_ua1(ncell, ncelltot, etc, etac, phic,
+ minmove, maxmove, mode, precbg, ierror);
// Write result to output
if(fWrite) WriteJets();
fEvent++;
// Wrapper for fortran coded jet finder using member data for
// argument list
- Float_t min_move = fMinMove;
- Float_t max_move = fMaxMove;
+ Float_t minmove = fMinMove;
+ Float_t maxmove = fMaxMove;
Int_t mode = fMode;
- Float_t prec_bg = fPrecBg;
+ Float_t precbg = fPrecBg;
Int_t ierror;
ResetJets(); // 4-feb-2002 by PAI
jet_finder_ua1(fNcell, fNtot, fEtCell, fEtaCell, fPhiCell,
- min_move, max_move, mode, prec_bg, ierror);
+ minmove, maxmove, mode, precbg, ierror);
fError = ierror;
// Write result to output
Int_t njet = Njets();
fJetT[nj]->SetIsWeightedEnergy(fWeightingMethod);
fJetT[nj]->SetEMCALEnergy( EMCALConeEnergy(JetEtaW(nj),JetPhiW(nj)) );
fJetT[nj]->SetTrackEnergy(TrackConeEnergy( JetEtaW(nj),JetPhiW(nj) ));
- fJetT[nj]->SetHCEnergy(HCConeEnergy( JetEtaW(nj),JetPhiW(nj) ));
}
Float_t AliEMCALJetFinder::EMCALConeEnergy(Float_t eta, Float_t phi)
{
+// Calculate the energy in the cone
Float_t newenergy = 0.0;
Float_t bineta,binphi;
TAxis *x = fhLegoEMCAL->GetXaxis();
Float_t AliEMCALJetFinder::TrackConeEnergy(Float_t eta, Float_t phi)
{
+// Calculate the track energy in the cone
Float_t newenergy = 0.0;
Float_t bineta,binphi;
TAxis *x = fhLegoTracks->GetXaxis();
return newenergy;
}
-Float_t AliEMCALJetFinder::HCConeEnergy(Float_t eta, Float_t phi)
-{
-//Float_t newenergy = 0.0;
-//Float_t bineta,binphi;
-//TAxis *x = fhLegoTracks->GetXaxis();
-//TAxis *y = fhLegoTracks->GetYaxis();
-//for (Int_t i = 0 ; i < fNbinEta ; i++) // x coord
-// {
-// for (Int_t j = 0 ; j < fNbinPhi ; j++) // y coord
-// {
-// bineta = x->GetBinCenter(i);
-// binphi = y->GetBinCenter(j);
-// if ( (bineta-eta)*(bineta-eta) + (binphi-phi)*(binphi-phi) < fConeRadius*fConeRadius)
-// {
-// newenergy += fhLegoTracks->GetBinContent(i,j);
-// }
-// }
-//}
-//return newenergy;
-
-return 0.0;
-
-}
-
-
Float_t AliEMCALJetFinder::WeightedJetEnergy(Float_t eta, Float_t phi)
{
-
-
+// Calculate the weighted jet energy
+
Float_t newenergy = 0.0;
Float_t bineta,binphi;
TAxis *x = fhLegoEMCAL->GetXaxis();
}
-Int_t AliEMCALJetFinder::Njets()
+Int_t AliEMCALJetFinder::Njets() const
{
// Get number of reconstructed jets
return EMCALJETS.njet;
}
-Float_t AliEMCALJetFinder::JetEnergy(Int_t i)
+Float_t AliEMCALJetFinder::JetEnergy(Int_t i) const
{
// Get reconstructed jet energy
return EMCALJETS.etj[i];
}
-Float_t AliEMCALJetFinder::JetPhiL(Int_t i)
+Float_t AliEMCALJetFinder::JetPhiL(Int_t i) const
{
// Get reconstructed jet phi from leading particle
return EMCALJETS.phij[0][i];
}
-Float_t AliEMCALJetFinder::JetPhiW(Int_t i)
+Float_t AliEMCALJetFinder::JetPhiW(Int_t i) const
{
// Get reconstructed jet phi from weighting
return EMCALJETS.phij[1][i];
}
-Float_t AliEMCALJetFinder::JetEtaL(Int_t i)
+Float_t AliEMCALJetFinder::JetEtaL(Int_t i) const
{
// Get reconstructed jet eta from leading particles
return EMCALJETS.etaj[0][i];
}
-Float_t AliEMCALJetFinder::JetEtaW(Int_t i)
+Float_t AliEMCALJetFinder::JetEtaW(Int_t i) const
{
// Get reconstructed jet eta from weighting
return EMCALJETS.etaj[1][i];
//
// Test the finder call
//
- const Int_t nmax = 30000;
+ const Int_t knmax = 30000;
Int_t ncell = 10;
- Int_t ncell_tot = 100;
+ Int_t ncelltot = 100;
- Float_t etc[nmax];
- Float_t etac[nmax];
- Float_t phic[nmax];
- Float_t min_move = 0;
- Float_t max_move = 0;
+ Float_t etc[knmax];
+ Float_t etac[knmax];
+ Float_t phic[knmax];
+ Float_t minmove = 0;
+ Float_t maxmove = 0;
Int_t mode = 0;
- Float_t prec_bg = 0;
+ Float_t precbg = 0;
Int_t ierror = 0;
- Find(ncell, ncell_tot, etc, etac, phic,
- min_move, max_move, mode, prec_bg, ierror);
+ Find(ncell, ncelltot, etc, etac, phic,
+ minmove, maxmove, mode, precbg, ierror);
}
file = (pK->GetCurrentFile())->GetName();
TBranch * jetBranch ;
if (fDebug > 1)
- printf("Make Branch - TreeR address %p %p\n",gAlice->TreeR(), pEMCAL);
+ printf("Make Branch - TreeR address %p %p\n",(void*)gAlice->TreeR(), (void*)pEMCAL);
//if (fJets && gAlice->TreeR()) {
if (fJets && gime->TreeR()) {
// pEMCAL->MakeBranchInTree(gAlice->TreeR(),
// Dump lego histo into array
//
fNcell = 0;
- TAxis* Xaxis = fLego->GetXaxis();
- TAxis* Yaxis = fLego->GetYaxis();
+ TAxis* xaxis = fLego->GetXaxis();
+ TAxis* yaxis = fLego->GetYaxis();
// fhCellEt->Clear();
Float_t e, eH;
for (Int_t i = 1; i <= fNbinEta; i++) {
}
if (e > 0.0) e -= fMinCellEt;
if (e < 0.0) e = 0.;
- Float_t eta = Xaxis->GetBinCenter(i);
- Float_t phi = Yaxis->GetBinCenter(j);
+ Float_t eta = xaxis->GetBinCenter(i);
+ Float_t phi = yaxis->GetBinCenter(j);
fEtCell[fNcell] = e;
fEtaCell[fNcell] = eta;
fPhiCell[fNcell] = phi;
// this is for Pythia ??
for (Int_t part = 0; part < npart; part++) {
- TParticle *MPart = gAlice->Particle(part);
- Int_t mpart = MPart->GetPdgCode();
- Int_t child1 = MPart->GetFirstDaughter();
- Float_t pT = MPart->Pt();
- Float_t p = MPart->P();
- Float_t phi = MPart->Phi();
+ TParticle *mPart = gAlice->GetMCApp()->Particle(part);
+ Int_t mpart = mPart->GetPdgCode();
+ Int_t child1 = mPart->GetFirstDaughter();
+ Float_t pT = mPart->Pt();
+ Float_t p = mPart->P();
+ Float_t phi = mPart->Phi();
Float_t eta = -100.;
- if(pT > 0.001) eta = MPart->Eta();
- Float_t theta = MPart->Theta();
- if (fDebug>=2 && MPart->GetStatusCode()==1) {
+ if(pT > 0.001) eta = mPart->Eta();
+ Float_t theta = mPart->Theta();
+ if (fDebug>=2 && mPart->GetStatusCode()==1) {
printf("ind %7i part %7i -> child1 %5i child2 %5i Status %5i\n",
- part, mpart, child1, MPart->GetLastDaughter(), MPart->GetStatusCode());
+ part, mpart, child1, mPart->GetLastDaughter(), mPart->GetStatusCode());
}
if (fDebug >= 2 && genType == kPythia) {
// final state particles only
if (genType == kPythia) {
- if (MPart->GetStatusCode() != 1) continue;
+ if (mPart->GetStatusCode() != 1) continue;
} else if (genType == kHijing) {
if (child1 >= 0 && child1 < npart) continue;
}
TParticlePDG* pdgP = 0;
// charged or neutral
- pdgP = MPart->GetPDG();
+ pdgP = mPart->GetPDG();
chTmp = pdgP->Charge() / 3.; // 13-feb-2001!!
if (ich == 0) {
nbytes += branchDr->GetEntry(0);
//
// Get digitizer parameters
- Float_t preADCped = digr->GetPREpedestal();
- Float_t preADCcha = digr->GetPREchannel();
Float_t ecADCped = digr->GetECApedestal();
Float_t ecADCcha = digr->GetECAchannel();
- Float_t hcADCped = digr->GetHCApedestal();
- Float_t hcADCcha = digr->GetHCAchannel();
AliEMCAL* pEMCAL = (AliEMCAL*) gAlice->GetModule("EMCAL");
AliEMCALGeometry* geom =
if (fDebug) {
Int_t ndig = digs->GetEntries();
- Info("FillFromDigits","Number of Digits: %d %d\n Parameters: PRE : %f %f EC: %f %f HC: %f %f\n Geometry: %d %d",
- ndig, nent, preADCped, preADCcha, ecADCped, ecADCcha, hcADCped, hcADCcha, geom->GetNEta(), geom->GetNPhi());
+ Info("FillFromDigits","Number of Digits: %d %d\n Parameters: EC: %f %f\n Geometry: %d %d",
+ ndig, nent, ecADCped, ecADCcha, geom->GetNEta(), geom->GetNPhi());
}
//
{
Double_t pedestal = 0.;
Double_t channel = 0.;
- if (geom->IsInPRE(sdg->GetId())) {
- pedestal = preADCped;
- channel = preADCcha;
- }
- else if (geom->IsInECA(sdg->GetId())) {
+ if (geom->IsInECA(sdg->GetId())) {
pedestal = ecADCped;
channel = ecADCcha;
- }
- else if (geom->IsInHCA(sdg->GetId())) {
- pedestal = hcADCped;
- channel = hcADCcha;
- }
+ }
else
Fatal("FillFromDigits", "unexpected digit is number!") ;
fNtS = 0;
for (Int_t track = 0; track < ntracks; track++) {
- TParticle *MPart = gAlice->Particle(track);
- Float_t pT = MPart->Pt();
- Float_t phi = MPart->Phi();
- Float_t eta = MPart->Eta();
+ TParticle *mPart = gAlice->GetMCApp()->Particle(track);
+ Float_t pT = mPart->Pt();
+ Float_t phi = mPart->Phi();
+ Float_t eta = mPart->Eta();
if(fTrackList[track]) {
fPtT[track] = pT;
fEtaT[track] = eta;
fPhiT[track] = phi;
- fPdgT[track] = MPart->GetPdgCode();
+ fPdgT[track] = mPart->GetPdgCode();
if (track < 2) continue; //Colliding particles?
if (pT == 0 || pT < fPtCut) continue;
// 26-feb-2002 PAI - for checking all chain
// Work on particles level; accept all particle (not neutrino )
- Double_t PX=0, PY=0, PZ=0, E=0; // checking conservation law
+ Double_t pX=0, pY=0, pZ=0, energy=0; // checking conservation law
fNChTpc = 0;
ResetMap();
// Go through the particles
Int_t mpart, child1, child2, geantPdg;
Float_t pT, phi, eta, e=0, px=0, py=0, pz=0;
- TParticle *MPart=0;
+ TParticle *mPart=0;
for (Int_t part = 0; part < npart; part++) {
fTrackList[part] = 0;
- MPart = gAlice->Particle(part);
- mpart = MPart->GetPdgCode();
- child1 = MPart->GetFirstDaughter();
- child2 = MPart->GetLastDaughter();
- pT = MPart->Pt();
- phi = MPart->Phi();
- eta = MPart->Eta();
+ mPart = gAlice->GetMCApp()->Particle(part);
+ mpart = mPart->GetPdgCode();
+ child1 = mPart->GetFirstDaughter();
+ child2 = mPart->GetLastDaughter();
+ pT = mPart->Pt();
+ phi = mPart->Phi();
+ eta = mPart->Eta();
- px = MPart->Px();
- py = MPart->Py();
- pz = MPart->Pz();
- e = MPart->Energy();
+ px = mPart->Px();
+ py = mPart->Py();
+ pz = mPart->Pz();
+ e = mPart->Energy();
// see pyedit in Pythia's text
geantPdg = mpart;
// printf("%4i -> %5i(%3i) px %6.1f py %6.1f pz %7.1f e %8.2f child1 %5i %s\n",
// part, mpart, geantPdg, px, py, pz, e, child1, name.Data());
- PX += px;
- PY += py;
- PZ += pz;
- E += e;
+ pX += px;
+ pY += py;
+ pZ += pz;
+ energy += e;
if (TMath::Abs(eta) <= 0.9) fNChTpc++;
} // primary loop
printf("\n PX %8.2f PY %8.2f PZ %8.2f E %8.2f \n",
- PX, PY, PZ, E);
+ pX, pY, pZ, energy);
DumpLego();
if(fhChPartMultInTpc) fhChPartMultInTpc->Fill(fNChTpc);
}
// Go through the partons
Int_t statusCode=0;
for (Int_t part = 8; part < npart; part++) {
- TParticle *MPart = gAlice->Particle(part);
- Int_t mpart = MPart->GetPdgCode();
+ TParticle *mPart = gAlice->GetMCApp()->Particle(part);
+ Int_t mpart = mPart->GetPdgCode();
// Int_t child1 = MPart->GetFirstDaughter();
- Float_t pT = MPart->Pt();
+ Float_t pT = mPart->Pt();
// Float_t p = MPart->P();
- Float_t phi = MPart->Phi();
- Float_t eta = MPart->Eta();
+ Float_t phi = mPart->Phi();
+ Float_t eta = mPart->Eta();
// Float_t theta = MPart->Theta();
- statusCode = MPart->GetStatusCode();
+ statusCode = mPart->GetStatusCode();
// accept partons (21 - gluon, 92 - string)
if (!(TMath::Abs(mpart) <= 6 || mpart == 21 ||mpart == 92)) continue;
// Access hit information
AliEMCAL* pEMCAL = (AliEMCAL*) gAlice->GetModule("EMCAL");
- TTree *TK = gAlice->TreeK(); // Get the number of entries in the kine tree
- Int_t nKTrks = (Int_t) TK->GetEntries(); // (Number of particles created somewhere)
+ TTree *treeK = gAlice->TreeK(); // Get the number of entries in the kine tree
+ Int_t nKTrks = (Int_t) treeK->GetEntries(); // (Number of particles created somewhere)
if(fTrackList) delete[] fTrackList; //Make sure we get rid of the old one
fTrackList = new Int_t[nKTrks]; //before generating a new one
Int_t idprim = mHit->GetPrimary(); // primary particle
//Determine the origin point of this particle - it made a hit in the EMCAL
- TParticle *trkPart = gAlice->Particle(iTrk);
+ TParticle *trkPart = gAlice->GetMCApp()->Particle(iTrk);
TParticlePDG *trkPdg = trkPart->GetPDG();
Int_t trkCode = trkPart->GetPdgCode();
Double_t trkChg;
//Loop through the ancestry of the EMCAL entrance particles
Int_t ancestor = trkPart->GetFirstMother(); //Get track's Mother
while (ancestor != -1) {
- TParticle *ancPart = gAlice->Particle(ancestor); //get particle info on ancestor
+ TParticle *ancPart = gAlice->GetMCApp()->Particle(ancestor); //get particle info on ancestor
TParticlePDG *ancPdg = ancPart->GetPDG();
Int_t ancCode = ancPart->GetPdgCode();
Double_t ancChg;
}
//Determine the origin point of the primary particle associated with the hit
- TParticle *primPart = gAlice->Particle(idprim);
+ TParticle *primPart = gAlice->GetMCApp()->Particle(idprim);
TParticlePDG *primPdg = primPart->GetPDG();
Int_t primCode = primPart->GetPdgCode();
Double_t primChg;
Int_t AliEMCALJetFinder
::SetTrackFlag(Float_t radius, Int_t code, Double_t charge) {
-
+// Set the flag for the track
Int_t flag = 0;
Int_t parton = 0;
Int_t neutral = 0;
-void AliEMCALJetFinder::SaveBackgroundEvent(Char_t *name)
+void AliEMCALJetFinder::SaveBackgroundEvent(const char *name)
{
// Saves the eta-phi lego and the tracklist and name of file with BG events
//
return dPhi;
}
-void hf1(Int_t& id, Float_t& x, Float_t& wgt)
+void hf1(Int_t& , Float_t& , Float_t& )
{
// dummy for hbook calls
;
}
-void AliEMCALJetFinder::DrawLego(Char_t *opt)
-{if(fLego) fLego->Draw(opt);}
+void AliEMCALJetFinder::DrawLego(const char *opt)
+{
+// Draw lego
+ if(fLego) fLego->Draw(opt);
+}
-void AliEMCALJetFinder::DrawLegoBackground(Char_t *opt)
-{if(fLegoB) fLegoB->Draw(opt);}
+void AliEMCALJetFinder::DrawLegoBackground(const char *opt)
+{
+// Draw background lego
+ if(fLegoB) fLegoB->Draw(opt);
+}
-void AliEMCALJetFinder::DrawLegoEMCAL(Char_t *opt)
-{if(fhLegoEMCAL) fhLegoEMCAL->Draw(opt);}
+void AliEMCALJetFinder::DrawLegoEMCAL(const char *opt)
+{
+// Draw EMCAL Lego
+ if(fhLegoEMCAL) fhLegoEMCAL->Draw(opt);
+}
void AliEMCALJetFinder::DrawHistsForTuning(Int_t mode)
{
+// Draw all hists
static TPaveText *varLabel=0;
if(!fC1) {
fC1 = new TCanvas("C1","Hists. for tunning", 0,25,600,800);
void AliEMCALJetFinder::PrintParameters(Int_t mode)
{
+// Print all parameters out
+
FILE *file=0;
if(mode==0) file = stdout; // output to terminal
else {
void AliEMCALJetFinder::DrawLegos()
{
+// Draw all legos
if(!fC1) {
fC1 = new TCanvas("C1","Hists. for tunning", 0,25,600,800);
}
int1, int2, int3, int4, int1 - (int2 + int3 - int4));
}
-const Char_t* AliEMCALJetFinder::GetFileNameForParameters(Char_t* dir)
+const Char_t* AliEMCALJetFinder::GetFileNameForParameters(const char* dir)
{
+// Get paramters from a file
static TString tmp;
if(strlen(dir)) tmp = dir;
tmp += GetTitle();
}
void AliEMCALJetFinder::RearrangeParticlesMemory(Int_t npart)
-{ // See FillFromTracks() - npart must be positive
+{
+ // See FillFromTracks() - npart must be positive
if (fTrackList) delete[] fTrackList;
if (fPtT) delete[] fPtT;
if (fEtaT) delete[] fEtaT;
Bool_t AliEMCALJetFinder::IsThisPartonsOrDiQuark(Int_t pdg)
{
+// Return quark info
Int_t absPdg = TMath::Abs(pdg);
if(absPdg<=6) return kTRUE; // quarks
if(pdg == 21) return kTRUE; // gluon
// 16-jan-2003 - just for convenience
void AliEMCALJetFinder::Browse(TBrowser* b)
{
+// Add to browser
if(fHistsList) b->Add((TObject*)fHistsList);
}
Bool_t AliEMCALJetFinder::IsFolder() const
{
+// Return folder status
if(fHistsList) return kTRUE;
else return kFALSE;
}
const Char_t* AliEMCALJetFinder::GetNameOfVariant()
-{// generate the literal string with info about jet finder
+{
+ // generate the literal string with info about jet finder
Char_t name[200];
sprintf(name, "jF_R%3.2fMinCell%4.1fPtCut%4.1fEtSeed%4.1fMinEt%4.1fBGSubtr%iSF%4.1f",
fConeRadius,fMinCellEt,fPtCut,fEtSeed,fMinJetEt, fMode, fSamplingF);