]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HBTAN/AliHBTAnalysis.cxx
Bug Correction
[u/mrichter/AliRoot.git] / HBTAN / AliHBTAnalysis.cxx
index f4ea1ab19ff37849f50ecac4285dc75a97aeaad0..e5e6eda6a54c5bfc04e9a0c93fdc91c278d2f5b0 100644 (file)
@@ -147,10 +147,18 @@ Int_t AliHBTAnalysis::ProcessEvent(AliAOD* aodrec, AliAOD* aodsim)
   //Processes one event
   if (fProcEvent == 0x0)
    {
-     Error("ProcessEvent","Analysis option not specified");
+     Error("ProcessEvent","Analysis <<%s>> option not specified.",GetName());
      return 1;
    }
-  if ( Pass(aodrec,aodsim) ) return 0;
+  if ( Rejected(aodrec,aodsim) ) 
+   {
+//     Double_t x = 0, y = 0, z = 0;
+//     aodrec->GetPrimaryVertex(x,y,z);
+//     Info("ProcessEvent","Event has vertex at %f %f %f",x,y,z);
+     Info("ProcessEvent","Nch is %d",aodsim->GetNumberOfCharged());
+     Info("ProcessEvent","%s: Event cut rejected this event",GetName());
+     return 0;
+   } 
   
   //Move event to the apparent vertex -> must be after the event cut
   //It is important for any cut that use any spacial coordiantes, 
@@ -269,11 +277,13 @@ Int_t AliHBTAnalysis::Init()
     case kReconstructed:
       if (nonid) fProcEvent = &AliHBTAnalysis::ProcessRecNonId;
       else fProcEvent = &AliHBTAnalysis::ProcessRec;
+      SetCutsOnRec();
       break;
 
     case kSimulated:
       if (nonid) fProcEvent = &AliHBTAnalysis::ProcessSimNonId;
       else fProcEvent = &AliHBTAnalysis::ProcessSim;
+      SetCutsOnSim();
       break;
 
     case kSimulatedAndReconstructed:
@@ -368,7 +378,7 @@ Int_t AliHBTAnalysis::ProcessRecAndSim(AliAOD* aodrec, AliAOD* aodsim)
 
   if ( !partEvent || !trackEvent ) 
    {
-     Error("ProcessRecAndSim","Can not get event");
+     Error("ProcessRecAndSim","<<%s>> Can not get event",GetName());
      return 1;
    }
 
@@ -553,10 +563,10 @@ Int_t AliHBTAnalysis::ProcessSim(AliAOD* /*aodrec*/, AliAOD* aodsim)
 
      part1= partEvent->GetParticle(j);
 
-     Bool_t firstcut = fPairCut->GetFirstPartCut()->Pass(part1);
+     Bool_t firstcut = fPairCut->GetFirstPartCut()->Rejected(part1);
 
      if (fBufferSize != 0) 
