]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDRecPoint.cxx
Fix Coverity leaks
[u/mrichter/AliRoot.git] / FMD / AliFMDRecPoint.cxx
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  **************************************************************************/
15 /* $Id$ */
16 /** @file    AliFMDRecPoint.cxx
17     @author  Christian Holm Christensen <cholm@nbi.dk>
18     @date    Mon Mar 27 12:46:26 2006
19     @brief   Pseudo reconstructed charged particle multiplicity 
20 */
21 //____________________________________________________________________
22 //
23 // Base class for reconstructed charged particle multiplicty in the
24 // FMD.  
25 // The class contains the field fMethod which is a flag set by
26 // the AliFMDRecPointAlgorithm that created the object. The flag tells us
27 // which algorithm was used to create the data stored in the object. 
28 //
29 #include "AliFMDRecPoint.h"     // ALIFMDRECPOINT_H
30 #include <TString.h>            // ROOT_TString 
31 #include <Riostream.h>          // ROOT_Riostream
32
33 //____________________________________________________________________
34 ClassImp(AliFMDRecPoint)
35 #if 0
36   ; // This is here to keep Emacs for indenting the next line
37 #endif
38
39 //____________________________________________________________________
40 AliFMDRecPoint::AliFMDRecPoint()
41   : fDetector(0),
42     fRing('\0'),
43     fSector(0),
44     fStrip(0),
45     fEta(0),
46     fPhi(0),
47     fEdep(0),
48     fParticles(0)
49 {
50   // CTOR 
51 }
52
53 //____________________________________________________________________
54 AliFMDRecPoint::AliFMDRecPoint(UShort_t detector,  Char_t   ring, 
55                                UShort_t sector,    UShort_t strip,
56                                Float_t  eta,       Float_t  phi,
57                                Float_t  edep,      Float_t  particles)
58   : fDetector(detector),
59     fRing(ring),
60     fSector(sector),
61     fStrip(strip),
62     fEta(eta),
63     fPhi(phi),
64     fEdep(edep),
65     fParticles(particles)
66 {
67 }
68
69 //____________________________________________________________________
70 const char*
71 AliFMDRecPoint::GetName() const 
72
73   // Get the name 
74   static TString n;
75   n = Form("FMD%d%c[%2d,%3d]", fDetector,fRing,fSector,fStrip);
76   return n.Data();
77 }
78
79 //____________________________________________________________________
80 const char*
81 AliFMDRecPoint::GetTitle() const 
82
83   // Get the title 
84   static TString t;
85   t = Form("%f (%f,%f)", fParticles, fEta, fPhi);
86   return t.Data();
87 }
88
89 //____________________________________________________________________
90 void
91 AliFMDRecPoint::Print(Option_t* option) const
92 {
93   // Print information 
94   // 
95   // Options:
96   //    D:           Detector (default)
97   //    E:           Eta range (default)
98   //    P:           Phi range (default)
99   //
100   TString opt(option);
101   cout << "FMD RecPoint in a strip: " << fParticles << endl;
102   if (opt.Contains("D", TString::kIgnoreCase))
103     cout << "  Detector:      FMD" << fDetector << fRing 
104          << "[" << fSector << "," << fStrip << "]" << endl;
105   if (opt.Contains("E", TString::kIgnoreCase))
106     cout << "  Eta range:     " << fEta << endl;
107   if (opt.Contains("P", TString::kIgnoreCase))
108     cout << "  Phi range:     " << fPhi << endl;
109 }
110
111     
112 //____________________________________________________________________
113 //
114 // EOF
115 //