AliPhysics  b555aef (b555aef)
AliMTRChEffAnalysis.h
Go to the documentation of this file.
1 #ifndef ALIMTRCHEFFANALYSIS_h
2 #define ALIMTRCHEFFANALYSIS_h
3 
13 
14 #include "TObject.h"
15 #include "TString.h"
16 #include "AliTrigChEffOutput.h"
17 #include <map>
18 #include <string>
19 #include <vector>
20 
21 class TObjArray;
22 class TDirectory;
23 class TH1;
24 class TGraphAsymmErrors;
25 class TArrayI;
26 class TArrayD;
27 class TList;
28 
29 class AliMTRChEffAnalysis : public TObject {
30  public:
32  AliMTRChEffAnalysis ( const char *localFileList, const char *outputName = "testMTRChamberEff" );
33 
34  TArrayI GetHomogeneousRanges ( Double_t chi2Cut = 3, Int_t maxNRanges = 4, Double_t minEffVariation = 0.005, Bool_t perRPC = kTRUE, TArrayI* forcedChanges = 0x0, Double_t minEff = 0.85, Double_t maxEff = 1.01 );
35  TArrayI GetHomogeneousRanges ( TGraphAsymmErrors* trendGraph, Double_t chi2Cut = 3, Int_t maxNRanges = 4, Double_t minEffVariation = 0.005, TArrayI* forcedChanges = 0x0, Bool_t returnIndex = kFALSE );
36 
37  void DrawEffTrend ( Int_t itype, Int_t irpc, Double_t maxNsigmasOutliers = -1., Double_t minEff = 0.8, Double_t maxEff = 1.01 ) const;
38  void DrawStatContribution ( Int_t itype, Int_t irpc, Double_t maxNsigmaOutliers = -1., Double_t minY = 0., Double_t maxY = 0.15 ) const;
39 
40  Double_t GetAverageStat ( Int_t firstRun, Int_t lastRun, Int_t itype = AliTrigChEffOutput::kHboardEff, Bool_t excludePeriphericBoards = kTRUE ) const;
41 
42  TGraphAsymmErrors* GetOutliers ( TGraphAsymmErrors* graph, Double_t maxNsigmas = 3. ) const;
43 
44  TH1* GetTrend ( Int_t itype, Int_t icount, Int_t ichamber, Int_t idetelem ) const;
45  TGraphAsymmErrors* GetTrendEff ( Int_t itype, Int_t icount, Int_t ichamber, Int_t idetelem ) const;
46 
47  Int_t CompareEfficiencies ( const char* sources, const char* titles, const char* opt, const char* canvasNameSuffix = "" ) const;
48  Int_t CompareEfficiencyMethods ( const char* source, const char* opt, const char* canvasNameSuffix = "" ) const;
49  void CompareMergedEfficiencies ( const char* opt ) const;
50  Int_t ComputeAndCompareEfficiencies ( const char* sources, const char* titles, const char* opt, const char* canvasNameSuffix = "") const;
51 
52  Bool_t AddSystematicCondition ( const char* physSel, const char* trigClassName, const char* centrality, Int_t itrackSel, Int_t imatch, Int_t imethod );
54  Bool_t SetEffConditions ( const char* physSel, const char* trigClassName, const char* centrality, Int_t itrackSel, Int_t imatch, Int_t imethod );
55 
56  Bool_t MergeOutput ( TArrayI runRanges, Double_t averageStatError = 0.01, Bool_t isIndex = kFALSE );
57 
58  Bool_t InitFromGrid ( const char *runList, const char *path, const char *pattern, const char* localFileList = "localFileList.txt", const char* outDir = "", const char *directory = "MTR_ChamberEffMap", const char *outputName = "testMTRChamberEff" );
59  Bool_t InitFromLocal ( const char *localFileList, const char *outputName = "testMTRChamberEff" );
60  Bool_t InitFromWeb ( const char *runList, const char *path, const char* localFileList = "localFileList.txt", const char* outDir = "", const char *directory = "MTR_ChamberEffMap", const char *outputName = "testMTRChamberEff" );
61 
62 
63  Bool_t WriteMergedToOCDB ( const char* outputCDB = "CDB", Bool_t writeSystematics = kFALSE ) const;
64  Bool_t DrawSystematicEnvelope ( Bool_t perRPC = kFALSE ) const;
66  Bool_t RecoverEfficiency ( const char* runList, const char* ocdb, const char* systOcdb, Int_t referenceRun = -1 );
67 
68  static void ZoomPad();
69 
70  virtual ~AliMTRChEffAnalysis();
71 
72  private:
73 
74  Bool_t AddToList ( const char *filename, const char *outputName );
75  TArrayI BoardsInRPC ( Int_t irpc ) const;
76  void CopyDir ( TDirectory *source ) const;
77  Bool_t CopyLocally ( const char* runList, const char* path, const char* pattern, const char* localFileList, const char* outDir, const char* directory ) const;
78  Int_t Check() const;
79  Int_t CompareEfficiencies ( TObjArray* effHistoLists, const char* titles, const char* opt, const char* canvasNameSuffix ) const;
80  TList* CloneEffHistoList ( TList* effHistos ) const;
81  Bool_t ExecCommand ( TString command, Bool_t prompt ) const;
83  Double_t GetError ( Double_t errLow, Double_t errHigh ) const;
84  TList* GetEffHistoList ( AliTrigChEffOutput* trigOut, TObjArray* condition ) const;
85  TH1* GetHisto ( TList* effHistoList, Int_t itype, Int_t icount, Int_t ichamber ) const;
86  Int_t GetIndexFromRun ( Int_t runNumber ) const;
87  Int_t GetRunNumber ( Int_t ipt ) const;
88  TList* GetRunList ( const char* runList ) const;
89  TString GetId ( const char* condition, Int_t minRun, Int_t maxRun = -1 ) const;
90 
91  TString GetShortConditionTitle ( const char* conditionName ) const;
92  AliTrigChEffOutput* Namer() const;
93 
94  TH1* GetSum ( AliTrigChEffOutput* trigOut, TObjArray* condition, Int_t itype, Int_t icount, Int_t ichamber ) const;
95 
96  Double_t GetThreeOfFour ( TArrayD eff, TArrayD effErr, Double_t &probErr ) const;
97 
98 
99  Bool_t HasMergedResults () const;
100 
101  TArrayI MergeRangesForStat ( TArrayI runRanges, Double_t averageStatError, Bool_t excludePeriphericBoards = kTRUE ) const;
102 
103  TList* ReadEffHistoList ( const char* src ) const;
104 
105  Bool_t SetCondition ( const char* physSel, const char* trigClassName, const char* centrality, Int_t itrackSel, Int_t imatch, Int_t imethod, Bool_t isBasic );
106 
111 
113 
115 
116  class AliMTRChEffInnerObj : public TObject {
117  public:
118  AliMTRChEffInnerObj ( const char* filename, const char* outputname, Int_t minRun, Int_t maxRun = -1 );
119  virtual ~AliMTRChEffInnerObj ();
120  TString GetFilename () const { return fFilename; }
121  TString GetOutputname () const { return fOutputname; }
122  Int_t GetMinRun () const { return fMinRun; }
123  Int_t GetMaxRun () const { return fMaxRun; }
124  std::map<std::string,TList*> GetEffLists() { return fEffLists; }
125  std::vector<std::string> GetSortKeys() { return fSortKeys; }
126  TList* GetEffHistoList ( const char* condition ) const;
127  Bool_t AddEffHistoList ( const char* condition, TList* effHistoList );
128  Bool_t RemoveEffHistoList ( const char* condition );
129 
130  private:
135  std::map<std::string,TList*> fEffLists;
136  std::vector<std::string> fSortKeys;
137  };
138 
139  std::vector<AliMTRChEffAnalysis::AliMTRChEffInnerObj*> fRunMap;
140  std::vector<AliMTRChEffAnalysis::AliMTRChEffInnerObj*> fMergedMap;
141 
143  ClassDef(AliMTRChEffAnalysis, 0); // Trigger chamber efficiencies
145 };
146 
147 #endif
std::map< std::string, TList * > GetEffLists()
const char * filename
Definition: TestFCM.C:1
void CompareMergedEfficiencies(const char *opt) const
double Double_t
Definition: External.C:58
void CopyDir(TDirectory *source) const
Double_t GetError(Double_t errLow, Double_t errHigh) const
std::map< std::string, TList * > fEffLists
Bool_t CopyLocally(const char *runList, const char *path, const char *pattern, const char *localFileList, const char *outDir, const char *directory) const
Double_t GetThreeOfFour(TArrayD eff, TArrayD effErr, Double_t &probErr) const
TGraphAsymmErrors * GetTrendEff(Int_t itype, Int_t icount, Int_t ichamber, Int_t idetelem) const
centrality
std::vector< std::string > GetSortKeys()
Bool_t RemoveEffHistoList(const char *condition)
AliMTRChEffInnerObj(const char *filename, const char *outputname, Int_t minRun, Int_t maxRun=-1)
TArrayI MergeRangesForStat(TArrayI runRanges, Double_t averageStatError, Bool_t excludePeriphericBoards=kTRUE) const
Int_t ComputeAndCompareEfficiencies(const char *sources, const char *titles, const char *opt, const char *canvasNameSuffix="") const
Counts per board histogram index.
Bool_t InitFromWeb(const char *runList, const char *path, const char *localFileList="localFileList.txt", const char *outDir="", const char *directory="MTR_ChamberEffMap", const char *outputName="testMTRChamberEff")
Int_t CompareEfficiencies(const char *sources, const char *titles, const char *opt, const char *canvasNameSuffix="") const
TList * GetEffHistoList(const char *condition) const
TList * GetEffHistoList(AliTrigChEffOutput *trigOut, TObjArray *condition) const
int Int_t
Definition: External.C:63
Bool_t WriteMergedToOCDB(const char *outputCDB="CDB", Bool_t writeSystematics=kFALSE) const
AliMTRChEffAnalysis & operator=(const AliMTRChEffAnalysis &)
Dummy.
Bool_t AddToList(const char *filename, const char *outputName)
Int_t CompareEfficiencyMethods(const char *source, const char *opt, const char *canvasNameSuffix="") const
Output for Trig chamber effieincy.
Bool_t InitFromLocal(const char *localFileList, const char *outputName="testMTRChamberEff")
Bool_t AddEffHistoList(const char *condition, TList *effHistoList)
TArrayI GetHomogeneousRanges(Double_t chi2Cut=3, Int_t maxNRanges=4, Double_t minEffVariation=0.005, Bool_t perRPC=kTRUE, TArrayI *forcedChanges=0x0, Double_t minEff=0.85, Double_t maxEff=1.01)
Bool_t SetEffConditions(const char *physSel, const char *trigClassName, const char *centrality, Int_t itrackSel, Int_t imatch, Int_t imethod)
Output for Trig chamber effieincy.
AliTrigChEffOutput * fNamer
! Namer for histograms
void DrawStatContribution(Int_t itype, Int_t irpc, Double_t maxNsigmaOutliers=-1., Double_t minY=0., Double_t maxY=0.15) const
Double_t GetAverageStat(Int_t firstRun, Int_t lastRun, Int_t itype=AliTrigChEffOutput::kHboardEff, Bool_t excludePeriphericBoards=kTRUE) const
TString GetId(const char *condition, Int_t minRun, Int_t maxRun=-1) const
AliTrigChEffOutput * Namer() const
std::vector< AliMTRChEffAnalysis::AliMTRChEffInnerObj * > fRunMap
! Map of internal objects per run
std::vector< AliMTRChEffAnalysis::AliMTRChEffInnerObj * > fMergedMap
! Map of merged internal objects
TH1 * GetHisto(TList *effHistoList, Int_t itype, Int_t icount, Int_t ichamber) const
Bool_t SetCondition(const char *physSel, const char *trigClassName, const char *centrality, Int_t itrackSel, Int_t imatch, Int_t imethod, Bool_t isBasic)
TList * GetRunList(const char *runList) const
Int_t GetRunNumber(Int_t ipt) const
Bool_t HasMergedResults() const
Bool_t ExecCommand(TString command, Bool_t prompt) const
TArrayI BoardsInRPC(Int_t irpc) const
Bool_t RecoverEfficiency(const char *runList, const char *ocdb, const char *systOcdb, Int_t referenceRun=-1)
Int_t GetIndexFromRun(Int_t runNumber) const
Double_t FitRangesFunc(Double_t *x, Double_t *par)
void DrawEffTrend(Int_t itype, Int_t irpc, Double_t maxNsigmasOutliers=-1., Double_t minEff=0.8, Double_t maxEff=1.01) const
TObjArray * fConditions
! List of conditions for trigger efficiency
Bool_t InitFromGrid(const char *runList, const char *path, const char *pattern, const char *localFileList="localFileList.txt", const char *outDir="", const char *directory="MTR_ChamberEffMap", const char *outputName="testMTRChamberEff")
TList * CloneEffHistoList(TList *effHistos) const
TGraphAsymmErrors * GetOutliers(TGraphAsymmErrors *graph, Double_t maxNsigmas=3.) const
Bool_t AddSystematicCondition(const char *physSel, const char *trigClassName, const char *centrality, Int_t itrackSel, Int_t imatch, Int_t imethod)
bool Bool_t
Definition: External.C:53
TString GetShortConditionTitle(const char *conditionName) const
Bool_t DrawSystematicEnvelope(Bool_t perRPC=kFALSE) const
Bool_t MergeOutput(TArrayI runRanges, Double_t averageStatError=0.01, Bool_t isIndex=kFALSE)
Definition: External.C:196
TH1 * GetSum(AliTrigChEffOutput *trigOut, TObjArray *condition, Int_t itype, Int_t icount, Int_t ichamber) const
TList * ReadEffHistoList(const char *src) const
TH1 * GetTrend(Int_t itype, Int_t icount, Int_t ichamber, Int_t idetelem) const