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 **************************************************************************/
16 /** @file AliFMDHit.cxx
17 @author Christian Holm Christensen <cholm@nbi.dk>
18 @date Mon Mar 27 12:41:58 2006
22 //____________________________________________________________________
25 // Contains information on:
29 // Energy loss of track
32 // Track stopping status.
33 // Latest changes by Christian Holm Christensen
35 #include "AliFMDHit.h" // ALIFMDHIT_H
36 // #include "AliLog.h" // ALILOG_H
37 #include "Riostream.h" // ROOT_Riostream
38 #include <TDatabasePDG.h>
42 //____________________________________________________________________
45 ; // This is here to keep Emacs for indenting the next line
49 //____________________________________________________________________
50 AliFMDHit::AliFMDHit()
69 //____________________________________________________________________
70 AliFMDHit::AliFMDHit(Int_t shunt,
87 : AliHit(shunt, track),
101 // Normal FMD hit ctor
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
126 //____________________________________________________________________
128 AliFMDHit::GetName() const
132 n = Form("FMD%d%c[%2d,%3d]", fDetector,fRing,fSector,fStrip);
136 //____________________________________________________________________
138 AliFMDHit::GetTitle() const
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);
149 //____________________________________________________________________
153 // Get the momentum of the particle of the particle that made this
155 return TMath::Sqrt(fPx * fPx + fPy * fPy + fPz * fPz);
158 //____________________________________________________________________
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);
168 //____________________________________________________________________
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);
179 //____________________________________________________________________
181 AliFMDHit::Print(Option_t* option) const
183 // Print Hit to standard out
184 cout << "AliFMDHit: FMD"
185 << fDetector << fRing << "["
186 << setw(3) << fSector << ","
187 << setw(3) << fStrip << "] = "
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"
196 << "\tTrack #:\t" << fTrack << "\tLength:\t"
197 << fLength << "cm\t" << (IsStop() ? "stopped" : "") << std::endl;
201 //____________________________________________________________________