]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSVertexer.cxx
merging RecPoints and ClustersV2. All ClusterFinders produce AliITSRecPoints objects...
[u/mrichter/AliRoot.git] / ITS / AliITSVertexer.cxx
index a9bde2e4cde455ee3464e5c66ff20f80cf4f6911..aa9d30da436ac4cb88cd6e125295f0bb27e5ce98 100644 (file)
@@ -13,13 +13,9 @@ ClassImp(AliITSVertexer)
 //////////////////////////////////////////////////////////////////////
 
 //______________________________________________________________________
-AliITSVertexer::AliITSVertexer() {
+AliITSVertexer::AliITSVertexer():AliVertexer() {
   // Default Constructor
-
-    fCurrentVertex  = 0;
-    SetDebug();
-    SetFirstEvent(0);
-    SetLastEvent(0);
+  //SetUseV2Clusters(kTRUE);
 }
 
 AliITSVertexer::AliITSVertexer(TString filename) {
@@ -38,17 +34,18 @@ AliITSVertexer::AliITSVertexer(TString filename) {
   rl->LoadHeader();
   AliITSLoader* itsLoader =  (AliITSLoader*) rl->GetLoader("ITSLoader");
   if(!filename.Contains("default"))itsLoader->SetVerticesFileName(filename);
-  itsLoader->LoadVertices("recreate");
+  if(!filename.Contains("null"))itsLoader->LoadVertices("recreate");
   itsLoader->LoadRecPoints();
   Int_t lst;
   if(rl->TreeE()){
     lst = static_cast<Int_t>(rl->TreeE()->GetEntries());
     SetLastEvent(lst-1);
   }
+  //SetUseV2Clusters(kTRUE);
 }
 
 //______________________________________________________________________
-AliITSVertexer::AliITSVertexer(const AliITSVertexer &vtxr) : TObject(vtxr) {
+AliITSVertexer::AliITSVertexer(const AliITSVertexer &vtxr) : AliVertexer(vtxr) {
   // Copy constructor
   // Copies are not allowed. The method is protected to avoid misuse.
   Error("AliITSVertexer","Copy constructor not allowed\n");
@@ -62,14 +59,6 @@ AliITSVertexer& AliITSVertexer::operator=(const AliITSVertexer& /* vtxr */){
   return *this;
 }
 
-//______________________________________________________________________
-AliITSVertexer::~AliITSVertexer() {
-  // Default Destructor
-  // The objects pointed by the following pointers are not owned
-  // by this class and are not deleted
-
-    fCurrentVertex  = 0;
-}
 
 //______________________________________________________________________
 void AliITSVertexer::WriteCurrentVertex(){
@@ -82,3 +71,53 @@ void AliITSVertexer::WriteCurrentVertex(){
   Int_t rc = itsLoader->PostVertex(fCurrentVertex);
   rc = itsLoader->WriteVertices();
 }
+/*
+//______________________________________________________________________
+void AliITSVertexer::Clusters2RecPoints
+(const TClonesArray *clusters, Int_t idx, TClonesArray *points) {
+  //------------------------------------------------------------
+  // Conversion AliITSRecPoint -> AliITSRecPoints for the ITS
+  // module "idx" (entry in the tree with the clusters).
+  // Simplified version, supposed to work with the pixels only !
+  //------------------------------------------------------------
+  const Int_t klastSPD1=79; //let's hope the number of the SPDs will not change
+  const Int_t klastSPD2=239;//let's hope the number of the SPDs will not change
+
+  Float_t yshift = 0; //see AliITSclustererV2.cxx about these shifts
+  Float_t zshift[4] = {-10.708000, -3.536000, 3.536000, 10.708000}; //let's hope the positioning of the SPDs will not change
+
+  if (idx<=klastSPD1) {
+    yshift=0.248499;  //let's hope the positioning of the SPDs will not change
+  } else if (idx<=klastSPD2) {
+    yshift=3.096207;  //let's hope the positioning of the SPDs will not change
+  } else {
+    Fatal("Clusters2RecPoints","This is not an SPD module ! %d",idx);
+  }
+
+  TClonesArray &pn=*points;
+  Int_t ncl=clusters->GetEntriesFast();
+  for (Int_t i=0; i<ncl; i++) {
+    AliITSRecPoint p;
+    AliITSRecPoint *c = (AliITSRecPoint *)clusters->UncheckedAt(i);
+
+    Float_t x=c->GetY();  if (idx<=klastSPD1) x=-x;
+    x+=yshift;
+
+    Float_t z=c->GetZ();
+    z=-z; z+=zshift[idx%4];
+
+    p.SetDetLocalX(x);
+    p.SetDetLocalZ(z);
+    p.SetQ(c->GetQ());
+    p.SetSigmaDetLocX2(c->GetSigmaY2());
+    p.SetSigmaZ2(c->GetSigmaZ2());
+    p.SetLabel(c->GetLabel(0),0);
+    p.SetLabel(c->GetLabel(1),1);
+    p.SetLabel(c->GetLabel(2),2);
+
+    new (pn[i]) AliITSRecPoint(p);
+  }
+
+}
+
+*/