1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // Class providing the calibration parameters by accessing the CDB //
22 // Request an instance with AliTRDcalibDB::Instance() //
23 // If a new event is processed set the event number with SetRun //
24 // Then request the calibration data //
27 // Jan Fiete Grosse-Oetringhaus (Jan.Fiete.Grosse-Oetringhaus@cern.ch) //
29 ///////////////////////////////////////////////////////////////////////////////
31 #include <TClonesArray.h>
32 #include <TObjArray.h>
34 #include "AliCDBManager.h"
35 #include "AliCDBEntry.h"
38 #include "AliTRDPIDReference.h"
39 #include "AliTRDcalibDB.h"
40 #include "AliTRDtrapConfig.h"
41 #include "AliTRDtrapConfigHandler.h"
42 #include "AliTRDCommonParam.h"
44 #include "Cal/AliTRDCalROC.h"
45 #include "Cal/AliTRDCalPad.h"
46 #include "Cal/AliTRDCalDet.h"
47 #include "Cal/AliTRDCalDCS.h"
48 #include "Cal/AliTRDCalDCSv2.h"
49 #include "Cal/AliTRDCalDCSFEEv2.h"
50 #include "Cal/AliTRDCalPID.h"
51 #include "Cal/AliTRDCalMonitoring.h"
52 #include "Cal/AliTRDCalChamberStatus.h"
53 #include "Cal/AliTRDCalPadStatus.h"
54 #include "Cal/AliTRDCalSingleChamberStatus.h"
55 #include "Cal/AliTRDCalTrkAttach.h"
56 #include "Cal/AliTRDCalOnlineGainTable.h"
58 ClassImp(AliTRDcalibDB)
60 AliTRDcalibDB *AliTRDcalibDB::fgInstance = 0;
61 Bool_t AliTRDcalibDB::fgTerminated = kFALSE;
63 //_ singleton implementation __________________________________________________
64 AliTRDcalibDB* AliTRDcalibDB::Instance()
67 // Singleton implementation
68 // Returns an instance of this class, it is created if neccessary
71 if (fgTerminated != kFALSE) {
75 if (fgInstance == 0) {
76 fgInstance = new AliTRDcalibDB();
83 //_____________________________________________________________________________
84 void AliTRDcalibDB::Terminate()
87 // Singleton implementation
88 // Deletes the instance of this class and sets the terminated flag,
89 // instances cannot be requested anymore
90 // This function can be called several times.
95 if (fgInstance != 0) {
102 //_____________________________________________________________________________
103 AliTRDcalibDB::AliTRDcalibDB()
113 ,fOnlineGainTableID(0)
117 // Default constructor
119 // TODO Default runnumber is set to 0, this should be changed later
120 // to an invalid value (e.g. -1) to prevent
121 // TODO invalid calibration data to be used.
124 for (Int_t i = 0; i < kCDBCacheSize; ++i) {
129 // Create the sampled PRF
134 //_____________________________________________________________________________
135 AliTRDcalibDB::AliTRDcalibDB(const AliTRDcalibDB &c)
145 ,fOnlineGainTableID(0)
149 // Copy constructor (not that it make any sense for a singleton...)
152 for (Int_t i = 0; i < kCDBCacheSize; ++i) {
157 // Create the sampled PRF
162 //_____________________________________________________________________________
163 AliTRDcalibDB &AliTRDcalibDB::operator=(const AliTRDcalibDB &c)
166 // Assignment operator (same as above ...)
170 AliFatal("No assignment operator defined");
177 //_____________________________________________________________________________
178 AliTRDcalibDB::~AliTRDcalibDB()
198 //_caching functions____________________________________________________________
199 const TObject *AliTRDcalibDB::GetCachedCDBObject(Int_t id)
202 // Retrieves a cdb object with the given id. The objects are cached as
203 // long as the run number is not changed.
205 // Put together the available objects here by using the lines
206 // a) For usual calibration objects:
208 // return CacheCDBEntry(kID<Name>,"TRD/Calib/<Path>");
210 // See function CacheCDBEntry for details.
212 // b) For calibration data which depends on two objects: One containing
213 // a value per detector and one the local fluctuations per pad:
215 // return CacheMergeCDBEntry(kID<Name>,"TRD/Calib/<padPath>","TRD/Calib/<chamberPath>");
217 // See function CacheMergeCDBEntry for details.
222 // Parameters defined per pad and chamber
224 return CacheCDBEntry(kIDVdriftPad ,"TRD/Calib/LocalVdrift");
226 case kIDVdriftChamber :
227 return CacheCDBEntry(kIDVdriftChamber ,"TRD/Calib/ChamberVdrift");
230 return CacheCDBEntry(kIDExBChamber ,"TRD/Calib/ChamberExB");
233 return CacheCDBEntry(kIDT0Pad ,"TRD/Calib/LocalT0");
236 return CacheCDBEntry(kIDT0Chamber ,"TRD/Calib/ChamberT0");
238 case kIDGainFactorPad :
239 return CacheCDBEntry(kIDGainFactorPad ,"TRD/Calib/LocalGainFactor");
241 case kIDGainFactorChamber :
242 return CacheCDBEntry(kIDGainFactorChamber ,"TRD/Calib/ChamberGainFactor");
245 case kIDOnlineGainFactor :
246 switch(GetOnlineGainTableID()) {
248 // For testing purposes only !!!
249 AliInfo("No gain table name from OCDB. Use default table!");
250 return CacheCDBEntry(kIDOnlineGainFactor ,"TRD/Calib/Krypton_2011-01");
253 // Online gain table ID 1
254 return CacheCDBEntry(kIDOnlineGainFactor ,"TRD/Calib/Krypton_2011-01");
257 // Online gain table ID 2
258 return CacheCDBEntry(kIDOnlineGainFactor ,"TRD/Calib/Gaintbl_Uniform_FGAN0_2011-01");
261 // Online gain table ID 3
262 return CacheCDBEntry(kIDOnlineGainFactor ,"TRD/Calib/Gaintbl_Uniform_FGAN8_2011-01");
265 // Online gain table ID 4
266 return CacheCDBEntry(kIDOnlineGainFactor ,"TRD/Calib/Krypton_2011-02");
269 // Online gain table ID 5
270 return CacheCDBEntry(kIDOnlineGainFactor ,"TRD/Calib/Krypton_2011-03");
273 // Online gain table ID 6
274 return CacheCDBEntry(kIDOnlineGainFactor ,"TRD/Calib/Gaintbl_Uniform_FGAN0_2012-01");
277 // Online gain table ID 7
278 return CacheCDBEntry(kIDOnlineGainFactor ,"TRD/Calib/Gaintbl_Uniform_FGAN8_2012-01");
283 case kIDNoiseChamber :
284 return CacheCDBEntry(kIDNoiseChamber ,"TRD/Calib/DetNoise");
287 return CacheCDBEntry(kIDNoisePad ,"TRD/Calib/PadNoise");
290 // Parameters defined per pad
292 return CacheCDBEntry(kIDPRFWidth ,"TRD/Calib/PRFWidth");
296 case kIDChamberStatus :
297 return CacheCDBEntry(kIDChamberStatus ,"TRD/Calib/ChamberStatus");
300 return CacheCDBEntry(kIDPadStatus ,"TRD/Calib/PadStatus");
304 case kIDMonitoringData :
305 return CacheCDBEntry(kIDMonitoringData ,"TRD/Calib/MonitoringData");
308 return CacheCDBEntry(kIDFEE ,"TRD/Calib/FEE");
311 return CacheCDBEntry(kIDFEE ,"TRD/Calib/TrapConfig");
314 return CacheCDBEntry(kIDDCS ,"TRD/Calib/DCS");
317 return CacheCDBEntry(kIDPIDNN ,"TRD/Calib/PIDNN");
320 return CacheCDBEntry(kIDPIDLQ ,"TRD/Calib/PIDLQ");
323 return CacheCDBEntry(kIDPIDLQ1D ,"TRD/Calib/PIDLQ1D");
326 return CacheCDBEntry(kIDRecoParam ,"TRD/Calib/RecoParam");
329 return CacheCDBEntry(kIDAttach ,"TRD/Calib/TrkAttach");
332 return CacheCDBEntry(kIDPHQ ,"TRD/Calib/PHQ");
340 //_____________________________________________________________________________
341 AliCDBEntry *AliTRDcalibDB::GetCDBEntry(const char *cdbPath)
344 // Retrieves an entry with path <cdbPath> from the CDB.
347 AliCDBEntry *entry = AliCDBManager::Instance()->Get(cdbPath,fRun);
349 AliError(Form("Failed to get entry: %s",cdbPath));
357 //_____________________________________________________________________________
358 const TObject *AliTRDcalibDB::CacheCDBEntry(Int_t id, const char *cdbPath)
361 // Caches the entry <id> with cdb path <cdbPath>
364 if (!fCDBCache[id]) {
365 fCDBEntries[id] = GetCDBEntry(cdbPath);
366 if (fCDBEntries[id]) {
367 fCDBCache[id] = fCDBEntries[id]->GetObject();
371 return fCDBCache[id];
375 //_____________________________________________________________________________
376 void AliTRDcalibDB::SetRun(Long64_t run)
379 // Sets current run number. Calibration data is read from the corresponding file.
380 // When the run number changes the caching is invalidated.
393 //_____________________________________________________________________________
394 void AliTRDcalibDB::Invalidate()
397 // Invalidates cache (when run number is changed).
400 for (Int_t i = 0; i < kCDBCacheSize; ++i) {
401 if (fCDBEntries[i]) {
402 if (AliCDBManager::Instance()->GetCacheFlag() == kFALSE) {
403 if ((fCDBEntries[i]->IsOwner() == kFALSE) &&
407 delete fCDBEntries[i];
414 fOnlineGainTableID = 0;
418 //_____________________________________________________________________________
419 Float_t AliTRDcalibDB::GetNoise(Int_t det, Int_t col, Int_t row)
422 // Returns the noise level in ADC counts for the given pad.
425 const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
426 (GetCachedCDBObject(kIDNoisePad));
431 AliTRDCalROC *roc = calPad->GetCalROC(det);
436 const AliTRDCalDet *calChamber = dynamic_cast<const AliTRDCalDet *>
437 (GetCachedCDBObject(kIDNoiseChamber));
442 return calChamber->GetValue(det) * roc->GetValue(col,row);
446 //_____________________________________________________________________________
447 AliTRDCalROC *AliTRDcalibDB::GetNoiseROC(Int_t det)
450 // Returns the Vdrift calibration object for a given ROC
451 // containing one number per pad
454 const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
455 (GetCachedCDBObject(kIDNoisePad));
460 AliTRDCalROC *roc = calPad->GetCalROC(det);
470 //_____________________________________________________________________________
471 const AliTRDCalDet *AliTRDcalibDB::GetNoiseDet()
474 // Returns the Vdrift calibration object
475 // containing one number per detector
478 const AliTRDCalDet *calChamber = dynamic_cast<const AliTRDCalDet *>
479 (GetCachedCDBObject(kIDNoiseChamber));
489 //_____________________________________________________________________________
490 Float_t AliTRDcalibDB::GetVdrift(Int_t det, Int_t col, Int_t row)
493 // Returns the drift velocity for the given pad.
496 const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
497 (GetCachedCDBObject(kIDVdriftPad));
502 AliTRDCalROC *roc = calPad->GetCalROC(det);
507 const AliTRDCalDet *calChamber = dynamic_cast<const AliTRDCalDet *>
508 (GetCachedCDBObject(kIDVdriftChamber));
513 return calChamber->GetValue(det) * roc->GetValue(col,row);
517 //_____________________________________________________________________________
518 AliTRDCalROC *AliTRDcalibDB::GetVdriftROC(Int_t det)
521 // Returns the Vdrift calibration object for a given ROC
522 // containing one number per pad
525 const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
526 (GetCachedCDBObject(kIDVdriftPad));
531 AliTRDCalROC *roc = calPad->GetCalROC(det);
541 //_____________________________________________________________________________
542 const AliTRDCalDet *AliTRDcalibDB::GetVdriftDet()
545 // Returns the Vdrift calibration object
546 // containing one number per detector
549 const AliTRDCalDet *calChamber = dynamic_cast<const AliTRDCalDet *>
550 (GetCachedCDBObject(kIDVdriftChamber));
560 //_____________________________________________________________________________
561 TObjArray * AliTRDcalibDB::GetPHQ()
564 //return PHQ calibration object
566 TObjArray *arr = (TObjArray *) (GetCachedCDBObject(kIDPHQ));
570 //_____________________________________________________________________________
571 Float_t AliTRDcalibDB::GetVdriftAverage(Int_t det)
574 // Returns the average drift velocity for the given detector
577 const AliTRDCalDet *calDet = dynamic_cast<const AliTRDCalDet *>
578 (GetCachedCDBObject(kIDVdriftChamber));
583 return calDet->GetValue(det);
586 //_____________________________________________________________________________
587 const AliTRDCalDet *AliTRDcalibDB::GetExBDet()
590 // Returns the exB calibration object
591 // containing one number per detector
594 const AliTRDCalDet *calChamber = dynamic_cast<const AliTRDCalDet *> (GetCachedCDBObject(kIDExBChamber));
596 Double_t meanexb = 100.0;
597 if (calChamber) meanexb = calChamber->GetMean();
598 //printf("mean %f\n",meanexb);
600 if ((!calChamber) || (meanexb > 70.0)) {
602 const AliTRDCalDet *calChambervdrift = dynamic_cast<const AliTRDCalDet *>
603 (GetCachedCDBObject(kIDVdriftChamber));
604 if (!calChambervdrift) {
608 AliTRDCalDet *calDetExB = new AliTRDCalDet("lorentz angle tan","lorentz angle tan (detector value)");
609 for(Int_t k = 0; k < 540; k++){
610 calDetExB->SetValue(k,AliTRDCommonParam::Instance()->GetOmegaTau(calChambervdrift->GetValue(k)));
615 else return calChamber;
618 //_____________________________________________________________________________
619 Float_t AliTRDcalibDB::GetT0(Int_t det, Int_t col, Int_t row)
622 // Returns t0 for the given pad.
625 const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
626 (GetCachedCDBObject(kIDT0Pad));
631 AliTRDCalROC *roc = calPad->GetCalROC(det);
636 const AliTRDCalDet *calChamber = dynamic_cast<const AliTRDCalDet *>
637 (GetCachedCDBObject(kIDT0Chamber));
642 return calChamber->GetValue(det) + roc->GetValue(col,row);
646 //_____________________________________________________________________________
647 AliTRDCalROC *AliTRDcalibDB::GetT0ROC(Int_t det)
650 // Returns the t0 calibration object for a given ROC
651 // containing one number per pad
654 const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
655 (GetCachedCDBObject(kIDT0Pad));
660 AliTRDCalROC *roc = calPad->GetCalROC(det);
670 //_____________________________________________________________________________
671 const AliTRDCalDet *AliTRDcalibDB::GetT0Det()
674 // Returns the t0 calibration object
675 // containing one number per detector
678 const AliTRDCalDet *calChamber = dynamic_cast<const AliTRDCalDet *>
679 (GetCachedCDBObject(kIDT0Chamber));
689 //_____________________________________________________________________________
690 Float_t AliTRDcalibDB::GetT0Average(Int_t det)
693 // Returns the average t0 for the given detector
696 const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
697 (GetCachedCDBObject(kIDT0Pad));
702 AliTRDCalROC *roc = calPad->GetCalROC(det);
707 const AliTRDCalDet *calDet = dynamic_cast<const AliTRDCalDet *>
708 (GetCachedCDBObject(kIDT0Chamber));
714 for (Int_t channel = 0; channel < roc->GetNchannels(); ++channel) {
715 sum += roc->GetValue(channel);
717 sum /= roc->GetNchannels();
718 sum += calDet->GetValue(det);
723 //_____________________________________________________________________________
724 Float_t AliTRDcalibDB::GetGainFactor(Int_t det, Int_t col, Int_t row)
727 // Returns the gain factor for the given pad.
730 const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
731 (GetCachedCDBObject(kIDGainFactorPad));
736 AliTRDCalROC *roc = calPad->GetCalROC(det);
741 const AliTRDCalDet *calChamber = dynamic_cast<const AliTRDCalDet *>
742 (GetCachedCDBObject(kIDGainFactorChamber));
747 return calChamber->GetValue(det) * roc->GetValue(col,row);
751 //_____________________________________________________________________________
752 AliTRDCalOnlineGainTableROC* AliTRDcalibDB::GetOnlineGainTableROC(Int_t det)
755 // Returns the online gain factor table for a given ROC.
758 const AliTRDCalOnlineGainTable *calOnline
759 = dynamic_cast<const AliTRDCalOnlineGainTable *>
760 (GetCachedCDBObject(kIDOnlineGainFactor));
765 return calOnline->GetGainTableROC(det);
769 //_____________________________________________________________________________
770 Float_t AliTRDcalibDB::GetOnlineGainFactor(Int_t det, Int_t col, Int_t row)
773 // Returns the online gain factor for the given pad.
776 const AliTRDCalOnlineGainTable *calOnline
777 = dynamic_cast<const AliTRDCalOnlineGainTable *>
778 (GetCachedCDBObject(kIDOnlineGainFactor));
783 return calOnline->GetGainCorrectionFactor(det,row,col);
787 //_____________________________________________________________________________
788 AliTRDCalROC *AliTRDcalibDB::GetGainFactorROC(Int_t det)
791 // Returns the gain factor calibration object for a given ROC
794 const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
795 (GetCachedCDBObject(kIDGainFactorPad));
800 AliTRDCalROC *roc = calPad->GetCalROC(det);
810 //_____________________________________________________________________________
811 const AliTRDCalDet *AliTRDcalibDB::GetGainFactorDet()
814 // Returns the gain factor calibration object
815 // containing one number per detector
818 const AliTRDCalDet *calChamber = dynamic_cast<const AliTRDCalDet *>
819 (GetCachedCDBObject(kIDGainFactorChamber));
829 //_____________________________________________________________________________
830 Float_t AliTRDcalibDB::GetGainFactorAverage(Int_t det)
833 // Returns the average gain factor for the given detector
836 const AliTRDCalDet *calDet = dynamic_cast<const AliTRDCalDet *>
837 (GetCachedCDBObject(kIDGainFactorChamber));
842 return calDet->GetValue(det);
846 //_____________________________________________________________________________
847 AliTRDCalROC *AliTRDcalibDB::GetPRFROC(Int_t det)
850 // Returns the PRF calibration object for a given ROC
851 // containing one number per pad
854 const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
855 (GetCachedCDBObject(kIDPRFWidth));
860 AliTRDCalROC *roc = calPad->GetCalROC(det);
870 //_____________________________________________________________________________
871 Float_t AliTRDcalibDB::GetPRFWidth(Int_t det, Int_t col, Int_t row)
874 // Returns the PRF width for the given pad.
877 const AliTRDCalPad *calPad = dynamic_cast<const AliTRDCalPad *>
878 (GetCachedCDBObject(kIDPRFWidth));
883 AliTRDCalROC *roc = calPad->GetCalROC(det);
888 return roc->GetValue(col,row);
892 //_____________________________________________________________________________
893 Int_t AliTRDcalibDB::GetNumberOfTimeBinsDCS()
896 // Returns Number of time bins from the DCS
899 Int_t nMixed = -2; // not the same number for all chambers
900 Int_t nUndef = -1; // default value - has not been set!
901 Int_t nTbSor = nUndef;
902 Int_t nTbEor = nUndef;
903 Int_t calver = 0; // Check CalDCS version
905 const TObjArray *dcsArr = dynamic_cast<const TObjArray *>(GetCachedCDBObject(kIDDCS));
907 AliError("No DCS object found!");
911 if (!strcmp(dcsArr->At(0)->ClassName(),"AliTRDCalDCS")) calver = 1;
912 if (!strcmp(dcsArr->At(0)->ClassName(),"AliTRDCalDCSv2")) calver = 2;
916 const AliTRDCalDCS *calDCSsor = dynamic_cast<const AliTRDCalDCS *>(dcsArr->At(0));
917 const AliTRDCalDCS *calDCSeor = dynamic_cast<const AliTRDCalDCS *>(dcsArr->At(1));
919 // the SOR file is mandatory
920 AliError("NO SOR AliTRDCalDCS object found in CDB file!");
924 // this can happen if the run is shorter than a couple of seconds.
925 AliWarning("NO EOR AliTRDCalDCS object found in CDB file.");
929 nTbSor = calDCSsor->GetGlobalNumberOfTimeBins();
930 if (calDCSeor) nTbEor = calDCSeor->GetGlobalNumberOfTimeBins();
932 } else if (calver == 2) {
934 const AliTRDCalDCSv2 *calDCSsorv2 = dynamic_cast<const AliTRDCalDCSv2 *>(dcsArr->At(0));
935 const AliTRDCalDCSv2 *calDCSeorv2 = dynamic_cast<const AliTRDCalDCSv2 *>(dcsArr->At(1));
937 // the SOR file is mandatory
938 AliError("NO SOR AliTRDCalDCSv2 object found in CDB file!");
942 // this can happen if the run is shorter than a couple of seconds.
943 AliWarning("NO EOR AliTRDCalDCSv2 object found in CDB file.");
947 nTbSor = calDCSsorv2->GetGlobalNumberOfTimeBins();
948 if (calDCSeorv2) nTbEor = calDCSeorv2->GetGlobalNumberOfTimeBins();
950 } else AliError("NO DCS/DCSv2 OCDB entry found!");
952 // if they're the same return the value
953 // -2 means mixed, -1: no data, >= 0: good number of time bins
954 if (nTbSor == nTbEor) return nTbSor;
956 // if they're differing:
957 if (nTbSor == nMixed || nTbEor == nMixed) {
958 AliWarning("Inconsistent number of time bins found!");
962 // one is undefined, the other ok -> return that one
963 if (nTbSor == nUndef) return nTbEor;
964 if (nTbEor == nUndef) return nTbSor;
966 // only remains: two different numbers >= 0
971 //_____________________________________________________________________________
972 void AliTRDcalibDB::GetFilterType(TString &filterType)
975 // Returns the filter type
978 const TObjArray *dcsArr = dynamic_cast<const TObjArray *>(GetCachedCDBObject(kIDDCS));
984 Int_t esor = 0; // Take SOR
985 Int_t calver = 0; // Check CalDCS version
986 if (!strcmp(dcsArr->At(0)->ClassName(),"AliTRDCalDCS")) calver = 1;
987 if (!strcmp(dcsArr->At(0)->ClassName(),"AliTRDCalDCSv2")) calver = 2;
992 const AliTRDCalDCS *calDCS = dynamic_cast<const AliTRDCalDCS *>(dcsArr->At(esor));
997 filterType = calDCS->GetGlobalFilterType();
1000 else if (calver == 2) {
1003 const AliTRDCalDCSv2 *calDCSv2 = dynamic_cast<const AliTRDCalDCSv2 *>(dcsArr->At(esor));
1008 filterType = calDCSv2->GetGlobalFilterType();
1013 AliError("NO DCS/DCSv2 OCDB entry found!");
1019 //_____________________________________________________________________________
1020 Int_t AliTRDcalibDB::GetOnlineGainTableID()
1023 // Get the gain table ID from the DCS
1026 if (fOnlineGainTableID > 0) {
1027 return fOnlineGainTableID;
1030 const TObjArray *dcsArr = dynamic_cast<const TObjArray *>(GetCachedCDBObject(kIDDCS));
1035 Int_t esor = 0; // Take SOR
1036 Int_t calver = 0; // Check CalDCS version
1037 if (!strcmp(dcsArr->At(0)->ClassName(),"AliTRDCalDCS")) calver = 1;
1038 if (!strcmp(dcsArr->At(0)->ClassName(),"AliTRDCalDCSv2")) calver = 2;
1042 // No data for old DCS object available, anyway
1046 else if (calver == 2) {
1049 const AliTRDCalDCSv2 *calDCSv2 = dynamic_cast<const AliTRDCalDCSv2 *>(dcsArr->At(esor));
1054 TString tableName = "";
1055 for (Int_t i = 0; i < 540; i++) {
1056 const AliTRDCalDCSFEEv2 *calDCSFEEv2 = calDCSv2->GetCalDCSFEEObj(0);
1057 tableName = calDCSFEEv2->GetGainTableName();
1058 if (tableName.Length() > 0) {
1062 if (tableName.CompareTo("Krypton_2011-01") == 0) {
1063 fOnlineGainTableID = 1;
1064 return fOnlineGainTableID;
1066 if (tableName.CompareTo("Gaintbl_Uniform_FGAN0_2011-01") == 0) {
1067 fOnlineGainTableID = 2;
1068 return fOnlineGainTableID;
1070 if (tableName.CompareTo("Gaintbl_Uniform_FGAN8_2011-01") == 0) {
1071 fOnlineGainTableID = 3;
1072 return fOnlineGainTableID;
1074 if (tableName.CompareTo("Krypton_2011-02") == 0) {
1075 fOnlineGainTableID = 4;
1076 return fOnlineGainTableID;
1078 if (tableName.CompareTo("Krypton_2011-03") == 0) {
1079 fOnlineGainTableID = 5;
1080 return fOnlineGainTableID;
1082 if (tableName.CompareTo("Gaintbl_Uniform_FGAN0_2012-01") == 0) {
1083 fOnlineGainTableID = 6;
1084 return fOnlineGainTableID;
1086 if (tableName.CompareTo("Gaintbl_Uniform_FGAN8_2012-01") == 0) {
1087 fOnlineGainTableID = 7;
1088 return fOnlineGainTableID;
1094 AliError("NO DCS/DCSv2 OCDB entry found!");
1103 //_____________________________________________________________________________
1104 void AliTRDcalibDB::GetGlobalConfiguration(TString &config)
1107 // Get Configuration from the DCS
1110 const TObjArray *dcsArr = dynamic_cast<const TObjArray *>(GetCachedCDBObject(kIDDCS));
1116 Int_t esor = 0; // Take SOR
1117 Int_t calver = 0; // Check CalDCS version
1118 if (!strcmp(dcsArr->At(0)->ClassName(),"AliTRDCalDCS")) calver = 1;
1119 if (!strcmp(dcsArr->At(0)->ClassName(),"AliTRDCalDCSv2")) calver = 2;
1124 const AliTRDCalDCS *calDCS = dynamic_cast<const AliTRDCalDCS *>(dcsArr->At(esor));
1129 config = calDCS->GetGlobalConfigName();
1132 else if (calver == 2) {
1135 const AliTRDCalDCSv2 *calDCSv2 = dynamic_cast<const AliTRDCalDCSv2 *>(dcsArr->At(esor));
1140 config = calDCSv2->GetGlobalConfigName();
1145 AliError("NO DCS/DCSv2 OCDB entry found!");
1151 //_____________________________________________________________________________
1152 void AliTRDcalibDB::GetGlobalConfigurationVersion(TString &version)
1155 // Get Version of Configuration from the DCS
1158 const TObjArray *dcsArr = dynamic_cast<const TObjArray *>(GetCachedCDBObject(kIDDCS));
1164 Int_t esor = 0; // Take SOR
1165 Int_t calver = 0; // Check CalDCS version
1166 if (!strcmp(dcsArr->At(0)->ClassName(),"AliTRDCalDCS")) calver = 1;
1167 if (!strcmp(dcsArr->At(0)->ClassName(),"AliTRDCalDCSv2")) calver = 2;
1172 const AliTRDCalDCS *calDCS = dynamic_cast<const AliTRDCalDCS *>(dcsArr->At(esor));
1177 version = calDCS->GetGlobalConfigVersion();
1180 else if (calver == 2) {
1183 const AliTRDCalDCSv2 *calDCSv2 = dynamic_cast<const AliTRDCalDCSv2 *>(dcsArr->At(esor));
1188 version = calDCSv2->GetGlobalConfigVersion();
1193 AliError("NO DCS/DCSv2 OCDB entry found!");
1199 //_____________________________________________________________________________
1200 Bool_t AliTRDcalibDB::HasOnlineFilterPedestal()
1203 // Checks whether pedestal filter was applied online
1208 // Temporary: Get the filter config from the configuration name
1209 GetGlobalConfiguration(cname);
1210 TString filterconfig = cname(cname.First("_") + 1, cname.First("-") - cname.First("_") - 1);
1212 // TString filterconfig;
1213 //GetFilterType(filterconfig);
1215 return filterconfig.Contains("p");
1219 //_____________________________________________________________________________
1220 Bool_t AliTRDcalibDB::HasOnlineFilterGain()
1223 // Checks whether online gain filter was applied
1228 // Temporary: Get the filter config from the configuration name
1229 GetGlobalConfiguration(cname);
1230 TString filterconfig = cname(cname.First("_") + 1, cname.First("-") - cname.First("_") - 1);
1232 //TString filterconfig;
1233 //GetFilterType(filterconfig);
1235 return filterconfig.Contains("g");
1239 //_____________________________________________________________________________
1240 Bool_t AliTRDcalibDB::HasOnlineTailCancellation()
1243 // Checks whether online tail cancellation was applied
1248 // Temporary: Get the filter config from the configuration name
1249 GetGlobalConfiguration(cname);
1250 TString filterconfig = cname(cname.First("_") + 1, cname.First("-") - cname.First("_") - 1);
1252 //TString filterconfig;
1253 //GetFilterType(filterconfig);
1255 return filterconfig.Contains("t");
1259 //_____________________________________________________________________________
1260 Char_t AliTRDcalibDB::GetPadStatus(Int_t det, Int_t col, Int_t row)
1263 // Returns the status of the given pad
1266 const AliTRDCalPadStatus *cal = dynamic_cast<const AliTRDCalPadStatus *>
1267 (GetCachedCDBObject(kIDPadStatus));
1272 const AliTRDCalSingleChamberStatus *roc = cal->GetCalROC(det);
1277 return roc->GetStatus(col,row);
1281 //_____________________________________________________________________________
1282 AliTRDCalSingleChamberStatus* AliTRDcalibDB::GetPadStatusROC(Int_t det)
1285 // Returns the pad status calibration object for a given ROC
1288 const AliTRDCalPadStatus *cal = dynamic_cast<const AliTRDCalPadStatus *>
1289 (GetCachedCDBObject(kIDPadStatus));
1294 AliTRDCalSingleChamberStatus *roc = cal->GetCalROC(det);
1304 //_____________________________________________________________________________
1305 Char_t AliTRDcalibDB::GetChamberStatus(Int_t det)
1308 // Returns the status of the given chamber
1311 const AliTRDCalChamberStatus *cal = dynamic_cast<const AliTRDCalChamberStatus *>
1312 (GetCachedCDBObject(kIDChamberStatus));
1317 return cal->GetStatus(det);
1321 //_____________________________________________________________________________
1322 AliTRDrecoParam* AliTRDcalibDB::GetRecoParam(Int_t */*eventtype*/)
1325 // Returns the TRD reconstruction parameters from the OCDB
1328 const TClonesArray *recos = dynamic_cast<const TClonesArray*>(GetCachedCDBObject(kIDRecoParam));
1329 if (!recos) return 0x0;
1331 // calculate entry based on event type info
1332 Int_t n = 0; //f(eventtype[0], eventtype[1], ....)
1334 return (AliTRDrecoParam *) recos->UncheckedAt(n);
1338 //_____________________________________________________________________________
1339 Bool_t AliTRDcalibDB::IsPadMasked(Int_t det, Int_t col, Int_t row)
1342 // Returns status, see name of functions for details ;-)
1345 const AliTRDCalPadStatus *cal = dynamic_cast<const AliTRDCalPadStatus *>
1346 (GetCachedCDBObject(kIDPadStatus));
1351 return cal->IsMasked(det,col,row);
1355 //_____________________________________________________________________________
1356 Bool_t AliTRDcalibDB::IsPadBridgedLeft(Int_t det, Int_t col, Int_t row)
1359 // Returns status, see name of functions for details ;-)
1362 const AliTRDCalPadStatus *cal = dynamic_cast<const AliTRDCalPadStatus *>
1363 (GetCachedCDBObject(kIDPadStatus));
1368 return cal->IsBridgedLeft(det,col,row);
1372 //_____________________________________________________________________________
1373 Bool_t AliTRDcalibDB::IsPadBridgedRight(Int_t det, Int_t col, Int_t row)
1376 // Returns status, see name of functions for details ;-)
1379 const AliTRDCalPadStatus * cal = dynamic_cast<const AliTRDCalPadStatus *>
1380 (GetCachedCDBObject(kIDPadStatus));
1385 return cal->IsBridgedRight(det,col,row);
1389 //_____________________________________________________________________________
1390 Bool_t AliTRDcalibDB::IsPadNotConnected(Int_t det, Int_t col, Int_t row)
1393 // Returns status, see name of functions for details ;-)
1396 const AliTRDCalPadStatus * cal = dynamic_cast<const AliTRDCalPadStatus *>
1397 (GetCachedCDBObject(kIDPadStatus));
1402 return cal->IsNotConnected(det,col,row);
1406 //_____________________________________________________________________________
1407 Bool_t AliTRDcalibDB::IsChamberGood(Int_t det)
1410 // Returns status, see name of functions for details ;-)
1413 const AliTRDCalChamberStatus * cal = dynamic_cast<const AliTRDCalChamberStatus *>
1414 (GetCachedCDBObject(kIDChamberStatus));
1419 return cal->IsGood(det);
1423 //_____________________________________________________________________________
1424 Bool_t AliTRDcalibDB::IsChamberNoData(Int_t det)
1427 // Returns status, see name of functions for details ;-)
1430 const AliTRDCalChamberStatus * cal = dynamic_cast<const AliTRDCalChamberStatus *>
1431 (GetCachedCDBObject(kIDChamberStatus));
1436 return cal->IsNoData(det);
1440 //_____________________________________________________________________________
1441 Bool_t AliTRDcalibDB::IsHalfChamberNoData(Int_t det, Int_t side)
1444 // Returns status, see name of functions for details ;-)
1447 const AliTRDCalChamberStatus * cal = dynamic_cast<const AliTRDCalChamberStatus *>
1448 (GetCachedCDBObject(kIDChamberStatus));
1453 return side > 0 ? cal->IsNoDataSideB(det) : cal->IsNoDataSideA(det);
1457 //_____________________________________________________________________________
1458 Bool_t AliTRDcalibDB::IsChamberBadCalibrated(Int_t det)
1461 // Returns status, see name of functions for details ;-)
1464 const AliTRDCalChamberStatus * cal = dynamic_cast<const AliTRDCalChamberStatus *>
1465 (GetCachedCDBObject(kIDChamberStatus));
1470 return cal->IsBadCalibrated(det);
1474 //_____________________________________________________________________________
1475 const AliTRDCalPID *AliTRDcalibDB::GetPIDObject(AliTRDpidUtil::ETRDPIDMethod method)
1478 // Returns the object storing the distributions for PID with likelihood
1482 case AliTRDpidUtil::kLQ:
1483 return dynamic_cast<const AliTRDCalPID *>(GetCachedCDBObject(kIDPIDLQ));
1484 case AliTRDpidUtil::kNN:
1485 return dynamic_cast<const AliTRDCalPID *>(GetCachedCDBObject(kIDPIDNN));
1486 case AliTRDpidUtil::kESD:
1487 return 0x0; // To avoid compiler warnings
1494 //_____________________________________________________________________________
1495 AliTRDPIDResponse *AliTRDcalibDB::GetPIDResponse(AliTRDPIDResponse::ETRDPIDMethod method)
1498 // Returns the PID response object for 1D-LQ
1501 if (!fPIDResponse) {
1503 fPIDResponse = new AliTRDPIDResponse;
1505 // Load Reference Histos from OCDB
1506 fPIDResponse->SetPIDmethod(method);
1507 const TObjArray *references = dynamic_cast<const TObjArray *>(GetCachedCDBObject(kIDPIDLQ1D));
1509 TIter refs(references);
1510 TObject *obj = NULL;
1511 AliTRDPIDReference *ref = NULL;
1512 Bool_t hasReference = kFALSE;
1513 while ((obj = refs())){
1514 if ((ref = dynamic_cast<AliTRDPIDReference *>(obj))){
1515 fPIDResponse->Load(ref);
1516 hasReference = kTRUE;
1521 if (!hasReference) {
1522 AliError("Reference histograms not found in the OCDB");
1527 return fPIDResponse;
1531 //_____________________________________________________________________________
1532 const AliTRDCalTrkAttach* AliTRDcalibDB::GetAttachObject()
1535 // Returns the object storing likelihood distributions for cluster to track attachment
1538 return dynamic_cast<const AliTRDCalTrkAttach*>(GetCachedCDBObject(kIDAttach));
1542 //_____________________________________________________________________________
1543 const AliTRDCalMonitoring *AliTRDcalibDB::GetMonitoringObject()
1546 // Returns the object storing the monitoring data
1549 return dynamic_cast<const AliTRDCalMonitoring *>
1550 (GetCachedCDBObject(kIDMonitoringData));
1554 //_____________________________________________________________________________
1555 void AliTRDcalibDB::SamplePRF()
1558 // Samples the pad response function (should maybe go somewhere else ...)
1561 const Int_t kPRFbin = 61;
1563 Float_t prf[kNlayer][kPRFbin] = {
1564 {2.9037e-02, 3.3608e-02, 3.9020e-02, 4.5292e-02,
1565 5.2694e-02, 6.1362e-02, 7.1461e-02, 8.3362e-02,
1566 9.7063e-02, 1.1307e-01, 1.3140e-01, 1.5235e-01,
1567 1.7623e-01, 2.0290e-01, 2.3294e-01, 2.6586e-01,
1568 3.0177e-01, 3.4028e-01, 3.8077e-01, 4.2267e-01,
1569 4.6493e-01, 5.0657e-01, 5.4655e-01, 5.8397e-01,
1570 6.1767e-01, 6.4744e-01, 6.7212e-01, 6.9188e-01,
1571 7.0627e-01, 7.1499e-01, 7.1851e-01, 7.1499e-01,
1572 7.0627e-01, 6.9188e-01, 6.7212e-01, 6.4744e-01,
1573 6.1767e-01, 5.8397e-01, 5.4655e-01, 5.0657e-01,
1574 4.6493e-01, 4.2267e-01, 3.8077e-01, 3.4028e-01,
1575 3.0177e-01, 2.6586e-01, 2.3294e-01, 2.0290e-01,
1576 1.7623e-01, 1.5235e-01, 1.3140e-01, 1.1307e-01,
1577 9.7063e-02, 8.3362e-02, 7.1461e-02, 6.1362e-02,
1578 5.2694e-02, 4.5292e-02, 3.9020e-02, 3.3608e-02,
1580 {2.5478e-02, 2.9695e-02, 3.4655e-02, 4.0454e-02,
1581 4.7342e-02, 5.5487e-02, 6.5038e-02, 7.6378e-02,
1582 8.9696e-02, 1.0516e-01, 1.2327e-01, 1.4415e-01,
1583 1.6794e-01, 1.9516e-01, 2.2573e-01, 2.5959e-01,
1584 2.9694e-01, 3.3719e-01, 3.7978e-01, 4.2407e-01,
1585 4.6889e-01, 5.1322e-01, 5.5569e-01, 5.9535e-01,
1586 6.3141e-01, 6.6259e-01, 6.8882e-01, 7.0983e-01,
1587 7.2471e-01, 7.3398e-01, 7.3761e-01, 7.3398e-01,
1588 7.2471e-01, 7.0983e-01, 6.8882e-01, 6.6259e-01,
1589 6.3141e-01, 5.9535e-01, 5.5569e-01, 5.1322e-01,
1590 4.6889e-01, 4.2407e-01, 3.7978e-01, 3.3719e-01,
1591 2.9694e-01, 2.5959e-01, 2.2573e-01, 1.9516e-01,
1592 1.6794e-01, 1.4415e-01, 1.2327e-01, 1.0516e-01,
1593 8.9696e-02, 7.6378e-02, 6.5038e-02, 5.5487e-02,
1594 4.7342e-02, 4.0454e-02, 3.4655e-02, 2.9695e-02,
1596 {2.2363e-02, 2.6233e-02, 3.0782e-02, 3.6140e-02,
1597 4.2535e-02, 5.0157e-02, 5.9197e-02, 6.9900e-02,
1598 8.2707e-02, 9.7811e-02, 1.1548e-01, 1.3601e-01,
1599 1.5998e-01, 1.8739e-01, 2.1840e-01, 2.5318e-01,
1600 2.9182e-01, 3.3373e-01, 3.7837e-01, 4.2498e-01,
1601 4.7235e-01, 5.1918e-01, 5.6426e-01, 6.0621e-01,
1602 6.4399e-01, 6.7700e-01, 7.0472e-01, 7.2637e-01,
1603 7.4206e-01, 7.5179e-01, 7.5551e-01, 7.5179e-01,
1604 7.4206e-01, 7.2637e-01, 7.0472e-01, 6.7700e-01,
1605 6.4399e-01, 6.0621e-01, 5.6426e-01, 5.1918e-01,
1606 4.7235e-01, 4.2498e-01, 3.7837e-01, 3.3373e-01,
1607 2.9182e-01, 2.5318e-01, 2.1840e-01, 1.8739e-01,
1608 1.5998e-01, 1.3601e-01, 1.1548e-01, 9.7811e-02,
1609 8.2707e-02, 6.9900e-02, 5.9197e-02, 5.0157e-02,
1610 4.2535e-02, 3.6140e-02, 3.0782e-02, 2.6233e-02,
1612 {1.9635e-02, 2.3167e-02, 2.7343e-02, 3.2293e-02,
1613 3.8224e-02, 4.5335e-02, 5.3849e-02, 6.4039e-02,
1614 7.6210e-02, 9.0739e-02, 1.0805e-01, 1.2841e-01,
1615 1.5216e-01, 1.7960e-01, 2.1099e-01, 2.4671e-01,
1616 2.8647e-01, 3.2996e-01, 3.7660e-01, 4.2547e-01,
1617 4.7536e-01, 5.2473e-01, 5.7215e-01, 6.1632e-01,
1618 6.5616e-01, 6.9075e-01, 7.1939e-01, 7.4199e-01,
1619 7.5838e-01, 7.6848e-01, 7.7227e-01, 7.6848e-01,
1620 7.5838e-01, 7.4199e-01, 7.1939e-01, 6.9075e-01,
1621 6.5616e-01, 6.1632e-01, 5.7215e-01, 5.2473e-01,
1622 4.7536e-01, 4.2547e-01, 3.7660e-01, 3.2996e-01,
1623 2.8647e-01, 2.4671e-01, 2.1099e-01, 1.7960e-01,
1624 1.5216e-01, 1.2841e-01, 1.0805e-01, 9.0739e-02,
1625 7.6210e-02, 6.4039e-02, 5.3849e-02, 4.5335e-02,
1626 3.8224e-02, 3.2293e-02, 2.7343e-02, 2.3167e-02,
1628 {1.7224e-02, 2.0450e-02, 2.4286e-02, 2.8860e-02,
1629 3.4357e-02, 4.0979e-02, 4.8966e-02, 5.8612e-02,
1630 7.0253e-02, 8.4257e-02, 1.0102e-01, 1.2094e-01,
1631 1.4442e-01, 1.7196e-01, 2.0381e-01, 2.4013e-01,
1632 2.8093e-01, 3.2594e-01, 3.7450e-01, 4.2563e-01,
1633 4.7796e-01, 5.2991e-01, 5.7974e-01, 6.2599e-01,
1634 6.6750e-01, 7.0344e-01, 7.3329e-01, 7.5676e-01,
1635 7.7371e-01, 7.8410e-01, 7.8793e-01, 7.8410e-01,
1636 7.7371e-01, 7.5676e-01, 7.3329e-01, 7.0344e-01,
1637 6.6750e-01, 6.2599e-01, 5.7974e-01, 5.2991e-01,
1638 4.7796e-01, 4.2563e-01, 3.7450e-01, 3.2594e-01,
1639 2.8093e-01, 2.4013e-01, 2.0381e-01, 1.7196e-01,
1640 1.4442e-01, 1.2094e-01, 1.0102e-01, 8.4257e-02,
1641 7.0253e-02, 5.8612e-02, 4.8966e-02, 4.0979e-02,
1642 3.4357e-02, 2.8860e-02, 2.4286e-02, 2.0450e-02,
1644 {1.5096e-02, 1.8041e-02, 2.1566e-02, 2.5793e-02,
1645 3.0886e-02, 3.7044e-02, 4.4515e-02, 5.3604e-02,
1646 6.4668e-02, 7.8109e-02, 9.4364e-02, 1.1389e-01,
1647 1.3716e-01, 1.6461e-01, 1.9663e-01, 2.3350e-01,
1648 2.7527e-01, 3.2170e-01, 3.7214e-01, 4.2549e-01,
1649 4.8024e-01, 5.3460e-01, 5.8677e-01, 6.3512e-01,
1650 6.7838e-01, 7.1569e-01, 7.4655e-01, 7.7071e-01,
1651 7.8810e-01, 7.9871e-01, 8.0255e-01, 7.9871e-01,
1652 7.8810e-01, 7.7071e-01, 7.4655e-01, 7.1569e-01,
1653 6.7838e-01, 6.3512e-01, 5.8677e-01, 5.3460e-01,
1654 4.8024e-01, 4.2549e-01, 3.7214e-01, 3.2170e-01,
1655 2.7527e-01, 2.3350e-01, 1.9663e-01, 1.6461e-01,
1656 1.3716e-01, 1.1389e-01, 9.4364e-02, 7.8109e-02,
1657 6.4668e-02, 5.3604e-02, 4.4515e-02, 3.7044e-02,
1658 3.0886e-02, 2.5793e-02, 2.1566e-02, 1.8041e-02,
1661 // More sampling precision with linear interpolation
1664 Float_t pad[kPRFbin];
1665 Int_t sPRFbin = kPRFbin;
1666 Float_t sPRFwid = (fPRFhi - fPRFlo) / ((Float_t) sPRFbin);
1667 for (Int_t iPad = 0; iPad < sPRFbin; iPad++) {
1668 pad[iPad] = ((Float_t) iPad + 0.5) * sPRFwid + fPRFlo;
1671 fPRFwid = (fPRFhi - fPRFlo) / ((Float_t) fPRFbin);
1672 fPRFpad = ((Int_t) (1.0 / fPRFwid));
1674 if (fPRFsmp) delete [] fPRFsmp;
1675 fPRFsmp = new Float_t[kNlayer*fPRFbin];
1681 for (Int_t iLayer = 0; iLayer < kNlayer; iLayer++) {
1683 for (Int_t iBin = 0; iBin < fPRFbin; iBin++) {
1685 Float_t bin = (((Float_t) iBin) + 0.5) * fPRFwid + fPRFlo;
1689 diff = bin - pad[ipos2++];
1690 } while ((diff > 0) && (ipos2 < kPRFbin));
1691 if (ipos2 == kPRFbin) {
1692 fPRFsmp[iLayer*fPRFbin+iBin] = prf[iLayer][ipos2-1];
1694 else if (ipos2 == 1) {
1695 fPRFsmp[iLayer*fPRFbin+iBin] = prf[iLayer][ipos2-1];
1699 if (ipos2 >= kPRFbin) ipos2 = kPRFbin - 1;
1701 fPRFsmp[iLayer*fPRFbin+iBin] = prf[iLayer][ipos2]
1702 + diff * (prf[iLayer][ipos2] - prf[iLayer][ipos1])
1711 //_____________________________________________________________________________
1712 Int_t AliTRDcalibDB::PadResponse(Double_t signal, Double_t dist
1713 , Int_t layer, Double_t *pad) const
1716 // Applies the pad response
1717 // So far this is the fixed parametrization and should be replaced by
1718 // something dependent on calibration values
1721 Int_t iBin = ((Int_t) ((-dist - fPRFlo) / fPRFwid));
1722 Int_t iOff = layer * fPRFbin;
1724 Int_t iBin0 = iBin - fPRFpad + iOff;
1725 Int_t iBin1 = iBin + iOff;
1726 Int_t iBin2 = iBin + fPRFpad + iOff;
1731 if ((iBin1 >= 0) && (iBin1 < (fPRFbin*kNlayer))) {
1734 pad[0] = signal * fPRFsmp[iBin0];
1736 pad[1] = signal * fPRFsmp[iBin1];
1737 if (iBin2 < (fPRFbin*kNlayer)) {
1738 pad[2] = signal * fPRFsmp[iBin2];
1753 AliTRDtrapConfig* AliTRDcalibDB::GetTrapConfig()
1755 // return an existing TRAPconfig or load it from the OCDB
1756 // in case of failure, a default TRAPconfig is created
1761 // query the configuration to be used
1763 this->GetGlobalConfiguration(configName);
1764 TString configVersion;
1765 this->GetGlobalConfigurationVersion(configVersion);
1767 this->LoadTrapConfig(configName, configVersion);
1769 // if we still don't have a valid TRAPconfig, create a default one
1771 AliWarning("Falling back to default configuration");
1772 fTrapConfig = new AliTRDtrapConfig("default", "default TRAP configuration");
1773 AliTRDtrapConfigHandler cfgHandler(fTrapConfig);
1775 cfgHandler.LoadConfig();
1778 AliInfo(Form("using TRAPconfig \"%s\"", fTrapConfig->GetTitle()));
1785 AliTRDtrapConfig* AliTRDcalibDB::LoadTrapConfig(const TString &name, const TString &version)
1787 // try to load the specified configuration from the OCDB
1788 // if it fails, or it does not exist, return null
1790 AliInfo(Form("looking for TRAPconfig \"%s.%s\"", name.Data(), version.Data()));
1792 const AliTRDCalTrapConfig *caltrap = dynamic_cast<const AliTRDCalTrapConfig*> (GetCachedCDBObject(kIDTrapConfig));
1795 TString configName(name);
1796 configName.Append(".");
1797 configName.Append(version);
1798 fTrapConfig = caltrap->Get(configName);
1802 AliError("No TRAPconfig entry found!");