]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONTriggerChamberEff.h
new SPD geometry (A.Pulvirenti)
[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
17 class AliMUONGeometryTransformer;
18 class AliMUONDigitMaker;
19 class AliMUONTriggerTrack;
20 class AliMUONVDigitStore;
21 class AliMUONVTriggerStore;
22 class AliMUONVTriggerTrackStore;
23 class AliMUONVTrackStore;
24
25 class AliMUONTriggerChamberEff : public TObject
26 {
27 public:
28     AliMUONTriggerChamberEff();
29     AliMUONTriggerChamberEff(const AliMUONGeometryTransformer* transformer,
30                              const AliMUONDigitMaker* digitMaker,
31                              Bool_t writeOnESD=kFALSE);
32     
33     virtual ~AliMUONTriggerChamberEff();
34
35     AliMUONTriggerChamberEff(const AliMUONTriggerChamberEff& other); // copy constructor
36     AliMUONTriggerChamberEff& operator=(const AliMUONTriggerChamberEff& other); // assignment operator
37     
38     /// Set Reproduce trigger response
39     void SetReproduceTrigResponse(Bool_t reproduceTrigRes=kFALSE)
40     {fReproduceTrigResponse=reproduceTrigRes;}
41     /// Set Print informations on event
42     void SetPrintInfo(Bool_t printInfo=kFALSE)
43     {fPrintInfo=printInfo;}
44     /// Set Debug level
45     void SetDebugLevel(Int_t debugLevel)
46     {fDebugLevel=debugLevel;}
47
48     void EventChamberEff(const AliMUONVTriggerStore& triggerStore,
49                          const AliMUONVTriggerTrackStore& trigTrackStore,
50                          const AliMUONVTrackStore& trackStore);
51     void WriteEfficiencyMap(const char* outputDir);
52     void WriteEfficiencyMapTxt(const char* outputDir);
53     void DisplayEfficiency(Bool_t perSlat=kFALSE);
54
55
56 protected:
57     Int_t MatchingPad(AliMUONVDigitStore& digitStore, Int_t &detElemId, Float_t coor[2],
58                       Bool_t isMatch[2], TArrayI nboard[2],
59                       TArrayF &zRealMatch, Float_t y11);
60     Float_t PadMatchTrack(Float_t xPad, Float_t yPad, Float_t dpx, Float_t dpy,
61                           Float_t xTrackAtPad, Float_t yTrackAtPad, Int_t chamber);
62     void InfoDigit(AliMUONVDigitStore& digitStore);
63     void CalculateEfficiency(Int_t trigger44, Int_t trigger34, Float_t &efficiency,
64                              Float_t &error, Bool_t failuresAsInput);
65     Int_t DetElemIdFromPos(Float_t x, Float_t y, Int_t chamber, Int_t cathode);
66     void LocalBoardFromPos(Float_t x, Float_t y, Int_t detElemId,
67                            Int_t cathode, Int_t localBoard[4]);
68     void ResetArrays();
69     Bool_t TriggerDigits(const AliMUONVTriggerStore& triggerStore,
70                          AliMUONVDigitStore& digitStore) const;
71     Bool_t IsCleanTrack(AliMUONTriggerTrack *triggerTrack,
72                         const AliMUONVTrackStore& trackStore);
73     void SaveInESDFile();
74
75     
76 private:
77     void CheckConstants() const;
78
79     const AliMUONGeometryTransformer* fTransformer; //!< geometry transformer
80     const AliMUONDigitMaker* fDigitMaker; //!< pointer to digit maker
81     Bool_t fReproduceTrigResponse; //!< Reproduce trigger response
82     Bool_t fPrintInfo; //!< Print informations on event
83     Int_t fWriteOnESD; //!< flag to write on ESD
84     Int_t fDebugLevel; //!< Debug level
85     const Float_t fkMaxDistance; //!< Maximum distance for reference
86
87     static const Int_t fgkNcathodes=2; ///<Number of cathodes
88     static const Int_t fgkNchambers=4; ///<Number of chambers
89     static const Int_t fgkNplanes=8;   ///<Number of planes
90     static const Int_t fgkNslats=18;   ///<Number of slats
91     static const Int_t fgkNlocations=4; ///<Number of locations
92
93     TArrayI fTrigger44; ///< Array counting # of times all chambers were efficient
94     TArrayI fTrigger34; ///< Array counting # of times chamber was inefficient
95     TArrayI fInefficientSlat[fgkNplanes]; ///< Array counting # of times slats were inefficient
96     TArrayI fHitPerSlat[fgkNplanes]; ///< Array counting # of times slats were efficient
97     TArrayI fInefficientBoard[fgkNplanes]; ///< Array counting # of times boards were inefficient
98     TArrayI fHitPerBoard[fgkNplanes]; ///< Array counting # of times boards were efficient
99     
100     ClassDef(AliMUONTriggerChamberEff,2) // Trigger chamber efficiency
101 };
102 #endif