Coeverity fixes, changed hard-coded track eta of 0.9 for the cluster task, do not...
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Feb 2011 20:12:47 +0000 (20:12 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Feb 2011 20:12:47 +0000 (20:12 +0000)
JETAN/AliAnalysisTaskFastEmbedding.cxx
JETAN/AliAnalysisTaskJetBackgroundSubtract.cxx
JETAN/AliAnalysisTaskJetCluster.cxx
JETAN/AliAnalysisTaskJetCluster.h

index e69c496..c4ec235 100644 (file)
@@ -636,11 +636,6 @@ Int_t AliAnalysisTaskFastEmbedding::OpenAODfile(){
     delete fAODevent;
     fAODevent = new AliAODEvent();
     fAODevent->ReadFromTree(fAODtree);
-    if(!fAODevent){
-       AliError("AOD event not found.");
-       return -1;
-    }
-
     return 1;
 }
 
index 5a36e64..5c94c15 100644 (file)
@@ -222,7 +222,7 @@ void AliAnalysisTaskJetBackgroundSubtract::UserCreateOutputObjects()
       continue;
     }
     newName.ReplaceAll(fReplaceString1.Data(),Form(fReplaceString2.Data(),fSubtraction));
-    TH2F *hTmp = new TH2F(Form("h2PtInPtOut_%d",iJB),Form(";%s p_{T}; %s p_{T}",oldName.Data(),newName.Data()),200,0,200.,200,0.,200.);
+    TH2F *hTmp = new TH2F(Form("h2PtInPtOut_%d",iJB),Form(";%s p_{T}; %s p_{T}",oldName.Data(),newName.Data()),200,0,200.,400,-200.,200.);
     fHistList->Add(hTmp);
   }
 
