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