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 //____________________________________________________________________
20 // ESD information from the FMD
21 // Contains information on:
22 // Charged particle multiplicty per strip (rough estimate)
23 // Psuedo-rapdity per strip
24 // Latest changes by Christian Holm Christensen
26 #include "AliESDFMD.h" // ALIFMDESD_H
27 #include "AliLog.h" // ALILOG_H
28 #include "Riostream.h" // ROOT_Riostream
30 //____________________________________________________________________
33 ; // This is here to keep Emacs for indenting the next line
37 //____________________________________________________________________
38 AliESDFMD::AliESDFMD()
39 : fMultiplicity(AliFMDFloatMap::kMaxDetectors,
40 AliFMDFloatMap::kMaxRings,
41 AliFMDFloatMap::kMaxSectors,
42 AliFMDFloatMap::kMaxStrips),
43 fEta(AliFMDFloatMap::kMaxDetectors,
44 AliFMDFloatMap::kMaxRings,
46 AliFMDFloatMap::kMaxStrips),
48 fAngleCorrected(kFALSE)
53 //____________________________________________________________________
54 AliESDFMD::AliESDFMD(const AliESDFMD& other)
56 fMultiplicity(other.fMultiplicity),
58 fNoiseFactor(other.fNoiseFactor),
59 fAngleCorrected(other.fAngleCorrected)
64 //____________________________________________________________________
66 AliESDFMD::operator=(const AliESDFMD& other)
70 TObject::operator=(other);
71 fMultiplicity = other.fMultiplicity;
77 //____________________________________________________________________
79 AliESDFMD::CheckNeedUShort(TFile* file)
81 fMultiplicity.CheckNeedUShort(file);
82 fEta.CheckNeedUShort(file);
85 //____________________________________________________________________
87 AliESDFMD::Clear(Option_t* )
89 fMultiplicity.Reset(kInvalidMult);
90 fEta.Reset(kInvalidEta);
94 //____________________________________________________________________
96 AliESDFMD::Multiplicity(UShort_t detector, Char_t ring, UShort_t sector,
99 // Return rough estimate of charged particle multiplicity in the
100 // strip FMD<detector><ring>[<sector>,<strip>].
102 // Note, that this should at most be interpreted as the sum
103 // multiplicity of secondaries and primaries.
104 return fMultiplicity(detector, ring, sector, strip);
107 //____________________________________________________________________
109 AliESDFMD::Eta(UShort_t detector, Char_t ring, UShort_t /* sector */,
110 UShort_t strip) const
112 // Return pseudo-rapidity of the strip
113 // FMD<detector><ring>[<sector>,<strip>]. (actually, the sector
114 // argument is ignored, as it is assumed that the primary vertex is
115 // a (x,y) = (0,0), and that the modules are aligned with a
116 // precision better than 2 degrees in the azimuthal angle).
118 return fEta(detector, ring, 0, strip);
121 //____________________________________________________________________
123 AliESDFMD::SetMultiplicity(UShort_t detector, Char_t ring, UShort_t sector,
124 UShort_t strip, Float_t mult)
126 // Return rough estimate of charged particle multiplicity in the
127 // strip FMD<detector><ring>[<sector>,<strip>].
129 // Note, that this should at most be interpreted as the sum
130 // multiplicity of secondaries and primaries.
131 fMultiplicity(detector, ring, sector, strip) = mult;
134 //____________________________________________________________________
136 AliESDFMD::SetEta(UShort_t detector, Char_t ring, UShort_t /* sector */,
137 UShort_t strip, Float_t eta)
139 // Set pseudo-rapidity of the strip
140 // FMD<detector><ring>[<sector>,<strip>]. (actually, the sector
141 // argument is ignored, as it is assumed that the primary vertex is
142 // a (x,y) = (0,0), and that the modules are aligned with a
143 // precision better than 2 degrees in the azimuthal angle).
145 fEta(detector, ring, 0, strip) = eta;
148 //____________________________________________________________________
150 AliESDFMD::Print(Option_t* /* option*/) const
152 // Print all information to standard output.
153 std::cout << "AliESDFMD:" << std::endl;
154 for (UShort_t det = 1; det <= fMultiplicity.MaxDetectors(); det++) {
155 for (UShort_t ir = 0; ir < fMultiplicity.MaxRings(); ir++) {
156 Char_t ring = (ir == 0 ? 'I' : 'O');
157 std::cout << "FMD" << det << ring << ":" << std::endl;
158 for (UShort_t sec = 0; sec < fMultiplicity.MaxSectors(); sec++) {
159 std::cout << " Sector # " << sec << ":" << std::flush;
160 for (UShort_t str = 0; str < fMultiplicity.MaxStrips(); str++) {
161 if (str % 6 == 0) std::cout << "\n " << std::flush;
162 Float_t m = fMultiplicity(det, ring, sec, str);
163 Float_t e = fEta(det, ring, 0, str);
164 if (m == kInvalidMult && e == kInvalidEta) break;
165 if (m == kInvalidMult) std::cout << " ---- ";
166 else std::cout << Form("%6.3f", m);
168 if (e == kInvalidEta) std::cout << " ---- ";
169 else std::cout << Form("%-6.3f", e);
170 std::cout << " " << std::flush;
172 std::cout << std::endl;
179 //____________________________________________________________________