#include "AliRunLoader.h"
#include "AliRun.h"
#include "AliESDEvent.h"
+ #include "AliESDtrack.h"
#include "AliSimDigits.h"
#include "AliTPC.h"
#include "AliTPCClustersRow.h"
#include "AliTPCcluster.h"
#include "AliTPCLoader.h"
+
+ #include "AliCDBManager.h"
+ #include "AliTPCcalibDB.h"
#endif
Int_t GoodTracksTPC(const Char_t *dir=".");
-extern AliRun *gAlice;
extern TBenchmark *gBenchmark;
extern TROOT *gROOT;
Int_t GoodTracksTPC(const Char_t *dir) {
- if (gAlice) {
- delete gAlice->GetRunLoader();
- delete gAlice;//if everything was OK here it is already NULL
- gAlice = 0x0;
- }
-
Char_t fname[100];
sprintf(fname,"%s/galice.root",dir);
return 3;
}
- rl->CdGAFile();
- AliTPCParamSR *digp=(AliTPCParamSR*)gDirectory->Get("75x40_100x60_150x60");
+
+ AliCDBManager *man=AliCDBManager::Instance();
+ man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+ man->SetRun(0);
+ AliTPCParamSR *digp=
+ (AliTPCParamSR*)(AliTPCcalibDB::Instance()->GetParameters());
if (!digp) {
- ::Error("AliTPCHits2Digits.C","TPC parameters have not been found !");
+ ::Error("AliTPCComparison.C","TPC parameters have not been found !");
delete rl;
return 4;
}
- TPC->SetParam(digp);
Int_t nrow_up=digp->GetNRowUp();
Int_t nrows=digp->GetNRowLow()+nrow_up;
if (p->Pt()<0.100) continue;
if (TMath::Abs(p->Pz()/p->Pt())>0.999) continue;
- Double_t vx=p->Vx(),vy=p->Vy();
+ Double_t vx=p->Vx(),vy=p->Vy(),vz=p->Vz();
if (TMath::Sqrt(vx*vx+vy*vy)>3.5) continue;
+ if (TMath::Abs(vz) > 50.) continue;
AliTrackReference *ref=new((*refs)[nt]) AliTrackReference();
//**** check if there is also information at the entrance of the TPC
TTree *TR=rl->TreeTR();
- TBranch *branch=TR->GetBranch("TPC");
+ TBranch *branch=TR->GetBranch("TrackReferences");
if (branch==0) {
::Error("GoodTracksTPC","No track references !");
delete rl;
for (Int_t r=0; r<nr; r++) {
//cerr<<r<<' '<<nr<<'\r';
TR->GetEvent(r);
- if (tpcRefs->GetEntriesFast()==0) continue;
- AliTrackReference *tpcRef=(AliTrackReference*)tpcRefs->UncheckedAt(0);
+
+ Int_t nref = tpcRefs->GetEntriesFast();
+ if (!nref) continue;
+ AliTrackReference *tpcRef= 0x0;
+ for (Int_t iref=0; iref<nref; ++iref) {
+ tpcRef = (AliTrackReference*)tpcRefs->UncheckedAt(iref);
+ if (tpcRef->DetectorId() == AliTrackReference::kTPC) break;
+ tpcRef = 0x0;
+ }
+
+ if (!tpcRef) continue;
+
Int_t j;
AliTrackReference *ref=0;
for (j=0; j<nt; j++) {