@@ -406,8 +406,8 @@ void AliAnalysisTaskJetBackgroundSubtract::UserExec(Option_t */*option*/)
        }
        if(ptSub<0){
          // optionally rescale it and keep??
-         bAdd = RescaleJetMomentum(&tmpNewJet,0.1);
-         if(h2PtInOut)h2PtInOut->Fill(jet->Pt(),0.1);
+         bAdd = false; // RescaleJetMomentum(&tmpNewJet,0.1);
+         if(h2PtInOut)h2PtInOut->Fill(jet->Pt(),ptSub);
        }
        else{
          bAdd = RescaleJetMomentum(&tmpNewJet,ptSub);
@@ -424,8 +424,8 @@ void AliAnalysisTaskJetBackgroundSubtract::UserExec(Option_t */*option*/)
          Printf("%s:%d Jet %d %3.3f %3.3f %3.3f %3.3f",(char*)__FILE__,__LINE__,i,jet->Pt(),ptSub,background,rho);}
        if(ptSub<0){
          // optionally rescale it and keep??
-         bAdd = RescaleJetMomentum(&tmpNewJet,0.1);
-         if(h2PtInOut)h2PtInOut->Fill(jet->Pt(),0.1);
+         bAdd = false;// RescaleJetMomentum(&tmpNewJet,0.1);
+         if(h2PtInOut)h2PtInOut->Fill(jet->Pt(),ptSub);
        }
        else{
          bAdd = RescaleJetMomentum(&tmpNewJet,ptSub);
@@ -442,8 +442,8 @@ void AliAnalysisTaskJetBackgroundSubtract::UserExec(Option_t */*option*/)
        if(fDebug>2){   Printf("%s:%d Jet %d %3.3f %3.3f %3.3f %3.3f",(char*)__FILE__,__LINE__,i,jet->Pt(),ptSub,background,rho);}
        if(ptSub<0){
          // optionally rescale it and keep??
-         bAdd = RescaleJetMomentum(&tmpNewJet,0.1);
-         if(h2PtInOut)h2PtInOut->Fill(jet->Pt(),0.1);
+         bAdd = false; // RescaleJetMomentum(&tmpNewJet,0.1);
+         if(h2PtInOut)h2PtInOut->Fill(jet->Pt(),ptSub);
        }
        else{
          bAdd = RescaleJetMomentum(&tmpNewJet,ptSub);
@@ -462,8 +462,8 @@ void AliAnalysisTaskJetBackgroundSubtract::UserExec(Option_t */*option*/)
         if((backgroundv.E()>jet->E())&&(backgroundv.Pt()>jet->Pt())){
        
           // optionally rescale it and keep??
-          bAdd = RescaleJetMomentum(&tmpNewJet,0.1);
-          if(h2PtInOut)h2PtInOut->Fill(jet->Pt(),0.1);
+          bAdd = false; // RescaleJetMomentum(&tmpNewJet,0.1);
+          if(h2PtInOut)h2PtInOut->Fill(jet->Pt(),jet->Pt()-backgroundv.Pt());
         }
         else{
           bAdd = RescaleJet4vector(&tmpNewJet,backgroundv);
index 6f4ad26..28ed802 100644 (file)
@@ -97,7 +97,8 @@ AliAnalysisTaskJetCluster::AliAnalysisTaskJetCluster(): AliAnalysisTaskSE(),
   fNSkipLeadingRan(0),
   fNRandomCones(0),
   fAvgTrials(1),
-  fExternalWeight(1),    
+  fExternalWeight(1),
+  fTrackEtaWindow(0.9),    
   fRecEtaWindow(0.5),
   fTrackPtCut(0.),                                                     
   fJetOutputMinPt(1),
@@ -205,6 +206,7 @@ AliAnalysisTaskJetCluster::AliAnalysisTaskJetCluster(const char* name):
   fNRandomCones(0),
   fAvgTrials(1),
   fExternalWeight(1),    
+  fTrackEtaWindow(0.9),    
   fRecEtaWindow(0.5),
   fTrackPtCut(0.),                                                     
   fJetOutputMinPt(1),
@@ -449,9 +451,9 @@ void AliAnalysisTaskJetCluster::UserCreateOutputObjects()
   fh1PtJetsLeadingRecInRan = new TH1F("fh1PtJetsLeadingRecInRan","Rec jets P_T;p_{T} (GeV/c)",nBinPt,binLimitsPt);
   fh1PtJetConstRec = new TH1F("fh1PtJetsConstRec","Rec jets constituents P_T;p_{T} (GeV/c)",nBinPt,binLimitsPt);
   fh1PtJetConstLeadingRec = new TH1F("fh1PtJetsConstLeadingRec","Rec jets constituents P_T;p_{T} (GeV/c)",nBinPt,binLimitsPt);
-  fh1PtTracksRecIn  = new TH1F("fh1PtTracksRecIn","Rec tracks P_T #eta < 0.9;p_{T} (GeV/c)",nBinPt,binLimitsPt);
-  fh1PtTracksLeadingRecIn  = new TH1F("fh1PtTracksLeadingRecIn","Rec tracks P_T #eta < 0.9;p_{T} (GeV/c)",nBinPt,binLimitsPt);
-  fh1PtTracksGenIn  = new TH1F("fh1PtTracksGenIn","gen tracks P_T #eta < 0.9;p_{T} (GeV/c)",nBinPt,binLimitsPt);
+  fh1PtTracksRecIn  = new TH1F("fh1PtTracksRecIn",Form("Rec tracks P_T #eta < %1.2f;p_{T} (GeV/c)",fTrackEtaWindow),nBinPt,binLimitsPt);
+  fh1PtTracksLeadingRecIn  = new TH1F("fh1PtTracksLeadingRecIn",Form("Rec tracks P_T #eta < %1.2f ;p_{T} (GeV/c)",fTrackEtaWindow),nBinPt,binLimitsPt);
+  fh1PtTracksGenIn  = new TH1F("fh1PtTracksGenIn",Form("gen tracks P_T #eta < %1.2f ;p_{T} (GeV/c)",fTrackEtaWindow),nBinPt,binLimitsPt);
   fh1Nch = new TH1F("fh1Nch","charged multiplicity; N_{ch}",nChMax,-0.5,nChMax-0.5);
 
   fh1Centrality = new TH1F("fh1Centrality",";cent (%)",111,-0.5,110.5);
@@ -760,7 +762,7 @@ void AliAnalysisTaskJetCluster::UserExec(Option_t */*option*/)
     // the randomized input changes eta and phi, but keeps the p_T
     if(i>=fNSkipLeadingRan){// eventually skip the leading particles
       Double_t pT = vp->Pt();
-      Double_t eta = 1.8 * fRandom->Rndm() - 0.9;
+      Double_t eta = 2.*fTrackEtaWindow * fRandom->Rndm() - fTrackEtaWindow;
       Double_t phi = 2.* TMath::Pi() * fRandom->Rndm();
       
       Double_t theta = 2.*TMath::ATan(TMath::Exp(-eta));  
@@ -1020,7 +1022,7 @@ void AliAnalysisTaskJetCluster::UserExec(Option_t */*option*/)
        // the randomized input changes eta and phi, but keeps the p_T
        if(i>=fNSkipLeadingRan){// eventually skip the leading particles
         Double_t pTR = vp->Pt();
-        Double_t etaR = 1.8 * fRandom->Rndm() - 0.9;
+        Double_t etaR = 2.*fTrackEtaWindow* fRandom->Rndm() - fTrackEtaWindow;
         Double_t phiR = 2.* TMath::Pi() * fRandom->Rndm();
         
         Double_t thetaR = 2.*TMath::ATan(TMath::Exp(-etaR));  
@@ -1360,7 +1362,7 @@ Int_t  AliAnalysisTaskJetCluster::GetListOfTracks(TList *list,Int_t type){
       for(int it = 0;it < aod->GetNumberOfTracks();++it){
        AliAODTrack *tr = aod->GetTrack(it);
        if((fFilterMask>0)&&!(tr->TestFilterBit(fFilterMask)))continue;
-       if(TMath::Abs(tr->Eta())>0.9)continue;
+       if(TMath::Abs(tr->Eta())>fTrackEtaWindow)continue;
        if(tr->Pt()<fTrackPtCut)continue;
        list->Add(tr);
        iCount++;
@@ -1430,7 +1432,7 @@ Int_t  AliAnalysisTaskJetCluster::GetListOfTracks(TList *list,Int_t type){
          list->Add(part);
        }
        else {
-         if(TMath::Abs(part->Eta())>0.9)continue;
+         if(TMath::Abs(part->Eta())>fTrackEtaWindow)continue;
          list->Add(part);
        }
        iCount++;
index 04cc43c..0e2bb20 100644 (file)
@@ -55,6 +55,7 @@ class AliAnalysisTaskJetCluster : public AliAnalysisTaskSE
     virtual void SetAODTrackInput(Bool_t b){fUseAODTrackInput = b;}
     virtual void SetAODMCInput(Bool_t b){fUseAODMCInput = b;}
     virtual void SetRecEtaWindow(Float_t f){fRecEtaWindow = f;}
+    virtual void SetTrackEtaWindow(Float_t f){fTrackEtaWindow = f;}
     virtual void SetTrackTypeGen(Int_t i){fTrackTypeGen = i;}
     virtual void SetTrackTypeRec(Int_t i){fTrackTypeRec = i;}
     virtual void SetTrackPtCut(Float_t x){fTrackPtCut = x;}
@@ -125,6 +126,7 @@ class AliAnalysisTaskJetCluster : public AliAnalysisTaskSE
     Int_t         fNRandomCones;          // number of generated random cones
     Float_t       fAvgTrials;             // Average nimber of trials
     Float_t       fExternalWeight;        // external weight
+    Float_t       fTrackEtaWindow;          // eta window used for corraltion plots between rec and gen 
     Float_t       fRecEtaWindow;          // eta window used for corraltion plots between rec and gen 
     Float_t       fTrackPtCut;            // minimum track pt to be accepted
     Float_t       fJetOutputMinPt;        // minimum p_t for jets to be written out