X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONTriggerChamberEfficiency.cxx;h=676b8e73b3fe84b69bf245b473bf5b5377d5c813;hb=2f331bdc8a58547d8030e506b118c7fdc86e83f3;hp=08c38a3282bee4aea7b49e493dfa9cdb3676c3e8;hpb=32ceb7fa05ce511cb1335f4c8dc4d3f2c21c3180;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONTriggerChamberEfficiency.cxx b/MUON/AliMUONTriggerChamberEfficiency.cxx index 08c38a3282b..676b8e73b3f 100755 --- a/MUON/AliMUONTriggerChamberEfficiency.cxx +++ b/MUON/AliMUONTriggerChamberEfficiency.cxx @@ -17,7 +17,6 @@ #include "AliMUONTriggerEfficiencyCells.h" #include "AliMpConstants.h" -#include "AliMUONConstants.h" // Classes for display #include "AliMUONTriggerDisplay.h" @@ -138,6 +137,32 @@ Float_t AliMUONTriggerChamberEfficiency::GetCellEfficiency(Int_t detElemId, Int_ } +//__________________________________________________________________________ +Float_t AliMUONTriggerChamberEfficiency::GetCellEfficiencyError(Int_t detElemId, Int_t localBoard, Int_t hType, Int_t errType) const +{ + /// Get the efficiencie errors of the 2 cathodes at a given local board + /// errype 0 -> low error + /// errype 1 -> high error + + Int_t chamber = FindChamberIndex(detElemId); + Int_t index = GetIndex(kHboardEff, hType, chamber); + TGraphAsymmErrors* effGraph = ((TGraphAsymmErrors*)fEfficiencyObjects->At(index)); + + // Some graphs are not available in the old implementation + if ( ! effGraph ) return -1.; + + Float_t err = -1.; + if ( errType == 0 ) { // low error + err = effGraph->GetErrorYlow(localBoard-1); + } + else if ( errType == 1 ) { // up error + err = effGraph->GetErrorYhigh(localBoard-1); + } + + return err; +} + + //__________________________________________________________________________ void AliMUONTriggerChamberEfficiency::IsTriggered(Int_t detElemId, Int_t localBoard, Bool_t &trigBend, Bool_t &trigNonBend) const @@ -190,7 +215,7 @@ AliMUONTriggerChamberEfficiency::FillFromList(Bool_t useMeanValues) delete fEfficiencyObjects; const Int_t kNeffHistos = - 2 * ( AliMUONTriggerEfficiencyCells::kNcounts - 1 ) * AliMUONConstants::NTriggerCh(); + 2 * ( AliMUONTriggerEfficiencyCells::kNcounts - 1 ) * AliMpConstants::NofTriggerChambers(); fEfficiencyObjects = new TObjArray(kNeffHistos); fEfficiencyObjects->SetOwner(); @@ -210,7 +235,7 @@ AliMUONTriggerChamberEfficiency::FillFromList(Bool_t useMeanValues) if ( useMeanValues && currDe == AliMUONTriggerEfficiencyCells::kHboardCount ) continue; - for(Int_t ich=0; ichGetHistoName(currDe, AliMUONTriggerEfficiencyCells::kAllTracks, ich); if ( fEfficiencyMap->GetHistoList() ) { histoDen = (TH1F*)fEfficiencyMap->GetHistoList()->FindObject(histoName.Data()); @@ -239,8 +264,6 @@ AliMUONTriggerChamberEfficiency::FillFromList(Bool_t useMeanValues) index = GetIndex(deTypeEff[ide], hType, ich); TGraphAsymmErrors* effGraph = GetEfficiencyGraph(histoNum,histoDen); - histoName.ReplaceAll("Count","Eff"); - effGraph->SetName(histoName.Data()); fEfficiencyObjects->AddAt(effGraph, index); TString debugString = Form("Adding object %s",effGraph->GetName()); @@ -248,7 +271,7 @@ AliMUONTriggerChamberEfficiency::FillFromList(Bool_t useMeanValues) debugString += Form(" index %i",index); AliDebug(5,debugString.Data()); - if ( useMeanValues ){ + if ( useMeanValues && rebuildEfficiency ){ Int_t currChamber = ich + AliMpConstants::NofTrackingChambers(); histoName = fEfficiencyMap->GetHistoName(AliMUONTriggerEfficiencyCells::kHboardCount, hType, ich); TH1F* auxHistoNum = (TH1F*)fEfficiencyMap->GetHistoList()->FindObject(histoName.Data())->Clone("tempHistoNum"); @@ -262,8 +285,6 @@ AliMUONTriggerChamberEfficiency::FillFromList(Bool_t useMeanValues) } index = GetIndex(kHboardEff, hType, ich); effGraph = GetEfficiencyGraph(auxHistoNum,auxHistoDen); - histoName.ReplaceAll("Count","Eff"); - effGraph->SetName(histoName.Data()); fEfficiencyObjects->AddAt(effGraph, index); AliDebug(5,Form("Adding object %s (%s/%s) at index %i",effGraph->GetName(),histoNum->GetName(),histoDen->GetName(),index)); delete auxHistoNum; @@ -319,7 +340,7 @@ void AliMUONTriggerChamberEfficiency::DisplayEfficiency(Bool_t perSlat, Bool_t s TGraph* graph = 0x0; // Book histos - for(Int_t ich=0; ichGetName(); histoName += baseCanName; Int_t shift = 10*(index%((AliMUONTriggerEfficiencyCells::kNcounts - 1)* - AliMUONConstants::NTriggerCh())); + AliMpConstants::NofTriggerChambers())); can = new TCanvas(histoName.Data(), histoName.Data(), 100+shift, shift, 700, 700); can->SetRightMargin(0.14); can->SetLeftMargin(0.12); @@ -398,7 +419,7 @@ AliMUONTriggerChamberEfficiency::GetIndex(Int_t histoType, Int_t countType, // const Int_t kNtypes = AliMUONTriggerEfficiencyCells::kNcounts - 1; - const Int_t kNchambers = AliMUONConstants::NTriggerCh(); + const Int_t kNchambers = AliMpConstants::NofTriggerChambers(); return histoType * kNtypes * kNchambers + chamber * kNtypes + @@ -407,6 +428,19 @@ AliMUONTriggerChamberEfficiency::GetIndex(Int_t histoType, Int_t countType, //chamber; } + +//_____________________________________________________________________________ +TObject* AliMUONTriggerChamberEfficiency::GetEffObject(Int_t histoType, Int_t countType, + Int_t chamber) +{ + // + /// Get efficiency object + // + Int_t index = GetIndex(histoType, countType, chamber); + return fEfficiencyObjects->At(index); +} + + //_____________________________________________________________________________ TGraphAsymmErrors* AliMUONTriggerChamberEfficiency::GetEfficiencyGraph(TH1* histoNum, TH1* histoDen) { @@ -422,6 +456,10 @@ TGraphAsymmErrors* AliMUONTriggerChamberEfficiency::GetEfficiencyGraph(TH1* hist Int_t npoints = histoNum->GetNbinsX(); TGraphAsymmErrors* effGraph = new TGraphAsymmErrors(npoints); + TString histoName = histoNum->GetName(); + histoName.ReplaceAll("Count","Eff"); + effGraph->SetName(histoName.Data()); + effGraph->SetTitle(histoName.Data()); Double_t oldX, oldY; for ( Int_t ibin=0; ibin