Bugs correction
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 18 Aug 2003 15:32:41 +0000 (15:32 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 18 Aug 2003 15:32:41 +0000 (15:32 +0000)
HBTAN/AliHBTAnalysis.cxx
HBTAN/AliHBTReader.cxx
HBTAN/AliHBTReaderInternal.cxx
HBTAN/AliHBTWriteInternFormat.C

index 943a40d67a5e81fc486070708a81a0cbbd18280d..6ddec4087919d070702feaa80d42f82eb9dbf428 100644 (file)
@@ -326,14 +326,15 @@ void AliHBTAnalysis::ProcessTracksAndParticles()
 
          part1= partEvent->GetParticle(j);
          track1= trackEvent->GetParticle(j);
-         
-         if( part1->GetPdgCode() != track1->GetPdgCode() )
-          {
-            Fatal("ProcessTracksAndParticles",
-                  "Event %d: Particle %d: PID of simulated particle (%d) not the same of reconstructed track (%d)",
-                  i,j, part1->GetPdgCode(),track1->GetPdgCode() );
-            return;
-          }
+  
+//PID imperfections ???
+//         if( part1->GetPdgCode() != track1->GetPdgCode() )
+//          {
+//            Fatal("ProcessTracksAndParticles",
+//                  "Event %d: Particle %d: PID of simulated particle (%d) not the same of reconstructed track (%d)",
+//                  i,j, part1->GetPdgCode(),track1->GetPdgCode() );
+//            return;
+//          }
          
          Bool_t firstcut = fPairCut->GetFirstPartCut()->Pass(part1);
          
@@ -363,7 +364,7 @@ void AliHBTAnalysis::ProcessTracksAndParticles()
             if (part1->GetUID() == part2->GetUID()) continue;
             partpair->SetParticles(part1,part2);
            
-            track2= trackEvent->GetParticle(k);       
+            track2= trackEvent->GetParticle(k);
             trackpair->SetParticles(track1,track2);
 
             if(fPairCut->Pass(partpair) ) //check pair cut 
@@ -952,14 +953,15 @@ void AliHBTAnalysis::ProcessTracksAndParticlesNonIdentAnal()
 
          part1= partEvent1->GetParticle(j);
          track1= trackEvent1->GetParticle(j);
-         
-         if( part1->GetPdgCode() != track1->GetPdgCode() )
-          {
-            Fatal("ProcessTracksAndParticlesNonIdentAnal",
-                  "Event %d: Particle %d: PID of simulated particle (%d) not the same of reconstructed track (%d)",
-                  i,j, part1->GetPdgCode(),track1->GetPdgCode() );
-            return;
-          }
+  
+//PID reconstruction imperfections
+//         if( part1->GetPdgCode() != track1->GetPdgCode() )
+//          {
+//            Fatal("ProcessTracksAndParticlesNonIdentAnal",
+//                  "Event %d: Particle %d: PID of simulated particle (%d) not the same of reconstructed track (%d)",
+//                  i,j, part1->GetPdgCode(),track1->GetPdgCode() );
+//            return;
+//          }
          
          for(ii = 0; ii<fNParticleMonitorFunctions; ii++)
            fParticleMonitorFunctions[ii]->Process(part1);
index b98e1f9813c0ca19a8131be3d377ead592537a1b..1cecb7e47d4ca497f1ab43204991d1101103a2df 100644 (file)
@@ -197,18 +197,19 @@ Int_t AliHBTReader::Read(AliHBTRun* particles, AliHBTRun *tracks)
  //
   Info("Read","");
   
-  if (!particles) //check if an object is instatiated
+  if ( ReadsParticles() && (particles == 0x0) ) //check if an object is instatiated
    {
      Error("Read"," particles object must be instatiated before passing it to the reader");
      return 1;
    }
-  if (!tracks)  //check if an object is instatiated
+  if ( ReadsTracks() && (tracks == 0x0) )  //check if an object is instatiated
    {
      Error("Read"," tracks object must be instatiated before passing it to the reader");
      return 1;
    }
-  particles->Reset();//clear runs == delete all old events
-  tracks->Reset();
+   
+  if (ReadsParticles()) particles->Reset();//clear runs == delete all old events
+  if (ReadsTracks()) tracks->Reset();
   
   Rewind();
   
index 109869a682bf1334a14672730b56cb9f99dc1c27..92eceb119a19989c99b5f9c914afa9ffbe45f5be 100644 (file)
@@ -101,7 +101,7 @@ Int_t AliHBTReaderInternal::ReadNext()
     if (fTree == 0x0)
      if( (i=OpenNextFile()) )
       {
-        Error("ReadNext","Skippimg directory due to problems with opening files. Errorcode %d",i);
+        Error("ReadNext","Skipping directory due to problems with opening files. Errorcode %d",i);
         fCurrentDir++;
         continue;
       }
@@ -226,7 +226,7 @@ Int_t AliHBTReaderInternal::ReadNext()
     
     return 0;
 
-   }while(fCurrentEvent < GetNumberOfDirs());
+   }while(fCurrentDir < GetNumberOfDirs());
 
   return 1;//no more directories to read
 }
