/*
$Log$
+Revision 1.14 2004/04/02 17:11:33 mhorner
+Marco's bug - fixes implemented
+
+Revision 1.13 2004/03/26 01:00:38 mhorner
+Implementing Marco's optimisations
+
+Revision 1.12 2004/03/15 19:59:37 mhorner
+Pyhtia comparison extended
+
+Revision 1.11 2004/03/09 17:06:38 mhorner
+Made more robust
+
Revision 1.10 2004/03/06 01:56:09 mhorner
Pythai comp code
void AliEMCALJetFinderAlgoOmni::InitUnitArray()
{
//Initialises unit arrays
- if(fArrayInitialised) delete[] fUnit;
+ if(fArrayInitialised) delete [] fUnit;
+ if(fArrayInitialised) delete [] fUnitNoCuts;
fUnit = new AliEMCALJetFinderAlgoUA1Unit[fNumUnits];
fUnitNoCuts = new AliEMCALJetFinderAlgoUA1Unit[fNumUnits];
fArrayInitialised = 1;
// {
AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
- AliEMCALGeometry * geom = gime->EMCALGeometry();
+ AliEMCALGeometry * geom;
+ if (gime)
+ geom = gime->EMCALGeometry();
+ else
+ geom = AliEMCALGeometry::GetInstance("EMCAL_55_25","EMCAL");
// }
fUnit[j].SetUnitFlag(kOutJet);
fUnit[j].SetUnitEta(myPart->Eta());
fUnit[j].SetUnitPhi(myPart->Phi());
- fUnit[j].SetUnitEnergy(myPart->Energy()*TMath::Sin(myPart->Theta()));
+ if (myPart->Energy()*TMath::Sin(myPart->Theta()) > fPtCut || myPart->GetPDG()->Charge() == 0.0 )
+ {
+ fUnit[j].SetUnitEnergy(myPart->Energy()*TMath::Sin(myPart->Theta()));
+ }else
+ {
+ fUnit[j].SetUnitEnergy(0.00);
+ }
fUnitNoCuts[j].SetUnitID(j);
fUnitNoCuts[j].SetUnitFlag(kOutJet);
fUnitNoCuts[j].SetUnitEta(myPart->Eta());
//Stores the resulting jet information in appropriate storage structure (TO BE DECIDED!!!!)
if (fDebug>1) Info("StoreJetInfo","Storing Jet Information");
AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
- AliEMCALGeometry * geom = gime->EMCALGeometry();
+ AliEMCALGeometry * geom;
+ if (gime)
+ geom = gime->EMCALGeometry();
+ else
+ geom = AliEMCALGeometry::GetInstance("EMCAL_55_25","EMCAL");
//Store:
//fJetESum is the final jet energy (background has been subtracted)
//fJetEta is the final jet Eta
//fNumInCone is the final number of cells included in the jet cone
//fEtaInit is the eta of the initiator cell
//fPhiInit is the phi of the initiator cell
- fJet.SetEnergy(fJetESum);
- fJet.SetEta(fJetEta);
- fJet.SetPhi(fJetPhi);
+
+ AliEMCALJet jet(fJetESum,fJetPhi,fJetEta);
cout<<"For iteration "<<fNumIter <<" and Jet number " <<fNumJets <<endl;
cout<<"The jet energy is: " <<fJetESum <<endl;
}//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);
+ jet.SetTrackList(numTracksInCone,pTArray, etaArray, phiArray, pdgArray);
+ jet.SetEMCALEnergy(emcalEnergy);
+ jet.SetEMCALEnergyBGSub(emcalEnergyBGSub);
+ jet.SetTrackEnergy(trackEnergy);
+ jet.SetTrackEnergyPtCut(trackEnergyPtCut);
+ fOutputPointer->AddJet(&jet);
delete[] pTArray;
delete[] etaArray;
delete[] phiArray;
//Step 4. Find the value of the average background energy
FindBG();
- fOutputObject.Reset(kResetJets); //Reset output object to store info for new iteration
+ fOutputPointer->Reset(kResetJets); //Reset output object to store info for new iteration
fNumJets=0;
//Loop over the array of unit objects and flag those with energy below MinCellEt
fPhiInit = fJetPhi;
fEtaB = fJetEta;
fPhiB = fJetPhi;
+ Int_t testflag = 1;
+ do
+ {
fJetESum = 0.0;
fJetEtaSum = 0.0;
fJetPhiSum = 0.0;
//Step 6. Find Jet Eta and Phi
//Loop over all units in the array to find the ones in the jet cone and determine contrib to Jet eta, phi
- do
- {
for(Int_t count1=0; count1<fNumUnits; count1++)
{
- if(fUnit[count1].GetUnitID() == seedID) continue; //skip unit if the jetseed to avoid doublecounting
+ if(fUnit[count1].GetUnitID() == seedID && testflag)
+ {
+ testflag=0;
+ continue; //skip unit if the jetseed to avoid doublecounting
+ }
if(fUnit[count1].GetUnitFlag() == kOutJet)
{
fDEta = fUnit[count1].GetUnitEta() - fJetEta;