]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - JETAN/AliSISConeJetFinder.cxx
Fix for Coverity warning 16208
[u/mrichter/AliRoot.git] / JETAN / AliSISConeJetFinder.cxx
index 75fdc2939ad1b16b24a3f161923d587f01794700..f9ef55f8b91a461755e8f2f5b9edb23519d3ff94 100644 (file)
@@ -88,11 +88,6 @@ void AliSISConeJetFinder::FindJets()
   Int_t debug  = header->GetDebug();     // debug option
   Int_t fOpt    = fReader->GetReaderHeader()->GetDetector();
 
-  // Check if we are reading AOD jets
-  TRefArray *refs = 0;
-  Bool_t fromAod = !strcmp(fReader->ClassName(),"AliJetAODReader");
-  if (fromAod) { refs = fReader->GetReferences(); }
-  
 
 //******************************** SISCONE PLUGIN CONFIGURATION
 // Here we look for SISCone parameters in the header and we define our plugin.  
@@ -116,7 +111,7 @@ void AliSISConeJetFinder::FindJets()
     if(fOpt==0) 
       {
        TClonesArray *lvArray = fReader->GetMomentumArray();
-       Int_t nIn = lvArray->GetEntries();
+
        
        // We check if lvArray is ok
        if(lvArray == 0)
@@ -126,6 +121,8 @@ void AliSISConeJetFinder::FindJets()
            return;
          }
        
+       Int_t nIn = lvArray->GetEntries();
+       
        if(nIn == 0)// nIn = Number of particles in the event
          {
            if (debug) cout << "entries = 0 ; Event empty !!!" << endl ;
@@ -251,7 +248,8 @@ void AliSISConeJetFinder::FindJets()
     fastjet::JetAlgorithm algorithm = fastjet::kt_algorithm;
     if (algo == 0) algorithm = fastjet::kt_algorithm;
     if (algo == 1) algorithm = fastjet::cambridge_algorithm;
-    fastjet::JetDefinition jetDefForRho(algorithm, 0.5);
+    Double_t RRho = header->GetRForRho();
+    fastjet::JetDefinition jetDefForRho(algorithm, RRho);
     fastjet::ClusterSequenceArea csForRho(inputParticles, jetDefForRho, areaDef);
     Double_t rho = csForRho.median_pt_per_unit_area_4vector(range);
     cout<<"rho = "<<rho<<endl;
@@ -272,16 +270,10 @@ void AliSISConeJetFinder::FindJets()
       if(debug){
        cout<<"********************************** Reconstructed jet(s) (non corrected)"<<endl;
        cout<<"Jet number "<<j+1<<" : "<<"Rapidity : "<<jets[j].rap()<<" Phi : "<<jets[j].phi()<<" pT : "<<jets[j].perp()<<" area : "<<clustSeq.area(jets[j])<<endl;
-       //     cout<<"px = "<<jets[j].px()<<endl;
-       //     cout<<"py = "<<jets[j].py()<<endl;
-       //     cout<<"pz = "<<jets[j].pz()<<endl;
        cout<<"e = "<<jets[j].E()<<endl;
        
        cout<<"********************************** Corrected jet(s)"<<endl;
        cout<<"Jet number "<<j+1<<" : "<<"Rapidity : "<<corrJets[j].rap()<<" Phi : "<<corrJets[j].phi()<<" pT : "<<corrJets[j].perp()<<endl;
-       //     cout<<"px = "<<corrJets[j].px()<<endl;
-       //     cout<<"py = "<<corrJets[j].py()<<endl;
-       //     cout<<"pz = "<<corrJets[j].pz()<<endl;
        cout<<"e = "<<corrJets[j].E()<<endl;
       }
       // Go to write AOD info
@@ -297,26 +289,27 @@ void AliSISConeJetFinder::FindJets()
   if (bgMode == 0)// No BG subtraction
   {
     //******************************** JETS FINDING AND EXTRACTION
-    fastjet::ClusterSequence clustSeq(inputParticles, plugin);
+    fastjet::ClusterSequenceArea clustSeq(inputParticles, plugin, areaDef);
     // Here we extract inclusive jets with pt > ptmin, sorted by pt 
     Double_t ptMin = header->GetMinJetPt(); 
     vector<fastjet::PseudoJet> inclusiveJets = clustSeq.inclusive_jets(ptMin);
     vector<fastjet::PseudoJet> jets = sorted_by_pt(inclusiveJets);
-  
+
     //***************************** JETS DISPLAY
 
     for (size_t k = 0; k < jets.size(); k++)
     {
-      if(debug){
+      if(debug)
+      {
        cout<<"********************************** Reconstructed jet(s) (non corrected)"<<endl;
        cout<<"Jet number "<<k+1<<" : "<<"Rapidity : "<<jets[k].rap()<<" Phi : "<<jets[k].phi()<<" pT : "<<jets[k].perp()<<endl;
-       //     cout<<"px = "<<jets[k].px()<<endl;
-       //     cout<<"py = "<<jets[k].py()<<endl;
-       //     cout<<"pz = "<<jets[k].pz()<<endl;
        cout<<"e = "<<jets[k].E()<<endl;
       }
+
       // Go to write AOD info
+      Double_t area = clustSeq.area(jets[k]);
       AliAODJet aodjet (jets[k].px(), jets[k].py(), jets[k].pz(), jets[k].E());
+      aodjet.SetEffArea(area,0);
       if(debug) aodjet.Print("");
       AddJet(aodjet);
     }