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));
+
+ TString debugString = Form("Adding object %s",effGraph->GetName());
+ if ( histoDen ) debugString += Form(" (%s/%s)",histoNum->GetName(),histoDen->GetName());
+ debugString += Form(" index %i",index);
+ AliDebug(5,debugString.Data());
if ( useMeanValues ){
Int_t currChamber = ich + AliMpConstants::NofTrackingChambers();
}
else {
TGraph* inputGraph = dynamic_cast<TGraph*>(inputObject);
- if ( inputGraph->GetN() == 0 ){
- return kTRUE;
+ if ( inputGraph ) {
+ if ( inputGraph->GetN() == 0 ){
+ return kTRUE;
+ }
+ }
+ else {
+ AliWarning("The object should inherit from TH1 or TGraph!");
+ return kFALSE;
}
}
}
/// Given the bin in inputHisto, search the corresponding bins
/// in display histo and fill it.
//
- TString className = inputObject->ClassName();
Int_t binY=0;
Float_t binContent=0;
- if ( className.Contains("TH") ) {
- TH1* inputHisto = dynamic_cast<TH1*>(inputObject);
+ TH1* inputHisto = dynamic_cast<TH1*>(inputObject);
+ if ( inputHisto ) {
Int_t binX = inputHisto->GetXaxis()->FindBin(iElement1);
- if(className.Contains("TH2")) {
+ if ( inputObject->IsA()->InheritsFrom("TH2") ) {
binY = inputHisto->GetYaxis()->FindBin(iElement2);
binContent = inputHisto->GetBinContent(binX, binY);
}
}
else {
TGraph* inputGraph = dynamic_cast<TGraph*>(inputObject);
- Double_t xpt, ypt;
- for ( Int_t ipt=0; ipt<inputGraph->GetN(); ipt++){
- inputGraph->GetPoint(ipt, xpt, ypt);
- if ( TMath::Abs(xpt - iElement1) < 0.1 ) {
- binContent = ypt;
- break;
+ if ( inputGraph ) {
+ Double_t xpt, ypt;
+ for ( Int_t ipt=0; ipt<inputGraph->GetN(); ipt++){
+ inputGraph->GetPoint(ipt, xpt, ypt);
+ if ( TMath::Abs(xpt - iElement1) < 0.1 ) {
+ binContent = ypt;
+ break;
+ }
}
}
- }
+ else return;
+ }
if(binContent==0) {
if(displayOpt==kShowZeroes) binContent = 1e-5;