]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpDCSNamer.h
In mapping:
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpDCSNamer.h
1 #ifndef ALIMPDCSNAMER_H
2 #define ALIMPDCSNAMER_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice                               */
6
7 // $Id$
8
9 /// \ingroup management
10 /// \class AliMpDCSNamer
11 /// \brief Collection of methods usefull to DCS handling for MUON TRK and TRG
12 /// 
13 //  Author Laurent Aphecetche and Diego Stocco, Subatech
14
15 #ifndef ROOT_TObject
16 #  include "TObject.h"
17 #endif
18
19 class TObjArray;
20
21 class AliMpDCSNamer : public TObject
22 {
23 public:
24   AliMpDCSNamer();
25   AliMpDCSNamer(const char* detName);
26   
27   virtual ~AliMpDCSNamer();
28
29   Bool_t SetDetector(const char* detName);
30   
31   const char* DCSChannelName(Int_t detElemId, Int_t sector=0, Int_t dcsMeasure=0) const;
32   
33   const char* DCSSwitchName(Int_t detElemId, Int_t pcbNumber) const;
34
35   Int_t DCS2DE(Int_t chamberId, Int_t side, Int_t dcsNumber) const;
36   
37   Int_t DetElemId2DCS(Int_t detElemId, Int_t& side, Int_t& chId) const;
38     
39   Int_t DCSIndexFromDCSAlias(const char* dcsAlias) const;
40   
41   Int_t DetElemIdFromDCSAlias(const char* dcsAlias) const;
42
43   Int_t DCSvariableFromDCSAlias(const char* dcsAlias) const;
44   
45   Int_t ManuId2Index(Int_t detElemId, Int_t manuId) const;
46   
47   /// Returns the index of PCB (within a St345 slat) for a given manu number.
48   Int_t ManuId2PCBIndex(Int_t detElemId, Int_t manuId) const;
49   
50   /// Return the HV-sector number (within a St12 quadrant) for a given manu number.
51   Int_t ManuId2Sector(Int_t detElemId, Int_t manuId) const;
52   
53   Int_t NumberOfPCBs(Int_t detElemId) const;
54
55   TObjArray* GenerateAliases() const;
56   TObjArray* CompactAliases() const;
57   void AliasesAsLdif(const char* ldiffile) const;
58
59   enum 
60   {
61     kDCSHV,    ///< High Voltage
62     kDCSI,     ///< Currents
63     kNDCSMeas  ///< Number of measured quantities
64   };
65
66   enum 
67   {
68     kTrackerDet, ///< Namer for tracker
69     kTriggerDet  ///< Namer for trigger
70   };
71   
72   
73 private:
74   /// Not implemented
75   AliMpDCSNamer(const AliMpDCSNamer& right);
76   /// Not implemented
77   AliMpDCSNamer&  operator = (const AliMpDCSNamer& right);
78
79   Bool_t CheckConsistency(Int_t detElemId) const;
80     
81   static const char* fgkDCSChannelSt345Pattern[]; ///< DCS Tracker Channel name template
82   static const char* fgkDCSChannelSt12Pattern[]; ///< DCS Tracker Channel name template
83   static const char* fgkDCSSwitchSt345Pattern; ///< DCS Tracker Switch name template
84   static const char* fgkDCSSideTrackerName[]; ///< DCS Tracker Name of the side written in DCS
85
86   static const char* fgkDCSChannelTriggerPattern[]; ///< DCS Trigger Channel name template
87   static const char* fgkDCSSideTriggerName[]; ///< DCS Trigger Name of the side written in DCS
88   static const char* fgkDCSMeasureName[]; ///< DCS Trigger Name of the measure (HV or current) written in DCS
89
90   static const char* fgkDetectorName[]; ///< Name of detector (Tracker or Trigger)
91
92   Int_t fDetector; ///< Detector type (either tracker or trigger)
93   
94   ClassDef(AliMpDCSNamer,0) // Utility class for coding/decoding DCS aliases
95 };
96
97 #endif