Line data Source code
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 : #include "AliMpPlaneType.h"
20 :
21 : class TObjArray;
22 : class AliMpDCSNamer : public TObject
23 :
24 : {
25 : public:
26 : AliMpDCSNamer();
27 : AliMpDCSNamer(const char* detName);
28 :
29 : virtual ~AliMpDCSNamer();
30 :
31 : Bool_t SetDetector(const char* detName);
32 :
33 : TString DCSNameFromAlias(const char* dcsAlias) const;
34 :
35 : TString DCSAliasFromName(const char* dcsName) const;
36 :
37 : TString DCSMCHLVAliasName(Int_t detElemId, Int_t voltageType, AliMp::PlaneType planeType=AliMp::kBendingPlane) const;
38 :
39 : TString DCSAliasName(Int_t detElemId, Int_t sector=0, Int_t dcsMeasure=0) const;
40 :
41 : TString DCSSwitchAliasName(Int_t detElemId, Int_t pcbNumber) const;
42 :
43 : Int_t DCS2DE(Int_t chamberId, Int_t side, Int_t dcsNumber) const;
44 :
45 : Int_t DetElemId2DCS(Int_t detElemId, Int_t& side, Int_t& chId) const;
46 :
47 : Int_t DCSIndexFromDCSAlias(const char* dcsAlias) const;
48 :
49 : Bool_t DecodeDCSMCHLVAlias(const char* dcsAlias, Int_t*& detElemId, Int_t& numberOfDetectionElements, AliMp::PlaneType& planeType ) const;
50 :
51 : Int_t DetElemIdFromDCSAlias(const char* dcsAlias) const;
52 :
53 : Int_t DCSvariableFromDCSAlias(const char* dcsAlias) const;
54 :
55 : Int_t ManuId2Index(Int_t detElemId, Int_t manuId) const;
56 :
57 : /// Returns the index of PCB (within a St345 slat) for a given manu number.
58 : Int_t ManuId2PCBIndex(Int_t detElemId, Int_t manuId) const;
59 :
60 : /// Return the HV-sector number (within a St12 quadrant) for a given manu number.
61 : Int_t ManuId2Sector(Int_t detElemId, Int_t manuId) const;
62 :
63 : Int_t NumberOfPCBs(Int_t detElemId) const;
64 :
65 : TObjArray* GenerateAliases(const char* pattern="") const;
66 : TObjArray* CompactAliases() const;
67 : void AliasesAsLdif(const char* ldiffile) const;
68 :
69 : // Below this value we consider tracking HV is off
70 2592 : static Float_t TrackerHVOFF() { return 30.0; }
71 :
72 : // Below this value we consider tracking LV is off
73 0 : static Float_t TrackerLVOFF() { return 1.0; }
74 :
75 : Bool_t TestMCHLV() const;
76 :
77 : enum
78 : {
79 : kDCSHV, ///< High Voltage
80 : kDCSI, ///< Currents
81 : kNDCSMeas ///< Number of measured quantities
82 : };
83 :
84 : enum
85 : {
86 : kTrackerDet, ///< Namer for tracker
87 : kTriggerDet ///< Namer for trigger
88 : };
89 :
90 :
91 : private:
92 : /// Not implemented
93 : AliMpDCSNamer(const AliMpDCSNamer& right);
94 : /// Not implemented
95 : AliMpDCSNamer& operator = (const AliMpDCSNamer& right);
96 :
97 : Bool_t CheckConsistency(Int_t detElemId) const;
98 :
99 : static const char* fgkDCSChannelSt345Pattern[]; ///< DCS Tracker Channel name template
100 : static const char* fgkDCSChannelSt12Pattern[]; ///< DCS Tracker Channel name template
101 : static const char* fgkDCSQuadrantPattern[]; ///< DCS Tracker quadrant name template
102 : static const char* fgkDCSChamberPattern[]; ///< DCS Tracker chamber name template
103 : static const char* fgkDCSMCHLVGroupPattern[]; ///< DCS Tracker chamber LV group name template
104 :
105 : static const char* fgkDCSSwitchSt345Pattern; ///< DCS Tracker Switch name template
106 : static const char* fgkDCSSideTrackerName[]; ///< DCS Tracker Name of the side written in DCS
107 :
108 : static const char* fgkDCSChannelTriggerPatternRead[]; ///< DCS Trigger Channel name template for input
109 : static const char* fgkDCSChannelTriggerPattern[]; ///< DCS Trigger Channel name template for output
110 : static const char* fgkDCSSideTriggerName[]; ///< DCS Trigger Name of the side written in DCS
111 : static const char* fgkDCSMeasureName[]; ///< DCS Trigger Name of the measure (HV or current) written in DCS
112 :
113 : static const char* fgkDetectorName[]; ///< Name of detector (Tracker or Trigger)
114 :
115 : Int_t fDetector; ///< Detector type (either tracker or trigger)
116 :
117 142282 : ClassDef(AliMpDCSNamer,0) // Utility class for coding/decoding DCS aliases
118 : };
119 :
120 : #endif
|