from Marta
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 Aug 2013 19:38:13 +0000 (19:38 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 Aug 2013 19:38:13 +0000 (19:38 +0000)
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalDiJetAna.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalDiJetAna.h
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalDiJetBase.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalDiJetBase.h
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalDiJetResponse.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalDiJetResponse.h
PWGJE/EMCALJetTasks/macros/AddTaskEmcalDiJetAna.C
PWGJE/EMCALJetTasks/macros/AddTaskEmcalDiJetResponse.C

index e02d328..0119be0 100644 (file)
@@ -424,41 +424,9 @@ AliEmcalJet* AliAnalysisTaskEmcalDiJetAna::GetLeadingAssociatedJet(const Int_t t
     typea = fContainerCharged;
   else if(type==2)  //full-charged
     typea = fContainerCharged;
-  
-  Int_t nJetsAssoc = GetNJets(typea);
-  Double_t ptLead = -999;
-  Int_t    iJetLead = -1;
-  for(Int_t ija=0; ija<nJetsAssoc; ija++) {
 
-    AliEmcalJet *jetAssoc = NULL;
-    if(type==0) {
-      jetAssoc = static_cast<AliEmcalJet*>(GetJetFromArray(ija, typea));
-      if(TMath::Abs(jetAssoc->Eta())>0.5)
-       jetAssoc = NULL;
-    }
-    else
-      jetAssoc = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ija, typea));
-    
-    if(!jetAssoc)
-      continue;
-   
-    Double_t dPhi = GetDeltaPhi(jetTrig,jetAssoc);
-    Double_t phiMin = 0.5*TMath::Pi();
-    Double_t phiMax = 1.5*TMath::Pi();
-    if(dPhi<phiMin || phiMax>phiMax)
-      continue;
-    Double_t jetAssocPt = GetJetPt(jetAssoc,typea);
-
-    if(jetAssocPt>ptLead) {
-      ptLead = jetAssocPt;
-      iJetLead = ija;
-    }
-    
-  }
+  AliEmcalJet *jetAssocLead = GetLeadingJetOppositeHemisphere(type, typea, jetTrig);
   
-  AliEmcalJet *jetAssocLead = static_cast<AliEmcalJet*>(GetJetFromArray(iJetLead, typea));
-
   return jetAssocLead;
 
 }
index 21a64a3..6aade9b 100644 (file)
@@ -67,6 +67,6 @@ class AliAnalysisTaskEmcalDiJetAna : public AliAnalysisTaskEmcalDiJetBase {
   AliAnalysisTaskEmcalDiJetAna(const AliAnalysisTaskEmcalDiJetAna&);            // not implemented
   AliAnalysisTaskEmcalDiJetAna &operator=(const AliAnalysisTaskEmcalDiJetAna&); // not implemented
 
-  ClassDef(AliAnalysisTaskEmcalDiJetAna, 4) // dijet analysis task
+  ClassDef(AliAnalysisTaskEmcalDiJetAna, 5) // dijet analysis task
 };
 #endif
index e5bf4bc..92d4283 100644 (file)
@@ -605,6 +605,51 @@ void AliAnalysisTaskEmcalDiJetBase::SetChargedFractionIndexMC() {
 
 }
 
