]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSReconstructor.cxx
Fixing a little overlap. Adding flags to perform material budget studies (Mario)
[u/mrichter/AliRoot.git] / ITS / AliITSReconstructor.cxx
index 102b276ae6af72934e7311abd1ecd46ff8617811..9e61af29d029dbc166af4c0985eb2bd5c17e0a45 100644 (file)
 #include "AliITSReconstructor.h"
 #include "AliRun.h"
 #include "AliRawReader.h"
-#include "AliITSDetTypeRec.h"
+#include "AliESDEvent.h"
+#include "AliESDpid.h"
 #include "AliITSgeom.h"
 #include "AliITSLoader.h"
 #include "AliITStrackerMI.h"
 #include "AliITStrackerV2.h"
 #include "AliITStrackerSA.h"
-#include "AliITSVertexerIons.h"
 #include "AliITSVertexerFast.h"
 #include "AliITSVertexerFixed.h"
 #include "AliITSVertexer3D.h"
 #include "AliITSVertexerZ.h"
+#include "AliITSVertexerZD.h"
 #include "AliITSVertexerCosmics.h"
-#include "AliESDEvent.h"
-#include "AliITSpidESD.h"
-#include "AliITSpidESD1.h"
-#include "AliITSpidESD2.h"
 #include "AliITSInitGeometry.h"
 #include "AliITSTrackleterSPDEff.h"
-
+#include "AliITSMultReconstructor.h"
 
 ClassImp(AliITSReconstructor)
 
 //___________________________________________________________________________
 AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
-fItsPID(0),
 fDetTypeRec(0)
 {
   // Default constructor
@@ -57,26 +53,24 @@ fDetTypeRec(0)
  //___________________________________________________________________________
 AliITSReconstructor::~AliITSReconstructor(){
 // destructor
-  delete fItsPID;
   if(fDetTypeRec) delete fDetTypeRec;
 } 
-//______________________________________________________________________
-AliITSReconstructor::AliITSReconstructor(const AliITSReconstructor &ob) :AliReconstructor(ob),
-fItsPID(ob.fItsPID),
-fDetTypeRec(ob.fDetTypeRec)
-
-{
-  // Copy constructor
-}
+//____________________________________________________________________________
+void AliITSReconstructor::GetPidSettings(AliESDpid *ESDpid) {
+  //
+  // pass PID settings from AliITSRecoParam to AliESDpid
+  //
+  Int_t pidOpt = GetRecoParam()->GetPID();
 
-//______________________________________________________________________
-AliITSReconstructor& AliITSReconstructor::operator=(const AliITSReconstructor&  ob ){
-  // Assignment operator
-  this->~AliITSReconstructor();
-  new(this) AliITSReconstructor(ob);
-  return *this;
+  if(pidOpt==1){
+    AliDebug(1,"ITS LandauFitPID option has been selected\n");
+    ESDpid->SetITSPIDmethod(AliESDpid::kITSLikelihood);
+  }
+  else{
+    AliDebug(1,"ITS default PID\n");
+    ESDpid->SetITSPIDmethod(AliESDpid::kITSTruncMean);
+  }
 }
-
 //______________________________________________________________________
 void AliITSReconstructor::Init() {
     // Initalize this constructor bet getting/creating the objects
@@ -104,22 +98,32 @@ void AliITSReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) co
 {
 // reconstruct clusters
 
-  Int_t cluFindOpt = GetRecoParam()->GetClusterFinder();
-
+  TString recopt = GetRecoParam()->GetOptReco();
   fDetTypeRec->SetTreeAddressD(digitsTree);
   fDetTypeRec->MakeBranch(clustersTree,"R");
   fDetTypeRec->SetTreeAddressR(clustersTree);
-  fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,"All",cluFindOpt);    
+  fDetTypeRec->DigitsToRecPoints(digitsTree,clustersTree,0,recopt.Data(),1);    
 }
 
 //_________________________________________________________________
 void AliITSReconstructor::Reconstruct(AliRawReader* rawReader, TTree *clustersTree) const
 {
   // reconstruct clusters from raw data
-  fDetTypeRec->SetDefaultClusterFindersV2(kTRUE);
-  fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree);
+  TString recopt = GetRecoParam()->GetOptReco();
+  fDetTypeRec->SetDefaultClusterFindersV2(kTRUE,kTRUE);
+  fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree,recopt.Data());
 }
+
+//_____________________________________________________________________________
+AliTrackleter* AliITSReconstructor::CreateMultFinder() const
+{
+  // create the SPD trackeleter for mult. reconstruction
+  AliITSMultReconstructor* multReco = new AliITSMultReconstructor();
+  multReco->SetHistOn(kFALSE);
+  multReco->SetDetTypeRec(fDetTypeRec);
+  return multReco;
+}
+
 //_____________________________________________________________________________
 AliTracker* AliITSReconstructor::CreateTrackleter() const
 {
@@ -138,7 +142,7 @@ AliTracker* AliITSReconstructor::CreateTrackleter() const
   spdtrackleter->SetPhiWindowL1(GetRecoParam()->GetTrackleterPhiWindowL1());
   spdtrackleter->SetZetaWindowL1(GetRecoParam()->GetTrackleterZetaWindowL1());
   if(GetRecoParam()->GetUpdateOncePerEventPlaneEff()) spdtrackleter->SetUpdateOncePerEventPlaneEff();
-  //spdtrackleter->(GetRecoParam()->GetMinContVtxPlaneEff()); // to be implemented
+  spdtrackleter->SetMinContVtx(GetRecoParam()->GetMinContVtxPlaneEff());
   return trackleter;
 }
 
