Take out ntuples from TLists and use dedicated output containers
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Jun 2009 12:24:54 +0000 (12:24 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Jun 2009 12:24:54 +0000 (12:24 +0000)
PWG3/vertexingHF/AddTaskCompareHF.C
PWG3/vertexingHF/AddTaskDplus.C
PWG3/vertexingHF/AliAnalysisTaskSECompareHF.cxx
PWG3/vertexingHF/AliAnalysisTaskSEDplus.cxx

index 9ac40a48daf0a0c8bca69235d4dca1afa9e538bc..fc21f87cae50af1e616f7a887517359a255141d2 100644 (file)
@@ -23,14 +23,19 @@ AliAnalysisTaskSECompareHF *AddTaskCompareHF()
   \r
   //\r
   // Create containers for input/output\r
-  AliAnalysisDataContainer *cinput = mgr->CreateContainer("cinput",TChain::Class(), \r
+  AliAnalysisDataContainer *cinputCmp = mgr->CreateContainer("cinput",TChain::Class(), \r
                                                          AliAnalysisManager::kInputContainer);\r
-  AliAnalysisDataContainer *coutput = mgr->CreateContainer("coutput",TList::Class(),\r
+  AliAnalysisDataContainer *coutputCmp1 = mgr->CreateContainer("coutputCmp1",TList::Class(),\r
                                                           AliAnalysisManager::kOutputContainer, \r
                                                           "CmpHF.root");\r
+  AliAnalysisDataContainer *coutputCmp2 = mgr->CreateContainer("coutputCmp2",TNtuple::Class(),\r
+                                                          AliAnalysisManager::kOutputContainer, \r
+                                                          "CmpHF.root");\r
+\r
   mgr->ConnectInput(hfTask,0,mgr->GetCommonInputContainer());\r
 \r
-  mgr->ConnectOutput(hfTask,1,coutput);\r
+  mgr->ConnectOutput(hfTask,1,coutputCmp1);\r
+  mgr->ConnectOutput(hfTask,2,coutputCmp2);\r
 \r
   return hfTask;\r
 }\r
index db8d0585a7091e28fc36c67ba0d134c4f13d222f..f494264ba869bd6e16e6ecbd973e1ce736baa3f0 100644 (file)
@@ -28,9 +28,17 @@ AliAnalysisTaskSEDplus *AddTaskDplus()
   AliAnalysisDataContainer *coutputDplus = mgr->CreateContainer("coutputDplus",TList::Class(),
                                                            AliAnalysisManager::kOutputContainer,
                                                            "InvMassDplus.root");
+  AliAnalysisDataContainer *coutputDplus2 = mgr->CreateContainer("coutputDplus2",TNtuple::Class(),
+                                                           AliAnalysisManager::kOutputContainer,
+                                                                "InvMassDplus.root");
+  AliAnalysisDataContainer *coutputDplus3 = mgr->CreateContainer("coutputDplus3",TNtuple::Class(),
+                                                           AliAnalysisManager::kOutputContainer,
+                                                                "InvMassDplus.root");
   mgr->ConnectInput(dplusTask,0,mgr->GetCommonInputContainer());
 
   mgr->ConnectOutput(dplusTask,1,coutputDplus);
+  mgr->ConnectOutput(dplusTask,2,coutputDplus2);
+  mgr->ConnectOutput(dplusTask,3,coutputDplus3);
 
   return dplusTask;
 }
index 2eff8b6e9c93a7875cf4463fd1c6cde708e81310..72153b8e4d9f71a5cee8e4a20271bb9d20059b6e 100644 (file)
@@ -65,6 +65,8 @@ fVHF(0)
 
   // Output slot #1 writes into a TList container
   DefineOutput(1,TList::Class());  //My private output
+  // Output slot #2 writes into a TNtuple container
+  DefineOutput(2,TNtuple::Class());  //My private output
 }
 
 //________________________________________________________________________
@@ -113,7 +115,6 @@ void AliAnalysisTaskSECompareHF::UserCreateOutputObjects()
   fOutput->Add(fHistMass);
 
   fNtupleD0Cmp = new TNtuple("fNtupleD0Cmp","D0 comparison","pdg:VxRec:VxTrue:PtRec:PtTrue");
-  fOutput->Add(fNtupleD0Cmp);
 
   return;
 }
@@ -189,6 +190,7 @@ void AliAnalysisTaskSECompareHF::UserExec(Option_t */*option*/)
        PostData(1,fOutput);
 
        fNtupleD0Cmp->Fill(pdgD0,d->Xv(),partD0->Xv(),d->Pt(),partD0->Pt());
