fixed errors
authorssakai <ssakai@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 15 May 2013 22:18:23 +0000 (22:18 +0000)
committerssakai <ssakai@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 15 May 2013 22:18:23 +0000 (22:18 +0000)
PWGHF/hfe/AliAnalysisTaskFlowTPCTOFQCSP.cxx
PWGHF/hfe/macros/AddTaskHFEpPb.C

index 7b0824e..c8b7548 100644 (file)
@@ -647,11 +647,13 @@ void AliAnalysisTaskFlowTPCTOFQCSP::UserCreateOutputObjects()
  
     AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
     AliInputEventHandler *inputHandler=dynamic_cast<AliInputEventHandler*>(man->GetInputEventHandler());
-    if (!inputHandler)
+    if (!inputHandler){
         AliFatal("Input handler needed");
-    
+    }
+    else{
+        fPIDResponse=inputHandler->GetPIDResponse();
+    }
   //pid response object
-  fPIDResponse=inputHandler->GetPIDResponse();
   if (!fPIDResponse)AliError("PIDResponse object was not created");
     
     
index 6202b13..6c05fbe 100644 (file)
-AliAnalysisTask *AddTaskHFEpPb(Bool_t isMC = kFALSE,\r
-                               Bool_t isAOD = kFALSE,\r
-                               Bool_t kTPCTOF_Ref = kTRUE,\r
-                               Bool_t kTPC_Only = kFALSE,\r
-                               Bool_t kTPCTOF_Cent = kFALSE,\r
-                               Bool_t kTPCTOF_Sys = kFALSE,\r
+AliAnalysisTask *AddTaskHFEpPb(Bool_t isMC = kFALSE,
+                               Bool_t isAOD = kFALSE,
+                               Bool_t kTPCTOF_Ref = kTRUE,
+                               Bool_t kTPC_Only = kFALSE,
+                               Bool_t kTPCTOF_Cent = kFALSE,
+                               Bool_t kTPCTOF_Sys = kFALSE,
                               Bool_t kTPCTOFTRD_Ref = kFALSE,
                               Bool_t kTPCTOFTRD_PID = kFALSE,
-                               int TRDtrigger = 0\r
-  ){\r
-  //get the current analysis manager\r
-  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
-  if (!mgr) {\r
-    Error("AddTaskHFEpPb", "No analysis manager found.");\r
-    return 0;\r
-  }\r
-  \r
-  AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();\r
-  \r
-  //@@ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-  \r
-  // Default settings \r
-  const int kDefITScl = 4;\r
-  const int kDefTPCcl = 110;\r
-  const int kDefTPCclPID = 80;\r
-  const double kDefDCAr = 1.;\r
-  const double kDefDCAz = 2.;\r
-  \r
-  // 24.02.2013 After the latest fits, mean is 0 and sigma is 1\r
-  const double kDefTPCs = 0;\r
-  const double kDefTPCu = 3;   \r
-  const double kDefTOFs = 3.;\r
-  //const int TRDtrigger = 1; // trd trigger type\r
-  if(!kTPCTOFTRD_Ref) TRDtrigger = 0;\r
-  \r
-  Double_t dEdxlm[12] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};  //  50%\r
-  Double_t dEdxhm[12] = {3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0};\r
-  // For systematics:\r
-  Double_t tpcl0[12]  = {-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0};  //  84%\r
-  Double_t tpcl1[12]  = {-0.53,-0.53,-0.53,-0.53,-0.53,-0.53,-0.53,-0.53,-0.53,-0.53,-0.53,-0.53};  //  70%\r
-  Double_t tpcl2[12]  = {-0.26,-0.26,-0.26,-0.26,-0.26,-0.26,-0.26,-0.26,-0.26,-0.26,-0.26,-0.26};  //  60%\r
-  Double_t tpcl3[12]  = {0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25};  //   40%/   40%\r
-\r
-  \r
-  // For TPC only\r
-  const double kDefTPCs1 = 0.0;\r
-  const double kDefTPCu1 = 3.0;\r
+                               int TRDtrigger = 0
+  ){
+  //get the current analysis manager
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr) {
+    Error("AddTaskHFEpPb", "No analysis manager found.");
+    return 0;
+  }
+  
+  AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
+  
+  //@@ 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+  
+  // Default settings 
+  const int kDefITScl = 4;
+  const int kDefTPCcl = 110;
+  const int kDefTPCclPID = 80;
+  const double kDefDCAr = 1.;
+  const double kDefDCAz = 2.;
+  
+  // 24.02.2013 After the latest fits, mean is 0 and sigma is 1
+  const double kDefTPCs = 0;
+  const double kDefTPCu = 3;   
+  const double kDefTOFs = 3.;
+  //const int TRDtrigger = 1; // trd trigger type
+  if(!kTPCTOFTRD_Ref) TRDtrigger = 0;
+  
+  Double_t dEdxlm[12] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};  //  50%
+  Double_t dEdxhm[12] = {3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0};
+  // For systematics:
+  Double_t tpcl0[12]  = {-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0};  //  84%
+  Double_t tpcl1[12]  = {-0.53,-0.53,-0.53,-0.53,-0.53,-0.53,-0.53,-0.53,-0.53,-0.53,-0.53,-0.53};  //  70%
+  Double_t tpcl2[12]  = {-0.26,-0.26,-0.26,-0.26,-0.26,-0.26,-0.26,-0.26,-0.26,-0.26,-0.26,-0.26};  //  60%
+  Double_t tpcl3[12]  = {0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25};  //   40%/   40%
+
+  
+  // For TPC only
+  const double kDefTPCs1 = 0.0;
+  const double kDefTPCu1 = 3.0;
 
   // eta cut
   Int_t etacut=0; // eta cut off
