]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSMapA1.cxx
Adding the full covariance matrix for the ITS space-points
[u/mrichter/AliRoot.git] / ITS / AliITSMapA1.cxx
index 787d5759646ac2f5a670ae41dd66dfcf430b2130..6c19dcdc6b7edba55c3399a24e469e0e238695c6 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 #include <TObjArray.h>
-#include <TMath.h>
-
 #include "AliITSMapA1.h"
 #include "AliITSsegmentation.h"
-#include "AliITSresponse.h"
 #include "AliITSdigit.h"
 
 ////////////////////////////////////////////////////////////////////////
@@ -41,6 +38,7 @@ AliITSMapA1::AliITSMapA1(){
     fObjects      = 0;
     fNobjects     = 0;
     fMapThreshold = 0;
+    fMapThresholdArr = 0;
 }
 //______________________________________________________________________
 AliITSMapA1::AliITSMapA1(AliITSsegmentation *seg){
@@ -54,6 +52,7 @@ AliITSMapA1::AliITSMapA1(AliITSsegmentation *seg){
     fObjects      = 0;
     fNobjects     = 0;
     fMapThreshold = 0;
+    fMapThresholdArr = 0;
     ClearMap();
 }
 //______________________________________________________________________
@@ -69,6 +68,7 @@ AliITSMapA1::AliITSMapA1(AliITSsegmentation *seg, TObjArray *obj){
     fObjects      =  obj;
     if(fObjects) fNobjects = fObjects->GetEntriesFast();
     fMapThreshold = 0;
+    fMapThresholdArr = 0;
     ClearMap();
 }
 //______________________________________________________________________
@@ -86,6 +86,23 @@ AliITSMapA1::AliITSMapA1(AliITSsegmentation *seg, TObjArray *obj, Int_t thr){
     fMapThreshold = thr;
     ClearMap();
 }
+//______________________________________________________________________
+AliITSMapA1::AliITSMapA1(AliITSsegmentation *seg, TObjArray *obj, TArrayI thr){
+    //constructor
+
+    fNobjects     = 0;
+    fSegmentation = seg;
+    fNpz          = fSegmentation->Npz();
+    fNpx          = fSegmentation->Npx();
+    fMaxIndex     = fNpz*fNpx+fNpx;             // 2 halves of detector
+    fHitMap       = new Int_t[fMaxIndex];
+    fObjects      =  obj;
+    if(fObjects) fNobjects = fObjects->GetEntriesFast();
+    fMapThreshold = 0;
+    fMapThresholdArr = thr;
+    ClearMap();
+}
+
 //______________________________________________________________________
 AliITSMapA1::~AliITSMapA1(){
     //destructor
@@ -105,6 +122,7 @@ AliITSMapA1& AliITSMapA1::operator=(const AliITSMapA1 &source) {
     this->fMaxIndex     = source.fMaxIndex;
     this->fHitMap       = source.fHitMap;
     this->fMapThreshold = source.fMapThreshold;
+    this->fMapThresholdArr = source.fMapThresholdArr;
     return *this;
 }
 //______________________________________________________________________
@@ -156,6 +174,22 @@ void  AliITSMapA1::FillMap(){
        } // end if fSignal > fMapthreshold
     } // end for ndig
 }
+//______________________________________________________________________
+void  AliITSMapA1::FillMap2(){
+    // fill array with digits indices
+
+    Int_t ndigits = fObjects->GetEntriesFast();
+    if (!ndigits) return;
+
+    AliITSdigit *dig;
+    for (Int_t ndig=0; ndig<ndigits; ndig++) {
+       dig = (AliITSdigit*)fObjects->UncheckedAt(ndig);
+       if(dig->GetSignal() > fMapThresholdArr[dig->GetCoord1()]) {
+           SetHit(dig->GetCoord1(),dig->GetCoord2(),ndig);
+       } // end if fSignal > fMapthreshold
+    } // end for ndig
+}
+
 //______________________________________________________________________
 void  AliITSMapA1::SetHit(Int_t iz, Int_t ix, Int_t idigit){
     // set the digit index at a certain position in array
@@ -199,7 +233,7 @@ Double_t AliITSMapA1::GetSignal(Int_t iz, Int_t ix){
     return signal;
 }
 //______________________________________________________________________
-FlagType AliITSMapA1::TestHit(Int_t iz, Int_t ix){
+FlagType AliITSMapA1::TestHit(Int_t iz, Int_t ix) {
     // check whether the digit has already been flagged
 
     if (CheckedIndex(iz, ix) < 0) return kEmpty;