adding the option for hybrid tracks global+global constrained as well as global+TPC...
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskJCORRANTask.C
CommitLineData
6392490d 1
2//---------------------------------------------------
3// Macro to do analysis with AliJCORRANTask
4// Can be executed with Root and AliRoot
5//
6// ALICE Jyvaskyla group
7//
7b3462ad 8// last change 20th Jun 2010 FK
6392490d 9//-------------------------------------------------
10
11
12const TString kInputData = "ESD";
7d365db4 13const TString kJCORRANInputFormat = "ESD"; // ESD, AOD
7b3462ad 14const Bool_t kMC = kFALSE; //With real data kMC = kFALSE, MC data kMC =kTRUE
6392490d 15
7b3462ad 16AliJCORRANTask* AddTaskJCORRAN(const char* aodName="jcorran.root", const char* addPhysSelection="$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C")
6392490d 17{
18 //--------------------------------------
19 // Make the analysis manager
20 //-------------------------------------
21 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
22 if(!mgr){
23 ::Error("AddTaskJCORRAN", "No analysis manager to connect to.");
24 return NULL;
25 }
26
7b3462ad 27 if(!mgr->GetInputEventHandler()){
6392490d 28 ::Error("AddTaskJets", "This task requires an input event handler");
29 return NULL;
30 }
7b3462ad 31
32 //AliAODHandler *aodH = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler());
33 //aodH->SetCreateNonStandardAOD();
6392490d 34
35 //-------------------------------------------------------------------------
7d365db4 36 /// T R A C K S E L E C T I O N
6392490d 37
7d365db4 38 AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts", "Loose");
39 esdTrackCuts->SetMinNClustersTPC(70);
40 esdTrackCuts->SetMaxChi2PerClusterTPC(4.0);
41 esdTrackCuts->SetRequireTPCRefit(kTRUE);
42 esdTrackCuts->SetRequireITSRefit(kTRUE);
43 esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
44 esdTrackCuts->SetMaxDCAToVertexXY(3.5);
45 esdTrackCuts->SetMaxDCAToVertexZ(3.5);
46 esdTrackCuts->SetMaxDCAToVertexXYPtDep("0.0350+0.0420/pt^0.9");
47
48
49
50 //-------------------------------------------------------------------------
6392490d 51 // E V E N T S E L E C T I O N
52
7d365db4 53 Int_t downscaling = 1;//20; //downscaling of normal events
54 Double_t lowerCutOnLPmom = 0;//3; // 3 GeV
55 Double_t lowerCutOnLeadingCaloClusterE = 1.; //GeV
56 Double_t lowerCutOnCaloClusterE = 0.2; //select only clusters above this energy
7b3462ad 57
58 if(addPhysSelection){
59 gROOT->LoadMacro(addPhysSelection);
60 AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection();
61 AliPhysicsSelection* physSele = physSelTask->GetPhysicsSelection();
7b3462ad 62 }
63 //---------------------------------------------------------------------------
64 // J C O R R A N T A S K
6392490d 65
7b3462ad 66 AliJCORRANTask *jctask = new AliJCORRANTask("PWG4JCORRANTask",kJCORRANInputFormat);
7d365db4 67 jctask->SetESDtrackCuts(esdTrackCuts);
68 jctask->SetDownScalingOfMB(downscaling);
69 jctask->SetLeadingPaticleMomCut(lowerCutOnLPmom);
7b3462ad 70 jctask->SetLowerCutOnCaloClusterE(lowerCutOnCaloClusterE);
7d365db4 71 jctask->SetLowerCutOnLeadingCaloClusterE(lowerCutOnLeadingCaloClusterE);
72 jctask->SetRealOrMC(kMC);
7b3462ad 73 jctask->SetOutputAODName(aodName);
7d365db4 74 jctask->SetDebugLevel(1);
6392490d 75
7d365db4 76 if(!kMC && addPhysSelection){
77 //Apply offline trigger selection by AliPhysicsSelectionTask
78 jctask->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kHighMult);
79 }
6392490d 80
7d365db4 81 mgr->AddTask(jctask);
82
6392490d 83 // Create containers for input:
7b3462ad 84 AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer();
6392490d 85
7b3462ad 86 //connect input to JCORRAN task
87 mgr->ConnectInput(jctask, 0, cinput0);
6392490d 88
6392490d 89
7b3462ad 90 return jctask;
6392490d 91}
92
93