#include "AliMUONTriggerEfficiencyCells.h"
#include "AliMpConstants.h"
-#include "AliMUONConstants.h"
// Classes for display
#include "AliMUONTriggerDisplay.h"
}
+//__________________________________________________________________________
+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
delete fEfficiencyObjects;
const Int_t kNeffHistos =
- 2 * ( AliMUONTriggerEfficiencyCells::kNcounts - 1 ) * AliMUONConstants::NTriggerCh();
+ 2 * ( AliMUONTriggerEfficiencyCells::kNcounts - 1 ) * AliMpConstants::NofTriggerChambers();
fEfficiencyObjects = new TObjArray(kNeffHistos);
fEfficiencyObjects->SetOwner();
if ( useMeanValues && currDe == AliMUONTriggerEfficiencyCells::kHboardCount )
continue;
- for(Int_t ich=0; ich<AliMUONConstants::NTriggerCh(); ich++){
+ for(Int_t ich=0; ich<AliMpConstants::NofTriggerChambers(); ich++){
histoName = fEfficiencyMap->GetHistoName(currDe, AliMUONTriggerEfficiencyCells::kAllTracks, ich);
if ( fEfficiencyMap->GetHistoList() ) {
histoDen = (TH1F*)fEfficiencyMap->GetHistoList()->FindObject(histoName.Data());
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());
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");
}
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;
TGraph* graph = 0x0;
// Book histos
- for(Int_t ich=0; ich<AliMUONConstants::NTriggerCh(); ich++){
+ for(Int_t ich=0; ich<AliMpConstants::NofTriggerChambers(); ich++){
Int_t currCh = 11 + ich;
for(Int_t hType=0; hType<AliMUONTriggerEfficiencyCells::kNcounts - 1; hType++){
index = GetIndex(deType, hType, ich);
histoName = graph->GetName();
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);
//
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 +
//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)
{
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<npoints; ibin++ ) {
Int_t foundPoint = -1;