//----------------------------------------------------------------------------
// Implementation of the D0toKpi reconstruction and analysis class
-//
// Note: the two decay tracks are labelled: 0 (positive track)
// 1 (negative track)
-//
+// An example of usage can be found in the macro AliD0toKpiTest.C
// Origin: A. Dainese andrea.dainese@pd.infn.it
//----------------------------------------------------------------------------
-#include <Riostream.h>
-#include <TH1.h>
-#include <TH2.h>
#include <TKey.h>
#include <TFile.h>
#include <TTree.h>
#include "AliV0vertex.h"
#include "AliD0toKpi.h"
#include "AliD0toKpiAnalysis.h"
+#include "AliLog.h"
typedef struct {
Int_t lab;
AliD0toKpiAnalysis::AliD0toKpiAnalysis() {
// Default constructor
- SetBz();
+ fBz=-9999;
SetPtCut();
Setd0Cut();
SetMassCut();
fVertexOnTheFly = kFALSE;
fSim = kFALSE;
fOnlySignal = kFALSE;
- fDebug = kFALSE;
}
//----------------------------------------------------------------------------
AliD0toKpiAnalysis::~AliD0toKpiAnalysis() {}
printf("AliD0toKpiAnalysis::FindCandidates(): Set B!\n");
return;
}
- AliKalmanTrack::SetConvConst(100/0.299792458/fBz);
TString trkName("AliITStracksV2.root");
if(gSystem->AccessPathName(trkName.Data(),kFileExists)) {
// (it will be used only if fVertexOnTheFly=kTrue)
AliITSVertexerTracks *vertexer1 = new AliITSVertexerTracks;
vertexer1->SetMinTracks(2);
- vertexer1->SetDebug(0);
Int_t skipped[2];
Bool_t goodVtx1;
printf("AliD0toKpiAnalysis::FindCandidatesESD(): Set B!\n");
return;
}
- AliKalmanTrack::SetConvConst(100/0.299792458/fBz);
TString esdName("AliESDs.root");
if(gSystem->AccessPathName(esdName.Data(),kFileExists)) {
// (it will be used only if fVertexOnTheFly=kTrue)
AliITSVertexerTracks *vertexer1 = new AliITSVertexerTracks;
vertexer1->SetMinTracks(2);
- vertexer1->SetDebug(0);
Int_t skipped[2];
Bool_t goodVtx1;
// open file with tracks
TFile *esdFile = TFile::Open(esdName.Data());
+ AliESD* event = new AliESD;
+ TTree* tree = (TTree*) esdFile->Get("esdTree");
+ if (!tree) {
+ Error("FindCandidatesESD", "no ESD tree found");
+ return;
+ }
+ tree->SetBranchAddress("ESD", &event);
- TKey *key=0;
- TIter next(esdFile->GetListOfKeys());
// loop on events in file
- while ((key=(TKey*)next())!=0) {
- AliESD *event=(AliESD*)key->ReadObj();
+ for (Int_t iEvent = evFirst; iEvent < tree->GetEntries(); iEvent++) {
+ if (iEvent > evLast) break;
+ tree->GetEvent(iEvent);
Int_t ev = (Int_t)event->GetEventNumber();
- if(ev<evFirst || ev>evLast) { delete event; continue; }
printf("--- Finding D0 -> Kpi in event %d\n",ev);
// retrieve primary vertex from file
trksN,trkEntryN,nTrksN);
}
- if(fDebug) printf(" pos. tracks: %d neg .tracks: %d\n",nTrksP,nTrksN);
+ AliDebugClass(1,Form(" pos. tracks: %d neg .tracks: %d",nTrksP,nTrksN));
nD0rec1ev = 0;
// loop on positive tracks
for(iTrkP=0; iTrkP<nTrksP; iTrkP++) {
- if((iTrkP%10==0) || fDebug) printf(" Processing positive track number %d of %d\n",iTrkP,nTrksP);
+ if(iTrkP%10==0) AliDebugClass(1,Form(" Processing positive track number %d of %d",iTrkP,nTrksP));
// get track from track array
postrack = (AliITStrackV2*)trksP.UncheckedAt(iTrkP);
delete [] trkEntryP;
delete [] trkEntryN;
delete trkTree;
- delete event;
printf(" Number of D0 candidates: %d\n",nD0rec1ev);
// transfer ITS tracks from ESD to arrays and to a tree
for(Int_t i=0; i<entr; i++) {
- //if(fDebug) printf(" SelectTracksESD: %d/%d\n",i,entr);
AliESDtrack *esdtrack = (AliESDtrack*)event.GetTrack(i);
UInt_t status = esdtrack->GetStatus();