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 //____________________________________________________________________
22 // Latest changes by Christian Holm Christensen
24 #include "AliFMDHit.h" // ALIFMDHIT_H
25 #include "AliLog.h" // ALILOG_H
26 #include "Riostream.h" // ROOT_Riostream
27 #include <TDatabasePDG.h>
31 //____________________________________________________________________
34 ; // This is here to keep Emacs for indenting the next line
38 //____________________________________________________________________
39 AliFMDHit::AliFMDHit()
55 //____________________________________________________________________
56 AliFMDHit::AliFMDHit(Int_t shunt,
71 : AliHit(shunt, track),
83 // Normal FMD hit ctor
89 // detector Detector # (1, 2, or 3)
90 // ring Ring ID ('I' or 'O')
91 // sector Sector # (For inner/outer rings: 0-19/0-39)
92 // strip Strip # (For inner/outer rings: 0-511/0-255)
93 // x Track's X-coordinate at hit
94 // y Track's Y-coordinate at hit
95 // z Track's Z-coordinate at hit
96 // px X-component of track's momentum
97 // py Y-component of track's momentum
98 // pz Z-component of track's momentum
99 // edep Energy deposited by track
100 // pdg Track's particle Id #
101 // t Time when the track hit
108 //____________________________________________________________________
112 // Get the momentum of the particle of the particle that made this
114 return TMath::Sqrt(fPx * fPx + fPy * fPy + fPz * fPz);
117 //____________________________________________________________________
121 // Get the mass of the particle that made this hit.
122 TDatabasePDG* pdgDB = TDatabasePDG::Instance();
123 TParticlePDG* pdg = pdgDB->GetParticle(fPdg);
124 return (pdg ? pdg->Mass() : -1);
127 //____________________________________________________________________
131 // Get the charge of the particle that made this hit.
132 TDatabasePDG* pdgDB = TDatabasePDG::Instance();
133 TParticlePDG* pdg = pdgDB->GetParticle(fPdg);
134 return (pdg ? pdg->Charge() : 0);
138 //____________________________________________________________________
140 AliFMDHit::Print(Option_t* option) const
142 // Print Hit to standard out
143 cout << "AliFMDHit: FMD"
144 << fDetector << fRing << "["
145 << setw(3) << fSector << ","
146 << setw(3) << fStrip << "] = "
149 if (opt.Contains("D", TString::kIgnoreCase)) {
150 TDatabasePDG* pdgDB = TDatabasePDG::Instance();
151 TParticlePDG* pdg = pdgDB->GetParticle(fPdg);
152 cout << "\tPDG:\t" << fPdg << " " << (pdg ? pdg->GetName() : "?") << "\n"
153 << "\tP:\t(" << fPx << "," << fPy << "," << fPz << ") "<<P() << "\n"
154 << "\tX:\t" << fX << "," << fY << "," << fZ << "\n"
155 << "\tTrack #:\t" << fTrack << std::endl;
159 //____________________________________________________________________