]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changes to use the mean vertexer DA
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Jul 2010 13:40:16 +0000 (13:40 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Jul 2010 13:40:16 +0000 (13:40 +0000)
ITS/AliITSDetTypeRec.cxx
ITS/AliITSMeanVertexer.cxx
ITS/AliITSMeanVertexer.h

index 41728ce2c2202e8ea1ae5a0aec344011245ca463..d691f2a89e8342e018f335686413fbcf7579817c 100644 (file)
@@ -390,17 +390,17 @@ void AliITSDetTypeRec::SetDefaults(){
       SetSegmentationModel(dettype,seg);
       SetDigitClassName(dettype,"AliITSdigitSPD");
     }
-    if(fLoadOnlySPDCalib==kFALSE){
-      if(dettype==1){
-       seg = new AliITSsegmentationSDD();
+    if(dettype==1){
+      seg = new AliITSsegmentationSDD();
+      if(fLoadOnlySPDCalib==kFALSE){
        AliITSCalibrationSDD* cal=(AliITSCalibrationSDD*)GetCalibrationModel(fgkDefaultNModulesSPD+1);
        if(cal->IsAMAt20MHz()){ 
          seg->SetPadSize(seg->Dpz(0),20.);
          seg->SetNPads(seg->Npz()/2,128);
        }
-       SetSegmentationModel(dettype,seg);
-       SetDigitClassName(dettype,"AliITSdigitSDD");
       }
+      SetSegmentationModel(dettype,seg);
+      SetDigitClassName(dettype,"AliITSdigitSDD");
     }
     if(dettype==2){
       AliITSsegmentationSSD* seg2 = new AliITSsegmentationSSD();
index b4ccaab9378e70e6bb2688807acda76f377f26a6..80bc6d92f56f338f246a89fda7640e33fd473b2c 100644 (file)
@@ -5,6 +5,7 @@
 #include "AliITSDetTypeRec.h"
 #include "AliITSInitGeometry.h"
 #include "AliITSMeanVertexer.h"
+#include "AliITSRecPointContainer.h"
 #include "AliITSLoader.h"
 #include "AliLog.h"
 #include "AliRawReader.h"
@@ -38,7 +39,7 @@ ClassImp(AliITSMeanVertexer)
 /* $Id$ */
 
 //______________________________________________________________________
-AliITSMeanVertexer::AliITSMeanVertexer():TObject(),
+AliITSMeanVertexer::AliITSMeanVertexer(Bool_t mode):TObject(),
 fDetTypeRec(NULL),
 fVertexXY(NULL),
 fVertexZ(NULL),
@@ -48,7 +49,9 @@ fAverTracklets(0.),
 fTotTrackletsSq(0.),
 fSigmaOnAverTracks(0.), 
 fFilterOnContributors(0),
-fFilterOnTracklets(0)
+fFilterOnTracklets(0),
+fMode(mode),
+fVertexer(NULL)
 {
   // Default Constructor
   for(Int_t i=0;i<3;i++){
@@ -100,6 +103,15 @@ Bool_t AliITSMeanVertexer::Init() {
   SetFilterOnContributors();
   SetFilterOnTracklets();
 
+  // Instatiate vertexer
+  if (!fMode) {
+    fVertexer = new AliITSVertexer3DTapan(1000);
+  }
+  else {
+    fVertexer = new AliITSVertexer3D();
+    fVertexer->SetDetTypeRec(fDetTypeRec);
+    fVertexer->SetComputeMultiplicity(kTRUE);
+  }
   return kTRUE;
 }
 
@@ -109,35 +121,27 @@ AliITSMeanVertexer::~AliITSMeanVertexer() {
   delete fDetTypeRec;
   delete fVertexXY;
   delete fVertexZ;
+  delete fVertexer;
 }
 
 //______________________________________________________________________
-Bool_t AliITSMeanVertexer::Reconstruct(AliRawReader *rawReader, Bool_t mode){
+Bool_t AliITSMeanVertexer::Reconstruct(AliRawReader *rawReader){
   // Performs SPD local reconstruction
   // and vertex finding
   // returns true in case a vertex is found
 
   // Run SPD cluster finder
+  AliITSRecPointContainer::Instance()->PrepareToRead();
   TTree* clustersTree = new TTree("TreeR", "Reconstructed Points Container"); //make a tree
   fDetTypeRec->DigitsToRecPoints(rawReader,clustersTree,"SPD");
 
   Bool_t vtxOK = kFALSE;
-  AliESDVertex *vtx = NULL;
-  // Run Tapan's vertex-finder
-  if (!mode) {
-    AliITSVertexer3DTapan *vertexer1 = new AliITSVertexer3DTapan(1000);
-    vtx = vertexer1->FindVertexForCurrentEvent(clustersTree);
-    delete vertexer1;
+  AliESDVertex *vtx = fVertexer->FindVertexForCurrentEvent(clustersTree);
+  if (!fMode) {
     if (TMath::Abs(vtx->GetChi2()) < 0.1) vtxOK = kTRUE;
   }
   else {
-  // Run standard vertexer3d
-    AliITSVertexer3D *vertexer2 = new AliITSVertexer3D();
-    vertexer2->SetDetTypeRec(fDetTypeRec);
-    vertexer2->SetComputeMultiplicity(kTRUE);
-    vtx = vertexer2->FindVertexForCurrentEvent(clustersTree);
-    AliMultiplicity *mult = vertexer2->GetMultiplicity();
-    delete vertexer2;
+    AliMultiplicity *mult = fVertexer->GetMultiplicity();
     if(Filter(vtx,mult)) vtxOK = kTRUE;
   }
   delete clustersTree;
index da2e67e3fb8406f22e681198cd2b23bfc748d1bb..4fb734da139a0aef1ebbfeb2781e4d0b021a9330 100644 (file)
@@ -18,19 +18,20 @@ class AliRawReader;
 class AliMultiplicity;
 class AliESDVertex;
 class AliITSDetTypeRec;
+class AliITSVertexer;
 
 class AliITSMeanVertexer : public TObject {
 
  public:
   // default constructor
-    AliITSMeanVertexer();   
+    AliITSMeanVertexer(Bool_t mode = kTRUE);   
     virtual ~AliITSMeanVertexer();
  
     Bool_t Init();
  
     void   SetFilterOnContributors(Int_t nc=1){fFilterOnContributors = nc;}
     void   SetFilterOnTracklets(Int_t nc=1){fFilterOnTracklets = nc;}
-    Bool_t Reconstruct(AliRawReader *rawReader, Bool_t mode = kTRUE);
+    Bool_t Reconstruct(AliRawReader *rawReader);
     void   WriteVertices(const char *filename);
 
     const TH2F*GetVertexXY() const { return fVertexXY; }
@@ -65,6 +66,9 @@ class AliITSMeanVertexer : public TObject {
     Float_t fSigmaOnAverTracks;  //! RMS of fAverTracklets
     Int_t fFilterOnContributors; //! Numb. of contrib must be > fFilter...
     Int_t fFilterOnTracklets;    //! Numb. of tracklets must be > fFilterOnTr...
+    Bool_t fMode;                //! kTRUE for Vertexer3D; 
+                                 //! kFALSE for VertexerTapan
+    AliITSVertexer* fVertexer;   //! vertexer
 
     ClassDef(AliITSMeanVertexer,0)
 };