+//_______________________________________________________________________
+AliEmcalJet* AliAnalysisTaskEmcalDiJetBase::GetLeadingJetOppositeHemisphere(const Int_t type, const Int_t typea, const AliEmcalJet *jetTrig) {
+
+  // Get leading jet in opposite hemisphere from trigger jet
+  // type = correlation type
+  // typea = container of associated jets
+
+  Int_t nJetsAssoc = GetNJets(typea);
+  Double_t ptLead = -999;
+  Int_t    iJetLead = -1;
+  for(Int_t ija=0; ija<nJetsAssoc; ija++) {
+
+    AliEmcalJet *jetAssoc = NULL;
+    if(type==0) {
+      jetAssoc = static_cast<AliEmcalJet*>(GetJetFromArray(ija, typea));
+      if(TMath::Abs(jetAssoc->Eta())>0.5)
+        jetAssoc = NULL;
+    }
+    else
+      jetAssoc = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ija, typea));
+
+    if(!jetAssoc)
+      continue;
+
+    Double_t dPhi = GetDeltaPhi(jetTrig,jetAssoc);
+    Double_t phiMin = 0.5*TMath::Pi();
+    Double_t phiMax = 1.5*TMath::Pi();
+    if(dPhi<phiMin || phiMax>phiMax)
+      continue;
+
+    Double_t jetAssocPt = GetJetPt(jetAssoc,typea);
+
+    if(jetAssocPt>ptLead) {
+      ptLead = jetAssocPt;
+      iJetLead = ija;
+    }
+
+  }
+
+  AliEmcalJet *jetAssocLead = static_cast<AliEmcalJet*>(GetJetFromArray(iJetLead, typea));
+
+  return jetAssocLead;
+
+}
+
 //________________________________________________________________________
 Bool_t AliAnalysisTaskEmcalDiJetBase::PythiaInfoFromFile(const char* currFile, Float_t &xsec, Float_t &trials, Int_t &pthard)
 {
index 225920f..be55dce 100644 (file)
@@ -77,6 +77,8 @@ class AliAnalysisTaskEmcalDiJetBase : public AliAnalysisTaskEmcalJetDev {
   Double_t GetZ(const AliVParticle *trk, const AliEmcalJet *jet)       const;
   Double_t GetZ(const Double_t trkPx, const Double_t trkPy, const Double_t trkPz, const Double_t jetPx, const Double_t jetPy, const Double_t jetPz) const;
 
+  AliEmcalJet* GetLeadingJetOppositeHemisphere(const Int_t type, const Int_t typea, const AliEmcalJet *jetTrig);
+
  protected:
   virtual Bool_t                      RetrieveEventObjects();
 
@@ -138,6 +140,6 @@ class AliAnalysisTaskEmcalDiJetBase : public AliAnalysisTaskEmcalJetDev {
   AliAnalysisTaskEmcalDiJetBase(const AliAnalysisTaskEmcalDiJetBase&);            // not implemented
   AliAnalysisTaskEmcalDiJetBase &operator=(const AliAnalysisTaskEmcalDiJetBase&); // not implemented
 
-  ClassDef(AliAnalysisTaskEmcalDiJetBase, 3) // dijet base task
+  ClassDef(AliAnalysisTaskEmcalDiJetBase, 4) // dijet base task
 };
 #endif
index bebb778..fa9851d 100644 (file)
@@ -45,10 +45,10 @@ AliAnalysisTaskEmcalDiJetResponse::AliAnalysisTaskEmcalDiJetResponse() :
   fh3AssocLostPtDeltaPhiCharged(0),
   fh3AssocLostPtDeltaPhiFull(0),
   fhnMatchingCharged(0),
-  fhnMatchingFull(0)
+  fhnMatchingFull(0),
+  fnUsedResponseVar(0)
 {
   // Default constructor.
-
   
   SetMakeGeneralHistograms(kTRUE);
 
@@ -70,7 +70,8 @@ AliAnalysisTaskEmcalDiJetResponse::AliAnalysisTaskEmcalDiJetResponse(const char
   fh3AssocLostPtDeltaPhiCharged(0),
   fh3AssocLostPtDeltaPhiFull(0),
   fhnMatchingCharged(0),
-  fhnMatchingFull(0)
+  fhnMatchingFull(0),
+  fnUsedResponseVar(0)
 {
   // Standard constructor.
 
@@ -107,18 +108,34 @@ void AliAnalysisTaskEmcalDiJetResponse::UserCreateOutputObjects()
   const Int_t nBinsPt = 250;
   const Int_t nBinsDPhi     = 72;
   const Int_t nBinsKt       = 50;
-  const Int_t nBins0[nBinsSparse0] = {nBinsPt,nBinsPt,nBinsPt,nBinsPt,nBinsDPhi,nBinsDPhi,nBinsKt,nBinsKt};
+  const Int_t nBinsDiJetEta = 40;
+  const Int_t nBinsVar[2] = {nBinsKt,nBinsDiJetEta};
+
+  const Int_t nBins0[nBinsSparse0] = {nBinsPt,nBinsPt,nBinsPt,nBinsPt,nBinsDPhi,nBinsDPhi,nBinsVar[fnUsedResponseVar],nBinsVar[fnUsedResponseVar]};
 
   const Double_t minPt = 0.;
   const Double_t maxPt = 250.;
+  const Double_t minVar[2] = {-100.,-1.};
+  const Double_t maxVar[2] = { 100., 1.};
 
-  const Double_t xmin0[nBinsSparse0]  = {  minPt, minPt, minPt, minPt, -0.5*TMath::Pi(), -0.5*TMath::Pi(), -100.,-100.};
-  const Double_t xmax0[nBinsSparse0]  = {  maxPt, maxPt, maxPt, maxPt,  1.5*TMath::Pi(), 1.5*TMath::Pi(),  100., 100.};
+  const Double_t xmin0[nBinsSparse0]  = {  minPt, minPt, minPt, minPt, -0.5*TMath::Pi(), -0.5*TMath::Pi(), minVar[fnUsedResponseVar], minVar[fnUsedResponseVar]};
+  const Double_t xmax0[nBinsSparse0]  = {  maxPt, maxPt, maxPt, maxPt,  1.5*TMath::Pi(), 1.5*TMath::Pi(),  maxVar[fnUsedResponseVar], maxVar[fnUsedResponseVar]};
 
   fhnDiJetResponseCharged = new THnSparseF("fhnDiJetResponseCharged","fhnDiJetResponseCharged;p_{T,trig}^{part};p_{T,trig}^{det};p_{T,ass}^{part};p_{T,ass}^{det};#Delta#varphi_{part};#Delta#varphi_{det};k_{T}^{part},k_{T}^{det}",nBinsSparse0,nBins0,xmin0,xmax0);
-  fOutput->Add(fhnDiJetResponseCharged);
 
   fhnDiJetResponseFullCharged = new THnSparseF("fhnDiJetResponseFullCharged","fhnDiJetResponseFullCharged;p_{T,trig}^{part};p_{T,trig}^{det};p_{T,ass}^{part};p_{T,ass}^{det};#Delta#varphi_{part};#Delta#varphi_{det};k_{T}^{part},k_{T}^{det}",nBinsSparse0,nBins0,xmin0,xmax0);
+
+  if(fnUsedResponseVar==1) {
+    fhnDiJetResponseCharged->SetTitle("fhnDiJetResponseCharged DiJetEta"); 
+    fhnDiJetResponseCharged->GetAxis(6)->SetTitle("#eta_{dijet}^{part}");
+    fhnDiJetResponseCharged->GetAxis(7)->SetTitle("#eta_{dijet}^{det}");
+
+    fhnDiJetResponseFullCharged->SetTitle("fhnDiJetResponseFullCharged DiJetEta"); 
+    fhnDiJetResponseFullCharged->GetAxis(6)->SetTitle("#eta_{dijet}^{part}");
+    fhnDiJetResponseFullCharged->GetAxis(7)->SetTitle("#eta_{dijet}^{det}");
+  }
+
+  fOutput->Add(fhnDiJetResponseCharged);
   fOutput->Add(fhnDiJetResponseFullCharged);
 
   TString strType = "";
@@ -231,6 +248,24 @@ void AliAnalysisTaskEmcalDiJetResponse::CorrelateJets(const Int_t type) {
   // Correlate jets and fill histos
   //
 
+  if( fJetCorrelationType==kCorrelateAll )
+    CorrelateAllJets(type);
+  else if( fJetCorrelationType==kCorrelateTwo )
+    CorrelateTwoJets(type);
+  else if( fJetCorrelationType==kCorrelateLS )
+    AliWarning(Form("%s: leading-subleading correlation not implemented for response!",GetName()));
+
+  return;
+
+}
+
+
+//________________________________________________________________________
+void AliAnalysisTaskEmcalDiJetResponse::CorrelateAllJets(const Int_t type) {
+  //
+  // Correlate jets and fill histos
+  //
+
   Int_t typet = 0;
   Int_t typea = 0;
   Int_t typetMC = 0;
@@ -324,30 +359,176 @@ void AliAnalysisTaskEmcalDiJetResponse::CorrelateJets(const Int_t type) {
        continue;
       }
 
-      //Store dijet vars: pt,trig MC; pt,trig DET; pt,ass MC; pt,ass DET; dPhi MC; dPhi Det; kT MC; kT Det;
-      Double_t diJetVars[8] = {
-       jetTrigPtMC,
-       GetJetPt(jetTrigDet,typet),
-       jetAssocPtMC,
-       GetJetPt(jetAssocDet,typea),
-       GetDeltaPhi(jetTrigMC,jetAssocMC),
-       GetDeltaPhi(jetTrigDet,jetAssocDet),
-       jetTrigPtMC*TMath::Sin(GetDeltaPhi(jetTrigMC,jetAssocMC)),
-       GetJetPt(jetTrigDet,typet)*TMath::Sin(GetDeltaPhi(jetTrigDet,jetAssocDet))
-      }; 
+      FillDiJetResponse(jetTrigMC,jetAssocMC,jetTrigDet,jetAssocDet,type);
+
+    } // associate jet loop
+  }//trigger jet loop
+
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskEmcalDiJetResponse::CorrelateTwoJets(const Int_t type) {
+  //
+  // Correlate jets and fill histos
+  //
+
+  Int_t typet = 0;
+  Int_t typea = 0;
+  Int_t typetMC = 0;
+  Int_t typeaMC = 0;
+  if(type==0) { //full-full
+    typetMC = fContainerFullMC;
+    typeaMC = fContainerFullMC;
+    typet = fContainerFull;
+    typea = fContainerFull;
+  }
+  else if(type==1) { //charged-charged
+    typetMC = fContainerChargedMC;
+    typeaMC = fContainerChargedMC;
+    typet = fContainerCharged;
+    typea = fContainerCharged;
+  }
+  else if(type==2) { //full-charged
+    typetMC = fContainerFullMC;
+    typeaMC = fContainerChargedMC;
+    typet = fContainerFull;
+    typea = fContainerCharged;
+  }
+  else {
+    AliWarning(Form("%s: type %d of dijet correlation not defined!",GetName(),type));
+    return;
+  }
+
+  Int_t nJetsTrig  = 0;
+  Int_t nJetsAssoc = 0;
+  if(type==0) {
+    nJetsTrig  = GetNJets(fContainerFullMC);
+    nJetsAssoc = nJetsTrig;
+  }
+  else if(type==1) {
+    nJetsTrig  = GetNJets(fContainerChargedMC);
+    nJetsAssoc = nJetsTrig;
+  }
+  else if(type==2) {
+    nJetsTrig  = GetNJets(fContainerFullMC);
+    nJetsAssoc = GetNJets(fContainerChargedMC);
+  }
 
+
+  for(Int_t ijt=0; ijt<nJetsTrig; ijt++) {
+
+    AliEmcalJet *jetTrigMC = static_cast<AliEmcalJet*>(GetAcceptJetFromArray(ijt, typetMC));
+    if(!jetTrigMC) continue; //jet not selected
+
+    Double_t jetTrigPtMC = GetJetPt(jetTrigMC,typetMC);
+
+    if(jetTrigPtMC<fPtMinTriggerJet)
+      continue;
+
+    if(type==1)
+      fh1TriggersCharged[0]->Fill(jetTrigPtMC);
+    if(type==2)
+      fh1TriggersFull[0]->Fill(jetTrigPtMC);
+
+    AliEmcalJet *jetTrigDet = jetTrigMC->ClosestJet();
+    if(!jetTrigDet) {
+      //trigger is lost
       if(type==1)
-       fhnDiJetResponseCharged->Fill(diJetVars);
-      else if(type==2)
-       fhnDiJetResponseFullCharged->Fill(diJetVars);
+       fh1TriggersLostCharged->Fill(jetTrigPtMC);
+      if(type==2)
+       fh1TriggersLostFull->Fill(jetTrigPtMC);
+      
+      continue;
+    }
+
+    if(type==1)
+      fh1TriggersCharged[1]->Fill(GetJetPt(jetTrigDet,typet));
+    if(type==2)
+      fh1TriggersFull[1]->Fill(GetJetPt(jetTrigDet,typet));
+
+
+    AliEmcalJet *jetAssocMC = GetLeadingJetOppositeHemisphere(type,typeaMC,jetTrigMC);
+    if(!jetAssocMC) continue;
 
+    Double_t jetAssocPtMC = GetJetPt(jetAssocMC,typeaMC);
       
-    } // associate jet loop
+    //Now check if jets are also there on detector level
+    AliEmcalJet *jetAssocDet = jetAssocMC->ClosestJet();
+    if(!jetAssocDet) {
+      //dijet is lost
+      if(type==1)
+       fh3AssocLostPtDeltaPhiCharged->Fill(jetTrigPtMC,jetAssocPtMC,GetDeltaPhi(jetTrigMC,jetAssocMC));
+      if(type==2)
+       fh3AssocLostPtDeltaPhiFull->Fill(jetTrigPtMC,jetAssocPtMC,GetDeltaPhi(jetTrigMC,jetAssocMC));
+      continue;
+    }
+
+    FillDiJetResponse(jetTrigMC,jetAssocMC,jetTrigDet,jetAssocDet,type);
+
+
   }//trigger jet loop
 
 }
 
 //________________________________________________________________________
+void AliAnalysisTaskEmcalDiJetResponse::FillDiJetResponse(const AliEmcalJet *jetTrigMC, const AliEmcalJet *jetAssocMC, const AliEmcalJet *jetTrigDet, const AliEmcalJet *jetAssocDet, Int_t type) {
+
+  //Fill dijet response
+
+  Int_t typet = 0;
+  Int_t typea = 0;
+  Int_t typetMC = 0;
+  Int_t typeaMC = 0;
+  if(type==0) { //full-full
+    typetMC = fContainerFullMC;
+    typeaMC = fContainerFullMC;
+    typet = fContainerFull;
+    typea = fContainerFull;
+  }
+  else if(type==1) { //charged-charged
+    typetMC = fContainerChargedMC;
+    typeaMC = fContainerChargedMC;
+    typet = fContainerCharged;
+    typea = fContainerCharged;
+  }
+  else if(type==2) { //full-charged
+    typetMC = fContainerFullMC;
+    typeaMC = fContainerChargedMC;
+    typet = fContainerFull;
+    typea = fContainerCharged;
+  }
+  else {
+    AliWarning(Form("%s: type %d of dijet correlation not defined!",GetName(),type));
+    return;
+  }
+
+  Double_t jetTrigPtMC  = GetJetPt(jetTrigMC,typetMC);
+  Double_t jetAssocPtMC = GetJetPt(jetAssocMC,typeaMC);
+
+  Double_t varDet[2] = {GetJetPt(jetTrigDet,typet)*TMath::Sin(GetDeltaPhi(jetTrigDet,jetAssocDet)),(jetTrigDet->Eta()+jetAssocDet->Eta())/2.};
+  Double_t varPart[2] = {jetTrigPtMC*TMath::Sin(GetDeltaPhi(jetTrigMC,jetAssocMC)),(jetTrigMC->Eta()+jetAssocMC->Eta())/2.};
+
+  //Store dijet vars: pt,trig MC; pt,trig DET; pt,ass MC; pt,ass DET; dPhi MC; dPhi Det; kT MC; kT Det;
+  Double_t diJetVars[8] = {
+    jetTrigPtMC,
+    GetJetPt(jetTrigDet,typet),
+    jetAssocPtMC,
+    GetJetPt(jetAssocDet,typea),
+    GetDeltaPhi(jetTrigMC,jetAssocMC),
+    GetDeltaPhi(jetTrigDet,jetAssocDet),
+    varPart[fnUsedResponseVar],
+    varDet[fnUsedResponseVar]
+  }; 
+  
+  if(type==1)
+    fhnDiJetResponseCharged->Fill(diJetVars);
+  else if(type==2)
+    fhnDiJetResponseFullCharged->Fill(diJetVars);
+
+
+}
+
+//________________________________________________________________________
 void AliAnalysisTaskEmcalDiJetResponse::FillMatchHistos() {
   //
   // Fill Particle-Detector level matching histos
index 8f1763c..6a5bb72 100644 (file)
@@ -26,18 +26,24 @@ class AliAnalysisTaskEmcalDiJetResponse : public AliAnalysisTaskEmcalDiJetBase {
   void                        Terminate(Option_t *option);
 
   //Setters
-  void SetMatchFullCharged(Bool_t b)        { fDoMatchFullCharged = b;}
+  void SetMatchFullCharged(Bool_t b)        { fDoMatchFullCharged = b; }
+  void SetResponseVar(Int_t v)              { fnUsedResponseVar   = v; }    
 
   //Getters
 
  protected:
   Bool_t                      Run()              ;
   void                        CorrelateJets(const Int_t type);
+  void                        CorrelateAllJets(const Int_t type);
+  void                        CorrelateTwoJets(const Int_t type);
+
   Bool_t                      FillHistograms()   ;
   void                        FillDiJetHistos(const AliEmcalJet *jet1 = 0, const AliEmcalJet *jet2 = 0, const Int_t mode = 0);
   void                        FillMatchHistos();
   Bool_t                      RetrieveEventObjects();
 
+  void                        FillDiJetResponse(const AliEmcalJet *jetTrigMC = 0, const AliEmcalJet *jetAssocMC = 0, const AliEmcalJet *jetTrigDet = 0, const AliEmcalJet *jetAssocDet = 0, Int_t type = 0);
+
  private:
   Bool_t            fDoMatchFullCharged;          //  do full-charged matching histos
   THnSparse        *fhnDiJetResponseCharged;      //! sparse with di-jet properties (full-full)
@@ -50,11 +56,12 @@ class AliAnalysisTaskEmcalDiJetResponse : public AliAnalysisTaskEmcalDiJetBase {
   TH3F             *fh3AssocLostPtDeltaPhiFull;   //! lost full associated jet
   THnSparse        *fhnMatchingCharged;           //! sparse comparing matched particle and detector level charged jets
   THnSparse        *fhnMatchingFull;              //! sparse comparing matched particle and detector level charged jets
+  Int_t             fnUsedResponseVar;            //  build response for kt (0) or dijet eta (1)
 
 
   AliAnalysisTaskEmcalDiJetResponse(const AliAnalysisTaskEmcalDiJetResponse&);            // not implemented
   AliAnalysisTaskEmcalDiJetResponse &operator=(const AliAnalysisTaskEmcalDiJetResponse&); // not implemented
 
-  ClassDef(AliAnalysisTaskEmcalDiJetResponse, 1) // jet sample analysis task
+  ClassDef(AliAnalysisTaskEmcalDiJetResponse, 2) // jet sample analysis task
 };
 #endif
index f5b88fb..5fffbc1 100644 (file)
@@ -26,7 +26,7 @@ AliAnalysisTaskEmcalDiJetAna* AddTaskEmcalDiJetAna(TString     kTracksName
                                                   Int_t       pSel                = AliVEvent::kINT7,
                                                   Int_t       matchFullCh         = AliAnalysisTaskEmcalDiJetBase::kNoMatching,
                                                   Double_t    ptTrackBias         = 0.,
-                                                  Int_t       corrType            = AliAnalysisTaskEmcalDiJetBase::kCorrelateAll
+                                                  Int_t       corrType            = AliAnalysisTaskEmcalDiJetBase::kCorrelateTwo
                                                   ) {
   
   enum AlgoType {kKT, kANTIKT};
@@ -148,11 +148,13 @@ AliAnalysisTaskEmcalDiJetAna* AddTaskEmcalDiJetAna(TString     kTracksName
   //Connect output
   AliAnalysisDataContainer *coutput1 = 0x0;
 
-  TString containerName1 = Form("%s",wagonName.Data());
+  TString contName(wagonName);
+  contName += "_histos";
 
-  TString outputfile = Form("%s:%s",AliAnalysisManager::GetCommonFileName(),wagonName.Data());
+  //  TString outputfile = Form("%s:%s",AliAnalysisManager::GetCommonFileName(),wagonName.Data());
+  TString outputfile = Form("%s",AliAnalysisManager::GetCommonFileName());
 
-  coutput1 = mgr->CreateContainer(containerName1, TList::Class(),AliAnalysisManager::kOutputContainer,outputfile);
+  coutput1 = mgr->CreateContainer(contName.Data(), TList::Class(),AliAnalysisManager::kOutputContainer,outputfile);
 
   mgr->ConnectOutput(taskDiJet,1,coutput1);
   
index 81d504a..b5f378d 100644 (file)
@@ -9,7 +9,9 @@ AliAnalysisTaskEmcalDiJetResponse* AddTaskEmcalDiJetResponse(TString     kTracks
                                                             const char *CentEst             = "V0A",
                                                             Int_t       pSel                = AliVEvent::kINT7,
                                                             Int_t       matchFullCh         = AliAnalysisTaskEmcalDiJetBase::kNoMatching,
-                                                            Double_t    ptTrackBias         = 0.
+                                                            Double_t    ptTrackBias         = 0.,
+                                                            Int_t       responseVar         = 0,
+                                                            Int_t       corrType            = AliAnalysisTaskEmcalDiJetBase::kCorrelateTwo
                                                             ) {
   
   enum AlgoType {kKT, kANTIKT};
@@ -47,7 +49,7 @@ AliAnalysisTaskEmcalDiJetResponse* AddTaskEmcalDiJetResponse(TString     kTracks
   TString strJetsChMC   = jetFinderTaskChargedMC->GetName();
 
 
-  TString wagonName = Form("DiJetResponse_%s_%s_Rho%dTC%sMatch%dHadTrig%d",strJetsFull.Data(),strJetsFullMC.Data(),rhoType,trigClass.Data(),matchFullCh,(Int_t)(ptTrackBias));
+  TString wagonName = Form("DiJetResponse_%s_%s_Rho%dTC%sMatch%dHadTrig%dRV%d",strJetsFull.Data(),strJetsFullMC.Data(),rhoType,trigClass.Data(),matchFullCh,(Int_t)(ptTrackBias),responseVar);
 
   //Configure DiJet task
   AliAnalysisTaskEmcalDiJetResponse *taskDiJet = NULL;
@@ -56,6 +58,10 @@ AliAnalysisTaskEmcalDiJetResponse* AddTaskEmcalDiJetResponse(TString     kTracks
   Printf("strJetsFull: %s",strJetsFull.Data());
   Printf("strJetsCh: %s",strJetsCh.Data());
 
+  taskDiJet->SetIsPythiaPtHard(kTRUE);
+
+  taskDiJet->SetJetCorrelationType(corrType);
+
   taskDiJet->SetContainerFull(0);
   taskDiJet->SetContainerCharged(1);
   taskDiJet->SetContainerFullMC(2);
@@ -89,6 +95,8 @@ AliAnalysisTaskEmcalDiJetResponse* AddTaskEmcalDiJetResponse(TString     kTracks
 
   taskDiJet->SetIsPythiaPtHard(kTRUE);
 
+  taskDiJet->SetResponseVar(responseVar);
+
 
   mgr->AddTask(taskDiJet);
 
@@ -98,11 +106,13 @@ AliAnalysisTaskEmcalDiJetResponse* AddTaskEmcalDiJetResponse(TString     kTracks
   //Connect output
   AliAnalysisDataContainer *coutput1 = 0x0;
 
-  TString containerName1 = Form("%s",wagonName.Data());
+  TString contName(wagonName);
+  contName += "_histos";
 
-  TString outputfile = Form("%s:%s",AliAnalysisManager::GetCommonFileName(),wagonName.Data());
+  //  TString outputfile = Form("%s:%s",AliAnalysisManager::GetCommonFileName(),wagonName.Data());
+  TString outputfile = Form("%s",AliAnalysisManager::GetCommonFileName());
 
-  coutput1 = mgr->CreateContainer(containerName1, TList::Class(),AliAnalysisManager::kOutputContainer,outputfile);
+  coutput1 = mgr->CreateContainer(contName.Data(), TList::Class(),AliAnalysisManager::kOutputContainer,outputfile);
 
   mgr->ConnectOutput(taskDiJet,1,coutput1);