]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/ITS/AliSPDUtils.h
attaching file writer to the StreamerInfo component
[u/mrichter/AliRoot.git] / PWG1 / ITS / AliSPDUtils.h
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 //-----------------------------------------------------------------------
17 // Utility class to change from online to offline numbering scheme
18 // for SPD. Most of these methods already exist in AliITSRawStreamSPD.
19 // Author : A. Mastroserio
20 //-----------------------------------------------------------------------
21
22 #ifndef ALISPDUTILS_H
23 #define ALISPDUTILS_H
24
25 #include "TObject.h"
26
27 class AliSPDUtils : public TObject {
28
29  public:
30  
31   AliSPDUtils(){;}  
32    
33  
34   virtual ~AliSPDUtils();
35
36  
37   // module mapping
38   static Int_t GetModuleNumber(UInt_t iDDL, UInt_t iModule); 
39   static Int_t GetModuleNumber(UInt_t iDDL, UInt_t iHS, UInt_t iChip)  {return GetOfflineModuleFromOnline(iDDL,iHS,iChip);}
40
41   // general coordinate conversions:
42   static Bool_t OfflineToOnline(UInt_t module, UInt_t colM, UInt_t RowM, UInt_t& eq, UInt_t& hs, UInt_t& chip, UInt_t& col, UInt_t& row); 
43   static Bool_t OnlineToOffline(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row, UInt_t& module, UInt_t& colM, UInt_t& rowM);
44   static Bool_t GetOfflineFromOfflineChipKey(UInt_t chipkey,UInt_t& module, UInt_t& chip);
45  
46   // specific coordinate conversions - offline->online
47   static UInt_t GetOnlineEqIdFromOffline(UInt_t module);
48   static UInt_t GetOnlineHSFromOffline(UInt_t module);
49   static UInt_t GetOnlineChipFromOffline(UInt_t module, UInt_t colM);
50   static UInt_t GetOnlineColFromOffline(UInt_t module, UInt_t colM); 
51   static UInt_t GetOnlineRowFromOffline(UInt_t module, UInt_t rowM);    
52   static Bool_t GetOnlineFromOfflineChipKey(UInt_t chipkey,UInt_t& eq, UInt_t& hs, UInt_t& chip);
53  
54   // specific coordinate conversions - online->offline
55   static UInt_t GetOfflineModuleFromOnline(UInt_t eqId, UInt_t hs, UInt_t chip);
56   static UInt_t GetOfflineChipKeyFromOnline(UInt_t eqId, UInt_t hs, UInt_t chip); 
57   static UInt_t GetOfflineColFromOnline(UInt_t eqId, UInt_t hs, UInt_t chip, UInt_t col);
58   static UInt_t GetOfflineRowFromOnline(UInt_t eqId, UInt_t hs, UInt_t chip, UInt_t row);
59
60  
61  
62
63   private :
64
65     static const Int_t fgkDDLModuleMap[20][12];  // mapping DDL/module -> module number
66   AliSPDUtils& operator= (const AliSPDUtils& c); // dummy
67   AliSPDUtils(const AliSPDUtils& c);             // dummy
68
69   ClassDef(AliSPDUtils,0);
70 };
71
72 #endif