From: cblume Date: Tue, 2 Feb 2010 18:14:24 +0000 (+0000) Subject: Introducing method IsHalfChamberMasked() (Raphaelle) X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=7a6352a627901cfc31d1a679652f3bff5a15ce28;p=u%2Fmrichter%2FAliRoot.git Introducing method IsHalfChamberMasked() (Raphaelle) --- diff --git a/TRD/AliTRDcalibDB.cxx b/TRD/AliTRDcalibDB.cxx index 64fd8c691cc..6c89372de2d 100644 --- a/TRD/AliTRDcalibDB.cxx +++ b/TRD/AliTRDcalibDB.cxx @@ -746,16 +746,22 @@ Int_t AliTRDcalibDB::GetNumberOfTimeBinsDCS() const TObjArray *dcsArr = dynamic_cast(GetCachedCDBObject(kIDDCS)); if(!dcsArr){ - return -1; + printf("No DCS Object found\n"); + //return -1; + return 30; } const AliTRDCalDCS *calDCSsor = dynamic_cast(dcsArr->At(0)); // Take SOR const AliTRDCalDCS *calDCSeor = dynamic_cast(dcsArr->At(1)); // prefer SOR if(!calDCSsor){ - if(!calDCSeor) - return -1; - return calDCSeor->GetGlobalNumberOfTimeBins(); + if(!calDCSeor){ + printf("No calDCSeor found\n"); + //return -1; + return 30; + } + if(calDCSeor->GetGlobalNumberOfTimeBins() > 0.0) return calDCSeor->GetGlobalNumberOfTimeBins(); + else return 30; } // if SOR is available and the number of timebins is > -1, take this, otherwise check EOR Int_t nTimeSOR = calDCSsor->GetGlobalNumberOfTimeBins(); @@ -765,15 +771,21 @@ Int_t AliTRDcalibDB::GetNumberOfTimeBinsDCS() Int_t nTimeEOR = calDCSeor->GetGlobalNumberOfTimeBins(); if((nTimeEOR > -1) && (nTimeSOR != nTimeEOR)){ // Parameter inconsistency found, return -2 to be able to catch the error - return -2; + //return -2; + printf("Inconsistency\n"); + return 30; } } // Consisency check passed or not done - return nTimeSOR; + if(nTimeSOR > 0.0) return nTimeSOR; + else return 30; } else { // SOR has unphysical time parameter, take EOR - if(calDCSeor) return calDCSeor->GetGlobalNumberOfTimeBins(); - return -1; // Both SOR and EOR not available + if(calDCSeor) { + if(calDCSeor->GetGlobalNumberOfTimeBins() > 0.0) return calDCSeor->GetGlobalNumberOfTimeBins(); + else return 30; + } + return 30; // Both SOR and EOR not available } } @@ -979,7 +991,21 @@ Bool_t AliTRDcalibDB::IsChamberMasked(Int_t det) return cal->IsMasked(det); } +//_____________________________________________________________________________ +Bool_t AliTRDcalibDB::IsHalfChamberMasked(Int_t det, Int_t side){ + // + // Returns status, see name of functions for details ;-) + // + const AliTRDCalChamberStatus * cal = dynamic_cast + (GetCachedCDBObject(kIDChamberStatus)); + if (!cal) { + return -1; + } + + return side > 0 ? cal->IsHalfChamberSideBMasked(det) : cal->IsHalfChamberSideAMasked(det); + +} //_____________________________________________________________________________ const AliTRDCalPID *AliTRDcalibDB::GetPIDObject(AliTRDpidUtil::ETRDPIDMethod method) { @@ -1209,3 +1235,5 @@ Int_t AliTRDcalibDB::PadResponse(Double_t signal, Double_t dist } } + + diff --git a/TRD/AliTRDcalibDB.h b/TRD/AliTRDcalibDB.h index aa099611c4f..3ce576997e8 100644 --- a/TRD/AliTRDcalibDB.h +++ b/TRD/AliTRDcalibDB.h @@ -86,6 +86,7 @@ class AliTRDcalibDB : public TObject { Bool_t IsChamberInstalled(Int_t det); Bool_t IsChamberMasked(Int_t det); + Bool_t IsHalfChamberMasked(Int_t det, Int_t side); const AliTRDCalMonitoring *GetMonitoringObject(); const AliTRDCalPID *GetPIDObject(AliTRDpidUtil::ETRDPIDMethod m); @@ -154,3 +155,4 @@ class AliTRDcalibDB : public TObject { }; #endif +