@@ -173,19 +177,6 @@ AliTracker* AliITSReconstructor::CreateTracker() const
     sat->SetMinNPoints(GetRecoParam()->GetMinNPointsSA());
   }
 
-  Int_t pidOpt = GetRecoParam()->GetPID();
-
-  AliITSReconstructor* nc = const_cast<AliITSReconstructor*>(this);
-  if(pidOpt==1){
-    Info("FillESD","ITS LandauFitPID option has been selected\n");
-    nc->fItsPID = new AliITSpidESD2();
-  }
-  else{
-    Info("FillESD","ITS default PID\n");
-    Double_t parITS[] = {79.,0.13, 5.}; //IB: this is  "pp tuning"
-    nc->fItsPID = new AliITSpidESD1(parITS);
-  }
   return tracker;
   
 }
@@ -195,38 +186,48 @@ AliVertexer* AliITSReconstructor::CreateVertexer() const
 {
 // create a ITS vertexer
 
-  AliITSVertexer *vptr;
+  AliITSVertexer *vptr = NULL;
   Int_t vtxOpt = GetRecoParam()->GetVertexer();
   if(vtxOpt==3){
-    AliInfo("AliITSVertexerIons has been selected");
-    vptr =  new AliITSVertexerIons();
+    AliFatal("Option AliITSVertexerIons is no longer supported");
+    return vptr;
   }
   else if(vtxOpt==4){
     Double_t smear[3]={GetRecoParam()->GetVertexerFastSmearX(),
                       GetRecoParam()->GetVertexerFastSmearY(),
                       GetRecoParam()->GetVertexerFastSmearZ()};
-    AliInfo("AliITSVertexerFast has been selected"); 
+    AliDebug(1,"AliITSVertexerFast has been selected"); 
     vptr = new AliITSVertexerFast(smear);
   }
   else if(vtxOpt==1){
-    AliInfo("AliITSVertexerZ has been selected");
-    vptr =  new AliITSVertexerZ();
+    AliDebug(1,"AliITSVertexerZ has been selected");
+    AliITSVertexerZ* vtxrz =  new AliITSVertexerZ();
+    Int_t pileupAlgo=GetRecoParam()->GetSPDVertexerPileupAlgo();
+    if(pileupAlgo==3) vtxrz->SetSearchForPileup(kFALSE);
+    vptr = vtxrz;
   }
   else if(vtxOpt==2){
-    AliInfo("AliITSVertexerCosmics has been selected");
+    AliDebug(1,"AliITSVertexerCosmics has been selected");
     vptr = new AliITSVertexerCosmics();
   }
   else if(vtxOpt==5){ 
-    AliInfo("Vertex is fixed in the position of the TDI\n");
+    AliDebug(1,"Vertex is fixed in the position of the TDI\n");
     vptr = new AliITSVertexerFixed("TDI");
   }
   else if(vtxOpt==6){ 
-    AliInfo("Vertex is fixed in the position of the TED\n");
+    AliDebug(1,"Vertex is fixed in the position of the TED\n");
     vptr = new AliITSVertexerFixed("TED");
   }
+  else if(vtxOpt==7){
+    AliDebug(1,"VertexerZD:  reconstruction of the Z coordinate with SDD \n");
+    AliITSVertexerZD*vtxrz = new AliITSVertexerZD();
+    vtxrz->SetSearchForPileup(kFALSE);
+    vptr = vtxrz;
+  }
   else {
   // by default an AliITSVertexer3D object is instatiated
-    AliITSVertexer3D*  vtxr = new AliITSVertexer3D();
+    AliITSVertexer3D*  vtxr = 
+       new AliITSVertexer3D(GetRecoParam()->GetVertexer3DWideFiducialRegionZ());
     Float_t dzw=GetRecoParam()->GetVertexer3DWideFiducialRegionZ();
     Float_t drw=GetRecoParam()->GetVertexer3DWideFiducialRegionR();
     vtxr->SetWideFiducialRegion(dzw,drw);
@@ -240,7 +241,9 @@ AliVertexer* AliITSReconstructor::CreateVertexer() const
     vtxr->SetDCACut(dcacut);
     Int_t pileupAlgo=GetRecoParam()->GetSPDVertexerPileupAlgo();
     vtxr->SetPileupAlgo(pileupAlgo);
-    AliInfo(Form("AliITSVertexer3D with pileup algo %d has been selected",pileupAlgo));
+    UChar_t highmultAlgo=GetRecoParam()->GetSPDVertexerHighMultAlgo();
+    vtxr->SetHighMultAlgo(highmultAlgo);
+    AliDebug(1,Form("AliITSVertexer3D with pileup algo %d has been selected",pileupAlgo));
     vptr = vtxr;
   }
   vptr->SetDetTypeRec(fDetTypeRec);
@@ -249,9 +252,11 @@ AliVertexer* AliITSReconstructor::CreateVertexer() const
 
 //_____________________________________________________________________________
 void AliITSReconstructor::FillESD(TTree * /*digitsTree*/, TTree * /*clustersTree*/, 
-                                 AliESDEvent* esd) const
+                                 AliESDEvent* /* esd */) const
 {
 // make PID, find V0s and cascade
+/* Now done in AliESDpid
   if(fItsPID!=0) fItsPID->MakePID(esd);
   else AliError("!! cannot do the PID !!");
+*/
 }