#include "AliCFManager.h"
#include "AliCFContainer.h"
#include "AliLog.h"
+#include "AliAnalysisManager.h"
+#include "AliAODHandler.h"
#include "AliAODEvent.h"
#include "AliAODRecoDecay.h"
#include "AliAODRecoDecayHF.h"
#include "AliAODRecoDecayHF2Prong.h"
#include "AliAODMCParticle.h"
+#include "AliAODMCHeader.h"
#include "AliESDtrack.h"
#include "TChain.h"
#include "THnSparse.h"
#include "TH2D.h"
+
//__________________________________________________________________________
AliCFHeavyFlavourTaskMultiVarMultiStep::AliCFHeavyFlavourTaskMultiVarMultiStep() :
AliAnalysisTaskSE(),
fEvents++;
if (fEvents%10000 ==0) AliDebug(2,Form("Event %d",fEvents));
AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
- fCFManager->SetEventInfo(aodEvent);
+
+ TClonesArray *arrayD0toKpi=0;
+
+ if(!aodEvent && AODEvent() && IsStandardAOD()) {
+ // In case there is an AOD handler writing a standard AOD, use the AOD
+ // event in memory rather than the input (ESD) event.
+ aodEvent = dynamic_cast<AliAODEvent*> (AODEvent());
+ // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
+ // have to taken from the AOD event hold by the AliAODExtension
+ AliAODHandler* aodHandler = (AliAODHandler*)
+ ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
+ if(aodHandler->GetExtensions()) {
+ AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
+ AliAODEvent *aodFromExt = ext->GetAOD();
+ arrayD0toKpi=(TClonesArray*)aodFromExt->GetList()->FindObject("D0toKpi");
+ }
+ } else {
+ arrayD0toKpi=(TClonesArray*)aodEvent->GetList()->FindObject("D0toKpi");
+ }
+
+
+ if (!arrayD0toKpi) {
+ AliError("Could not find array of HF vertices");
+ return;
+ }
+
+
+ fCFManager->SetRecEventInfo(aodEvent);
+ fCFManager->SetMCEventInfo(aodEvent);
// MC-event selection
Double_t containerInput[12] ;
//loop on the MC event
TClonesArray* mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
- if (!mcArray) AliError("Could not find Monte-Carlo in AOD");
+ if (!mcArray) {
+ AliError("Could not find Monte-Carlo in AOD");
+ return;
+ }
Int_t icountMC = 0;
Int_t icountAcc = 0;
Int_t icountReco = 0;
Int_t icountRecoITSClusters = 0;
Int_t icountRecoPPR = 0;
+ AliAODMCHeader *mcHeader = dynamic_cast<AliAODMCHeader*>(aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName()));
+ if (!mcHeader) {
+ AliError("Could not find MC Header in AOD");
+ return;
+ }
+
Int_t cquarks = 0;
// AOD primary vertex
AliAODVertex *vtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
+ Double_t zPrimVertex = vtx1->GetZ();
+ Double_t zMCVertex = mcHeader->GetVtxZ();
Bool_t vtxFlag = kTRUE;
TString title=vtx1->GetTitle();
if(!title.Contains("VertexerTracks")) vtxFlag=kFALSE;
containerInputMC[9] = -100000.; // dummy value, meaningless in MC, in micron^2
containerInputMC[10] = 1.01; // dummy value, meaningless in MC
containerInputMC[11] = vectorMC[6]; // dummy value, meaningless in MC
+ containerInputMC[12] = zMCVertex; // z of reconstructed of primary vertex
fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepGenerated);
icountMC++;
fCountMC += icountMC;
fCountAcc += icountAcc;
- // load heavy flavour vertices
- TClonesArray *arrayD0toKpi = (TClonesArray*)((aodEvent->GetList())->FindObject("D0toKpi"));
- if (!arrayD0toKpi) AliError("Could not find array of HF vertices");
AliDebug(2, Form("Found %d vertices",arrayD0toKpi->GetEntriesFast()));
Int_t pdgDgD0toKpi[2]={321,211};
containerInput[9] = d0xd0*1.E8; // in micron^2
containerInput[10] = cosPointingAngle; // in micron
containerInput[11] = phi;
+ containerInputMC[12] = zPrimVertex; // z of reconstructed of primary vertex
}
else {
// ... or with generated values
containerInput[9] = 100000.; // dummy value, meaningless in MC, in micron^2
containerInput[10] = 1.01; // dummy value, meaningless in MC
containerInput[11] = vectorMC[6];
+ containerInputMC[12] = zMCVertex; // z of reconstructed of primary vertex
}
else {
AliDebug(3,"Problems in filling the container");
Double_t cuts[7] = {9999999., 1.1, 0., 9999999., 9999999., 0.,0.027};
//cuts of the D0 analysis (looser) see AliAnalysisTaskSED0Mass.cxx
if (pt <= 1){
+
+ //coutputmassD02
cuts[0] = 400; //dca (um)
cuts[1] = 0.8; //cosTstar
cuts[2] = 0.5; //pt (GeV/c)
cuts[3] = 500; //d0 (um)
cuts[4] = -25000; //d0xd0 (um^2)
cuts[5] = 0.7; //cosTpointing
+ /*
+ //PPR
+ cuts[0] = 400; //dca (um)
+ cuts[1] = 0.8; //cosTstar
+ cuts[2] = 0.5; //pt (GeV/c)
+ cuts[3] = 500; //d0 (um)
+ cuts[4] = -20000; //d0xd0 (um^2)
+ cuts[5] = 0.5; //cosTpointing
+ */
}
+ /* //not same cuts for pt = 1 to 2 and 1 to 3 GeV in case must match them because of poor stat
+ else if (pt > 1 && pt <= 2){
+
+ //coutputmassD02
+ cuts[0] = 300;
+ cuts[1] = 0.8;
+ cuts[2] = 0.6;
+ cuts[3] = 1000;
+ cuts[4] = -25000;
+ cuts[5] = 0.7;
+
+ //PPR
+ cuts[0] = 300;
+ cuts[1] = 0.8;
+ cuts[2] = 0.6;
+ cuts[3] = 500;
+ cuts[4] = -20000;
+ cuts[5] = 0.6;
+
+ }
+ */
else if (pt > 1 && pt <= 3){
- cuts[0] = 200;
- cuts[1] = 0.8;
- cuts[2] = 0.7;
- cuts[3] = 1000;
- cuts[4] = -25000;
- cuts[5] = 0.8;
+
+ //coutputmassD02
+ cuts[0] = 200;
+ cuts[1] = 0.8;
+ cuts[2] = 0.7;
+ cuts[3] = 1000;
+ cuts[4] = -25000;
+ cuts[5] = 0.8;
+ /*
+ //PPR
+ cuts[0] = 300;
+ cuts[1] = 0.8;
+ cuts[2] = 0.6;
+ cuts[3] = 500;
+ cuts[4] = -20000;
+ cuts[5] = 0.6;
+ */
}
else if (pt > 3 && pt <= 5){
- cuts[0] = 200;
- cuts[1] = 0.8;
- cuts[2] = 0.7;
- cuts[3] = 500;
- cuts[4] = -15000;
- cuts[5] = 0.8;
+
+ //coutputmassD02
+ cuts[0] = 200;
+ cuts[1] = 0.8;
+ cuts[2] = 0.7;
+ cuts[3] = 500;
+ cuts[4] = -15000;
+ cuts[5] = 0.8;
+ /*
+ //PPR
+ cuts[0] = 200;
+ cuts[1] = 0.8;
+ cuts[2] = 0.7;
+ cuts[3] = 500;
+ cuts[4] = -10000;
+ cuts[5] = 0.8;
+ */
}
-// else if (pt > 3 && pt <= 5){
-// cuts[0] = 200;
-// cuts[1] = 0.8;
-// cuts[2] = 0.7;
-// cuts[3] = 500;
-// cuts[4] = -10000;
-// cuts[5] = 0.8;
-// }
else if (pt > 5){
- cuts[0] = 200;
- cuts[1] = 0.8;
- cuts[2] = 0.7;
- cuts[3] = 500;
- cuts[4] = -15000;
- cuts[5] = 0.9;
+
+ //coutputmassD02
+ cuts[0] = 200;
+ cuts[1] = 0.8;
+ cuts[2] = 0.7;
+ cuts[3] = 500;
+ cuts[4] = -15000;
+ cuts[5] = 0.9;
+ /*
+ //PPR
+ cuts[0] = 200;
+ cuts[1] = 0.8;
+ cuts[2] = 0.7;
+ cuts[3] = 500;
+ cuts[4] = -5000;
+ cuts[5] = 0.8;
+ */
}
Double_t mD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass();
corr2->Draw("text");
- TFile* file_projection = new TFile("file_projection.root","RECREATE");
+ TFile* file_projection = new TFile("CFtaskHFprojection.root","RECREATE");
corr1->Write();
corr2->Write();
c2->SaveAs("Plots/pTpi_pTK_cT.gif");
c3->SaveAs("Plots/dca_d0pi_d0TK.gif");
c4->SaveAs("Plots/d0xd0_cosPointingAngle.gif");
- */
+ */
}
//___________________________________________________________________________
//slot #1
OpenFile(1);
- fHistEventsProcessed = new TH1I("fHistEventsProcessed","",1,0,1) ;
+ fHistEventsProcessed = new TH1I("CFHFchist0","",1,0,1) ;
}
//___________________________________________________________________________