Geometry V2 updated with the final frames. Now completed.
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDHit.cxx
1 //  **************************************************************************
2 //  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 //  *                                                                        *
4 //  * Author: The ALICE Off-line Project.                                    *
5 //  * Contributors are mentioned in the code where appropriate.              *
6 //  *                                                                        *
7 //  * Permission to use, copy, modify and distribute this software and its   *
8 //  * documentation strictly for non-commercial purposes is hereby granted   *
9 //  * without fee, provided that the above copyright notice appears in all   *
10 //  * copies and that both the copyright notice and this permission notice   *
11 //  * appear in the supporting documentation. The authors make no claims     *
12 //  * about the suitability of this software for any purpose. It is          *
13 //  * provided "as is" without express or implied warranty.                  *
14 //  **************************************************************************
15
16 #include "AliHMPIDHit.h"  //class header
17 #include <TPDGCode.h>     //Draw() Print()
18 #include <TMarker.h>      //Draw()
19 #include <TClonesArray.h> //Hit2Sdi()
20 #include "AliHMPIDParam.h" 
21 ClassImp(AliHMPIDHit)
22 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 void AliHMPIDHit::Draw(Option_t*)
24 {
25 // Draw option of the hits in the display
26   Int_t iMark;
27   switch(Pid()){
28     case 50000050:   iMark=4;  break;
29     case 50000051:   iMark=27; break;
30     default:         iMark=26; break;
31   }    
32   TMarker *pMark=new TMarker(fLx,fLy,iMark); pMark->SetMarkerColor(kRed); pMark->Draw();
33 }//Draw
34 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
35 void AliHMPIDHit::Hit2Sdi(TClonesArray *pSdiLst,Int_t iHow)const
36 {
37 // Adds  sdigits of this hit to the list
38 // Arguments: pSdiLst- sigits list where to add new sdgits
39 //            iHow- how many pads to check 
40 //   Returns: none
41   Int_t pc,px,py;
42   AliHMPIDParam::Lors2Pad(fLx,fLy,pc,px,py); if(py<0) return; //check if the hit in dead zone. Should never happen during trasport!
43
44   AliHMPIDDigit dig;
45   Int_t iSdiCnt=pSdiLst->GetEntries();                       //list of sdigits contains sdigits from previous ivocations of Hit2Sdi, do not override them
46
47   for(Int_t i=-iHow;i<=iHow;i++){                            //horizontal loop
48     for(Int_t j=-iHow;j<=iHow;j++){                          //vertical loop
49       if(dig.Set(fCh,pc,px+i,py+j,fTrack)) continue;
50       dig.SetQ(fQ*dig.IntMathieson(fLx,fLy));
51       new((*pSdiLst)[iSdiCnt++]) AliHMPIDDigit(dig);
52     }
53   }
54 }//Hit2Sdi
55 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
56 void AliHMPIDHit::Print(Option_t *opt)const
57 {
58 //Print hit
59   char *sPart=Form("pid=%i",Pid());
60   switch(Pid()){
61     case kProton:      sPart="p+  ";break;
62     case kProtonBar:   sPart="p-  ";break;
63     case kKPlus:       sPart="K+  ";break;
64     case kKMinus:      sPart="K-  ";break;
65     case kPiPlus:      sPart="Pi+ ";break;
66     case kPiMinus:     sPart="Pi- ";break;
67     case kMuonPlus:    sPart="Mu+ ";break;
68     case kMuonMinus:   sPart="Mu- ";break;
69     case kElectron:    sPart="e-  ";break;
70     case kPositron:    sPart="e+  ";break;
71     case 50000050:     sPart="ckov";break;
72     case 50000051:     sPart="feed";break;
73   }
74
75   Printf("%sHIT: ch=%i                 (%7.6f,%7.6f) Q=%8.3f TID= %5i, MARS=(%7.2f,%7.2f,%7.2f) %s  %s",
76          opt,  Ch(),                    fLx,fLy,  fQ,     fTrack,         X(),  Y(),  Z(),   sPart, 
77                         (AliHMPIDParam::IsInDead(LorsX(),LorsY()))? "IN DEAD ZONE":"");
78 }//Print
79 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++