StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StETofHardwareMap.h
1 /***************************************************************************
2  *
3  * $Id: StETofHardwareMap.h,v 1.4 2021/05/12 16:04:42 weidenkaff Exp $
4  *
5  * Author: Pengfei Lyu, April 2018
6  ***************************************************************************
7  *
8  * Description: This class provides a mapping from the hardware address of
9  * the electroinc channels to the eTOF geometry, e.g. sector, z-plane,
10  * counter, strip, side
11  *
12  ***************************************************************************
13  *
14  * $Log: StETofHardwareMap.h,v $
15  * Revision 1.4 2021/05/12 16:04:42 weidenkaff
16  * adjusted mapping to fit with pattern mapping in digimaker
17  *
18  * Revision 1.3 2019/02/19 20:15:14 fseck
19  * update to allow initialization from database
20  *
21  * Revision 1.2 2018/07/27 14:01:53 fseck
22  * small change to fix compiler warning
23  *
24  * Revision 1.1 2018/07/25 14:34:40 jeromel
25  * First version, reviewed Raghav+Jerome
26  *
27  *
28  **************************************************************************/
29 #ifndef STETOFHARDWAREMAP_H
30 #define STETOFHARDWAREMAP_H
31 
32 #include <string>
33 #include <vector>
34 #include <map>
35 
36 #include "TObject.h"
37 
38 class St_etofElectronicsMap;
39 
40 
41 class StETofHardwareMap : public TObject {
42 
43 public:
44  StETofHardwareMap( St_etofElectronicsMap* etofElectronicsMap, unsigned int year );
45  StETofHardwareMap( std::string fileName, unsigned int year );
46 
48 
49  void init( St_etofElectronicsMap* etofElectronicsMap );
50  void init( std::string fileName );
51 
52  void mapToGeom( unsigned int rocId, unsigned int chipId, unsigned int chanId, std::vector< unsigned int >& geomVec );
53  void mapToSector( unsigned int rocId, unsigned int& sector );
54  unsigned int module( unsigned int sector, unsigned int plane );
55 
56 
57 protected:
58  UInt_t mYear;
59 
60  std::vector< UInt_t > mOrderedPlanes;
61  std::vector< UInt_t > mAfckToSector;
62 
63  std::map< UInt_t, UInt_t > mAfckAddressMap;
64  std::map< UInt_t, UInt_t > mChannelNumberMap;
65 
66 
67  ClassDef( StETofHardwareMap, 1 )
68 };
69 
70 #endif