]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
use label instead of bit
authormverweij <marta.verweij@cern.ch>
Tue, 9 Dec 2014 11:00:21 +0000 (12:00 +0100)
committermverweij <marta.verweij@cern.ch>
Tue, 9 Dec 2014 12:31:45 +0000 (13:31 +0100)
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalHJetMass.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalHJetMass.h

index bd5dfd70ac312784d44f86e43040bcdaee2b1961..cb10872c3ca5e33b072f92387c6db37e4704a23f 100644 (file)
@@ -51,7 +51,9 @@ namespace EmcalHJetMassAnalysis {
     fPtTTMax(0),
     fRandom(0),
     fEmbConstSel(0),
+    fMarkMCLabel(-1),
     fh1PtHadron(0),
+    fh1PtHadronMatch(0),
     fh3PtHPtJDPhi(0),
     fh3PtJet1VsMassVsHPtAllSel(0),
     fh3PtJet1VsMassVsHPtAllSelMatch(0),
@@ -65,6 +67,7 @@ namespace EmcalHJetMassAnalysis {
     // Default constructor.
 
     fh1PtHadron                       = new TH1F*[fNcentBins];
+    fh1PtHadronMatch                  = new TH1F*[fNcentBins];
     fh3PtHPtJDPhi                     = new TH3F*[fNcentBins];
     fh3PtJet1VsMassVsHPtAllSel        = new TH3F*[fNcentBins];
     fh3PtJet1VsMassVsHPtAllSelMatch   = new TH3F*[fNcentBins];
@@ -77,6 +80,7 @@ namespace EmcalHJetMassAnalysis {
 
     for (Int_t i = 0; i < fNcentBins; i++) {
       fh1PtHadron[i]                       = 0;
+      fh1PtHadronMatch[i]                  = 0;
       fh3PtHPtJDPhi[i]                     = 0;
       fh3PtJet1VsMassVsHPtAllSel[i]        = 0;
       fh3PtJet1VsMassVsHPtAllSelMatch[i]   = 0;
@@ -108,7 +112,9 @@ namespace EmcalHJetMassAnalysis {
     fPtTTMax(0),
     fRandom(0),
     fEmbConstSel(0),
+    fMarkMCLabel(-1),
     fh1PtHadron(0),
+    fh1PtHadronMatch(0),
     fh3PtHPtJDPhi(0),
     fh3PtJet1VsMassVsHPtAllSel(0),
     fh3PtJet1VsMassVsHPtAllSelMatch(0),
@@ -122,6 +128,7 @@ namespace EmcalHJetMassAnalysis {
     // Standard constructor.
 
     fh1PtHadron                       = new TH1F*[fNcentBins];
+    fh1PtHadronMatch                  = new TH1F*[fNcentBins];
     fh3PtHPtJDPhi                     = new TH3F*[fNcentBins];
     fh3PtJet1VsMassVsHPtAllSel        = new TH3F*[fNcentBins];
     fh3PtJet1VsMassVsHPtAllSelMatch   = new TH3F*[fNcentBins];
@@ -134,6 +141,7 @@ namespace EmcalHJetMassAnalysis {
  
     for (Int_t i = 0; i < fNcentBins; i++) {
       fh1PtHadron[i]                       = 0;
+      fh1PtHadronMatch[i]                  = 0;
       fh3PtHPtJDPhi[i]                     = 0;
       fh3PtJet1VsMassVsHPtAllSel[i]        = 0;
       fh3PtJet1VsMassVsHPtAllSelMatch[i]   = 0;
@@ -175,8 +183,8 @@ namespace EmcalHJetMassAnalysis {
     const Double_t minPt = -50.;
     const Double_t maxPt = 150.;
 
-    const Int_t nBinsM  = 100;
-    const Double_t minM = -20.;
+    const Int_t nBinsM  = 90;
+    const Double_t minM = -10.;
     const Double_t maxM = 80.;
 
     const Int_t nBinsR  = 100;
@@ -199,6 +207,11 @@ namespace EmcalHJetMassAnalysis {
       fh1PtHadron[i] = new TH1F(histName.Data(),histTitle.Data(),200.,0.,200.);
       fOutput->Add(fh1PtHadron[i]);
 
+      histName = TString::Format("fh1PtHadronMatch_%d",i);
+      histTitle = TString::Format("%s;#it{p}_{T,h}",histName.Data());
+      fh1PtHadronMatch[i] = new TH1F(histName.Data(),histTitle.Data(),200.,0.,200.);
+      fOutput->Add(fh1PtHadronMatch[i]);
+
       histName = TString::Format("fh3PtHPtJDPhi_%d",i);
       histTitle = TString::Format("%s;#it{p}_{T,h};#it{p}_{T,jet};#Delta#varphi_{h,jet}",histName.Data());
       fh3PtHPtJDPhi[i] = new TH3F(histName.Data(),histTitle.Data(),nBinsPtH,minPtH,maxPtH,nBinsPt,minPt,maxPt,nBinsPhi,minPhi,maxPhi);
@@ -268,6 +281,8 @@ namespace EmcalHJetMassAnalysis {
       pCont->ResetCurrentID();
       while((vp = pCont->GetNextAcceptParticle())) {
         fh1PtHadron[fCentBin]->Fill(vp->Pt()); //all hadrons
+        if(fMarkMCLabel>0 && TMath::Abs(vp->GetLabel()) >= fMarkMCLabel )
+          fh1PtHadronMatch[fCentBin]->Fill(vp->Pt()); //hadrons matched to MC
         AliEmcalJet* jet = NULL;
         if(jCont) {
           jCont->ResetCurrentID();
@@ -285,6 +300,8 @@ namespace EmcalHJetMassAnalysis {
        vp = GetSingleInclusiveTT(pCont,fPtTTMin->At(it),fPtTTMax->At(it));
        if(!vp) continue;
        fh1PtHadron[fCentBin]->Fill(vp->Pt()); //all trigger tracks
+        if(fMarkMCLabel>0 && TMath::Abs(vp->GetLabel()) >= fMarkMCLabel )
+          fh1PtHadronMatch[fCentBin]->Fill(vp->Pt()); //hadrons matched to MC
        AliEmcalJet* jet = NULL;
        jCont->ResetCurrentID();
        while((jet = jCont->GetNextAcceptJet())) {
@@ -356,9 +373,8 @@ namespace EmcalHJetMassAnalysis {
     }
   
     if(fMinFractionShared>0. && fraction>fMinFractionShared) {
-      if(vp->TestBits(fEmbConstSel) != (Int_t)fEmbConstSel) 
-        AliDebug(11,Form("Skipping track with pT=%f because it does not match the bit mask (%d, %d)", vp->Pt(), fEmbConstSel, vp->TestBits(fEmbConstSel)));
-      else {
+      if(fMarkMCLabel>0 && TMath::Abs(vp->GetLabel()) >= fMarkMCLabel ) {
+        //        Printf("Accepting track with pT=%f because it does match the bit mask (%d, %d, %d). label: %d fMarkMCLabel: %d", vp->Pt(), fEmbConstSel, vp->TestBits(fEmbConstSel), vp->TestBit(fEmbConstSel),vp->GetLabel(),fMarkMCLabel);
         fh3PtJet1VsMassVsHPtAllSelMatch[fCentBin]->Fill(ptJet,mJet,pt);
         fh3PtJet1VsRatVsHPtAllSelMatch[fCentBin]->Fill(ptJet,rat,pt);
       }
@@ -371,9 +387,7 @@ namespace EmcalHJetMassAnalysis {
     fh3PtJet1VsRatVsHPtTagged[fCentBin]->Fill(ptJet,rat,pt);
 
     if(fMinFractionShared>0. && fraction>fMinFractionShared) {
-      if(vp->TestBits(fEmbConstSel) != (Int_t)fEmbConstSel) 
-        AliDebug(11,Form("Skipping track with pT=%f because it does not match the bit mask (%d, %d)", vp->Pt(), fEmbConstSel, vp->TestBits(fEmbConstSel)));
-      else {
+      if(fMarkMCLabel>0 && TMath::Abs(vp->GetLabel()) >= fMarkMCLabel ) {
         fh3PtJet1VsMassVsHPtTaggedMatch[fCentBin]->Fill(ptJet,mJet,pt);
         fh3PtJet1VsRatVsHPtTaggedMatch[fCentBin]->Fill(ptJet,rat,pt);
       }
index e00260699424a459cd051f5c2b9f498deec954bd..3874f1084ed8082f7cd93b9dfefca6e40cd74448 100644 (file)
@@ -47,6 +47,7 @@ namespace EmcalHJetMassAnalysis {
     void SetTriggerTrackType(TriggerTrackType t)                       { fTriggerTrackType  = t   ; }
     void AddTriggerTrackPtCuts(Float_t min, Float_t max);
     void SelectConstituents(UInt_t constSel)                           { fEmbConstSel = constSel  ; }
+    void SetMarkMCLabel(Int_t l)                                       { fMarkMCLabel = l         ; }
 
   protected:
     Bool_t                              RetrieveEventObjects();
@@ -68,9 +69,11 @@ namespace EmcalHJetMassAnalysis {
     TArrayF                            *fPtTTMin;                    // minimum pt of trigger tracks
     TArrayF                            *fPtTTMax;                    // maximum pt of trigger tracks
     TRandom3                           *fRandom;                     //! Random number generator
-    UInt_t                              fEmbConstSel;                // select embedded constituents
+    UInt_t                              fEmbConstSel;                // select embedded constituents using bit
+    Int_t                               fMarkMCLabel;                // select embedded constituents using label
 
     TH1F            **fh1PtHadron;                        //!pt of hadrons
+    TH1F            **fh1PtHadronMatch;                   //!pt of hadrons matched to MC
     TH3F            **fh3PtHPtJDPhi;                      //!pt hadron vs pt jet vs delta phi
     TH3F            **fh3PtJet1VsMassVsHPtAllSel;         //!all jets after std selection pt vs mass vs track pt
     TH3F            **fh3PtJet1VsMassVsHPtAllSelMatch;    //!all jets after std selection pt vs mass vs track pt matched to MC
@@ -86,7 +89,7 @@ namespace EmcalHJetMassAnalysis {
     AliAnalysisTaskEmcalHJetMass(const AliAnalysisTaskEmcalHJetMass&);            // not implemented
     AliAnalysisTaskEmcalHJetMass &operator=(const AliAnalysisTaskEmcalHJetMass&); // not implemented
 
-    ClassDef(AliAnalysisTaskEmcalHJetMass, 5)
+    ClassDef(AliAnalysisTaskEmcalHJetMass, 6)
       };
 }
 #endif