#include "Cal/AliTRDCalROC.h"
#include "Cal/AliTRDCalPad.h"
#include "Cal/AliTRDCalDet.h"
-#include "Cal/AliTRDCalGlobals.h"
-#include "Cal/AliTRDCalPIDLQ.h"
+#include "Cal/AliTRDCalFEE.h"
+#include "Cal/AliTRDCalPID.h"
#include "Cal/AliTRDCalMonitoring.h"
#include "Cal/AliTRDCalChamberStatus.h"
#include "Cal/AliTRDCalPadStatus.h"
// Create the sampled PRF
SamplePRF();
-
+
}
//_____________________________________________________________________________
case kIDMonitoringData :
return CacheCDBEntry(kIDMonitoringData ,"TRD/Calib/MonitoringData");
break;
- case kIDGlobals :
- return CacheCDBEntry(kIDGlobals ,"TRD/Calib/Globals");
+ case kIDFEE :
+ return CacheCDBEntry(kIDFEE ,"TRD/Calib/FEE");
break;
+ case kIDPIDNN :
+ return CacheCDBEntry(kIDPIDNN ,"TRD/Calib/PIDNN");
case kIDPIDLQ :
return CacheCDBEntry(kIDPIDLQ ,"TRD/Calib/PIDLQ");
break;
AliCDBEntry *entry = AliCDBManager::Instance()->Get(cdbPath,fRun);
if (!entry) {
- AliError(Form("Failed to get entry: %s",cdbPath));
+ AliFatal(Form("Failed to get entry: %s",cdbPath));
return 0;
}
return calChamber->GetValue(det) * roc->GetValue(col,row);
}
+
+//_____________________________________________________________________________
+AliTRDCalROC *AliTRDcalibDB::GetVdriftROC(Int_t det)
+{
+ //
+ // Returns the Vdrift calibration object for a given ROC
+ // containing one number per pad
+ //
+
+ const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
+ (GetCachedCDBObject(kIDVdriftPad));
+ if (!calPad) {
+ return 0;
+ }
+
+ AliTRDCalROC *roc = calPad->GetCalROC(det);
+ if (!roc) {
+ return 0;
+ }
+ else {
+ return roc;
+ }
+
+}
+
+//_____________________________________________________________________________
+const AliTRDCalDet *AliTRDcalibDB::GetVdriftDet()
+{
+ //
+ // Returns the Vdrift calibration object
+ // containing one number per detector
+ //
+
+ const AliTRDCalDet *calChamber = dynamic_cast<const AliTRDCalDet *>
+ (GetCachedCDBObject(kIDVdriftChamber));
+ if (!calChamber) {
+ return 0;
+ }
+ else {
+ return calChamber;
+ }
+
+}
//_____________________________________________________________________________
Float_t AliTRDcalibDB::GetVdriftAverage(Int_t det)
// Returns t0 for the given pad.
//
- const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
- (GetCachedCDBObject(kIDT0Pad));
+ const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
+ (GetCachedCDBObject(kIDT0Pad));
if (!calPad) {
return -1;
}
- AliTRDCalROC *roc = calPad->GetCalROC(det);
+ AliTRDCalROC *roc = calPad->GetCalROC(det);
if (!roc) {
return -1;
}
- const AliTRDCalDet *calChamber = dynamic_cast<const AliTRDCalDet *>
- (GetCachedCDBObject(kIDT0Chamber));
+ const AliTRDCalDet *calChamber = dynamic_cast<const AliTRDCalDet *>
+ (GetCachedCDBObject(kIDT0Chamber));
if (!calChamber) {
return -1;
}
- return calChamber->GetValue(det) * roc->GetValue(col,row);
+ return calChamber->GetValue(det) + roc->GetValue(col,row);
+
+}
+
+//_____________________________________________________________________________
+AliTRDCalROC *AliTRDcalibDB::GetT0ROC(Int_t det)
+{
+ //
+ // Returns the t0 calibration object for a given ROC
+ // containing one number per pad
+ //
+
+ const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
+ (GetCachedCDBObject(kIDT0Pad));
+ if (!calPad) {
+ return 0;
+ }
+
+ AliTRDCalROC *roc = calPad->GetCalROC(det);
+ if (!roc) {
+ return 0;
+ }
+ else {
+ return roc;
+ }
+
+}
+
+//_____________________________________________________________________________
+const AliTRDCalDet *AliTRDcalibDB::GetT0Det()
+{
+ //
+ // Returns the t0 calibration object
+ // containing one number per detector
+ //
+
+ const AliTRDCalDet *calChamber = dynamic_cast<const AliTRDCalDet *>
+ (GetCachedCDBObject(kIDT0Chamber));
+ if (!calChamber) {
+ return 0;
+ }
+ else {
+ return calChamber;
+ }
}
// Returns the average t0 for the given detector
//
+ const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
+ (GetCachedCDBObject(kIDT0Pad));
+ if (!calPad) {
+ return -1;
+ }
+
+ AliTRDCalROC *roc = calPad->GetCalROC(det);
+ if (!roc) {
+ return -1;
+ }
+
const AliTRDCalDet *calDet = dynamic_cast<const AliTRDCalDet *>
(GetCachedCDBObject(kIDT0Chamber));
if (!calDet) {
return -1;
}
- return calDet->GetValue(det);
+ Double_t mean = 0.0;
+ for (Int_t channel = 0; channel < roc->GetNchannels(); ++channel) {
+ mean += (calDet->GetValue(det) + roc->GetValue(channel)) / roc->GetNchannels();
+ }
+
+ return mean;
}
}
AliTRDCalROC *roc = calPad->GetCalROC(det);
- if (!roc)
+ if (!roc) {
return -1;
+ }
const AliTRDCalDet *calChamber = dynamic_cast<const AliTRDCalDet *>
(GetCachedCDBObject(kIDGainFactorChamber));
}
+//_____________________________________________________________________________
+AliTRDCalROC *AliTRDcalibDB::GetGainFactorROC(Int_t det)
+{
+ //
+ // Returns the gain factor calibration object for a given ROC
+ // containing one number per pad
+ //
+
+ const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
+ (GetCachedCDBObject(kIDGainFactorPad));
+ if (!calPad) {
+ return 0;
+ }
+
+ AliTRDCalROC *roc = calPad->GetCalROC(det);
+ if (!roc) {
+ return 0;
+ }
+ else {
+ return roc;
+ }
+
+}
+
+//_____________________________________________________________________________
+const AliTRDCalDet *AliTRDcalibDB::GetGainFactorDet()
+{
+ //
+ // Returns the gain factor calibration object
+ // containing one number per detector
+ //
+
+ const AliTRDCalDet *calChamber = dynamic_cast<const AliTRDCalDet *>
+ (GetCachedCDBObject(kIDGainFactorChamber));
+ if (!calChamber) {
+ return 0;
+ }
+ else {
+ return calChamber;
+ }
+
+}
+
//_____________________________________________________________________________
Float_t AliTRDcalibDB::GetGainFactorAverage(Int_t det)
{
}
//_____________________________________________________________________________
-Float_t AliTRDcalibDB::GetPRFWidth(Int_t det, Int_t col, Int_t row)
+AliTRDCalROC *AliTRDcalibDB::GetPRFROC(Int_t det)
{
//
- // Returns the PRF width for the given pad.
+ // Returns the PRF calibration object for a given ROC
+ // containing one number per pad
//
- const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
- (GetCachedCDBObject(kIDPRFWidth));
+ const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
+ (GetCachedCDBObject(kIDPRFWidth));
if (!calPad) {
- return -1;
+ return 0;
}
- AliTRDCalROC *roc = calPad->GetCalROC(det);
+ AliTRDCalROC *roc = calPad->GetCalROC(det);
if (!roc) {
- return -1;
+ return 0;
+ }
+ else {
+ return roc;
}
-
- return roc->GetValue(col,row);
}
//_____________________________________________________________________________
-Float_t AliTRDcalibDB::GetSamplingFrequency()
+Float_t AliTRDcalibDB::GetPRFWidth(Int_t det, Int_t col, Int_t row)
{
//
- // Returns the sampling frequency of the TRD read-out.
+ // Returns the PRF width for the given pad.
//
- const AliTRDCalGlobals *calGlobal = dynamic_cast<const AliTRDCalGlobals *>
- (GetCachedCDBObject(kIDGlobals));
- if (!calGlobal) {
- return -1;
- }
+ const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
+ (GetCachedCDBObject(kIDPRFWidth));
+ if (!calPad) {
+ return -1;
+ }
- return calGlobal->GetSamplingFrequency();
+ AliTRDCalROC *roc = calPad->GetCalROC(det);
+ if (!roc) {
+ return -1;
+ }
+
+ return roc->GetValue(col,row);
}
// Returns the number of time bins which are read-out.
//
- const AliTRDCalGlobals *calGlobal = dynamic_cast<const AliTRDCalGlobals *>
- (GetCachedCDBObject(kIDGlobals));
- if (!calGlobal) {
+ const AliTRDCalFEE *calFEE = dynamic_cast<const AliTRDCalFEE *>
+ (GetCachedCDBObject(kIDFEE));
+ if (!calFEE) {
return -1;
}
- return calGlobal->GetNumberOfTimeBins();
+ return calFEE->GetNumberOfTimeBins();
}
// Returns the status of the given pad
//
- const AliTRDCalPadStatus *cal = dynamic_cast<const AliTRDCalPadStatus *>
- (GetCachedCDBObject(kIDPadStatus));
+ const AliTRDCalPadStatus *cal = dynamic_cast<const AliTRDCalPadStatus *>
+ (GetCachedCDBObject(kIDPadStatus));
if (!cal) {
return -1;
}
}
//_____________________________________________________________________________
-const AliTRDCalPIDLQ* AliTRDcalibDB::GetPIDLQObject()
+const AliTRDCalPID *AliTRDcalibDB::GetPIDObject(const Int_t method)
{
//
// Returns the object storing the distributions for PID with likelihood
//
- return dynamic_cast<const AliTRDCalPIDLQ *> (GetCachedCDBObject(kIDPIDLQ));
+ switch(method) {
+ case 0: return dynamic_cast<const AliTRDCalPID *>
+ (GetCachedCDBObject(kIDPIDNN));
+ case 1: return dynamic_cast<const AliTRDCalPID *>
+ (GetCachedCDBObject(kIDPIDLQ));
+ }
+
+ return 0;
}
//_____________________________________________________________________________
-const AliTRDCalMonitoring* AliTRDcalibDB::GetMonitoringObject()
+const AliTRDCalMonitoring *AliTRDcalibDB::GetMonitoringObject()
{
//
// Returns the object storing the monitoring data
//
- return dynamic_cast<const AliTRDCalMonitoring *> (GetCachedCDBObject(kIDMonitoringData));
+ return dynamic_cast<const AliTRDCalMonitoring *>
+ (GetCachedCDBObject(kIDMonitoringData));
}
{
//
// Applies the pad response
+ // So far this is the fixed parametrization and should be replaced by
+ // something dependent on calibration values
//
Int_t iBin = ((Int_t) (( - dist - fPRFlo) / fPRFwid));