/*
$Log$
+Revision 1.4 2003/09/19 13:16:20 mhorner
+Added additional jet energy info
+Revision 1.3 2003/09/04 12:49:56 mhorner
+Changed hadron correction and added saving EMCAL and track contributions
*/
#include "AliEMCALJetFinderAlgoUA1Unit.h"
#include "AliEMCALGeometry.h"
#include "AliEMCAL.h"
-#include "AliEMCALGetter.h"
#include "AliEMCALDigit.h"
#include "TParticle.h"
#include "AliRun.h"
fESeed = 5.0; //Default value
fConeRad = 0.3; //Default value
fJetEMin = 10.0; //Default value
- fEtMin = 0.28; //Default value
+ fEtMin = 0.0; //Default value
fMinMove = 0.05; //From original UA1 JetFinder
fMaxMove = 0.15; //From original UA1 JetFinder
fBGMaxMove = 0.035; //From original UA1 JetFinder
void AliEMCALJetFinderAlgoOmni::FillUnitArray(AliEMCALJetFinderAlgoUA1FillUnitFlagType_t flag)
{
if (fDebug>1) Info("FillUnitArray","Beginning FillUnitArray");
- // AliEMCAL* pEMCAL = (AliEMCAL*) gAlice->GetModule("EMCAL");
+ AliEMCAL* pEMCAL = (AliEMCAL*) gAlice->GetModule("EMCAL");
// if (pEMCAL){
// AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance(pEMCAL->GetTitle(), "");
// }else
// {
- //AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance("EMCAL_5655_21", "");
- AliEMCALGeometry* geom = AliEMCALGetter::Instance()->EMCALGeometry() ;
- // }
+ AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance("EMCAL_5655_21", "");
+ // }
AliEMCALJetFinderAlgoUA1FillUnitFlagType_t option = flag;
Int_t numTracks, numDigits;
Float_t unitEnergy = fUnit[towerID-1].GetUnitEnergy();
Float_t unitEnergyNoCuts = fUnitNoCuts[towerID-1].GetUnitEnergy();
- /*
- //OLD WAY: //Do Hadron Correction
+
+ //OLD WAY: //Do Hadron Correction
if(fHadCorr != 0)
{
Double_t fullP = myPart->P();
Double_t hCEnergy = fHadCorr->GetEnergy(fullP, (Double_t)eta);
unitEnergy -= hCEnergy*TMath::Sin(myPart->Theta());
+ unitEnergyNoCuts -= hCEnergy*TMath::Sin(myPart->Theta());
fUnit[towerID-1].SetUnitEnergy(unitEnergy);
+ fUnitNoCuts[towerID-1].SetUnitEnergy(unitEnergyNoCuts);
} //end Hadron Correction loop
- */
-
+
+
+ /*
//Do Hadron Correction with propagate phi for the track
if(fHadCorr != 0)
{
phi += deltaPhi;
//Get new tower id for cell that track would curve into
Int_t towerID2;
- if(phi<(1.0/3.0)*TMath::Pi() || phi>TMath::Pi())
+ if(phi>(TMath::Pi()/180.0)*geom->GetArm1PhiMax() || phi<(TMath::Pi()/180.0)*geom->GetArm1PhiMin())
{
towerID2 = -1;
}
fUnitNoCuts[towerID2-1].SetUnitEnergy(unitEnergy2NoCuts);
}//end if for towerID2
}//end Hadron Correction loop
+ */
fUnitNoCuts[towerID-1].SetUnitEnergy(unitEnergyNoCuts + pT);
//Do Pt cut on tracks
for(Int_t i=0; i<fNumUnits; i++)
{
if (fDebug>10) Info("FillUnitArray","Setting all units outside jets");
- fUnit[i].SetUnitFlag(kOutJet); //Set all units to be outside a jet initially
+ //Set all units to be outside a jet initially
+ fUnit[i].SetUnitFlag(kOutJet);
fUnit[i].SetUnitID(i+1);
Float_t eta;
Float_t phi;
geom->EtaPhiFromIndex(fUnit[i].GetUnitID(), eta, phi);
fUnit[i].SetUnitEta(eta);
fUnit[i].SetUnitPhi(phi*TMath::Pi()/180.0);
-
- fUnitNoCuts[i].SetUnitFlag(kOutJet); //Set all units to be outside a jet initially
+ //Set all units to be outside a jet initially
+ fUnitNoCuts[i].SetUnitFlag(kOutJet);
fUnitNoCuts[i].SetUnitID(i+1);
eta = 0.0;
phi = 0.0;
{
//Stores the resulting jet information in appropriate storage structure (TO BE DECIDED!!!!)
if (fDebug>1) Info("StoreJetInfo","Storing Jet Information");
-
+ AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance("EMCAL_5655_21", "");
//Store:
//fJetESum is the final jet energy (background has been subtracted)
//fJetEta is the final jet Eta
cout<<"The jet phi is ---->" <<fJetPhi <<endl;
Int_t numberTracks = fInputPointer->GetNTracks();
+ Int_t numberDigits = fInputPointer->GetNDigits();
+ AliEMCALDigit *myD;
TParticle *myP;
Int_t numTracksInCone = 0;
+ Float_t trackEnergy = 0.0;
+ Float_t trackEnergyPtCut =0.0;
+ Float_t emcalEnergy = 0.0;
+ Float_t emcalEnergyBGSub = 0.0;
for(Int_t counter=0; counter<numberTracks; counter++)
{
if(rad<=fConeRad)
{
pTArray[index] = myP->Pt();
+ //Calculate track contribution within jetcone
+ trackEnergy += myP->Pt();
+ if(myP->Pt() >= fPtCut) trackEnergyPtCut += myP->Pt();
etaArray[index] = eta;
phiArray[index] = phi;
pdgArray[index] = myP->GetPdgCode();
index++;
+ if(fHadCorr != 0)
+ {
+ Double_t fullP = myP->P();
+ Double_t hCEnergy = fHadCorr->GetEnergy(fullP, (Double_t)eta);
+ emcalEnergy -= hCEnergy*TMath::Sin(myP->Theta());
+ emcalEnergyBGSub -= hCEnergy*TMath::Sin(myP->Theta());
+ } //end Hadron Correction loop
+
}//end if
}//end for
+ //Loop over digits to find EMCal contribution within jetcone
+ for(Int_t counter3=0; counter3<numberDigits; counter3++)
+ {
+ myD = fInputPointer->GetDigit(counter3);
+ //GET DIGIT ETA, PHI so that can check if inside R!
+ Float_t eta = 0.0;
+ Float_t phi = 0.0;
+ Int_t ID = myD->GetId();
+ geom->EtaPhiFromIndex(ID, eta, phi);
+ Float_t deta = fJetEta-eta;
+ Float_t dphi = fJetPhi -(TMath::Pi()/180.0)*phi;
+ Float_t rad = TMath::Sqrt( (deta*deta) + (dphi*dphi));
+ if(rad<=fConeRad)
+ {
+ Int_t amplitude = myD->GetAmp(); //Gets the integer valued amplitude of the digit
+ Float_t amp = (Float_t)amplitude; //Need to typecast to Float_t before doing real energy conversion
+ Float_t digitEnergy = amp/10000000.0; //Factor of 10 million needed to convert!
+ emcalEnergy += digitEnergy;
+ emcalEnergyBGSub += (digitEnergy - fEBGAve);
+ }//end if
+ }//end count3 for
+
+ //Save in JET object
fJet.SetTrackList(numTracksInCone,pTArray, etaArray, phiArray, pdgArray);
+ fJet.SetEMCALEnergy(emcalEnergy);
+ fJet.SetEMCALEnergyBGSub(emcalEnergyBGSub);
+ fJet.SetTrackEnergy(trackEnergy);
+ fJet.SetTrackEnergyPtCut(trackEnergyPtCut);
fOutputObject.AddJet(&fJet);
delete[] pTArray;
delete[] etaArray;