-  \r
+  
   if(kTPC_Only){\r
     // for the moment (09.02.2013) use the same as TOF-TPC. Refine later on\r
     RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],0,0,AliHFEextraCuts::kBoth,1,-0.8,0.8); // 50%\r
-  }\r
-  \r
+  }
+
   //------------------------------//\r
   //   TPC-TOF analysis\r
   //------------------------------//\r
-  \r
-  if(kTPCTOF_Ref){\r
+
+  if(kTPCTOF_Ref){
     // Reference task\r
     // with centrality V0A\r
-    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth,1,-0.8,0.8); // 50%\r
-  }\r
-\r
-  if (kTPCTOF_Cent){\r
+    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth,1,-0.8,0.8); // 50%
+  }
+
+  if (kTPCTOF_Cent){
     // For the moment we set V0A as the reference centrality estimator, and test the other ones:\r
     // 1: V0A, 2: V0M, 3: CL1, 4: ZNA\r
-    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth,2); // V0M\r
-    RegisterTask(isMC,isAOD, kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth,3); // CL1\r
-    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth,4); // ZNA\r
-\r
-  }  \r
-\r
-  if(kTPCTOF_Sys){\r
-\r
+    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth,2); // V0M
+    RegisterTask(isMC,isAOD, kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth,3); // CL1
+    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth,4); // ZNA
+
+  }
+
+  if(kTPCTOF_Sys){
+
     // TPC PID\r
-    if (!isMC){\r
+    if (!isMC){
       // 84%\r
-      //RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&tpcl0[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth); \r
-      //RegisterTaskPID2(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,-0.835,kDefTPCu,kDefTOFs,0,AliHFEextraCuts::kBoth);\r
+      //RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&tpcl0[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth);
+      //RegisterTaskPID2(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,-0.835,kDefTPCu,kDefTOFs,0,AliHFEextraCuts::kBoth);
       // 70%\r
-      RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&tpcl1[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth); \r
+      RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&tpcl1[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth);
       // 60%\r
-      RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&tpcl2[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth); \r
+      RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&tpcl2[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth);
       //RegisterTaskPID2(isMC,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,-0.184,kDefTPCu,kDefTOFs,0,AliHFEextraCuts::kBoth);\r
       // 40%\r
-      RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&tpcl3[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth); \r
-      //RegisterTaskPID2(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,0.265,kDefTPCu,kDefTOFs,0,AliHFEextraCuts::kBoth);\r
+      RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&tpcl3[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth);
+      //RegisterTaskPID2(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,0.265,kDefTPCu,kDefTOFs,0,AliHFEextraCuts::kBoth);
     }\r
-\r
+
     // TOF PID\r
-    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],2.0,0,AliHFEextraCuts::kBoth);\r
-    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],4.0,0,AliHFEextraCuts::kBoth);\r
+    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],2.0,0,AliHFEextraCuts::kBoth);
+    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],4.0,0,AliHFEextraCuts::kBoth);
     // TOF latest mismatch - helps nothing\r
-    //RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,1,AliHFEextraCuts::kBoth);\r
-\r
+    //RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,1,AliHFEextraCuts::kBoth);
+
     // ITS hits and SPD request\r
-    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,4,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth);\r
-    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,5,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth);\r
-    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,3,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kFirst);\r
-    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,4,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kFirst);\r
-    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,5,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kFirst);\r
+    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,4,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth);
+    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,5,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth);
+    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,3,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kFirst);
+    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,4,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kFirst);
+    RegisterTask(isMC,isAOD,kDefTPCcl,kDefTPCclPID,5,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kFirst);
 \r
     // TPC clusters\r
