]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
CheckTrack implemented
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 30 Mar 2004 16:54:06 +0000 (16:54 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 30 Mar 2004 16:54:06 +0000 (16:54 +0000)
HBTAN/AliHBTReaderESD.cxx
HBTAN/AliHBTReaderESD.h

index 5e2c07ae53f9020a5731c745ef52ed18ce01fa54..ab90c149c84698269bfad353970f333bb6c5f185 100644 (file)
@@ -41,6 +41,7 @@ AliHBTReaderESD::AliHBTReaderESD(const Char_t* esdfilename, const Char_t* galfil
  fRunLoader(0x0),
  fKeyIterator(0x0),
  fReadParticles(kFALSE),
+ fCheckParticlePID(kFALSE),
  fNTrackPoints(0),
  fdR(0.0),
  fClusterMap(kFALSE),
@@ -84,6 +85,7 @@ AliHBTReaderESD::AliHBTReaderESD(TObjArray* dirs,const Char_t* esdfilename, cons
  fRunLoader(0x0),
  fKeyIterator(0x0),
  fReadParticles(kFALSE),
+ fCheckParticlePID(kFALSE),
  fNTrackPoints(0),
  fdR(0.0),
  fClusterMap(kFALSE),
@@ -319,9 +321,7 @@ Int_t AliHBTReaderESD::ReadESD(AliESD* esd)
         continue;
       } 
      esdtrack->GetESDpid(pidtable);
-     //esdtrack->GetVertexPxPyPz(mom[0],mom[1],mom[2]); 
      esdtrack->GetConstrainedPxPyPz(mom);
-     //esdtrack->GetVertexXYZ(pos[0],pos[1],pos[2]);
      esdtrack->GetConstrainedXYZ(pos);
      pos[0] -= vertexpos[0];//we are interested only in relative position to Primary vertex at this point
      pos[1] -= vertexpos[1];
@@ -341,11 +341,19 @@ Int_t AliHBTReaderESD::ReadESD(AliESD* esd)
            Error("ReadNext","Can not find track with such label.");
            continue;
          }
+        if(Pass(p->GetPdgCode())) 
+         {
+           if ( AliHBTParticle::GetDebug() > 5 )
+             Info("ReadNext","Simulated Particle PID (%d) did not pass the cut.",p->GetPdgCode());
+           continue; //check if we are intersted with particles of this type 
+         }
 //           if(p->GetPdgCode()<0) charge = -1;
         particle = new AliHBTParticle(*p,i);
 
       }
-
+      
+     if(CheckTrack(esdtrack)) continue;
+      
      //Here we apply Bayes' formula
      Double_t rc=0.;
      for (Int_t s=0; s<AliESDtrack::kSPECIES; s++) rc+=concentr[s]*pidtable[s];
@@ -565,6 +573,47 @@ Int_t AliHBTReaderESD::GetSpeciesPdgCode(ESpecies spec)//skowron
   return 0;
 }
 /********************************************************************/
