/// \ingroup base
/// \class AliMUONTriggerChamberEff
/// \brief trigger chamber efficiency from data
-/// \author Diego Stocco
+///
+// Author Diego Stocco
#include <TObject.h>
-#include <TString.h>
+#include <TList.h>
+#include <TArrayI.h>
+#include <TArrayF.h>
+#include <TH3.h>
-class AliRunLoader;
-class AliMUONData;
-class AliMUON;
-class AliMUONGlobalTrigger;
-class TString;
+class AliMUONGeometryTransformer;
+class AliMUONDigitMaker;
+class AliMUONTriggerTrack;
+class AliMUONVDigitStore;
+class AliMUONVTriggerStore;
+class AliMUONVTriggerTrackStore;
+class AliMUONVTrackStore;
class AliMUONTriggerChamberEff : public TObject
{
public:
- AliMUONTriggerChamberEff(const char* galiceFile, Int_t firstEvent=0, Int_t lastEvent=-1);
- AliMUONTriggerChamberEff(Int_t firstRun, Int_t lastRun, const char* galiceRunDir, Int_t firstEvent=0, Int_t lastEvent=-1);
+ AliMUONTriggerChamberEff();
+ AliMUONTriggerChamberEff(const AliMUONGeometryTransformer* transformer,
+ const AliMUONDigitMaker* digitMaker,
+ Bool_t writeOnESD=kFALSE);
+
virtual ~AliMUONTriggerChamberEff();
+ AliMUONTriggerChamberEff(const AliMUONTriggerChamberEff& other); // copy constructor
+ AliMUONTriggerChamberEff& operator=(const AliMUONTriggerChamberEff& other); // assignment operator
+
+ /// Set Reproduce trigger response
void SetReproduceTrigResponse(Bool_t reproduceTrigRes=kFALSE)
{fReproduceTrigResponse=reproduceTrigRes;}
+ /// Set Print informations on event
void SetPrintInfo(Bool_t printInfo=kFALSE)
{fPrintInfo=printInfo;}
+ /// Set Debug level
void SetDebugLevel(Int_t debugLevel)
{fDebugLevel=debugLevel;}
- void PerformTriggerChamberEff(const char* outputDir);
-
+ void EventChamberEff(const AliMUONVTriggerStore& triggerStore,
+ const AliMUONVTriggerTrackStore& trigTrackStore,
+ const AliMUONVTrackStore& trackStore);
+
protected:
- Bool_t PadMatchTrack(Float_t xPad, Float_t yPad, Float_t dpx, Float_t dpy,
- Float_t xTrackAtPad, Float_t yTrackAtPad, Int_t chamber);
- Bool_t IsDiffLocalBoard(Int_t currDetElemId, Int_t iy, Int_t detElemIdP1, Int_t iyDigitP1) const;
- void PrintTrigger(AliMUONGlobalTrigger *globalTrig);
- void InfoDigit();
- void CalculateEfficiency(Int_t trigger44, Int_t trigger34, Float_t &efficiency, Float_t &error, Bool_t failuresAsInput);
+ Int_t MatchingPad(AliMUONVDigitStore& digitStore, Int_t &detElemId, Float_t coor[2],
+ Bool_t isMatch[2], TArrayI nboard[2],
+ TArrayF &zRealMatch, Float_t y11);
+ Float_t PadMatchTrack(Float_t xPad, Float_t yPad, Float_t dpx, Float_t dpy,
+ Float_t xTrackAtPad, Float_t yTrackAtPad, Int_t chamber);
+ void InfoDigit(AliMUONVDigitStore& digitStore);
+ void CalculateEfficiency(Int_t trigger44, Int_t trigger34, Float_t &efficiency,
+ Float_t &error, Bool_t failuresAsInput);
Int_t DetElemIdFromPos(Float_t x, Float_t y, Int_t chamber, Int_t cathode);
- void LocalBoardFromPos(Float_t x, Float_t y, Int_t detElemId, Int_t cathode, Int_t localBoard[4]);
+ void LocalBoardFromPos(Float_t x, Float_t y, Int_t detElemId,
+ Int_t cathode, Int_t localBoard[4]);
void ResetArrays();
- void WriteOutput(const char* outputDir, Int_t totNumOfTrig[4][2], Int_t atLeast1MuPerEv[4][2]);
- void WriteEfficiencyMap(const char* outputDir);
+ void InitHistos();
+ Bool_t TriggerDigits(const AliMUONVTriggerStore& triggerStore,
+ AliMUONVDigitStore& digitStore) const;
+ Bool_t IsCleanTrack(AliMUONTriggerTrack *triggerTrack,
+ const AliMUONVTrackStore& trackStore);
+ void SaveInESDFile();
+ void GetEfficiencyHistos(TList &countList, TList &noCountList);
+
private:
- AliMUONTriggerChamberEff(const AliMUONTriggerChamberEff& other);
- AliMUONTriggerChamberEff& operator=(const AliMUONTriggerChamberEff& other);
-
- void SetGaliceFile(const char* galiceFile);
- void CleanGalice();
-
- Int_t fFirstEvent; //!< First event to consider
- Int_t fLastEvent; //!< Last event to consider
- Int_t fFirstRun; //!< First run to consider
- Int_t fLastRun; //!< Last run to consider
- AliRunLoader* fRunLoader; //!< AliRunLoader pointer
- AliMUONData* fData; //!< AliMUONData pointer (to access containers)
- Bool_t fReproduceTrigResponse;//!< Reproduce trigger response
- Bool_t fPrintInfo;//!< Print informations on event
- AliMUON *fMUON; //!< AliMUON pointer
+ void CheckConstants() const;
+ /// Get max number of strips along x
+ Int_t GetMaxX(Int_t cath) const {return (cath==0) ? 7 : 112;}
+ /// Get max number of strips along x
+ Int_t GetMaxY(Int_t cath) const {return (cath==0) ? 64 : 1;}
+
+ const AliMUONGeometryTransformer* fTransformer; //!< geometry transformer
+ const AliMUONDigitMaker* fDigitMaker; //!< pointer to digit maker
+ Bool_t fReproduceTrigResponse; //!< Reproduce trigger response
+ Bool_t fPrintInfo; //!< Print informations on event
+ Int_t fWriteOnESD; //!< flag to write on ESD
Int_t fDebugLevel; //!< Debug level
- TString fGaliceDir; //!< base directory for many runs.
+ const Float_t fkMaxDistance; //!< Maximum distance for reference
- static const Int_t fgkNchambers=4; //!< Number of trigger chambers
- static const Int_t fgkNcathodes=2; //!< Number of cathodes per chamber
- static const Int_t fgkNslats=18; //!< Number of slats per chamber
- static const Int_t fgkNboards=234; //!< Number of trigger boards per chamber
+ static const Int_t fgkNcathodes=2; ///<Number of cathodes
+ static const Int_t fgkNchambers=4; ///<Number of chambers
+ static const Int_t fgkNplanes=8; ///<Number of planes
+ static const Int_t fgkNslats=18; ///<Number of slats
+ static const Int_t fgkNlocations=4; ///<Number of locations
- Int_t fTrigger34[fgkNchambers][fgkNcathodes];//!< Array counting # of times chamber was inefficient
- Int_t fTrigger44[fgkNcathodes];//!< Array counting # of times all chambers were efficient
- Int_t fInefficientSlat[fgkNchambers][fgkNcathodes][fgkNslats];//!< Array counting # of times slats were inefficient
- Int_t fHitPerSlat[fgkNchambers][fgkNcathodes][fgkNslats];//!< Array counting # of times slats were efficient
- Int_t fInefficientBoard[fgkNchambers][fgkNcathodes][fgkNboards];//!< Array counting # of times boards were inefficient
- Int_t fHitPerBoard[fgkNchambers][fgkNcathodes][fgkNboards];//!< Array counting # of times boards were efficient
+ TArrayI fTrigger44; ///< Array counting # of times all chambers were efficient
+ TArrayI fTrigger34; ///< Array counting # of times chamber was inefficient
+ TArrayI fInefficientSlat[fgkNplanes]; ///< Array counting # of times slats were inefficient
+ TArrayI fHitPerSlat[fgkNplanes]; ///< Array counting # of times slats were efficient
+ TArrayI fInefficientBoard[fgkNplanes]; ///< Array counting # of times boards were inefficient
+ TArrayI fHitPerBoard[fgkNplanes]; ///< Array counting # of times boards were efficient
- ClassDef(AliMUONTriggerChamberEff,0) // Dumper of MUON related data
+ TH3F *fPadFired[fgkNcathodes]; ///< Histo counting the fired pads
+
+ ClassDef(AliMUONTriggerChamberEff,3) // Trigger chamber efficiency
};
#endif