Setting of magnetic filed adapted to new schema
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Oct 2002 10:59:38 +0000 (10:59 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Oct 2002 10:59:38 +0000 (10:59 +0000)
HBTAN/AliHBTReaderITSv2.cxx
HBTAN/AliHBTReaderTPC.cxx

index fb0390b38d17127e3bdbe424609d8fea9ff9b676..d7da1a9e2d784a249d8e0def9bfc586eaa56eda4 100644 (file)
@@ -174,8 +174,8 @@ Int_t AliHBTReaderITSv2::Read(AliHBTRun* particles, AliHBTRun *tracks)
     if( (i=OpenFiles(aTracksFile,aClustersFile,aGAliceFile,currentdir)) )
      {
        Error("Read","Exiting due to problems with opening files. Errorcode %d",i);
     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
      }
     
     if (gAlice->TreeE())//check if tree E exists
@@ -183,22 +183,22 @@ Int_t AliHBTReaderITSv2::Read(AliHBTRun* particles, AliHBTRun *tracks)
       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;
       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");
      }
     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!"); 
      }
     
     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
      }
 
     for(Int_t currentEvent =0; currentEvent<Nevents;currentEvent++)//loop over all events
@@ -208,21 +208,14 @@ Int_t AliHBTReaderITSv2::Read(AliHBTRun* particles, AliHBTRun *tracks)
        aGAliceFile->cd();
        gAlice->GetEvent(currentEvent);
 
        aGAliceFile->cd();
        gAlice->GetEvent(currentEvent);
 
-//       TParticle * part = gAlice->Particle(0);
-      
        aClustersFile->cd();
        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"); 
        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");
       
          }
        TBranch *tbranch=tracktree->GetBranch("tracks");
       
index 39421c892a186b658a39cc9c2501d054d23d1a79..b765de0ff96ead767b0a25be2779b302b3ded768 100644 (file)
@@ -171,7 +171,8 @@ Int_t AliHBTReaderTPC::Read(AliHBTRun* particles, AliHBTRun *tracks)
     if( (i=OpenFiles(aTracksFile,aClustersFile,aGAliceFile,currentdir)) )
      {
        Error("Read","Exiting due to problems with opening files. Errorcode %d",i);
     if( (i=OpenFiles(aTracksFile,aClustersFile,aGAliceFile,currentdir)) )
      {
        Error("Read","Exiting due to problems with opening files. Errorcode %d",i);
-       return i;
+       currentdir++;
+       continue;
      }
   
     
      }
   
     
@@ -180,13 +181,14 @@ Int_t AliHBTReaderTPC::Read(AliHBTRun* particles, AliHBTRun *tracks)
       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;
       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");
      }
     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 
      }
   
     aClustersFile->cd();//set cluster file active 
@@ -194,7 +196,8 @@ Int_t AliHBTReaderTPC::Read(AliHBTRun* particles, AliHBTRun *tracks)
     if (!TPCParam) 
       { 
        Error("Read","TPC parameters have not been found !\n");
     if (!TPCParam) 
       { 
        Error("Read","TPC parameters have not been found !\n");
-       return 1;
+       currentdir++;
+       continue;
       }
 
   
       }
 
   
@@ -216,15 +219,14 @@ Int_t AliHBTReaderTPC::Read(AliHBTRun* particles, AliHBTRun *tracks)
          if (!tracktree) //check if we got the tree
           {//if not return with error
             Error("Read","Can't get a tree with TPC tracks !\n"); 
          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"); 
           }
    
          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";
           }
          Int_t NTPCtracks=(Int_t)tracktree->GetEntries();//get number of TPC tracks 
          cout<<"Found "<<NTPCtracks<<" TPC tracks.\n";
@@ -237,7 +239,7 @@ Int_t AliHBTReaderTPC::Read(AliHBTRun* particles, AliHBTRun *tracks)
          if (!tracker) //check if it has created succeffuly
           {//if not return with error
             Error("Read","Can't get a tracker !\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();
           }
          tracker->LoadInnerSectors();
          tracker->LoadOuterSectors();
@@ -279,8 +281,8 @@ Int_t AliHBTReaderTPC::Read(AliHBTRun* particles, AliHBTRun *tracks)
             
             TParticle *p = (TParticle*)gAlice->Particle(label);
             
             
             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(p->GetPdgCode())) continue; //check if we are intersted with particles of this type 
                                         //if not take next partilce
@@ -289,7 +291,6 @@ Int_t AliHBTReaderTPC::Read(AliHBTRun* particles, AliHBTRun *tracks)
             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
          
             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
             iotrack->PropagateToVertex();
 
             iotrack->GetExternalParameters(xk,par);     //get properties of the track
@@ -307,7 +308,7 @@ Int_t AliHBTReaderTPC::Read(AliHBTRun* particles, AliHBTRun *tracks)
             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.);
             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;
                          //if it does not delete it and take next good track
              { 
                delete track;