Fixed Warnings in Reconstructioner and Prob
[u/mrichter/AliRoot.git] / TOF / AliTOFReconstructionerV2.cxx
index ce70672aa93ed9e1f117909ffc677a54cb5c2d1b..a40d1d1f7f3857904c1cd9019eef6500b5c1e0b5 100644 (file)
@@ -31,7 +31,8 @@
 #include <stdlib.h>
 #include <iostream.h>
 #include <fstream.h>
-#include "../TGeant3/TGeant3.h"
+#include "TGeant3.h"
+#include "TVirtualMC.h"
 
 #include "AliDetector.h"
 #include "AliMC.h"
@@ -45,7 +46,7 @@
 #include "AliTOFReconstructionerV2.h"
 #include "AliTOFTrackV2.h"
 
-#include "../STEER/AliKalmanTrack.h"
+#include "AliKalmanTrack.h"
 #include "../TPC/AliTPCtrack.h"
 #include "../TRD/AliTRDtrack.h"
 
@@ -61,7 +62,6 @@ ClassImp(AliTOFReconstructionerV2)
   fdbg      =0;
   fDigitsMap=0x0;
   fField    =0;
-  fG3Geom   =0x0;
   fNDummyTracks=0;
   fScaleSigmaFactor=0.;
   fStep     =0; 
@@ -101,8 +101,6 @@ AliTOFReconstructionerV2::AliTOFReconstructionerV2(char* tpcBackTracks, char* to
   // initialize the G3 geometry 
   gAlice->Init();
   gAlice->Print(); 
-  // set the fg3 pointer to geometry used by IsInsideThePad method
-  fG3Geom = (TGeant3*) gMC;    
 
   // add Task to //root/Tasks folder
   TTask * roottasks = (TTask*)gROOT->GetRootFolder()->FindObject("Tasks") ; 
@@ -134,12 +132,6 @@ AliTOFReconstructionerV2::AliTOFReconstructionerV2(const AliTOFReconstructionerV
       fDigitsMap = 0;
     }
 
-  if (fG3Geom)
-    {
-      delete fG3Geom;
-      fG3Geom = 0;
-    }
-
   if (fTOFDigits)
     {
       delete fTOFDigits;
@@ -356,8 +348,8 @@ void AliTOFReconstructionerV2::Exec(Option_t* option)
        Double_t zlrf= dummyrt->GetZ();  // P1
 
        // smear according to sigmaY and sigmaZ
-       Double_t ylrfNew=gRandom->Gaus(ylrf,fScaleSigmaFactor*sigmaY);
-       Double_t zlrfNew=gRandom->Gaus(zlrf,fScaleSigmaFactor*sigmaZ);
+       //Double_t ylrfNew=gRandom->Gaus(ylrf,fScaleSigmaFactor*sigmaY);
+       //Double_t zlrfNew=gRandom->Gaus(zlrf,fScaleSigmaFactor*sigmaZ);
 
        // set Y and Z accordingly
        // setter to be added in the class AliTPCtrack
@@ -719,6 +711,8 @@ void AliTOFReconstructionerV2::IsInsideThePad(Float_t x, Float_t y, Float_t z, I
   xTOF[1]=y;
   xTOF[2]=z;
   
+  TGeant3 * fG3Geom = (TGeant3*) gMC;
+
   fG3Geom->Gmedia(xTOF, numed);
   gcvolu=fG3Geom->Gcvolu();
   nLevel=gcvolu->nlevel;
@@ -997,3 +991,15 @@ void AliTOFReconstructionerV2::Comparison(Int_t* rtIndex)
     } // if(TOF)
   } // end loop on primary tracks
 }
+
+//__________________________________________________________________
+Bool_t AliTOFReconstructionerV2::operator==(const AliTOFReconstructionerV2 & tofrecv2)const
+{
+  // Equal operator.
+  // Reconstructioner are equal if their fField, fNDummyTracks, fScaleSigmaFactor and fStep are equal
+  if( (fField==tofrecv2.fField)&&(fNDummyTracks==tofrecv2.fNDummyTracks)&&(fScaleSigmaFactor==tofrecv2.fScaleSigmaFactor)&&(fStep==tofrecv2.fStep))
+    return kTRUE ;
+  else
+    return kFALSE ;
+}