Added docs and fixed a bug
[u/mrichter/AliRoot.git] / FMD / AliFMDMultNaiive.cxx
CommitLineData
56b1929b 1/**************************************************************************
2 * Copyright(c) 1998-1999, 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//____________________________________________________________________
19//
7684b53c 20// Reconstruct charged particle multiplicity in the FMD
21//
22// [See also the AliFMDReconstructor class]
23//
24// This class reconstructs the multiplicity based on the assumption
25// that all particles are minimum ionizing.
56b1929b 26//
27#include "AliFMD.h" // ALIFMD_H
28#include "AliFMDMultNaiive.h" // ALIFMDMULTNAIIVE_H
29#include "AliFMDMultStrip.h" // ALIFMDMULTNAIIVE_H
30#include "AliFMDDigit.h" // ALIFMDDIGIT_H
31#include <TClonesArray.h> // ROOT_TClonesArray
32#include <TTree.h> // ROOT_TTree
33
34//____________________________________________________________________
35ClassImp(AliFMDMultNaiive);
36
37//____________________________________________________________________
38AliFMDMultNaiive::AliFMDMultNaiive()
39 : AliFMDMultAlgorithm("Naiive", "Naiive")
40{
41 // Default CTOR
42 fMult = new TClonesArray("AliFMDMultStrip", 1000);
43}
44
45//____________________________________________________________________
46void
47AliFMDMultNaiive::PreRun(AliFMD* fmd)
48{
49 // Initialise before a run
50 AliFMDMultAlgorithm::PreRun(fmd);
51 fEdepMip = fmd->GetEdepMip();
7684b53c 52 fGain = (Float_t(fmd->GetVA1MipRange()) / fmd->GetAltroChannelSize()
56b1929b 53 * fEdepMip);
54}
55
56//____________________________________________________________________
57void
58AliFMDMultNaiive::PreEvent(TTree* treeR, Float_t ipZ)
59{
60 // Reset internal data
61 AliFMDMultAlgorithm::PreEvent(treeR, ipZ);
62 fTreeR->Branch("FMDNaiive", &fMult);
63}
64
65//____________________________________________________________________
66void
67AliFMDMultNaiive::ProcessDigit(AliFMDDigit* digit,
68 Float_t eta,
69 Float_t phi,
70 UShort_t count)
71{
72 // Process one digit.
73 //
74 // Parameters:
75 //
76 // digit Digit to process
77 // eta Pseudo-rapidity of digit
78 // phi Azimuthal angle of digit
79 // count ADC (corrected for the pedestal)
80 //
81 // This calculates the energy deposited and the number of MIPs that
82 // this energy deposition corresponds to
83 //
84 // EnergyDeposited = cos(theta) * gain * count
85 // Multiplicity = EnergyDeposited / EnergyDepositedPerMIP
86 //
87 // where gain is a conversion factor from number of counts to an
88 // energy:
89 // Pre_Amp_MIP_Range 1
90 // gain = ----------------- * ---------------------
91 // ADC_channel_size EnergyDepositedPerMip
92 //
93 // and theta is the particles incident angle on the strip, given by
94 //
95 // theta = 2 * atan(exp(-eta))
96 //
97 // The cos(theta) factor corrects for the fact that the particle may
98 // traverse the strip at an angle, and therefor have a longer flight
99 // length, leading to a larger energy deposition.
100 //
101 if (!digit) return;
102 Double_t edep = Adc2Energy(digit, eta, count);
103 Double_t mult = Energy2Multiplicity(digit, edep);
7684b53c 104
105 AliFMDMultStrip* m =
106 new ((*fMult)[fNMult]) AliFMDMultStrip(digit->Detector(),
107 digit->Ring(),
108 digit->Sector(),
109 digit->Strip(),
110 eta, phi,
111 edep, mult,
112 AliFMDMult::kNaiive);
113 (void)m;
56b1929b 114 fNMult++;
115}
116//____________________________________________________________________
117Float_t
118AliFMDMultNaiive::Adc2Energy(AliFMDDigit* /* digit */,
119 Float_t eta,
120 UShort_t count)
121{
122 // Converts number of ADC counts to energy deposited.
123 // Note, that this member function can be overloaded by derived
124 // classes to do strip-specific look-ups in databases or the like,
125 // to find the proper gain for a strip.
126 //
127 // In this simple version, we calculate the energy deposited as
128 //
129 // EnergyDeposited = cos(theta) * gain * count
130 //
131 // where
132 //
133 // Pre_amp_MIP_Range
134 // gain = ----------------- * Energy_deposited_per_MIP
135 // ADC_channel_size
136 //
137 // is constant and the same for all strips.
138 Double_t theta = 2 * TMath::Tan(TMath::Exp(-eta));
139 Double_t edep = TMath::Cos(theta) * fGain * count;
140 return edep;
141}
142
143//____________________________________________________________________
144Float_t
145AliFMDMultNaiive::Energy2Multiplicity(AliFMDDigit* /* digit */,
146 Float_t edep)
147{
148 // Converts an energy signal to number of particles.
149 // Note, that this member function can be overloaded by derived
150 // classes to do strip-specific look-ups in databases or the like,
151 // to find the proper gain for a strip.
152 //
153 // In this simple version, we calculate the multiplicity as
154 //
155 // multiplicity = Energy_deposited / Energy_deposited_per_MIP
156 //
157 // where
158 //
159 // Energy_deposited_per_MIP = 1.664 * SI_density * SI_thickness
160 //
161 // is constant and the same for all strips
162 return edep / fEdepMip;
163}
164
165
166
167//____________________________________________________________________
168//
169// EOF
170//