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