]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALJetMicroDst.cxx
Enlarging digits array
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALJetMicroDst.cxx
index d2bbec7c8a5c2fc126f88f2bc6c7c77ea1582ecc..438702b1dcc035ef7fd31581e5ee8b0c90cb53fd 100644 (file)
 #include <TBrowser.h>
 #include <TString.h>
 #include <TParticle.h>
+#include "AliMC.h"
+#include <TH2.h>
+#include <TH1F.h>
+
 
 ClassImp(AliEMCALJetMicroDst)
 
-TString nameTree("jetMDST"); // 7-feb-2002
+TString gAliNameTree("jetMDST"); // 7-feb-2002
 
-TH1F*  hPtPart, *hNJet, *hPtJet;
-TH2F*  hEtaPhiPart, *hEtaPhiJet;
-TH1F*  hNcell, *hCellId, *hCellEt, *hSumEt;
-TH1F*  hNgrid, *hGridId, *hGridEt, *hSumEtGrForJF;
+//TH1F*  fhPtPart, *fhNJet, *fhPtJet;
+//TH2F*  fhEtaPhiPart, *fhEtaPhiJet;
+//TH1F*  fhNcell, *fhCellId, *fhCellEt, *fhSumEt;
+//TH1F*  fhNgrid, *fhGridId, *fhGridEt, *fhSumEtGrForJF;
 
 extern "C" void sgpdge_(Int_t &i, Int_t &pdggea);
 
