]>
Commit | Line | Data |
---|---|---|
fc392675 | 1 | AliAnalysisTaskEmcalJetHadEPpid* AddTaskEmcalJetHadEPpid( |
2 | const char *outfilename = "AnalysisOutput.root", | |
3 | const char *nJets = "Jets", | |
3badfe33 | 4 | const char *nTracksME = "PicoTracks", |
8ee2d316 | 5 | const char *nClusters = "CaloClustersCorr", |
6 | const char *nRho = "rhoCh", | |
fc392675 | 7 | const char *lrho = "lrho", |
8 | const Double_t minPhi = 1.8, | |
9 | const Double_t maxPhi = 2.74, | |
10 | const Double_t minEta = -0.3, | |
11 | const Double_t maxEta = 0.3, | |
12 | const Double_t minArea = 0.4, | |
13 | const Int_t EvtMix = 0, | |
14 | const Double_t TrkBias = 5, | |
15 | const Double_t ClusBias = 5, | |
8ee2d316 | 16 | const Double_t TrkEta = 0.9, |
17 | Bool_t PID = 0, //kFALSE, | |
18 | Bool_t PIDtrackBIAS = 0, //kFALSE, | |
19 | Bool_t varbinTHnSparse = 0, //kFALSE, | |
139e13f4 | 20 | Bool_t allpidAXIS = 0, //kFALSE, |
8ee2d316 | 21 | Bool_t QAhistos = 0, //kFALSE, |
22 | Bool_t BIAShistos = 0, //kFALSE, | |
23 | Bool_t extraCORRhistos = 0, //kFALSE, | |
daa728b0 | 24 | Bool_t oldJEThadhistos = 0, //kFALSE, |
8ee2d316 | 25 | const Double_t JetPtcut = 15.0, |
26 | const Double_t JetRadius = 0.4, | |
f1ce4cc3 | 27 | const Double_t constitCut = 0.15, |
8ee2d316 | 28 | const Int_t MixingTracks = 50000, |
a409c5ba | 29 | const Int_t nmixingTR = 5000, |
d60e724e | 30 | const Int_t nmixingEV = 5, |
f1ce4cc3 | 31 | TString cutType = "EMCAL", |
a8150e70 | 32 | Bool_t Comments = 0, |
56523939 | 33 | Bool_t doFlavourJetAnalysis = 0, |
34 | Int_t flavTag = 999, | |
3263f852 | 35 | Int_t esdcuts = 10001006, |
56523939 | 36 | TString colltype = "", |
d60e724e | 37 | UInt_t trigevent = AliVEvent::kAny, |
38 | UInt_t mixevent = AliVEvent::kAny, | |
3263f852 | 39 | const char *tag = "" |
fc392675 | 40 | ) |
41 | { | |
42 | ||
43 | // Get the pointer to the existing analysis manager via the static access method. | |
44 | //============================================================================== | |
45 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
46 | if (!mgr) | |
47 | { | |
48 | ::Error("AddTaskEmcalJetHadEPpid", "No analysis manager to connect to."); | |
49 | return NULL; | |
50 | } | |
3badfe33 | 51 | |
fc392675 | 52 | // Check the analysis type using the event handlers connected to the analysis manager. |
53 | //============================================================================== | |
3badfe33 | 54 | AliVEventHandler *evhand = mgr->GetInputEventHandler(); |
55 | //if (!mgr->GetInputEventHandler()) | |
56 | if (!evhand) { | |
57 | Error("AddTaskEmcalJetHadEPpid", "This task requires an input event handler"); | |
fc392675 | 58 | return NULL; |
59 | } | |
139e13f4 | 60 | |
3badfe33 | 61 | // check on type of event |
62 | TString dType("ESD"); | |
63 | if (!evhand->InheritsFrom("AliESDInputHandler")) | |
64 | dType = "AOD"; | |
65 | if (dType == "AOD") const char *nTracks = "AODFilterTracks"; | |
66 | if (dType == "ESD") const char *nTracks = "ESDFilterTracks"; | |
67 | ||
56523939 | 68 | // find out collisions system in order to know beamtype in UserCreateObjects later on |
69 | AliAnalysisTaskEmcal::BeamType beam = -99; | |
70 | if (colltype == "p-p") beam = 0; | |
71 | else if(colltype == "A-A") beam = 1; | |
72 | else if(colltype == "p-A") beam = 2; | |
73 | else beam = -1; | |
74 | ||
fc392675 | 75 | //------------------------------------------------------- |
76 | // Init the task and do settings | |
77 | //------------------------------------------------------- | |
78 | ||
3263f852 | 79 | TString name(Form("Correlations_%s%s", nJets, tag)); |
fc392675 | 80 | AliAnalysisTaskEmcalJetHadEPpid *correlationtask = new AliAnalysisTaskEmcalJetHadEPpid(name); |
81 | correlationtask->SetJetsName(nJets); | |
82 | correlationtask->SetTracksName(nTracks); | |
56523939 | 83 | correlationtask->SetTracksNameME(nTracksME); |
fc392675 | 84 | correlationtask->SetRhoName(nRho); |
d60e724e | 85 | if(colltype == "A-A") correlationtask->SetLocalRhoName(lrho); |
fc392675 | 86 | correlationtask->SetJetPhi(minPhi,maxPhi); |
87 | correlationtask->SetJetEta(minEta,maxEta); | |
88 | correlationtask->SetAreaCut(minArea); | |
89 | correlationtask->SetEventMixing(EvtMix); | |
90 | correlationtask->SetTrkBias(TrkBias); | |
91 | correlationtask->SetClusBias(ClusBias); | |
d60e724e | 92 | correlationtask->SetTrkEta(TrkEta); |
8ee2d316 | 93 | // Added on/after March20, 2014 |
94 | correlationtask->SetdoPID(PID); | |
95 | correlationtask->SetdoPIDtrackBIAS(PIDtrackBIAS); | |
96 | correlationtask->SetvarbinTHnSparse(varbinTHnSparse); | |
139e13f4 | 97 | correlationtask->SetallpidAXIS(allpidAXIS); |
8ee2d316 | 98 | correlationtask->SetmakeQAhistos(QAhistos); |
99 | correlationtask->SetmakeBIAShistos(BIAShistos); | |
100 | correlationtask->SetmakeextraCORRhistos(extraCORRhistos); | |
daa728b0 | 101 | correlationtask->SetoldJEThadhistos(oldJEThadhistos); |
8ee2d316 | 102 | correlationtask->SetJetPtcut(JetPtcut); |
103 | correlationtask->SetJetRad(JetRadius); | |
f1ce4cc3 | 104 | correlationtask->SetConstituentCut(constitCut); |
8ee2d316 | 105 | correlationtask->SetMixingTracks(MixingTracks); |
a409c5ba | 106 | correlationtask->SetNMixedTr(nmixingTR); |
d60e724e | 107 | correlationtask->SetNMixedEvt(nmixingEV); |
8ee2d316 | 108 | correlationtask->SetcutType(cutType); |
f1ce4cc3 | 109 | correlationtask->SetdoComments(Comments); |
56523939 | 110 | correlationtask->SetFlavourJetAnalysis(doFlavourJetAnalysis); |
111 | correlationtask->SetJETFlavourTag(flavTag); | |
112 | correlationtask->SetCollType(beam); | |
d60e724e | 113 | correlationtask->SetTriggerEventType(trigevent); |
114 | correlationtask->SetMixedEventType(mixevent); | |
8ee2d316 | 115 | |
116 | // =================== set up containers ================================================ | |
117 | // Cluster Container | |
118 | AliClusterContainer *clusCont = correlationtask->AddClusterContainer(nClusters); | |
119 | ||
120 | // Particle Container | |
121 | AliParticleContainer *partCont = correlationtask->AddParticleContainer(nTracks); | |
fc392675 | 122 | |
8ee2d316 | 123 | // Jet Containers |
124 | AliJetContainer *jetCont0 = correlationtask->AddJetContainer(nJets, cutType, JetRadius); | |
125 | AliJetContainer *jetCont1 = correlationtask->AddJetContainer(nJets, cutType, JetRadius); | |
126 | correlationtask->SetContainerAllJets(0); | |
127 | correlationtask->SetContainerPIDJets(1); | |
128 | ||
129 | // jet container cuts.. | |
130 | correlationtask->SetJetPtCut(JetPtcut, 1); | |
131 | correlationtask->SetPercAreaCut(0.6, 1); | |
132 | ||
a8150e70 | 133 | // =================================================================== |
3badfe33 | 134 | // for manually doing Track Cuts |
a8150e70 | 135 | // ESD track quality cuts |
136 | AliESDtrackCuts *esdTrackCuts = 0x0; | |
137 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/macros/CreateTrackCutsPWGJE.C"); | |
138 | esdTrackCuts = CreateTrackCutsPWGJE(esdcuts); | |
3263f852 | 139 | correlationtask->SetTrackCuts(esdTrackCuts); |
a8150e70 | 140 | |
fc392675 | 141 | //------------------------------------------------------- |
142 | // Final settings, pass to manager and set the containers | |
143 | //------------------------------------------------------- | |
144 | mgr->AddTask(correlationtask); | |
145 | ||
146 | // Create containers for input/output | |
147 | mgr->ConnectInput (correlationtask, 0, mgr->GetCommonInputContainer() ); | |
148 | AliAnalysisDataContainer *cojeth = mgr->CreateContainer(name, | |
149 | TList::Class(), | |
150 | AliAnalysisManager::kOutputContainer, | |
151 | outfilename); | |
152 | ||
153 | mgr->ConnectOutput(correlationtask,1,cojeth); | |
154 | return correlationtask; | |
155 | } |