]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSVertexer.cxx
Check PHOS and EMCAL clusters
[u/mrichter/AliRoot.git] / ITS / AliITSVertexer.cxx
index 357099f6d2837f24dbedde6b29cd3de2a626840b..d5e62ec7adacbfebcf8c5bd068539f95fd8a6ef4 100644 (file)
@@ -2,6 +2,8 @@
 #include <AliITSVertexer.h>
 #include <AliRunLoader.h>
 #include <AliITSLoader.h>
+#include <AliMultiplicity.h>
+#include <AliITSMultReconstructor.h>
 
 ClassImp(AliITSVertexer)
 
@@ -15,7 +17,6 @@ ClassImp(AliITSVertexer)
 //______________________________________________________________________
 AliITSVertexer::AliITSVertexer():AliVertexer() {
   // Default Constructor
-  //SetUseV2Clusters(kTRUE);
 }
 
 AliITSVertexer::AliITSVertexer(TString filename) {
@@ -28,7 +29,7 @@ AliITSVertexer::AliITSVertexer(TString filename) {
     Fatal("AliITSVertexer","The AliRun object is not available - nothing done");
   }
   fCurrentVertex  = 0;   
-  SetDebug();
+  fDebug = 0;
   SetFirstEvent(0);
   SetLastEvent(0);
   rl->LoadHeader();
@@ -41,7 +42,6 @@ AliITSVertexer::AliITSVertexer(TString filename) {
     lst = static_cast<Int_t>(rl->TreeE()->GetEntries());
     SetLastEvent(lst-1);
   }
-  //SetUseV2Clusters(kTRUE);
 }
 
 //______________________________________________________________________
@@ -59,6 +59,57 @@ AliITSVertexer& AliITSVertexer::operator=(const AliITSVertexer& /* vtxr */){
   return *this;
 }
 
+//______________________________________________________________________
+void AliITSVertexer::FindMultiplicity(Int_t evnumber){
+  // Invokes AliITSMultReconstructor to determine the
+  // charged multiplicity in the pixel layers
+  if(fMult){delete fMult; fMult = 0;}
+  Bool_t success=kTRUE;
+  if(!fCurrentVertex)success=kFALSE;
+  if(fCurrentVertex && fCurrentVertex->GetNContributors()<1)success=kFALSE;
+  if(!success){
+    AliWarning("Tracklets multiplicity not determined because the primary vertex was not found");
+    return;
+  }
+  AliITSMultReconstructor* multReco = new AliITSMultReconstructor();
+  AliRunLoader *rl =AliRunLoader::GetRunLoader();
+  AliITSLoader* itsLoader = (AliITSLoader*)rl->GetLoader("ITSLoader");
+  multReco->SetGeometry(itsLoader->GetITSgeom());
+  itsLoader->LoadRecPoints();
+  rl->GetEvent(evnumber);
+  TTree* itsClusterTree = itsLoader->TreeR();
+  if (!itsClusterTree) {
+    AliError(" Can't get the ITS cluster tree !\n");
+    return;
+  }
+  Double_t vtx[3];
+  fCurrentVertex->GetXYZ(vtx);
+  Float_t vtxf[3];
+  for(Int_t i=0;i<3;i++)vtxf[i]=vtx[i];
+  multReco->SetHistOn(kFALSE);
+  multReco->Reconstruct(itsClusterTree,vtxf,vtxf);
+  cout<<"======================================================="<<endl;
+  cout<<"Event number "<<evnumber<<"; tracklets= "<<multReco->GetNTracklets()<<endl;
+  Int_t notracks=multReco->GetNTracklets();
+  Float_t *trk = new Float_t [notracks];
+  Float_t *phi = new Float_t [notracks];
+  Float_t *dphi = new Float_t [notracks];
+  for(Int_t i=0;i<multReco->GetNTracklets();i++){
+    trk[i] = multReco->GetTracklet(i)[0];
+    phi[i] =  multReco->GetTracklet(i)[1];
+    dphi[i] = multReco->GetTracklet(i)[2];
+  }
+  fMult = new AliMultiplicity(notracks,trk,phi, dphi);
+  delete [] trk;
+  delete [] phi;
+  delete [] dphi;
+  for(Int_t i=0;i<multReco->GetNTracklets();i++){
+    cout<<i<<") theta= "<<fMult->GetTheta(i)<<", phi= "<<fMult->GetPhi(i)<<", DeltaPhi= "<<fMult->GetDeltaPhi(i)<<endl;
+  }
+  itsLoader->UnloadRecPoints();
+  delete multReco;
+  return;
+}
 
 //______________________________________________________________________
 void AliITSVertexer::WriteCurrentVertex(){