add mc jets
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 9 Jun 2012 03:40:57 +0000 (03:40 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 9 Jun 2012 03:40:57 +0000 (03:40 +0000)
PWGGA/EMCALJetTasks/AliJetResponseMaker.cxx
PWGGA/EMCALJetTasks/AliJetResponseMaker.h

index 01ed236..b978683 100644 (file)
@@ -28,23 +28,23 @@ AliJetResponseMaker::AliJetResponseMaker() :
   AliAnalysisTaskEmcalJet("AliJetResponseMaker"),
   fMCTracksName("MCParticles"),
   fMCJetsName("MCJets"),
-  fMaxDistance(0.2),
+  fMaxDistance(0.25),
   fMCTracks(0),
   fMCJets(0),
   fHistMCJetPhiEta(0),
   fHistMCJetsPt(0),
-  fHistMCJetsPtNonBias(0),
   fHistMCJetsNEFvsPt(0),
   fHistMCJetsZvsPt(0),
   fHistJetPhiEta(0),
   fHistJetsPt(0),
-  fHistJetsPtNonBias(0),
   fHistJetsNEFvsPt(0),
   fHistJetsZvsPt(0),
   fHistClosestDistance(0),
   fHistClosestDeltaPhi(0),
   fHistClosestDeltaEta(0),
   fHistClosestDeltaPt(0),
+  fHistNonMatchedMCJetPt(0),
+  fHistNonMatchedJetPt(0),
   fHistPartvsDetecPt(0)
 {
   // Default constructor.
@@ -55,23 +55,23 @@ AliJetResponseMaker::AliJetResponseMaker(const char *name) :
   AliAnalysisTaskEmcalJet(name),
   fMCTracksName("MCParticles"),
   fMCJetsName("MCJets"),
-  fMaxDistance(0.2),
+  fMaxDistance(0.25),
   fMCTracks(0),
   fMCJets(0),
   fHistMCJetPhiEta(0),
   fHistMCJetsPt(0),
-  fHistMCJetsPtNonBias(0),
   fHistMCJetsNEFvsPt(0),
   fHistMCJetsZvsPt(0),
   fHistJetPhiEta(0),
   fHistJetsPt(0),
-  fHistJetsPtNonBias(0),
   fHistJetsNEFvsPt(0),
   fHistJetsZvsPt(0),
   fHistClosestDistance(0),
   fHistClosestDeltaPhi(0),
   fHistClosestDeltaEta(0),
   fHistClosestDeltaPt(0),
+  fHistNonMatchedMCJetPt(0),
+  fHistNonMatchedJetPt(0),
   fHistPartvsDetecPt(0)
 {
   // Standard constructor.
@@ -102,11 +102,6 @@ void AliJetResponseMaker::UserCreateOutputObjects()
   fHistJetsPt->GetYaxis()->SetTitle("counts");
   fOutput->Add(fHistJetsPt);
   
-  fHistJetsPtNonBias = new TH1F("fHistJetsPtNonBias", "fHistJetsPtNonBias", fNbins, fMinBinPt, fMaxBinPt);
-  fHistJetsPtNonBias->GetXaxis()->SetTitle("p_{T} [GeV/c]");
-  fHistJetsPtNonBias->GetYaxis()->SetTitle("counts");
-  fOutput->Add(fHistJetsPtNonBias);
-  
   fHistJetsZvsPt = new TH2F("fHistJetsZvsPt", "fHistJetsZvsPt", fNbins, 0, 1.2, fNbins, fMinBinPt, fMaxBinPt);
   fHistJetsZvsPt->GetXaxis()->SetTitle("Z");
   fHistJetsZvsPt->GetYaxis()->SetTitle("p_{T} [GeV/c]");
@@ -129,11 +124,6 @@ void AliJetResponseMaker::UserCreateOutputObjects()
   fHistMCJetsPt->GetYaxis()->SetTitle("counts");
   fOutput->Add(fHistMCJetsPt);
   
-  fHistMCJetsPtNonBias = new TH1F("fHistMCJetsPtNonBias", "fHistMCJetsPtNonBias", fNbins, fMinBinPt, fMaxBinPt);
-  fHistMCJetsPtNonBias->GetXaxis()->SetTitle("p_{T} [GeV/c]");
-  fHistMCJetsPtNonBias->GetYaxis()->SetTitle("counts");
-  fOutput->Add(fHistMCJetsPtNonBias);
-  
   fHistMCJetsZvsPt = new TH2F("fHistMCJetsZvsPt", "fHistMCJetsZvsPt", fNbins, 0, 1.2, fNbins, fMinBinPt, fMaxBinPt);
   fHistMCJetsZvsPt->GetXaxis()->SetTitle("Z");
   fHistMCJetsZvsPt->GetYaxis()->SetTitle("p_{T} [GeV/c]");
@@ -166,12 +156,22 @@ void AliJetResponseMaker::UserCreateOutputObjects()
   fHistClosestDeltaPt->GetYaxis()->SetTitle("counts");
   fOutput->Add(fHistClosestDeltaPt);
 
+  fHistNonMatchedMCJetPt = new TH1F("fHistNonMatchedMCJetPt", "fHistNonMatchedMCJetPt", fNbins, fMinBinPt, fMaxBinPt);
+  fHistNonMatchedMCJetPt->GetXaxis()->SetTitle("p_{T} [GeV/c]");
+  fHistNonMatchedMCJetPt->GetYaxis()->SetTitle("counts");
+  fOutput->Add(fHistNonMatchedMCJetPt);
+
+  fHistNonMatchedJetPt = new TH1F("fHistNonMatchedJetPt", "fHistNonMatchedJetPt", fNbins, fMinBinPt, fMaxBinPt);
+  fHistNonMatchedJetPt->GetXaxis()->SetTitle("p_{T} [GeV/c]");
+  fHistNonMatchedJetPt->GetYaxis()->SetTitle("counts");
+  fOutput->Add(fHistNonMatchedJetPt);
+
   fHistPartvsDetecPt = new TH2F("fHistPartvsDetecPt", "fHistPartvsDetecPt", fNbins, fMinBinPt, fMaxBinPt, fNbins, fMinBinPt, fMaxBinPt);
-  fHistPartvsDetecPt->GetXaxis()->SetTitle("p_{T}^{det}");
-  fHistPartvsDetecPt->GetYaxis()->SetTitle("p_{T}^{rec}");
+  fHistPartvsDetecPt->GetXaxis()->SetTitle("p_{T}^{rec}");
+  fHistPartvsDetecPt->GetYaxis()->SetTitle("p_{T}^{gen}");
   fOutput->Add(fHistPartvsDetecPt);
 
-  PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram
+  PostData(1, fOutput); // Post data for ALL output slots > 0 here, to get at least an empty histogram
 }
 
 //________________________________________________________________________
@@ -180,8 +180,8 @@ Bool_t AliJetResponseMaker::FillHistograms()
   // Fill histograms.
 
   // Find the closest jets
-  DoJetLoop(fJets, fMCJets);
-  DoJetLoop(fMCJets, fJets);
+  DoJetLoop(fJets, fMCJets, kFALSE);
+  DoJetLoop(fMCJets, fJets, kTRUE);
 
   const Int_t nJets = fJets->GetEntriesFast();
 
@@ -197,11 +197,6 @@ Bool_t AliJetResponseMaker::FillHistograms()
     if (!AcceptJet(jet))
       continue;
 
-    fHistJetsPtNonBias->Fill(jet->Pt());
-
-    if (jet->MaxTrackPt() < fPtBiasJetTrack && (fAnaType == kTPC || jet->MaxClusterPt() < fPtBiasJetClus))
-       continue;
-
     if (jet->ClosestJet() && jet->ClosestJet()->ClosestJet() == jet && 
         jet->ClosestJetDistance() < fMaxDistance) {    // Matched jet found
       jet->SetMatchedToClosest();
@@ -215,6 +210,9 @@ Bool_t AliJetResponseMaker::FillHistograms()
       fHistClosestDeltaPt->Fill(dpt);
       fHistPartvsDetecPt->Fill(jet->Pt(), jet->MatchedJet()->Pt());
     }
+    else {
+      fHistNonMatchedJetPt->Fill(jet->Pt());
+    }
 
     fHistJetsPt->Fill(jet->Pt());
 
@@ -249,14 +247,13 @@ Bool_t AliJetResponseMaker::FillHistograms()
       AliError(Form("Could not receive mc jet %d", i));
       continue;
     }  
-
-    if (!AcceptJet(jet))
+    
+    if (!AcceptJet(jet, kTRUE, kFALSE))
       continue;
 
-    fHistMCJetsPtNonBias->Fill(jet->Pt());
-
-    if (jet->MaxTrackPt() < fPtBiasJetTrack)
-       continue;
+    if (!jet->MatchedJet()) {
+      fHistNonMatchedMCJetPt->Fill(jet->Pt());
+    }
 
     fHistMCJetsPt->Fill(jet->Pt());
 
@@ -276,7 +273,7 @@ Bool_t AliJetResponseMaker::FillHistograms()
 }
 
 //________________________________________________________________________
