#include <Riostream.h>
#include "AliCascadeVertexer.h"
#include "TFile.h"
+ #include "TKey.h"
#include "TStopwatch.h"
#include "AliRun.h"
+ #include "AliMagF.h"
+ #include "AliESD.h"
+ #include "AliKalmanTrack.h"
#include "AliRunLoader.h"
- #include "AliITSLoader.h"
#endif
Int_t AliCascadeFindVertices(Int_t nev=5) {
cerr<<"AliCascadeFindVertices.C : Can not open session RL=NULL"<< endl;
return 1;
}
- AliITSLoader* itsl = (AliITSLoader*)rl->GetLoader("ITSLoader");
- if (itsl == 0x0) {
- cerr<<"AliCascadeFindVertices.C : Can not get ITS loader"<<endl;
- return 2;
+
+ if (rl->LoadgAlice()) {
+ cerr<<"AliV0FindVertices.C : LoadgAlice returned error"<<endl;
+ delete rl;
+ return 3;
}
- itsl->LoadTracks("read");
- itsl->LoadV0s("read");
- itsl->LoadCascades("recreate");
+ AliKalmanTrack::SetConvConst(
+ 1000/0.299792458/rl->GetAliRun()->Field()->SolenoidField()
+ );
+
Double_t cuts[]={33., // max. allowed chi2
0.05, // min. allowed V0 impact parameter
0.008, // window around the Lambda mass
0.035, // min. allowed bachelor's impact parameter
0.10, // max. allowed DCA between a V0 and a track
- 0.9985, // max. allowed cosine of the cascade pointing angle
+ 0.9985,// max. allowed cosine of the cascade pointing angle
0.9, // min. radius of the fiducial volume
2.9 // max. radius of the fiducial volume
};
TStopwatch timer;
AliCascadeVertexer *vertexer=new AliCascadeVertexer(cuts);
+
Int_t rc=0;
if (nev>rl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents();
- for (Int_t i=0; i<nev; i++) {
- rl->GetEvent(i);
- TTree *tTree=itsl->TreeT();
- if (!tTree) {
- cerr<<"AliCascadeFindVertices.C : Can't get the ITS track tree !"<<endl;
- return 3;
- }
- TTree *vTree=itsl->TreeV0();
- if (!vTree) {
- cerr<<"AliCascadeFindVertices.C : Can't get the V0 tree !"<<endl;
- return 4;
- }
- TTree *xTree=itsl->TreeX();
- if (!xTree) {
- itsl->MakeTree("X");
- xTree=itsl->TreeX();
- }
+ TFile *casf=TFile::Open("AliESDcas.root","RECREATE");
+ if ((!casf)||(!casf->IsOpen())) {
+ cerr<<"Can't AliESDcas.root !\n"; return 1;
+ }
+ TFile *v0f=TFile::Open("AliESDv0.root");
+ if ((!v0f)||(!v0f->IsOpen())) {
+ cerr<<"Can't AliESDv0.root !\n"; return 1;
+ }
+
+ TKey *key=0;
+ TIter next(v0f->GetListOfKeys());
+ for (Int_t i=0; i<nev; i++) {
+ v0f->cd();
+ if ((key=(TKey*)next())==0) break;
+ cerr<<"Processing event number: "<<i<<endl;
+ AliESD *event=(AliESD*)key->ReadObj();
- rc=vertexer->V0sTracks2CascadeVertices(vTree,tTree,xTree);
+ rc=vertexer->V0sTracks2CascadeVertices(event);
- itsl->WriteCascades("OVERWRITE");
+ if (rc==0) {
+ Char_t ename[100];
+ sprintf(ename,"%d",i);
+ casf->cd();
+ if (!event->Write(ename)) rc++;
+ }
+ if (rc) {
+ cerr<<"Something bad happened...\n";
+ }
+ delete event;
}
delete vertexer;
timer.Stop(); timer.Print();
+ v0f->Close();
+ casf->Close();
+
delete rl;
return rc;
#if !defined(__CINT__) || defined(__MAKECINT__)
#include "Riostream.h"
-
+ #include "TKey.h"
#include "TStopwatch.h"
#include "AliRun.h"
+ #include "AliMagF.h"
#include "AliRunLoader.h"
#include "AliTPCLoader.h"
#include "AliITSLoader.h"
#include "AliITS.h"
#include "AliITSgeom.h"
#include "AliITStrackerV2.h"
+ #include "AliESD.h"
#endif
extern AliRun *gAlice;
return 3;
}
- Int_t retval = rl->LoadgAlice();
- if (retval) {
- cerr<<"AliITSFindTracksV2.C : LoadgAlice returned error"<<endl;
- delete rl;
- return 3;
- }
- retval = rl->LoadHeader();
- if (retval) {
- cerr<<"AliITSFindTracksV2.C : LoadHeader returned error"<<endl;
- delete rl;
- return 3;
- }
- gAlice=rl->GetAliRun();
-
AliITSLoader* itsl = (AliITSLoader*)rl->GetLoader("ITSLoader");
if (itsl == 0x0) {
cerr<<"AliITSFindTracksV2.C : Can not get ITS loader"<<endl;
return 4;
}
- AliTPCLoader* tpcl = (AliTPCLoader*)rl->GetLoader("TPCLoader");
- if (tpcl == 0x0) {
- cerr<<"AliITSFindTracksV2.C : can not get TPC loader"<<endl;
- return 5;
+ if (rl->LoadgAlice()) {
+ cerr<<"AliITSFindTracksV2.C : LoadgAlice returned error"<<endl;
+ delete rl;
+ return 3;
}
- AliITS *dITS = (AliITS*)gAlice->GetDetector("ITS");
+ AliKalmanTrack::SetConvConst(
+ 1000/0.299792458/rl->GetAliRun()->Field()->SolenoidField()
+ );
+
+ AliITS *dITS = (AliITS*)rl->GetAliRun()->GetDetector("ITS");
if (!dITS) {
cerr<<"AliITSFindClusters.C : Can not find the ITS detector !"<<endl;
return 6;
AliITStrackerV2 tracker(geom);
- tpcl->LoadTracks("read");
- itsl->LoadTracks("recreate");
itsl->LoadRecPoints("read");
- TStopwatch timer;
if (nev>rl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents();
Int_t rc=0;
+
+ TFile *itsf=TFile::Open("AliESDits.root","RECREATE");
+ if ((!itsf)||(!itsf->IsOpen())) {
+ cerr<<"Can't AliESDits.root !\n"; return 1;
+ }
+ TFile *tpcf=TFile::Open("AliESDtpc.root");
+ if ((!tpcf)||(!tpcf->IsOpen())) {
+ cerr<<"Can't AliESDtpc.root !\n"; return 1;
+ }
+ TKey *key=0;
+ TIter next(tpcf->GetListOfKeys());
+ TStopwatch timer;
for (Int_t i=0; i<nev; i++) {
+ tpcf->cd();
+ if ((key=(TKey*)next())==0) break;
cerr<<"Processing event number: "<<i<<endl;
+ AliESD *event=(AliESD*)key->ReadObj();
+
rl->GetEvent(i);
TTree *cTree=itsl->TreeR();
cerr<<"AliITSFindTracksV2.C : Can't get the clusters tree !"<<endl;
return 4;
}
- TTree *tpcTree=tpcl->TreeT();
- if (!tpcTree) {
- cerr<<"AliITSFindTracksV2.C : Can't get the TPC track tree !"<<endl;
- return 4;
- }
- TTree *itsTree=itsl->TreeT();
- if (!itsTree) {
- itsl->MakeTree("T");
- itsTree=itsl->TreeT();
- }
tracker.LoadClusters(cTree);
- rc=tracker.Clusters2Tracks(tpcTree,itsTree);
+ rc=tracker.Clusters2Tracks(event);
tracker.UnloadClusters();
- itsl->WriteTracks("OVERWRITE");
+ if (rc==0) {
+ Char_t ename[100];
+ sprintf(ename,"%d",i);
+ itsf->cd();
+ if (!event->Write(ename)) rc++;
+ }
+ if (rc) {
+ cerr<<"Something bad happened...\n";
+ }
+ delete event;
}
timer.Stop(); timer.Print();
+ tpcf->Close();
+ itsf->Close();
+
delete rl;
return rc;
AliITSSDigits2Digits();
}
gROOT->LoadMacro("$(ALICE_ROOT)/ITS/AliITSFindClustersV2.C");
- if (rc=AliITSFindClustersV2(SlowOrFast)) return rc;
+ if (rc=AliITSFindClustersV2(nev,SlowOrFast)) return rc;
gROOT->LoadMacro("$(ALICE_ROOT)/ITS/AliITSFindTracksV2.C");
if (rc=AliITSFindTracksV2()) return rc;
+/****************************************************************************
+ * Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch *
+ ****************************************************************************/
+
#if !defined(__CINT__) || defined(__MAKECINT__)
#include "Riostream.h"
#include "AliV0vertexer.h"
#include "TFile.h"
+ #include "TKey.h"
#include "TStopwatch.h"
#include "AliRun.h"
+ #include "AliKalmanTrack.h"
+ #include "AliMagF.h"
+ #include "AliESD.h"
#include "AliRunLoader.h"
- #include "AliITSLoader.h"
#endif
extern AliRun *gAlice;
delete gAlice;
gAlice=0;
}
+
AliRunLoader* rl = AliRunLoader::Open("galice.root");
if (rl == 0x0) {
cerr<<"AliV0FindVertices.C : Can not open session RL=NULL"<< endl;
return 1;
}
- AliITSLoader* itsl = (AliITSLoader*)rl->GetLoader("ITSLoader");
- if (itsl == 0x0) {
- cerr<<"AliV0FindVertices.C : Can not get ITS loader"<<endl;
- return 2;
+
+ if (rl->LoadgAlice()) {
+ cerr<<"AliV0FindVertices.C : LoadgAlice returned error"<<endl;
+ delete rl;
+ return 3;
}
- itsl->LoadTracks("read");
- itsl->LoadV0s("recreate");
+ AliKalmanTrack::SetConvConst(
+ 1000/0.299792458/rl->GetAliRun()->Field()->SolenoidField()
+ );
+
Double_t cuts[]={33, // max. allowed chi2
0.16,// min. allowed negative daughter's impact parameter
0.05,// min. allowed positive daughter's impact parameter
AliV0vertexer vtxer(cuts);
Int_t rc=0;
if (nev>rl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents();
+
+ TFile *v0f=TFile::Open("AliESDv0.root","RECREATE");
+ if ((!v0f)||(!v0f->IsOpen())) {
+ cerr<<"Can't AliESDv0.root !\n"; return 1;
+ }
+ TFile *itsf=TFile::Open("AliESDits.root");
+ if ((!itsf)||(!itsf->IsOpen())) {
+ cerr<<"Can't AliESDits.root !\n"; return 1;
+ }
+ TKey *key=0;
+ TIter next(itsf->GetListOfKeys());
for (Int_t i=0; i<nev; i++) {
- rl->GetEvent(i);
- //Double_t vtx[3]={0.,0.,0.}; vtxer.SetVertex(vtx); // primary vertex (cm)
+ itsf->cd();
+ if ((key=(TKey*)next())==0) break;
+ cerr<<"Processing event number: "<<i<<endl;
+ AliESD *event=(AliESD*)key->ReadObj();
- TTree *tTree=itsl->TreeT();
- if (!tTree) {
- cerr<<"AliV0FindVertices.C : Can't get the ITS track tree !"<<endl;
- return 3;
- }
- TTree *vTree=itsl->TreeV0();
- if (!vTree) {
- itsl->MakeTree("V0");
- vTree=itsl->TreeV0();
- }
+ //Double_t vtx[3]={0.,0.,0.}; vtxer.SetVertex(vtx); // primary vertex (cm)
- rc=vtxer.Tracks2V0vertices(tTree,vTree);
+ rc=vtxer.Tracks2V0vertices(event);
- itsl->WriteV0s("OVERWRITE");
+ if (rc==0) {
+ Char_t ename[100];
+ sprintf(ename,"%d",i);
+ v0f->cd();
+ if (!event->Write(ename)) rc++;
+ }
+ if (rc) {
+ cerr<<"Something bad happened...\n";
+ }
+ delete event;
}
timer.Stop(); timer.Print();
+ itsf->Close();
+ v0f->Close();
+
delete rl;
return rc;
#include "AliMagF.h"
#include "AliRunLoader.h"
#include "AliTPCLoader.h"
+ #include "AliESD.h"
#include "TFile.h"
#include "TStopwatch.h"
cerr<<"Error occured while loading gAlice"<<endl;
return 1;
}
+
AliKalmanTrack::SetConvConst(
- 1000/0.299792458/rl->GetAliRun()->Field()->SolenoidField()
+ 1000/0.299792458/rl->GetAliRun()->Field()->SolenoidField()
);
+
rl->CdGAFile();
AliTPCParam *dig=(AliTPCParam *)gDirectory->Get("75x40_100x60_150x60");
if (!dig) {
return 1;
}
- rl->UnloadgAlice();
+ //rl->UnloadgAlice();
tpcl->LoadRecPoints("read");
- tpcl->LoadTracks("recreate");
if (nev>rl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents();
+ TFile *ef=TFile::Open("AliESDtpc.root","RECREATE");
+ if ((!ef)||(!ef->IsOpen())) {
+ cerr<<"Can't AliESDtpc.root !\n"; return 1;
+ }
TStopwatch timer;
Int_t rc=0;
AliTPCtracker tracker(dig);
for (Int_t i=0;i<nev;i++){
printf("Processing event %d\n",i);
+ AliESD *event=new AliESD();
rl->GetEvent(i);
TTree *in=tpcl->TreeR();
return 4;
}
- TTree *out=tpcl->TreeT();
- if (!out) {
- tpcl->MakeTree("T");
- out=tpcl->TreeT();
+ tracker.LoadClusters(in);
+ rc=tracker.Clusters2Tracks(event);
+ tracker.UnloadClusters();
+
+ if (rc==0) {
+ Char_t ename[100];
+ sprintf(ename,"%d",i);
+ ef->cd();
+ if (!event->Write(ename)) rc++;
+ }
+ if (rc) {
+ cerr<<"Something bad happened...\n";
}
-
- rc=tracker.Clusters2Tracks(in,out);
-
- tpcl->WriteTracks("OVERWRITE");
+ delete event;
}
timer.Stop(); timer.Print();
+ ef->Close();
+
delete dig; //Thanks to Mariana Bondila
delete rl;