AliRoot Core  3dc7879 (3dc7879)
AliFMDAltroMapping.h
Go to the documentation of this file.
1 #ifndef ALIFMDALTROMAPPING_H
2 #define ALIFMDALTROMAPPING_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
4  * reserved.
5  *
6  * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
7  *
8  * See cxx source for full Copyright notice
9  */
15 #ifndef ALIALTROMAPPING_H
16 # include <AliAltroMapping.h>
17 #endif
18 //
19 // Map hardware address to detector coordinates.
20 //
21 // The hardware address consist of a DDL number and 12bits of ALTRO
22 // addresses. The ALTRO address are formatted as follows.
23 //
24 // 12 7 4 0
25 // |---------------|---------|------------|
26 // | Board # | ALTRO # | Channel # |
27 // +---------------+---------+------------+
28 //
29 //
30 //____________________________________________________________________
46 class AliFMDAltroMapping : public AliAltroMapping
47 {
48 public:
56  virtual ~AliFMDAltroMapping() {}
63  Short_t DDL2Detector(UInt_t ddl) const
64  {
65  return (ddl<=2 ? Short_t(ddl + 1) : -1);
66  }
73  Char_t Board2Ring(UShort_t board) const { return (board%2)?'O':'I'; }
74 
86  Bool_t Channel2StripBase(UShort_t board, UShort_t altro,
87  UShort_t chan, Char_t& ring,
88  UShort_t& sec, Short_t& str) const;
99  void Timebin2Strip(UShort_t sec, UShort_t timebin,
100  UShort_t preSamples, UShort_t sampleRate,
101  Short_t& strip, UShort_t& sample) const;
102 
118  Bool_t Hardware2Detector(UShort_t ddl, UShort_t hwaddr,
119  UShort_t timebin, UShort_t preSamples,
120  UShort_t sampleRate,
121  UShort_t& det, Char_t& ring,
122  UShort_t& sec, Short_t& str,
123  UShort_t& sam) const;
141  Bool_t Hardware2Detector(UShort_t ddl, UShort_t board,
142  UShort_t altro, UShort_t chan,
143  UShort_t timebin, UShort_t preSamples,
144  UShort_t sampleRate,
145  UShort_t& det, Char_t& ring,
146  UShort_t& sec, Short_t& str,
147  UShort_t& sam) const;
148 
149 
150 
157  UShort_t Detector2DDL(UShort_t det) const { return det - 1; }
165  Short_t Sector2Board(Char_t ring, UShort_t sec) const;
177  Bool_t Strip2Channel(Char_t ring, UShort_t sec,
178  UShort_t str, UShort_t& board,
179  UShort_t& altro, UShort_t& chan) const;
190  UShort_t Strip2Timebin(UShort_t sec, UShort_t strip,
191  UShort_t sam, UShort_t preSamples,
192  UShort_t sampleRate) const;
193 
211  Bool_t Detector2Hardware(UShort_t det, Char_t ring,
212  UShort_t sec, UShort_t str,
213  UShort_t sam,
214  UShort_t preSamples, UShort_t sampleRate,
215  UShort_t& ddl, UShort_t& board,
216  UShort_t& altro, UShort_t& channel,
217  UShort_t& timebin) const;
233  Bool_t Detector2Hardware(UShort_t det, Char_t ring,
234  UShort_t sec, UShort_t str,
235  UShort_t sam,
236  UShort_t preSamples, UShort_t sampleRate,
237  UShort_t& ddl, UShort_t& hwaddr,
238  UShort_t& timebin) const;
247  UInt_t ChannelAddress(UShort_t board, UShort_t altro, UShort_t channel) const;
256  void ChannelAddress(UShort_t hwaddr, UShort_t& board, UShort_t& altro,
257  UShort_t& channel) const;
266  Int_t GetHWAddress(Int_t sector, Int_t str, Int_t ring);
273  Int_t GetPadRow(Int_t hwaddr) const;
280  Int_t GetPad(Int_t hwaddr) const;
287  Int_t GetSector(Int_t hwaddr) const;
293  void Print(Option_t* option="hw") const;
294 protected:
300  virtual Bool_t ReadMapping();
304  virtual Bool_t CreateInvMapping();
305 
306  ClassDef(AliFMDAltroMapping, 2) // Read raw FMD Altro data
307 };
308 
309 #endif
310 //____________________________________________________________________
311 //
312 // Local Variables:
313 // mode: C++
314 // End:
315 //
316 // EOF
317 //
virtual Bool_t CreateInvMapping()
Bool_t Strip2Channel(Char_t ring, UShort_t sec, UShort_t str, UShort_t &board, UShort_t &altro, UShort_t &chan) const
Int_t GetSector(Int_t hwaddr) const
UInt_t ChannelAddress(UShort_t board, UShort_t altro, UShort_t channel) const
Int_t GetPad(Int_t hwaddr) const
Short_t DDL2Detector(UInt_t ddl) const
Bool_t Hardware2Detector(UShort_t ddl, UShort_t hwaddr, UShort_t timebin, UShort_t preSamples, UShort_t sampleRate, UShort_t &det, Char_t &ring, UShort_t &sec, Short_t &str, UShort_t &sam) const
UShort_t Detector2DDL(UShort_t det) const
Int_t GetHWAddress(Int_t sector, Int_t str, Int_t ring)
void Print(Option_t *option="hw") const
UShort_t Strip2Timebin(UShort_t sec, UShort_t strip, UShort_t sam, UShort_t preSamples, UShort_t sampleRate) const
virtual Bool_t ReadMapping()
Bool_t Detector2Hardware(UShort_t det, Char_t ring, UShort_t sec, UShort_t str, UShort_t sam, UShort_t preSamples, UShort_t sampleRate, UShort_t &ddl, UShort_t &board, UShort_t &altro, UShort_t &channel, UShort_t &timebin) const
Bool_t Channel2StripBase(UShort_t board, UShort_t altro, UShort_t chan, Char_t &ring, UShort_t &sec, Short_t &str) const
Class that encodes a map to/from ALTRO hardware address to FMD detector coordinates.
Int_t GetPadRow(Int_t hwaddr) const
Char_t Board2Ring(UShort_t board) const
void Timebin2Strip(UShort_t sec, UShort_t timebin, UShort_t preSamples, UShort_t sampleRate, Short_t &strip, UShort_t &sample) const
Short_t Sector2Board(Char_t ring, UShort_t sec) const