]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSTrackleterSPDEff.cxx
Update for Ds
[u/mrichter/AliRoot.git] / ITS / AliITSTrackleterSPDEff.cxx
index b8844c92496775b32fe4942f91e11ae9722d9bb5..617eb171054af9082e1fe7660ab70df4d0fccfc8 100644 (file)
@@ -136,6 +136,10 @@ fhClustersInModuleLay2(0)
 {
    // default constructor
 // from AliITSMultReconstructor
+  Init();
+}
+//______________________________________________________________________
+void AliITSTrackleterSPDEff::Init() {
   SetPhiWindowL2();
   SetZetaWindowL2();
   SetOnlyOneTrackletPerC2();
@@ -839,7 +843,7 @@ AliITSTrackleterSPDEff::Reconstruct(AliStack *pStack, TTree *tRef, Bool_t lbkg)
   AliDebug(1,Form(("Eff. of method FindChip for Cluster on lay 2 = %d / %d"),nfClu2,ntClu2));
 }
 //____________________________________________________________________
-Bool_t AliITSTrackleterSPDEff::FindChip(UInt_t &key, Int_t layer,  Float_t* vtx, 
+Bool_t AliITSTrackleterSPDEff::FindChip(UInt_t &key, Int_t layer,const  Float_t* vtx, 
                                   Float_t thetaVtx, Float_t phiVtx, Float_t zVtx) {
 //
 // Input: a) layer number in the range [0,1]
@@ -860,7 +864,10 @@ Bool_t AliITSTrackleterSPDEff::FindChip(UInt_t &key, Int_t layer,  Float_t* vtx,
   Double_t zAbs,phiAbs; // those are the polar coordinate, in the Absolute ALICE Reference 
                         // of the intersection of the tracklet with the pixel layer.  
   if (TMath::Abs(zVtx)<100) zAbs=zVtx + vtx[2]; // this is fine only for the cluster, not for the track prediction
-  else zAbs=r/TMath::Tan(thetaVtx) + vtx[2]; // this is the only way to do for the tracklet prediction
+  else {
+    if(TMath::Abs(thetaVtx)<1E-6) return kFALSE;
+    zAbs=r/TMath::Tan(thetaVtx) + vtx[2]; // this is the only way to do for the tracklet prediction
+  }
   AliDebug(1,Form("FindChip: vtx[0] = %f, vtx[1] = %f, vtx[2] = %f",vtx[0],vtx[1],vtx[2]));
   Double_t vtxy[2]={vtx[0],vtx[1]};
   if (vtxy[0]*vtxy[1]+vtxy[1]*vtxy[1]>0) { // this method holds only for displaced vertices 
@@ -1009,7 +1016,7 @@ phi=TMath::ATan2(pP[1],pP[0]);
 return kTRUE;
 }
 //___________________________________________________________
-Bool_t AliITSTrackleterSPDEff::SetAngleRange02Pi(Double_t &angle) {
+Bool_t AliITSTrackleterSPDEff::SetAngleRange02Pi(Double_t &angle) const {
 //
 //  simple method to reduce all angles (in rad)
 //  in range [0,2pi[
@@ -1849,7 +1856,7 @@ void AliITSTrackleterSPDEff::DeleteHistos() {
 }
 //_______________________________________________________________
 Bool_t AliITSTrackleterSPDEff::IsReconstructableAt(Int_t layer,Int_t iC,Int_t ipart,
-                                                   Float_t* vtx, AliStack *stack, TTree *ref) {
+                                                   const Float_t* vtx, const AliStack *stack, TTree *ref) {
 // This (private) method can be used only for MC events, where both AliStack and the TrackReference
 // are available. 
 // It is used to asses whether a tracklet prediction is reconstructable or not at the other layer
@@ -1977,7 +1984,7 @@ Int_t AliITSTrackleterSPDEff::Clusters2Tracks(AliESDEvent *esd){
   Int_t rc=1;
   // apply cuts on the vertex quality
   const AliESDVertex *vertex = esd->GetVertex();
-  if(vertex->GetNContributors()<fMinContVtx) return rc;
+  if(vertex->GetNContributors()<fMinContVtx) return 0;
   //
   AliRunLoader* runLoader = AliRunLoader::Instance();
   if (!runLoader) {
@@ -2128,4 +2135,16 @@ AliITSTrackleterSPDEff::SetLightBkgStudyInParallel(Bool_t b) {
     fPlaneEffBkg=0;
   }
 }
-
+//______________________________________________________________
+void AliITSTrackleterSPDEff::SetReflectClusterAroundZAxisForLayer(Int_t ilayer,Bool_t b){  
+//
+// method to study residual background:
+// Input b= KTRUE --> reflect the clusters 
+//      ilayer (either 0 or 1) --> which SPD layers should be reflected
+//
+    if(b) {AliInfo(Form("All clusters on layer %d will be rotated by 180 deg around z",ilayer));
+           SetLightBkgStudyInParallel(kFALSE);}
+    if(ilayer==0) fReflectClusterAroundZAxisForLayer0=b;                   // a rotation by 180degree around the Z axis  
+    else if(ilayer==1) fReflectClusterAroundZAxisForLayer1=b;              // (x->-x; y->-y) to all RecPoints on a 
+    else AliInfo("Nothing done: input argument (ilayer) either 0 or 1");   // given layer is applied. In such a way 
+  }