@@ -235,7 +235,7 @@ Int_t AliHBTReaderInternal::ReadNext()
 Int_t AliHBTReaderInternal::OpenNextFile()
 {
   //open file in current directory
-   const TString& dirname = GetDirName(fCurrentEvent); 
+   const TString& dirname = GetDirName(fCurrentDir);
    if (dirname == "")
     {
       Error("OpenNextFile","Can not get directory name");
index 292100b66216a4ca02283a758c74e6702bea214a..0808efdc39f7b12249cb48e0e5d6fda3c6631d3e 100644 (file)
@@ -55,7 +55,7 @@ void AliHBTWriteInternFormat(Option_t* datatype, Option_t* processopt="TracksAnd
   gSystem->Load("$(ALICE_ROOT)/lib/tgt_$(ALICE_TARGET)/libHBTAN");
   cout<<"AliHBTWriteInternFormat.C: ..... Loaded\n";
   
-
+  Bool_t multcheck = kTRUE;
   /***********************************************************/
    
   AliHBTReader* reader;
@@ -70,32 +70,38 @@ void AliHBTWriteInternFormat(Option_t* datatype, Option_t* processopt="TracksAnd
    {
     reader = new AliHBTReaderKineTree();
     processopt="Particles"; //this reader by definition reads only simulated particles
+    multcheck = kFALSE;
    }
   else if(!ESD)
    {
     AliHBTReaderESD* esdreader = new AliHBTReaderESD();
     esdreader->ReadParticles(kTRUE);
     reader = esdreader;
+    multcheck = kTRUE;
    }
   else if(!TPC)
    {
     cout<<"AliHBTWriteInternFormat.C: Creating Reader TPC .....\n";
     reader = new AliHBTReaderTPC();
+    multcheck = kFALSE;
     cout<<"AliHBTWriteInternFormat.C: ..... Created\n";
    }
   else if(!ITSv1)
    {
     reader = new AliHBTReaderITSv1();
+    multcheck = kFALSE;
    }
   else if(!ITSv2)
    {
     cout<<"AliHBTWriteInternFormat.C: Creating Reader ITSv2 .....\n";
     reader = new AliHBTReaderITSv2();
+    multcheck = kFALSE;
     cout<<"AliHBTWriteInternFormat.C: ..... Created\n";
    }
   else if(!intern)
    {
     reader = new AliHBTReaderInternal("data.root");
+    multcheck = kTRUE;
    }
   else
    {
@@ -121,7 +127,7 @@ void AliHBTWriteInternFormat(Option_t* datatype, Option_t* processopt="TracksAnd
    reader->SetDirs(dirs);
 
    cout<<"AliHBTWriteInternFormat.C:   P R O C S E S S I N G .....\n\n";
-   AliHBTReaderInternal::Write(reader,outfile);
+   AliHBTReaderInternal::Write(reader,outfile,multcheck);
    cout<<"\n\nAliHBTWriteInternFormat.C:   F I N I S H E D\n";
    
    if (dirs) delete dirs;