]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSMapA1.cxx
v11 geometry updates and elimination of V2clusters/recpoint choice from vertexers
[u/mrichter/AliRoot.git] / ITS / AliITSMapA1.cxx
index fdb73deed28ab91f7ca499b86a3ce9a24c4b7ca5..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,10 +122,11 @@ AliITSMapA1& AliITSMapA1::operator=(const AliITSMapA1 &source) {
     this->fMaxIndex     = source.fMaxIndex;
     this->fHitMap       = source.fHitMap;
     this->fMapThreshold = source.fMapThreshold;
+    this->fMapThresholdArr = source.fMapThresholdArr;
     return *this;
 }
 //______________________________________________________________________
-AliITSMapA1::AliITSMapA1(const AliITSMapA1 &source){
+AliITSMapA1::AliITSMapA1(const AliITSMapA1 &source) : AliITSMap(source){
     //     Copy Constructor
 
     *this = source;
@@ -127,7 +145,7 @@ void AliITSMapA1::SetArray(TObjArray *obj){
     if (fObjects) fNobjects = fObjects->GetEntriesFast();
 }
 //______________________________________________________________________
-Int_t AliITSMapA1::CheckedIndex(Int_t iz, Int_t ix){
+Int_t AliITSMapA1::CheckedIndex(Int_t iz, Int_t ix) const {
     //check boundaries and return an index in array
     Int_t index=fNpx*iz+ix;
 
@@ -151,11 +169,27 @@ void  AliITSMapA1::FillMap(){
     AliITSdigit *dig;
     for (Int_t ndig=0; ndig<ndigits; ndig++) {
        dig = (AliITSdigit*)fObjects->UncheckedAt(ndig);
-       if(dig->fSignal > fMapThreshold) {
-           SetHit(dig->fCoord1,dig->fCoord2,ndig);
+       if(dig->GetSignal() > fMapThreshold) {
+           SetHit(dig->GetCoord1(),dig->GetCoord2(),ndig);
+       } // 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
@@ -175,7 +209,7 @@ void AliITSMapA1::FlagHit(Int_t iz, Int_t ix){
     fHitMap[CheckedIndex(iz, ix)] = -TMath::Abs(fHitMap[CheckedIndex(iz, ix)]);
 }
 //______________________________________________________________________
-Int_t AliITSMapA1::GetHitIndex(Int_t iz, Int_t ix){
+Int_t AliITSMapA1::GetHitIndex(Int_t iz, Int_t ix) const {
     // return the digit index from a specific entry in array
 
     return TMath::Abs(fHitMap[CheckedIndex(iz, ix)])-1;
@@ -194,12 +228,12 @@ Double_t AliITSMapA1::GetSignal(Int_t iz, Int_t ix){
     Double_t signal;
 
     AliITSdigit *dig = (AliITSdigit*)GetHit(iz,ix);
-    if(dig) signal=(Double_t)dig->fSignal;
+    if(dig) signal=(Double_t)dig->GetSignal();
     else signal=0.;
     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;