Possibility to use only ITSTPC or only ITSSA tracks to rereco vertex
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 5 Dec 2009 14:07:06 +0000 (14:07 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 5 Dec 2009 14:07:06 +0000 (14:07 +0000)
PWG1/global/AliAnalysisTaskVertexESD.cxx
PWG1/global/AliAnalysisTaskVertexESD.h

index 6c1196a..ffc76f0 100644 (file)
@@ -66,6 +66,8 @@ fCheckEventType(kTRUE),
 fReadMC(kFALSE),
 fRecoVtxTPC(kFALSE),
 fRecoVtxITSTPC(kFALSE),
+fOnlyITSTPCTracks(kFALSE),
+fOnlyITSSATracks(kFALSE),
 fESD(0), 
 fOutput(0), 
 fNtupleVertexESD(0),
@@ -386,5 +388,22 @@ AliESDVertex* AliAnalysisTaskVertexESD::ReconstructPrimaryVertexITSTPC() const {
   delete initVertex;
   vertexer.SetConstraintOff();
 
+  // use only ITS-TPC or only ITS-SA tracks
+  if(fOnlyITSTPCTracks || fOnlyITSSATracks) {
+    Int_t iskip=0;
+    Int_t *skip = new Int_t[fESD->GetNumberOfTracks()];
+    for(Int_t itr=0;itr<fESD->GetNumberOfTracks(); itr++) {
+      AliESDtrack* track = fESD->GetTrack(itr);
+      if(fOnlyITSTPCTracks && track->GetNcls(1)==0) { // skip ITSSA
+       skip[iskip++]=itr;
+      }
+      if(fOnlyITSSATracks && track->GetNcls(1)>0) { // skip ITSTPC
+       skip[iskip++]=itr;
+      }
+    }
+    vertexer.SetSkipTracks(iskip,skip);
+    delete [] skip; skip=NULL;
+  }
+
   return vertexer.FindPrimaryVertex(fESD);
 }
index 438d4d0..c75ea62 100644 (file)
@@ -40,12 +40,16 @@ class AliAnalysisTaskVertexESD : public AliAnalysisTask
   void           SetReadMC(Bool_t flag=kTRUE) { fReadMC=flag; if(flag) fCheckEventType=kFALSE;}
   void           SetRerecoVertexTPC(Bool_t flag=kTRUE) { fRecoVtxTPC=flag; }
   void           SetRerecoVertexITSTPC(Bool_t flag=kTRUE) { fRecoVtxITSTPC=flag; }
+  void           SetOnlyITSTPCTracks() {fOnlyITSTPCTracks=kTRUE;}
+  void           SetOnlyITSSATracks() {fOnlyITSSATracks=kTRUE;}
   
  protected:
   Bool_t       fCheckEventType; // read only events of type 7
   Bool_t       fReadMC;         // read Monte Carlo
   Bool_t       fRecoVtxTPC;     // reco TPC vertex on the flight
   Bool_t       fRecoVtxITSTPC;  // reco ITS+TPC vertex on the flight
+  Bool_t       fOnlyITSTPCTracks; // only ITS-TPC tracks to redo ITSTPC vertex
+  Bool_t       fOnlyITSSATracks;  // only ITS-SA tracks to redo ITSTPC vertex
   AliESDEvent *fESD;            // ESD object
   TList       *fOutput;         //! list send on output slot 0
   TNtuple     *fNtupleVertexESD;//! output ntuple