adding plots vs. mult in background subtraction, fixed setting of p_T in randomized...
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 28 Mar 2011 11:21:25 +0000 (11:21 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 28 Mar 2011 11:21:25 +0000 (11:21 +0000)
JETAN/AliAnalysisTaskJetBackgroundSubtract.cxx
JETAN/AliAnalysisTaskJetBackgroundSubtract.h
JETAN/AliAnalysisTaskJetCluster.cxx

index 2838a8d..a6a74ac 100644 (file)
@@ -64,6 +64,8 @@ AliAnalysisTaskJetBackgroundSubtract::AliAnalysisTaskJetBackgroundSubtract():
   fOutJetArrayList(0x0),
   fh2CentvsRho(0x0),
   fh2CentvsSigma(0x0),
+  fh2MultvsRho(0x0),
+  fh2MultvsSigma(0x0),
   fh2ShiftEta(0x0),
   fh2ShiftPhi(0x0),
   fh2ShiftEtaLeading(0x0),
@@ -89,6 +91,8 @@ AliAnalysisTaskJetBackgroundSubtract::AliAnalysisTaskJetBackgroundSubtract(const
   fOutJetArrayList(0x0),
   fh2CentvsRho(0x0),
   fh2CentvsSigma(0x0),
+  fh2MultvsRho(0x0),
+  fh2MultvsSigma(0x0),
   fh2ShiftEta(0x0),
   fh2ShiftPhi(0x0),
   fh2ShiftEtaLeading(0x0),
@@ -238,11 +242,16 @@ void AliAnalysisTaskJetBackgroundSubtract::UserCreateOutputObjects()
   //    
 
  
-    fh2CentvsRho = new TH2F("fh2CentvsRho","centrality vs background density",100,0.,100.,100,0.,150.);
-    fh2CentvsSigma = new TH2F("fh2CentvsSigma","centrality vs backgroun sigma",100,0.,100.,100,0.,150.);
+    fh2CentvsRho = new TH2F("fh2CentvsRho","centrality vs background density",100,0.,100.,2000,0.,200.);
+    fh2CentvsSigma = new TH2F("fh2CentvsSigma","centrality vs backgroun sigma",100,0.,100.,1000,0.,50.);
     fHistList->Add(fh2CentvsRho);
     fHistList->Add(fh2CentvsSigma);
 
+    fh2MultvsRho = new TH2F("fh2MultvsRho","mult vs background density",4000,0.,4000.,2000,0.,200.);
+    fh2MultvsSigma = new TH2F("fh2MultvsSigma","mult vs backgroun sigma",4000,0.,4000.,1000,0.,50.);
+    fHistList->Add(fh2MultvsRho);
+    fHistList->Add(fh2MultvsSigma);
+
    if(fSubtraction==k4Area){
     fh2ShiftEta = new TH2F("fh2ShiftEta","extended correction Eta",100,-0.9,0.9,100,-0.9,0.9);
     fh2ShiftPhi = new TH2F("fh2ShiftPhi","extended correction Phi",100,0.,6.5,100,0.,6.5);
@@ -366,6 +375,7 @@ void AliAnalysisTaskJetBackgroundSubtract::UserExec(Option_t */*option*/)
    Double_t meanarea = 0;
    TLorentzVector backgroundv;
    Float_t cent=0.;
+   
    if(fAODOut)cent = fAODOut->GetHeader()->GetCentrality();
    if(evBkg)sigma=evBkg->GetSigma(1); 
 
@@ -380,8 +390,24 @@ void AliAnalysisTaskJetBackgroundSubtract::UserExec(Option_t */*option*/)
      rho =RecalcRho(bkgClusters,meanarea);
    }
    if(fSubtraction==kRhoRC) rho=RhoRC(bkgClustersRC);
+
+   Float_t mult = 0;
+   for(int iJB = 0;iJB<fInJetArrayList->GetEntries();iJB++){
+    TClonesArray* jarray = (TClonesArray*)fInJetArrayList->At(iJB);
+    if(jarray){
+      TString tmp(jarray->GetName());
+      if(tmp.Contains("cluster")){
+       mult = MultFromJetRefs(jarray);
+       if(mult>0)break;
+      }
+    }
+   }
+
    fh2CentvsRho->Fill(cent,rho);
    fh2CentvsSigma->Fill(cent,sigma);
+
+   fh2MultvsRho->Fill(mult,rho);
+   fh2MultvsSigma->Fill(mult,sigma);
    
    for(int iJB = 0;iJB<fInJetArrayList->GetEntries();iJB++){
     TClonesArray* jarray = (TClonesArray*)fInJetArrayList->At(iJB);
@@ -643,3 +669,18 @@ void AliAnalysisTaskJetBackgroundSubtract::PrintAODContents(){
     fAODOut->Print();
   }
 }
+
+Int_t AliAnalysisTaskJetBackgroundSubtract::MultFromJetRefs(TClonesArray* jets){
+  if(!jets)return 0;
+
+  Int_t refMult = 0;
+  for(int ij = 0;ij < jets->GetEntries();++ij){
+    AliAODJet* jet = (AliAODJet*)jets->At(ij);
+    if(!jet)continue;
+    TRefArray *refs = jet->GetRefTracks();
+    if(!refs)continue;
+    refMult += refs->GetEntries();
+  }
+  return refMult;
+
+}
index f249e43..5dd76c4 100644 (file)
@@ -67,7 +67,7 @@ class AliAnalysisTaskJetBackgroundSubtract : public AliAnalysisTaskSE
     AliAnalysisTaskJetBackgroundSubtract& operator=(const AliAnalysisTaskJetBackgroundSubtract&);
     Bool_t RescaleJetMomentum(AliAODJet *jet,Float_t pT);
     Bool_t RescaleJet4vector(AliAODJet *jet,TLorentzVector backgroundv);
-
+    Int_t  MultFromJetRefs(TClonesArray* jets);
     Double_t RecalcRho(TClonesArray* fbkgclusters,Double_t meanarea);
     Double_t RhoRC(TClonesArray* fbkgclustersRC);
     void ResetOutJets();
@@ -88,6 +88,8 @@ class AliAnalysisTaskJetBackgroundSubtract : public AliAnalysisTaskSE
 
     TH2F*         fh2CentvsRho;   //! centrality vs background density  
     TH2F*         fh2CentvsSigma;   //! centrality vs background sigma  
+    TH2F*         fh2MultvsRho;   //! centrality vs background density  
+    TH2F*         fh2MultvsSigma;   //! centrality vs background sigma  
     TH2F*         fh2ShiftEta;   //! extended correction Eta
     TH2F*         fh2ShiftPhi;   //! extended correction Phi
     TH2F*         fh2ShiftEtaLeading;   //! extended correction Eta leading jet
@@ -96,7 +98,7 @@ class AliAnalysisTaskJetBackgroundSubtract : public AliAnalysisTaskSE
  
     TList *fHistList; //! the histograms output list
    
-    ClassDef(AliAnalysisTaskJetBackgroundSubtract, 4) 
+    ClassDef(AliAnalysisTaskJetBackgroundSubtract, 5) 
 };
  
 #endif
index 1c36bfa..d8e6f4b 100644 (file)
@@ -1004,8 +1004,8 @@ void AliAnalysisTaskJetCluster::UserExec(Option_t */*option*/)
        }
        if(skip)continue;
        tmpRecC.SetBgEnergy(0,0); // this is use as temporary storage of the summed p_T below
-       if(fTCARandomConesOut)new ((*fTCARandomConesOut)[nConeRan++]) AliAODJet(tmpRecC);
-       if(fTCARandomConesOutRan)new ((*fTCARandomConesOutRan)[nCone++]) AliAODJet(tmpRecC);
+       if(fTCARandomConesOut)new ((*fTCARandomConesOut)[nCone++]) AliAODJet(tmpRecC);
+       if(fTCARandomConesOutRan)new ((*fTCARandomConesOutRan)[nConeRan++]) AliAODJet(tmpRecC);
      }// loop over random cones creation
 
   
@@ -1071,7 +1071,7 @@ void AliAnalysisTaskJetCluster::UserExec(Option_t */*option*/)
         }
        }
      }
-     if(!fTCARandomConesOutRan){
+     if(fTCARandomConesOutRan){
        for(int ir = 0;ir < fTCARandomConesOutRan->GetEntriesFast();ir++){
         AliAODJet* rC = (AliAODJet*)fTCARandomConesOutRan->At(ir);
         // same wit random