///////////////////////////////////////////////////////////////////////////////
// //
-// Class containing constant common parameters //
+// Class containing constant common parameters //
// //
-// Request an instance with AliTRDCommonParam::Instance() //
+// Request an instance with AliTRDCommonParam::Instance() //
// Then request the needed values //
// //
///////////////////////////////////////////////////////////////////////////////
#include "AliTRDCommonParam.h"
#include "AliTRDpadPlane.h"
-
ClassImp(AliTRDCommonParam)
AliTRDCommonParam* AliTRDCommonParam::fgInstance = 0;
fgInstance = new AliTRDCommonParam();
return fgInstance;
+
}
+//_____________________________________________________________________________
void AliTRDCommonParam::Terminate()
{
//
delete fgInstance;
fgInstance = 0;
}
+
}
//_____________________________________________________________________________
AliTRDCommonParam::AliTRDCommonParam()
+ :TObject()
+ ,fField(0)
+ ,fExBOn(kFALSE)
+ ,fPadPlaneArray(0)
{
//
- // constructor
+ // Default constructor
//
- fField = 0.0;
-
- fExBOn = kFALSE;
-
- fPadPlaneArray = 0;
-
Init();
+
}
//_____________________________________________________________________________
void AliTRDCommonParam::Init()
{
//
- // constructor helper
+ // Initialization
//
// E x B effects
fPadPlaneArray->AddAt(new AliTRDpadPlane(iplan,icham),ipp);
}
}
+
}
//_____________________________________________________________________________
AliTRDCommonParam::~AliTRDCommonParam()
{
//
- // destructor
+ // Destructor
//
if (fPadPlaneArray) {
delete fPadPlaneArray;
fPadPlaneArray = 0;
}
+
}
//_____________________________________________________________________________
-AliTRDCommonParam::AliTRDCommonParam(const AliTRDCommonParam &p):TObject(p)
+AliTRDCommonParam::AliTRDCommonParam(const AliTRDCommonParam &p)
+ :TObject(p)
+ ,fField(p.fField)
+ ,fExBOn(p.fExBOn)
+ ,fPadPlaneArray(0)
{
//
- // copy constructor
+ // Copy constructor
//
- ((AliTRDCommonParam &) p).Copy(*this);
}
-
//_____________________________________________________________________________
AliTRDCommonParam &AliTRDCommonParam::operator=(const AliTRDCommonParam &p)
{
if (this != &p) ((AliTRDCommonParam &) p).Copy(*this);
return *this;
+
}
//_____________________________________________________________________________
//
AliTRDCommonParam* target = dynamic_cast<AliTRDCommonParam*> (&p);
- if (!target)
+ if (!target) {
return;
-
- target->fExBOn = fExBOn;
- target->fField = fField;
+ }
+
+ target->fExBOn = fExBOn;
+ target->fField = fField;
+
}
//_____________________________________________________________________________
///////////////////////////////////////////////////////////////////////////////
// //
-// Class containing constant common parameters //
+// Class containing constant common parameters //
// //
///////////////////////////////////////////////////////////////////////////////
class AliTRDCommonParam : public TObject
{
+
public:
- static AliTRDCommonParam* Instance();
- static void Terminate();
enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 };
AliTRDCommonParam(const AliTRDCommonParam &p);
AliTRDCommonParam &operator=(const AliTRDCommonParam &p);
- virtual void Copy(TObject &p) const;
-
- void SetField(Float_t field) { fField = field; };
+ static AliTRDCommonParam *Instance();
+ static void Terminate();
+ virtual void Copy(TObject &p) const;
- void SetExB(Int_t exbOn = 1) { fExBOn = exbOn; };
+ void SetField(Float_t field) { fField = field; };
+ void SetExB(Int_t exbOn = 1) { fExBOn = exbOn; };
- Float_t GetField() const { return fField; };
-
- Bool_t ExBOn() const { return fExBOn; };
+ Float_t GetField() const { return fField; };
+ Bool_t ExBOn() const { return fExBOn; };
AliTRDpadPlane *GetPadPlane(Int_t p, Int_t c) const;
- Int_t GetRowMax(Int_t p, Int_t c, Int_t /*s*/) const;
- Int_t GetColMax(Int_t p) const;
- Double_t GetRow0(Int_t p, Int_t c, Int_t /*s*/) const;
- Double_t GetCol0(Int_t p) const;
+ Int_t GetRowMax(Int_t p, Int_t c, Int_t /*s*/) const;
+ Int_t GetColMax(Int_t p) const;
+ Double_t GetRow0(Int_t p, Int_t c, Int_t /*s*/) const;
+ Double_t GetCol0(Int_t p) const;
protected:
- static AliTRDCommonParam* fgInstance; // Instance of this class (singleton implementation)
- static Bool_t fgTerminated; // Defines if this class has already been terminated and therefore does not return instances in GetInstance anymore
+
+ static AliTRDCommonParam *fgInstance; // Instance of this class (singleton implementation)
+ static Bool_t fgTerminated; // Defines if this class has already been terminated
void Init();
- Float_t fField; // Magnetic field
-
- Int_t fExBOn; // Switch for the ExB effects
+ Float_t fField; // Magnetic field
+ Int_t fExBOn; // Switch for the ExB effects
- TObjArray *fPadPlaneArray; //! Array of pad plane objects
+ TObjArray *fPadPlaneArray; //! Array of pad plane objects
private:
- // this is a singleton, constructor is private!
+
+ // This is a singleton, constructor is private!
AliTRDCommonParam();
virtual ~AliTRDCommonParam();
- ClassDef(AliTRDCommonParam, 1)
+ ClassDef(AliTRDCommonParam,1) // The constant parameters common to simulation and reconstruction
+
};
#endif
/* $Id$ */
///////////////////////////////////////////////////////////////////////////////
-///
-/// This class provides access to TRD digits in raw data.
-///
-/// It loops over all TRD digits in the raw data given by the AliRawReader.
-/// The Next method goes to the next digit. If there are no digits left
-/// it returns kFALSE.
-/// Several getters provide information about the current digit.
-///
+// //
+// This class provides access to TRD digits in raw data. //
+// //
+// It loops over all TRD digits in the raw data given by the AliRawReader. //
+// The Next method goes to the next digit. If there are no digits left //
+// it returns kFALSE. //
+// Several getters provide information about the current digit. //
+// //
///////////////////////////////////////////////////////////////////////////////
-#include "AliTRDRawStream.h"
+#include "AliLog.h"
#include "AliRawReader.h"
+
+#include "AliTRDRawStream.h"
#include "AliTRDcalibDB.h"
ClassImp(AliTRDRawStream)
+//_____________________________________________________________________________
+AliTRDRawStream::AliTRDRawStream()
+ :TObject()
+ ,fRawReader(0)
+ ,fCount(0)
+ ,fDetector(-1)
+ ,fPrevDetector(-1)
+ ,fNPads(-1)
+ ,fRow(-1)
+ ,fPrevRow(-1)
+ ,fColumn(-1)
+ ,fPrevColumn(-1)
+ ,fTime(-1)
+ ,fSignal(-1)
+{
+ //
+ // Default constructor
+ //
-AliTRDRawStream::AliTRDRawStream(AliRawReader* rawReader) :
- fRawReader(rawReader),
- fCount(0),
- fDetector(-1),
- fPrevDetector(-1),
- fNPads(-1),
- fRow(-1),
- fPrevRow(-1),
- fColumn(-1),
- fPrevColumn(-1),
- fTime(-1),
- fSignal(-1)
+}
+
+//_____________________________________________________________________________
+AliTRDRawStream::AliTRDRawStream(AliRawReader* rawReader)
+ :TObject()
+ ,fRawReader(rawReader)
+ ,fCount(0)
+ ,fDetector(-1)
+ ,fPrevDetector(-1)
+ ,fNPads(-1)
+ ,fRow(-1)
+ ,fPrevRow(-1)
+ ,fColumn(-1)
+ ,fPrevColumn(-1)
+ ,fTime(-1)
+ ,fSignal(-1)
{
-// create an object to read TRD raw digits
+ //
+ // Create an object to read TRD raw digits
+ //
fRawReader->Select("TRD");
+
}
+//_____________________________________________________________________________
AliTRDRawStream::AliTRDRawStream(const AliTRDRawStream& stream) :
TObject(stream),
fRawReader(NULL),
fTime(-1),
fSignal(-1)
{
- Fatal("AliTRDRawStream", "copy constructor not implemented");
+ //
+ // Copy constructor
+ //
+
+ AliFatal("Copy constructor not implemented");
+
}
+//_____________________________________________________________________________
AliTRDRawStream& AliTRDRawStream::operator = (const AliTRDRawStream&
/* stream */)
{
+ //
+ // Assigment operator
+ //
+
Fatal("operator =", "assignment operator not implemented");
return *this;
+
}
+//_____________________________________________________________________________
AliTRDRawStream::~AliTRDRawStream()
{
-// clean up
+ //
+ // Destructor
+ //
}
-
+//_____________________________________________________________________________
Bool_t AliTRDRawStream::Next()
{
-// read the next raw digit
-// returns kFALSE if there is no digit left
+ //
+ // Read the next raw digit
+ // Returns kFALSE if there is no digit left
+ //
fPrevDetector = fDetector;
- fPrevRow = fRow;
- fPrevColumn = fColumn;
+ fPrevRow = fRow;
+ fPrevColumn = fColumn;
UChar_t data;
AliTRDcalibDB* calibration = AliTRDcalibDB::Instance();
// read the flag
if (!fRawReader->ReadNextChar(data)) return kFALSE;
if (data != 0xBB) {
- Error("Next", "wrong flag: %x", data);
+ AliError(Form("wrong flag: %x", data));
fCount = -1;
return kFALSE;
}
// read the detector number
if (!fRawReader->ReadNextChar(data)) {
- Error("Next", "could not read detector number");
+ AliError("Could not read detector number");
fCount = -1;
return kFALSE;
}
fDetector = data;
if (!fRawReader->ReadNextChar(data)) {
- Error("Next", "could not read detector number");
+ AliError("Could not read detector number");
fCount = -1;
return kFALSE;
}
// read the number of byts
if (!fRawReader->ReadNextChar(data)) {
- Error("Next", "could not read number of bytes");
+ AliError("Could not read number of bytes");
fCount = -1;
return kFALSE;
}
fCount = data;
if (!fRawReader->ReadNextChar(data)) {
- Error("Next", "could not read number of bytes");
+ AliError("Could not read number of bytes");
fCount = -1;
return kFALSE;
}
fCount += (UInt_t(data) << 8);
if (!fRawReader->ReadNextChar(data)) {
- Error("Next", "could not read number of bytes");
+ AliError("Could not read number of bytes");
fCount = -1;
return kFALSE;
}
// read the number of active pads
if (!fRawReader->ReadNextChar(data)) {
- Error("Next", "could not read number of active pads");
+ AliError("Could not read number of active pads");
fCount = -1;
return kFALSE;
}
fNPads = data;
if (!fRawReader->ReadNextChar(data)) {
- Error("Next", "could not read number of active pads");
+ AliError("Could not read number of active pads");
fCount = -1;
return kFALSE;
}
// read the pad row and column number
if ((fTime >= timeBins) && (fCount > 2)) {
if (!fRawReader->ReadNextChar(data)) {
- Error("Next", "could not read row number");
+ AliError("Could not read row number");
fCount = -1;
return kFALSE;
}
fCount--;
fRow = data - 1;
if (!fRawReader->ReadNextChar(data)) {
- Error("Next", "could not read column number");
+ AliError("Could not read column number");
fCount = -1;
return kFALSE;
}
// read the next data byte
if (!fRawReader->ReadNextChar(data)) {
- Error("Next", "could not read data");
+ AliError("Could not read data");
fCount = -1;
return kFALSE;
}
if (data == 0) { // zeros
if (!fRawReader->ReadNextChar(data)) {
- Error("Next", "could not read time value");
+ AliError("Could not read time value");
fCount = -1;
return kFALSE;
}
fCount--;
fTime += data + 1;
- } else { // signal
+ }
+ else { // signal
fSignal = (UInt_t(data & 0x7F) << 8);
if (!fRawReader->ReadNextChar(data)) {
- Error("Next", "could not read ADC value");
+ AliError("Could not read ADC value");
fCount = -1;
return kFALSE;
}
}
return kFALSE;
+
}
/* $Id$ */
///////////////////////////////////////////////////////////////////////////////
-///
-/// This class provides access to TRD digits in raw data.
-///
+// //
+// This class provides access to TRD digits in raw data. //
+// //
///////////////////////////////////////////////////////////////////////////////
#include <TObject.h>
class AliTRDparameter;
class AliTRDRawStream: public TObject {
+
public :
+
+ AliTRDRawStream();
AliTRDRawStream(AliRawReader* rawReader);
virtual ~AliTRDRawStream();
virtual Bool_t Next();
- Int_t GetDetector() const {return fDetector;};
- Int_t GetPrevDetector() const {return fPrevDetector;};
- Bool_t IsNewDetector() const {return fDetector != fPrevDetector;};
- Int_t GetNPads() const {return fNPads;};
- Int_t GetRow() const {return fRow;};
- Int_t GetPrevRow() const {return fPrevRow;};
- Bool_t IsNewRow() const {return (fRow != fPrevRow) || IsNewDetector();};
- Int_t GetColumn() const {return fColumn;};
- Int_t GetPrevColumn() const {return fPrevColumn;};
- Bool_t IsNewColumn() const {return (fColumn != fPrevColumn) || IsNewRow();};
- Int_t GetTime() const {return fTime-1;};
- Int_t GetSignal() const {return fSignal;};
+ Int_t GetDetector() const { return fDetector; };
+ Int_t GetPrevDetector() const { return fPrevDetector; };
+ Bool_t IsNewDetector() const { return fDetector != fPrevDetector; };
+ Int_t GetNPads() const { return fNPads; };
+ Int_t GetRow() const { return fRow; };
+ Int_t GetPrevRow() const { return fPrevRow; };
+ Bool_t IsNewRow() const { return (fRow != fPrevRow) || IsNewDetector(); };
+ Int_t GetColumn() const { return fColumn; };
+ Int_t GetPrevColumn() const { return fPrevColumn; };
+ Bool_t IsNewColumn() const { return (fColumn != fPrevColumn) || IsNewRow(); };
+ Int_t GetTime() const { return fTime-1; };
+ Int_t GetSignal() const { return fSignal; };
enum {kDDLOffset = 0x400}; // offset for DDL numbers
private :
- AliTRDRawStream(const AliTRDRawStream& stream);
- AliTRDRawStream& operator = (const AliTRDRawStream& stream);
- AliRawReader* fRawReader; // object for reading the raw data
+ AliTRDRawStream(const AliTRDRawStream &stream);
+ AliTRDRawStream &operator=(const AliTRDRawStream &stream);
+
+ AliRawReader* fRawReader; // Object for reading the raw data
+
+ Int_t fCount; // Counter of bytes to be read for current detector
- Int_t fCount; // counter of bytes to be read for current detector
+ Int_t fDetector; // Index of current detector
+ Int_t fPrevDetector; // Index of previous detector
+ Int_t fNPads; // Number of active pads
+ Int_t fRow; // Index of current pad row
+ Int_t fPrevRow; // Index of previous pad row
+ Int_t fColumn; // Index of current pad column
+ Int_t fPrevColumn; // Index of previous pad column
+ Int_t fTime; // Index of current time bin
+ Int_t fSignal; // Signal in ADC counts
- Int_t fDetector; // index of current detector
- Int_t fPrevDetector; // index of previous detector
- Int_t fNPads; // number of active pads
- Int_t fRow; // index of current pad row
- Int_t fPrevRow; // index of previous pad row
- Int_t fColumn; // index of current pad column
- Int_t fPrevColumn; // index of previous pad column
- Int_t fTime; // index of current time bin
- Int_t fSignal; // signal in ADC counts
+ ClassDef(AliTRDRawStream, 1) // Class for reading TRD raw digits
- ClassDef(AliTRDRawStream, 1) // class for reading TRD raw digits
};
#endif
// //
// Class providing the calibration parameters by accessing the CDB //
// //
-// Request an instance with AliTRDcalibDB::Instance() //
+// Request an instance with AliTRDcalibDB::Instance() //
// If a new event is processed set the event number with SetRun //
// Then request the calibration data //
// //
+// Author: //
+// Jan Fiete Grosse-Oetringhaus (Jan.Fiete.Grosse-Oetringhaus@cern.ch) //
+// //
///////////////////////////////////////////////////////////////////////////////
#include <TRandom.h>
-#include <AliCDBManager.h>
+#include "AliCDBManager.h"
+#include "AliCDBStorage.h"
+#include "AliCDBEntry.h"
+#include "AliLog.h"
#include "AliTRDcalibDB.h"
#include "AliTRDgeometry.h"
#include "AliTRDCommonParam.h"
#include "Cal/AliTRDCalROC.h"
-
#include "Cal/AliTRDCalPad.h"
#include "Cal/AliTRDCalDet.h"
#include "Cal/AliTRDCalGlobals.h"
#include "Cal/AliTRDCalPIDLQ.h"
#include "Cal/AliTRDCalMonitoring.h"
-
#include "Cal/AliTRDCalSuperModuleStatus.h"
#include "Cal/AliTRDCalChamberStatus.h"
#include "Cal/AliTRDCalMCMStatus.h"
ClassImp(AliTRDcalibDB)
-AliTRDcalibDB* AliTRDcalibDB::fgInstance = 0;
-Bool_t AliTRDcalibDB::fgTerminated = kFALSE;
+AliTRDcalibDB *AliTRDcalibDB::fgInstance = 0;
+Bool_t AliTRDcalibDB::fgTerminated = kFALSE;
//_ singleton implementation __________________________________________________
AliTRDcalibDB* AliTRDcalibDB::Instance()
return fgInstance;
}
+//_____________________________________________________________________________
void AliTRDcalibDB::Terminate()
{
//
delete fgInstance;
fgInstance = 0;
}
+
}
//_____________________________________________________________________________
AliTRDcalibDB::AliTRDcalibDB()
+ :TObject()
+ ,fRun(-1)
{
//
- // constructor
+ // Default constructor
//
-
- // TODO Default runnumber is set to 0, this should be changed later to an invalid value (e.g. -1) to prevent
+ // TODO Default runnumber is set to 0, this should be changed later
+ // to an invalid value (e.g. -1) to prevent
// TODO invalid calibration data to be used.
- fRun = -1;
+ //
+
+ fPadResponse.fPRFbin = 0;
+ fPadResponse.fPRFlo = 0.0;
+ fPadResponse.fPRFhi = 0.0;
+ fPadResponse.fPRFwid = 0.0;
+ fPadResponse.fPRFpad = 0;
+ fPadResponse.fPRFsmp = 0;
+
+ for (Int_t i=0; i<kCDBCacheSize; ++i)
+ {
+ fCDBCache[i] = 0;
+ fCDBEntries[i] = 0;
+ }
- fPadResponse.fPRFbin = 0;
- fPadResponse.fPRFlo = 0.0;
- fPadResponse.fPRFhi = 0.0;
- fPadResponse.fPRFwid = 0.0;
- fPadResponse.fPRFpad = 0;
- fPadResponse.fPRFsmp = 0;
+ // Create the sampled PRF
+ SamplePRF();
+
+}
+
+//_____________________________________________________________________________
+AliTRDcalibDB::AliTRDcalibDB(const AliTRDcalibDB &c)
+ :TObject(c)
+ ,fRun(0)
+{
+ //
+ // Copy constructor (not that it make any sense for a singleton...)
+ //
+
+ fPadResponse.fPRFbin = 0;
+ fPadResponse.fPRFlo = 0.0;
+ fPadResponse.fPRFhi = 0.0;
+ fPadResponse.fPRFwid = 0.0;
+ fPadResponse.fPRFpad = 0;
+ fPadResponse.fPRFsmp = 0;
for (Int_t i=0; i<kCDBCacheSize; ++i)
{
- fCDBCache[i] = 0;
+ fCDBCache[i] = 0;
fCDBEntries[i] = 0;
}
// Create the sampled PRF
SamplePRF();
+
+}
+
+//_____________________________________________________________________________
+AliTRDcalibDB &AliTRDcalibDB::operator=(const AliTRDcalibDB &c)
+{
+ //
+ // Assignment operator (same as above ...)
+ //
+
+ if (this != &c) {
+ AliFatal("No assignment operator defined");
+ }
+ return *this;
+
}
//_____________________________________________________________________________
}
Invalidate();
+
}
//_caching functions____________________________________________________________
const TObject* AliTRDcalibDB::GetCachedCDBObject(Int_t id)
{
- //
- // Retrieves a cdb object with the given id. The objects are cached as long as the run number is not changed.
- //
- // Put together the available objects here by using the lines
- // a) For usual calibration objects:
- // ase kID<Name> : return CacheCDBEntry(kID<Name>, "TRD/Calib/<Path>"); break;
- // See function CacheCDBEntry for details.
- // and
- // b) For calibration data which depends on two objects: One containing a value per detector and one the local fluctuations per pad:
- // case kID<Name> : return CacheMergeCDBEntry(kID<Name>, "TRD/Calib/<padPath>", "TRD/Calib/<chamberPath>"); break;
- // See function CacheMergeCDBEntry for details.
- //
+ //
+ // Retrieves a cdb object with the given id. The objects are cached as
+ // long as the run number is not changed.
+ //
+ // Put together the available objects here by using the lines
+ // a) For usual calibration objects:
+ // case kID<Name> :
+ // return CacheCDBEntry(kID<Name>,"TRD/Calib/<Path>");
+ // break;
+ // See function CacheCDBEntry for details.
+ // and
+ // b) For calibration data which depends on two objects: One containing
+ // a value per detector and one the local fluctuations per pad:
+ // case kID<Name> :
+ // return CacheMergeCDBEntry(kID<Name>,"TRD/Calib/<padPath>","TRD/Calib/<chamberPath>");
+ // break;
+ // See function CacheMergeCDBEntry for details.
+ //
- switch (id)
- {
- // parameters defined per pad and chamber
- case kIDVdriftPad : return CacheCDBEntry(kIDVdriftPad, "TRD/Calib/LocalVdrift"); break;
- case kIDVdriftChamber : return CacheCDBEntry(kIDVdriftChamber, "TRD/Calib/ChamberVdrift"); break;
-
- case kIDT0Pad : return CacheCDBEntry(kIDT0Pad, "TRD/Calib/LocalT0"); break;
- case kIDT0Chamber : return CacheCDBEntry(kIDT0Chamber, "TRD/Calib/ChamberT0"); break;
-
- case kIDGainFactorPad : return CacheCDBEntry(kIDGainFactorPad, "TRD/Calib/LocalGainFactor"); break;
- case kIDGainFactorChamber : return CacheCDBEntry(kIDGainFactorChamber, "TRD/Calib/ChamberGainFactor"); break;
-
- // parameters defined per pad
- case kIDPRFWidth : return CacheCDBEntry(kIDPRFWidth, "TRD/Calib/PRFWidth"); break;
-
- // status values
- case kIDSuperModuleStatus : return CacheCDBEntry(kIDSuperModuleStatus, "TRD/Calib/SuperModuleStatus"); break;
- case kIDChamberStatus : return CacheCDBEntry(kIDChamberStatus, "TRD/Calib/ChamberStatus"); break;
- case kIDMCMStatus : return CacheCDBEntry(kIDMCMStatus, "TRD/Calib/MCMStatus"); break;
- case kIDPadStatus : return CacheCDBEntry(kIDPadStatus, "TRD/Calib/PadStatus"); break;
-
- // global parameters
- case kIDMonitoringData : return CacheCDBEntry(kIDMonitoringData, "TRD/Calib/MonitoringData"); break;
- case kIDGlobals : return CacheCDBEntry(kIDGlobals, "TRD/Calib/Globals"); break;
- case kIDPIDLQ : return CacheCDBEntry(kIDPIDLQ, "TRD/Calib/PIDLQ"); break;
- }
- return 0;
+ switch (id)
+ {
+
+ // Parameters defined per pad and chamber
+ case kIDVdriftPad :
+ return CacheCDBEntry(kIDVdriftPad, "TRD/Calib/LocalVdrift");
+ break;
+ case kIDVdriftChamber :
+ return CacheCDBEntry(kIDVdriftChamber, "TRD/Calib/ChamberVdrift");
+ break;
+ case kIDT0Pad :
+ return CacheCDBEntry(kIDT0Pad, "TRD/Calib/LocalT0");
+ break;
+ case kIDT0Chamber :
+ return CacheCDBEntry(kIDT0Chamber, "TRD/Calib/ChamberT0");
+ break;
+ case kIDGainFactorPad :
+ return CacheCDBEntry(kIDGainFactorPad, "TRD/Calib/LocalGainFactor");
+ break;
+ case kIDGainFactorChamber :
+ return CacheCDBEntry(kIDGainFactorChamber, "TRD/Calib/ChamberGainFactor");
+ break;
+
+ // Parameters defined per pad
+ case kIDPRFWidth :
+ return CacheCDBEntry(kIDPRFWidth, "TRD/Calib/PRFWidth");
+ break;
+
+ // Status values
+ case kIDSuperModuleStatus :
+ return CacheCDBEntry(kIDSuperModuleStatus, "TRD/Calib/SuperModuleStatus");
+ break;
+ case kIDChamberStatus :
+ return CacheCDBEntry(kIDChamberStatus, "TRD/Calib/ChamberStatus");
+ break;
+ case kIDMCMStatus :
+ return CacheCDBEntry(kIDMCMStatus, "TRD/Calib/MCMStatus");
+ break;
+ case kIDPadStatus :
+ return CacheCDBEntry(kIDPadStatus, "TRD/Calib/PadStatus");
+ break;
+
+ // Global parameters
+ case kIDMonitoringData :
+ return CacheCDBEntry(kIDMonitoringData, "TRD/Calib/MonitoringData");
+ break;
+ case kIDGlobals :
+ return CacheCDBEntry(kIDGlobals, "TRD/Calib/Globals");
+ break;
+ case kIDPIDLQ :
+ return CacheCDBEntry(kIDPIDLQ, "TRD/Calib/PIDLQ");
+ break;
+
+ }
+
+ return 0;
+
}
//_____________________________________________________________________________
//
AliCDBEntry* entry = AliCDBManager::Instance()->Get(cdbPath, fRun);
- if (!entry)
- {
- std::cerr << "AliTRDcalibDB: Failed to get entry: " << cdbPath << std::endl;
+ if (!entry) {
+ AliError(Form("Failed to get entry: %s",cdbPath));
return 0;
}
- std::cout << "AliTRDcalibDB: Retrieved object: " << cdbPath << std::endl;
+ AliInfo(Form("AliTRDcalibDB: Retrieved object: %s",cdbPath));
+
return entry;
+
}
//_____________________________________________________________________________
// Caches the entry <id> with cdb path <cdbPath>
//
- if (!fCDBCache[id])
- {
+ if (!fCDBCache[id]) {
fCDBEntries[id] = GetCDBEntry(cdbPath);
if (fCDBEntries[id])
fCDBCache[id] = fCDBEntries[id]->GetObject();
}
return fCDBCache[id];
+
}
//_____________________________________________________________________________
fRun = run;
Invalidate();
+
}
//_____________________________________________________________________________
// Invalidates cache (when run number is changed).
//
- for (Int_t i=0; i<kCDBCacheSize; ++i)
- {
- if (fCDBEntries[i])
- {
- if (AliCDBManager::Instance()->GetCacheFlag() == kFALSE)
- {
- if (fCDBEntries[i]->IsOwner() == kFALSE && fCDBCache[i])
+ for (Int_t i=0; i<kCDBCacheSize; ++i) {
+ if (fCDBEntries[i]) {
+ if (AliCDBManager::Instance()->GetCacheFlag() == kFALSE) {
+ if (fCDBEntries[i]->IsOwner() == kFALSE && fCDBCache[i]) {
delete fCDBCache[i];
-
+ }
delete fCDBEntries[i];
}
fCDBEntries[i] = 0;
- fCDBCache[i] = 0;
+ fCDBCache[i] = 0;
}
}
+
}
//_____________________________________________________________________________
return -1;
return calChamber->GetValue(det) * roc->GetValue(col, row);
+
}
//_____________________________________________________________________________
return -1;
return calDet->GetValue(det);
+
}
//_____________________________________________________________________________
return -1;
return calChamber->GetValue(det) * roc->GetValue(col, row);
+
}
//_____________________________________________________________________________
return -1;
return calDet->GetValue(det);
+
}
//_____________________________________________________________________________
return -1;
return calChamber->GetValue(det) * roc->GetValue(col, row);
+
}
//_____________________________________________________________________________
return -1;
return calDet->GetValue(det);
+
}
//_____________________________________________________________________________
return -1;
return roc->GetValue(col, row);
+
}
//_____________________________________________________________________________
return -1;
return calGlobal->GetSamplingFrequency();
+
}
//_____________________________________________________________________________
return -1;
return calGlobal->GetNumberOfTimeBins();
+
}
//_____________________________________________________________________________
return -1;
return roc->GetStatus(col, row);
+
}
//_____________________________________________________________________________
return -1;
return roc->GetStatus(mcm, row);
+
}
//_____________________________________________________________________________
return -1;
return cal->GetStatus(det);
+
}
//_____________________________________________________________________________
return -1;
return cal->GetStatus(sm);
+
}
//_____________________________________________________________________________
return -1;
return cal->IsMasked(det, col, row);
+
}
//_____________________________________________________________________________
return -1;
return cal->IsBridgedLeft(det, col, row);
+
}
//_____________________________________________________________________________
return -1;
return cal->IsBridgedRight(det, col, row);
+
}
//_____________________________________________________________________________
return -1;
return cal->IsMasked(det, col, row);
+
}
//_____________________________________________________________________________
return -1;
return cal->IsInstalled(det);
+
}
//_____________________________________________________________________________
return -1;
return cal->IsMasked(det);
+
}
//_____________________________________________________________________________
return -1;
return cal->IsInstalled(det);
+
}
//_____________________________________________________________________________
return -1;
return cal->IsMasked(det);
+
}
//_____________________________________________________________________________
//
return dynamic_cast<const AliTRDCalPIDLQ*> (GetCachedCDBObject(kIDPIDLQ));
+
}
//_____________________________________________________________________________
//
return dynamic_cast<const AliTRDCalMonitoring*> (GetCachedCDBObject(kIDMonitoringData));
+
}
//_____________________________________________________________________________
void AliTRDcalibDB::SamplePRF()
{
//
- // Samples the pad response function
+ // Samples the pad response function (should maybe go somewhere else ...)
//
const Int_t kPRFbin = 61;
//_____________________________________________________________________________
Int_t AliTRDcalibDB::PadResponse(Double_t signal, Double_t dist
- , Int_t plane, Double_t *pad) const
+ , Int_t plane, Double_t *pad) const
{
//
// Applies the pad response
/* $Id$ */
-#include <iostream>
#include "TObject.h"
-#include "AliLog.h"
-#include "AliTRDgeometry.h"
-
-#include <AliCDBStorage.h>
-#include <AliCDBEntry.h>
+class AliCDBEntry;
class AliTRDCalPIDLQ;
class AliTRDCalMonitoring;
-class AliTRDcalibDB : public TObject
-{
-public:
+class AliTRDcalibDB : public TObject {
+
+ public:
+
enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 };
- static AliTRDcalibDB* Instance();
- static void Terminate();
+ static AliTRDcalibDB *Instance();
+ static void Terminate();
- void SetRun(Long64_t run);
+ void SetRun(Long64_t run);
Long64_t GetRun() { return fRun; }
- Float_t GetVdrift(Int_t det, Int_t col, Int_t row);
- Float_t GetVdriftAverage(Int_t det);
+ Float_t GetVdrift(Int_t det, Int_t col, Int_t row);
+ Float_t GetVdriftAverage(Int_t det);
- Float_t GetT0(Int_t det, Int_t col, Int_t row);
- Float_t GetT0Average(Int_t det);
+ Float_t GetT0(Int_t det, Int_t col, Int_t row);
+ Float_t GetT0Average(Int_t det);
- Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
- Float_t GetGainFactorAverage(Int_t det);
+ Float_t GetGainFactor(Int_t det, Int_t col, Int_t row);
+ Float_t GetGainFactorAverage(Int_t det);
- Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
+ Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
- Float_t GetSamplingFrequency();
- Int_t GetNumberOfTimeBins();
+ Float_t GetSamplingFrequency();
+ Int_t GetNumberOfTimeBins();
- Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
- Char_t GetMCMStatus(Int_t det, Int_t col, Int_t row);
- Char_t GetChamberStatus(Int_t det);
- Char_t GetSuperModuleStatus(Int_t sm);
+ Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
+ Char_t GetMCMStatus(Int_t det, Int_t col, Int_t row);
+ Char_t GetChamberStatus(Int_t det);
+ Char_t GetSuperModuleStatus(Int_t sm);
- Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row);
- Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
- Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
+ Bool_t IsPadMasked(Int_t det, Int_t col, Int_t row);
+ Bool_t IsPadBridgedLeft(Int_t det, Int_t col, Int_t row);
+ Bool_t IsPadBridgedRight(Int_t det, Int_t col, Int_t row);
- Bool_t IsMCMMasked(Int_t det, Int_t col, Int_t row);
+ Bool_t IsMCMMasked(Int_t det, Int_t col, Int_t row);
- Bool_t IsChamberInstalled(Int_t det);
- Bool_t IsChamberMasked(Int_t det);
+ Bool_t IsChamberInstalled(Int_t det);
+ Bool_t IsChamberMasked(Int_t det);
- Bool_t IsSuperModuleInstalled(Int_t det);
- Bool_t IsSuperModuleMasked(Int_t det);
+ Bool_t IsSuperModuleInstalled(Int_t det);
+ Bool_t IsSuperModuleMasked(Int_t det);
- const AliTRDCalMonitoring* GetMonitoringObject();
- const AliTRDCalPIDLQ* GetPIDLQObject();
+ const AliTRDCalMonitoring *GetMonitoringObject();
+ const AliTRDCalPIDLQ *GetPIDLQObject();
- //Related functions, these depend on calibration data
+ // Related functions, these depend on calibration data
static Float_t GetOmegaTau(Float_t vdrift);
- Int_t PadResponse(Double_t signal, Double_t dist, Int_t plane, Double_t *pad) const;
+ Int_t PadResponse(Double_t signal, Double_t dist, Int_t plane, Double_t *pad) const;
-protected:
- // for caching see also implentation of GetCachedCDBObject in the .cxx file
+ protected:
+
+ // For caching see also implentation of GetCachedCDBObject in the .cxx file
enum { kCDBCacheSize = 17 }; // Number of cached objects
enum { kIDVdriftPad = 0, kIDVdriftChamber,
kIDT0Pad, kIDT0Chamber,
const TObject* GetCachedCDBObject(Int_t id);
- void Invalidate();
- void SamplePRF();
+ void Invalidate();
+ void SamplePRF();
- AliCDBEntry* GetCDBEntry(const char* cdbPath);
- const TObject* CacheCDBEntry(Int_t id, const char* cdbPath);
+ AliCDBEntry *GetCDBEntry(const char* cdbPath);
+ const TObject *CacheCDBEntry(Int_t id, const char* cdbPath);
- static AliTRDcalibDB* fgInstance; // Instance of this class (singleton implementation)
- static Bool_t fgTerminated; // Defines if this class has already been terminated and therefore does not return instances in GetInstance anymore
+ static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation)
+ static Bool_t fgTerminated; // Defines if this class has already been terminated
+ AliCDBEntry *fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
+ TObject *fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
- AliCDBEntry* fCDBEntries[kCDBCacheSize]; // Cache for CDB entries
- TObject* fCDBCache[kCDBCacheSize]; // Cache for calibration objects.
-
- Long64_t fRun;
+ Long64_t fRun; // Run Number
struct
{
- Float_t *fPRFsmp; //! Sampled pad response
- Int_t fPRFbin; // Number of bins for the PRF
- Float_t fPRFlo; // Lower boundary of the PRF
- Float_t fPRFhi; // Higher boundary of the PRF
- Float_t fPRFwid; // Bin width of the sampled PRF
- Int_t fPRFpad; // Distance to next pad in PRF
+ Float_t *fPRFsmp; //! Sampled pad response
+ Int_t fPRFbin; // Number of bins for the PRF
+ Float_t fPRFlo; // Lower boundary of the PRF
+ Float_t fPRFhi; // Higher boundary of the PRF
+ Float_t fPRFwid; // Bin width of the sampled PRF
+ Int_t fPRFpad; // Distance to next pad in PRF
} fPadResponse;
-private:
- AliTRDcalibDB(); // this is a singleton, constructor is private!
+ private:
+
+ AliTRDcalibDB(); // This is a singleton, constructor is private!
+ AliTRDcalibDB(const AliTRDcalibDB &c);
+ AliTRDcalibDB &operator=(const AliTRDcalibDB &c);
virtual ~AliTRDcalibDB();
- ClassDef(AliTRDcalibDB, 2)
+ ClassDef(AliTRDcalibDB, 2) // Provides central access to the CDB
+
};
#endif
//
AliTRDrawData raw;
- raw.SetDebug(1);
fDigitsManager = raw.Raw2Digits(rawReader);
#include "TClass.h"
#include "TError.h"
+
+#include "AliLog.h"
+
#include "AliTRDsegmentID.h"
#include "AliTRDarrayI.h"
#include "AliTRDdataArray.h"
//_____________________________________________________________________________
AliTRDdataArray::AliTRDdataArray()
+ :fNrow(0)
+ ,fNcol(0)
+ ,fNtime(0)
+ ,fNdim1(-1)
+ ,fNdim2(-1)
+ ,fIndex(0)
+ ,fBufType(-1)
+ ,fNelems(-1)
+ ,fCurrentIdx1(0)
+ ,fCurrentIdx2(0)
+ ,fCurrentIndex(0)
{
//
// Default constructor
//
- fIndex = 0;
-
- fNdim1 = -1;
- fNdim2 = -1;
- fNelems = -1;
-
- fBufType = -1;
-
- fNrow = 0;
- fNcol = 0;
- fNtime = 0;
-
}
//_____________________________________________________________________________
AliTRDdataArray::AliTRDdataArray(Int_t nrow, Int_t ncol, Int_t ntime)
+ :fNrow(0)
+ ,fNcol(0)
+ ,fNtime(0)
+ ,fNdim1(-1)
+ ,fNdim2(-1)
+ ,fIndex(0)
+ ,fBufType(-1)
+ ,fNelems(-1)
+ ,fCurrentIdx1(0)
+ ,fCurrentIdx2(0)
+ ,fCurrentIndex(0)
{
//
// Creates a AliTRDdataArray with the dimensions <nrow>, <ncol>, and <ntime>.
// The row- and column dimensions are compressible.
//
- fIndex = 0;
-
Allocate(nrow,ncol,ntime);
}
//_____________________________________________________________________________
-AliTRDdataArray::AliTRDdataArray(const AliTRDdataArray &d):AliTRDsegmentID(d)
+AliTRDdataArray::AliTRDdataArray(const AliTRDdataArray &d)
+ :AliTRDsegmentID(d)
+ ,fNrow(d.fNrow)
+ ,fNcol(d.fNcol)
+ ,fNtime(d.fNtime)
+ ,fNdim1(d.fNdim1)
+ ,fNdim2(d.fNdim2)
+ ,fIndex(d.fIndex)
+ ,fBufType(d.fBufType)
+ ,fNelems(d.fNelems)
+ ,fCurrentIdx1(0)
+ ,fCurrentIdx2(0)
+ ,fCurrentIndex(0)
{
//
// AliTRDdataArray copy constructor
//
- ((AliTRDdataArray &) d).Copy(*this);
-
}
//_____________________________________________________________________________
}
//_____________________________________________________________________________
-void AliTRDdataArray::Allocate(Int_t nrow, Int_t ncol,Int_t ntime)
+void AliTRDdataArray::Allocate(Int_t nrow, Int_t ncol, Int_t ntime)
{
//
// Allocates memory for a AliTRDdataArray with the dimensions
//
if (nrow <= 0) {
- Error("AliTRDdataArray::Allocate","The number of rows has to be positive");
+ AliError("The number of rows has to be positive");
exit(1);
}
if (ncol <= 0) {
- Error("AliTRDdataArray::Allocate","The number of columns has to be positive");
+ AliError("The number of columns has to be positive");
exit(1);
}
if (ntime <= 0) {
- Error("AliTRDdataArray::Allocate","The number of timebins has to be positive");
+ AliError("The number of timebins has to be positive");
exit(1);
}
}
//_____________________________________________________________________________
-Bool_t AliTRDdataArray::CheckBounds(const char *where, Int_t idx1, Int_t idx2)
+Bool_t AliTRDdataArray::CheckBounds(Int_t idx1, Int_t idx2)
{
//
// Does the boundary checking
//
if ((idx2 >= fNdim2) || (idx2 < 0))
- return OutOfBoundsError(where,idx1,idx2);
+ return OutOfBoundsError(idx1,idx2);
Int_t index = (*fIndex).At(idx2) + idx1;
if ((index < 0) || (index > fNelems))
- return OutOfBoundsError(where,idx1,idx2);
+ return OutOfBoundsError(idx1,idx2);
return kTRUE;
}
//_____________________________________________________________________________
-Bool_t AliTRDdataArray::OutOfBoundsError(const char *where, Int_t idx1, Int_t idx2)
+Bool_t AliTRDdataArray::OutOfBoundsError(Int_t idx1, Int_t idx2)
{
//
// Generate an out-of-bounds error. Always returns false.
//
- TObject::Error(where, "idx1 %d idx2 %d out of bounds (size: %d x %d, this: 0x%08x)"
- ,idx1,idx2,fNdim1,fNdim2,this);
+ AliError(Form("idx1 %d idx2 %d out of bounds (size: %d x %d, this: 0x%08x)"
+ ,idx1,idx2,fNdim1,fNdim2,this));
return kFALSE;
//
if (row >= fNrow) {
- TObject::Error("GetIdx1"
- ,"row %d out of bounds (size: %d, this: 0x%08x)"
- ,row,fNrow,this);
+ AliError(Form("row %d out of bounds (size: %d, this: 0x%08x)",row,fNrow,this));
return -1;
}
if (col >= fNcol) {
- TObject::Error("GetIdx1"
- ,"col %d out of bounds (size: %d, this: 0x%08x)"
- ,col,fNcol,this);
+ AliError(Form("col %d out of bounds (size: %d, this: 0x%08x)",col,fNcol,this));
return -1;
}
//
if (time > fNtime) {
- TObject::Error("GetIdx1"
- ,"time %d out of bounds (size: %d, this: 0x%08x)"
- ,time,fNtime,this);
+ AliError(Form("time %d out of bounds (size: %d, this: 0x%08x)",time,fNtime,this));
return -1;
}
Int_t GetIdx1(Int_t row, Int_t col) const;
inline Int_t GetIdx1Unchecked(Int_t row, Int_t col) const
{ return row + col * fNrow; };
- inline Bool_t CheckBounds(const char *where, Int_t idx1, Int_t idx2);
- inline Bool_t OutOfBoundsError(const char *where, Int_t idx1, Int_t idx2);
+ inline Bool_t CheckBounds(Int_t idx1, Int_t idx2);
+ inline Bool_t OutOfBoundsError(Int_t idx1, Int_t idx2);
Int_t fNrow; // Number of rows of the detector segement
Int_t fNcol; // Number of columns of the detector segment
// //
///////////////////////////////////////////////////////////////////////////////
+#include "AliLog.h"
+
#include "AliTRDdataArrayF.h"
#include "AliTRDarrayI.h"
#include "AliTRDarrayF.h"
ClassImp(AliTRDdataArrayF)
//_____________________________________________________________________________
-AliTRDdataArrayF::AliTRDdataArrayF():AliTRDdataArray()
+AliTRDdataArrayF::AliTRDdataArrayF()
+ :AliTRDdataArray()
+ ,fElements(0)
+ ,fThreshold(0)
{
//
// Default constructor
//
- fElements = 0;
-
}
//_____________________________________________________________________________
AliTRDdataArrayF::AliTRDdataArrayF(Int_t nrow, Int_t ncol, Int_t ntime)
- :AliTRDdataArray(nrow,ncol,ntime)
+ :AliTRDdataArray(nrow,ncol,ntime)
+ ,fElements(0)
+ ,fThreshold(0)
{
//
// Creates a AliTRDdataArrayF with the dimensions <nrow>, <ncol>, and <ntime>.
// The row- and column dimensions are compressible.
//
- fElements = 0;
-
Allocate(nrow,ncol,ntime);
}
//_____________________________________________________________________________
-AliTRDdataArrayF::AliTRDdataArrayF(const AliTRDdataArrayF &a):AliTRDdataArray(a)
+AliTRDdataArrayF::AliTRDdataArrayF(const AliTRDdataArrayF &a)
+ :AliTRDdataArray(a)
+ ,fElements(a.fElements)
+ ,fThreshold(a.fThreshold)
{
//
// AliTRDdataArrayF copy constructor
//
- ((AliTRDdataArrayF &) a).Copy(*this);
-
}
//_____________________________________________________________________________
}
else {
if (idx1 >= 0) {
- TObject::Error("GetData"
- ,"time %d out of bounds (size: %d, this: 0x%08x)"
- ,time,fNdim2,this);
+ AliError(Form("time %d out of bounds (size: %d, this: 0x%08x)"
+ ,time,fNdim2,this));
}
}
}
//
if (fBufType < 0) {
- Error("AliTRDdataArrayF::Compress","Buffer does not exist");
+ AliError("Buffer does not exist");
return;
}
if (fBufType == bufferType) {
Expand();
}
if (fBufType !=0) {
- Error("AliTRDdataArrayF::Compress","Buffer does not exist");
+ AliError("Buffer does not exist");
return;
}
//
if (fBufType < 0) {
- Error("AliTRDdataArrayF::Expand","Buffer does not exist");
+ AliError("Buffer does not exist");
return;
}
if (fBufType == 0) {
}
else {
if (idx1 >= 0) {
- TObject::Error("SetData"
- ,"time %d out of bounds (size: %d, this: 0x%08x)"
- ,time,fNdim2,this);
+ AliError(Form("time %d out of bounds (size: %d, this: 0x%08x)"
+ ,time,fNdim2,this));
}
}
}
protected:
- void SetDataFast(Int_t idx1, Int_t idx2, Float_t v);
- Float_t GetDataFast(Int_t idx1, Int_t idx2) const;
+ void SetDataFast(Int_t idx1, Int_t idx2, Float_t v);
+ Float_t GetDataFast(Int_t idx1, Int_t idx2) const;
Float_t GetData1(Int_t idx1, Int_t idx2) const;
void Expand1();
// //
///////////////////////////////////////////////////////////////////////////////
+#include "AliLog.h"
+
#include "AliTRDdataArrayI.h"
#include "AliTRDarrayI.h"
ClassImp(AliTRDdataArrayI)
//_____________________________________________________________________________
-AliTRDdataArrayI::AliTRDdataArrayI():AliTRDdataArray()
+AliTRDdataArrayI::AliTRDdataArrayI()
+ :AliTRDdataArray()
+ ,fElements(0)
+ ,fThreshold(0)
{
//
// Default constructor
//
- fElements = 0;
-
}
//_____________________________________________________________________________
AliTRDdataArrayI::AliTRDdataArrayI(Int_t nrow, Int_t ncol, Int_t ntime)
- :AliTRDdataArray(nrow,ncol,ntime)
+ :AliTRDdataArray(nrow,ncol,ntime)
+ ,fElements(0)
+ ,fThreshold(0)
{
//
// Creates a AliTRDdataArrayI with the dimensions <nrow>, <ncol>, and <ntime>.
// The row- and column dimensions are compressible.
//
- fElements = 0;
-
Allocate(nrow,ncol,ntime);
}
//_____________________________________________________________________________
-AliTRDdataArrayI::AliTRDdataArrayI(const AliTRDdataArrayI &a):AliTRDdataArray(a)
+AliTRDdataArrayI::AliTRDdataArrayI(const AliTRDdataArrayI &a)
+ :AliTRDdataArray(a)
+ ,fElements(a.fElements)
+ ,fThreshold(a.fThreshold)
{
//
// AliTRDdataArrayI copy constructor
//
- ((AliTRDdataArrayI &) a).Copy(*this);
-
}
//_____________________________________________________________________________
}
else {
if (idx1 >= 0) {
- TObject::Error("GetData"
- ,"time %d out of bounds (size: %d, this: 0x%08x)"
- ,time,fNdim2,this);
+ AliError(Form("time %d out of bounds (size: %d, this: 0x%08x)"
+ ,time,fNdim2,this));
}
}
}
//
if (fBufType < 0) {
- Error("AliTRDdataArrayI::Compress","Buffer does not exist");
+ AliError("Buffer does not exist");
return;
}
if (fBufType == bufferType) {
Expand();
}
if (fBufType !=0) {
- Error("AliTRDdataArrayI::Compress","Buffer does not exist");
+ AliError("Buffer does not exist");
return;
}
//
if (fBufType < 0) {
- Error("AliTRDdataArrayI::Expand","Buffer does not exist");
+ AliError("Buffer does not exist");
return;
}
if (fBufType == 0) {
}
else {
if (idx1 >= 0) {
- TObject::Error("SetData"
- ,"time %d out of bounds (size: %d, this: 0x%08x)"
- ,time,fNdim2,this);
+ AliError(Form("time %d out of bounds (size: %d, this: 0x%08x)"
+ ,time,fNdim2,this));
}
}
}
protected:
- void SetDataFast(Int_t idx1, Int_t idx2, Int_t value);
- Int_t GetDataFast(Int_t idx1, Int_t idx2) const;
+ void SetDataFast(Int_t idx1, Int_t idx2, Int_t value);
+ Int_t GetDataFast(Int_t idx1, Int_t idx2) const;
Int_t GetData1(Int_t idx1, Int_t idx2) const;
void Expand1();
const UInt_t AliTRDdigit::fgkRawDigit = 0x00000001;
//_____________________________________________________________________________
-AliTRDdigit::AliTRDdigit():AliDigitNew()
+AliTRDdigit::AliTRDdigit()
+ :AliDigitNew()
+ ,fRow(0)
+ ,fCol(0)
+ ,fTime(0)
{
//
// Default constructor
//
- fRow = 0;
- fCol = 0;
- fTime = 0;
-
}
//_____________________________________________________________________________
-AliTRDdigit::AliTRDdigit(Bool_t isRaw, Int_t *digits, Int_t *amp):AliDigitNew()
+AliTRDdigit::AliTRDdigit(Bool_t isRaw, Int_t *digits, Int_t *amp)
+ :AliDigitNew()
+ ,fRow(0)
+ ,fCol(0)
+ ,fTime(0)
{
//
// Create a TRD digit
protected:
- static const UInt_t fgkRawDigit; // Marks a raw digit
+ static const UInt_t fgkRawDigit; // Marks a raw digit
- UShort_t fRow; // Pad row number
- UShort_t fCol; // Pad col number
- UShort_t fTime; // Time bucket
+ UShort_t fRow; // Pad row number
+ UShort_t fCol; // Pad col number
+ UShort_t fTime; // Time bucket
- ClassDef(AliTRDdigit,2) // Digit for the TRD
+ ClassDef(AliTRDdigit,2) // Digit for the TRD
};
#include <TFile.h>
#include "AliRun.h"
+#include "AliLog.h"
#include "AliTRDdigitsManager.h"
#include "AliTRDsegmentArray.h"
const Int_t AliTRDdigitsManager::fgkNDict = kNDict;
//_____________________________________________________________________________
-AliTRDdigitsManager::AliTRDdigitsManager():TObject()
+AliTRDdigitsManager::AliTRDdigitsManager()
+ :TObject()
+ ,fEvent(0)
+ ,fTree(0)
+ ,fDigits(0)
+ ,fIsRaw(0)
+ ,fSDigits(0)
{
//
// Default constructor
//
- fIsRaw = kFALSE;
- fEvent = 0;
- fDebug = 0;
- fSDigits = 0;
-
- fTree = NULL;
- fDigits = NULL;
for (Int_t iDict = 0; iDict < kNDict; iDict++) {
fDictionary[iDict] = NULL;
}
//_____________________________________________________________________________
AliTRDdigitsManager::AliTRDdigitsManager(const AliTRDdigitsManager &m)
-:TObject(m)
+ :TObject(m)
+ ,fEvent(m.fEvent)
+ ,fTree(0)
+ ,fDigits(0)
+ ,fIsRaw(m.fIsRaw)
+ ,fSDigits(m.fSDigits)
{
//
// AliTRDdigitsManager copy constructor
//
- ((AliTRDdigitsManager &) m).Copy(*this);
-
}
//_____________________________________________________________________________
}
+//_____________________________________________________________________________
+AliTRDdigitsManager &AliTRDdigitsManager::operator=(const AliTRDdigitsManager &m)
+{
+ //
+ // Assignment operator
+ //
+
+ if (this != &m) ((AliTRDdigitsManager &) m).Copy(*this);
+ return *this;
+
+}
+
//_____________________________________________________________________________
void AliTRDdigitsManager::Copy(TObject &m) const
{
((AliTRDdigitsManager &) m).fIsRaw = fIsRaw;
((AliTRDdigitsManager &) m).fEvent = fEvent;
- ((AliTRDdigitsManager &) m).fDebug = fDebug;
((AliTRDdigitsManager &) m).fSDigits = fSDigits;
TObject::Copy(m);
TBranch* branch = fTree->GetBranch("TRDdigits");
if (!branch) fTree->Branch("TRDdigits",kDigits->IsA()->GetName(),
&kDigits,buffersize,99);
- if (fDebug > 0) {
- printf("<AliTRDdigitsManager::MakeBranch> ");
- printf("Making branch TRDdigits\n");
- }
+ AliDebug(1,"Making branch TRDdigits\n");
}
else {
status = kFALSE;
TBranch* branch = fTree->GetBranch(branchname);
if (!branch) fTree->Branch(branchname,kDictionary->IsA()->GetName(),
&kDictionary,buffersize,99);
- if (fDebug > 0) {
- printf("<AliTRDdigitsManager::MakeBranch> ");
- printf("Making branch %s\n",branchname);
- }
+ AliDebug(1,Form("Making branch %s\n",branchname));
}
else {
status = kFALSE;
}
if (!fDigits) {
- if (fDebug > 0) {
- printf("<AliTRDdigitsManager::ReadDigits> ");
- printf("Create the data arrays.\n");
- }
+ AliDebug(1,"Create the data arrays.\n");
CreateArrays();
}
// Store the contents of the segment array in the tree
if (!fDigits->StoreArray("TRDdigits",fTree)) {
- printf("<AliTRDdigitsManager::WriteDigits> ");
- printf("Error while storing digits in branch TRDdigits\n");
+ AliError("Error while storing digits in branch TRDdigits\n");
return kFALSE;
}
for (Int_t iDict = 0; iDict < kNDict; iDict++) {
Char_t branchname[15];
sprintf(branchname,"TRDdictionary%d",iDict);
if (!fDictionary[iDict]->StoreArray(branchname,fTree)) {
- printf("<AliTRDdigitsManager::WriteDigits> ");
- printf("Error while storing dictionary in branch %s\n",branchname);
+ AliError(Form("Error while storing dictionary in branch %s\n",branchname));
return kFALSE;
}
}
// Write the new tree to the output file
- //fTree->Write();
fTree->AutoSave(); // Modification by Jiri
return kTRUE;
//
if ((track < 0) || (track >= kNDict)) {
- TObject::Error("GetTracks"
- ,"track %d out of bounds (size: %d, this: 0x%08x)"
- ,track,kNDict,this);
+ AliError(Form("track %d out of bounds (size: %d, this: 0x%08x)"
+ ,track,kNDict,this));
return -1;
}
return GetTrack(track,row,col,time,det);
}
-
-//_____________________________________________________________________________
-AliTRDdigitsManager &AliTRDdigitsManager::operator=(const AliTRDdigitsManager &m)
-{
- //
- // Assignment operator
- //
-
- if (this != &m) ((AliTRDdigitsManager &) m).Copy(*this);
- return *this;
-
-}
virtual void SetRaw();
virtual void SetEvent(Int_t evt) { fEvent = evt; };
- virtual void SetDebug(Int_t v = 1) { fDebug = v; };
virtual void SetSDigits(Int_t v = 1) { fSDigits = v; };
virtual Bool_t IsRaw() const { return fIsRaw; };
Bool_t fIsRaw; // Flag indicating raw digits
Bool_t fSDigits; // Switch for the summable digits
- Int_t fDebug; // Debug flag
- ClassDef(AliTRDdigitsManager,4) // Manages the TRD digits
+ ClassDef(AliTRDdigitsManager,5) // Manages the TRD digits
};
///////////////////////////////////////////////////////////////////////////////
-#include <TError.h>
#include <TGeoManager.h>
#include <TGeoPhysicalNode.h>
#include <TGeoMatrix.h>
-
+#include "AliLog.h"
#include "AliRunLoader.h"
-#include "AliTRDgeometry.h"
-#include "AliTRDpadPlane.h"
-
#include "AliAlignObj.h"
#include "AliAlignObjAngles.h"
#include "AliTRD.h"
#include "AliTRDcalibDB.h"
#include "AliTRDCommonParam.h"
+#include "AliTRDgeometry.h"
+#include "AliTRDpadPlane.h"
ClassImp(AliTRDgeometry)
fgkTime0Base + 5 * (Cheight() + Cspace()) };
//_____________________________________________________________________________
-AliTRDgeometry::AliTRDgeometry():AliGeometry()
+AliTRDgeometry::AliTRDgeometry()
+ :AliGeometry()
+ ,fMatrixArray(0)
+ ,fMatrixCorrectionArray(0)
+ ,fMatrixGeo(0)
+
{
//
// AliTRDgeometry default constructor
//
- fMatrixArray = 0;
- fMatrixCorrectionArray = 0;
+ Init();
+
+}
+
+//_____________________________________________________________________________
+AliTRDgeometry::AliTRDgeometry(const AliTRDgeometry &g)
+ :AliGeometry(g)
+ ,fMatrixArray(g.fMatrixArray)
+ ,fMatrixCorrectionArray(g.fMatrixCorrectionArray)
+ ,fMatrixGeo(g.fMatrixGeo)
+
+{
+ //
+ // AliTRDgeometry copy constructor
+ //
Init();
}
+//_____________________________________________________________________________
+AliTRDgeometry &AliTRDgeometry::operator=(const AliTRDgeometry &g)
+{
+ //
+ // Assignment operator
+ //
+
+ if (this != &g) Init();
+ return *this;
+
+}
+
//_____________________________________________________________________________
void AliTRDgeometry::Init()
{
gMC->Matrix(matrix[2], 0.0, 0.0, 90.0, 90.0, 90.0, 0.0);
AliTRDCommonParam* commonParam = AliTRDCommonParam::Instance();
- if (!commonParam)
- {
- AliError("Could not get common params\n");
+ if (!commonParam) {
+ AliError("Could not get common parameters\n");
return;
}
//
AliTRDCommonParam* commonParam = AliTRDCommonParam::Instance();
- if (!commonParam)
+ if (!commonParam) {
+ AliError("Could not get common parameters\n");
return kFALSE;
+ }
AliTRDcalibDB* calibration = AliTRDcalibDB::Instance();
- if (!calibration)
+ if (!calibration) {
+ AliError("Could not get calibration data\n");
return kFALSE;
+ }
AliTRDpadPlane *padPlane = commonParam->GetPadPlane(iplan,icham);
if (!runLoader) runLoader = AliRunLoader::GetRunLoader();
if (!runLoader) {
- ::Error("AliTRDgeometry::GetGeometry", "No run loader");
+ //AliError("No run loader");
return NULL;
}
AliTRD * trd = (AliTRD*)runLoader->GetAliRun()->GetDetector("TRD");
geom = trd->GetGeometry();
}
- if (!geom) ::Error("AliTRDgeometry::GetGeometry", "Geometry not found");
+ if (!geom) {
+ //AliError("Geometry not found");
+ return NULL;
+ }
saveDir->cd();
return geom;
Int_t lid = GetDetector(iLayerTRD,ichamber,isector);
//
- // local geo system z-x-y to x-y--z
+ // Local geo system z-x-y to x-y--z
//
fMatrixGeo->AddAt(new TGeoHMatrix(*m),lid);
///////////////////////////////////////////////////////////////////////////////
#include "AliGeometry.h"
+
#include "TObjArray.h"
+
class AliRunLoader;
class TGeoHMatrix;
enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540, kNdets = 30 };
AliTRDgeometry();
+ AliTRDgeometry(const AliTRDgeometry &g);
virtual ~AliTRDgeometry();
+ AliTRDgeometry &operator=(const AliTRDgeometry &g);
virtual void CreateGeometry(Int_t *idtmed);
virtual Int_t IsVersion() { return 1; };
void CreateServices(Int_t *idtmed);
Bool_t ReadGeoMatrices();
- TGeoHMatrix * GetGeoMatrix(Int_t det) { return (TGeoHMatrix *) fMatrixGeo->At(det); }
- TGeoHMatrix * GetMatrix(Int_t det) { return (TGeoHMatrix *) fMatrixArray->At(det); }
- TGeoHMatrix * GetCorrectionMatrix(Int_t det){ return (TGeoHMatrix *) fMatrixCorrectionArray->At(det); }
+ TGeoHMatrix *GetGeoMatrix(Int_t det) { return (TGeoHMatrix *) fMatrixGeo->At(det); }
+ TGeoHMatrix *GetMatrix(Int_t det) { return (TGeoHMatrix *) fMatrixArray->At(det); }
+ TGeoHMatrix *GetCorrectionMatrix(Int_t det) { return (TGeoHMatrix *) fMatrixCorrectionArray->At(det); }
static Int_t Nsect() { return fgkNsect; };
static Int_t Nplan() { return fgkNplan; };
static Float_t RpadW() { return fgkRpadW; };
static Float_t CpadW() { return fgkCpadW; };
- //void SetSMstatus(Int_t sm, Char_t status) { sm += 5; if (sm > 17) sm -= 18;
- // fSMstatus[sm] = status; };
void SetSMstatus(Int_t sm, Char_t status) { fSMstatus[sm] = status; };
virtual Bool_t IsHole(Int_t /*iplan*/, Int_t /*icham*/, Int_t /*isect*/) const { return kFALSE; };
virtual Int_t GetChamber(Int_t d) const;
virtual Int_t GetSector(Int_t d) const;
- //Char_t GetSMstatus(Int_t sm) const { sm += 5; if (sm > 17) sm -= 18;
- // return fSMstatus[sm]; };
Char_t GetSMstatus(Int_t sm) const { return fSMstatus[sm]; };
Float_t GetChamberWidth(Int_t p) const { return fCwidth[p]; };
Float_t GetChamberLength(Int_t p, Int_t c) const { return fClength[p][c]; };
protected:
- static const Int_t fgkNsect; // Number of sectors in the full detector (18)
- static const Int_t fgkNplan; // Number of planes of the TRD (6)
- static const Int_t fgkNcham; // Number of chambers in z-direction (5)
- static const Int_t fgkNdet; // Total number of detectors (18 * 6 * 5 = 540)
-
- static const Float_t fgkRmin; // Minimal radius of the TRD
- static const Float_t fgkRmax; // Maximal radius of the TRD
-
- static const Float_t fgkZmax1; // Half-length of the TRD at outer radius
- static const Float_t fgkZmax2; // Half-length of the TRD at inner radius
-
- static const Float_t fgkSheight; // Height of the TRD-volume in spaceframe (BTR1-3)
- static const Float_t fgkSwidth1; // Lower width of the TRD-volume in spaceframe (BTR1-3)
- static const Float_t fgkSwidth2; // Upper width of the TRD-volume in spaceframe (BTR1-3)
- static const Float_t fgkSlenTR1; // Length of the TRD-volume in spaceframe (BTR1)
- static const Float_t fgkSlenTR2; // Length of the TRD-volume in spaceframe (BTR2)
- static const Float_t fgkSlenTR3; // Length of the TRD-volume in spaceframe (BTR3)
-
- static const Float_t fgkSMpltT; // Thickness of the super module side plates
- //static const Float_t fgkSMgapT; // Thickness of the gap between side plates and space frame
-
- static const Float_t fgkCraH; // Height of the radiator part of the chambers
- static const Float_t fgkCdrH; // Height of the drift region of the chambers
- static const Float_t fgkCamH; // Height of the amplification region of the chambers
- static const Float_t fgkCroH; // Height of the readout of the chambers
- static const Float_t fgkCH; // Total height of the chambers
-
- static const Float_t fgkVspace; // Vertical spacing of the chambers
- static const Float_t fgkHspace; // Horizontal spacing of the chambers
- static const Float_t fgkVrocsm; // Radial distance of the first ROC to the outer plates of the SM
- static const Float_t fgkCalT; // Thickness of the lower aluminum frame
- static const Float_t fgkCclsT; // Thickness of the lower G10 frame sides
- static const Float_t fgkCclfT; // Thickness of the lower G10 frame front
- static const Float_t fgkCcuT; // Thickness of the upper G10 frame
- static const Float_t fgkCauT; // Thickness of the upper aluminum frame
-
- static const Float_t fgkCroW; // Additional width of the readout chamber frames
-
- static const Float_t fgkCpadW; // Difference of outer chamber width and pad plane width
- static const Float_t fgkRpadW; // Difference of outer chamber width and pad plane width
-
- static const Float_t fgkRaThick; // Thickness of the radiator
- static const Float_t fgkMyThick; // Thickness of the mylar-layer
- static const Float_t fgkXeThick; // Thickness of the gas volume
- static const Float_t fgkDrThick; // Thickness of the drift region
- static const Float_t fgkAmThick; // Thickness of the amplification region
- static const Float_t fgkCuThick; // Thickness of the pad plane
- static const Float_t fgkSuThick; // Thickness of the HEXCEL+G10 support structure
- static const Float_t fgkFeThick; // Thickness of the FEE + signal lines
- static const Float_t fgkCoThick; // Thickness of the PE of the cooling device
- static const Float_t fgkWaThick; // Thickness of the cooling water
- static const Float_t fgkRpThick; // Thickness of the PCB readout boards
- static const Float_t fgkRcThick; // Thickness of the PCB copper layers
-
- static const Float_t fgkRaZpos; // Position of the radiator
- static const Float_t fgkMyZpos; // Position of the mylar-layer
- static const Float_t fgkDrZpos; // Position of the drift region
- static const Float_t fgkAmZpos; // Position of the amplification region
- static const Float_t fgkCuZpos; // Position of the pad plane
- static const Float_t fgkSuZpos; // Position of the HEXCEL+G10 support structure
- static const Float_t fgkFeZpos; // Position of the FEE + signal lines
- static const Float_t fgkCoZpos; // Position of the PE of the cooling device
- static const Float_t fgkWaZpos; // Position of the cooling water
- static const Float_t fgkRpZpos; // Position of the PCB readout boards
- static const Float_t fgkRcZpos; // Position of the PCB copper layers
-
- Char_t fSMstatus[kNsect]; // Super module status byte
-
- Float_t fCwidth[kNplan]; // Outer widths of the chambers
- Float_t fClength[kNplan][kNcham]; // Outer lengths of the chambers
-
- Float_t fRotA11[kNsect]; // Matrix elements for the rotation
- Float_t fRotA12[kNsect]; // Matrix elements for the rotation
- Float_t fRotA21[kNsect]; // Matrix elements for the rotation
- Float_t fRotA22[kNsect]; // Matrix elements for the rotation
-
- Float_t fRotB11[kNsect]; // Matrix elements for the backward rotation
- Float_t fRotB12[kNsect]; // Matrix elements for the backward rotation
- Float_t fRotB21[kNsect]; // Matrix elements for the backward rotation
- Float_t fRotB22[kNsect]; // Matrix elements for the backward rotation
-
- static const Double_t fgkTime0Base; // Base value for calculation of Time-position of pad 0
- static const Float_t fgkTime0[kNplan]; // Time-position of pad 0
+ static const Int_t fgkNsect; // Number of sectors in the full detector (18)
+ static const Int_t fgkNplan; // Number of planes of the TRD (6)
+ static const Int_t fgkNcham; // Number of chambers in z-direction (5)
+ static const Int_t fgkNdet; // Total number of detectors (18 * 6 * 5 = 540)
+
+ static const Float_t fgkRmin; // Minimal radius of the TRD
+ static const Float_t fgkRmax; // Maximal radius of the TRD
+
+ static const Float_t fgkZmax1; // Half-length of the TRD at outer radius
+ static const Float_t fgkZmax2; // Half-length of the TRD at inner radius
+
+ static const Float_t fgkSheight; // Height of the TRD-volume in spaceframe (BTR1-3)
+ static const Float_t fgkSwidth1; // Lower width of the TRD-volume in spaceframe (BTR1-3)
+ static const Float_t fgkSwidth2; // Upper width of the TRD-volume in spaceframe (BTR1-3)
+ static const Float_t fgkSlenTR1; // Length of the TRD-volume in spaceframe (BTR1)
+ static const Float_t fgkSlenTR2; // Length of the TRD-volume in spaceframe (BTR2)
+ static const Float_t fgkSlenTR3; // Length of the TRD-volume in spaceframe (BTR3)
+
+ static const Float_t fgkSMpltT; // Thickness of the super module side plates
+
+ static const Float_t fgkCraH; // Height of the radiator part of the chambers
+ static const Float_t fgkCdrH; // Height of the drift region of the chambers
+ static const Float_t fgkCamH; // Height of the amplification region of the chambers
+ static const Float_t fgkCroH; // Height of the readout of the chambers
+ static const Float_t fgkCH; // Total height of the chambers
+
+ static const Float_t fgkVspace; // Vertical spacing of the chambers
+ static const Float_t fgkHspace; // Horizontal spacing of the chambers
+ static const Float_t fgkVrocsm; // Radial distance of the first ROC to the outer plates of the SM
+ static const Float_t fgkCalT; // Thickness of the lower aluminum frame
+ static const Float_t fgkCclsT; // Thickness of the lower G10 frame sides
+ static const Float_t fgkCclfT; // Thickness of the lower G10 frame front
+ static const Float_t fgkCcuT; // Thickness of the upper G10 frame
+ static const Float_t fgkCauT; // Thickness of the upper aluminum frame
+
+ static const Float_t fgkCroW; // Additional width of the readout chamber frames
+
+ static const Float_t fgkCpadW; // Difference of outer chamber width and pad plane width
+ static const Float_t fgkRpadW; // Difference of outer chamber width and pad plane width
+
+ static const Float_t fgkRaThick; // Thickness of the radiator
+ static const Float_t fgkMyThick; // Thickness of the mylar-layer
+ static const Float_t fgkXeThick; // Thickness of the gas volume
+ static const Float_t fgkDrThick; // Thickness of the drift region
+ static const Float_t fgkAmThick; // Thickness of the amplification region
+ static const Float_t fgkCuThick; // Thickness of the pad plane
+ static const Float_t fgkSuThick; // Thickness of the HEXCEL+G10 support structure
+ static const Float_t fgkFeThick; // Thickness of the FEE + signal lines
+ static const Float_t fgkCoThick; // Thickness of the PE of the cooling device
+ static const Float_t fgkWaThick; // Thickness of the cooling water
+ static const Float_t fgkRpThick; // Thickness of the PCB readout boards
+ static const Float_t fgkRcThick; // Thickness of the PCB copper layers
+
+ static const Float_t fgkRaZpos; // Position of the radiator
+ static const Float_t fgkMyZpos; // Position of the mylar-layer
+ static const Float_t fgkDrZpos; // Position of the drift region
+ static const Float_t fgkAmZpos; // Position of the amplification region
+ static const Float_t fgkCuZpos; // Position of the pad plane
+ static const Float_t fgkSuZpos; // Position of the HEXCEL+G10 support structure
+ static const Float_t fgkFeZpos; // Position of the FEE + signal lines
+ static const Float_t fgkCoZpos; // Position of the PE of the cooling device
+ static const Float_t fgkWaZpos; // Position of the cooling water
+ static const Float_t fgkRpZpos; // Position of the PCB readout boards
+ static const Float_t fgkRcZpos; // Position of the PCB copper layers
+
+ Char_t fSMstatus[kNsect]; // Super module status byte
+
+ Float_t fCwidth[kNplan]; // Outer widths of the chambers
+ Float_t fClength[kNplan][kNcham]; // Outer lengths of the chambers
+
+ Float_t fRotA11[kNsect]; // Matrix elements for the rotation
+ Float_t fRotA12[kNsect]; // Matrix elements for the rotation
+ Float_t fRotA21[kNsect]; // Matrix elements for the rotation
+ Float_t fRotA22[kNsect]; // Matrix elements for the rotation
+
+ Float_t fRotB11[kNsect]; // Matrix elements for the backward rotation
+ Float_t fRotB12[kNsect]; // Matrix elements for the backward rotation
+ Float_t fRotB21[kNsect]; // Matrix elements for the backward rotation
+ Float_t fRotB22[kNsect]; // Matrix elements for the backward rotation
+
+ static const Double_t fgkTime0Base; // Base value for calculation of Time-position of pad 0
+ static const Float_t fgkTime0[kNplan]; // Time-position of pad 0
- Float_t fChamberUAorig[3*kNdets][3]; // Volumes origin in
- Float_t fChamberUDorig[3*kNdets][3]; // the chamber
- Float_t fChamberUForig[3*kNdets][3]; // [3] = x, y, z
- Float_t fChamberUUorig[3*kNdets][3]; //
+ Float_t fChamberUAorig[3*kNdets][3]; // Volumes origin in
+ Float_t fChamberUDorig[3*kNdets][3]; // the chamber
+ Float_t fChamberUForig[3*kNdets][3]; // [3] = x, y, z
+ Float_t fChamberUUorig[3*kNdets][3]; //
- Float_t fChamberUAboxd[3*kNdets][3]; // Volumes box
- Float_t fChamberUDboxd[3*kNdets][3]; // dimensions (half)
- Float_t fChamberUFboxd[3*kNdets][3]; // [3] = x, y, z
- Float_t fChamberUUboxd[3*kNdets][3]; //
+ Float_t fChamberUAboxd[3*kNdets][3]; // Volumes box
+ Float_t fChamberUDboxd[3*kNdets][3]; // dimensions (half)
+ Float_t fChamberUFboxd[3*kNdets][3]; // [3] = x, y, z
+ Float_t fChamberUUboxd[3*kNdets][3]; //
- TObjArray * fMatrixArray; //! array of matrix - Transformation Global to Local
- TObjArray * fMatrixCorrectionArray; //! array of Matrix - Transformation Cluster to Tracking systerm
- TObjArray * fMatrixGeo; //! geo matrices
+ TObjArray * fMatrixArray; //! array of matrix - Transformation Global to Local
+ TObjArray * fMatrixCorrectionArray; //! array of Matrix - Transformation Cluster to Tracking systerm
+ TObjArray * fMatrixGeo; //! geo matrices
- ClassDef(AliTRDgeometry,10) // TRD geometry class
+ ClassDef(AliTRDgeometry,10) // TRD geometry class
};
ClassImp(AliTRDpadPlane)
//_____________________________________________________________________________
-AliTRDpadPlane::AliTRDpadPlane():TObject()
+AliTRDpadPlane::AliTRDpadPlane()
+ :TObject()
+ ,fGeo(0)
+ ,fPla(0)
+ ,fCha(0)
+ ,fLength(0)
+ ,fWidth(0)
+ ,fLengthRim(0)
+ ,fWidthRim(0)
+ ,fLengthOPad(0)
+ ,fWidthOPad(0)
+ ,fLengthIPad(0)
+ ,fWidthIPad(0)
+ ,fRowSpacing(0)
+ ,fColSpacing(0)
+ ,fNrows(0)
+ ,fNcols(0)
+ ,fTiltingAngle(0)
+ ,fTiltingTan(0)
+ ,fPadRow(0)
+ ,fPadCol(0)
{
//
// Default constructor
//
- fGeo = 0;
-
- fPla = 0;
- fCha = 0;
-
- fLength = 0.0;
- fWidth = 0.0;
- fLengthRim = 0.0;
- fWidthRim = 0.0;
- fLengthOPad = 0.0;
- fWidthOPad = 0.0;
- fLengthIPad = 0.0;
- fWidthIPad = 0.0;
-
- fRowSpacing = 0.0;
- fColSpacing = 0.0;
-
- fNrows = 0;
- fNcols = 0;
-
- fPadRow = 0;
- fPadCol = 0;
-
- fTiltingAngle = 0.0;
- fTiltingTan = 0.0;
-
}
//_____________________________________________________________________________
-AliTRDpadPlane::AliTRDpadPlane(Int_t p, Int_t c):TObject(),fPadRow(0),fPadCol(0)
+AliTRDpadPlane::AliTRDpadPlane(Int_t p, Int_t c)
+ :TObject()
+ ,fGeo(0)
+ ,fPla(0)
+ ,fCha(0)
+ ,fLength(0)
+ ,fWidth(0)
+ ,fLengthRim(0)
+ ,fWidthRim(0)
+ ,fLengthOPad(0)
+ ,fWidthOPad(0)
+ ,fLengthIPad(0)
+ ,fWidthIPad(0)
+ ,fRowSpacing(0)
+ ,fColSpacing(0)
+ ,fNrows(0)
+ ,fNcols(0)
+ ,fTiltingAngle(0)
+ ,fTiltingTan(0)
+ ,fPadRow(0)
+ ,fPadCol(0)
{
//
// Constructor that initializes a given pad plane type
}
//_____________________________________________________________________________
-AliTRDpadPlane::AliTRDpadPlane(const AliTRDpadPlane &p):TObject(p)
+AliTRDpadPlane::AliTRDpadPlane(const AliTRDpadPlane &p)
+ :TObject(p)
+ ,fGeo(0)
+ ,fPla(p.fPla)
+ ,fCha(p.fCha)
+ ,fLength(p.fLength)
+ ,fWidth(p.fWidth)
+ ,fLengthRim(p.fLengthRim)
+ ,fWidthRim(p.fLengthRim)
+ ,fLengthOPad(p.fLengthOPad)
+ ,fWidthOPad(p.fWidthOPad)
+ ,fLengthIPad(p.fLengthIPad)
+ ,fWidthIPad(p.fWidthIPad)
+ ,fRowSpacing(p.fRowSpacing)
+ ,fColSpacing(p.fColSpacing)
+ ,fNrows(p.fNrows)
+ ,fNcols(p.fNcols)
+ ,fTiltingAngle(p.fTiltingAngle)
+ ,fTiltingTan(p.fTiltingTan)
+ ,fPadRow(0)
+ ,fPadCol(0)
{
//
// AliTRDpadPlane copy constructor
//
- ((AliTRDpadPlane &) p).Copy(*this);
+ Int_t iBin = 0;
+
+ if (((AliTRDpadPlane &) p).fPadRow) delete [] ((AliTRDpadPlane &) p).fPadRow;
+ ((AliTRDpadPlane &) p).fPadRow = new Double_t[fNrows];
+ for (iBin = 0; iBin < fNrows; iBin++) {
+ ((AliTRDpadPlane &) p).fPadRow[iBin] = fPadRow[iBin];
+ }
+
+ if (((AliTRDpadPlane &) p).fPadCol) delete [] ((AliTRDpadPlane &) p).fPadCol;
+ ((AliTRDpadPlane &) p).fPadCol = new Double_t[fNrows];
+ for (iBin = 0; iBin < fNrows; iBin++) {
+ ((AliTRDpadPlane &) p).fPadCol[iBin] = fPadCol[iBin];
+ }
}
//_____________________________________________________________________________
Int_t AliTRDpadPlane::GetPadColNumber(Double_t rphi
- , Double_t /*rowOffset*/) const
+ , Double_t /*rowOffset*/) const
{
//
// Finds the pad column number for a given global rphi-position
// into the opposite direction
//
-
rphiShift = rphi ;
if ((rphiShift > GetCol0()) || (rphiShift < GetColEnd())) {
#include <Riostream.h>
+#include "AliDAQ.h"
+#include "AliRawDataHeader.h"
+#include "AliRawReader.h"
+#include "AliLog.h"
+
#include "AliTRDrawData.h"
#include "AliTRDdigitsManager.h"
#include "AliTRDgeometry.h"
#include "AliTRDdataArrayI.h"
#include "AliTRDRawStream.h"
-#include "AliRawDataHeader.h"
-#include "AliRawReader.h"
#include "AliTRDCommonParam.h"
#include "AliTRDcalibDB.h"
-#include "AliDAQ.h"
ClassImp(AliTRDrawData)
// Default constructor
//
- fDebug = 0;
-
-}
-
-//_____________________________________________________________________________
-AliTRDrawData::AliTRDrawData(const AliTRDrawData &r):TObject()
-{
- //
- // AliTRDrawData copy constructor
- //
-
- ((AliTRDrawData &) r).Copy(*this);
-
}
//_____________________________________________________________________________
}
-//_____________________________________________________________________________
-AliTRDrawData &AliTRDrawData::operator=(const AliTRDrawData &r)
-{
- //
- // Assignment operator
- //
-
- if (this != &r) ((AliTRDrawData &) r).Copy(*this);
- return *this;
-
-}
-
-//_____________________________________________________________________________
-void AliTRDrawData::Copy(TObject &r) const
-{
- //
- // Copy function
- //
-
- ((AliTRDrawData &) r).fDebug = fDebug;
-
-}
-
//_____________________________________________________________________________
Bool_t AliTRDrawData::Digits2Raw(TTree *digitsTree)
{
unsigned char *headerPtr;
AliTRDdigitsManager* digitsManager = new AliTRDdigitsManager();
- digitsManager->SetDebug(fDebug);
// Read in the digit arrays
if (!digitsManager->ReadDigits(digitsTree)) {
AliTRDdataArrayI *digits;
AliTRDCommonParam* commonParam = AliTRDCommonParam::Instance();
- if (!commonParam)
- {
- printf("<AliTRDrawData::Digits2Raw> ");
- printf("Could not get common params\n");
+ if (!commonParam) {
+ AliError("Could not get common parameters\n");
return 0;
}
AliTRDcalibDB* calibration = AliTRDcalibDB::Instance();
if (!calibration)
{
- printf("<AliTRDdigitizer::Digits2Raw> ");
- printf("Could not get calibration object\n");
+ AliError("Could not get calibration object\n");
return kFALSE;
}
nbyte++;
}
- if (fDebug > 1) {
- Info("Digits2Raw","det = %d, nbyte = %d (%d)",det,nbyte,bufferMax);
- }
+ AliDebug(1,Form("det = %d, nbyte = %d (%d)",det,nbyte,bufferMax));
// Write the subevent header
bytePtr = (unsigned char *) headerSubevent;
}
- if (fDebug) {
- for (Int_t iDDL = 0; iDDL < kNumberOfDDLs; iDDL++) {
- Info("Digits2Raw","Total size: DDL %d = %d",iDDL,ntotalbyte[iDDL]);
- }
- }
-
// Update the data headers and close the output files
for (Int_t iDDL = 0; iDDL < kNumberOfDDLs; iDDL++) {
+
header.fSize = UInt_t(outputFile[iDDL]->tellp()) - bHPosition[iDDL];
header.SetAttribute(0); // valid data
outputFile[iDDL]->seekp(bHPosition[iDDL]);
outputFile[iDDL]->close();
delete outputFile[iDDL];
+
}
delete geo;
delete [] bHPosition;
delete [] ntotalbyte;
-
-
-
return kTRUE;
}
AliTRDgeometry *geo = new AliTRDgeometry();
AliTRDCommonParam* commonParam = AliTRDCommonParam::Instance();
- if (!commonParam)
- {
- printf("<AliTRDrawData::Raw2Digits> ");
- printf("Could not get common params\n");
+ if (!commonParam) {
+ AliError("Could not get common parameters\n");
return 0;
}
AliTRDcalibDB* calibration = AliTRDcalibDB::Instance();
- if (!calibration)
- {
- printf("<AliTRDdigitizer::Raw2Digits> ");
- printf("Could not get calibration object\n");
+ if (!calibration) {
+ AliError("Could not get calibration object\n");
return 0;
}
// Create the digits manager
AliTRDdigitsManager* digitsManager = new AliTRDdigitsManager();
- digitsManager->SetDebug(fDebug);
digitsManager->CreateArrays();
AliTRDRawStream input(rawReader);
if (track1) track1->Compress(1,0);
if (track2) track2->Compress(1,0);
- if (fDebug > 2) {
- Info("Raw2Digits","Subevent header:");
- Info("Raw2Digits","\tdet = %d",det);
- Info("Raw2Digits","\tnpads = %d",npads);
- }
+ AliDebug(2,"Subevent header:");
+ AliDebug(2,Form("\tdet = %d",det));
+ AliDebug(2,Form("\tnpads = %d",npads));
// Create the data buffer
Int_t cham = geo->GetChamber(det);
public:
AliTRDrawData();
- AliTRDrawData(const AliTRDrawData &r);
virtual ~AliTRDrawData();
- AliTRDrawData &operator=(const AliTRDrawData &r);
-
- virtual void Copy(TObject &r) const;
virtual Bool_t Digits2Raw(TTree *digits);
virtual AliTRDdigitsManager* Raw2Digits(AliRawReader* rawReader);
- virtual void SetDebug(Int_t v = 1) { fDebug = v; };
protected:
- Int_t fDebug; // Debug level
-
- ClassDef(AliTRDrawData,1) // TRD raw data class
+ ClassDef(AliTRDrawData,2) // TRD raw data class
};
#endif
// //
///////////////////////////////////////////////////////////////////////////////
-#include "AliTRDsegmentArrayBase.h"
#include <TROOT.h>
#include <TTree.h>
#include <TClonesArray.h>
#include <TError.h>
#include <TClass.h>
+#include "AliLog.h"
+
+#include "AliTRDsegmentArrayBase.h"
#include "AliTRDarrayI.h"
#include "AliTRDsegmentID.h"
ClassImp(AliTRDsegmentArrayBase)
//_____________________________________________________________________________
-AliTRDsegmentArrayBase::AliTRDsegmentArrayBase():TNamed()
+AliTRDsegmentArrayBase::AliTRDsegmentArrayBase()
+ :TNamed()
+ ,fSegment(0)
+ ,fTreeIndex(0)
+ ,fNSegment(0)
+ ,fTree(0)
+ ,fBranch(0)
+ ,fClass(0)
{
//
// AliTRDsegmentArrayBase default constructor
//
- fNSegment = 0;
- fSegment = 0;
- fTreeIndex = 0;
- fTree = 0;
- fClass = 0;
- fBranch = 0;
-
}
//_____________________________________________________________________________
AliTRDsegmentArrayBase::AliTRDsegmentArrayBase(const char *classname, Int_t n)
+ :TNamed()
+ ,fSegment(0)
+ ,fTreeIndex(0)
+ ,fNSegment(0)
+ ,fTree(0)
+ ,fBranch(0)
+ ,fClass(0)
{
//
// Create an array of objects of <classname>. The class must inherit from
// the array.
//
- fNSegment = 0;
- fSegment = 0;
- fTreeIndex = 0;
- fTree = 0;
- fClass = 0;
- fBranch = 0;
-
SetClass(classname);
if (MakeArray(n) == kFALSE) {
//_____________________________________________________________________________
AliTRDsegmentArrayBase::AliTRDsegmentArrayBase(const AliTRDsegmentArrayBase &a)
-:TNamed(a)
+ :TNamed(a)
+ ,fSegment(a.fSegment)
+ ,fTreeIndex(a.fTreeIndex)
+ ,fNSegment(a.fNSegment)
+ ,fTree(a.fTree)
+ ,fBranch(a.fBranch)
+ ,fClass(a.fClass)
{
//
// AliTRDsegmentArrayBase copy constructor
//
-
- ((AliTRDsegmentArrayBase &) a).Copy(*this);
}
// AliTRDsegmentArrayBase destructor
//
- if (fNSegment){
+ if (fNSegment) {
fSegment->Delete();
delete fSegment;
}
- //if (fTree) delete fTree;
- if (fTreeIndex) delete fTreeIndex;
+ if (fTreeIndex) {
+ delete fTreeIndex;
+ }
}
fSegment = 0;
}
- if (!gROOT) ::Fatal("AliTRDsegmentArrayBase::AliTRDsegmentArrayBase"
- ,"ROOT system not initialized");
-
- fClass = gROOT->GetClass(classname);
- if (!fClass) {
- Error("AliTRDsegmentArrayBase","%s is not a valid class name",classname);
- return kFALSE;
- }
- if (!fClass->InheritsFrom(AliTRDsegmentID::Class())) {
- Error("AliTRDsegmentArrayBase"
- ,"%s does not inherit from AliTRDsegmentID",classname);
- return kFALSE;
- }
+ if (!gROOT) {
+ AliFatal("ROOT system not initialized");
+ exit(1);
+ }
+
+ fClass = gROOT->GetClass(classname);
+ if (!fClass) {
+ AliError(Form("%s is not a valid class name",classname));
+ return kFALSE;
+ }
+ if (!fClass->InheritsFrom(AliTRDsegmentID::Class())) {
+ AliError(Form("%s does not inherit from AliTRDsegmentID",classname));
+ return kFALSE;
+ }
- return kTRUE;
+ return kTRUE;
}
if (fClass == 0) return 0;
AliTRDsegmentID *segment = (AliTRDsegmentID *) fClass->New();
- if (segment == 0) return 0;
- return segment;
+ if (segment == 0) {
+ return 0;
+ }
+ else {
+ return segment;
+ }
}
if (fClass == 0) return kFALSE;
if (!(segment->IsA()->InheritsFrom(fClass))) {
- Error("AliTRDsegmentArrayBase","added class %s is not of proper type",
- segment->IsA()->GetName());
+ AliError(Form("added class %s is not of proper type"
+ ,segment->IsA()->GetName()));
return kFALSE;
}
fTreeIndex = new AliTRDarrayI();
fTreeIndex->Set(n);
fNSegment = n;
- if ((fSegment) && (fTreeIndex))
+ if ((fSegment) && (fTreeIndex)) {
return kTRUE;
- else
+ }
+ else {
return kFALSE;
+ }
}
// Remove a segment from the active memory
//
- //PH if ((*fSegment)[index]){
- //PH delete (*fSegment)[index]; // because problem with deleting TClonesArray
- //PH fSegment->RemoveAt(index);
- //PH }
- if (fSegment->At(index)){
+ if (fSegment->At(index)) {
delete fSegment->RemoveAt(index);
}
fTree = new TTree("Segment Tree","Tree with segments");
fBranch = fTree->Branch("Segment",psegment->IsA()->GetName(),&psegment,64000);
- if (file)
- fBranch->SetFile(file);
+ if (file) {
+ fBranch->SetFile(file);
+ }
delete psegment;
// Connect a tree from current directory
//
- if (fTree){
+ if (fTree) {
delete fTree;
fTree = 0;
fBranch = 0;
if (fTreeIndex == 0) return 0;
if (fBranch == 0) return 0;
if (index > fTreeIndex->fN) return 0;
- //PH AliTRDsegmentID *s = (AliTRDsegmentID*) (*fSegment)[index];
+
AliTRDsegmentID *s = (AliTRDsegmentID*) fSegment->At(index);
if (s == 0) s = NewSegment();
s->SetID(index);
if (s != 0) {
Int_t treeIndex = (*fTreeIndex)[index];
- if (treeIndex < 1)
+ if (treeIndex < 1) {
return 0;
- else
- treeIndex--;
+ }
+ else {
+ treeIndex--;
+ }
fBranch->SetAddress(&s);
fTree->GetEvent(treeIndex);
- //PH (*fSegment)[index] = (TObject*) s;
fSegment->AddAt((TObject*) s, index);
}
- else
+ else {
return 0;
+ }
return s;
fBranch->SetAddress(&s);
fTree->GetEvent(index);
}
- else
+ else {
return 0;
+ }
Int_t nindex = s->GetID();
ClearSegment(nindex);
- //PH (*fSegment)[nindex] = (TObject *) s;
fSegment->AddAt((TObject *) s, nindex);
return s;
//
if ((i < 0) || (i >= fNSegment)) return 0;
- //PH return (AliTRDsegmentID *)((*fSegment)[i]);
return (AliTRDsegmentID *) fSegment->At(i);
}
ClassImp(AliTRDsegmentID)
//_____________________________________________________________________________
-AliTRDsegmentID::AliTRDsegmentID():TObject()
+AliTRDsegmentID::AliTRDsegmentID()
+ :fSegmentID(0)
{
//
// AliTRDsegmentID default constructor
//
- fSegmentID = 0;
-
}
//_____________________________________________________________________________
-AliTRDsegmentID::AliTRDsegmentID(Int_t index):TObject()
+AliTRDsegmentID::AliTRDsegmentID(Int_t index)
+ :fSegmentID(index)
{
//
// Defines a detector segment
//
- fSegmentID = index;
-
}
//_____________________________________________________________________________
//
AliTRDrawData *raw = new AliTRDrawData();
- raw->SetDebug(1);
fDigitsManager = raw->Raw2Digits(rawReader);
ClassImp(AliTRDCalChamberStatus)
//_____________________________________________________________________________
-AliTRDCalChamberStatus::AliTRDCalChamberStatus():TNamed()
+AliTRDCalChamberStatus::AliTRDCalChamberStatus()
+ :TNamed()
{
//
// AliTRDCalChamberStatus default constructor
for (Int_t idet = 0; idet < kNdet; idet++) {
fStatus[idet] = 0;
}
+
}
//_____________________________________________________________________________
AliTRDCalChamberStatus::AliTRDCalChamberStatus(const Text_t *name, const Text_t *title)
- :TNamed(name,title)
+ :TNamed(name,title)
{
//
// AliTRDCalChamberStatus constructor
for (Int_t idet = 0; idet < kNdet; idet++) {
fStatus[idet] = 0;
}
+
}
///////////////////////////////////////////////////////////////////////////////
// //
-// TRD calibration class for status of supermodules //
+// TRD calibration class for the status of a readout chamber //
// //
///////////////////////////////////////////////////////////////////////////////
#include "TNamed.h"
class AliTRDCalChamberStatus : public TNamed {
- public:
- enum { kNdet = 540, kNstacks = 90, kNcham = 5, kNsect = 18 };
- enum { kInstalled = 1, kMasked = 2 };
+
+ public:
+
+ enum { kNdet = 540, kNstacks = 90, kNcham = 5, kNsect = 18 };
+ enum { kInstalled = 1, kMasked = 2 };
- AliTRDCalChamberStatus();
- AliTRDCalChamberStatus(const Text_t* name, const Text_t* title);
+ AliTRDCalChamberStatus();
+ AliTRDCalChamberStatus(const Text_t* name, const Text_t* title);
+
+ Char_t GetStatus(Int_t det) const { return fStatus[det]; };
+ void SetStatus(Int_t det, Char_t status) { fStatus[det] = status; };
+
+ Bool_t IsInstalled(Int_t sm) const { return (GetStatus(sm) & kInstalled) ? kTRUE : kFALSE; }
+ Bool_t IsMasked(Int_t sm) const { return (GetStatus(sm) & kMasked) ? kTRUE : kFALSE; }
- Char_t GetStatus(Int_t det) const { return fStatus[det]; };
- void SetStatus(Int_t det, Char_t status) { fStatus[det] = status; };
+ protected:
- Bool_t IsInstalled(Int_t sm) const { return (GetStatus(sm) & kInstalled) ? kTRUE : kFALSE; }
- Bool_t IsMasked(Int_t sm) const { return (GetStatus(sm) & kMasked) ? kTRUE : kFALSE; }
+ Char_t fStatus[kNdet]; // Status byte
- protected:
- Char_t fStatus[kNdet]; // status byte
+ ClassDef(AliTRDCalChamberStatus,1) // Defines the status of a single readout chamber
- ClassDef(AliTRDCalChamberStatus,1)
};
#endif
}
-
//_____________________________________________________________________________
AliTRDCalDet::AliTRDCalDet(const AliTRDCalDet &c):TNamed(c)
{
AliTRDCalDet();
AliTRDCalDet(const Text_t* name, const Text_t* title);
AliTRDCalDet(const AliTRDCalDet &c);
- virtual ~AliTRDCalDet();
+ virtual ~AliTRDCalDet();
AliTRDCalDet &operator=(const AliTRDCalDet &c);
- virtual void Copy(TObject &c) const;
+ virtual void Copy(TObject &c) const;
- Float_t GetValue(Int_t d) const { return fData[d]; };
- Float_t GetValue(Int_t p, Int_t c, Int_t s) const { return fData[AliTRDgeometry::GetDetector(p,c,s)]; };
+ Float_t GetValue(Int_t d) const { return fData[d]; };
+ Float_t GetValue(Int_t p, Int_t c, Int_t s) const
+ { return fData[AliTRDgeometry::GetDetector(p,c,s)]; };
- void SetValue(Int_t d, Float_t value) { fData[d] = value; };
- void SetValue(Int_t p, Int_t c, Int_t s, Float_t value) { fData[AliTRDgeometry::GetDetector(p,c,s)] = value; };
+ void SetValue(Int_t d, Float_t value) { fData[d] = value; };
+ void SetValue(Int_t p, Int_t c, Int_t s, Float_t value)
+ { fData[AliTRDgeometry::GetDetector(p,c,s)] = value; };
- protected:
+ protected:
- Float_t fData[kNdet]; //[kNdet] Data
+ Float_t fData[kNdet]; //[kNdet] Data
- ClassDef(AliTRDCalDet,1) // TRD calibration class for parameters which are saved per detector
+ ClassDef(AliTRDCalDet,1) // TRD calibration class for parameters which are saved per detector
};
ClassImp(AliTRDCalGlobals)
//_____________________________________________________________________________
-AliTRDCalGlobals::AliTRDCalGlobals():TNamed()
+AliTRDCalGlobals::AliTRDCalGlobals()
+ :TNamed()
+ ,fSamplingFrequency(0)
+ ,fNumberOfTimeBins(0)
{
//
// AliTRDCalGlobals default constructor
//
-
-
- Init();
+
}
//_____________________________________________________________________________
AliTRDCalGlobals::AliTRDCalGlobals(const Text_t *name, const Text_t *title)
- :TNamed(name,title)
+ :TNamed(name,title)
+ ,fSamplingFrequency(0)
+ ,fNumberOfTimeBins(0)
{
//
// AliTRDCalGlobals constructor
//
- Init();
-}
-
-//_____________________________________________________________________________
-void AliTRDCalGlobals::Init()
-{
- //
- // default initialization
- //
-
- fSamplingFrequency = 0;
- fNumberOfTimeBins = 0;
}
///////////////////////////////////////////////////////////////////////////////
// //
-// TRD calibration class for global TRD parameters //
+// TRD calibration class for global TRD parameters //
// //
///////////////////////////////////////////////////////////////////////////////
#include "TNamed.h"
class AliTRDCalGlobals : public TNamed {
- public:
- AliTRDCalGlobals();
- AliTRDCalGlobals(const Text_t* name, const Text_t* title);
- virtual ~AliTRDCalGlobals() {};
+
+ public:
+
+ AliTRDCalGlobals();
+ AliTRDCalGlobals(const Text_t* name, const Text_t* title);
+ virtual ~AliTRDCalGlobals() {};
- void SetSamplingFrequency(Float_t freq) { fSamplingFrequency = freq; };
- Float_t GetSamplingFrequency() const { return fSamplingFrequency; };
+ void SetSamplingFrequency(Float_t freq) { fSamplingFrequency = freq; };
+ Float_t GetSamplingFrequency() const { return fSamplingFrequency; };
- void SetNumberOfTimeBins(Int_t value) { fNumberOfTimeBins = value; };
- Int_t GetNumberOfTimeBins() const { return fNumberOfTimeBins; };
+ void SetNumberOfTimeBins(Int_t value) { fNumberOfTimeBins = value; };
+ Int_t GetNumberOfTimeBins() const { return fNumberOfTimeBins; };
- protected:
- Float_t fSamplingFrequency; // Sampling Frequency in MHz
- Int_t fNumberOfTimeBins; // Number of timebins
-
- void Init();
+ protected:
+
+ Float_t fSamplingFrequency; // Sampling Frequency in MHz
+ Int_t fNumberOfTimeBins; // Number of timebins
- ClassDef(AliTRDCalGlobals,1) // TRD calibration class for global TRD parameters
+ ClassDef(AliTRDCalGlobals,1) // TRD calibration class for global TRD parameters
+
};
#endif
///////////////////////////////////////////////////////////////////////////////
#include "AliTRDCalMCMStatus.h"
+#include "AliTRDgeometry.h"
#include "AliTRDCalSingleChamberStatus.h"
ClassImp(AliTRDCalMCMStatus)
}
-
//_____________________________________________________________________________
AliTRDCalMCMStatus::AliTRDCalMCMStatus(const AliTRDCalMCMStatus &c):TNamed(c)
{
}
TObject::Copy(c);
+
}
+//_____________________________________________________________________________
+Bool_t AliTRDCalMCMStatus::CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const
+{
+ //
+ // Checks the MCM status byte
+ //
+
+ AliTRDCalSingleChamberStatus* roc = GetCalROC(d);
+
+ if (!roc) {
+ return kFALSE;
+ }
+ else {
+ return (roc->GetStatus(col, row) & bitMask) ? kTRUE : kFALSE;
+ }
+
+}
+
+//_____________________________________________________________________________
+AliTRDCalSingleChamberStatus* AliTRDCalMCMStatus::GetCalROC(Int_t p, Int_t c, Int_t s) const
+{
+ //
+ // Returns the readout chamber of this MCM
+ //
+
+ return GetCalROC(AliTRDgeometry::GetDetector(p,c,s));
+
+}
///////////////////////////////////////////////////////////////////////////////
#include "TNamed.h"
-#include "AliTRDgeometry.h"
-#include "AliTRDCalSingleChamberStatus.h"
+
+class AliTRDCalSingleChamberStatus;
class AliTRDCalMCMStatus : public TNamed {
virtual ~AliTRDCalMCMStatus();
AliTRDCalMCMStatus &operator=(const AliTRDCalMCMStatus &c);
- virtual void Copy(TObject &c) const;
+ virtual void Copy(TObject &c) const;
+
- AliTRDCalSingleChamberStatus *GetCalROC(Int_t d) const { return fROC[d]; };
- AliTRDCalSingleChamberStatus *GetCalROC(Int_t p, Int_t c, Int_t s) const
- { return GetCalROC(AliTRDgeometry::GetDetector(p,c,s)); };
+ Bool_t IsMasked(Int_t d, Int_t col, Int_t row) const
+ { return CheckStatus(d, col, row, kMasked); };
+ Bool_t CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const;
- Bool_t IsMasked(Int_t d, Int_t col, Int_t row) const { return CheckStatus(d, col, row, kMasked); };
- inline Bool_t CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const;
+ AliTRDCalSingleChamberStatus *GetCalROC(Int_t p, Int_t c, Int_t s) const;
+ AliTRDCalSingleChamberStatus *GetCalROC(Int_t d) const
+ { return fROC[d]; };
protected:
};
-Bool_t AliTRDCalMCMStatus::CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const
-{
- AliTRDCalSingleChamberStatus* roc = GetCalROC(d);
- if (!roc)
- return kFALSE;
-
- return (roc->GetStatus(col, row) & bitMask) ? kTRUE : kFALSE;
-}
-
#endif
///////////////////////////////////////////////////////////////////////////////
// //
-// TRD calibration class for global TRD parameters //
+// TRD calibration class for monitoring data //
// //
///////////////////////////////////////////////////////////////////////////////
ClassImp(AliTRDCalMonitoring)
//_____________________________________________________________________________
-AliTRDCalMonitoring::AliTRDCalMonitoring():TNamed()
+AliTRDCalMonitoring::AliTRDCalMonitoring()
+ :TNamed()
+ ,fDriftVelocity(0)
+ ,fGasComposition(0)
+ ,fEnvironmentTemperature(0)
{
//
// AliTRDCalMonitoring default constructor
//
-
-
- Init();
+
}
//_____________________________________________________________________________
AliTRDCalMonitoring::AliTRDCalMonitoring(const Text_t *name, const Text_t *title)
- :TNamed(name,title)
+ :TNamed(name,title)
+ ,fDriftVelocity(0)
+ ,fGasComposition(0)
+ ,fEnvironmentTemperature(0)
{
//
// AliTRDCalMonitoring constructor
//
- Init();
}
-//_____________________________________________________________________________
-void AliTRDCalMonitoring::Init()
-{
- //
- // default initialization
- //
-
-}
#include "TNamed.h"
class AliTRDCalMonitoring : public TNamed {
- public:
- AliTRDCalMonitoring();
- AliTRDCalMonitoring(const Text_t* name, const Text_t* title);
- virtual ~AliTRDCalMonitoring() {};
- //void SetSamplingFrequency(Float_t freq) { fSamplingFrequency = freq; };
- //Float_t GetSamplingFrequency() const { return fSamplingFrequency; };
+ public:
- protected:
- Int_t fADCTresholds[6700];
- Float_t fDriftVelocity; // Drift velocity from the monitor
- TString fGasComposition; // Gas composition
- Float_t fEnvironmentTemperature;
+ AliTRDCalMonitoring();
+ AliTRDCalMonitoring(const Text_t* name, const Text_t* title);
+ virtual ~AliTRDCalMonitoring() {};
- //Float_t fMCMTemperature[6700];
+ protected:
- Float_t fAnodeCurrentsMin[540];
- Float_t fAnodeCurrentsMax[540];
- Float_t fDriftCurrentsMin[540];
- Float_t fDriftCurrentsMax[540];
- Float_t fAnodeVoltagesMin[540];
- Float_t fAnodeVoltagesMax[540];
- Float_t fDriftVoltagesMin[540];
- Float_t fDriftVoltagesMax[540];
+ Int_t fADCTresholds[6700]; // Threshold voltage for ADCs
+ Float_t fDriftVelocity; // Drift velocity from the monitor
+ TString fGasComposition; // Gas composition
+ Float_t fEnvironmentTemperature; // Environment temperature
- Float_t fLVVoltage[360];
- Float_t fLVCurrent[360];
+ Float_t fAnodeCurrentsMin[540]; // Minimum anode current
+ Float_t fAnodeCurrentsMax[540]; // Maximum anode current
+ Float_t fDriftCurrentsMin[540]; // Minimum drift current
+ Float_t fDriftCurrentsMax[540]; // Maximum drift current
+ Float_t fAnodeVoltagesMin[540]; // Minimum anode voltage
+ Float_t fAnodeVoltagesMax[540]; // Maximum anode voltage
+ Float_t fDriftVoltagesMin[540]; // Minimum drift voltage
+ Float_t fDriftVoltagesMax[540]; // Maximum drift voltage
- void Init();
+ Float_t fLVVoltage[360]; // Low voltage
+ Float_t fLVCurrent[360]; // Low voltage current
+
+ ClassDef(AliTRDCalMonitoring,1) // TRD calibration class for global TRD parameters
- ClassDef(AliTRDCalMonitoring,1) // TRD calibration class for global TRD parameters
};
#endif
* provided "as is" without express or implied warranty. *
**************************************************************************/
-//-----------------------------------------------------------------
-// Class for dE/dx and Time Bin of Max. Cluster for Electrons and
-// pions in TRD.
-// It is instantiated in class AliTRDpidESD for particle identification
-// in TRD
-// Prashant Shukla <shukla@pi0.physi.uni-heidelberg.de>
-//-----------------------------------------------------------------
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Container for the distributions of dE/dx and the time bin of the //
+// max. cluster for electrons and pions //
+// //
+// Author: //
+// Prashant Shukla <shukla@pi0.physi.uni-heidelberg.de> //
+// //
+///////////////////////////////////////////////////////////////////////////////
#include <TH1F.h>
#include <TFile.h>
#include "AliLog.h"
+#include "AliPID.h"
#include "AliTRDCalPIDLQ.h"
Char_t* AliTRDCalPIDLQ::fpartName[AliPID::kSPECIES] = {"electron", "muon", "pion", "kaon", "proton"};
//_________________________________________________________________________
-AliTRDCalPIDLQ::AliTRDCalPIDLQ():
- TNamed(),
- fNMom(0),
- fTrackMomentum(0),
- fMeanChargeRatio(0),
- fNbins(0),
- fBinSize(0),
- fHistdEdx(0),
- fHistTimeBin(0)
+AliTRDCalPIDLQ::AliTRDCalPIDLQ()
+ :TNamed()
+ ,fNMom(0)
+ ,fTrackMomentum(0)
+ ,fMeanChargeRatio(0)
+ ,fNbins(0)
+ ,fBinSize(0)
+ ,fHistdEdx(0)
+ ,fHistTimeBin(0)
{
//
// The Default constructor
}
//_________________________________________________________________________
-AliTRDCalPIDLQ::AliTRDCalPIDLQ(const Text_t *name, const Text_t *title) : TNamed(name, title)
+AliTRDCalPIDLQ::AliTRDCalPIDLQ(const Text_t *name, const Text_t *title)
+ :TNamed(name,title)
+ ,fNMom(0)
+ ,fTrackMomentum(0)
+ ,fMeanChargeRatio(0)
+ ,fNbins(0)
+ ,fBinSize(0)
+ ,fHistdEdx(0)
+ ,fHistTimeBin(0)
{
//
// The main constructor
}
//_____________________________________________________________________________
-AliTRDCalPIDLQ::AliTRDCalPIDLQ(const AliTRDCalPIDLQ &c) : TNamed(c)
+AliTRDCalPIDLQ::AliTRDCalPIDLQ(const AliTRDCalPIDLQ &c)
+ :TNamed(c)
+ ,fNMom(c.fNMom)
+ ,fTrackMomentum(0)
+ ,fMeanChargeRatio(c.fMeanChargeRatio)
+ ,fNbins(c.fNbins)
+ ,fBinSize(c.fBinSize)
+ ,fHistdEdx(0)
+ ,fHistTimeBin(0)
{
//
// Copy constructor
//
- Init();
+ AliTRDCalPIDLQ& target = (AliTRDCalPIDLQ &) c;
- ((AliTRDCalPIDLQ &) c).Copy(*this);
+ target.fTrackMomentum = new Double_t[fNMom];
+ for (Int_t i=0; i<fNMom; ++i) {
+ target.fTrackMomentum[i] = fTrackMomentum[i];
+ }
+ if (fHistdEdx) {
+ target.fHistdEdx = (TObjArray*) fHistdEdx->Clone();
+ }
+
+ if (fHistTimeBin) {
+ target.fHistTimeBin = (TObjArray*) fHistTimeBin->Clone();
+ }
}
// Delets all newly created objects
//
- if (fHistdEdx)
- {
+ if (fHistdEdx) {
delete fHistdEdx;
fHistdEdx = 0;
}
- if (fHistTimeBin)
- {
+ if (fHistTimeBin) {
delete fHistTimeBin;
fHistTimeBin = 0;
}
- if (fTrackMomentum)
- {
+ if (fTrackMomentum) {
delete[] fTrackMomentum;
fTrackMomentum = 0;
}
target.CleanUp();
- target.fNMom = fNMom;
+ target.fNMom = fNMom;
+ target.fNbins = fNbins;
+ target.fBinSize = fBinSize;
+ target.fMeanChargeRatio = fMeanChargeRatio;
target.fTrackMomentum = new Double_t[fNMom];
- for (Int_t i=0; i<fNMom; ++i)
+ for (Int_t i=0; i<fNMom; ++i) {
target.fTrackMomentum[i] = fTrackMomentum[i];
-
- target.fMeanChargeRatio = fMeanChargeRatio;
-
- target.fNbins = fNbins;
- target.fBinSize = fBinSize;
+ }
- if (fHistdEdx)
+ if (fHistdEdx) {
target.fHistdEdx = (TObjArray*) fHistdEdx->Clone();
-
- if (fHistTimeBin)
+ }
+ if (fHistTimeBin) {
target.fHistTimeBin = (TObjArray*) fHistTimeBin->Clone();
-
+ }
+
TObject::Copy(c);
}
// Read histogram Root file
TFile *histFile = new TFile(responseFile, "READ");
if (!histFile || !histFile->IsOpen()) {
- TString error;
- error.Form("Opening TRD histgram file %s failed", responseFile);
- AliError(error);
+ AliError(Form("Opening TRD histgram file %s failed", responseFile));
return kFALSE;
}
gROOT->cd();
// Gets mean of de/dx dist. of e
//
- printf("Mean for particle = %s and momentum = %.2f is:\n"
- ,fpartName[k]
- ,fTrackMomentum[ip]);
- if (k < 0 || k > AliPID::kSPECIES)
+ AliInfo(Form("Mean for particle = %s and momentum = %.2f is:\n"
+ ,fpartName[k]
+ ,fTrackMomentum[ip]));
+ if (k < 0 || k > AliPID::kSPECIES) {
return 0;
-
+ }
+
return ((TH1F*) fHistdEdx->At(GetHistID(k,ip)))->GetMean();
}
// Gets Normalization of de/dx dist. of e
//
- printf("Normalization for particle = %s and momentum = %.2f is:\n"
- ,fpartName[k]
- ,fTrackMomentum[ip]);
- if (k < 0 || k > AliPID::kSPECIES)
+ AliInfo(Form("Normalization for particle = %s and momentum = %.2f is:\n"
+ ,fpartName[k]
+ ,fTrackMomentum[ip]));
+ if (k < 0 || k > AliPID::kSPECIES) {
return 0;
+ }
return ((TH1F*) fHistdEdx->At(GetHistID(k,ip)))->Integral();
// Returns one selected dEdx histogram
//
- printf("Histogram for particle = %s and momentum = %.2f is:\n"
- ,fpartName[k]
- ,fTrackMomentum[ip]);
- if (k < 0 || k > AliPID::kSPECIES)
+ AliInfo(Form("Histogram for particle = %s and momentum = %.2f is:\n"
+ ,fpartName[k]
+ ,fTrackMomentum[ip]));
+ if (k < 0 || k > AliPID::kSPECIES) {
return 0;
+ }
return (TH1F*) fHistdEdx->At(GetHistID(k,ip));
// Returns one selected time bin max histogram
//
- printf("Histogram for particle = %s and momentum = %.2f is:\n"
- ,fpartName[k]
- ,fTrackMomentum[ip]);
+ AliInfo(Form("Histogram for particle = %s and momentum = %.2f is:\n"
+ ,fpartName[k]
+ ,fTrackMomentum[ip]));
if (k < 0 || k > AliPID::kSPECIES)
return 0;
// from the precalculated de/dx distributions
//
- Double_t dedx = dedx1/fMeanChargeRatio;
- Int_t iEnBin= ((Int_t) (dedx/fBinSize+1));
+ Double_t dedx = dedx1/fMeanChargeRatio;
+ Int_t iEnBin = ((Int_t) (dedx/fBinSize+1));
if(iEnBin > fNbins) iEnBin = fNbins;
- if (k < 0 || k > AliPID::kSPECIES)
+ if (k < 0 || k > AliPID::kSPECIES) {
return 1;
+ }
TH1F* hist1 = 0;
TH1F* hist2 = 0;
Double_t mom2 = 0;
// Lower limit
- if (mom<=fTrackMomentum[0])
- {
+ if (mom<=fTrackMomentum[0]) {
hist1 = (TH1F*) fHistdEdx->At(GetHistID(k,1));
hist2 = (TH1F*) fHistdEdx->At(GetHistID(k,0));
mom1 = fTrackMomentum[1];
}
// Upper Limit
- if(mom>=fTrackMomentum[fNMom-1])
- {
+ if(mom>=fTrackMomentum[fNMom-1]) {
hist2 = (TH1F*) fHistdEdx->At(GetHistID(k,fNMom-1));
hist1 = (TH1F*) fHistdEdx->At(GetHistID(k,fNMom-2));
mom2 = fTrackMomentum[fNMom-1];
}
// In the range
- for (Int_t ip=1; ip<fNMom; ip++)
- {
- if ((fTrackMomentum[ip-1]<= mom) && (mom<fTrackMomentum[ip]))
- {
+ for (Int_t ip=1; ip<fNMom; ip++) {
+ if ((fTrackMomentum[ip-1]<= mom) && (mom<fTrackMomentum[ip])) {
hist1 = (TH1F*) fHistdEdx->At(GetHistID(k,ip));
hist2 = (TH1F*) fHistdEdx->At(GetHistID(k,ip-1));
mom1 = fTrackMomentum[ip];
// from the precalculated timbin distributions
//
- if (timbin<=0)
- return 0.;
- Int_t iTBin=timbin+1;
+ if (timbin<=0) {
+ return 0.0;
+ }
+
+ Int_t iTBin = timbin+1;
- // everything which is not electron counts as pion for time bin
- if (k != AliPID::kElectron)
+ // Everything which is not an electron counts as a pion for time bin max
+ if (k != AliPID::kElectron) {
k = AliPID::kPion;
+ }
- if (mom<=fTrackMomentum[0])
+ if (mom<=fTrackMomentum[0]) {
return ((TH1F*) fHistTimeBin->At(GetHistID(k,0)))->GetBinContent(iTBin);
-
- if (mom>=fTrackMomentum[fNMom-1])
+ }
+ if (mom>=fTrackMomentum[fNMom-1]) {
return ((TH1F*) fHistTimeBin->At(GetHistID(k,fNMom-1)))->GetBinContent(iTBin);
-
- for (Int_t ip=1; ip<fNMom; ip++)
- {
- if ((fTrackMomentum[ip-1]<= mom) && (mom<fTrackMomentum[ip]))
- {
+ }
+
+ for (Int_t ip=1; ip<fNMom; ip++) {
+ if ((fTrackMomentum[ip-1]<= mom) && (mom<fTrackMomentum[ip])) {
Double_t slop = (((TH1F*) fHistTimeBin->At(GetHistID(k,ip)))->GetBinContent(iTBin)
- ((TH1F*) fHistTimeBin->At(GetHistID(k,ip-1)))->GetBinContent(iTBin))
/ (fTrackMomentum[ip] - fTrackMomentum[ip-1]);
- // Linear Interpolation
+ // Linear interpolation
return ((TH1F*) fHistTimeBin->At(GetHistID(k,ip-1)))->GetBinContent(iTBin)
+ slop * (mom - fTrackMomentum[ip-1]);
}
#define ALITRDCALPIDLQ_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-/*-----------------------------------------------------------------
- Class for dE/dx and Time Bin of Max. Cluster for Electrons and
- pions in TRD.
- It is instantiated in class AliTRDpidESD for particle identification
- in TRD
- Prashant Shukla <shukla@pi0.physi.uni-heidelberg.de>
- -----------------------------------------------------------------*/
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Container for the distributions of dE/dx and the time bin of the //
+// max. cluster for electrons and pions //
+// //
+// Author: //
+// Prashant Shukla <shukla@pi0.physi.uni-heidelberg.de> //
+// //
+///////////////////////////////////////////////////////////////////////////////
#include <TNamed.h>
-#include <AliPID.h>
class TH1F;
class TObjArray;
class AliTRDCalPIDLQ : public TNamed {
- public:
+ public:
- AliTRDCalPIDLQ();
- AliTRDCalPIDLQ(const Text_t *name, const Text_t *title);
- AliTRDCalPIDLQ(const AliTRDCalPIDLQ& pd);
- virtual ~AliTRDCalPIDLQ();
+ AliTRDCalPIDLQ();
+ AliTRDCalPIDLQ(const Text_t *name, const Text_t *title);
+ AliTRDCalPIDLQ(const AliTRDCalPIDLQ& pd);
+ virtual ~AliTRDCalPIDLQ();
+ AliTRDCalPIDLQ &operator=(const AliTRDCalPIDLQ &c);
- AliTRDCalPIDLQ &operator=(const AliTRDCalPIDLQ &c);
- virtual void Copy(TObject &c) const;
+ virtual void Copy(TObject &c) const;
- Bool_t ReadData(Char_t *responseFile);
- void SetMeanChargeRatio(Double_t ratio) { fMeanChargeRatio = ratio; }
+ Bool_t ReadData(Char_t *responseFile);
+ void SetMeanChargeRatio(Double_t ratio) { fMeanChargeRatio = ratio; }
- Double_t GetMeanChargeRatio() const { return fMeanChargeRatio; }
- Double_t GetMomentum(Int_t ip) const { return fTrackMomentum[ip];}
- Double_t GetMean(Int_t iType, Int_t ip) const;
- Double_t GetNormalization(Int_t iType, Int_t ip) const;
+ Double_t GetMeanChargeRatio() const { return fMeanChargeRatio; }
+ Double_t GetMomentum(Int_t ip) const { return fTrackMomentum[ip]; }
+ Double_t GetMean(Int_t iType, Int_t ip) const;
+ Double_t GetNormalization(Int_t iType, Int_t ip) const;
- TH1F *GetHistogram(Int_t iType, Int_t ip) const;
- TH1F *GetHistogramT(Int_t iType, Int_t ip) const;
+ TH1F *GetHistogram(Int_t iType, Int_t ip) const;
+ TH1F *GetHistogramT(Int_t iType, Int_t ip) const;
- Double_t GetProbability(Int_t iType, Double_t mom, Double_t dedx) const;
- Double_t GetProbabilityT(Int_t iType, Double_t mom, Int_t timbin) const;
- Int_t GetNbins() const { return fNbins; }
- Double_t GetBinSize() const { return fBinSize; }
+ Double_t GetProbability(Int_t iType, Double_t mom, Double_t dedx) const;
+ Double_t GetProbabilityT(Int_t iType, Double_t mom, Int_t timbin) const;
+ Int_t GetNbins() const { return fNbins; }
+ Double_t GetBinSize() const { return fBinSize; }
- protected:
+ protected:
- void Init();
- void CleanUp();
- inline Int_t GetHistID(Int_t part, Int_t mom) const { return part*fNMom + mom; }
+ void Init();
+ void CleanUp();
+ inline Int_t GetHistID(Int_t part, Int_t mom) const { return part*fNMom + mom; }
- static Char_t *fpartName[AliPID::kSPECIES]; //! Names of particle species
+ static Char_t *fpartName[5]; //! Names of particle species
- Int_t fNMom; // Number of momenta
- Double_t *fTrackMomentum; //[fNMom] Track momenta for which response functions are available
- Double_t fMeanChargeRatio; // Ratio of mean charge from real Det. to prob. dist.
+ Int_t fNMom; // Number of momenta
+ Double_t *fTrackMomentum; //[fNMom] Track momenta for which response functions are available
+ Double_t fMeanChargeRatio; // Ratio of mean charge from real Det. to prob. dist.
- Int_t fNbins; // Number of energy bins
- Double_t fBinSize; // Size of energy bin
+ Int_t fNbins; // Number of energy bins
+ Double_t fBinSize; // Size of energy bin
- TObjArray *fHistdEdx; // Prob. of dEdx for 5 particles and for several momenta
- TObjArray *fHistTimeBin; // Prob. of max time bin for 5 particles and for several momenta
+ TObjArray *fHistdEdx; // Prob. of dEdx for 5 particles and for several momenta
+ TObjArray *fHistTimeBin; // Prob. of max time bin for 5 particles and for several momenta
- ClassDef(AliTRDCalPIDLQ, 1) // The TRD PID response container class
+ ClassDef(AliTRDCalPIDLQ, 1) // The TRD PID response container class
};
}
-
//_____________________________________________________________________________
AliTRDCalPad::AliTRDCalPad(const AliTRDCalPad &c):TNamed(c)
{
}
TObject::Copy(c);
+
}
//_____________________________________________________________________________
fROC[idet]->Scale(values->GetValue(idet));
}
}
+
}
AliTRDCalPad();
AliTRDCalPad(const Text_t* name, const Text_t* title);
AliTRDCalPad(const AliTRDCalPad &c);
- virtual ~AliTRDCalPad();
- AliTRDCalPad &operator=(const AliTRDCalPad &c);
+ virtual ~AliTRDCalPad();
+ AliTRDCalPad &operator=(const AliTRDCalPad &c);
- virtual void Copy(TObject &c) const;
+ virtual void Copy(TObject &c) const;
- static inline Int_t GetDet(Int_t p, Int_t c, Int_t s) { return p+c*kNplan+s*kNplan*kNcham; };
+ static inline Int_t GetDet(Int_t p, Int_t c, Int_t s) { return p+c*kNplan+s*kNplan*kNcham; };
- AliTRDCalROC *GetCalROC(Int_t d) const { return fROC[d]; };
- AliTRDCalROC *GetCalROC(Int_t p, Int_t c, Int_t s) const
- { return fROC[GetDet(p,c,s)]; };
+ AliTRDCalROC *GetCalROC(Int_t d) const { return fROC[d]; };
+ AliTRDCalROC *GetCalROC(Int_t p, Int_t c, Int_t s) const
+ { return fROC[GetDet(p,c,s)]; };
- void ScaleROCs(AliTRDCalDet* values);
+ void ScaleROCs(AliTRDCalDet* values);
protected:
- AliTRDCalROC *fROC[kNdet]; // Array of ROC objects which contain the values per pad
+ AliTRDCalROC *fROC[kNdet]; // Array of ROC objects which contain the values per pad
- ClassDef(AliTRDCalPad,1) // TRD calibration class for parameters which are saved per pad
+ ClassDef(AliTRDCalPad,1) // TRD calibration class for parameters which are saved per pad
};
///////////////////////////////////////////////////////////////////////////////
// //
-// TRD calibration class for MCM status //
+// TRD calibration class for the single pad status //
// //
///////////////////////////////////////////////////////////////////////////////
#include "AliTRDCalPadStatus.h"
-
+#include "AliTRDgeometry.h"
#include "AliTRDCalSingleChamberStatus.h"
ClassImp(AliTRDCalPadStatus)
//_____________________________________________________________________________
-AliTRDCalPadStatus::AliTRDCalPadStatus():TNamed()
+AliTRDCalPadStatus::AliTRDCalPadStatus()
+ :TNamed()
{
//
// AliTRDCalPadStatus default constructor
//_____________________________________________________________________________
AliTRDCalPadStatus::AliTRDCalPadStatus(const Text_t *name, const Text_t *title)
- :TNamed(name,title)
+ :TNamed(name,title)
{
//
// AliTRDCalPadStatus constructor
}
-
//_____________________________________________________________________________
-AliTRDCalPadStatus::AliTRDCalPadStatus(const AliTRDCalPadStatus &c):TNamed(c)
+AliTRDCalPadStatus::AliTRDCalPadStatus(const AliTRDCalPadStatus &c)
+ :TNamed(c)
{
//
// AliTRDCalPadStatus copy constructor
}
TObject::Copy(c);
+
}
+//_____________________________________________________________________________
+Bool_t AliTRDCalPadStatus::CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const
+{
+ //
+ // Checks the pad status
+ //
+
+ AliTRDCalSingleChamberStatus *roc = GetCalROC(d);
+ if (!roc) {
+ return kFALSE;
+ }
+ else {
+ return (roc->GetStatus(col, row) & bitMask) ? kTRUE : kFALSE;
+ }
+
+}
+
+//_____________________________________________________________________________
+AliTRDCalSingleChamberStatus* AliTRDCalPadStatus::GetCalROC(Int_t p, Int_t c, Int_t s) const
+{
+ //
+ // Returns the readout chamber of this pad
+ //
+
+ return fROC[AliTRDgeometry::GetDetector(p,c,s)];
+
+}
///////////////////////////////////////////////////////////////////////////////
// //
-// TRD calibration class for MCM status //
+// TRD calibration class for the single pad status //
// //
///////////////////////////////////////////////////////////////////////////////
#include "TNamed.h"
-#include "AliTRDgeometry.h"
-#include "AliTRDCalSingleChamberStatus.h"
+
+class AliTRDCalSingleChamberStatus;
class AliTRDCalPadStatus : public TNamed {
public:
enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 };
- enum { kMasked = 2, kPadBridgedLeft = 4, kPadBridgedRight = 8 };
+ enum { kMasked = 2, kPadBridgedLeft = 4, kPadBridgedRight = 8 };
AliTRDCalPadStatus();
AliTRDCalPadStatus(const Text_t* name, const Text_t* title);
AliTRDCalPadStatus(const AliTRDCalPadStatus &c);
- virtual ~AliTRDCalPadStatus();
+ virtual ~AliTRDCalPadStatus();
AliTRDCalPadStatus &operator=(const AliTRDCalPadStatus &c);
- virtual void Copy(TObject &c) const;
+ virtual void Copy(TObject &c) const;
- AliTRDCalSingleChamberStatus *GetCalROC(Int_t d) const { return fROC[d]; };
- AliTRDCalSingleChamberStatus *GetCalROC(Int_t p, Int_t c, Int_t s) const
- { return fROC[AliTRDgeometry::GetDetector(p,c,s)]; };
+ Bool_t IsMasked(Int_t d, Int_t col, Int_t row) const
+ { return CheckStatus(d, col, row, kMasked); };
+ Bool_t IsBridgedLeft(Int_t d, Int_t col, Int_t row) const
+ { return CheckStatus(d, col, row, kPadBridgedLeft); };
+ Bool_t IsBridgedRight(Int_t d, Int_t col, Int_t row) const
+ { return CheckStatus(d, col, row, kPadBridgedRight); };
+ Bool_t CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const;
- Bool_t IsMasked(Int_t d, Int_t col, Int_t row) const { return CheckStatus(d, col, row, kMasked); };
- Bool_t IsBridgedLeft(Int_t d, Int_t col, Int_t row) const { return CheckStatus(d, col, row, kPadBridgedLeft); };
- Bool_t IsBridgedRight(Int_t d, Int_t col, Int_t row) const { return CheckStatus(d, col, row, kPadBridgedRight); };
- inline Bool_t CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const;
+ AliTRDCalSingleChamberStatus *GetCalROC(Int_t d) const { return fROC[d]; };
+ AliTRDCalSingleChamberStatus *GetCalROC(Int_t p, Int_t c, Int_t s) const;
protected:
AliTRDCalSingleChamberStatus *fROC[kNdet]; // Array of ROC objects which contain the values per pad
- ClassDef(AliTRDCalPadStatus,1) // TRD calibration class for MCM status
+ ClassDef(AliTRDCalPadStatus,1) // TRD calibration class for the single pad status
};
-
-Bool_t AliTRDCalPadStatus::CheckStatus(Int_t d, Int_t col, Int_t row, Int_t bitMask) const
-{
- AliTRDCalSingleChamberStatus* roc = GetCalROC(d);
- if (!roc)
- return kFALSE;
-
- return (roc->GetStatus(col, row) & bitMask) ? kTRUE : kFALSE;
-}
#endif
ClassImp(AliTRDCalROC)
//_____________________________________________________________________________
-AliTRDCalROC::AliTRDCalROC():TObject()
+AliTRDCalROC::AliTRDCalROC()
+ :TObject()
+ ,fPla(0)
+ ,fCha(0)
+ ,fNrows(0)
+ ,fNcols(0)
+ ,fNchannels(0)
+ ,fData(0)
{
//
// Default constructor
//
- fPla = 0;
- fCha = 0;
-
- fNrows = 0;
- fNcols = 0;
-
- fNchannels = 0;
- fData = 0;
}
//_____________________________________________________________________________
-AliTRDCalROC::AliTRDCalROC(Int_t p, Int_t c):TObject()
+AliTRDCalROC::AliTRDCalROC(Int_t p, Int_t c)
+ :TObject()
+ ,fPla(p)
+ ,fCha(c)
+ ,fNrows(0)
+ ,fNcols(144)
+ ,fNchannels(0)
+ ,fData(0)
{
//
// Constructor that initializes a given pad plane type
//
- fPla = p;
- fCha = c;
-
- fNcols = 144;
-
//
// The pad plane parameter
//
};
fNchannels = fNrows * fNcols;
- if (fNchannels != 0)
+ if (fNchannels != 0) {
fData = new UShort_t[fNchannels];
+ }
- for (Int_t i=0; i<fNchannels; ++i)
+ for (Int_t i=0; i<fNchannels; ++i) {
fData[i] = 0;
+ }
+
}
//_____________________________________________________________________________
-AliTRDCalROC::AliTRDCalROC(const AliTRDCalROC &c):TObject(c)
+AliTRDCalROC::AliTRDCalROC(const AliTRDCalROC &c)
+ :TObject(c)
+ ,fPla(c.fPla)
+ ,fCha(c.fCha)
+ ,fNrows(c.fNrows)
+ ,fNcols(c.fNcols)
+ ,fNchannels(c.fNchannels)
+ ,fData(0)
{
//
// AliTRDCalROC copy constructor
//
- ((AliTRDCalROC &) c).Copy(*this);
+ Int_t iBin = 0;
+
+ if (((AliTRDCalROC &) c).fData) delete [] ((AliTRDCalROC &) c).fData;
+ ((AliTRDCalROC &) c).fData = new UShort_t[fNchannels];
+ for (iBin = 0; iBin < fNchannels; iBin++) {
+ ((AliTRDCalROC &) c).fData[iBin] = fData[iBin];
+ }
}
delete [] fData;
fData = 0;
}
+
}
//_____________________________________________________________________________
for (Int_t iBin = 0; iBin < fNchannels; iBin++) {
fData[iBin] = (UShort_t) (value * fData[iBin]);
}
+
}
AliTRDCalROC();
AliTRDCalROC(Int_t p, Int_t c);
AliTRDCalROC(const AliTRDCalROC &c);
- virtual ~AliTRDCalROC();
- AliTRDCalROC &operator=(const AliTRDCalROC &c);
- virtual void Copy(TObject &c) const;
+ virtual ~AliTRDCalROC();
+ AliTRDCalROC &operator=(const AliTRDCalROC &c);
+ virtual void Copy(TObject &c) const;
- Int_t GetNrows() const { return fNrows; };
- Int_t GetNcols() const { return fNcols; };
+ Int_t GetNrows() const { return fNrows; };
+ Int_t GetNcols() const { return fNcols; };
- Int_t GetChannel(Int_t c, Int_t r) { return r+c*fNrows; };
- Int_t GetNchannels() const { return fNchannels; };
+ Int_t GetChannel(Int_t c, Int_t r) { return r+c*fNrows; };
+ Int_t GetNchannels() const { return fNchannels; };
- Float_t GetValue(Int_t ich) const { return (Float_t) fData[ich] / 10000; };
- Float_t GetValue(Int_t col, Int_t row) { return GetValue(GetChannel(col,row)); };
+ Float_t GetValue(Int_t ich) const { return (Float_t) fData[ich] / 10000; };
+ Float_t GetValue(Int_t col, Int_t row) { return GetValue(GetChannel(col,row)); };
- void SetValue(Int_t ich, Float_t value) { fData[ich] = (UShort_t) (value * 10000); };
- void SetValue(Int_t col, Int_t row, Float_t value) { SetValue(GetChannel(col,row), value); };
+ void SetValue(Int_t ich, Float_t value)
+ { fData[ich] = (UShort_t) (value * 10000); };
+ void SetValue(Int_t col, Int_t row, Float_t value)
+ { SetValue(GetChannel(col,row), value); };
- void Scale(Float_t value);
+ void Scale(Float_t value);
protected:
- Int_t fPla; // Plane number
- Int_t fCha; // Chamber number
+ Int_t fPla; // Plane number
+ Int_t fCha; // Chamber number
- Int_t fNrows; // Number of rows
- Int_t fNcols; // Number of columns
+ Int_t fNrows; // Number of rows
+ Int_t fNcols; // Number of columns
- Int_t fNchannels; // Number of channels
- UShort_t *fData; //[fNchannels] Data
+ Int_t fNchannels; // Number of channels
+ UShort_t *fData; //[fNchannels] Data
ClassDef(AliTRDCalROC, 2) // TRD ROC calibration class
///////////////////////////////////////////////////////////////////////////////
// //
// Calibration base class for a single ROC //
-// Contains one char value per pad //
+// Contains one char value per pad //
// //
///////////////////////////////////////////////////////////////////////////////
ClassImp(AliTRDCalSingleChamberStatus)
//_____________________________________________________________________________
-AliTRDCalSingleChamberStatus::AliTRDCalSingleChamberStatus():TObject()
+AliTRDCalSingleChamberStatus::AliTRDCalSingleChamberStatus()
+ :TObject()
+ ,fPla(0)
+ ,fCha(0)
+ ,fNrows(0)
+ ,fNcols(0)
+ ,fNchannels(0)
+ ,fData(0)
{
//
// Default constructor
//
- fPla = 0;
- fCha = 0;
-
- fNrows = 0;
- fNcols = 0;
-
- fNchannels = 0;
- fData = 0;
}
//_____________________________________________________________________________
-AliTRDCalSingleChamberStatus::AliTRDCalSingleChamberStatus(Int_t p, Int_t c, Int_t cols):TObject()
+AliTRDCalSingleChamberStatus::AliTRDCalSingleChamberStatus(Int_t p, Int_t c, Int_t cols)
+ :TObject()
+ ,fPla(p)
+ ,fCha(c)
+ ,fNrows(0)
+ ,fNcols(cols)
+ ,fNchannels(0)
+ ,fData(0)
{
//
// Constructor that initializes a given pad plane type
//
- fPla = p;
- fCha = c;
-
- fNcols = cols;
-
//
// The pad plane parameter
//
};
fNchannels = fNrows * fNcols;
- if (fNchannels != 0)
+ if (fNchannels != 0) {
fData = new Char_t[fNchannels];
-
- for (Int_t i=0; i<fNchannels; ++i)
+ }
+ for (Int_t i=0; i<fNchannels; ++i) {
fData[i] = 0;
+ }
+
}
//_____________________________________________________________________________
-AliTRDCalSingleChamberStatus::AliTRDCalSingleChamberStatus(const AliTRDCalSingleChamberStatus &c):TObject(c)
+AliTRDCalSingleChamberStatus::AliTRDCalSingleChamberStatus(const AliTRDCalSingleChamberStatus &c)
+ :TObject(c)
+ ,fPla(c.fPla)
+ ,fCha(c.fCha)
+ ,fNrows(c.fNrows)
+ ,fNcols(c.fNcols)
+ ,fNchannels(c.fNchannels)
+ ,fData(0)
{
//
// AliTRDCalSingleChamberStatus copy constructor
//
- ((AliTRDCalSingleChamberStatus &) c).Copy(*this);
+ Int_t iBin = 0;
+
+ if (((AliTRDCalSingleChamberStatus &) c).fData) {
+ delete [] ((AliTRDCalSingleChamberStatus &) c).fData;
+ }
+ ((AliTRDCalSingleChamberStatus &) c).fData = new Char_t[fNchannels];
+ for (iBin = 0; iBin < fNchannels; iBin++) {
+ ((AliTRDCalSingleChamberStatus &) c).fData[iBin] = fData[iBin];
+ }
}
delete [] fData;
fData = 0;
}
+
}
//_____________________________________________________________________________
// Copy function
//
- ((AliTRDCalSingleChamberStatus &) c).fPla = fPla;
- ((AliTRDCalSingleChamberStatus &) c).fCha = fCha;
+ Int_t iBin = 0;
- ((AliTRDCalSingleChamberStatus &) c).fNrows = fNrows;
- ((AliTRDCalSingleChamberStatus &) c).fNcols = fNcols;
+ ((AliTRDCalSingleChamberStatus &) c).fPla = fPla;
+ ((AliTRDCalSingleChamberStatus &) c).fCha = fCha;
- Int_t iBin = 0;
+ ((AliTRDCalSingleChamberStatus &) c).fNrows = fNrows;
+ ((AliTRDCalSingleChamberStatus &) c).fNcols = fNcols;
((AliTRDCalSingleChamberStatus &) c).fNchannels = fNchannels;
- if (((AliTRDCalSingleChamberStatus &) c).fData) delete [] ((AliTRDCalSingleChamberStatus &) c).fData;
+ if (((AliTRDCalSingleChamberStatus &) c).fData) {
+ delete [] ((AliTRDCalSingleChamberStatus &) c).fData;
+ }
((AliTRDCalSingleChamberStatus &) c).fData = new Char_t[fNchannels];
for (iBin = 0; iBin < fNchannels; iBin++) {
((AliTRDCalSingleChamberStatus &) c).fData[iBin] = fData[iBin];
/* $Id: AliTRDCalSingleChamberStatus.h,v */
-//////////////////////////////////////////////////
-// //
-// TRD calibration base class containing status values for one ROC //
-// //
-//////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+// //
+// TRD calibration base class containing status values for one ROC //
+// //
+////////////////////////////////////////////////////////////////////////////
#include <TObject.h>
AliTRDCalSingleChamberStatus();
AliTRDCalSingleChamberStatus(Int_t p, Int_t c, Int_t cols);
AliTRDCalSingleChamberStatus(const AliTRDCalSingleChamberStatus &c);
- virtual ~AliTRDCalSingleChamberStatus();
- AliTRDCalSingleChamberStatus &operator=(const AliTRDCalSingleChamberStatus &c);
- virtual void Copy(TObject &c) const;
+ virtual ~AliTRDCalSingleChamberStatus();
+ AliTRDCalSingleChamberStatus &operator=(const AliTRDCalSingleChamberStatus &c);
- Int_t GetNrows() const { return fNrows; };
- Int_t GetNcols() const { return fNcols; };
+ virtual void Copy(TObject &c) const;
- Int_t GetChannel(Int_t c, Int_t r) const { return r+c*fNrows; };
- Int_t GetNchannels() const { return fNchannels; };
- Char_t GetStatus(Int_t ich) const { return fData[ich]; };
- Char_t GetStatus(Int_t col, Int_t row) const { return fData[GetChannel(col,row)]; };
+ Int_t GetNrows() const { return fNrows; };
+ Int_t GetNcols() const { return fNcols; };
- void SetStatus(Int_t ich, Char_t vd) { fData[ich] = vd; };
- void SetStatus(Int_t col, Int_t row, Char_t vd)
- { fData[GetChannel(col,row)] = vd; };
+ Int_t GetChannel(Int_t c, Int_t r) const { return r+c*fNrows; };
+ Int_t GetNchannels() const { return fNchannels; };
+ Char_t GetStatus(Int_t ich) const { return fData[ich]; };
+ Char_t GetStatus(Int_t col, Int_t row) const { return fData[GetChannel(col,row)]; };
+
+ void SetStatus(Int_t ich, Char_t vd) { fData[ich] = vd; };
+ void SetStatus(Int_t col, Int_t row, Char_t vd)
+ { fData[GetChannel(col,row)] = vd; };
protected:
- Int_t fPla; // Plane number
- Int_t fCha; // Chamber number
+ Int_t fPla; // Plane number
+ Int_t fCha; // Chamber number
- Int_t fNrows; // Number of rows
- Int_t fNcols; // Number of columns
+ Int_t fNrows; // Number of rows
+ Int_t fNcols; // Number of columns
- Int_t fNchannels; // Number of channels
- Char_t *fData; //[fNchannels] Data
+ Int_t fNchannels; // Number of channels
+ Char_t *fData; //[fNchannels] Data
- ClassDef(AliTRDCalSingleChamberStatus,1) // TRD ROC calibration class
+ ClassDef(AliTRDCalSingleChamberStatus,1) // TRD ROC calibration class
};
ClassImp(AliTRDCalSuperModuleStatus)
//_____________________________________________________________________________
-AliTRDCalSuperModuleStatus::AliTRDCalSuperModuleStatus():TNamed()
+AliTRDCalSuperModuleStatus::AliTRDCalSuperModuleStatus()
+ :TNamed()
{
//
// AliTRDCalSuperModuleStatus default constructor
for (Int_t idet = 0; idet < kNsect; idet++) {
fStatus[idet] = 0;
}
+
}
//_____________________________________________________________________________
AliTRDCalSuperModuleStatus::AliTRDCalSuperModuleStatus(const Text_t *name, const Text_t *title)
- :TNamed(name,title)
+ :TNamed(name,title)
{
//
// AliTRDCalSuperModuleStatus constructor
for (Int_t idet = 0; idet < kNsect; idet++) {
fStatus[idet] = 0;
}
+
}
#include "TNamed.h"
class AliTRDCalSuperModuleStatus : public TNamed {
- public:
- enum { kNdet = 540, kNstacks = 90, kNcham = 5, kNsect = 18 };
- enum { kInstalled = 1, kMasked = 2 };
+
+ public:
+
+ enum { kNdet = 540, kNstacks = 90, kNcham = 5, kNsect = 18 };
+ enum { kInstalled = 1, kMasked = 2 };
- AliTRDCalSuperModuleStatus();
- AliTRDCalSuperModuleStatus(const Text_t* name, const Text_t* title);
+ AliTRDCalSuperModuleStatus();
+ AliTRDCalSuperModuleStatus(const Text_t* name, const Text_t* title);
+
+ Char_t GetStatus(Int_t sm) const { return fStatus[sm]; };
+ void SetStatus(Int_t sm, Char_t status) { fStatus[sm] = status; };
+
+ Bool_t IsInstalled(Int_t sm) const { return (GetStatus(sm) & kInstalled) ? kTRUE : kFALSE; }
+ Bool_t IsMasked(Int_t sm) const { return (GetStatus(sm) & kMasked) ? kTRUE : kFALSE; }
- Char_t GetStatus(Int_t sm) const { return fStatus[sm]; };
- void SetStatus(Int_t sm, Char_t status) { fStatus[sm] = status; };
+ protected:
- Bool_t IsInstalled(Int_t sm) const { return (GetStatus(sm) & kInstalled) ? kTRUE : kFALSE; }
- Bool_t IsMasked(Int_t sm) const { return (GetStatus(sm) & kMasked) ? kTRUE : kFALSE; }
+ Char_t fStatus[kNsect]; // Status byte
- protected:
- Char_t fStatus[kNsect]; // status byte
+ ClassDef(AliTRDCalSuperModuleStatus,1) // Defines the status of a single super module
- ClassDef(AliTRDCalSuperModuleStatus,1)
};
#endif