+       PostData(2,fNtupleD0Cmp);
       }
     }
     if(unsetvtx) d->UnsetOwnPrimaryVtx();
@@ -208,6 +210,7 @@ void AliAnalysisTaskSECompareHF::UserExec(Option_t */*option*/)
   */
   // Post the data already here
   PostData(1,fOutput);
+  PostData(2,fNtupleD0Cmp);
 
   return;
 }
@@ -224,9 +227,10 @@ void AliAnalysisTaskSECompareHF::Terminate(Option_t */*option*/)
     return;
   }
 
-  fNtupleD0Cmp = dynamic_cast<TNtuple*>(fOutput->FindObject("fNtupleD0Cmp"));
   fHistMass = dynamic_cast<TH1F*>(fOutput->FindObject("fHistMass"));
 
+  fNtupleD0Cmp = dynamic_cast<TNtuple*> (GetOutputData(2));
+
   return;
 }
 
index 3b25499122747fc71612cb9a9127b64529ddf071..07ba1be3f99d24eb23e4eea9fd772978bf3c756a 100644 (file)
@@ -66,6 +66,10 @@ fVHF(0)
 
   // Output slot #1 writes into a TList container
   DefineOutput(1,TList::Class());  //My private output
+  // Output slot #2 writes into a TNtuple container
+  DefineOutput(2,TNtuple::Class());  //My private output
+  // Output slot #3 writes into a TNtuple container
+  DefineOutput(3,TNtuple::Class());  //My private output
 }
 
 //________________________________________________________________________
@@ -131,9 +135,6 @@ void AliAnalysisTaskSEDplus::UserCreateOutputObjects()
   fNtupleDplus = new TNtuple("fNtupleDplus","D +","pdg:Px:Py:Pz:Ptpi:Ptpi2:PtK:PtRec:PtTrue:PointingAngle:DecLeng:VxTrue:VxRec:InvMass:sigvert");
   fNtupleDplusbackg = new TNtuple("fNtupleDplusbackg","D + backg","Ptpibkg:Ptpi2bkg:PtKbkg:PtRecbkg:PointingAnglebkg:DLbkg:VxRecbkg:InvMassbkg:sigvertbkg");
   
-  fOutput->Add(fNtupleDplus);
-  fOutput->Add(fNtupleDplusbackg);
-
   return;
 }
 
@@ -204,20 +205,18 @@ void AliAnalysisTaskSEDplus::UserExec(Option_t */*option*/)
            PostData(1,fOutput);
            
            fNtupleDplus->Fill(pdgDp,partDp->Px()-d->Px(),partDp->Py()-d->Py(),partDp->Pz()-d->Pz(),d->PtProng(0),d->PtProng(2),d->PtProng(1),d->Pt(),partDp->Pt(),d->CosPointingAngle(),d->DecayLength(),partDp->Xv(),d->Xv(),d->InvMassDplus(),d->GetSigmaVert());
+           PostData(2,fNtupleDplus);
          }
-       }         
-       else {     
+       } else {     
          fHistBackground->Fill(d->InvMassDplus());
          fNtupleDplusbackg->Fill(d->PtProng(0),d->PtProng(2),d->PtProng(1),d->Pt(),d->CosPointingAngle(),d->DecayLength(),d->Xv(),d->InvMassDplus(),d->GetSigmaVert());            
-         
+         PostData(3,fNtupleDplusbackg);
          fHistMass->Fill(d->InvMassDplus());
        }
        
        
       }
 
-
-       
       if(unsetvtx) d->UnsetOwnPrimaryVtx();
 
     }
@@ -240,11 +239,12 @@ void AliAnalysisTaskSEDplus::Terminate(Option_t */*option*/)
     return;
   }
 
-  fNtupleDplus = dynamic_cast<TNtuple*>(fOutput->FindObject("fNtupleDplus"));
   fHistMass = dynamic_cast<TH1F*>(fOutput->FindObject("fHistMass"));
   fHistSignal = dynamic_cast<TH1F*>(fOutput->FindObject("fHistSignal"));
   fHistBackground = dynamic_cast<TH1F*>(fOutput->FindObject("fHistBackground"));
-  fNtupleDplusbackg = dynamic_cast<TNtuple*>(fOutput->FindObject("fNtupleDplusbackg"));
-    return;
+  fNtupleDplus = dynamic_cast<TNtuple*>(GetOutputData(2));
+  fNtupleDplusbackg = dynamic_cast<TNtuple*>(GetOutputData(3));
+
+  return;
 }