* Author: The ALICE Off-line Project. *
* Contributors are mentioned in the code where appropriate. *
* *
- * Permission to use, copy, modify and distribute this software and its *
+ * Permission to usec, copy, modify and distribute this software and its *
* documentation strictly for non-commercial purposes is hereby granted *
* without fee, provided that the above copyright notice appears in all *
* copies and that both the copyright notice and this permission notice *
AliCdfJetFinder::AliCdfJetFinder():
AliJetFinder(),
fHistos(0),
- fDebug(0),
fFromAod(0),
fAODwrite(0),
fAODtracksWrite(0),
//______________________________________________________________________________
AliCdfJetFinder::~AliCdfJetFinder()
{
+ Clean();
// destructor
}
// * Go to the next highest PT particle (not already included in a jet) and include in the "jet" all particles
// (not already included in a jet) within the radius R =0.7.
// * Continue until all particles are in a "jet".
-
+ if (fDebug) { printf("AliCDJetfinder::FindJets() %d \n", __LINE__ ); }
AliCdfJetHeader *header = (AliCdfJetHeader*)fHeader;
if (header)
{
- fDebug = header->IsDebugCDF();
+ fDebug = header->GetDebug();
fAODwrite = header->IsAODwrite() ; // write jets to AOD
fAODtracksWrite = header->IsAODtracksWrite() ; // write jet tracks to AOD
fRadius = header->GetRadius(); // get Radius from jet finder header
InitData();
-if (!fNPart) { if (fDebug) {cout << "entries = 0 ; Event empty !!!" << endl ;} return; } // if event empty then exit
-
-FindCones();
-
-ComputeConesWeight();
-
-if (fAODwrite) { cout << "Writing AOD" << endl ; WriteJets(); }
-
-if (fAnalyseJets) AnalizeJets();
-
-Clean();
+ if (!fNPart) {
+ if (fDebug) {
+ cout << "entries = 0 ; Event empty !!!" << endl ;
+ }
+ // no need to call clean, InitData does not
+ // create pointers if npart == 0
+ return;
+ } // if event empty then exit
+
+ FindCones();
+
+ ComputeConesWeight();
+
+ if (fAODwrite) {
+ if(fDebug)cout << "Writing AOD" << endl ;
+ WriteJets();
+ }
+
+ if (fAnalyseJets) AnalizeJets();
+
+ Clean();
}
if (fDebug) jet.Print("");
if (fFromAod && fAODtracksWrite)
- {
+ {
for ( Int_t jetTrack = 0; jetTrack < fNPart; jetTrack++ )
- { if ( fVectParticle[jetTrack]->njet == jetnr ) { jet.AddTrack(fRefArr->At(jetTrack)) ; } }
- }
+ { if ( fVectParticle[jetTrack]->njet == jetnr ) { jet.AddTrack(fRefArr->At(jetTrack)) ; } }
+ }
// tracks REFs written in AOD
AddJet(jet);
+
}
//jets vector parsed and written to AOD
}
void AliCdfJetFinder::Clean()
{
// CLEANING SECTION
- delete [] fVectParticle;
- delete [] fVectJet;
- delete [] fPtArray;
- delete [] fIdxArray;
+ for ( Int_t i = 0 ; i < fNPart ; i++ ){
+ delete fVectParticle[i];
+ fVectParticle[i] = 0;
+ }
+ delete [] fVectParticle;fVectParticle = 0;
+
+ for ( Int_t i = 0 ; i < fNJets ; i++ ){
+ delete fVectJet[i];
+ fVectJet[i] = 0;
+ }
+ delete [] fVectJet;fVectJet = 0;
+
+ delete [] fPtArray;fPtArray = 0;
+ delete [] fIdxArray;fIdxArray = 0;
Reset();
}