]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSTrackleterSPDEff.cxx
add the possibility to process the event stat file
[u/mrichter/AliRoot.git] / ITS / AliITSTrackleterSPDEff.cxx
index 35cc9e82ae2492f595f6059d9004f661980d2d6f..7b54ceb5a6d344917e3ccce99e17bf27098b7d1e 100644 (file)
 #include "AliESDEvent.h"
 #include "AliESDVertex.h"
 //____________________________________________________________________
+
+using std::ofstream;
+using std::ios;
+using std::ifstream;
 ClassImp(AliITSTrackleterSPDEff)
 
 
@@ -136,6 +140,10 @@ fhClustersInModuleLay2(0)
 {
    // default constructor
 // from AliITSMultReconstructor
+  Init();
+}
+//______________________________________________________________________
+void AliITSTrackleterSPDEff::Init() {
   SetPhiWindowL2();
   SetZetaWindowL2();
   SetOnlyOneTrackletPerC2();
@@ -408,7 +416,7 @@ AliITSTrackleterSPDEff::Reconstruct(AliStack *pStack, TTree *tRef, Bool_t lbkg)
 
     found=FindChip(key, 0, vtx, fClustersLay2[iC2][0],fClustersLay2[iC2][1]);
     if (!found) {
-      AliWarning(Form("Reconstruct: cannot find chip prediction on inner layer for cluster %d on the outer layer",iC2)); 
+      AliDebug(1,Form("Reconstruct: cannot find chip prediction on inner layer for cluster %d on the outer layer",iC2)); 
       key=999999;
     }
     nfTraPred1+=(Int_t)found; // this for debugging purpose
@@ -452,7 +460,7 @@ AliITSTrackleterSPDEff::Reconstruct(AliStack *pStack, TTree *tRef, Bool_t lbkg)
        Int_t lab3=(Int_t)fClustersLay1[iC1][5];
        // do it always as a function of the chip number used to built the prediction
        found=FindChip(key,0,vtx,fClustersLay1[iC1][0],fClustersLay1[iC1][1],fClustersLay1[iC1][2]);
-       if (!found) {AliWarning(
+       if (!found) {AliDebug(1,
          Form("Reconstruct MC: cannot find chip on inner layer for cluster %d",iC1)); }
        else {
          if((lab1 != -2  &&  PrimaryTrackChecker(lab1,pStack) ) ||
@@ -581,7 +589,7 @@ AliITSTrackleterSPDEff::Reconstruct(AliStack *pStack, TTree *tRef, Bool_t lbkg)
 // Check that this cluster is still in the same chip (here you pass also Zvtx for better computation)
       found=FindChip(key,1,vtx,fClustersLay2[iC2WithBestDist][0],fClustersLay2[iC2WithBestDist][1],fClustersLay2[iC2WithBestDist][2]);
       if(!found){
-        AliWarning(
+        AliDebug(1,
          Form("Reconstruct: cannot find chip on outer layer for cluster %d",iC2WithBestDist));
         key=999999;
       }
@@ -660,7 +668,7 @@ AliITSTrackleterSPDEff::Reconstruct(AliStack *pStack, TTree *tRef, Bool_t lbkg)
        Int_t lab3=(Int_t)fClustersLay2[iC2][5];
        // do it always as a function of the chip number used to built the prediction
        found=FindChip(key,1,vtx,fClustersLay2[iC2][0],fClustersLay2[iC2][1],fClustersLay2[iC2][2]);
-       if (!found) {AliWarning(
+       if (!found) {AliDebug(1,
          Form("Reconstruct MC: cannot find chip on outer layer for cluster %d",iC2)); }
        else {
          if((lab1 != -2  &&  PrimaryTrackChecker(lab1,pStack) ) ||
@@ -782,7 +790,7 @@ AliITSTrackleterSPDEff::Reconstruct(AliStack *pStack, TTree *tRef, Bool_t lbkg)
 // Check that this cluster is still in the same chip (here you pass also Zvtx for better computation)
       found=FindChip(key,0,vtx,fClustersLay1[iC1WithBestDist][0],fClustersLay1[iC1WithBestDist][1],fClustersLay1[iC1WithBestDist][2]);
       if(!found){
-        AliWarning(
+        AliDebug(1,
          Form("Reconstruct: cannot find chip on inner layer for cluster %d",iC1WithBestDist));
         key=999999;
       }
@@ -839,7 +847,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]
@@ -1012,7 +1020,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[
@@ -1087,13 +1095,13 @@ TParticle* part = stack->Particle(ipart);
 
   Int_t nret=0;
   TParticle* dau = 0;
-  Int_t nDau = 0;
+  //  Int_t nDau = 0;
   Int_t pdgDau;
   Int_t firstDau = part->GetFirstDaughter(); // if no daugther stored then no way to understand i
                                              // its real fate ! But you have to take it !
   if (firstDau > 0) { // if it has daugther(s) try to infer if it is "detectable" as a tracklet
     Int_t lastDau = part->GetLastDaughter();
-    nDau = lastDau - firstDau + 1;
+    //    nDau = lastDau - firstDau + 1;
     Double_t distMax=0.;
     Int_t jmax=0;
     for(Int_t j=firstDau; j<=lastDau; j++)  {
@@ -1852,7 +1860,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
@@ -1980,7 +1988,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) {
@@ -2131,4 +2139,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 
+  }