-    RegisterTask(isMC,isAOD,100,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth);\r
-    RegisterTask(isMC,isAOD,120,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth);\r
+    RegisterTask(isMC,isAOD,100,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth);
+    RegisterTask(isMC,isAOD,120,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth);
     // TPC clusters PID\r
-    RegisterTask(isMC,isAOD,kDefTPCcl,100,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth); \r
+    RegisterTask(isMC,isAOD,kDefTPCcl,100,kDefITScl,kDefDCAr,kDefDCAz,&dEdxlm[0],&dEdxhm[0],kDefTOFs,0,AliHFEextraCuts::kBoth);
   }\r
 \r
    if(kTPCTOFTRD_Ref){\r
 \r
-      RegisterTaskPID2(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,kDefTPCs,kDefTPCu,kDefTOFs,0,AliHFEextraCuts::kBoth,kFALSE,TRDtrigger);\r
+      RegisterTaskPID2(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,kDefTPCs,kDefTPCu,kDefTOFs,0,AliHFEextraCuts::kBoth,kFALSE,TRDtrigger);
+      RegisterTaskPID2(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,kDefTPCs,kDefTPCu,0,0,AliHFEextraCuts::kBoth,kFALSE,TRDtrigger);
    }
 
   if(kTPCTOFTRD_PID){
       // without TOF
-      RegisterTaskPID2TRD(MCthere,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,kDefTPCs,kDefTPCu,0,0,AliHFEextraCuts::kBoth,kFALSE,0,0,4,"TPC",etacut);
-      RegisterTaskPID2TRD(MCthere,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,kDefTPCs,kDefTPCu,0,0,AliHFEextraCuts::kBoth,kFALSE,0,6,4,"TRD,TPC",etacut);
-      RegisterTaskPID2TRD(MCthere,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,kDefTPCs,kDefTPCu,0,0,AliHFEextraCuts::kBoth,kFALSE,0,6,4,"TPC,TRD",etacut);
-      RegisterTaskPID2TRD(MCthere,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,kDefTPCs,kDefTPCu,0,0,AliHFEextraCuts::kBoth,kFALSE,0,6,2,"TRD,TPC",etacut);
-      RegisterTaskPID2TRD(MCthere,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,kDefTPCs,kDefTPCu,0,0,AliHFEextraCuts::kBoth,kFALSE,0,5,4,"TRD,TPC",etacut);
-      RegisterTaskPID2TRD(MCthere,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,kDefTPCs,kDefTPCu,0,0,AliHFEextraCuts::kBoth,kFALSE,0,5,4,"TPC,TRD",etacut);
-      RegisterTaskPID2TRD(MCthere,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,kDefTPCs,kDefTPCu,0,0,AliHFEextraCuts::kBoth,kFALSE,0,5,2,"TRD,TPC",etacut);
+      RegisterTaskPID2TRD(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,kDefTPCs,kDefTPCu,0,0,AliHFEextraCuts::kBoth,kFALSE,0,6,4,"TRD,TPC",etacut);
+      RegisterTaskPID2TRD(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,kDefTPCs,kDefTPCu,0,0,AliHFEextraCuts::kBoth,kFALSE,0,6,4,"TPC,TRD",etacut);
+      RegisterTaskPID2TRD(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,kDefTPCs,kDefTPCu,0,0,AliHFEextraCuts::kBoth,kFALSE,0,6,2,"TRD,TPC",etacut);
+      RegisterTaskPID2TRD(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,kDefTPCs,kDefTPCu,0,0,AliHFEextraCuts::kBoth,kFALSE,0,5,4,"TRD,TPC",etacut);
+      RegisterTaskPID2TRD(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,kDefTPCs,kDefTPCu,0,0,AliHFEextraCuts::kBoth,kFALSE,0,5,4,"TPC,TRD",etacut);
+      RegisterTaskPID2TRD(isMC,isAOD,kDefTPCcl,kDefTPCclPID,kDefITScl,kDefDCAr,kDefDCAz,kDefTPCs,kDefTPCu,0,0,AliHFEextraCuts::kBoth,kFALSE,0,5,2,"TRD,TPC",etacut);
   }
 
   \r
