if( (i=OpenFiles(aTracksFile,aClustersFile,aGAliceFile,currentdir)) )
{
Error("Read","Exiting due to problems with opening files. Errorcode %d",i);
- delete iotrack;
- return i;
+ currentdir++;
+ continue;
}
if (gAlice->TreeE())//check if tree E exists
Nevents = (Int_t)gAlice->TreeE()->GetEntries();//if yes get number of events in gAlice
cout<<"________________________________________________________\n";
cout<<"Found "<<Nevents<<" event(s) in directory "<<GetDirName(currentdir)<<endl;
- cout<<"Setting Magnetic Field. Factor is "<<gAlice->Field()->Factor()<<endl;
- AliKalmanTrack::SetConvConst(100/0.299792458/0.2/gAlice->Field()->Factor());
+ cout<<"Setting Magnetic Field: B="<<gAlice->Field()->SolenoidField()<<"T"<<endl;
+ AliKalmanTrack::SetConvConst(1000/0.299792458/gAlice->Field()->SolenoidField());
}
else
{//if not return an error
Error("Read","Can not find Header tree (TreeE) in gAlice");
- delete iotrack;
- return 1;
+ currentdir++;
+ continue;
}
AliITSgeom *geom=(AliITSgeom*)aClustersFile->Get("AliITSgeom");
if (!geom)
{
Error("Read","Can't get the ITS geometry!");
- delete iotrack;
- return 2;
+ currentdir++;
+ continue;
}
for(Int_t currentEvent =0; currentEvent<Nevents;currentEvent++)//loop over all events
aGAliceFile->cd();
gAlice->GetEvent(currentEvent);
-// TParticle * part = gAlice->Particle(0);
-
aClustersFile->cd();
-// Double_t orz=part->Vz();
-// tracker = new AliITStrackerV2(geom,currentEvent,orz); //<---- this is for Massimo version
-// tracker = new AliITStrackerV2(geom,currentEvent);
sprintf(tname,"TreeT_ITS_%d",currentEvent);
tracktree=(TTree*)aTracksFile->Get(tname);
if (!tracktree)
{
Error("Read","Can't get a tree with ITS tracks");
- delete iotrack;
- // delete tracker;
- return 4;
+ continue;
}
TBranch *tbranch=tracktree->GetBranch("tracks");
if( (i=OpenFiles(aTracksFile,aClustersFile,aGAliceFile,currentdir)) )
{
Error("Read","Exiting due to problems with opening files. Errorcode %d",i);
- return i;
+ currentdir++;
+ continue;
}
Nevents = (Int_t)gAlice->TreeE()->GetEntries();//if yes get number of events in gAlice
cout<<"________________________________________________________\n";
cout<<"Found "<<Nevents<<" event(s) in directory "<<GetDirName(currentdir)<<endl;
- cout<<"Setting Magnetic Field. Factor is "<<gAlice->Field()->Factor()<<endl;
- AliKalmanTrack::SetConvConst(100/0.299792458/0.2/gAlice->Field()->Factor());
+ cout<<"Setting Magnetic Field: B="<<gAlice->Field()->SolenoidField()<<"T"<<endl;
+ AliKalmanTrack::SetConvConst(1000/0.299792458/gAlice->Field()->SolenoidField());
}
else
{//if not return an error
Error("Read","Can not find Header tree (TreeE) in gAlice");
- return 1;
+ currentdir++;
+ continue;
}
aClustersFile->cd();//set cluster file active
if (!TPCParam)
{
Error("Read","TPC parameters have not been found !\n");
- return 1;
+ currentdir++;
+ continue;
}
if (!tracktree) //check if we got the tree
{//if not return with error
Error("Read","Can't get a tree with TPC tracks !\n");
-
- return 1;
+ continue;
}
TBranch *trackbranch=tracktree->GetBranch("tracks");//get the branch with tracks
if (!trackbranch) ////check if we got the branch
{//if not return with error
Error("Read","Can't get a branch with TPC tracks !\n");
- return 2;
+ continue;
}
Int_t NTPCtracks=(Int_t)tracktree->GetEntries();//get number of TPC tracks
cout<<"Found "<<NTPCtracks<<" TPC tracks.\n";
if (!tracker) //check if it has created succeffuly
{//if not return with error
Error("Read","Can't get a tracker !\n");
- return 3;
+ continue;
}
tracker->LoadInnerSectors();
tracker->LoadOuterSectors();
TParticle *p = (TParticle*)gAlice->Particle(label);
- if(p == 0x0) continue; //if returned pointer is NULL
- if(p->GetPDG() == 0x0) continue; //if particle has crezy PDG code (not known to our database)
+ if(p == 0x0) continue; //if returned pointer is NULL
+ if(p->GetPDG() == 0x0) continue; //if particle has crezy PDG code (not known to our database)
if(Pass(p->GetPdgCode())) continue; //check if we are intersted with particles of this type
//if not take next partilce
if(Pass(part)) { delete part; continue;}//check if meets all criteria of any of our cuts
//if it does not delete it and take next good track
-
iotrack->PropagateToVertex();
iotrack->GetExternalParameters(xk,par); //get properties of the track
Double_t tEtot = TMath::Sqrt( tpx*tpx + tpy*tpy + tpz*tpz + mass*mass);//total energy of the track
AliHBTParticle* track = new AliHBTParticle(p->GetPdgCode(), tpx, tpy , tpz, tEtot, 0., 0., 0., 0.);
- if(Pass(track))//check if meets all criteria of any of our cuts
+ if(Pass(track))//check if meets all criteria of any of our cuts
//if it does not delete it and take next good track
{
delete track;