// Connect the AOD
if (fDebug > 1) printf("AnalysisTaskJetBackgroundSubtract::UserCreateOutputObjects() \n");
+
+
+
if(fNonStdFile.Length()!=0){
// case that we have an AOD extension we need to fetch the jets from the extended output
if(!fHistList)fHistList = new TList();
fHistList->SetOwner();
+ PostData(1, fHistList); // post data in any case once
for(int iJB = 0;iJB<fJBArray->GetEntries();iJB++){
TObjString *ostr = (TObjString*)fJBArray->At(iJB);
continue;
}
newName.ReplaceAll(fReplaceString1.Data(),Form(fReplaceString2.Data(),fSubtraction));
- TH2F *hTmp = new TH2F(Form("h2PtInPtOut_%d",iJB),Form(";%s p_{T}; %s p_{T}",oldName.Data(),newName.Data()),200,0,200.,200,0.,200.);
+ TH2F *hTmp = new TH2F(Form("h2PtInPtOut_%d",iJB),Form(";%s p_{T}; %s p_{T}",oldName.Data(),newName.Data()),200,0,200.,400,-200.,200.);
fHistList->Add(hTmp);
}
}
if(ptSub<0){
// optionally rescale it and keep??
- bAdd = RescaleJetMomentum(&tmpNewJet,0.1);
- if(h2PtInOut)h2PtInOut->Fill(jet->Pt(),0.1);
+ bAdd = false; // RescaleJetMomentum(&tmpNewJet,0.1);
+ if(h2PtInOut)h2PtInOut->Fill(jet->Pt(),ptSub);
}
else{
bAdd = RescaleJetMomentum(&tmpNewJet,ptSub);
Printf("%s:%d Jet %d %3.3f %3.3f %3.3f %3.3f",(char*)__FILE__,__LINE__,i,jet->Pt(),ptSub,background,rho);}
if(ptSub<0){
// optionally rescale it and keep??
- bAdd = RescaleJetMomentum(&tmpNewJet,0.1);
- if(h2PtInOut)h2PtInOut->Fill(jet->Pt(),0.1);
+ bAdd = false;// RescaleJetMomentum(&tmpNewJet,0.1);
+ if(h2PtInOut)h2PtInOut->Fill(jet->Pt(),ptSub);
}
else{
bAdd = RescaleJetMomentum(&tmpNewJet,ptSub);
if(fDebug>2){ Printf("%s:%d Jet %d %3.3f %3.3f %3.3f %3.3f",(char*)__FILE__,__LINE__,i,jet->Pt(),ptSub,background,rho);}
if(ptSub<0){
// optionally rescale it and keep??
- bAdd = RescaleJetMomentum(&tmpNewJet,0.1);
- if(h2PtInOut)h2PtInOut->Fill(jet->Pt(),0.1);
+ bAdd = false; // RescaleJetMomentum(&tmpNewJet,0.1);
+ if(h2PtInOut)h2PtInOut->Fill(jet->Pt(),ptSub);
}
else{
bAdd = RescaleJetMomentum(&tmpNewJet,ptSub);
if((backgroundv.E()>jet->E())&&(backgroundv.Pt()>jet->Pt())){
// optionally rescale it and keep??
- bAdd = RescaleJetMomentum(&tmpNewJet,0.1);
- if(h2PtInOut)h2PtInOut->Fill(jet->Pt(),0.1);
+ bAdd = false; // RescaleJetMomentum(&tmpNewJet,0.1);
+ if(h2PtInOut)h2PtInOut->Fill(jet->Pt(),jet->Pt()-backgroundv.Pt());
}
else{
bAdd = RescaleJet4vector(&tmpNewJet,backgroundv);
if(i==0){fh2ShiftEtaLeading->Fill(jet->Eta(),newJet->Eta());
fh2ShiftPhiLeading->Fill(jet->Phi(),newJet->Phi());}}
-
+ // set the references
newJet->GetRefTracks()->Clear();
+ TRefArray *refs = jet->GetRefTracks();
+ for(Int_t ir=0;ir<refs->GetEntriesFast();ir++){
+ AliVParticle *vp = dynamic_cast<AliVParticle*>(refs->At(ir));
+ if(vp)newJet->AddTrack(vp);
+ }
}
-
-
-
-
-
-
}
-
-
-
- // subtract the background
-
-
- // remove jets??
-
- // sort jets...
-
- }
- PostData(1, fHistList);
+ if(jarrayOut)jarrayOut->Sort();
+ }
+
+ PostData(1, fHistList);
}
void AliAnalysisTaskJetBackgroundSubtract::Terminate(Option_t */*option*/)