updates from Salvatore
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 18 Aug 2012 12:06:41 +0000 (12:06 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 18 Aug 2012 12:06:41 +0000 (12:06 +0000)
PWGJE/EMCALJetTasks/AliJetResponseMaker.cxx
PWGJE/EMCALJetTasks/AliJetResponseMaker.h
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskSAQA.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskSAQA.h
PWGJE/EMCALJetTasks/macros/AddTaskJetRespPtHard.C

index b7619ac..8f6798e 100644 (file)
@@ -38,6 +38,7 @@ AliJetResponseMaker::AliJetResponseMaker() :
   fMCminPhi(0),
   fMCmaxPhi(0),
   fSelectPtHardBin(-999),
+  fDoMatching(kTRUE),
   fPythiaHeader(0),
   fEventWeight(0),
   fPtHardBin(0),
@@ -87,6 +88,7 @@ AliJetResponseMaker::AliJetResponseMaker(const char *name) :
   fMCminPhi(0),
   fMCmaxPhi(0),
   fSelectPtHardBin(-999),
+  fDoMatching(kTRUE),
   fPythiaHeader(0),
   fEventWeight(0),
   fPtHardBin(0),
@@ -377,9 +379,39 @@ Bool_t AliJetResponseMaker::Run()
 {
   // Find the closest jets
 
+  if (!fDoMatching)
+    return kTRUE;
+
   DoJetLoop(fJets, fMCJets, kFALSE);
   DoJetLoop(fMCJets, fJets, kTRUE);
 
+  const Int_t nMCJets = fMCJets->GetEntriesFast();
+
+  for (Int_t i = 0; i < nMCJets; i++) {
+
+    AliEmcalJet* jet = static_cast<AliEmcalJet*>(fMCJets->At(i));
+
+    if (!jet) {
+      AliError(Form("Could not receive jet %d", i));
+      continue;
+    }  
+
+    if (!AcceptJet(jet))
+      continue;
+
+    if (jet->Eta() < fMCminEta || jet->Eta() > fMCmaxEta || jet->Phi() < fMCminPhi || jet->Phi() > fMCmaxPhi)
+      continue;
+
+    if (jet->Pt() > fMaxBinPt)
+      continue;
+
+    if (jet->ClosestJet() && jet->ClosestJet()->ClosestJet() == jet && 
+        jet->ClosestJetDistance() < fMaxDistance) {    // Matched jet found
+      jet->SetMatchedToClosest();
+      jet->ClosestJet()->SetMatchedToClosest();
+    }
+  }
+
   return kTRUE;
 }
 
@@ -404,10 +436,6 @@ void AliJetResponseMaker::DoJetLoop(TClonesArray *jets1, TClonesArray *jets2, Bo
       continue;
 
     if (!mc) {
-      if (!AcceptBiasJet(jet1))
-       continue;
-      if (jet1->MaxTrackPt() > fMaxTrackPt || jet1->MaxClusterPt() > fMaxClusterPt)
-       continue;
       if (jet1->Eta() < fMinEta || jet1->Eta() > fMaxEta || jet1->Phi() < fMinPhi || jet1->Phi() > fMaxPhi)
        continue;
     }
@@ -429,10 +457,6 @@ void AliJetResponseMaker::DoJetLoop(TClonesArray *jets1, TClonesArray *jets2, Bo
        continue;
 
       if (mc) {
-       if (!AcceptBiasJet(jet2))
-         continue;
-       if (jet2->MaxTrackPt() > fMaxTrackPt || jet2->MaxClusterPt() > fMaxClusterPt)
-         continue;
        if (jet2->Eta() < fMinEta || jet2->Eta() > fMaxEta || jet2->Phi() < fMinPhi || jet2->Phi() > fMaxPhi)
          continue;
       }
@@ -456,7 +480,6 @@ void AliJetResponseMaker::DoJetLoop(TClonesArray *jets1, TClonesArray *jets2, Bo
   }
 }
 
-
 //________________________________________________________________________
 Bool_t AliJetResponseMaker::FillHistograms()
 {
@@ -488,11 +511,11 @@ Bool_t AliJetResponseMaker::FillHistograms()
     if (jet->Pt() > fMaxBinPt)
       continue;
 
-    if (jet->ClosestJet() && jet->ClosestJet()->ClosestJet() == jet && 
-        jet->ClosestJetDistance() < fMaxDistance) {    // Matched jet found
-      jet->SetMatchedToClosest();
-      jet->ClosestJet()->SetMatchedToClosest();
-      if (jet->MatchedJet()->Pt() > fMaxBinPt) {
+    if (jet->MatchedJet()) {
+
+      if (!AcceptBiasJet(jet->MatchedJet()) || 
+         jet->MatchedJet()->MaxTrackPt() > fMaxTrackPt || jet->MatchedJet()->MaxClusterPt() > fMaxClusterPt ||
+         jet->MatchedJet()->Pt() > fMaxBinPt) {
        fHistMissedMCJets->Fill(jet->Pt(), fEventWeight);
       }
       else {
index 92f9a16..d57c711 100644 (file)
@@ -25,6 +25,7 @@ class AliJetResponseMaker : public AliAnalysisTaskEmcalJet {
   void                        SetMCFiducial(Bool_t f = kTRUE)    { fMCFiducial      = f; }
   void                        SetEventWeightHist(Bool_t h)       { fEventWeightHist = h; }
   void                        SetPtHardBin(Int_t b)              { fSelectPtHardBin = b; }
+  void                        SetDoMatching(Bool_t b)            { fDoMatching      = b; }
 
  protected:
   Bool_t                      IsEventSelected();
@@ -45,7 +46,8 @@ class AliJetResponseMaker : public AliAnalysisTaskEmcalJet {
   Double_t                    fMCmaxEta;                  // MC jets maximum eta
   Double_t                    fMCminPhi;                  // MC jets minimum phi
   Double_t                    fMCmaxPhi;                  // MC jets maximum phi
-  Int_t                       fSelectPtHardBin;           // Select one pt hard bin for analysis
+  Int_t                       fSelectPtHardBin;           // select one pt hard bin for analysis
+  Bool_t                      fDoMatching;                // whether or not it should run the matching between MC and rec jets
 
   AliGenPythiaEventHeader    *fPythiaHeader;              //!event Pythia header
   Double_t                    fEventWeight;               //!event weight
@@ -84,6 +86,6 @@ class AliJetResponseMaker : public AliAnalysisTaskEmcalJet {
   AliJetResponseMaker(const AliJetResponseMaker&);            // not implemented
   AliJetResponseMaker &operator=(const AliJetResponseMaker&); // not implemented
 
-  ClassDef(AliJetResponseMaker, 6) // Jet response matrix producing task
+  ClassDef(AliJetResponseMaker, 7) // Jet response matrix producing task
 };
 #endif
index c3160eb..d25bde1 100644 (file)
@@ -69,6 +69,11 @@ AliAnalysisTaskSAQA::AliAnalysisTaskSAQA() :
     fHistTrackEta[i] = 0;
   }
 
+  for (Int_t i = 0; i < 6; i++) {
+    fHistTrackPhiPt[i] = 0;
+    fHistTrackEtaPt[i] = 0;
+  }
+
   for (Int_t i = 0; i < 4; i++) {
     fHistJetsPhiEta[i] = 0;
     fHistJetsPtNonBias[i] = 0;
@@ -121,6 +126,11 @@ AliAnalysisTaskSAQA::AliAnalysisTaskSAQA(const char *name) :
     fHistTrackEta[i] = 0;
   }
 
+  for (Int_t i = 0; i < 6; i++) {
+    fHistTrackPhiPt[i] = 0;
+    fHistTrackEtaPt[i] = 0;
+  }
+
   for (Int_t i = 0; i < 4; i++) {
     fHistJetsPhiEta[i] = 0;
     fHistJetsPtNonBias[i] = 0;
@@ -300,6 +310,20 @@ void AliAnalysisTaskSAQA::UserCreateOutputObjects()
     fHistTrackEta[i]->GetXaxis()->SetTitle("Eta");
     fOutput->Add(fHistTrackEta[i]);
   }
+
+  for (Int_t i = 0; i < 6; i++) {
+    TString histnamephipt("fHistTrackPhiPt_");
+    histnamephipt += i;
+    fHistTrackPhiPt[i] = new TH1F(histnamephipt.Data(),histnamephipt.Data(), 128, 0, 6.4);
+    fHistTrackPhiPt[i]->GetXaxis()->SetTitle("Phi");
+    fOutput->Add(fHistTrackPhiPt[i]);
+
+    TString histnameetapt("fHistTrackEtaPt_");
+    histnameetapt += i;
+    fHistTrackEtaPt[i] = new TH1F(histnameetapt.Data(),histnameetapt.Data(), 100, -2, 2);
+    fHistTrackEtaPt[i]->GetXaxis()->SetTitle("Eta");
+    fOutput->Add(fHistTrackEtaPt[i]);
+  }
   
   fHistTrackPhi[0]->SetLineColor(kRed);
   fHistTrackEta[0]->SetLineColor(kRed);
@@ -564,6 +588,31 @@ Float_t AliAnalysisTaskSAQA::DoTrackLoop()
       fHistTrackPhi[label]->Fill(track->Phi());
     }
 
+    if (track->Pt() < 0.5) {
+      fHistTrackPhiPt[0]->Fill(track->Phi());
+      fHistTrackEtaPt[0]->Fill(track->Eta());
+    }
+    else if (track->Pt() < 1) {
+      fHistTrackPhiPt[1]->Fill(track->Phi());
+      fHistTrackEtaPt[1]->Fill(track->Eta());
+    }
+    else if (track->Pt() < 2) {
+      fHistTrackPhiPt[2]->Fill(track->Phi());
+      fHistTrackEtaPt[2]->Fill(track->Eta());
+    }
+    else if (track->Pt() < 3) {
+      fHistTrackPhiPt[3]->Fill(track->Phi());
+      fHistTrackEtaPt[3]->Fill(track->Eta());
+    }
+    else if (track->Pt() < 5) {
+      fHistTrackPhiPt[4]->Fill(track->Phi());
+      fHistTrackEtaPt[4]->Fill(track->Eta());
+    }
+    else {
+      fHistTrackPhiPt[5]->Fill(track->Phi());
+      fHistTrackEtaPt[5]->Fill(track->Eta());
+    }
+
     if (!vtrack)
       continue;
 
index 76b6865..75deb13 100644 (file)
@@ -85,11 +85,13 @@ class AliAnalysisTaskSAQA : public AliAnalysisTaskEmcalJet {
   // Hybrid tracks
   TH1F                       *fHistTrackPhi[5];          //!Phi distribution of hybrid tracks
   TH1F                       *fHistTrackEta[5];          //!Eta distribution of hybrid tracks
+  TH1F                       *fHistTrackPhiPt[6];        //!Phi distribution of hybrid tracks per pt bins
+  TH1F                       *fHistTrackEtaPt[6];        //!Eta distribution of hybrid tracks per pt bins
 
  private:
   AliAnalysisTaskSAQA(const AliAnalysisTaskSAQA&);            // not implemented
   AliAnalysisTaskSAQA &operator=(const AliAnalysisTaskSAQA&); // not implemented
 
-  ClassDef(AliAnalysisTaskSAQA, 11) // Quality task for Emcal analysis
+  ClassDef(AliAnalysisTaskSAQA, 12) // Quality task for Emcal analysis
 };
 #endif
index 657cc6b..d5187ab 100644 (file)
@@ -18,7 +18,7 @@ AliJetResponseMaker* AddTaskJetRespPtHard(const char *ntracks            = "Trac
                                          const char *taskname           = "AliJetResponseMaker"
 )
 {  
-  gROOT->LoadMacro("$ALICE_ROOT/PWGJE/macros/AddTaskJetResponseMaker.C");
+  gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskJetResponseMaker.C");
   
   AliJetResponseMaker *jetTask = 0;