1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 // Forward Multiplicity Detector based on Silicon wafers.
22 // This class is a singleton that handles various parameters of
24 // Eventually, this class will use the Conditions DB to get the
25 // various parameters, which code can then request from here.
27 #include "AliLog.h" // ALILOG_H
28 #include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
29 #include "AliFMDGeometry.h" // ALIFMDGEOMETRY_H
30 #include "AliFMDRing.h" // ALIFMDRING_H
31 #include "AliFMDCalibGain.h" // ALIFMDCALIBGAIN_H
32 #include "AliFMDCalibPedestal.h" // ALIFMDCALIBPEDESTAL_H
33 #include "AliFMDCalibSampleRate.h" // ALIFMDCALIBPEDESTAL_H
34 #include <Riostream.h>
36 //====================================================================
37 ClassImp(AliFMDParameters)
39 ; // This is here to keep Emacs for indenting the next line
42 //____________________________________________________________________
43 AliFMDParameters* AliFMDParameters::fgInstance = 0;
45 //____________________________________________________________________
47 AliFMDParameters::Instance()
49 // Get static instance
50 if (!fgInstance) fgInstance = new AliFMDParameters;
54 //____________________________________________________________________
55 AliFMDParameters::AliFMDParameters()
65 // Default constructor
67 SetAltroChannelSize();
68 SetChannelsPerAltro();
77 //__________________________________________________________________
79 AliFMDParameters::GetThreshold() const
81 if (!fPulseGain) return fFixedThreshold;
82 return fPulseGain->Threshold();
85 //__________________________________________________________________
87 AliFMDParameters::GetPulseGain(UShort_t detector, Char_t ring,
88 UShort_t sector, UShort_t strip) const
90 // Returns the pulser calibrated gain for strip # strip in sector #
91 // sector or ring id ring of detector # detector.
93 // For simulation, this is normally set to
96 // ------------------ * MIP_Energy_Loss
100 if (fFixedPulseGain <= 0)
101 fFixedPulseGain = fVA1MipRange * GetEdepMip() / fAltroChannelSize;
102 return fFixedPulseGain;
104 return fPulseGain->Value(detector, ring, sector, strip);
107 //__________________________________________________________________
109 AliFMDParameters::IsDead(UShort_t detector, Char_t ring,
110 UShort_t sector, UShort_t strip) const
112 if (!fDeadMap) return kFALSE;
113 return fDeadMap->operator()(detector, ring, sector, strip);
116 //__________________________________________________________________
118 AliFMDParameters::GetZeroSuppression(UShort_t detector, Char_t ring,
119 UShort_t sector, UShort_t strip) const
121 if (!fZeroSuppression) return fFixedZeroSuppression;
122 // Need to map strip to ALTRO chip.
123 return fZeroSuppression->operator()(detector, ring, sector, strip/128);
126 //__________________________________________________________________
128 AliFMDParameters::GetSampleRate(UShort_t ddl) const
130 if (!fSampleRate) return fFixedSampleRate;
131 // Need to map sector to digitizier card.
132 return fSampleRate->Rate(ddl);
135 //__________________________________________________________________
137 AliFMDParameters::GetPedestal(UShort_t detector, Char_t ring,
138 UShort_t sector, UShort_t strip) const
140 if (!fPedestal) return fFixedPedestal;
141 return fPedestal->Value(detector, ring, sector, strip);
144 //__________________________________________________________________
146 AliFMDParameters::GetPedestalWidth(UShort_t detector, Char_t ring,
147 UShort_t sector, UShort_t strip) const
149 if (!fPedestal) return fFixedPedestalWidth;
150 return fPedestal->Width(detector, ring, sector, strip);
155 //__________________________________________________________________
157 AliFMDParameters::GetEdepMip() const
159 // Get energy deposited by a MIP in the silicon sensors
161 AliFMDGeometry* fmd = AliFMDGeometry::Instance();
162 fEdepMip = (fSiDeDxMip
163 * fmd->GetRing('I')->GetSiThickness()
164 * fmd->GetSiDensity());
169 //____________________________________________________________________