Getting the trigger descriptors from CDB
[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()
ae5a42aa 20#include "AliHMPIDParam.h"
d3da6dc4 21ClassImp(AliHMPIDHit)
22//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
d1bf51e1 23void AliHMPIDHit::Draw(Option_t*)
24{
423554a3 25// Draw option of the hits in the display
d1bf51e1 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 }
1d4857c5 32 TMarker *pMark=new TMarker(fLx,fLy,iMark); pMark->SetMarkerColor(kRed); pMark->Draw();
423554a3 33}//Draw
d1bf51e1 34//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1d4857c5 35void 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;
ae5a42aa 42 AliHMPIDParam::Lors2Pad(fLx,fLy,pc,px,py); if(py<0) return; //check if the hit in dead zone. Should never happen during trasport!
1d4857c5 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
f3bae3e2 49 if(dig.Set(fCh,pc,px+i,py+j,fTrack)) continue;
50 dig.SetQ(fQ*dig.IntMathieson(fLx,fLy));
1d4857c5 51 new((*pSdiLst)[iSdiCnt++]) AliHMPIDDigit(dig);
52 }
53 }
423554a3 54}//Hit2Sdi
1d4857c5 55//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
56void AliHMPIDHit::Print(Option_t *opt)const
d3da6dc4 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
ae5a42aa 75 Printf("%sHIT: ch=%i (%7.6f,%7.6f) Q=%8.3f TID= %5i, MARS=(%7.2f,%7.2f,%7.2f) %s %s",
1d4857c5 76 opt, Ch(), fLx,fLy, fQ, fTrack, X(), Y(), Z(), sPart,
ae5a42aa 77 (AliHMPIDParam::IsInDead(LorsX(),LorsY()))? "IN DEAD ZONE":"");
423554a3 78}//Print
d3da6dc4 79//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++