Use access functions to AliMUONDigit member data.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 26 Jan 2001 21:41:55 +0000 (21:41 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 26 Jan 2001 21:41:55 +0000 (21:41 +0000)
MUON/AliMUONClusterFinderVS.cxx
MUON/AliMUONClusterInput.cxx
MUON/AliMUONClusterInput.h
MUON/AliMUONDisplay.cxx

index 8555498d8d52703c18160fd29a08a933205f4853..444ed5a78635e593af657eee094af028209b9d59 100644 (file)
@@ -14,6 +14,9 @@
  **************************************************************************/
 /*
 $Log$
+Revision 1.17  2001/01/23 18:58:19  hristov
+Initialisation of some pointers
+
 Revision 1.16  2000/12/21 23:27:30  morsch
 Error in argument list of AddRawCluster corrected.
 
@@ -181,10 +184,10 @@ void AliMUONClusterFinderVS::SplitByLocalMaxima(AliMUONRawCluster *c)
            // pointer to digit
            fDig[i][cath]=fInput->Digit(cath, c->fIndexMap[i][cath]);
            // pad coordinates
-           fIx[i][cath]= fDig[i][cath]->fPadX;
-           fIy[i][cath]= fDig[i][cath]->fPadY;
+           fIx[i][cath]= fDig[i][cath]->PadX();
+           fIy[i][cath]= fDig[i][cath]->PadY();
            // pad charge
-           fQ[i][cath] = fDig[i][cath]->fSignal;
+           fQ[i][cath] = fDig[i][cath]->Signal();
            // pad centre coordinates
            fSeg[cath]->
                GetPadC(fIx[i][cath], fIy[i][cath], fX[i][cath], fY[i][cath], fZ[i][cath]);
@@ -895,12 +898,12 @@ void AliMUONClusterFinderVS::FindLocalMaxima(AliMUONRawCluster* c)
                digt=(AliMUONDigit*) fHitMap[cath]->GetHit(x[j], y[j]);
                isec=fSeg[cath]->Sector(x[j], y[j]);
                Float_t a1 = fSeg[cath]->Dpx(isec)*fSeg[cath]->Dpy(isec);
-               if (digt->fSignal/a1 > fQ[i][cath]/a0) {
+               if (digt->Signal()/a1 > fQ[i][cath]/a0) {
                    isLocal[i][cath]=kFALSE;
                    break;
 //
 // handle special case of neighbouring pads with equal signal
-               } else if (digt->fSignal == fQ[i][cath]) {
+               } else if (digt->Signal() == fQ[i][cath]) {
                    if (fNLocal[cath]>0) {
                        for (Int_t k=0; k<fNLocal[cath]; k++) {
                            if (x[j]==fIx[fIndLocal[k][cath]][cath] 
@@ -968,7 +971,7 @@ void AliMUONClusterFinderVS::FindLocalMaxima(AliMUONRawCluster* c)
                if (fHitMap[cath]->TestHit(ix, iy)!=kEmpty) {
                    iNN++;
                    digt=(AliMUONDigit*) fHitMap[cath]->GetHit(ix,iy);
-                   if (digt->fSignal > fQ[i][cath]) isLocal[i][cath]=kFALSE;
+                   if (digt->Signal() > fQ[i][cath]) isLocal[i][cath]=kFALSE;
                }
            } // Loop over pad neighbours in y
            if (isLocal[i][cath] && iNN>0) {
@@ -1031,7 +1034,7 @@ void AliMUONClusterFinderVS::FindLocalMaxima(AliMUONRawCluster* c)
                if (fHitMap[cath]->TestHit(ix, iy)!=kEmpty) {
                    iNN++;
                    digt=(AliMUONDigit*) fHitMap[cath]->GetHit(ix,iy);
-                   if (digt->fSignal > fQ[i][cath]) isLocal[i][cath]=kFALSE;
+                   if (digt->Signal() > fQ[i][cath]) isLocal[i][cath]=kFALSE;
                }
            } // Loop over pad neighbours in x
            if (isLocal[i][cath] && iNN>0) {
@@ -1077,14 +1080,14 @@ void  AliMUONClusterFinderVS::FillCluster(AliMUONRawCluster* c, Int_t flag, Int_
     for (Int_t i=0; i<c->fMultiplicity[cath]; i++)
     {
        dig= fInput->Digit(cath,c->fIndexMap[i][cath]);
-       ix=dig->fPadX+c->fOffsetMap[i][cath];
-       iy=dig->fPadY;
-       Int_t q=dig->fSignal;
+       ix=dig->PadX()+c->fOffsetMap[i][cath];
+       iy=dig->PadY();
+       Int_t q=dig->Signal();
        if (!flag) q=Int_t(q*c->fContMap[i][cath]);
 //     fprintf(stderr,"q %d c->fPeakSignal[ %d ] %d\n",q,cath,c->fPeakSignal[cath]);
-       if (dig->fPhysics >= dig->fSignal) {
+       if (dig->Physics() >= dig->Signal()) {
            c->fPhysicsMap[i]=2;
-       } else if (dig->fPhysics == 0) {
+       } else if (dig->Physics() == 0) {
            c->fPhysicsMap[i]=0;
        } else  c->fPhysicsMap[i]=1;
 //
@@ -1093,9 +1096,9 @@ void  AliMUONClusterFinderVS::FillCluster(AliMUONRawCluster* c, Int_t flag, Int_
 // peak signal and track list
        if (q>c->fPeakSignal[cath]) {
            c->fPeakSignal[cath]=q;
-           c->fTracks[0]=dig->fHit;
-           c->fTracks[1]=dig->fTracks[0];
-           c->fTracks[2]=dig->fTracks[1];
+           c->fTracks[0]=dig->Hit();
+           c->fTracks[1]=dig->Track(0);
+           c->fTracks[2]=dig->Track(1);
 //         fprintf(stderr," c->fTracks[0] %d c->fTracks[1] %d\n",dig->fHit,dig->fTracks[0]);
        }
 //
@@ -1150,7 +1153,7 @@ void  AliMUONClusterFinderVS::FillCluster(AliMUONRawCluster* c, Int_t cath)
     {
        dig = fInput->Digit(cath,c->fIndexMap[i][cath]);
        fSeg[cath]->
-       GetPadC(dig->fPadX,dig->fPadY,xpad,ypad, zpad);
+       GetPadC(dig->PadX(),dig->PadY(),xpad,ypad, zpad);
        fprintf(stderr,"x %f y %f cx %f cy %f\n",xpad,ypad,c->fX[0],c->fY[0]);
        dx = xpad - c->fX[0];
        dy = ypad - c->fY[0];
@@ -1159,17 +1162,18 @@ void  AliMUONClusterFinderVS::FillCluster(AliMUONRawCluster* c, Int_t cath)
        if (dr < dr0) {
            dr0 = dr;
            fprintf(stderr," dr %f\n",dr);
-           Int_t q=dig->fSignal;
-           if (dig->fPhysics >= dig->fSignal) {
+           Int_t q=dig->Signal();
+           if (dig->Physics() >= dig->Signal()) {
                c->fPhysicsMap[i]=2;
-           } else if (dig->fPhysics == 0) {
+           } else if (dig->Physics() == 0) {
                c->fPhysicsMap[i]=0;
            } else  c->fPhysicsMap[i]=1;
            c->fPeakSignal[cath]=q;
-           c->fTracks[0]=dig->fHit;
-           c->fTracks[1]=dig->fTracks[0];
-           c->fTracks[2]=dig->fTracks[1];
-           fprintf(stderr," c->fTracks[0] %d c->fTracks[1] %d\n",dig->fHit,dig->fTracks[0]);
+           c->fTracks[0]=dig->Hit();
+           c->fTracks[1]=dig->Track(0);
+           c->fTracks[2]=dig->Track(1);
+           fprintf(stderr," c->fTracks[0] %d c->fTracks[1] %d\n",dig->Hit(),
+                   dig->Track(0));
        }
 //
     } // loop over digits
@@ -1190,15 +1194,15 @@ void  AliMUONClusterFinderVS::FindCluster(Int_t i, Int_t j, Int_t cath, AliMUONR
     
     Int_t idx = fHitMap[cath]->GetHitIndex(i,j);
     AliMUONDigit* dig = (AliMUONDigit*) fHitMap[cath]->GetHit(i,j);
-    Int_t q=dig->fSignal;
-    Int_t theX=dig->fPadX;
-    Int_t theY=dig->fPadY
+    Int_t q=dig->Signal();
+    Int_t theX=dig->PadX();
+    Int_t theY=dig->PadY()
    
     if (q > TMath::Abs(c.fPeakSignal[0]) && q > TMath::Abs(c.fPeakSignal[1])) {
        c.fPeakSignal[cath]=q;
-       c.fTracks[0]=dig->fHit;
-       c.fTracks[1]=dig->fTracks[0];
-       c.fTracks[2]=dig->fTracks[1];
+       c.fTracks[0]=dig->Hit();
+       c.fTracks[1]=dig->Track(0);
+       c.fTracks[2]=dig->Track(1);
     }
 
 //
@@ -1207,9 +1211,9 @@ void  AliMUONClusterFinderVS::FindCluster(Int_t i, Int_t j, Int_t cath, AliMUONR
     Int_t mu=c.fMultiplicity[cath];
     c.fIndexMap[mu][cath]=idx;
     
-    if (dig->fPhysics >= dig->fSignal) {
+    if (dig->Physics() >= dig->Signal()) {
         c.fPhysicsMap[mu]=2;
-    } else if (dig->fPhysics == 0) {
+    } else if (dig->Physics() == 0) {
         c.fPhysicsMap[mu]=0;
     } else  c.fPhysicsMap[mu]=1;
 
@@ -1217,9 +1221,9 @@ void  AliMUONClusterFinderVS::FindCluster(Int_t i, Int_t j, Int_t cath, AliMUONR
     if (mu > 0) {
        for (Int_t ind = mu-1; ind >= 0; ind--) {
            Int_t ist=(c.fIndexMap)[ind][cath];
-           Int_t ql=fInput->Digit(cath, ist)->fSignal;
-           Int_t ix=fInput->Digit(cath, ist)->fPadX;
-           Int_t iy=fInput->Digit(cath, ist)->fPadY;
+           Int_t ql=fInput->Digit(cath, ist)->Signal();
+           Int_t ix=fInput->Digit(cath, ist)->PadX();
+           Int_t iy=fInput->Digit(cath, ist)->PadY();
            
            if (q>ql || (q==ql && theX > ix && theY < iy)) {
                c.fIndexMap[ind][cath]=idx;
@@ -1339,8 +1343,8 @@ void AliMUONClusterFinderVS::FindRawClusters()
     for (cath=0; cath<2; cath++) {
        for (ndig=0; ndig<fInput->NDigits(cath); ndig++) {
            dig = fInput->Digit(cath, ndig);
-           Int_t i=dig->fPadX;
-           Int_t j=dig->fPadY;
+           Int_t i=dig->PadX();
+           Int_t j=dig->PadY();
            if (fHitMap[cath]->TestHit(i,j)==kUsed ||fHitMap[0]->TestHit(i,j)==kEmpty) {
                nskip++;
                continue;
@@ -1349,10 +1353,10 @@ void AliMUONClusterFinderVS::FindRawClusters()
            AliMUONRawCluster c;
            c.fMultiplicity[0]=0;
            c.fMultiplicity[1]=0;
-           c.fPeakSignal[cath]=dig->fSignal;
-           c.fTracks[0]=dig->fHit;
-           c.fTracks[1]=dig->fTracks[0];
-           c.fTracks[2]=dig->fTracks[1];
+           c.fPeakSignal[cath]=dig->Signal();
+           c.fTracks[0]=dig->Hit();
+           c.fTracks[1]=dig->Track(0);
+           c.fTracks[2]=dig->Track(1);
            // tag the beginning of cluster list in a raw cluster
            c.fNcluster[0]=-1;
            Float_t xcu, ycu;
index ba516d65118d0cbd70913d394a7f63c54184f592..e0d7f28206740175d78762ba340e8e666ada6fec 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.8  2001/01/23 18:58:19  hristov
+Initialisation of some pointers
+
 Revision 1.7  2000/12/21 22:14:38  morsch
 Clean-up of coding rule violations.
 
@@ -148,10 +151,10 @@ void  AliMUONClusterInput::SetCluster(AliMUONRawCluster* cluster)
            digit =(AliMUONDigit*)
                (fDigits[cath]->UncheckedAt(cluster->fIndexMap[i][cath]));
            // pad coordinates
-           ix = digit->fPadX;
-           iy = digit->fPadY;
+           ix = digit->PadX();
+           iy = digit->PadY();
            // pad charge
-           fCharge[i][cath] = digit->fSignal;
+           fCharge[i][cath] = digit->Signal();
            // pad centre coordinates
 //         fSegmentation[cath]->GetPadCxy(ix, iy, x, y);
             // globals kUsed in fitting functions
@@ -253,5 +256,3 @@ AliMUONClusterInput& AliMUONClusterInput
 // Dummy assignment operator
     return *this;
 }
-
-
index 07f5be4e0a46ccf73dbdebea7d946fccda2871bd..cdf08639def6b0242f70424714fcef7f7c738e04 100644 (file)
@@ -47,7 +47,7 @@ class AliMUONClusterInput : public TObject {
     AliMUONClusterInput(const AliMUONClusterInput& clusterInput){;}
     AliMUONClusterInput & operator = (const AliMUONClusterInput& rhs);
  private:
-    static AliMUONClusterInput* fgClusterInput; // singleton instance
+    static AliMUONClusterInput* fgClusterInput; // singleton instance
     // Digits
     TClonesArray*        fDigits[2];       // ! Array of pointers to digits
     Int_t                fNDigits[2];      // ! Number of digits
@@ -65,7 +65,7 @@ class AliMUONClusterInput : public TObject {
     Float_t              fCharge[500][2];  // ! List of charges for current cluster
     Int_t                fChargeTot[2];    // ! Total charge
     Float_t              fQtot[2];         // ! Total charge
-    Float_t              fZ;                // ! Current z-position
+    Float_t              fZ;               // ! Current z-position
     // Fitter
     static TMinuit*      fgMinuit;          // ! Fitter
     ClassDef(AliMUONClusterInput, 0)        // Global data service for hit reconstruction
index ac16b6d7fd7e0eecdb0d0656170b9ac1331ee9d5..0796e41c2a5f9840080f8ad2ea6fa7c3565547ca 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.10  2001/01/25 20:41:56  morsch
+Protect against empty TreeD and TreeR.
+
 Revision 1.9  2001/01/23 18:58:19  hristov
 Initialisation of some pointers
 
@@ -517,7 +520,7 @@ void AliMUONDisplay::DisplayColorScale()
     AliMUONChamber *iChamber = &(pMUON->Chamber(fChamber-1));
     AliMUONResponse * response=iChamber->ResponseModel();
     Int_t adcmax=1024;
-    if (response) adcmax= (Int_t) response->MaxAdc();
+    if (response) adcmax = (Int_t) response->MaxAdc();
     
 
     TBox *box;
@@ -804,13 +807,11 @@ void AliMUONDisplay::DrawView(Float_t theta, Float_t phi, Float_t psi)
 // Display MUON Chamber Geometry
     char nodeName[7];
     sprintf(nodeName,"MUON%d",100+fChamber);
-    printf("\n Node name %s %p", nodeName, gAlice->GetGeometry());
     
     TNode *node1=gAlice->GetGeometry()->GetNode(nodeName);
     if (node1) node1->Draw("same");  
 //add clusters to the pad
     DrawClusters();
-    printf("Node name %s", nodeName);   
     DrawHits();
     DrawCoG();
     DrawCoG2();
@@ -897,12 +898,12 @@ void AliMUONDisplay::LoadDigits(Int_t chamber, Int_t cathode)
 
     if (chamber > 14) return;
     printf(" chamber %d \n",chamber);
-    fChamber=chamber;
-    fCathode=cathode;
+    fChamber = chamber;
+    fCathode = cathode;
     
     ResetPoints();
     
-    AliMUON *pMUON  = (AliMUON*)gAlice->GetModule("MUON");
+    AliMUON *pMUON  =     (AliMUON*)gAlice->GetModule("MUON");
     AliMUONChamber*       iChamber;
     AliSegmentation*      segmentation;
     AliMUONResponse*      response;
@@ -914,8 +915,9 @@ void AliMUONDisplay::LoadDigits(Int_t chamber, Int_t cathode)
     Int_t nent = 0;
  
    if (gAlice->TreeD()) {
-       nent=(Int_t)gAlice->TreeD()->GetEntries();
-       gAlice->TreeD()->GetEvent(nent-2+cathode-1);
+       nent = (Int_t) gAlice->TreeD()->GetEntries();
+       printf(" entries %d \n", nent);
+       gAlice->TreeD()->GetEvent(cathode-1);
     }
     
     Int_t ndigits = muonDigits->GetEntriesFast();
@@ -926,51 +928,56 @@ void AliMUONDisplay::LoadDigits(Int_t chamber, Int_t cathode)
 
     segmentation = iChamber->SegmentationModel(cathode);
     response     = iChamber->ResponseModel();
-    Float_t zpos=iChamber->Z();  
+    Float_t zpos = iChamber->Z();
+
+    segmentation->Dump();
+    
     AliMUONDigit  *mdig;
-    AliMUONPoints *points = 0;
-    TMarker3DBox *marker=0;
+    AliMUONPoints *points  = 0;
+    TMarker3DBox  *marker  = 0;
     //
     //loop over all digits and store their position
     
-    Int_t npoints=1;
-    Float_t adcmax=1024;
-    if (response) adcmax= response->MaxAdc();
+    Int_t npoints  = 1;
+    Float_t adcmax = 1024;
+    if (response) adcmax = response->MaxAdc();
 
-    for (Int_t digit=0;digit<ndigits;digit++) {
+    for (Int_t digit = 0; digit < ndigits; digit++) {
         mdig    = (AliMUONDigit*)muonDigits->UncheckedAt(digit);
+       if (mdig->Cathode() != cathode-1) continue;
+
         //
         // First get all needed parameters
         //
-        Int_t charge=mdig->fSignal;
-        Int_t index=Int_t(TMath::Log(charge)/(TMath::Log(adcmax)/22));
-        Int_t color=261+index;
-       Int_t colorTrigger=2;   
-        if (color>282) color=282;
+        Int_t charge = mdig->Signal();
+        Int_t index  = Int_t(TMath::Log(charge)/(TMath::Log(adcmax)/22));
+        Int_t color  = 261+index;
+       Int_t colorTrigger = 2;   
+        if (color > 282) color = 282;
 
        if (chamber > 10) { // trigger chamber 
-           Int_t sumCharge=0;
-           for (Int_t icharge=0; icharge<10; icharge++) {
-               sumCharge=sumCharge+mdig->fTcharges[icharge];
+           Int_t sumCharge = 0;
+           for (Int_t icharge = 0; icharge < 10; icharge++) {
+               sumCharge = sumCharge+mdig->TrackCharge(icharge);
            }
-           Int_t testCharge=sumCharge-(Int_t(sumCharge/10))*10;
-           if(sumCharge<=10||testCharge>0) {
-               colorTrigger=color; 
+           Int_t testCharge = sumCharge-(Int_t(sumCharge/10))*10;
+           if(sumCharge <= 10 || testCharge > 0) {
+               colorTrigger = color; 
            } else {
-               colorTrigger=5; 
+               colorTrigger = 5; 
            }
        }
 
        // get the center of the pad - add on x and y half of pad size
        Float_t xpad, ypad, zpad;
-       segmentation->GetPadC(mdig->fPadX, mdig->fPadY,xpad, ypad, zpad);
+       segmentation->GetPadC(mdig->PadX(), mdig->PadY(), xpad, ypad, zpad);
+       
+        Int_t   isec = segmentation->Sector(mdig->PadX(), mdig->PadY());
+        Float_t  dpx = segmentation->Dpx(isec)/2;
+        Float_t  dpy = segmentation->Dpy(isec)/2;
+//
+//     segmentation->Dump();
        
-        Int_t isec=segmentation->Sector(mdig->fPadX, mdig->fPadY);
-        Float_t dpx=segmentation->Dpx(isec)/2;
-        Float_t dpy=segmentation->Dpy(isec)/2;
-       Int_t nPara, offset;
-        segmentation->GetNParallelAndOffset(mdig->fPadX,mdig->fPadY,
-               &nPara,&offset);
        //
        // Then set the objects
        //
@@ -988,17 +995,16 @@ void AliMUONDisplay::LoadDigits(Int_t chamber, Int_t cathode)
         points->SetTrackIndex(-1);
         points->SetDigitIndex(digit);
         points->SetPoint(0,xpad,ypad,zpos);    
-       for (Int_t imark=0;imark<nPara; imark++)
-       {
-           Int_t lineColor = (zpad-zpos > 0) ? 2:3;
-           segmentation->GetPadC(mdig->fPadX + imark*offset, mdig->fPadY,xpad, ypad, zpad);
-           marker=new TMarker3DBox(xpad,ypad,zpos,dpx,dpy,0,0,0);
-           marker->SetLineColor(lineColor);
-           marker->SetFillStyle(1001);
-           marker->SetFillColor(color);
-           marker->SetRefObject((TObject*)points);
-           points->Set3DMarker(imark, marker);
-       }
+
+       Int_t lineColor = (zpad-zpos > 0) ? 2:3;
+       marker=new TMarker3DBox(xpad,ypad,zpos,dpx,dpy,0,0,0);
+
+           
+       marker->SetLineColor(lineColor);
+       marker->SetFillStyle(1001);
+       marker->SetFillColor(color);
+       marker->SetRefObject((TObject*)points);
+       points->Set3DMarker(0, marker);
     }
 }
 //___________________________________________
@@ -1117,8 +1123,8 @@ void AliMUONDisplay::LoadHits(Int_t chamber)
     Float_t zpos=iChamber->Z();
 
     Int_t ntracks = (Int_t)gAlice->TreeH()->GetEntries();
-    Int_t nthits=0;
-    for (track=0; track<ntracks;track++) {
+    Int_t nthits  = 0;
+    for (track = 0; track < ntracks; track++) {
        gAlice->ResetHits();
        gAlice->TreeH()->GetEvent(track);
        TClonesArray *muonHits  = pMUON->Hits();
@@ -1139,7 +1145,7 @@ void AliMUONDisplay::LoadHits(Int_t chamber)
        Int_t npoints=1;
        for (Int_t hit=0;hit<nhits;hit++) {
             mHit = (AliMUONHit*)muonHits->UncheckedAt(hit);
-            Int_t nch  = mHit->fChamber;              // chamber number
+            Int_t nch  = mHit->Chamber();              // chamber number
             if (nch != chamber) continue;
            //
            // Retrieve info and set the objects