1 /**************************************************************************
2 * Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //____________________________________________________________________
21 // Contains information on:
25 // Energy loss of track
28 // Track stopping status.
29 // Latest changes by Christian Holm Christensen
31 #include "AliFMDHit.h" // ALIFMDHIT_H
32 #include "AliLog.h" // ALILOG_H
33 #include "Riostream.h" // ROOT_Riostream
34 #include <TDatabasePDG.h>
38 //____________________________________________________________________
41 ; // This is here to keep Emacs for indenting the next line
45 //____________________________________________________________________
46 AliFMDHit::AliFMDHit()
65 //____________________________________________________________________
66 AliFMDHit::AliFMDHit(Int_t shunt,
83 : AliHit(shunt, track),
97 // Normal FMD hit ctor
103 // detector Detector # (1, 2, or 3)
104 // ring Ring ID ('I' or 'O')
105 // sector Sector # (For inner/outer rings: 0-19/0-39)
106 // strip Strip # (For inner/outer rings: 0-511/0-255)
107 // x Track's X-coordinate at hit
108 // y Track's Y-coordinate at hit
109 // z Track's Z-coordinate at hit
110 // px X-component of track's momentum
111 // py Y-component of track's momentum
112 // pz Z-component of track's momentum
113 // edep Energy deposited by track
114 // pdg Track's particle Id #
115 // t Time when the track hit
122 //____________________________________________________________________
124 AliFMDHit::GetName() const
127 n = Form("FMD%d%c[%2d,%3d]", fDetector,fRing,fSector,fStrip);
131 //____________________________________________________________________
133 AliFMDHit::GetTitle() const
136 TDatabasePDG* pdgDB = TDatabasePDG::Instance();
137 TParticlePDG* pdg = pdgDB->GetParticle(fPdg);
138 t = Form("%s (%d): %f MeV / %f cm", (pdg ? pdg->GetName() : "?"),
139 fTrack, fEdep, fLength);
143 //____________________________________________________________________
147 // Get the momentum of the particle of the particle that made this
149 return TMath::Sqrt(fPx * fPx + fPy * fPy + fPz * fPz);
152 //____________________________________________________________________
156 // Get the mass of the particle that made this hit.
157 TDatabasePDG* pdgDB = TDatabasePDG::Instance();
158 TParticlePDG* pdg = pdgDB->GetParticle(fPdg);
159 return (pdg ? pdg->Mass() : -1);
162 //____________________________________________________________________
166 // Get the charge of the particle that made this hit.
167 TDatabasePDG* pdgDB = TDatabasePDG::Instance();
168 TParticlePDG* pdg = pdgDB->GetParticle(fPdg);
169 return (pdg ? pdg->Charge() : 0);
173 //____________________________________________________________________
175 AliFMDHit::Print(Option_t* option) const
177 // Print Hit to standard out
178 cout << "AliFMDHit: FMD"
179 << fDetector << fRing << "["
180 << setw(3) << fSector << ","
181 << setw(3) << fStrip << "] = "
184 if (opt.Contains("D", TString::kIgnoreCase)) {
185 TDatabasePDG* pdgDB = TDatabasePDG::Instance();
186 TParticlePDG* pdg = pdgDB->GetParticle(fPdg);
187 cout << "\tPDG:\t" << fPdg << " " << (pdg ? pdg->GetName() : "?") << "\n"
188 << "\tP:\t(" << fPx << "," << fPy << "," << fPz << ") "<<P() << "\n"
189 << "\tX:\t" << fX << "," << fY << "," << fZ << "\n"
190 << "\tTrack #:\t" << fTrack << "\tLength:\t"
191 << fLength << "cm\t" << (IsStop() ? "stopped" : "") << std::endl;
195 //____________________________________________________________________