@@ -271,17 +271,30 @@ AliAnalysisTask *RegisterTaskPID2TRD(Bool_t useMC, Bool_t isAOD, Int_t tpcCls=12
                                  Int_t tofm=0,
                                  Int_t itshitpixel = AliHFEextraCuts::kBoth, 
                                  Bool_t withetacorrection = kTRUE,
-                                    Int_t TRDtrigger=0,Int_t trdl=6, Int_t trde=4,TString detector,Int_t etacut){
+                                    Int_t TRDtrigger=0,Int_t trdl=6, Int_t trde=4,TString detector="TRD,TPC",Int_t etacut=0){
 
     TString detused=detector.Copy();
     TPRegexp(",").Substitute(detused,"","g");
     printf("detectors in use %s %s \n",detector.Data(),detused.Data());
 
+    Int_t idcaxy = (Int_t)(dcaxy*10.);
+  Int_t idcaz = (Int_t)(dcaz*10.);
+  Int_t itpcs = (Int_t)(tpcs*1000.);
+  Int_t itofs = (Int_t)(tofs*10.);
+  Int_t ipixelany = itshitpixel;
+  Int_t ietacorr = 0;
+  if(withetacorrection) ietacorr = 1;
+  
+  TString appendix(TString::Format("mbTPCc%dTPCp%dITS%dDCAr%dz%dTPCs%dTOFs%dm%ipa%dtrdtrg%dtrdl%itrde%iPID%setacut%i",tpcCls,
+                                  tpcClsPID,itsCls,idcaxy,idcaz,itpcs,itofs,tofm,ipixelany,TRDtrigger,trdl,trde,detused.Data(),etacut));
+  printf("Add macro appendix %s\n", appendix.Data());
+
+
 
-  gROOT->LoadMacro("$TRAIN_ROOT/util/hfe/configs/ConfigHFEmbpPbTRD.C");
+  gROOT->LoadMacro("$ALICE_ROOT/PWGHF/hfe/macros/configs/pPb/ConfigHFEmbpPbTRD.C");
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
-  AliAnalysisTaskHFE *task = ConfigHFEmbpPbTRD(useMC, isAOD, tpcCls, tpcClsPID, itsCls, dcaxy, dcaz,
+  AliAnalysisTaskHFE *task = ConfigHFEmbpPbTRD(useMC, isAOD, appendix, tpcCls, tpcClsPID, itsCls, dcaxy, dcaz,
                                             tpcs,tpcu,tofs,tofm,3.,kFALSE,kTRUE,kFALSE,itshitpixel,withetacorrection,0,TRDtrigger,trdl,trde,detector,etacut);
 
   if(isAOD)
@@ -289,7 +302,7 @@ AliAnalysisTask *RegisterTaskPID2TRD(Bool_t useMC, Bool_t isAOD, Int_t tpcCls=12
   else
     task->SetESDAnalysis();
 
-  if (useMC)
+  if(useMC)
     task->SetHasMCData(kTRUE);
   else{
     task->SetHasMCData(kFALSE);
@@ -298,27 +311,22 @@ AliAnalysisTask *RegisterTaskPID2TRD(Bool_t useMC, Bool_t isAOD, Int_t tpcCls=12
   if(TRDtrigger==0) task->SelectCollisionCandidates(AliVEvent::kINT7);
   else task->SelectCollisionCandidates(AliVEvent::kTRD);
 
-  Int_t idcaxy = (Int_t)(dcaxy*10.);
-  Int_t idcaz = (Int_t)(dcaz*10.);
-  Int_t itpcs = (Int_t)(tpcs*1000.);
-  Int_t itofs = (Int_t)(tofs*10.);
-  Int_t ipixelany = itshitpixel;
-  Int_t ietacorr = 0;
-  if(withetacorrection) ietacorr = 1;
-  
-  TString appendix(TString::Format("mbTPCc%dTPCp%dITS%dDCAr%dz%dTPCs%dTOFs%dm%ipa%dtrdtrg%dtrdl%itrde%iPID%setacut%i",tpcCls,
-                                  tpcClsPID,itsCls,idcaxy,idcaz,itpcs,itofs,tofm,ipixelany,TRDtrigger,trdl,trde,detused.Data(),etacut));
-  printf("Add macro appendix %s\n", appendix.Data());
+
+  TString containerName = mgr->GetCommonFileName();
+  containerName += ":HFEtask";
+  containerName += appendix.Data();
+  printf("container name: %s\n", containerName.Data());
 
   //create data containers
   task->ConnectOutput(1, mgr->CreateContainer(Form("HFE_Results_%s", appendix.Data()), 
                                              TList::Class(), AliAnalysisManager::kOutputContainer, 
-                                             Form("HFEtask%s.root", appendix.Data())));
+                                             containerName.Data()));
   task->ConnectOutput(2, mgr->CreateContainer(Form("HFE_QA_%s", appendix.Data()), TList::Class(), 
                                              AliAnalysisManager::kOutputContainer, 
-                                             Form("HFEtask%s.root", appendix.Data())));
+                                             containerName.Data()));
   mgr->ConnectInput(task,  0, cinput );
 
   mgr->AddTask(task);
+
   return NULL;
-}
\ No newline at end of file
+}