]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONTriggerChamberEff.h
Protection against not accessible input OCDB (Laurent)
[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
52 protected:
53     Int_t MatchingPad(AliMUONVDigitStore& digitStore, Int_t &detElemId, Float_t coor[2],
54                       Bool_t isMatch[2], TArrayI nboard[2],
55                       TArrayF &zRealMatch, Float_t y11);
56     Float_t PadMatchTrack(Float_t xPad, Float_t yPad, Float_t dpx, Float_t dpy,
57                           Float_t xTrackAtPad, Float_t yTrackAtPad, Int_t chamber);
58     void InfoDigit(AliMUONVDigitStore& digitStore);
59     void CalculateEfficiency(Int_t trigger44, Int_t trigger34, Float_t &efficiency,
60                              Float_t &error, Bool_t failuresAsInput);
61     Int_t DetElemIdFromPos(Float_t x, Float_t y, Int_t chamber, Int_t cathode);
62     void LocalBoardFromPos(Float_t x, Float_t y, Int_t detElemId,
63                            Int_t cathode, Int_t localBoard[4]);
64     void ResetArrays();
65     Bool_t TriggerDigits(const AliMUONVTriggerStore& triggerStore,
66                          AliMUONVDigitStore& digitStore) const;
67     Bool_t IsCleanTrack(AliMUONTriggerTrack *triggerTrack,
68                         const AliMUONVTrackStore& trackStore);
69     void SaveInESDFile();
70     void GetEfficiencyHistos(TList &countList, TList &noCountList);
71
72     
73 private:
74     void CheckConstants() const;
75
76     const AliMUONGeometryTransformer* fTransformer; //!< geometry transformer
77     const AliMUONDigitMaker* fDigitMaker; //!< pointer to digit maker
78     Bool_t fReproduceTrigResponse; //!< Reproduce trigger response
79     Bool_t fPrintInfo; //!< Print informations on event
80     Int_t fWriteOnESD; //!< flag to write on ESD
81     Int_t fDebugLevel; //!< Debug level
82     const Float_t fkMaxDistance; //!< Maximum distance for reference
83
84     static const Int_t fgkNcathodes=2; ///<Number of cathodes
85     static const Int_t fgkNchambers=4; ///<Number of chambers
86     static const Int_t fgkNplanes=8;   ///<Number of planes
87     static const Int_t fgkNslats=18;   ///<Number of slats
88     static const Int_t fgkNlocations=4; ///<Number of locations
89
90     TArrayI fTrigger44; ///< Array counting # of times all chambers were efficient
91     TArrayI fTrigger34; ///< Array counting # of times chamber was inefficient
92     TArrayI fInefficientSlat[fgkNplanes]; ///< Array counting # of times slats were inefficient
93     TArrayI fHitPerSlat[fgkNplanes]; ///< Array counting # of times slats were efficient
94     TArrayI fInefficientBoard[fgkNplanes]; ///< Array counting # of times boards were inefficient
95     TArrayI fHitPerBoard[fgkNplanes]; ///< Array counting # of times boards were efficient
96     
97     ClassDef(AliMUONTriggerChamberEff,2) // Trigger chamber efficiency
98 };
99 #endif