-       if ( (firstcut == kFALSE) || ( fPairCut->GetSecondPartCut()->Pass(part1) == kFALSE ) )
+       if ( (firstcut == kFALSE) || ( fPairCut->GetSecondPartCut()->Rejected(part1) == kFALSE ) )
         {
           //accepted by any cut
           // we have to copy because reader keeps only one event
@@ -577,9 +587,9 @@ Int_t AliHBTAnalysis::ProcessSim(AliAOD* /*aodrec*/, AliAOD* aodsim)
         if (part1->GetUID() == part2->GetUID()) continue;
         partpair->SetParticles(part1,part2);
 
-           if(fPairCut->Pass(partpair)) //check pair cut
+           if(fPairCut->Rejected(partpair)) //check pair cut
             { //do not meets crietria of the 
-              if( fPairCut->Pass((AliHBTPair*)partpair->GetSwappedPair()) ) continue;
+              if( fPairCut->Rejected((AliHBTPair*)partpair->GetSwappedPair()) ) continue;
               else tmppartpair = (AliHBTPair*)partpair->GetSwappedPair();
             }
            else
@@ -612,9 +622,9 @@ Int_t AliHBTAnalysis::ProcessSim(AliAOD* /*aodrec*/, AliAOD* aodsim)
                 part2= partEvent2->GetParticle(l);
                 partpair->SetParticles(part1,part2);
 
-                if( fPairCut->Pass(partpair) ) //check pair cut
+                if( fPairCut->Rejected(partpair) ) //check pair cut
                   { //do not meets crietria of the 
-                    if( fPairCut->Pass((AliHBTPair*)partpair->GetSwappedPair()) )
+                    if( fPairCut->Rejected((AliHBTPair*)partpair->GetSwappedPair()) )
                       continue;
                     else 
                      {
@@ -676,10 +686,10 @@ Int_t AliHBTAnalysis::ProcessRec(AliAOD* aodrec, AliAOD* /*aodsim*/)
 
      track1= trackEvent->GetParticle(j);
 
-     Bool_t firstcut = fPairCut->GetFirstPartCut()->Pass(track1);
+     Bool_t firstcut = fPairCut->GetFirstPartCut()->Rejected(track1);
 
      if (fBufferSize != 0) 
-       if ( (firstcut == kFALSE) || ( fPairCut->GetSecondPartCut()->Pass(track1) == kFALSE ) )
+       if ( (firstcut == kFALSE) || ( fPairCut->GetSecondPartCut()->Rejected(track1) == kFALSE ) )
         {
           //accepted by any cut
           // we have to copy because reader keeps only one event
@@ -700,9 +710,9 @@ Int_t AliHBTAnalysis::ProcessRec(AliAOD* aodrec, AliAOD* /*aodsim*/)
         if (track1->GetUID() == track2->GetUID()) continue;
         trackpair->SetParticles(track1,track2);
 
-           if(fPairCut->Pass(trackpair)) //check pair cut
+           if(fPairCut->Rejected(trackpair)) //check pair cut
             { //do not meets crietria of the 
-              if( fPairCut->Pass((AliHBTPair*)trackpair->GetSwappedPair()) ) continue;
+              if( fPairCut->Rejected((AliHBTPair*)trackpair->GetSwappedPair()) ) continue;
               else tmptrackpair = (AliHBTPair*)trackpair->GetSwappedPair();
             }
            else
@@ -735,9 +745,9 @@ Int_t AliHBTAnalysis::ProcessRec(AliAOD* aodrec, AliAOD* /*aodsim*/)
                 track2= trackEvent2->GetParticle(l);
                 trackpair->SetParticles(track1,track2);
 
-                if( fPairCut->Pass(trackpair) ) //check pair cut
+                if( fPairCut->Rejected(trackpair) ) //check pair cut
                   { //do not meets crietria of the 
-                    if( fPairCut->Pass((AliHBTPair*)trackpair->GetSwappedPair()) )
+                    if( fPairCut->Rejected((AliHBTPair*)trackpair->GetSwappedPair()) )
                       continue;
                     else 
                      {
@@ -1669,8 +1679,8 @@ void AliHBTAnalysis::FilterOut(AliAOD* out1, AliAOD* out2, AliAOD* in) const
      in1 = in2 = kTRUE;
      part = in->GetParticle(i);
      
-     if ( cut1->Pass(part) ) in1 = kFALSE; //if part is rejected by cut1, in1 is false
-     if ( cut2->Pass(part) ) in2 = kFALSE; //if part is rejected by cut2, in2 is false
+     if ( cut1->Rejected(part) ) in1 = kFALSE; //if part is rejected by cut1, in1 is false
+     if ( cut2->Rejected(part) ) in2 = kFALSE; //if part is rejected by cut2, in2 is false
      
      if (gDebug)//to be removed in real analysis     
      if ( in1 && in2 ) //both cuts accepted, should never happen, just in case
@@ -1688,7 +1698,7 @@ void AliHBTAnalysis::FilterOut(AliAOD* out1, AliAOD* out2, AliAOD* in) const
      
      if (in2)
       {
-        out2->AddParticle(part);
+        out2->AddParticle(new AliAODParticle(*part));
         continue;
       }
    }