]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONTriggerChamberEff.h
- Changed the mask format accordingly to real life
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerChamberEff.h
1 #ifndef ALIMUONTRIGGERCHAMBEREFF_H
2 #define ALIMUONTRIGGERCHAMBEREFF_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /// \ingroup base
7 /// \class AliMUONTriggerChamberEff
8 /// \brief trigger chamber efficiency from data
9 ///
10 //  Author Diego Stocco
11
12 #include <TObject.h>
13 #include <TList.h>
14 #include <TArrayI.h>
15 #include <TArrayF.h>
16 #include <TH3.h>
17
18 class AliMUONGeometryTransformer;
19 class AliMUONDigitMaker;
20 class AliMUONTriggerTrack;
21 class AliMUONVDigitStore;
22 class AliMUONVTriggerStore;
23 class AliMUONVTriggerTrackStore;
24 class AliMUONVTrackStore;
25
26 class AliMUONTriggerChamberEff : public TObject
27 {
28 public:
29     AliMUONTriggerChamberEff();
30     AliMUONTriggerChamberEff(const AliMUONGeometryTransformer* transformer,
31                              const AliMUONDigitMaker* digitMaker,
32                              Bool_t writeOnESD=kFALSE);
33     
34     virtual ~AliMUONTriggerChamberEff();
35
36     AliMUONTriggerChamberEff(const AliMUONTriggerChamberEff& other); // copy constructor
37     AliMUONTriggerChamberEff& operator=(const AliMUONTriggerChamberEff& other); // assignment operator
38     
39     /// Set Reproduce trigger response
40     void SetReproduceTrigResponse(Bool_t reproduceTrigRes=kFALSE)
41     {fReproduceTrigResponse=reproduceTrigRes;}
42     /// Set Print informations on event
43     void SetPrintInfo(Bool_t printInfo=kFALSE)
44     {fPrintInfo=printInfo;}
45     /// Set Debug level
46     void SetDebugLevel(Int_t debugLevel)
47     {fDebugLevel=debugLevel;}
48
49     void EventChamberEff(const AliMUONVTriggerStore& triggerStore,
50                          const AliMUONVTriggerTrackStore& trigTrackStore,
51                          const AliMUONVTrackStore& trackStore);
52
53 protected:
54     Int_t MatchingPad(AliMUONVDigitStore& digitStore, Int_t &detElemId, Float_t coor[2],
55                       Bool_t isMatch[2], TArrayI nboard[2],
56                       TArrayF &zRealMatch, Float_t y11);
57     Float_t PadMatchTrack(Float_t xPad, Float_t yPad, Float_t dpx, Float_t dpy,
58                           Float_t xTrackAtPad, Float_t yTrackAtPad, Int_t chamber);
59     void InfoDigit(AliMUONVDigitStore& digitStore);
60     void CalculateEfficiency(Int_t trigger44, Int_t trigger34, Float_t &efficiency,
61                              Float_t &error, Bool_t failuresAsInput);
62     Int_t DetElemIdFromPos(Float_t x, Float_t y, Int_t chamber, Int_t cathode);
63     void LocalBoardFromPos(Float_t x, Float_t y, Int_t detElemId,
64                            Int_t cathode, Int_t localBoard[4]);
65     void ResetArrays();
66     void InitHistos();
67     Bool_t TriggerDigits(const AliMUONVTriggerStore& triggerStore,
68                          AliMUONVDigitStore& digitStore) const;
69     Bool_t IsCleanTrack(AliMUONTriggerTrack *triggerTrack,
70                         const AliMUONVTrackStore& trackStore);
71     void SaveInESDFile();
72     void GetEfficiencyHistos(TList &countList, TList &noCountList);
73
74     
75 private:
76     void CheckConstants() const;
77     /// Get max number of strips along x
78     inline Int_t GetMaxX(Int_t cath){return (cath==0) ? 7 : 112;}
79     /// Get max number of strips along x
80     inline Int_t GetMaxY(Int_t cath){return (cath==0) ? 64 : 1;}
81
82     const AliMUONGeometryTransformer* fTransformer; //!< geometry transformer
83     const AliMUONDigitMaker* fDigitMaker; //!< pointer to digit maker
84     Bool_t fReproduceTrigResponse; //!< Reproduce trigger response
85     Bool_t fPrintInfo; //!< Print informations on event
86     Int_t fWriteOnESD; //!< flag to write on ESD
87     Int_t fDebugLevel; //!< Debug level
88     const Float_t fkMaxDistance; //!< Maximum distance for reference
89
90     static const Int_t fgkNcathodes=2; ///<Number of cathodes
91     static const Int_t fgkNchambers=4; ///<Number of chambers
92     static const Int_t fgkNplanes=8;   ///<Number of planes
93     static const Int_t fgkNslats=18;   ///<Number of slats
94     static const Int_t fgkNlocations=4; ///<Number of locations
95
96     TArrayI fTrigger44; ///< Array counting # of times all chambers were efficient
97     TArrayI fTrigger34; ///< Array counting # of times chamber was inefficient
98     TArrayI fInefficientSlat[fgkNplanes]; ///< Array counting # of times slats were inefficient
99     TArrayI fHitPerSlat[fgkNplanes]; ///< Array counting # of times slats were efficient
100     TArrayI fInefficientBoard[fgkNplanes]; ///< Array counting # of times boards were inefficient
101     TArrayI fHitPerBoard[fgkNplanes]; ///< Array counting # of times boards were efficient
102
103     TH3F *fPadFired[fgkNcathodes]; ///< Histo counting the fired pads
104     
105     ClassDef(AliMUONTriggerChamberEff,3) // Trigger chamber efficiency
106 };
107 #endif