]>
Commit | Line | Data |
---|---|---|
b2a297fa | 1 | /************************************************************************* |
2 | * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /////////////////////////////////////////////////////////////////////////// | |
17 | // // | |
18 | // Basic Analysis Task // | |
19 | // // | |
20 | /////////////////////////////////////////////////////////////////////////// | |
21 | ||
22 | #include <TChain.h> | |
61d106d3 | 23 | #include <TH1D.h> |
b2a297fa | 24 | #include <AliLog.h> |
25 | #include <AliAODHandler.h> | |
ffbede40 | 26 | #include <AliAODInputHandler.h> |
b2a297fa | 27 | #include <AliAnalysisManager.h> |
28 | #include <AliVEvent.h> | |
6e3ee68a | 29 | #include <AliTriggerAnalysis.h> |
8df8e382 | 30 | #include <AliInputEventHandler.h> |
2a14a7b1 | 31 | #include <AliAODInputHandler.h> |
6e3ee68a | 32 | #include <AliESDInputHandler.h> |
b2a297fa | 33 | |
34 | #include "AliDielectron.h" | |
8df8e382 | 35 | #include "AliDielectronMC.h" |
b2a297fa | 36 | #include "AliDielectronHistos.h" |
8df8e382 | 37 | #include "AliDielectronVarManager.h" |
b2a297fa | 38 | #include "AliAnalysisTaskDielectronFilter.h" |
41a64bfb | 39 | #include "AliAODCaloCluster.h" |
b2a297fa | 40 | |
41 | ClassImp(AliAnalysisTaskDielectronFilter) | |
42 | ||
43 | //_________________________________________________________________________________ | |
44 | AliAnalysisTaskDielectronFilter::AliAnalysisTaskDielectronFilter() : | |
2a14a7b1 | 45 | AliAnalysisTaskSE(), |
46 | fDielectron(0), | |
47 | fSelectPhysics(kTRUE), | |
48 | fTriggerMask(AliVEvent::kMB), | |
6e3ee68a | 49 | fExcludeTriggerMask(0), |
50 | fTriggerOnV0AND(kFALSE), | |
51 | fRejectPileup(kFALSE), | |
fb7d2d99 | 52 | fEventStat(0x0), |
6e3ee68a | 53 | fTriggerLogic(kAny), |
54 | fTriggerAnalysis(0x0), | |
5720c765 | 55 | fStoreLikeSign(kFALSE), |
56 | fStoreRotatedPairs(kFALSE), | |
4533e78e | 57 | fStoreEventsWithSingleTracks(kFALSE), |
41a64bfb | 58 | fCreateNanoAOD(kFALSE), |
4533e78e | 59 | fStoreHeader(kFALSE), |
5720c765 | 60 | fEventFilter(0x0) |
b2a297fa | 61 | { |
62 | // | |
63 | // Constructor | |
64 | // | |
65 | } | |
66 | ||
67 | //_________________________________________________________________________________ | |
68 | AliAnalysisTaskDielectronFilter::AliAnalysisTaskDielectronFilter(const char *name) : | |
2a14a7b1 | 69 | AliAnalysisTaskSE(name), |
70 | fDielectron(0), | |
71 | fSelectPhysics(kTRUE), | |
72 | fTriggerMask(AliVEvent::kMB), | |
6e3ee68a | 73 | fExcludeTriggerMask(0), |
74 | fTriggerOnV0AND(kFALSE), | |
75 | fRejectPileup(kFALSE), | |
fb7d2d99 | 76 | fEventStat(0x0), |
6e3ee68a | 77 | fTriggerLogic(kAny), |
78 | fTriggerAnalysis(0x0), | |
5720c765 | 79 | fStoreLikeSign(kFALSE), |
80 | fStoreRotatedPairs(kFALSE), | |
4533e78e | 81 | fStoreEventsWithSingleTracks(kFALSE), |
41a64bfb | 82 | fCreateNanoAOD(kFALSE), |
4533e78e | 83 | fStoreHeader(kFALSE), |
5720c765 | 84 | fEventFilter(0x0) |
b2a297fa | 85 | { |
86 | // | |
87 | // Constructor | |
88 | // | |
89 | DefineInput(0,TChain::Class()); | |
90 | DefineOutput(1, THashList::Class()); | |
61d106d3 | 91 | DefineOutput(2, TH1D::Class()); |
b2a297fa | 92 | } |
93 | ||
94 | //_________________________________________________________________________________ | |
95 | void AliAnalysisTaskDielectronFilter::Init() | |
96 | { | |
97 | // Initialization | |
98 | if (fDebug > 1) AliInfo("Init() \n"); | |
99 | ||
100 | // require AOD handler | |
101 | AliAODHandler *aodH = (AliAODHandler*)((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()); | |
c8f0f810 | 102 | if (!aodH) AliFatal("No AOD handler. Halting."); |
103 | ||
b2a297fa | 104 | aodH->AddFilteredAOD("AliAOD.Dielectron.root", "DielectronEvents"); |
105 | // AddAODBranch("AliDielectronCandidates",fDielectron->GetPairArraysPointer(),"deltaAOD.Dielectron.root"); | |
106 | } | |
107 | ||
61d106d3 | 108 | //_________________________________________________________________________________ |
109 | void AliAnalysisTaskDielectronFilter::UserCreateOutputObjects() | |
110 | { | |
111 | // | |
112 | // Initilise histograms | |
113 | // | |
c8f0f810 | 114 | |
115 | //require dielectron framework | |
116 | if (!fDielectron) { | |
117 | AliFatal("Dielectron framework class required. Please create and instance with proper cuts and set it via 'SetDielectron' before executing this task!!!"); | |
118 | return; | |
119 | } | |
5720c765 | 120 | if(fStoreRotatedPairs) fDielectron->SetStoreRotatedPairs(kTRUE); |
2e02dba4 | 121 | fDielectron->SetDontClearArrays(); |
c8f0f810 | 122 | fDielectron->Init(); |
123 | ||
6e3ee68a | 124 | Int_t nbins=kNbinsEvent+2; |
61d106d3 | 125 | if (!fEventStat){ |
6e3ee68a | 126 | fEventStat=new TH1D("hEventStat","Event statistics",nbins,0,nbins); |
61d106d3 | 127 | fEventStat->GetXaxis()->SetBinLabel(1,"Before Phys. Sel."); |
128 | fEventStat->GetXaxis()->SetBinLabel(2,"After Phys. Sel."); | |
6e3ee68a | 129 | |
130 | //default names | |
131 | fEventStat->GetXaxis()->SetBinLabel(3,"Bin3 not used"); | |
132 | fEventStat->GetXaxis()->SetBinLabel(4,"Bin4 not used"); | |
133 | fEventStat->GetXaxis()->SetBinLabel(5,"Bin5 not used"); | |
134 | ||
135 | if(fTriggerOnV0AND) fEventStat->GetXaxis()->SetBinLabel(3,"V0and triggers"); | |
136 | if (fEventFilter) fEventStat->GetXaxis()->SetBinLabel(4,"After Event Filter"); | |
137 | if (fRejectPileup) fEventStat->GetXaxis()->SetBinLabel(5,"After Pileup rejection"); | |
138 | ||
139 | fEventStat->GetXaxis()->SetBinLabel((kNbinsEvent+1),Form("#splitline{1 candidate}{%s}",fDielectron->GetName())); | |
140 | fEventStat->GetXaxis()->SetBinLabel((kNbinsEvent+2),Form("#splitline{With >1 candidate}{%s}",fDielectron->GetName())); | |
141 | } | |
41a64bfb | 142 | |
143 | Bool_t isAOD=AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()->IsA()==AliAODInputHandler::Class(); | |
144 | if(fCreateNanoAOD && isAOD){ | |
145 | AliAODHandler *aodH = (AliAODHandler*)((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()); | |
146 | AliAODExtension *extDielectron = aodH->GetFilteredAOD("AliAOD.Dielectron.root"); | |
147 | TClonesArray *nanoAODTracks = new TClonesArray("AliAODTrack",500); | |
148 | nanoAODTracks->SetName("tracks"); | |
149 | extDielectron->AddBranch("TClonesArray", &nanoAODTracks); | |
150 | TClonesArray *nanoAODVertices = new TClonesArray("AliAODVertex",500); | |
151 | nanoAODVertices->SetName("vertices"); | |
152 | extDielectron->AddBranch("TClonesArray", &nanoAODVertices); | |
153 | TClonesArray *nanoAODCaloCluster = new TClonesArray("AliAODCaloCluster",500); | |
154 | nanoAODCaloCluster->SetName("caloClusters"); | |
155 | extDielectron->AddBranch("TClonesArray", &nanoAODCaloCluster); | |
156 | extDielectron->GetAOD()->GetStdContent(); | |
157 | }else if(fCreateNanoAOD && !isAOD){AliWarning("Filtered-Nano AODs creation works only on AODs "); } | |
158 | ||
61d106d3 | 159 | PostData(2,fEventStat); |
160 | } | |
161 | ||
b2a297fa | 162 | //_________________________________________________________________________________ |
163 | void AliAnalysisTaskDielectronFilter::UserExec(Option_t *) | |
164 | { | |
165 | // | |
166 | // Main loop. Called for every event | |
167 | // | |
8df8e382 | 168 | |
b2a297fa | 169 | if (!fDielectron) return; |
170 | ||
8df8e382 | 171 | AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager(); |
6e3ee68a | 172 | Bool_t isESD=man->GetInputEventHandler()->IsA()==AliESDInputHandler::Class(); |
173 | Bool_t isAOD=man->GetInputEventHandler()->IsA()==AliAODInputHandler::Class(); | |
174 | ||
5720c765 | 175 | |
176 | AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler()); | |
177 | if (!inputHandler) return; | |
178 | ||
179 | if ( inputHandler->GetPIDResponse() ){ | |
180 | AliDielectronVarManager::SetPIDResponse( inputHandler->GetPIDResponse() ); | |
8df8e382 | 181 | } else { |
5720c765 | 182 | AliFatal("This task needs the PID response attached to the input event handler!"); |
8df8e382 | 183 | } |
2a14a7b1 | 184 | |
8df8e382 | 185 | // Was event selected ? |
6e3ee68a | 186 | ULong64_t isSelected = AliVEvent::kAny; |
187 | Bool_t isRejected = kFALSE; | |
188 | if( fSelectPhysics && inputHandler){ | |
189 | if((isESD && inputHandler->GetEventSelection()) || isAOD){ | |
190 | isSelected = inputHandler->IsEventSelected(); | |
191 | if (fExcludeTriggerMask && (isSelected&fExcludeTriggerMask)) isRejected=kTRUE; | |
192 | if (fTriggerLogic==kAny) isSelected&=fTriggerMask; | |
193 | else if (fTriggerLogic==kExact) isSelected=((isSelected&fTriggerMask)==fTriggerMask); | |
194 | } | |
195 | } | |
196 | ||
197 | //before physics selection | |
198 | fEventStat->Fill(kAllEvents); | |
199 | if (isSelected==0||isRejected) { | |
200 | PostData(3,fEventStat); | |
61d106d3 | 201 | return; |
202 | } | |
203 | //after physics selection | |
6e3ee68a | 204 | fEventStat->Fill(kSelectedEvents); |
205 | ||
206 | //V0and | |
207 | if(fTriggerOnV0AND){ | |
208 | if(isESD){if (!fTriggerAnalysis->IsOfflineTriggerFired(static_cast<AliESDEvent*>(InputEvent()), AliTriggerAnalysis::kV0AND)) | |
209 | return;} | |
210 | if(isAOD){if(!((static_cast<AliAODEvent*>(InputEvent()))->GetVZEROData()->GetV0ADecision() == AliVVZERO::kV0BB && | |
211 | (static_cast<AliAODEvent*>(InputEvent()))->GetVZEROData()->GetV0CDecision() == AliVVZERO::kV0BB) ) | |
212 | return;} | |
213 | } | |
214 | ||
215 | fEventStat->Fill(kV0andEvents); | |
216 | ||
217 | //Fill Event histograms before the event filter | |
218 | Double_t values[AliDielectronVarManager::kNMaxValues]={0}; | |
219 | Double_t valuesMC[AliDielectronVarManager::kNMaxValues]={0}; | |
220 | AliDielectronVarManager::SetEvent(InputEvent()); | |
221 | AliDielectronVarManager::Fill(InputEvent(),values); | |
222 | AliDielectronVarManager::Fill(InputEvent(),valuesMC); | |
223 | ||
224 | Bool_t hasMC=AliDielectronMC::Instance()->HasMC(); | |
225 | if (hasMC) { | |
226 | if (AliDielectronMC::Instance()->ConnectMCEvent()) | |
227 | AliDielectronVarManager::Fill(AliDielectronMC::Instance()->GetMCEvent(),valuesMC); | |
228 | } | |
229 | ||
230 | AliDielectronHistos *h=fDielectron->GetHistoManager(); | |
231 | if (h){ | |
232 | if (h->GetHistogramList()->FindObject("Event_noCuts")) | |
233 | h->FillClass("Event_noCuts",AliDielectronVarManager::kNMaxValues,values); | |
234 | if (hasMC && h->GetHistogramList()->FindObject("MCEvent_noCuts")) | |
235 | h->FillClass("Event_noCuts",AliDielectronVarManager::kNMaxValues,valuesMC); | |
236 | } | |
5720c765 | 237 | |
238 | //event filter | |
239 | if (fEventFilter) { | |
6e3ee68a | 240 | if (!fEventFilter->IsSelected(InputEvent())) return; |
5720c765 | 241 | } |
6e3ee68a | 242 | fEventStat->Fill(kFilteredEvents); |
243 | ||
244 | //pileup | |
245 | if (fRejectPileup){ | |
246 | if (InputEvent()->IsPileupFromSPD(3,0.8,3.,2.,5.)) return; | |
247 | } | |
248 | fEventStat->Fill(kPileupEvents); | |
5720c765 | 249 | |
b2a297fa | 250 | //bz for AliKF |
251 | Double_t bz = InputEvent()->GetMagneticField(); | |
252 | AliKFParticle::SetField( bz ); | |
6e3ee68a | 253 | |
254 | AliDielectronPID::SetCorrVal((Double_t)InputEvent()->GetRunNumber()); | |
b2a297fa | 255 | |
256 | fDielectron->Process(InputEvent()); | |
8df8e382 | 257 | |
fb7d2d99 | 258 | Bool_t hasCand = kFALSE; |
259 | if(fStoreLikeSign) hasCand = (fDielectron->HasCandidates() || fDielectron->HasCandidatesLikeSign()); | |
260 | else hasCand = (fDielectron->HasCandidates()); | |
5720c765 | 261 | |
262 | if(fStoreRotatedPairs) hasCand = (hasCand || fDielectron->HasCandidatesTR()); | |
4533e78e | 263 | |
264 | if(fStoreEventsWithSingleTracks) hasCand = (hasCand || fDielectron->GetTrackArray(0) || fDielectron->GetTrackArray(1)); | |
265 | ||
fb7d2d99 | 266 | |
4533e78e | 267 | AliAODHandler *aodH=(AliAODHandler*)((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler()); |
268 | AliAODExtension *extDielectron = aodH->GetFilteredAOD("AliAOD.Dielectron.root"); | |
fb7d2d99 | 269 | if(hasCand){ |
45b2b1b8 | 270 | AliAODEvent *aod = aodH->GetAOD(); |
2a14a7b1 | 271 | |
6e3ee68a | 272 | // reset bit for all tracks |
273 | if(isAOD){ | |
274 | for(Int_t it=0;it<aod->GetNumberOfTracks();it++){ | |
275 | aod->GetTrack(it)->ResetBit(kIsReferenced); aod->GetTrack(it)->SetUniqueID(0); | |
276 | } | |
277 | } | |
278 | ||
2a14a7b1 | 279 | //replace the references of the legs with the AOD references |
280 | TObjArray *obj = 0x0; | |
5720c765 | 281 | for(Int_t i=0; i < 11; i++ ){ |
2a14a7b1 | 282 | obj = (TObjArray*)((*(fDielectron->GetPairArraysPointer()))->UncheckedAt(i)); |
283 | if(!obj) continue; | |
284 | for(int j=0;j<obj->GetEntriesFast();j++){ | |
2a14a7b1 | 285 | AliDielectronPair *pairObj = (AliDielectronPair*)obj->UncheckedAt(j); |
286 | Int_t id1 = ((AliVTrack*)pairObj->GetFirstDaughter())->GetID(); | |
287 | Int_t id2 = ((AliVTrack*)pairObj->GetSecondDaughter())->GetID(); | |
288 | ||
289 | for(Int_t it=0;it<aod->GetNumberOfTracks();it++){ | |
6e3ee68a | 290 | if(aod->GetTrack(it)->GetID() == id1) pairObj->SetRefFirstDaughter(aod->GetTrack(it)); |
291 | if(aod->GetTrack(it)->GetID() == id2) pairObj->SetRefSecondDaughter(aod->GetTrack(it)); | |
8df8e382 | 292 | } |
293 | } | |
294 | } | |
2a14a7b1 | 295 | |
b2a297fa | 296 | extDielectron->SelectEvent(); |
6e3ee68a | 297 | Int_t ncandidates=fDielectron->GetPairArray(1)->GetEntriesFast(); |
298 | if (ncandidates==1) fEventStat->Fill((kNbinsEvent)); | |
299 | else if (ncandidates>1) fEventStat->Fill((kNbinsEvent+1)); | |
300 | ||
b2a297fa | 301 | //see if dielectron candidate branch exists, if not create is |
302 | TTree *t=extDielectron->GetTree(); | |
2a14a7b1 | 303 | |
6e3ee68a | 304 | if(!t->GetListOfBranches()->GetEntries() && isAOD) |
2a14a7b1 | 305 | t->Branch(aod->GetList()); |
306 | ||
d27fa1c8 | 307 | if (!t->GetBranch("dielectrons")) |
b2a297fa | 308 | t->Bronch("dielectrons","TObjArray",fDielectron->GetPairArraysPointer()); |
41a64bfb | 309 | |
6e3ee68a | 310 | // store positive and negative tracks |
41a64bfb | 311 | if(fCreateNanoAOD && isAOD){ |
312 | Int_t nTracks = (fDielectron->GetTrackArray(0))->GetEntries() + (fDielectron->GetTrackArray(1))->GetEntries(); | |
313 | AliAODEvent *nanoEv = extDielectron->GetAOD(); | |
314 | nanoEv->GetTracks()->Clear(); | |
315 | nanoEv->GetVertices()->Clear(); | |
316 | nanoEv->GetCaloClusters()->Clear(); | |
317 | ||
318 | AliAODVertex* tmp = ((static_cast<AliAODEvent*>(InputEvent()))->GetPrimaryVertex())->CloneWithoutRefs(); | |
319 | nanoEv->AddVertex(tmp); | |
320 | AliAODVertex* tmpSpd = ((static_cast<AliAODEvent*>(InputEvent()))->GetPrimaryVertexSPD())->CloneWithoutRefs(); | |
321 | nanoEv->AddVertex(tmpSpd); | |
322 | nanoEv->GetVertex(0)->SetNContributors((static_cast<AliAODEvent*>(InputEvent()))->GetPrimaryVertex()->GetNContributors()); | |
323 | nanoEv->GetVertex(1)->SetNContributors((static_cast<AliAODEvent*>(InputEvent()))->GetPrimaryVertexSPD()->GetNContributors()); | |
4533e78e | 324 | // set event plane |
325 | nanoEv->GetHeader()->SetEventplane((static_cast<AliAODEvent*>(InputEvent()))->GetHeader()->GetEventplaneP()); | |
326 | nanoEv->GetHeader()->ResetEventplanePointer(); | |
327 | // set multiplicity | |
151ddcbc | 328 | nanoEv->GetHeader()->SetRefMultiplicity((Int_t)values[AliDielectronVarManager::kNTrk]); |
329 | nanoEv->GetHeader()->SetRefMultiplicityPos((Int_t)values[AliDielectronVarManager::kNacc]); | |
4533e78e | 330 | //nanoEv->GetHeader()->SetRefMultiplicityNeg(values[AliDielectronVarManager::kMatchEffITSTPC]); |
d27fa1c8 | 331 | |
41a64bfb | 332 | for(int kj=0; kj<(fDielectron->GetTrackArray(0))->GetEntries(); kj++){ |
333 | Int_t posit = nanoEv->AddTrack((AliAODTrack*)fDielectron->GetTrackArray(0)->At(kj)); | |
334 | Int_t posVtx = nanoEv->AddVertex(((AliAODTrack*)fDielectron->GetTrackArray(0)->At(kj))->GetProdVertex()); | |
335 | nanoEv->GetVertex(posVtx)->ResetBit(kIsReferenced); | |
336 | nanoEv->GetVertex(posVtx)->SetUniqueID(0); | |
337 | nanoEv->GetVertex(posVtx)->RemoveDaughters(); | |
338 | nanoEv->GetTrack(posit)->ResetBit(kIsReferenced); | |
339 | nanoEv->GetTrack(posit)->SetUniqueID(0); | |
340 | // calo cluster | |
341 | Int_t caloIndex = ((AliAODTrack*)fDielectron->GetTrackArray(0)->At(kj))->GetEMCALcluster(); | |
342 | if(caloIndex > 0 && (static_cast<AliAODEvent*>(InputEvent()))->GetCaloCluster(caloIndex)){ | |
343 | Int_t posCaloCls = nanoEv->AddCaloCluster(static_cast<AliAODEvent*>(InputEvent())->GetCaloCluster(caloIndex)); | |
344 | nanoEv->GetTrack(posit)->SetEMCALcluster(posCaloCls); | |
345 | AliAODCaloCluster *clCls = nanoEv->GetCaloCluster(posCaloCls); | |
5159632a | 346 | for(int u=0; u<clCls->GetNTracksMatched(); u++) clCls->RemoveTrackMatched(clCls->GetTrackMatched(u)); |
41a64bfb | 347 | nanoEv->GetCaloCluster(posCaloCls)->AddTrackMatched((AliAODTrack*)nanoEv->GetTrack(posit)); |
348 | } | |
349 | // set references for vtx | |
350 | nanoEv->GetTrack(posit)->SetProdVertex(nanoEv->GetVertex(posVtx)); | |
351 | } | |
352 | ||
353 | for(int kj=0; kj<(fDielectron->GetTrackArray(1))->GetEntries(); kj++){ | |
354 | Int_t negat = nanoEv->AddTrack((AliAODTrack*)fDielectron->GetTrackArray(1)->At(kj)); | |
355 | Int_t negVtx = nanoEv->AddVertex(((AliAODTrack*)fDielectron->GetTrackArray(1)->At(kj))->GetProdVertex()); | |
356 | nanoEv->GetVertex(negVtx)->ResetBit(kIsReferenced); | |
357 | nanoEv->GetVertex(negVtx)->SetUniqueID(0); | |
358 | nanoEv->GetVertex(negVtx)->RemoveDaughters(); | |
359 | nanoEv->GetTrack(negat)->ResetBit(kIsReferenced); | |
360 | nanoEv->GetTrack(negat)->SetUniqueID(0); | |
361 | // calo cluster | |
362 | Int_t caloIndex = ((AliAODTrack*)fDielectron->GetTrackArray(1)->At(kj))->GetEMCALcluster(); | |
363 | if(caloIndex > 0 && (static_cast<AliAODEvent*>(InputEvent()))->GetCaloCluster(caloIndex)){ | |
364 | Int_t negCaloCls = nanoEv->AddCaloCluster(static_cast<AliAODEvent*>(InputEvent())->GetCaloCluster(caloIndex)); | |
365 | nanoEv->GetTrack(negat)->SetEMCALcluster(negCaloCls); | |
366 | AliAODCaloCluster *clCls = nanoEv->GetCaloCluster(negCaloCls); | |
5159632a | 367 | for(int u=0; u<clCls->GetNTracksMatched(); u++) clCls->RemoveTrackMatched(clCls->GetTrackMatched(u)); |
41a64bfb | 368 | nanoEv->GetCaloCluster(negCaloCls)->AddTrackMatched((AliAODTrack*)nanoEv->GetTrack(negat)); |
369 | } | |
370 | nanoEv->GetTrack(negat)->SetProdVertex(nanoEv->GetVertex(negVtx)); | |
371 | } | |
372 | delete tmp; delete tmpSpd; | |
373 | nanoEv->GetTracks()->Expand(nTracks); | |
374 | nanoEv->GetVertices()->Expand(nTracks+2); | |
375 | nanoEv->GetCaloClusters()->Expand(nanoEv->GetNumberOfCaloClusters()); | |
376 | ||
377 | } | |
6e3ee68a | 378 | if(isAOD) t->Fill(); |
b2a297fa | 379 | } |
4533e78e | 380 | |
381 | if(fCreateNanoAOD && isAOD && (!hasCand) && fStoreHeader) | |
382 | { | |
383 | // set event plane | |
384 | extDielectron->GetAOD()->GetHeader()->SetEventplane((static_cast<AliAODEvent*>(InputEvent()))->GetHeader()->GetEventplaneP()); | |
385 | extDielectron->GetAOD()->GetHeader()->ResetEventplanePointer(); | |
386 | extDielectron->GetTree()->Fill(); // fill header for all events without tracks | |
387 | } | |
388 | ||
b2a297fa | 389 | PostData(1, const_cast<THashList*>(fDielectron->GetHistogramList())); |
61d106d3 | 390 | PostData(2,fEventStat); |
41a64bfb | 391 | return; |
b2a297fa | 392 | } |
393 | ||
b2ad74d0 | 394 |