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 //
26 ///////////////////////////////////////////////////////////////////////////////
30 #include <AliCDBManager.h>
32 #include "AliTRDcalibDB.h"
33 #include "AliTRDgeometry.h"
34 #include "AliTRDpadPlane.h"
35 #include "AliTRDCommonParam.h"
37 #include "AliTRDCalROC.h"
38 #include "AliTRDCalChamberPos.h"
39 #include "AliTRDCalStackPos.h"
40 #include "AliTRDCalPad.h"
41 #include "AliTRDCalDet.h"
42 #include "AliTRDCalGlobals.h"
43 #include "AliTRDCalPIDLQ.h"
45 ClassImp(AliTRDcalibDB)
47 AliTRDcalibDB* AliTRDcalibDB::fgInstance = 0;
48 Bool_t AliTRDcalibDB::fgTerminated = kFALSE;
50 //_ singleton implementation __________________________________________________
51 AliTRDcalibDB* AliTRDcalibDB::Instance()
54 // Singleton implementation
55 // Returns an instance of this class, it is created if neccessary
58 if (fgTerminated != kFALSE)
62 fgInstance = new AliTRDcalibDB();
67 void AliTRDcalibDB::Terminate()
70 // Singleton implementation
71 // Deletes the instance of this class and sets the terminated flag, instances cannot be requested anymore
72 // This function can be called several times.
84 //_____________________________________________________________________________
85 AliTRDcalibDB::AliTRDcalibDB()
91 // TODO Default runnumber is set to 0, this should be changed later to an invalid value (e.g. -1) to prevent
92 // TODO invalid calibration data to be used.
95 fPadResponse.fPRFbin = 0;
96 fPadResponse.fPRFlo = 0.0;
97 fPadResponse.fPRFhi = 0.0;
98 fPadResponse.fPRFwid = 0.0;
99 fPadResponse.fPRFpad = 0;
100 fPadResponse.fPRFsmp = 0;
102 AliCDBManager* manager = AliCDBManager::Instance();
105 std::cout << "AliTRDcalibDB: CRITICAL: Failed to get instance of AliCDBManager." << std::endl;
109 fLocator = manager->GetStorage("local://$ALICE_ROOT");
111 for (Int_t i=0; i<kCDBCacheSize; ++i)
117 // Create the sampled PRF
121 //_____________________________________________________________________________
122 AliTRDcalibDB::~AliTRDcalibDB()
128 if (fPadResponse.fPRFsmp) {
129 delete [] fPadResponse.fPRFsmp;
130 fPadResponse.fPRFsmp = 0;
136 //_caching functions____________________________________________________________
137 const TObject* AliTRDcalibDB::GetCachedCDBObject(Int_t id)
140 // Retrieves a cdb object with the given id. The objects are cached as long as the run number is not changed.
142 // Put together the available objects here by using the lines
143 // a) For usual calibration objects:
144 // ase kID<Name> : return CacheCDBEntry(kID<Name>, "TRD/Calib/<Path>"); break;
145 // See function CacheCDBEntry for details.
147 // b) For calibration data which depends on two objects: One containing a value per detector and one the local fluctuations per pad:
148 // case kID<Name> : return CacheMergeCDBEntry(kID<Name>, "TRD/Calib/<padPath>", "TRD/Calib/<chamberPath>"); break;
149 // See function CacheMergeCDBEntry for details.
154 // parameters defined per pad and chamber
155 case kIDVdrift : return CacheMergeCDBEntry(kIDVdrift, "TRD/Calib/LocalVdrift", "TRD/Calib/ChamberVdrift"); break;
156 case kIDT0 : return CacheMergeCDBEntry(kIDT0, "TRD/Calib/LocalT0", "TRD/Calib/ChamberT0"); break;
158 // parameters defined per pad
159 case kIDGainFactor : return CacheCDBEntry(kIDGainFactor, "TRD/Calib/GainFactor"); break;
160 case kIDPRFWidth : return CacheCDBEntry(kIDPRFWidth, "TRD/Calib/PRFWidth"); break;
163 case kIDGlobals : return CacheCDBEntry(kIDGlobals, "TRD/Calib/Globals"); break;
164 case kIDChamber : return CacheCDBEntry(kIDChamber, "TRD/Calib/Chamber"); break;
165 case kIDStack : return CacheCDBEntry(kIDStack, "TRD/Calib/Stack"); break;
166 case kIDPIDLQ : return CacheCDBEntry(kIDPIDLQ, "TRD/Calib/PIDLQ"); break;
171 //_____________________________________________________________________________
172 AliCDBEntry* AliTRDcalibDB::GetCDBEntry(const char* cdbPath)
175 // Retrieves an entry with path <cdbPath> from the CDB.
180 AliFatal("AliTRDcalibDB: Run number not set! Use AliTRDcalibDB::SetRun.");
181 //std::cerr << "AliTRDcalibDB: Run number not set! Use AliTRDcalibDB::SetRun." << std::endl;
186 std::cerr << "AliTRDcalibDB: Storage Locator not available." << std::endl;
189 AliCDBEntry* entry = fLocator->Get(cdbPath, fRun);
192 std::cerr << "AliTRDcalibDB: Failed to get entry: " << cdbPath << std::endl;
196 std::cout << "AliTRDcalibDB: Retrieved object: " << cdbPath << std::endl;
200 //_____________________________________________________________________________
201 const TObject* AliTRDcalibDB::CacheCDBEntry(Int_t id, const char* cdbPath)
204 // Caches the entry <id> with cdb path <cdbPath>
209 fCDBEntries[id] = GetCDBEntry(cdbPath);
211 fCDBCache[id] = fCDBEntries[id]->GetObject();
213 return fCDBCache[id];
216 //_____________________________________________________________________________
217 const TObject* AliTRDcalibDB::CacheMergeCDBEntry(Int_t id, const char* cdbPadPath, const char* cdbChamberPath)
220 // Retrieves and caches an object (id <id>) from the CDB. This function is specialized for parameters which are stored
221 // as local variation at pad level of a global variable defined per detector chamber. It uses the classes AliTRDCalPad and AliTRDCalDet.
222 // Before storing the object it retrieves the local variations (cdbPadPath) and the global variable (cdbChamberPath) and merges them using
223 // the AliTRDCalPad::ScaleROCs.
228 AliTRDCalPad* padObject = 0;
229 AliTRDCalDet* detObject = 0;
231 fCDBEntries[id] = GetCDBEntry(cdbPadPath);
233 padObject = dynamic_cast<AliTRDCalPad*>(fCDBEntries[id]->GetObject());
235 AliCDBEntry* mergeEntry = GetCDBEntry(cdbChamberPath);
237 detObject = dynamic_cast<AliTRDCalDet*>(mergeEntry->GetObject());
239 if (!padObject || !detObject)
241 if (fCDBEntries[id]) {
242 if (fCDBEntries[id]->IsOwner() == kFALSE && padObject)
244 delete fCDBEntries[id];
249 if (mergeEntry->IsOwner() == kFALSE && detObject)
256 padObject->ScaleROCs(detObject);
257 if (mergeEntry->IsOwner() == kFALSE)
261 fCDBCache[id] = padObject;
264 return fCDBCache[id];
267 //_____________________________________________________________________________
268 void AliTRDcalibDB::SetRun(Long64_t run)
271 // Sets current run number. Calibration data is read from the corresponding file.
272 // When the run number changes the caching is invalidated.
282 //_____________________________________________________________________________
283 void AliTRDcalibDB::Invalidate()
286 // Invalidates cache (when run number is changed).
289 for (Int_t i=0; i<kCDBCacheSize; ++i)
293 if (fCDBEntries[i]->IsOwner() == kFALSE && fCDBCache[i])
296 delete fCDBEntries[i];
303 //_____________________________________________________________________________
304 Bool_t AliTRDcalibDB::GetChamberPos(Int_t det, Float_t* xyz)
307 // Returns the deviation of the chamber position from the nominal position.
310 const AliTRDCalChamberPos* chamber = dynamic_cast<const AliTRDCalChamberPos*>(GetCachedCDBObject(kIDChamber));
314 const Float_t* kvalues = chamber->GetChamberPos(det);
325 //_____________________________________________________________________________
326 Bool_t AliTRDcalibDB::GetChamberRot(Int_t det, Float_t* xyz)
329 // Returns the rotation of the chamber from the nominal position.
332 const AliTRDCalChamberPos* chamber = dynamic_cast<const AliTRDCalChamberPos*>(GetCachedCDBObject(kIDChamber));
336 const Float_t* kvalues = chamber->GetChamberRot(det);
347 //_____________________________________________________________________________
348 Bool_t AliTRDcalibDB::GetStackPos(Int_t chamber, Int_t sector, Float_t* xyz)
351 // Returns the deviation of the stack position from the nominal position.
354 const AliTRDCalStackPos* stack = dynamic_cast<const AliTRDCalStackPos*>(GetCachedCDBObject(kIDStack));
358 const Float_t* kvalues = stack->GetStackPos(chamber, sector);
369 //_____________________________________________________________________________
370 Bool_t AliTRDcalibDB::GetStackRot(Int_t chamber, Int_t sector, Float_t* xyz)
373 // Returns the rotation of the stack from the nominal position.
376 const AliTRDCalStackPos* stack = dynamic_cast<const AliTRDCalStackPos*>(GetCachedCDBObject(kIDStack));
380 const Float_t* kvalues = stack->GetStackRot(chamber, sector);
391 //_____________________________________________________________________________
392 Float_t AliTRDcalibDB::GetVdrift(Int_t det, Int_t col, Int_t row)
395 // Returns the drift velocity for the given pad.
398 const AliTRDCalPad* calPad = dynamic_cast<const AliTRDCalPad*> (GetCachedCDBObject(kIDVdrift));
402 AliTRDCalROC* roc = calPad->GetCalROC(det);
406 return roc->GetValue(col, row);
409 //_____________________________________________________________________________
410 Float_t AliTRDcalibDB::GetT0(Int_t det, Int_t col, Int_t row)
413 // Returns t0 for the given pad.
416 const AliTRDCalPad* calPad = dynamic_cast<const AliTRDCalPad*> (GetCachedCDBObject(kIDT0));
420 AliTRDCalROC* roc = calPad->GetCalROC(det);
424 return roc->GetValue(col, row);
427 //_____________________________________________________________________________
428 Float_t AliTRDcalibDB::GetGainFactor(Int_t det, Int_t col, Int_t row)
431 // Returns the gain factor for the given pad.
434 const AliTRDCalPad* calPad = dynamic_cast<const AliTRDCalPad*> (GetCachedCDBObject(kIDGainFactor));
438 AliTRDCalROC* roc = calPad->GetCalROC(det);
442 return roc->GetValue(col, row);
445 //_____________________________________________________________________________
446 Float_t AliTRDcalibDB::GetPRFWidth(Int_t det, Int_t col, Int_t row)
449 // Returns the PRF width for the given pad.
452 const AliTRDCalPad* calPad = dynamic_cast<const AliTRDCalPad*> (GetCachedCDBObject(kIDPRFWidth));
456 AliTRDCalROC* roc = calPad->GetCalROC(det);
460 return roc->GetValue(col, row);
463 //_____________________________________________________________________________
464 Float_t AliTRDcalibDB::GetSamplingFrequency()
467 // Returns the sampling frequency of the TRD read-out.
470 const AliTRDCalGlobals* calGlobal = dynamic_cast<const AliTRDCalGlobals*> (GetCachedCDBObject(kIDGlobals));
474 return calGlobal->GetSamplingFrequency();
477 //_____________________________________________________________________________
478 Int_t AliTRDcalibDB::GetNumberOfTimeBins()
481 // Returns the number of time bins which are read-out.
484 const AliTRDCalGlobals* calGlobal = dynamic_cast<const AliTRDCalGlobals*> (GetCachedCDBObject(kIDGlobals));
488 return calGlobal->GetNumberOfTimeBins();
491 //_____________________________________________________________________________
492 const AliTRDCalPIDLQ* AliTRDcalibDB::GetPIDLQObject()
495 // Returns the object storing the distributions for PID with likelihood
498 return dynamic_cast<const AliTRDCalPIDLQ* const> (GetCachedCDBObject(kIDPIDLQ));
501 //_____________________________________________________________________________
502 Float_t AliTRDcalibDB::GetOmegaTau(Float_t vdrift)
505 // Returns omega*tau (tan(Lorentz-angle)) for a given drift velocity <vd>
506 // and a B-field <b> for Xe/CO2 (15%).
507 // The values are according to a GARFIELD simulation.
509 // This function basically does not belong to the calibration class. It should be moved somewhere else.
510 // However, currently it is in use by simulation and reconstruction.
513 AliTRDCommonParam* commonParam = AliTRDCommonParam::Instance();
516 Float_t field = commonParam->GetField();
519 Float_t p0[kNb] = { 0.004810, 0.007412, 0.010252, 0.013409, 0.016888 };
520 Float_t p1[kNb] = { 0.054875, 0.081534, 0.107333, 0.131983, 0.155455 };
521 Float_t p2[kNb] = { -0.008682, -0.012896, -0.016987, -0.020880, -0.024623 };
522 Float_t p3[kNb] = { 0.000155, 0.000238, 0.000330, 0.000428, 0.000541 };
524 Int_t ib = ((Int_t) (10 * (field - 0.15)));
525 ib = TMath::Max( 0,ib);
526 ib = TMath::Min(kNb,ib);
528 Float_t alphaL = p0[ib]
530 + p2[ib] * vdrift*vdrift
531 + p3[ib] * vdrift*vdrift*vdrift;
533 return TMath::Tan(alphaL);
536 //_____________________________________________________________________________
537 void AliTRDcalibDB::SamplePRF()
540 // Samples the pad response function
543 const Int_t kPRFbin = 61;
545 Float_t prf[kNplan][kPRFbin] = { {2.9037e-02, 3.3608e-02, 3.9020e-02, 4.5292e-02,
546 5.2694e-02, 6.1362e-02, 7.1461e-02, 8.3362e-02,
547 9.7063e-02, 1.1307e-01, 1.3140e-01, 1.5235e-01,
548 1.7623e-01, 2.0290e-01, 2.3294e-01, 2.6586e-01,
549 3.0177e-01, 3.4028e-01, 3.8077e-01, 4.2267e-01,
550 4.6493e-01, 5.0657e-01, 5.4655e-01, 5.8397e-01,
551 6.1767e-01, 6.4744e-01, 6.7212e-01, 6.9188e-01,
552 7.0627e-01, 7.1499e-01, 7.1851e-01, 7.1499e-01,
553 7.0627e-01, 6.9188e-01, 6.7212e-01, 6.4744e-01,
554 6.1767e-01, 5.8397e-01, 5.4655e-01, 5.0657e-01,
555 4.6493e-01, 4.2267e-01, 3.8077e-01, 3.4028e-01,
556 3.0177e-01, 2.6586e-01, 2.3294e-01, 2.0290e-01,
557 1.7623e-01, 1.5235e-01, 1.3140e-01, 1.1307e-01,
558 9.7063e-02, 8.3362e-02, 7.1461e-02, 6.1362e-02,
559 5.2694e-02, 4.5292e-02, 3.9020e-02, 3.3608e-02,
561 {2.5478e-02, 2.9695e-02, 3.4655e-02, 4.0454e-02,
562 4.7342e-02, 5.5487e-02, 6.5038e-02, 7.6378e-02,
563 8.9696e-02, 1.0516e-01, 1.2327e-01, 1.4415e-01,
564 1.6794e-01, 1.9516e-01, 2.2573e-01, 2.5959e-01,
565 2.9694e-01, 3.3719e-01, 3.7978e-01, 4.2407e-01,
566 4.6889e-01, 5.1322e-01, 5.5569e-01, 5.9535e-01,
567 6.3141e-01, 6.6259e-01, 6.8882e-01, 7.0983e-01,
568 7.2471e-01, 7.3398e-01, 7.3761e-01, 7.3398e-01,
569 7.2471e-01, 7.0983e-01, 6.8882e-01, 6.6259e-01,
570 6.3141e-01, 5.9535e-01, 5.5569e-01, 5.1322e-01,
571 4.6889e-01, 4.2407e-01, 3.7978e-01, 3.3719e-01,
572 2.9694e-01, 2.5959e-01, 2.2573e-01, 1.9516e-01,
573 1.6794e-01, 1.4415e-01, 1.2327e-01, 1.0516e-01,
574 8.9696e-02, 7.6378e-02, 6.5038e-02, 5.5487e-02,
575 4.7342e-02, 4.0454e-02, 3.4655e-02, 2.9695e-02,
577 {2.2363e-02, 2.6233e-02, 3.0782e-02, 3.6140e-02,
578 4.2535e-02, 5.0157e-02, 5.9197e-02, 6.9900e-02,
579 8.2707e-02, 9.7811e-02, 1.1548e-01, 1.3601e-01,
580 1.5998e-01, 1.8739e-01, 2.1840e-01, 2.5318e-01,
581 2.9182e-01, 3.3373e-01, 3.7837e-01, 4.2498e-01,
582 4.7235e-01, 5.1918e-01, 5.6426e-01, 6.0621e-01,
583 6.4399e-01, 6.7700e-01, 7.0472e-01, 7.2637e-01,
584 7.4206e-01, 7.5179e-01, 7.5551e-01, 7.5179e-01,
585 7.4206e-01, 7.2637e-01, 7.0472e-01, 6.7700e-01,
586 6.4399e-01, 6.0621e-01, 5.6426e-01, 5.1918e-01,
587 4.7235e-01, 4.2498e-01, 3.7837e-01, 3.3373e-01,
588 2.9182e-01, 2.5318e-01, 2.1840e-01, 1.8739e-01,
589 1.5998e-01, 1.3601e-01, 1.1548e-01, 9.7811e-02,
590 8.2707e-02, 6.9900e-02, 5.9197e-02, 5.0157e-02,
591 4.2535e-02, 3.6140e-02, 3.0782e-02, 2.6233e-02,
593 {1.9635e-02, 2.3167e-02, 2.7343e-02, 3.2293e-02,
594 3.8224e-02, 4.5335e-02, 5.3849e-02, 6.4039e-02,
595 7.6210e-02, 9.0739e-02, 1.0805e-01, 1.2841e-01,
596 1.5216e-01, 1.7960e-01, 2.1099e-01, 2.4671e-01,
597 2.8647e-01, 3.2996e-01, 3.7660e-01, 4.2547e-01,
598 4.7536e-01, 5.2473e-01, 5.7215e-01, 6.1632e-01,
599 6.5616e-01, 6.9075e-01, 7.1939e-01, 7.4199e-01,
600 7.5838e-01, 7.6848e-01, 7.7227e-01, 7.6848e-01,
601 7.5838e-01, 7.4199e-01, 7.1939e-01, 6.9075e-01,
602 6.5616e-01, 6.1632e-01, 5.7215e-01, 5.2473e-01,
603 4.7536e-01, 4.2547e-01, 3.7660e-01, 3.2996e-01,
604 2.8647e-01, 2.4671e-01, 2.1099e-01, 1.7960e-01,
605 1.5216e-01, 1.2841e-01, 1.0805e-01, 9.0739e-02,
606 7.6210e-02, 6.4039e-02, 5.3849e-02, 4.5335e-02,
607 3.8224e-02, 3.2293e-02, 2.7343e-02, 2.3167e-02,
609 {1.7224e-02, 2.0450e-02, 2.4286e-02, 2.8860e-02,
610 3.4357e-02, 4.0979e-02, 4.8966e-02, 5.8612e-02,
611 7.0253e-02, 8.4257e-02, 1.0102e-01, 1.2094e-01,
612 1.4442e-01, 1.7196e-01, 2.0381e-01, 2.4013e-01,
613 2.8093e-01, 3.2594e-01, 3.7450e-01, 4.2563e-01,
614 4.7796e-01, 5.2991e-01, 5.7974e-01, 6.2599e-01,
615 6.6750e-01, 7.0344e-01, 7.3329e-01, 7.5676e-01,
616 7.7371e-01, 7.8410e-01, 7.8793e-01, 7.8410e-01,
617 7.7371e-01, 7.5676e-01, 7.3329e-01, 7.0344e-01,
618 6.6750e-01, 6.2599e-01, 5.7974e-01, 5.2991e-01,
619 4.7796e-01, 4.2563e-01, 3.7450e-01, 3.2594e-01,
620 2.8093e-01, 2.4013e-01, 2.0381e-01, 1.7196e-01,
621 1.4442e-01, 1.2094e-01, 1.0102e-01, 8.4257e-02,
622 7.0253e-02, 5.8612e-02, 4.8966e-02, 4.0979e-02,
623 3.4357e-02, 2.8860e-02, 2.4286e-02, 2.0450e-02,
625 {1.5096e-02, 1.8041e-02, 2.1566e-02, 2.5793e-02,
626 3.0886e-02, 3.7044e-02, 4.4515e-02, 5.3604e-02,
627 6.4668e-02, 7.8109e-02, 9.4364e-02, 1.1389e-01,
628 1.3716e-01, 1.6461e-01, 1.9663e-01, 2.3350e-01,
629 2.7527e-01, 3.2170e-01, 3.7214e-01, 4.2549e-01,
630 4.8024e-01, 5.3460e-01, 5.8677e-01, 6.3512e-01,
631 6.7838e-01, 7.1569e-01, 7.4655e-01, 7.7071e-01,
632 7.8810e-01, 7.9871e-01, 8.0255e-01, 7.9871e-01,
633 7.8810e-01, 7.7071e-01, 7.4655e-01, 7.1569e-01,
634 6.7838e-01, 6.3512e-01, 5.8677e-01, 5.3460e-01,
635 4.8024e-01, 4.2549e-01, 3.7214e-01, 3.2170e-01,
636 2.7527e-01, 2.3350e-01, 1.9663e-01, 1.6461e-01,
637 1.3716e-01, 1.1389e-01, 9.4364e-02, 7.8109e-02,
638 6.4668e-02, 5.3604e-02, 4.4515e-02, 3.7044e-02,
639 3.0886e-02, 2.5793e-02, 2.1566e-02, 1.8041e-02,
642 // More sampling precision with linear interpolation
643 fPadResponse.fPRFlo = -1.5;
644 fPadResponse.fPRFhi = 1.5;
645 Float_t pad[kPRFbin];
646 Int_t sPRFbin = kPRFbin;
647 Float_t sPRFwid = (fPadResponse.fPRFhi - fPadResponse.fPRFlo) / ((Float_t) sPRFbin);
648 for (Int_t iPad = 0; iPad < sPRFbin; iPad++) {
649 pad[iPad] = ((Float_t) iPad + 0.5) * sPRFwid + fPadResponse.fPRFlo;
651 fPadResponse.fPRFbin = 500;
652 fPadResponse.fPRFwid = (fPadResponse.fPRFhi - fPadResponse.fPRFlo) / ((Float_t) fPadResponse.fPRFbin);
653 fPadResponse.fPRFpad = ((Int_t) (1.0 / fPadResponse.fPRFwid));
655 if (fPadResponse.fPRFsmp) delete [] fPadResponse.fPRFsmp;
656 fPadResponse.fPRFsmp = new Float_t[kNplan*fPadResponse.fPRFbin];
662 for (Int_t iPla = 0; iPla < kNplan; iPla++) {
664 for (Int_t iBin = 0; iBin < fPadResponse.fPRFbin; iBin++) {
666 Float_t bin = (((Float_t) iBin) + 0.5) * fPadResponse.fPRFwid + fPadResponse.fPRFlo;
670 diff = bin - pad[ipos2++];
671 } while ((diff > 0) && (ipos2 < kPRFbin));
672 if (ipos2 == kPRFbin) {
673 fPadResponse.fPRFsmp[iPla*fPadResponse.fPRFbin+iBin] = prf[iPla][ipos2-1];
675 else if (ipos2 == 1) {
676 fPadResponse.fPRFsmp[iPla*fPadResponse.fPRFbin+iBin] = prf[iPla][ipos2-1];
680 if (ipos2 >= kPRFbin) ipos2 = kPRFbin - 1;
682 fPadResponse.fPRFsmp[iPla*fPadResponse.fPRFbin+iBin] = prf[iPla][ipos2]
683 + diff * (prf[iPla][ipos2] - prf[iPla][ipos1])
692 //_____________________________________________________________________________
693 Int_t AliTRDcalibDB::PadResponse(Double_t signal, Double_t dist
694 , Int_t plane, Double_t *pad) const
697 // Applies the pad response
700 Int_t iBin = ((Int_t) (( - dist - fPadResponse.fPRFlo) / fPadResponse.fPRFwid));
701 Int_t iOff = plane * fPadResponse.fPRFbin;
703 Int_t iBin0 = iBin - fPadResponse.fPRFpad + iOff;
704 Int_t iBin1 = iBin + iOff;
705 Int_t iBin2 = iBin + fPadResponse.fPRFpad + iOff;
710 if ((iBin1 >= 0) && (iBin1 < (fPadResponse.fPRFbin*kNplan))) {
713 pad[0] = signal * fPadResponse.fPRFsmp[iBin0];
715 pad[1] = signal * fPadResponse.fPRFsmp[iBin1];
716 if (iBin2 < (fPadResponse.fPRFbin*kNplan)) {
717 pad[2] = signal * fPadResponse.fPRFsmp[iBin2];