#include "TParticle.h"
#endif
-struct GoodTrack {
+struct GoodTrackITS {
+ Int_t event;
Int_t lab;
Int_t code;
Float_t px,py,pz;
Float_t x,y,z;
};
-Int_t good_tracks(GoodTrack *gt, Int_t max);
Int_t AliITSComparisonV2() {
+ Int_t good_tracks_its(GoodTrackITS *gt, Int_t max);
+
cerr<<"Doing comparison...\n";
TFile *cf=TFile::Open("AliITSclustersV2.root");
TFile *tf=TFile::Open("AliITStracksV2.root");
if (!tf->IsOpen()) {cerr<<"Can't open AliITStracksV2.root !\n"; return 3;}
TObjArray tarray(2000);
- TTree *tracktree=(TTree*)tf->Get("ITSf");
+ TTree *tracktree=(TTree*)tf->Get("TreeT_ITS_0");
if (!tracktree) {cerr<<"Can't get a tree with ITS tracks !\n"; return 4;}
TBranch *tbranch=tracktree->GetBranch("tracks");
Int_t nentr=(Int_t)tracktree->GetEntries(),i;
}
*/
tarray.AddLast(iotrack);
- }
+ }
+ delete tracktree; //Thanks to Mariana Bondila
tf->Close();
+ delete geom; //Thanks to Mariana Bondila
cf->Close();
/////////////////////////////////////////////////////////////////////////
- GoodTrack gt[15000];
+ const Int_t MAX=15000;
+ GoodTrackITS gt[MAX];
Int_t ngood=0;
ifstream in("good_tracks_its");
if (in) {
cerr<<"Reading good tracks...\n";
- while (in>>gt[ngood].lab>>gt[ngood].code>>
+ while (in>>gt[ngood].event>>gt[ngood].lab>>gt[ngood].code>>
gt[ngood].px>>gt[ngood].py>>gt[ngood].pz>>
gt[ngood].x >>gt[ngood].y >>gt[ngood].z) {
ngood++;
cerr<<ngood<<'\r';
- if (ngood==15000) {
+ if (ngood==MAX) {
cerr<<"Too many good tracks !\n";
break;
}
if (!in.eof()) cerr<<"Read error (good_tracks_its) !\n";
} else {
cerr<<"Marking good tracks (this will take a while)...\n";
- ngood=good_tracks(gt,15000);
+ ngood=good_tracks_its(gt,MAX);
ofstream out("good_tracks_its");
if (out) {
- for (Int_t ngd=0; ngd<ngood; ngd++)
- out<<gt[ngd].lab<<' '<<gt[ngd].code<<' '<<
- gt[ngd].px<<' '<<gt[ngd].py<<' '<<gt[ngd].pz<<' '<<
- gt[ngd].x <<' '<<gt[ngd].y <<' '<<gt[ngd].z <<endl;
+ for (Int_t ngd=0; ngd<ngood; ngd++)
+ out<<gt[ngd].event<<' '<<gt[ngd].lab<<' '<<gt[ngd].code<<' '
+ <<gt[ngd].px<<' '<<gt[ngd].py<<' '<<gt[ngd].pz<<' '
+ <<gt[ngd].x <<' '<<gt[ngd].y <<' '<<gt[ngd].z <<endl;
} else cerr<<"Can not open file (good_tracks_its) !\n";
out.close();
}
return 0;
}
-Int_t good_tracks(GoodTrack *gt, Int_t max) {
+Int_t good_tracks_its(GoodTrackITS *gt, Int_t max) {
if (gAlice) {delete gAlice; gAlice=0;}
TFile *file=TFile::Open("galice.root");
}
AliITSgeom *geom=ITS->GetITSgeom();
if (!geom) {
- cerr<<"cen't get ITS geometry !\n"; exit(9);
+ cerr<<"can't get ITS geometry !\n"; exit(9);
}
TFile *cf=TFile::Open("AliITSclustersV2.root");
if (!cf->IsOpen()){
cerr<<"Can't open AliITSclustersV2.root !\n"; exit(6);
}
- TTree *cTree=(TTree*)cf->Get("cTree");
+ TTree *cTree=(TTree*)cf->Get("TreeC_ITS_0");
if (!cTree) {
cerr<<"Can't get cTree !\n"; exit(7);
}
Int_t entr=(Int_t)cTree->GetEntries();
for (k=0; k<entr; k++) {
- if (!cTree->GetEvent(k)) continue;
+ cTree->GetEvent(k);
+ Int_t ncl=clusters->GetEntriesFast(); if (ncl==0) continue;
Int_t lay,lad,det; geom->GetModuleId(k,lay,lad,det);
if (lay<1 || lay>6) {
cerr<<"wrong layer !\n"; exit(10);
}
- Int_t ncl=clusters->GetEntriesFast();
while (ncl--) {
AliITSclusterV2 *pnt=(AliITSclusterV2*)clusters->UncheckedAt(ncl);
Int_t l0=pnt->GetLabel(0);
}
}
clusters->Delete(); delete clusters;
+ delete cTree; //Thanks to Mariana Bondila
cf->Close();
ifstream in("good_tracks_tpc");
}
Int_t nt=0;
Double_t px,py,pz,x,y,z;
- Int_t code,lab;
- while (in>>lab>>code>>px>>py>>pz>>x>>y>>z) {
+ Int_t code,lab,event;
+ while (in>>event>>lab>>code>>px>>py>>pz>>x>>y>>z) {
if (good[lab] != 0x3F) continue;
TParticle *p = (TParticle*)gAlice->Particle(lab);
+ gt[nt].event=event;
gt[nt].lab=lab;
gt[nt].code=p->GetPdgCode();
//**** px py pz - in global coordinate system
#ifndef __CINT__
+ #include <iostream.h>
+
#include "AliRun.h"
#include "AliITS.h"
#include "AliITSgeom.h"
gAlice->MakeTree("R"); ITS->MakeBranch("R",0);
//////////////// Taken from ITSHitsToFastPoints.C ///////////////////////
- AliITSsimulationFastPoints *sim = new AliITSsimulationFastPoints();
- for (Int_t i=0;i<3;i++) { ITS->SetSimulationModel(i,sim); }
-
+ ITS->SetSimulationModel(0,new AliITSsimulationFastPoints());
+ ITS->SetSimulationModel(1,new AliITSsimulationFastPoints());
+ ITS->SetSimulationModel(2,new AliITSsimulationFastPoints());
Int_t nsignal=25;
Int_t size=-1;
Int_t bgr_ev=Int_t(ev/nsignal);
ITS->HitsToFastRecPoints(ev,bgr_ev,size," ","All"," ");
//////////////////////////////////////////////////////////////////////////
+
delete gAlice; gAlice=0;
in->Close();
geom->Write();
TClonesArray *clusters=new TClonesArray("AliITSclusterV2",10000);
- TTree *cTree=new TTree("cTree","ITS clusters");
+ //TTree *cTree=new TTree("cTree","ITS clusters");
+ TTree *cTree=new TTree("TreeC_ITS_0","ITS clusters");
cTree->Branch("Clusters",&clusters);
TTree *pTree=gAlice->TreeR();
- if (!pTree) {
+ if (!pTree) {
cerr<<"Can't get TreeR !\n";
return 7;
}
cerr<<"Number of entries: "<<nentr<<endl;
for (Int_t i=0; i<nentr; i++) {
- if (!pTree->GetEvent(i)) {cTree->Fill(); continue;}
+ points->Clear();
+ pTree->GetEvent(i);
+ Int_t ncl=points->GetEntriesFast(); if (ncl==0){cTree->Fill();continue;}
Int_t lay,lad,det; geom->GetModuleId(i,lay,lad,det);
Float_t x,y,zshift; geom->GetTrans(lay,lad,det,x,y,zshift);
Double_t rot[9]; geom->GetRotMatrix(lay,lad,det,rot);
Double_t yshift = x*rot[0] + y*rot[1];
Int_t ndet=(lad-1)*geom->GetNdetectors(lay) + (det-1);
- Int_t ncl=points->GetEntriesFast();
nclusters+=ncl;
for (Int_t j=0; j<ncl; j++) {
AliITSRecPoint *p=(AliITSRecPoint*)points->UncheckedAt(j);
delete cTree; delete clusters; delete points;
delete gAlice; gAlice=0;
+
in->Close();
out->Close();
return 0;
+
}
Int_t rc=tracker.Clusters2Tracks(in,out);
timer.Stop(); timer.Print();
+ delete geom; //Thanks to Mariana Bondila
+
file->Close();
in->Close();
out->Close();
try {
//Read clusters
- //MI change
- char cname[100];
- sprintf(cname,"TreeC_ITS_%d",eventn);
+ //MI change
+ char cname[100];
+ sprintf(cname,"TreeC_ITS_%d",eventn);
TTree *cTree=(TTree*)gDirectory->Get(cname);
- // TTree *cTree=(TTree*)gDirectory->Get("cTree");
if (!cTree) throw
("AliITStrackerV2::AliITStrackerV2 can't get cTree !\n");
Int_t nentr=(Int_t)cTree->GetEntries();
for (i=0; i<nentr; i++) {
if (!cTree->GetEvent(i)) continue;
- //Int_t lay,lad,det; g->GetModuleId(i-1,lay,lad,det);
Int_t lay,lad,det; g->GetModuleId(i,lay,lad,det);
Int_t ncl=clusters->GetEntriesFast();
while (ncl--) {
}
clusters->Delete();
}
+ delete cTree; //Thanks to Mariana Bondila
}
catch (const Char_t *msg) {
cerr<<msg<<endl;
char tname[100];
sprintf(tname,"TreeT_TPC_%d",fEventN);
TTree *tpcTree=(TTree*)in->Get(tname);
- //TTree *tpcTree=(TTree*)in->Get("TPCf");
if (!tpcTree) {
cerr<<"AliITStrackerV2::Clusters2Tracks() ";
cerr<<"Number of TPC tracks: "<<nentr<<endl;
cerr<<"Number of prolonged tracks: "<<ntrk<<endl;
+ delete tpcTree; //Thanks to Mariana Bondila
+
delete itrack;
return 0;
}
in->cd();
- TTree *itsTree=(TTree*)in->Get("ITSf");
+ TTree *itsTree=(TTree*)in->Get("TreeT_ITS_0");
if (!itsTree) {
cerr<<"AliITStrackerV2::PropagateBack() ";
cerr<<"can't get a tree with ITS tracks !\n";
itsTree->SetBranchAddress("tracks",&itrack);
out->cd();
- TTree backTree("ITSb","Tree with back propagated ITS tracks");
+ TTree backTree("TreeT_ITSb_0","Tree with back propagated ITS tracks");
AliTPCtrack *otrack=0;
backTree.Branch("tracks","AliTPCtrack",&otrack,32000,0);
delete itrack;
+ delete itsTree; //Thanks to Mariana Bondila
+
return 0;
}
//--------------------------------------------------------------------
fN=0;
fDetectors=0;
+ for (Int_t i=0; i<kMaxClusterPerLayer; i++) fClusters[i]=0;
}
AliITStrackerV2::AliITSlayer::
fR=r; fPhiOffset=p; fZOffset=z;
fNladders=nl; fNdetectors=nd;
fDetectors=new AliITSdetector[fNladders*fNdetectors];
+ for (Int_t i=0; i<kMaxClusterPerLayer; i++) fClusters[i]=0;
fN=0;
fI=0;
//This function returns the thickness of this layer
//--------------------------------------------------------------------
//-pi<phi<+pi
- if (3 <fR&&fR<8 ) return 1.1*0.096;
+ if (3 <fR&&fR<8 ) return 2.2*0.096;
if (13<fR&&fR<26) return 1.1*0.088;
if (37<fR&&fR<41) return 1.1*0.085;
return 1.1*0.081;
class AliITStrackerV2 : public AliTracker {
public:
AliITStrackerV2():AliTracker(){}
- AliITStrackerV2(const AliITSgeom *geom, Int_t event) throw (const Char_t *);
+ AliITStrackerV2(const AliITSgeom *geom, Int_t event=0) throw (const Char_t *);
AliCluster *GetCluster(Int_t index) const;
Int_t Clusters2Tracks(const TFile *in, TFile *out);