Removing extra semicolons (FedoraCore3, gcc 3.4.2)
[u/mrichter/AliRoot.git] / FMD / AliFMDMultRegion.cxx
CommitLineData
e802be3e 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
16/* $Id$ */
17
18//____________________________________________________________________
4347b38f 19//
7684b53c 20// FMD reconstructed multiplicity in a region of a ring. The region
21// is identified by (strip_min,sector_min)x(strip_max,sector_max) or
22// by (eta_max,phi_min),(eta_min,phi_max). It's also possible to
23// get the peudorapidity of the center-of-mass of the region, as well
24// as the mean azimuthal angle.
25//
26// [Note, that minStrip corresponds to maxEta, and maxStrip
27// corresponds to minEta]
28//
29// These objects are usually created by the Poisson reconstruction
30// method.
4347b38f 31//
56b1929b 32#include "AliFMDMultRegion.h" // ALIFMDPARTICLES_H
33#include <TString.h> // ROOT_TString
34#include <Riostream.h> // ROOT_Riostream
4347b38f 35
36//____________________________________________________________________
925e6570 37ClassImp(AliFMDMultRegion)
56b1929b 38
4347b38f 39
40//____________________________________________________________________
56b1929b 41AliFMDMultRegion::AliFMDMultRegion()
4347b38f 42 : fDetector(0),
43 fRing('\0'),
44 fMinSector(0),
45 fMaxSector(0),
46 fMinStrip(0),
47 fMaxStrip(0),
48 fMinEta(0),
49 fMaxEta(0),
50 fMinPhi(0),
56b1929b 51 fMaxPhi(0)
4347b38f 52{}
53
54//____________________________________________________________________
56b1929b 55AliFMDMultRegion::AliFMDMultRegion(UShort_t detector, Char_t ring,
56 UShort_t minSector, UShort_t maxSector,
57 UShort_t minStrip, UShort_t maxStrip,
58 Float_t minEta, Float_t maxEta,
59 Float_t minPhi, Float_t maxPhi,
60 Float_t particles, UShort_t method)
61 : AliFMDMult(particles, method),
62 fDetector(detector),
4347b38f 63 fRing(ring),
64 fMinSector(minSector),
65 fMaxSector(maxSector),
66 fMinStrip(minStrip),
67 fMaxStrip(maxStrip),
68 fMinEta(minEta),
69 fMaxEta(maxEta),
70 fMinPhi(minPhi),
56b1929b 71 fMaxPhi(maxPhi)
72{}
4347b38f 73
7684b53c 74//____________________________________________________________________
75Float_t
76AliFMDMultRegion::Eta() const
77{
78 // Return the center-of-mass eta of the region. This is calculated
79 // as the weighted mean of min and max eta, where the weights are
80 // the length of the arcs of the upper and lower edge of the region:
81 //
82 // (maxPhi - minPhi)
83 // f = -----------------
84 // 360
85 //
86 // w_max = ds*minStrip*2*pi*f
87 //
88 // w_min = ds*maxStrip*2*pi*f
89 //
90 // 1/w^2 = 1/w_max^2 + 1/w_min^2
91 //
92 // 1 1
93 // = ---------------------- + ----------------------
94 // (ds*minStrip*2*pi*f)^2 (ds*maxStrip*2*pi*f)^2
95 //
96 // (ds*maxStrip*2*pi*f)^2 + (ds*minStrip*2*pi*f)^2
97 // = -----------------------------------------------
98 // (ds*maxStrip*2*pi*f)^2 * (ds*minStrip*2*pi*f)^2
99 //
100 //
101 // 4 * pi^2 * ds^2 * f^2 (maxStrip^2 + minStrip^2)
102 // = -------------------------------------------------
103 // 16 * pi^4 * ds^4 * f^4 minStrip^2 * maxStrip^2
104 //
105 // (maxStrip^2 + minStrip^2)
106 // = -------------------------------------------------
107 // 4 * pi^2 * ds^2 * f^2 minStrip^2 * maxStrip^2
108 //
109 // <eta> = (maxEta/w_max^2 + minEta /w_min^2) / (1/w^2)
110 //
111 // w_min^2 * maxEta + w_max^2 * minEta
112 // = ------------------------------------ / (1/w^2)
113 // w_max^2 * w_min^2
114 //
115 // 4*pi^2*ds^2*(maxStrip*maxEta + minStrip*minEta)
116 // = ----------------------------------------------- / (1/w^2)
117 // 16*pi^4*ds^4*f^4*minStrip^2*maxStrip^2
118 //
119 // maxStrip * maxEta + minStrip * minEta
120 // = -------------------------------------
121 // 4*pi^2*ds^2*f^2*minStrip^2*maxStrip^2
122 //
123 // 4*pi^2*ds^2*f^2*minStrip^2*maxStrip^2
124 // * -------------------------------------
125 // maxStrip^2+minStrip^2
126 //
127 // maxStrip * maxEta + minStrip * minEta
128 // = -------------------------------------
129 // maxStrip^2 + minStrip^2
130 // _
131 // |_|
132 //
133 Float_t eta = (fMaxStrip * fMaxEta + fMinStrip * fMinEta)
134 / (fMaxStrip * fMaxStrip + fMinStrip * fMinStrip);
135 return eta;
136}
4347b38f 137
7684b53c 138
4347b38f 139//____________________________________________________________________
140void
56b1929b 141AliFMDMultRegion::Print(Option_t* option) const
4347b38f 142{
56b1929b 143 // Print information
144 //
145 // Options:
146 // D: Detector (default)
147 // S: Sector range
148 // T: Strip range
149 // E: Eta range (default)
150 // P: Phi range (default)
151 //
152 TString opt(option);
7684b53c 153 cout << "FMD Multiplicity in a region: " << fParticles << endl;
56b1929b 154 if (opt.Contains("D", TString::kIgnoreCase))
7684b53c 155 cout << " Detector: FMD" << fDetector << fRing
156 << "[" << fMinSector << "-" << fMaxSector
157 << "," << fMinStrip << "-" << fMaxStrip << "]" << endl;
56b1929b 158 if (opt.Contains("E", TString::kIgnoreCase))
159 cout << " Eta range: [" << fMinEta << "," << fMaxEta << endl;
160 if (opt.Contains("P", TString::kIgnoreCase))
161 cout << " Phi range: [" << fMinPhi << "," << fMaxPhi << endl;
162 AliFMDMult::Print(option);
4347b38f 163}
164
165
166//____________________________________________________________________
167//
168// EOF
169//