-void AliJetResponseMaker::DoJetLoop(TClonesArray *jets1, TClonesArray *jets2)
+void AliJetResponseMaker::DoJetLoop(TClonesArray *jets1, TClonesArray *jets2, Bool_t mc)
 {
   // Do the jet loop.
 
@@ -292,7 +289,7 @@ void AliJetResponseMaker::DoJetLoop(TClonesArray *jets1, TClonesArray *jets2)
       continue;
     }  
 
-    if (!AcceptJet(jet1))
+    if (!AcceptJet(jet1, kTRUE, mc))
       continue;
     
     if (jet1->MaxTrackPt() < fPtBiasJetTrack && 
@@ -308,7 +305,7 @@ void AliJetResponseMaker::DoJetLoop(TClonesArray *jets1, TClonesArray *jets2)
        continue;
       }  
       
-      if (!AcceptJet(jet2))
+      if (!AcceptJet(jet2, kTRUE, !mc))
        continue;
       
       if (jet2->MaxTrackPt() < fPtBiasJetTrack && 
index e083c6c..583bf5a 100644 (file)
@@ -23,7 +23,7 @@ class AliJetResponseMaker : public AliAnalysisTaskEmcalJet {
   void                        SetMaxDistance(Double_t d)         { fMaxDistance   = d; }
 
  protected:
-  void                        DoJetLoop(TClonesArray *jets1, TClonesArray *jets2);
+  void                        DoJetLoop(TClonesArray *jets1, TClonesArray *jets2, Bool_t mc);
   Bool_t                      FillHistograms();
   Bool_t                      RetrieveEventObjects();
 
@@ -35,13 +35,11 @@ class AliJetResponseMaker : public AliAnalysisTaskEmcalJet {
   // Particle level jets
   TH2F                       *fHistMCJetPhiEta;           //!phi-eta distribution of jets
   TH1F                       *fHistMCJetsPt;              //!inclusive jet pt spectrum
-  TH1F                       *fHistMCJetsPtNonBias;       //!non biased inclusive jet pt spectrum
   TH2F                       *fHistMCJetsNEFvsPt;         //!jet neutral energy fraction vs. jet pt
   TH2F                       *fHistMCJetsZvsPt;           //!constituent Pt over Jet Pt ratio vs. jet pt
   // Detector level jets
   TH2F                       *fHistJetPhiEta;             //!phi-eta distribution of jets
   TH1F                       *fHistJetsPt;                //!inclusive jet pt spectrum
-  TH1F                       *fHistJetsPtNonBias;         //!non biased inclusive jet pt spectrum
   TH2F                       *fHistJetsNEFvsPt;           //!jet neutral energy fraction vs. jet pt
   TH2F                       *fHistJetsZvsPt;             //!constituent Pt over Jet Pt ratio vs. jet pt
   // Detector-particle level matching
@@ -49,12 +47,14 @@ class AliJetResponseMaker : public AliAnalysisTaskEmcalJet {
   TH1F                       *fHistClosestDeltaPhi;       //!delta phi between closest particle to detector level jet
   TH1F                       *fHistClosestDeltaEta;       //!delta eta between closest particle to detector level jet
   TH1F                       *fHistClosestDeltaPt;        //!delta pt between closest particle to detector level jet
+  TH1F                       *fHistNonMatchedMCJetPt;     //!non-matched mc jet pt distribution
+  TH1F                       *fHistNonMatchedJetPt;       //!non-matched jet pt distribution
   TH2F                       *fHistPartvsDetecPt;         //!particle vs detector level jet pt
 
  private:
   AliJetResponseMaker(const AliJetResponseMaker&);            // not implemented
   AliJetResponseMaker &operator=(const AliJetResponseMaker&); // not implemented
 
-  ClassDef(AliJetResponseMaker, 1) // Jet response matrix producing task
+  ClassDef(AliJetResponseMaker, 2) // Jet response matrix producing task
 };
 #endif