]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSt1Response.h
Update raw2digits framework (Ch.Finck)
[u/mrichter/AliRoot.git] / MUON / AliMUONSt1Response.h
1 #ifndef ALI_MUON_ST1_RESPONSE_H
2 #define ALI_MUON_ST1_RESPONSE_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 // Revision of includes 07/05/2004
9
10 // Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay
11 //
12 // Class AliMUONSt1Response
13 // ----------------------------
14 // Response class for station 1 including electronics and detector response. 
15 // Individual pedestals or noise levels can be controlled separately. 
16 // The current pulse height responses do not contain any physics
17
18 #include <map>
19 #include <string>
20 #ifndef __HP_aCC
21 using std::map;
22 using std::string;
23 #endif
24
25 #include <TString.h>
26 #include <TList.h>
27
28 #include "AliMUONResponseV0.h"
29 #include "AliMUONSt1ElectronicElement.h"
30
31 class AliMpSector;
32 class AliMpSectorSegmentation;
33 class AliMpZone;
34 class AliMpSector;
35 class TArrayF;
36 class TObjArray;
37 class AliMUONSt1ResponseParameter;
38 class AliMUONChamber;
39
40 class AliMUONSt1Response : public AliMUONResponseV0 
41 {
42   public:
43     AliMUONSt1Response(AliMUONChamber* chamber);
44     AliMUONSt1Response();
45     virtual ~AliMUONSt1Response();
46     
47     //
48     // Configuration methods
49     //
50     void SetIniFileName(Int_t plane,const TString& fileName);
51
52     virtual Float_t  IntPH(Float_t eloss);
53
54     // Noise, zero-suppression, adc saturation
55     virtual Int_t DigitResponse(Int_t digit,AliMUONTransientDigit* where);
56     void PrintStatistics() const;
57
58   protected:
59     AliMUONSt1Response(const AliMUONSt1Response& rhs);
60
61     // operators
62     AliMUONSt1Response& operator=(const AliMUONSt1Response & rhs);
63
64   private:
65     // typedefs
66     typedef map<string, AliMUONSt1ResponseParameter*> ParamsMap;
67     typedef map<string, TList*>  ListMap;
68
69     // private methods
70     const AliMUONGeometrySegmentation* GetGeometrySegmentation(Int_t cathod);
71     const AliMpSectorSegmentation*     GetMpSegmentation(Int_t detElemId, Int_t cathod);
72     const AliMpSector*                 GetMpSector(Int_t detElemId, Int_t cathod);
73     AliMpZone* FindZone(const AliMpSector* sector,Int_t posId) const; // to be moved in AliMpSector::
74     void ReadFiles();
75     void ReadIniFile(Int_t plane,const TString& fileName,Bool_t rdParam,Bool_t rdRegion,Bool_t rdRule);
76     void ReadIniFile(Int_t plane);
77     void ReadCouplesOfIntRanges(const string& value,TList* list,AliMUONSt1ElectronicElement::TDescription descr);
78     void ReadCouplesOfFloatRanges(const string& value,TList* list);
79     void SetPairToParam(const string& name,const string& value,AliMUONSt1ResponseParameter* param) const;
80     void SetPairToListElem(const string& name,const string& value,TList* list);
81
82     // private constants
83     static const Int_t fgkNofZones=4;           // number of zones
84     static const TString fgkTopDir;             // top directory path
85     static const TString fgkDataDir;            // data directory path
86     static const TString fgkConfigBaseName;     // config file base name
87     static const TString fgkStandardIniFileName;// standard ini file name    
88
89     // static names
90     static const TString fgkBaseName ;          // base name
91     static const TString fgkIncludeName ;       // include name
92     static const TString fgkParameterName ;     // parameter name
93     static const TString fgkRegionName ;        // region name
94     static const TString fgkRuleName ;          // rule name
95     static const TString fgkNameName ;          // name name
96     static const TString fgkPedestalName ;      // pedestal name
97     static const TString fgkNoiseName ;         // noise name
98     static const TString fgkStateName ;         // state name
99     static const TString fgkMName ;             // M name
100     static const TString fgkMGName ;            // MG name
101     static const TString fgkMGCName ;           // MGC name
102     static const TString fgkIJName ;            // i,j name
103     static const TString fgkXYName ;            // x,y name
104     static const TString fgkZoneName ;          // zone name
105     static const TString fgkStickyOnName ;      // sticky on name
106     static const TString fgkStickyOffName ;     // sticky off
107     static const TString fgkFileName ;          // file name
108     static const TString fgkValueName ;         // value name
109     static const TString fgkGausName ;          // gauss name
110     static const TString fgkNotName ;           // not name
111     static const TString fgkNofSigmaName ;      // nof sigma name
112
113     // data members
114     TString fIniFileName[2];// file names for initialisation of each cathode
115     Bool_t  fReadFiles;     // flag to read initalization files only once
116     
117     AliMUONSt1ResponseParameter* fDefaultParameters[2][fgkNofZones]; // !Response for each zone
118     TList fRulesList[2]; //! list of special rules
119
120     Int_t fCountNofCalls;    // number of calls to DigitResponse()
121     Int_t fCountUnknownZone; // ntimes the DigitResponse was called in an unknown zone
122     Int_t fCountUnknownIndices; // ntimes the DigitResponse was called with unknown indices
123
124     AliMUONChamber* fChamber;   // The MUON chamber
125
126     ParamsMap  fParams;    //! internal parameter list
127     ListMap    fRegions;   //! internal list of regions
128     TList      fTrashList; //! internal trash list 
129
130   ClassDef(AliMUONSt1Response,1) // Overall detector response
131 };
132
133 #endif //ALI_MUON_ST1_RESPONSE_H