]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSVertexer3D.cxx
load AddTaskEmcalJet.C
[u/mrichter/AliRoot.git] / ITS / AliITSVertexer3D.cxx
index 4a585314a34fa92e696947410d596b8563a033d2..9903d0cc00de454231640bd8783dd9808919aca1 100644 (file)
@@ -43,7 +43,7 @@ ClassImp(AliITSVertexer3D)
 /* $Id$ */
 
 //______________________________________________________________________
-AliITSVertexer3D::AliITSVertexer3D():
+AliITSVertexer3D::AliITSVertexer3D(Double_t zcut):
   AliITSVertexer(),
   fLines("AliStrLine",1000),
   fVert3D(),
@@ -85,7 +85,12 @@ AliITSVertexer3D::AliITSVertexer3D():
   SetCoarseMaxRCut();
   SetMaxRCut();
   SetMaxRCutAlgo2();
-  SetZCutDiamond();
+  if(zcut>0.){
+    SetZCutDiamond(zcut);
+  }
+  else {
+    SetZCutDiamond();
+  }
   SetMaxZCut();
   SetDCACut();
   SetDiffPhiMax();
@@ -96,12 +101,50 @@ AliITSVertexer3D::AliITSVertexer3D():
   SetPileupAlgo();
   SetBinSizeR();
   SetBinSizeZ();
-  Double_t binsize=0.02; // default 200 micron
-  Int_t nbins=static_cast<Int_t>(1+2*fZCutDiamond/binsize);
-  fZHisto=new TH1F("hz","",nbins,-fZCutDiamond,-fZCutDiamond+binsize*nbins);
   fGenerForDownScale=new TRandom3(987654321);
 }
 
+//______________________________________________________________________
+AliITSVertexer3D::AliITSVertexer3D(TRootIOCtor*):
+  AliITSVertexer(),
+  fLines("AliStrLine",1000),
+  fVert3D(),
+  fCoarseDiffPhiCut(0.),
+  fFineDiffPhiCut(0.),
+  fCutOnPairs(0.),
+  fCoarseMaxRCut(0.),
+  fMaxRCut(0.),
+  fMaxRCut2(0.),
+  fZCutDiamond(0.),
+  fMaxZCut(0.),
+  fDCAcut(0.),
+  fDiffPhiMax(0.),
+  fMeanPSelTrk(0.),
+  fMeanPtSelTrk(0.),
+  fUsedCluster(kMaxCluPerMod*kNSPDMod),
+  fZHisto(0),
+  fDCAforPileup(0.),
+  fDiffPhiforPileup(0.),
+  fBinSizeR(0.),
+  fBinSizeZ(0.),
+  fPileupAlgo(0),
+  fMaxNumOfCl(fgkMaxNumOfClDefault),
+  fMaxNumOfClForRebin(fgkMaxNumOfClRebinDefault),
+  fMaxNumOfClForDownScale(fgkMaxNumOfClDownscaleDefault),
+  fNRecPLay1(0),
+  fNRecPLay2(0),
+  f3DBinSize(fgk3DBinSizeDefault),
+  fDoDownScale(kFALSE),
+  fGenerForDownScale(0),
+  f3DPeak(),
+  fHighMultAlgo(1),
+  fSwitchAlgorithm(kFALSE)
+{
+  // I/O constructor
+
+
+}
+
 //______________________________________________________________________
 AliITSVertexer3D::~AliITSVertexer3D() {
   // Destructor
@@ -112,7 +155,7 @@ AliITSVertexer3D::~AliITSVertexer3D() {
 
 //______________________________________________________________________
 void AliITSVertexer3D::ResetVert3D(){
-  //
+  // Reset the fVert3D object and reset the used clusters
   ResetVertex();
   fVert3D.SetXv(0.);
   fVert3D.SetYv(0.);
@@ -177,7 +220,7 @@ AliESDVertex* AliITSVertexer3D::FindVertexForCurrentEvent(TTree *itsClusterTree)
 
 //______________________________________________________________________
 void AliITSVertexer3D::FindVertex3D(TTree *itsClusterTree){
+  // Instantiates the fCurrentVertex object. calle by FindVertexForCurrenEvent
   Double_t vRadius=TMath::Sqrt(fVert3D.GetXv()*fVert3D.GetXv()+fVert3D.GetYv()*fVert3D.GetYv());
   if(vRadius<GetPipeRadius() && fVert3D.GetNContributors()>0){
     Double_t position[3]={fVert3D.GetXv(),fVert3D.GetYv(),fVert3D.GetZv()};
@@ -198,6 +241,7 @@ void AliITSVertexer3D::FindVertex3D(TTree *itsClusterTree){
     default: AliError("Wrong pileup algorithm"); break;
     }
     if(fNoVertices==1){
+      delete[] fVertArray;
       fVertArray = new AliESDVertex[1];
       fVertArray[0]=(*fCurrentVertex);   
     }
@@ -206,7 +250,7 @@ void AliITSVertexer3D::FindVertex3D(TTree *itsClusterTree){
 
 //______________________________________________________________________
 void AliITSVertexer3D::FindVertex3DIterative(){
-  //
+  // find vertex if fPileupAlgo == 2
 
   Int_t nLines=fLines.GetEntriesFast();
   Int_t maxPoints=nLines*(nLines-1)/2;
@@ -1052,6 +1096,19 @@ void AliITSVertexer3D::SetMeanPPtSelTracks(Double_t fieldTesla){
   }
 }
 
+//________________________________________________________
+void AliITSVertexer3D::SetZCutDiamond(Double_t zcut){
+  // The fiducial region along Z is set. The TH1 object pointed by 
+  // fZHisto is created 
+  if(TMath::AreEqualAbs(zcut,fZCutDiamond,1.e-10))return;
+  fZCutDiamond=zcut;
+  if(fZHisto) delete fZHisto;
+  Double_t binsize=0.02; // default 200 micron
+  Int_t nbins=static_cast<Int_t>(1+2*fZCutDiamond/binsize);
+  fZHisto=new TH1F("hz","",nbins,-fZCutDiamond,-fZCutDiamond+binsize*nbins);
+  fZHisto->SetDirectory(0);
+}
+
 //________________________________________________________
 void AliITSVertexer3D::FindPeaks(TH3F* histo, Double_t *peak, Int_t &nOfTracklets, Int_t &nOfTimes){
   // Finds bin with max contents in 3D histo of tracket intersections