]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HMPID/AliHMPIDHit.cxx
Copy constructor implemented.
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDHit.cxx
CommitLineData
d3da6dc4 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
3c6274c1 16#include "AliHMPIDHit.h" //class header
1d4857c5 17#include <TPDGCode.h> //Draw() Print()
18#include <TMarker.h> //Draw()
19#include <TClonesArray.h> //Hit2Sdi()
d3da6dc4 20
21ClassImp(AliHMPIDHit)
22//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
d1bf51e1 23void AliHMPIDHit::Draw(Option_t*)
24{
25 Int_t iMark;
26 switch(Pid()){
27 case 50000050: iMark=4; break;
28 case 50000051: iMark=27; break;
29 default: iMark=26; break;
30 }
1d4857c5 31 TMarker *pMark=new TMarker(fLx,fLy,iMark); pMark->SetMarkerColor(kRed); pMark->Draw();
d1bf51e1 32}
33//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1d4857c5 34void AliHMPIDHit::Hit2Sdi(TClonesArray *pSdiLst,Int_t iHow)const
35{
36// Adds sdigits of this hit to the list
37// Arguments: pSdiLst- sigits list where to add new sdgits
38// iHow- how many pads to check
39// Returns: none
40 Int_t pc,px,py;
41 AliHMPIDDigit::Lors2Pad(fLx,fLy,pc,px,py); if(pc<0) return; //check if the hit in dead zone. Should never happen during trasport!
42
43 AliHMPIDDigit dig;
44 Int_t iSdiCnt=pSdiLst->GetEntries(); //list of sdigits contains sdigits from previous ivocations of Hit2Sdi, do not override them
45
46 for(Int_t i=-iHow;i<=iHow;i++){ //horizontal loop
47 for(Int_t j=-iHow;j<=iHow;j++){ //vertical loop
48 if(dig.Set(fCh,pc,px+i,py+j,fQ*dig.Mathieson(fLx,fLy),fTrack)) continue;
49 new((*pSdiLst)[iSdiCnt++]) AliHMPIDDigit(dig);
50 }
51 }
52}
53//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
54void AliHMPIDHit::Print(Option_t *opt)const
d3da6dc4 55{
56//Print hit
57 char *sPart=Form("pid=%i",Pid());
58 switch(Pid()){
59 case kProton: sPart="p+ ";break;
60 case kProtonBar: sPart="p- ";break;
61 case kKPlus: sPart="K+ ";break;
62 case kKMinus: sPart="K- ";break;
63 case kPiPlus: sPart="Pi+ ";break;
64 case kPiMinus: sPart="Pi- ";break;
65 case kMuonPlus: sPart="Mu+ ";break;
66 case kMuonMinus: sPart="Mu- ";break;
67 case kElectron: sPart="e- ";break;
68 case kPositron: sPart="e+ ";break;
69 case 50000050: sPart="ckov";break;
70 case 50000051: sPart="feed";break;
71 }
72
1d4857c5 73 Printf("%sHIT: ch=%i (%7.3f,%7.3f) Q=%8.3f TID= %5i, MARS=(%7.2f,%7.2f,%7.2f) %s %s",
74 opt, Ch(), fLx,fLy, fQ, fTrack, X(), Y(), Z(), sPart,
3c6274c1 75 (AliHMPIDDigit::IsInDead(LorsX(),LorsY()))? "IN DEAD ZONE":"");
d3da6dc4 76}
77//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++