-AliEMCALJetMicroDst::AliEMCALJetMicroDst(char *name, char *tit) : TNamed(name,tit)
+AliEMCALJetMicroDst::AliEMCALJetMicroDst(const char *name, const char *tit) : TNamed(name,tit)
 {
+       //constructor
   fFile  = 0;
   fTree  = 0;
   fDebug = 0;
@@ -52,36 +57,38 @@ AliEMCALJetMicroDst::AliEMCALJetMicroDst(char *name, char *tit) : TNamed(name,ti
 //  Don't add histos to the current directory
 //  TH1::AddDirectory(0);
   gROOT->cd();
-  hPtPart     = new TH1F("hPtPart","P_{T} for partons", 300, 0., 300.);
+  fhPtPart     = new TH1F("fhPtPart","P_{T} for partons", 300, 0., 300.);
   // 16-jan-2002 - new limit fo phi 
-  hEtaPhiPart = new TH2F("hEtaPhiPart","#eta #phi distr.for partons after HSc", 
+  fhEtaPhiPart = new TH2F("fhEtaPhiPart","#eta #phi distr.for partons after HSc", 
                       28, -0.7, 0.7, 21, 0.0, (2.0/3.0)*TMath::Pi());
 
-  hNJet  = new TH1F("hNJet","number of jets", 11, -0.5, 10.5);
-  hPtJet = new TH1F("hPtJet","P_{T} for jets", 500, 0., 500.);
-  hEtaPhiJet = new TH2F("hEtaPhiJet","#eta #phi distr.for jets (W)", 
+  fhNJet  = new TH1F("fhNJet","number of jets", 11, -0.5, 10.5);
+  fhPtJet = new TH1F("fhPtJet","P_{T} for jets", 500, 0., 500.);
+  fhEtaPhiJet = new TH2F("fhEtaPhiJet","#eta #phi distr.for jets (W)", 
                       28, -0.7, 0.7, 21, 0.0, (2.0/3.0)*TMath::Pi());
 
-  hNcell  = new TH1F("hNcell","#cell with de>0.0 for EMCAL", 1400, 0.0, 14000.);
-  hCellId = new TH1F("hCellId","cell ID with de>0.0 for EMCAL", 1400, 0.0, 14000.);
-  hCellEt = new TH1F("hCellEt","cell Et for EMCAL", 1000, 0.0, 10.);
-  hSumEt  = new TH1F("hSumEt","sum Et for EMCAL", 1000, 0.0, 1000.);
+  fhNcell  = new TH1F("fhNcell","#cell with de>0.0 for EMCAL", 1400, 0.0, 14000.);
+  fhCellId = new TH1F("fhCellId","cell ID with de>0.0 for EMCAL", 1400, 0.0, 14000.);
+  fhCellEt = new TH1F("fhCellEt","cell Et for EMCAL", 1000, 0.0, 10.);
+  fhSumEt  = new TH1F("fhSumEt","sum Et for EMCAL", 1000, 0.0, 1000.);
 
-  hNgrid  = new TH1F("hNgrid","#cell with de>0.0 in EMCAL grid for JF", 1400, 0.0, 14000.);
-  hGridId = new TH1F("hGridId","cell ID with de>0.0 in EMCAL grid for JF", 1400, 0.0, 14000.);
-  hGridEt = new TH1F("hGridEt","cell Et in EMCAL grid for JF", 1000, 0.0, 10.);
-  hSumEtGrForJF  = new TH1F("hSumEtGrForJF","sum Et in EMCAL grid for JF", 1000, 0.0, 1000.);
+  fhNgrid  = new TH1F("fhNgrid","#cell with de>0.0 in EMCAL grid for JF", 1400, 0.0, 14000.);
+  fhGridId = new TH1F("fhGridId","cell ID with de>0.0 in EMCAL grid for JF", 1400, 0.0, 14000.);
+  fhGridEt = new TH1F("fhGridEt","cell Et in EMCAL grid for JF", 1000, 0.0, 10.);
+  fhSumEtGrForJF  = new TH1F("fhSumEtGrForJF","sum Et in EMCAL grid for JF", 1000, 0.0, 1000.);
 
   fListHist = MoveHistsToList("Hist For AliEMCALJetMicroDst", kFALSE); 
 }
 
 AliEMCALJetMicroDst::~AliEMCALJetMicroDst()
 {
+       //destructor
   if(fFile) fFile->Close();
 }  
 
 Bool_t AliEMCALJetMicroDst::Create(TFile *file)
 {
+  // Creates the DST file
   if(!file) {
     Error("Create", "define TFile for output\n");
     return kFALSE;
@@ -89,45 +96,46 @@ Bool_t AliEMCALJetMicroDst::Create(TFile *file)
   fFile     = file;
   fFileName = fFile->GetName();
   fFile->cd();
-  fTree = new TTree(nameTree.Data(),"Temporary micro DST for jets analysis");
+  fTree = new TTree(gAliNameTree.Data(),"Temporary micro DST for jets analysis");
   // for jet calibration - 4-mar-2003
-  fTree->Branch("decone", &decone, "decone/F");
-  fTree->Branch("ptcone", &ptcone, "ptcone/F");
+  fTree->Branch("fdecone", &fdecone, "fdecone/F");
+  fTree->Branch("fptcone", &fptcone, "fptcone/F");
   // partons 
-  fTree->Branch("npart", &npart, "npart/I");
-  fTree->Branch("xpt",  xpt,  "xpt[npart]/F");
-  fTree->Branch("xeta", xeta, "xeta[npart]/F");
-  fTree->Branch("xphi", xphi, "xphi[npart]/F");
+  fTree->Branch("fnpart", &fnpart, "fnpart/I");
+  fTree->Branch("fxpt",  fxpt,  "fxpt[fnpart]/F");
+  fTree->Branch("fxeta", fxeta, "fxeta[fnpart]/F");
+  fTree->Branch("fxphi", fxphi, "fxphi[fnpart]/F");
   // jets 
-  fTree->Branch("njet", &njet, "njet/I");
-  fTree->Branch("jet",  jet,  "jet[njet]/F");
-  fTree->Branch("jetaw", jetaw, "jetaw[njet]/F");
-  fTree->Branch("jphiw", jphiw, "jphiw[njet]/F");
-  fTree->Branch("jetal", jetal, "jetal[njet]/F");
-  fTree->Branch("jphil", jphil, "jphil[njet]/F");
+  fTree->Branch("fnjet", &fnjet, "fnjet/I");
+  fTree->Branch("fjet",  fjet,  "fjet[fnjet]/F");
+  fTree->Branch("fjetaw", fjetaw, "fjetaw[fnjet]/F");
+  fTree->Branch("fjphiw", fjphiw, "fjphiw[fnjet]/F");
+  fTree->Branch("fjetal", fjetal, "fjetal[fnjet]/F");
+  fTree->Branch("fjphil", fjphil, "fjphil[fnjet]/F");
 
   // Et in EMCAL itself 
-  fTree->Branch("ncell", &ncell, "ncell/I");
-  fTree->Branch("idcell", idcell, "idcell[ncell]/I");
-  fTree->Branch("etcell", etcell, "etcell[ncell]/F");
+  fTree->Branch("fncell", &fncell, "fncell/I");
+  fTree->Branch("fidcell", fidcell, "fidcell[fncell]/I");
+  fTree->Branch("fetcell", fetcell, "fetcell[fncell]/F");
 
   // Et in EMCAL grid for JF 
-  fTree->Branch("ngrid", &ngrid,  "ngrid/I");
-  fTree->Branch("idgrid", idgrid, "idgrid[ngrid]/I");
-  fTree->Branch("etgrid", etgrid, "etgrid[ngrid]/F");
+  fTree->Branch("fngrid", &fngrid,  "fngrid/I");
+  fTree->Branch("fidgrid", fidgrid, "fidgrid[fngrid]/I");
+  fTree->Branch("fetgrid", fetgrid, "fetgrid[fngrid]/F");
 
   // charge particle which hit to EMCAL
-  fTree->Branch("nchp", &nchp, "nchp/I");
-  fTree->Branch("pid", pid, "pid[nchp]/I");
-  fTree->Branch("ppt", ppt, "ppt[nchp]/F");
-  fTree->Branch("peta", peta, "peta[nchp]/F");
-  fTree->Branch("pphi", pphi, "pphi[nchp]/F");
+  fTree->Branch("fnchp", &fnchp, "fnchp/I");
+  fTree->Branch("fpid", fpid, "fpid[fnchp]/I");
+  fTree->Branch("fppt", fppt, "fppt[fnchp]/F");
+  fTree->Branch("fpeta", fpeta, "fpeta[fnchp]/F");
+  fTree->Branch("fpphi", fpphi, "fpphi[fnchp]/F");
 
   return kTRUE;
 }
 
 Bool_t AliEMCALJetMicroDst::Create(const char *fname)
 {
+       // Create member
   TFile *file = new TFile(fname, "RECREATE");
   if(file) {
     //    fNameFile = fname;
@@ -137,6 +145,7 @@ Bool_t AliEMCALJetMicroDst::Create(const char *fname)
 
 Bool_t AliEMCALJetMicroDst::Open(const char *fname)
 {
+       //Open member
   if(fFile && fFile->IsOpen()) fFile->Close();
   if(strlen(fname)) fName = fname;
   TFile *file = new TFile(fName.Data(), "READ");
@@ -150,8 +159,9 @@ Bool_t AliEMCALJetMicroDst::Open(const char *fname)
   }
 }
 
-const Char_t* AliEMCALJetMicroDst::DefineName(const Int_t mode)
+const Char_t* AliEMCALJetMicroDst::DefineName(Int_t mode)
 {
+       //DefineName member
   static TString dir, name;
   //  dir = "jetDST/"; // 24-jan-2003
   dir = "/auto/alice/pavlinov/jet/microDST/"; // 24-jan-2003
@@ -221,45 +231,47 @@ const Char_t* AliEMCALJetMicroDst::DefineName(const Int_t mode)
 
 Bool_t AliEMCALJetMicroDst::Initialize(TFile *file)
 {
+       // Initialize method
   if(file) fFile = file; 
   fFile->cd();
-  fTree = (TTree*)fFile->Get(nameTree.Data());
+  fTree = (TTree*)fFile->Get(gAliNameTree.Data());
   if(!fTree) return kFALSE;
   // for jet calibration - 4-mar-2003
-  fTree->SetBranchAddress("decone",&decone);
-  fTree->SetBranchAddress("ptcone",&ptcone);
+  fTree->SetBranchAddress("fdecone",&fdecone);
+  fTree->SetBranchAddress("fptcone",&fptcone);
   // partons
-  fTree->SetBranchAddress("npart",&npart);
-  fTree->SetBranchAddress("xpt",   xpt);
-  fTree->SetBranchAddress("xeta",  xeta);
-  fTree->SetBranchAddress("xphi",  xphi);
+  fTree->SetBranchAddress("fnpart",&fnpart);
+  fTree->SetBranchAddress("fxpt",   fxpt);
+  fTree->SetBranchAddress("fxeta",  fxeta);
+  fTree->SetBranchAddress("fxphi",  fxphi);
   // jets 
-  fTree->SetBranchAddress("njet", &njet);
-  fTree->SetBranchAddress("jet",   jet);
-  fTree->SetBranchAddress("jetaw", jetaw);
-  fTree->SetBranchAddress("jphiw", jphiw);
-  fTree->SetBranchAddress("jetal", jetal);
-  fTree->SetBranchAddress("jphil", jphil);
+  fTree->SetBranchAddress("fnjet", &fnjet);
+  fTree->SetBranchAddress("fjet",   fjet);
+  fTree->SetBranchAddress("fjetaw", fjetaw);
+  fTree->SetBranchAddress("fjphiw", fjphiw);
+  fTree->SetBranchAddress("fjetal", fjetal);
+  fTree->SetBranchAddress("fjphil", fjphil);
   // eT in EMCAL
-  fTree->SetBranchAddress("ncell", &ncell);
-  fTree->SetBranchAddress("idcell", idcell);
-  fTree->SetBranchAddress("etcell", etcell);
+  fTree->SetBranchAddress("fncell", &fncell);
+  fTree->SetBranchAddress("fidcell", fidcell);
+  fTree->SetBranchAddress("fetcell", fetcell);
   // eT in EMCAL grid for JF
-  fTree->SetBranchAddress("ngrid", &ngrid);
-  fTree->SetBranchAddress("idgrid", idgrid);
-  fTree->SetBranchAddress("etgrid", etgrid);
+  fTree->SetBranchAddress("fngrid", &fngrid);
+  fTree->SetBranchAddress("fidgrid", fidgrid);
+  fTree->SetBranchAddress("fetgrid", fetgrid);
   // 28-jan-2003
-  fTree->SetBranchAddress("nchp", &nchp);
-  fTree->SetBranchAddress("pid", pid);
-  fTree->SetBranchAddress("ppt", ppt);
-  fTree->SetBranchAddress("peta", peta);
-  fTree->SetBranchAddress("pphi", pphi);
+  fTree->SetBranchAddress("fnchp", &fnchp);
+  fTree->SetBranchAddress("fpid", fpid);
+  fTree->SetBranchAddress("fppt", fppt);
+  fTree->SetBranchAddress("fpeta", fpeta);
+  fTree->SetBranchAddress("fpphi", fpphi);
 
   return kTRUE;
 }
 
 void AliEMCALJetMicroDst::Print(Option_t* option) const
 {
+       // 
   if(option);
   if(fFile) {
     fFile->Print();
@@ -270,21 +282,22 @@ void AliEMCALJetMicroDst::Print(Option_t* option) const
   }
 
   Info("Print", "******* Current(last) event *****");
-  printf("#partons %2i \n", npart);
-  for(Int_t i=0; i<npart; i++){
+  printf("#partons %2i \n", fnpart);
+  for(Int_t i=0; i<fnpart; i++){
     printf("     %1i Pt %7.1f eta  %7.4f phi  %7.4f \n",
-    i, xpt[i],xeta[i],xphi[i]);  
+    i, fxpt[i],fxeta[i],fxphi[i]);  
   }
-  printf("#jets    %2i \n", njet);
-  for(Int_t i=0; i<njet; i++){
+  printf("#jets    %2i \n", fnjet);
+  for(Int_t i=0; i<fnjet; i++){
     printf("     %1i Et %7.1f etaw %7.4f phiw %7.4f \n",
-    i,jet[i],jetaw[i],jphiw[i]);  
+    i,fjet[i],fjetaw[i],fjphiw[i]);  
   }
   printf(" Title %s \n", GetTitle());
 }
 
 void AliEMCALJetMicroDst::Fill(AliRun *run, AliEMCALJetFinder* jetFinder, Int_t modeFilling)
-{//  modeFilling >=1 - fill info for EMCAL grid
+{
+  //  modeFilling >=1 - fill info for EMCAL grid
   if(!run) run = gAlice;
   AliGenEventHeader* evHeader = run->GetHeader()->GenEventHeader();
   TString tmp(evHeader->ClassName());
@@ -304,12 +317,12 @@ void AliEMCALJetMicroDst::Fill(AliRun *run, AliEMCALJetFinder* jetFinder, Int_t
      FillEtForGrid(jetFinder);
      FillChargeParticles(jetFinder);
   } else {
-     ncell = 0; // 27-jan-2003
-     ngrid = 0; // 27-jan-2003
-     nchp  = 0;
+     fncell = 0; // 27-jan-2003
+     fngrid = 0; // 27-jan-2003
+     fnchp  = 0;
      // negative - no signal 
-     decone = -1.;
-     ptcone = -1.;
+     fdecone = -1.;
+     fptcone = -1.;
   }
 
   FillJetsControl();  //24-jan-2003
@@ -319,61 +332,65 @@ void AliEMCALJetMicroDst::Fill(AliRun *run, AliEMCALJetFinder* jetFinder, Int_t
 
 void AliEMCALJetMicroDst::FillPartons(AliGenHijingEventHeader *header)
 {
+  //Make partons arrays
   TLorentzVector parton[4];
   header->GetJets(parton[0], parton[1], parton[2], parton[3]);
 
-  npart = 4; // 
+  fnpart = 4; // 
   for(Int_t i=0; i<4; i++){
-     xpt[i]  = parton[i].Pt();
-     xeta[i] = parton[i].Eta();
-     xphi[i] = parton[i].Phi();
+     fxpt[i]  = parton[i].Pt();
+     fxeta[i] = parton[i].Eta();
+     fxphi[i] = parton[i].Phi();
   }
 }
 
 void AliEMCALJetMicroDst::FillPartons()
-{// for case of Pythia -> get info from full event record
+{
+  // for case of Pythia -> get info from full event record
 
-  npart = 2;
-  TParticle *MPart;
+  fnpart = 2;
+  TParticle *mPart;
   Int_t ind;
   for(Int_t i=6; i<8; i++){
-     MPart = gAlice->Particle(i);
+     mPart = gAlice->GetMCApp()->Particle(i);
      ind   = i-6;
-     xpt[ind]  = MPart->Pt();
-     xeta[ind] = MPart->Eta();
-     xphi[ind] = MPart->Phi();
+     fxpt[ind]  = mPart->Pt();
+     fxeta[ind] = mPart->Eta();
+     fxphi[ind] = mPart->Phi();
   }
 }
 
 void AliEMCALJetMicroDst::FillJets(AliEMCALJetFinder* jetFinder)
 {
-  njet = 0;
+  // Fill Jets
+  fnjet = 0;
   if(fDebug>1) Info("FillJets", "Debug"); 
   if(!jetFinder) {
     if(fDebug>1) Info("FillJets", "jetFinder is zero"); 
     return;
   }
-  njet = jetFinder->Njets();
-  if(njet>10) {
-    if(fDebug>1) Warning("FillJets", "wrong value of jetFinder->Njets() %i ", njet); 
-    njet = 10;
+  fnjet = jetFinder->Njets();
+  if(fnjet>10) {
+    if(fDebug>1) Warning("FillJets", "wrong value of jetFinder->Njets() %i ", fnjet); 
+    fnjet = 10;
   }
-  //  hNJet->Fill(njet);
-  if(fDebug>1) Info("FillJets", "njet %i", njet); 
-  if(njet){
-    for(Int_t i=0; i<njet; i++){
-      jet[i]   = jetFinder->JetEnergy(i);
-      jetaw[i] = jetFinder->JetEtaW(i);
-      jphiw[i] = jetFinder->JetPhiW(i);
-      jetal[i] = jetFinder->JetEtaL(i);
-      jphil[i] = jetFinder->JetPhiL(i);
+  //  fhNJet->Fill(njet);
+  if(fDebug>1) Info("FillJets", "njet %i", fnjet); 
+  if(fnjet){
+    for(Int_t i=0; i<fnjet; i++){
+      fjet[i]   = jetFinder->JetEnergy(i);
+      fjetaw[i] = jetFinder->JetEtaW(i);
+      fjphiw[i] = jetFinder->JetPhiW(i);
+      fjetal[i] = jetFinder->JetEtaL(i);
+      fjphil[i] = jetFinder->JetPhiL(i);
     }
   }
 }
 
 void AliEMCALJetMicroDst::FillEtForEMCAL(AliEMCALJetFinder* jetFinder)
 {
-   ncell = 0;
+  // Fill Et for EMCAL
+   fncell = 0;
    TH2F *hid = jetFinder->GetLegoEMCAL();
    if(!hid) return;
 
@@ -383,39 +400,41 @@ void AliEMCALJetMicroDst::FillEtForEMCAL(AliEMCALJetFinder* jetFinder)
       for(Int_t iphi=1; iphi<=nphi; iphi++) {
         de = hid->GetBinContent(ieta,iphi);
          if(de > 0.0) {
-          etcell[ncell] = Float_t(de);
-           idcell[ncell] = nphi*(ieta-1) + iphi;
-          ncell++;
-           if(ncell >= 13824) break; 
+          fetcell[fncell] = Float_t(de);
+           fidcell[fncell] = nphi*(ieta-1) + iphi;
+          fncell++;
+           if(fncell >= 13824) break; 
           // Info("FillEtForEMCAL", " ncell %i6 id %i6 de %f \n", ncell, idcell[ncell], etcell[ncell]); 
          }
       }
    }
-   if(njet == 1) {
+   if(fnjet == 1) {
      // jet energy calculate around LP direction !!! - 10-mar-2003 
-      decone = jetFinder->EMCALConeEnergy(jetal[0],jphil[0]); 
-      ptcone = jetFinder->TrackConeEnergy(jetal[0],jphil[0]); // get from lego plot fo ch.part
-      Info("FillEtForEMCAL", " njet %i Emcal in cone %f pt ch.part in cone %f\n", njet, decone, ptcone); 
-      Info("FillEtForEMCAL", " jet - decone - ptcone : %9.2f\n", jet[0]-decone-ptcone);
+      fdecone = jetFinder->EMCALConeEnergy(fjetal[0],fjphil[0]); 
+      fptcone = jetFinder->TrackConeEnergy(fjetal[0],fjphil[0]); // get from lego plot fo ch.part
+      Info("FillEtForEMCAL", " njet %i Emcal in cone %f pt ch.part in cone %f\n", fnjet, fdecone, fptcone); 
+      Info("FillEtForEMCAL", " jet - decone - ptcone : %9.2f\n", fjet[0]-fdecone-fptcone);
    } else {
-      decone = -1.;
-      ptcone = -1.;
+      fdecone = -1.;
+      fptcone = -1.;
    }
 
    Info("FillEtForEMCAL", "neta %3i nphi %3i # array size %i Sum.Et %f\n", 
-   neta,nphi, ncell, hid->Integral());
+   neta,nphi, fncell, hid->Integral());
 }
 
 void AliEMCALJetMicroDst::FillEtForGrid(AliEMCALJetFinder* jetFinder)
 {
+  // Fill ET for Grid
    TH2F *hid = jetFinder->GetLego();
    if(!hid) return;
 
-   FillArrays(hid, ngrid, idgrid, etgrid);
+   FillArrays(hid, fngrid, fidgrid, fetgrid);
 }
 
 void AliEMCALJetMicroDst::FillArrays(TH2* hid, Int_t &n, Int_t *id, Float_t *et)
 {
+  // Fill arays
    n = 0;
    Double_t de = 0.;
    Int_t neta = hid->GetNbinsX(), nphi = hid->GetNbinsY();
@@ -435,57 +454,60 @@ void AliEMCALJetMicroDst::FillArrays(TH2* hid, Int_t &n, Int_t *id, Float_t *et)
 }
 
 void AliEMCALJetMicroDst::FillChargeParticles(AliEMCALJetFinder* jetFinder)
-{// 28-jan-2003 for fullness ; 18-mar - sometimes 
-  nchp = 0;
+{
+  // 28-jan-2003 for fullness ; 18-mar - sometimes 
+  fnchp = 0;
   Int_t gid=0;
   for(Int_t i=0; i<jetFinder->fNt; i++) {
     //     fPdgT[i];
      if(jetFinder->fTrackList[i] >= 1) {
         sgpdge_(jetFinder->fPdgT[i], gid);
-        pid[nchp]  = gid; 
-        ppt[nchp]  = jetFinder->fPtT[i];
-        peta[nchp] = jetFinder->fEtaT[i];
-        pphi[nchp] = jetFinder->fPhiT[i];
-        nchp++;
+        fpid[fnchp]  = gid; 
+        fppt[fnchp]  = jetFinder->fPtT[i];
+        fpeta[fnchp] = jetFinder->fEtaT[i];
+        fpphi[fnchp] = jetFinder->fPhiT[i];
+        fnchp++;
      }
   }
-  Info("FillChargedParticles", "fNtS %i : nchp %i -> %i\n", jetFinder->fNtS, nchp, jetFinder->fNtS - nchp);
+  Info("FillChargedParticles", "fNtS %i : nchp %i -> %i\n", jetFinder->fNtS, fnchp, jetFinder->fNtS - fnchp);
 }
 
 void AliEMCALJetMicroDst::FillJetsControl()
-{  // see FillJets(AliEMCALJetFinder* jetFinder) and FillPartons
-  hNJet->Fill(njet);
-  for(Int_t i=0; i<njet; i++){
-     hPtJet->Fill(jet[i]);
-     hEtaPhiJet->Fill(jetaw[i],jphiw[i]); 
+{  
+  // see FillJets(AliEMCALJetFinder* jetFinder) and FillPartons
+  fhNJet->Fill(fnjet);
+  for(Int_t i=0; i<fnjet; i++){
+     fhPtJet->Fill(fjet[i]);
+     fhEtaPhiJet->Fill(fjetaw[i],fjphiw[i]); 
   }
 
-  for(Int_t i=0; i < npart; i++){
-     hEtaPhiPart->Fill(xeta[i], xphi[i]);
-     hPtPart->Fill(xpt[i]);
+  for(Int_t i=0; i < fnpart; i++){
+     fhEtaPhiPart->Fill(fxeta[i], fxphi[i]);
+     fhPtPart->Fill(fxpt[i]);
   }
 
   Double_t sum = 0.0;
-  hNcell->Fill(ncell);
-  for(Int_t i=0; i < ncell; i++){
-    hCellId->Fill(idcell[i]);
-    hCellEt->Fill(etcell[i]);
-    sum += Double_t(etcell[i]);
+  fhNcell->Fill(fncell);
+  for(Int_t i=0; i < fncell; i++){
+    fhCellId->Fill(fidcell[i]);
+    fhCellEt->Fill(fetcell[i]);
+    sum += Double_t(fetcell[i]);
   }
-  hSumEt->Fill(sum);
+  fhSumEt->Fill(sum);
 
   sum = 0.0;
-  hNgrid->Fill(ngrid);
-  for(Int_t i=0; i < ngrid; i++){
-    hGridId->Fill(idgrid[i]);
-    hGridEt->Fill(etgrid[i]);
-    sum += Double_t(etgrid[i]);
+  fhNgrid->Fill(fngrid);
+  for(Int_t i=0; i < fngrid; i++){
+    fhGridId->Fill(fidgrid[i]);
+    fhGridEt->Fill(fetgrid[i]);
+    sum += Double_t(fetgrid[i]);
   }
-  hSumEtGrForJF->Fill(sum);
+  fhSumEtGrForJF->Fill(sum);
 }
 
 Int_t AliEMCALJetMicroDst::GetEntry(Int_t entry)
-{ // Read contents of entry.
+{ 
+  // Read contents of entry.
    if (!fTree) {
       Error("GetEntry", "define TTree");
       return -1;
@@ -493,18 +515,20 @@ Int_t AliEMCALJetMicroDst::GetEntry(Int_t entry)
    return fTree->GetEntry(entry);
 }
 
-Bool_t AliEMCALJetMicroDst::GetParton(Int_t i, Float_t& pt, Float_t& eta, Float_t& phi)
+Bool_t AliEMCALJetMicroDst::GetParton(Int_t i, Float_t& pt, Float_t& eta, Float_t& phi) const
 {
-  if(i>=0 && i<npart) {
-    pt  = xpt[i];
-    eta = xeta[i];
-    phi = xphi[i];
+  // Get parton
+  if(i>=0 && i<fnpart) {
+    pt  = fxpt[i];
+    eta = fxeta[i];
+    phi = fxphi[i];
     return kTRUE;
   } else return kFALSE; 
 }
 
-Bool_t AliEMCALJetMicroDst::GetParton(Int_t i, TVector3& vec)
+Bool_t AliEMCALJetMicroDst::GetParton(Int_t i, TVector3& vec) const
 {
+  // Get Parton
   static Float_t pt, eta, phi;
 
   if(!GetParton(i, pt, eta, phi)) return kFALSE;
@@ -513,23 +537,25 @@ Bool_t AliEMCALJetMicroDst::GetParton(Int_t i, TVector3& vec)
   return kTRUE;
 }
 
-Bool_t AliEMCALJetMicroDst::GetJet(Int_t i,Int_t mode,Float_t& pt, Float_t& eta, Float_t& phi)
-{// mode=1(W) mode=any(L)
-  if(i>=0 && i<njet) {
-    pt  = jet[i];
+Bool_t AliEMCALJetMicroDst::GetJet(Int_t i,Int_t mode,Float_t& pt, Float_t& eta, Float_t& phi) const
+{
+  // mode=1(W) mode=any(L)
+  if(i>=0 && i<fnjet) {
+    pt  = fjet[i];
     if(mode==1) {
-      eta = jetaw[i];
-      phi = jphiw[i];
+      eta = fjetaw[i];
+      phi = fjphiw[i];
     } else {
-      eta = jetal[i];
-      phi = jphil[i];
+      eta = fjetal[i];
+      phi = fjphil[i];
     }
     return kTRUE;
   } else return kFALSE; 
 }
 
-Bool_t AliEMCALJetMicroDst::GetJet(Int_t i, Int_t mode, TVector3& vec)
+Bool_t AliEMCALJetMicroDst::GetJet(Int_t i, Int_t mode, TVector3& vec) const 
 {
+  // Get Jet
   static Float_t pt, eta, phi;
 
   if(!GetJet(i, mode, pt, eta, phi)) return kFALSE;
@@ -539,6 +565,7 @@ Bool_t AliEMCALJetMicroDst::GetJet(Int_t i, Int_t mode, TVector3& vec)
 
 void AliEMCALJetMicroDst::Test()
 {
+  // Test
   if(!fFile || !fTree ) {
     Info("Test", "define file with proper TTree !");
     return;
@@ -547,16 +574,16 @@ void AliEMCALJetMicroDst::Test()
   for(Int_t i=0; i<nentries; i++){
     nb = fTree->GetEntry(i);  
     nbytes += nb;
-    for(Int_t j=0; j<npart; j++){
-      hEtaPhiPart->Fill(xeta[j], xphi[j]);
-      hPtPart->Fill(xpt[j]);
+    for(Int_t j=0; j<fnpart; j++){
+      fhEtaPhiPart->Fill(fxeta[j], fxphi[j]);
+      fhPtPart->Fill(fxpt[j]);
     }
 
-    hNJet->Fill(njet);
-    if(njet){
-      for(Int_t j=0; j<njet; j++) {
-        hPtJet->Fill(jet[j]);
-        hEtaPhiJet->Fill(jetaw[j],jphiw[j]); 
+    fhNJet->Fill(fnjet);
+    if(fnjet){
+      for(Int_t j=0; j<fnjet; j++) {
+        fhPtJet->Fill(fjet[j]);
+        fhEtaPhiJet->Fill(fjetaw[j],fjphiw[j]); 
       }
     }
   }
@@ -564,7 +591,8 @@ void AliEMCALJetMicroDst::Test()
 }
 
 void AliEMCALJetMicroDst::FillVector(Float_t pt, Float_t eta, Float_t phi, TVector3& vec)
-{ // service function 
+{ 
+  // service function 
   static Float_t px, py, pz;
 
   px = pt*TMath::Cos(phi);
@@ -574,8 +602,9 @@ void AliEMCALJetMicroDst::FillVector(Float_t pt, Float_t eta, Float_t phi, TVect
   vec.SetXYZ(px, py, pz);
 }
 
-void AliEMCALJetMicroDst::GetEtaPhi(Int_t id, Double_t &eta, Double_t &phi)
-{ // see AliEMCALGeometry 
+void AliEMCALJetMicroDst::GetEtaPhi(Int_t id, Double_t &eta, Double_t &phi) const
+{ 
+  // see AliEMCALGeometry 
   static Int_t ieta, iphi, nphi=144, neta=96;
   static Double_t phiMax=(2.0/3.0)*TMath::Pi(), phiMin=0.0;
   static Double_t phiStep=(phiMax-phiMin)/nphi, phiBeg = phiMin + phiStep/2.; 
@@ -593,32 +622,35 @@ void AliEMCALJetMicroDst::GetEtaPhi(Int_t id, Double_t &eta, Double_t &phi)
   phi  = phiBeg + phiStep*(iphi-1);
 }
 
-TVector3& AliEMCALJetMicroDst::GetCellVector(Int_t i)
+TVector3& AliEMCALJetMicroDst::GetCellVector(Int_t i) const 
 {
+  // Get cell vector
   static Double_t eta,phi;
   static TVector3 vec;
   vec.SetXYZ(0.,0.,0.);
-  if(i>=0 && i<ncell) {
-     GetEtaPhi(idcell[i], eta, phi);
-     vec.SetPtEtaPhi(Double_t(etcell[i]),eta,phi);
+  if(i>=0 && i<fncell) {
+     GetEtaPhi(fidcell[i], eta, phi);
+     vec.SetPtEtaPhi(Double_t(fetcell[i]),eta,phi);
   }
   return vec;
 }
 
-TVector3& AliEMCALJetMicroDst::GetGridVector(Int_t i)
+TVector3& AliEMCALJetMicroDst::GetGridVector(Int_t i) const 
 {
+  // Get grid vector
   static Double_t eta,phi;
   static TVector3 vec;
   vec.SetXYZ(0.,0.,0.);
-  if(i>=0 && i<ngrid) {
-     GetEtaPhi(idgrid[i], eta, phi);
-     vec.SetPtEtaPhi(Double_t(etgrid[i]),eta,phi);
+  if(i>=0 && i<fngrid) {
+     GetEtaPhi(fidgrid[i], eta, phi);
+     vec.SetPtEtaPhi(Double_t(fetgrid[i]),eta,phi);
   }
   return vec;
 }
 
-Double_t AliEMCALJetMicroDst::GetSumInCone(TVector3 &jet,Int_t nc, Float_t *et,Float_t *eta,Float_t *phi, Double_t cellEtCut, Double_t rJet)
+Double_t AliEMCALJetMicroDst::GetSumInCone(TVector3 &jet,Int_t nc, Float_t *et,Float_t *eta,Float_t *phi, Double_t cellEtCut, Double_t rJet) const 
 {
+  // Get Sum in cone
   static Double_t sum=0.;
   static TVector3 cell(0., 0., 0.);
   if(nc<=0 || et==0 || eta==0 || phi==0) {
@@ -628,7 +660,7 @@ Double_t AliEMCALJetMicroDst::GetSumInCone(TVector3 &jet,Int_t nc, Float_t *et,F
 
   sum=0.;
   //  jet.SetPtEtaPhi(jet[0],jetaw[0],jphiw[0]); // must be one jet !!
-  Info("GetSumInCone", "jet.Mag() %f : njet %i\n", jet.Mag(), njet);
+  Info("GetSumInCone", "jet.Mag() %f : njet %i\n", jet.Mag(), fnjet);
   for(Int_t i=0; i<nc; i++){
     if(et[i] < cellEtCut)    continue;
     cell.SetPtEtaPhi(et[i], eta[i], phi[i]);
@@ -639,35 +671,38 @@ Double_t AliEMCALJetMicroDst::GetSumInCone(TVector3 &jet,Int_t nc, Float_t *et,F
   return sum;
 }
 
-Double_t AliEMCALJetMicroDst::GetEmcalEtInCone(TVector3 &jet, Double_t cellEtCut, Double_t rJet)
+Double_t AliEMCALJetMicroDst::GetEmcalEtInCone(TVector3 &jet, Double_t cellEtCut, Double_t rJet) 
 {
-  Int_t nc = ncell;
+  // Get EMCAL Et in cone
+  Int_t nc = fncell;
   if(nc<=0) return 0.;
 
-  Float_t *et=etcell, *eta=new Float_t[nc], *phi=new Float_t[nc];
-  Double_t etaCell=0., phiCell=0., ET=0;
+  Float_t *et=fetcell, *eta=new Float_t[nc], *phi=new Float_t[nc];
+  Double_t etaCell=0., phiCell=0., eTotal=0;
 
   for(Int_t i=0; i<nc; i++) {
-    GetEtaPhi(idcell[i], etaCell, phiCell);
+    GetEtaPhi(fidcell[i], etaCell, phiCell);
     eta[i] = etaCell;
     phi[i] = phiCell;
   }
 
-  ET = GetSumInCone(jet, nc, et,eta,phi, cellEtCut,rJet);
+  eTotal = GetSumInCone(jet, nc, et,eta,phi, cellEtCut,rJet);
   delete [] eta;
   delete [] phi;
 
-  return ET;
+  return eTotal;
 }
 
-Double_t AliEMCALJetMicroDst::GetTpcPtInCone(TVector3 &jet,Double_t cellEtCut, Double_t rJet)
+Double_t AliEMCALJetMicroDst::GetTpcPtInCone(TVector3 &jet,Double_t cellEtCut, Double_t rJet) 
 {
-  if(nchp<=0) return 0.;
-  return GetSumInCone(jet, nchp, ppt,peta,pphi, cellEtCut,rJet);
+  // Get TPC PT in cone
+  if(fnchp<=0) return 0.;
+  return GetSumInCone(jet, fnchp, fppt,fpeta,fpphi, cellEtCut,rJet);
 }
 
-Double_t AliEMCALJetMicroDst::GetSum(Int_t n, Float_t *ar, Double_t cut)
-{ // 25-apr-2003
+Double_t AliEMCALJetMicroDst::GetSum(Int_t n, Float_t *ar, Double_t cut) const 
+{ 
+  // 25-apr-2003
   Double_t sum=0.0;
   if(n<=0 || ar==0) return sum;
   for(Int_t i=0; i<n; i++) {if(ar[i]>=cut) sum += Double_t(ar[i]);}
@@ -676,6 +711,7 @@ Double_t AliEMCALJetMicroDst::GetSum(Int_t n, Float_t *ar, Double_t cut)
 
 void AliEMCALJetMicroDst::Close()
 {
+  // Close
   fFile->Write(); 
   fTree->Print(); 
   fFile->Close();
@@ -683,15 +719,17 @@ void AliEMCALJetMicroDst::Close()
   fTree = 0;
 }
 
-void AliEMCALJetMicroDst::Browse(TBrowser* b)
+void AliEMCALJetMicroDst::Browse(TBrowser* b) const 
 {
+  // Browse
    if(fTree)      b->Add((TObject*)fTree);
    if(fListHist)  b->Add((TObject*)fListHist);
    //   TObject::Browse(b);
 }
 
-Bool_t  AliEMCALJetMicroDst::IsPythiaDst()
+Bool_t  AliEMCALJetMicroDst::IsPythiaDst() const 
 {
+  // Is Pythia DST
   TString st(GetTitle());
   if(st.Contains("py",TString::kIgnoreCase)||!st.Contains("hijing", TString::kIgnoreCase)) return kTRUE;
   else return kFALSE;
@@ -699,12 +737,14 @@ Bool_t  AliEMCALJetMicroDst::IsPythiaDst()
 
 Bool_t  AliEMCALJetMicroDst::IsFolder() const
 {
+  // Is folder
   if(fTree || fListHist) return kTRUE;
   else                   return kFALSE;
 }
 
-TList* AliEMCALJetMicroDst::MoveHistsToList(char* name, Bool_t putToBrowser)
+TList* AliEMCALJetMicroDst::MoveHistsToList(const char* name, Bool_t putToBrowser)
 {
+  // Move HIST to list
   gROOT->cd();
   TIter nextHist(gDirectory->GetList());
   TList *list = new TList;