+Bool_t AliHBTReaderESD::CheckTrack(AliESDtrack* t) const
+{
+  //Performs check of the track
+  
+  if ( (t->GetConstrainedChi2() < fChi2Min) || (t->GetConstrainedChi2() > fChi2Min) ) return kTRUE;
+  
+  if ( (t->GetTPCclusters(0x0) < fNTPCClustMin) || (t->GetTPCclusters(0x0) > fNTPCClustMax) ) return kTRUE;
+
+  Float_t chisqpercl = t->GetTPCchi2()/((Double_t)t->GetTPCclusters(0x0));
+  if ( (chisqpercl < fTPCChi2PerClustMin) || (chisqpercl > fTPCChi2PerClustMin) ) return kTRUE;
+
+  Double_t cc[15];
+  t->GetConstrainedExternalCovariance(cc);
+
+  if ( (cc[0]  < fC00Min) || (cc[0]  > fC00Max) ) return kTRUE;
+  if ( (cc[2]  < fC11Min) || (cc[2]  > fC11Max) ) return kTRUE;
+  if ( (cc[5]  < fC22Min) || (cc[5]  > fC22Max) ) return kTRUE;
+  if ( (cc[9]  < fC33Min) || (cc[9]  > fC33Max) ) return kTRUE;
+  if ( (cc[14] < fC44Min) || (cc[14] > fC44Max) ) return kTRUE;
+
+
+  t->GetInnerExternalCovariance(cc);
+
+  if ( (cc[0]  < fTPCC00Min) || (cc[0]  > fTPCC00Max) ) return kTRUE;
+  if ( (cc[2]  < fTPCC11Min) || (cc[2]  > fTPCC11Max) ) return kTRUE;
+  if ( (cc[5]  < fTPCC22Min) || (cc[5]  > fTPCC22Max) ) return kTRUE;
+  if ( (cc[9]  < fTPCC33Min) || (cc[9]  > fTPCC33Max) ) return kTRUE;
+  if ( (cc[14] < fTPCC44Min) || (cc[14] > fTPCC44Max) ) return kTRUE;
+
+  return kFALSE;
+
+}
+/********************************************************************/
+
+void AliHBTReaderESD::SetChi2(Float_t min, Float_t max)
+{
+  //sets range of Chi2 per Cluster
+  fChi2Min = min;
+  fChi2Max = max;
+}
+/********************************************************************/
 
 void AliHBTReaderESD::SetTPCNClustersRange(Int_t min,Int_t max)
 {
index 239fe9d0343bf94595adf401f77eba8c8ca9acde..2e8d4bfb17ca22a640b02016b6a64214643dcc36 100644 (file)
@@ -17,6 +17,7 @@
 class TFile;
 class AliRunLoader;
 class AliESD;
+class AliESDtrack;
 
 class AliHBTReaderESD: public AliHBTReader
 {
@@ -32,12 +33,15 @@ class AliHBTReaderESD: public AliHBTReader
     void          ReadParticles(Bool_t flag){fReadParticles = flag;}
     Bool_t        ReadsTracks() const {return kTRUE;}
     Bool_t        ReadsParticles() const {return fReadParticles;}
-    
+    void          SetCheckParticlePID(Bool_t flag){fCheckParticlePID = flag;}
+        
     void          ReadDataTPC(){}
     void          ReadDataITS(){}
 
     void          SetTPCNClustersRange(Int_t min,Int_t max);
     void          SetTPCChi2PerCluserRange(Float_t min, Float_t max);
+    
+    void          SetChi2(Float_t min, Float_t max);
     void          SetC00Range(Float_t min, Float_t max);
     void          SetC11Range(Float_t min, Float_t max);
     void          SetC22Range(Float_t min, Float_t max);
@@ -52,16 +56,19 @@ class AliHBTReaderESD: public AliHBTReader
     static Int_t  GetSpeciesPdgCode(ESpecies spec);//skowron
     
     Int_t         ReadESD(AliESD* esd);
+    
   protected:
     Int_t         ReadNext();
     TFile*        OpenFile(Int_t evno);//opens files to be read for given event
-
+    Bool_t        CheckTrack(AliESDtrack* t) const;
+    
     TString       fESDFileName;//name of the file with tracks
     TString       fGAlFileName;//name of the file with tracks
     TFile*        fFile;//! pointer to current ESD file
     AliRunLoader* fRunLoader;//!Run Loader
     TIter*        fKeyIterator;
     Bool_t        fReadParticles;//flag indicating wether to read particles from kinematics
+    Bool_t        fCheckParticlePID;//flag indicating to perform the check on PID of simulated particle
     
     Int_t         fNTrackPoints;//number of track points; if==0 track points are not created
     Float_t       fdR;//spacing between points (along radius) in cm
@@ -80,6 +87,9 @@ class AliHBTReaderESD: public AliHBTReader
 
 
     // Required parameters at vertex
+    Float_t       fChi2Min;//Chi^2 min value
+    Float_t       fChi2Max;//Chi^2 max value
+
     Float_t       fC00Min;//C00 (0th diagonal element of covariance matrix) min value
     Float_t       fC00Max;//C00 (0th diagonal element of covariance matrix) max value