]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDHit.cxx
Shuttle subprocessor for GMS
[u/mrichter/AliRoot.git] / FMD / AliFMDHit.cxx
CommitLineData
4347b38f 1/**************************************************************************
2 * Copyright(c) 2004, 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 **************************************************************************/
4347b38f 15/* $Id$ */
c2fc1258 16/** @file AliFMDHit.cxx
17 @author Christian Holm Christensen <cholm@nbi.dk>
18 @date Mon Mar 27 12:41:58 2006
19 @brief Hit in the FMD
02a27b50 20 @ingroup FMD_sim
c2fc1258 21*/
e802be3e 22//____________________________________________________________________
4347b38f 23//
24// Hits in the FMD
088f8e79 25// Contains information on:
26// Position of hit
27// Momentum of track
28// PID of track
29// Energy loss of track
30// Track #
31// Track path length
32// Track stopping status.
33// Latest changes by Christian Holm Christensen
4347b38f 34//
e802be3e 35#include "AliFMDHit.h" // ALIFMDHIT_H
02a27b50 36// #include "AliLog.h" // ALILOG_H
e802be3e 37#include "Riostream.h" // ROOT_Riostream
54240c8d 38#include <TDatabasePDG.h>
02a27b50 39// #include <TMath.h>
54240c8d 40#include <TString.h>
4347b38f 41
42//____________________________________________________________________
925e6570 43ClassImp(AliFMDHit)
1a1fdef7 44#if 0
45 ; // This is here to keep Emacs for indenting the next line
46#endif
4347b38f 47
48
49//____________________________________________________________________
50AliFMDHit::AliFMDHit()
51 : fDetector(0),
52 fRing(0),
53 fSector(0),
54 fStrip('\0'),
55 fPx(0),
56 fPy(0),
57 fPz(0),
58 fPdg(0),
59 fEdep(0),
088f8e79 60 fTime(0),
61 fLength(0),
62 fStop(0)
4347b38f 63{
088f8e79 64 // Default CTOR
4347b38f 65 fX = fY = fZ = 0;
66}
67
68
69//____________________________________________________________________
70AliFMDHit::AliFMDHit(Int_t shunt,
71 Int_t track,
72 UShort_t detector,
73 Char_t ring,
74 UShort_t sector,
75 UShort_t strip,
76 Float_t x,
77 Float_t y,
78 Float_t z,
79 Float_t px,
80 Float_t py,
81 Float_t pz,
82 Float_t edep,
83 Int_t pdg,
088f8e79 84 Float_t t,
85 Float_t l,
86 Bool_t stop)
4347b38f 87 : AliHit(shunt, track),
88 fDetector(detector),
89 fRing(ring),
90 fSector(sector),
91 fStrip(strip),
92 fPx(px),
93 fPy(py),
94 fPz(pz),
95 fPdg(pdg),
96 fEdep(edep),
088f8e79 97 fTime(t),
98 fLength(l),
99 fStop(stop)
4347b38f 100{
101 // Normal FMD hit ctor
102 //
103 // Parameters:
104 //
105 // shunt ???
106 // track Track #
107 // detector Detector # (1, 2, or 3)
108 // ring Ring ID ('I' or 'O')
109 // sector Sector # (For inner/outer rings: 0-19/0-39)
110 // strip Strip # (For inner/outer rings: 0-511/0-255)
111 // x Track's X-coordinate at hit
112 // y Track's Y-coordinate at hit
113 // z Track's Z-coordinate at hit
114 // px X-component of track's momentum
115 // py Y-component of track's momentum
116 // pz Z-component of track's momentum
117 // edep Energy deposited by track
118 // pdg Track's particle Id #
119 // t Time when the track hit
120 //
121 fX = x;
122 fY = y;
123 fZ = z;
124}
125
bf000c32 126//____________________________________________________________________
127const char*
128AliFMDHit::GetName() const
129{
02a27b50 130 // Get the name
bf000c32 131 static TString n;
132 n = Form("FMD%d%c[%2d,%3d]", fDetector,fRing,fSector,fStrip);
133 return n.Data();
134}
135
136//____________________________________________________________________
137const char*
138AliFMDHit::GetTitle() const
139{
02a27b50 140 // Get the title
bf000c32 141 static TString t;
142 TDatabasePDG* pdgDB = TDatabasePDG::Instance();
143 TParticlePDG* pdg = pdgDB->GetParticle(fPdg);
144 t = Form("%s (%d): %f MeV / %f cm", (pdg ? pdg->GetName() : "?"),
145 fTrack, fEdep, fLength);
146 return t.Data();
147}
148
54240c8d 149//____________________________________________________________________
150Float_t
151AliFMDHit::P() const
152{
153 // Get the momentum of the particle of the particle that made this
154 // hit.
155 return TMath::Sqrt(fPx * fPx + fPy * fPy + fPz * fPz);
156}
157
158//____________________________________________________________________
159Float_t
160AliFMDHit::M() const
161{
162 // Get the mass of the particle that made this hit.
163 TDatabasePDG* pdgDB = TDatabasePDG::Instance();
164 TParticlePDG* pdg = pdgDB->GetParticle(fPdg);
165 return (pdg ? pdg->Mass() : -1);
166}
167
168//____________________________________________________________________
169Float_t
170AliFMDHit::Q() const
171{
172 // Get the charge of the particle that made this hit.
173 TDatabasePDG* pdgDB = TDatabasePDG::Instance();
174 TParticlePDG* pdg = pdgDB->GetParticle(fPdg);
175 return (pdg ? pdg->Charge() : 0);
176}
177
178
4347b38f 179//____________________________________________________________________
180void
54240c8d 181AliFMDHit::Print(Option_t* option) const
4347b38f 182{
183 // Print Hit to standard out
7c09877a 184 cout << "AliFMDHit: FMD"
185 << fDetector << fRing << "["
186 << setw(3) << fSector << ","
187 << setw(3) << fStrip << "] = "
188 << fEdep << endl;
54240c8d 189 TString opt(option);
190 if (opt.Contains("D", TString::kIgnoreCase)) {
191 TDatabasePDG* pdgDB = TDatabasePDG::Instance();
192 TParticlePDG* pdg = pdgDB->GetParticle(fPdg);
193 cout << "\tPDG:\t" << fPdg << " " << (pdg ? pdg->GetName() : "?") << "\n"
194 << "\tP:\t(" << fPx << "," << fPy << "," << fPz << ") "<<P() << "\n"
195 << "\tX:\t" << fX << "," << fY << "," << fZ << "\n"
088f8e79 196 << "\tTrack #:\t" << fTrack << "\tLength:\t"
197 << fLength << "cm\t" << (IsStop() ? "stopped" : "") << std::endl;
54240c8d 198 }
4347b38f 199}
200
201//____________________________________________________________________
202//
203// EOF
204//