+// AliTRDonlineTrackletFilter implements an analysis task which reads
+// the tracklets from the TRD.Tracklets.root file and makes them
+// available to other analysis tasks. This allows to access the full
+// tracklet information without repeating the techncicalities in each
+// analysis task. The tracklets are made available in an exchange
+// container on the output slot 1.
+
#include "TFile.h"
#include "TTree.h"
#include "TChain.h"
void AliTRDonlineTrackletFilter::ConnectInputData(const Option_t */* option */)
{
+ // connect all the input handlers to access the data
+
fInputHandler = (AliInputEventHandler*) AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler();
if (fInputHandler)
fInputEvent = fInputHandler->GetEvent();
void AliTRDonlineTrackletFilter::CreateOutputObjects()
{
+ // create the output objects used to make the tracklets available to
+ // other tasks
+
OpenFile(1);
fTrackletTree = new TTree("tracklets", "on-line tracklets");
Bool_t AliTRDonlineTrackletFilter::Notify()
{
+ // we use notify to figure out which TRD.Tracklets.root file we have
+ // to use for accessing the tracklets
TString filename(AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile()->GetName());
+// AliTRDonlineTrackletFilter implements an analysis task which makes
+// the TRD on-line tracklets accessible for other analysis tasks.
+
#ifndef ALITRDONLINETRACKLETFILTER
#define ALITRDONLINETRACKLETFILTER
// ----- internal use -----
AliTRDgeometry *fGeo; //! TRD geometry
- Int_t fNevent;
+ Int_t fNevent; // current event number
TString fPath; //!
TFile *fTrackletFile; //!
+// AliTRDonlineTrackletQA implements the standard QA for the TRD
+// on-line tracklets. It reads the tracklets provided by
+// AliTRDonlineTrackletFilter and analyses them. The QA can be run
+// on tracklets from simulation or from real data. In addition it is
+// possible to compare the tracklets from real data to re-simulation
+// based on the ADC data.
+
#include "TFile.h"
#include "TTree.h"
#include "TChain.h"
}
-Int_t AliTRDonlineTrackletQA::GetTrackletsForMC(Int_t /* label */, Int_t /*idx*/ [])
+Int_t AliTRDonlineTrackletQA::GetTrackletsForMC(Int_t /* label */, Int_t /*idx*/ []) const
{
// get tracklets for MC label
// not implemented
+// AliTRDonlineTrackletQA implements the standard QA for the TRD
+// on-line tracklets.
+
#ifndef ALITRDONLINETRACKLETQA_H
#define ALITRDONLINETRACKLETQA_H
void PlotESD(AliTRDtrackletWord *trkl);
- Int_t GetTrackletsForMC(Int_t label, Int_t idx[]);
+ Int_t GetTrackletsForMC(Int_t label, Int_t idx[]) const;
protected:
AliESDEvent *fESD; //! current ESD event
AliTRDTriggerL0::AliTRDTriggerL0()
{
+ // constructor
+
SetName("TRD");
}
AliTRDTriggerL0::~AliTRDTriggerL0()
{
-
+ // destructor
}
void AliTRDTriggerL0::CreateInputs()
{
+ // create the L0 inputs which are provided by the TRD
+
if (fInputs.GetEntriesFast() > 0)
return;
void AliTRDTriggerL0::Trigger()
{
+ // do the actual trigger calculation
AliRunLoader *runLoader = AliRunLoader::Instance();
if (!runLoader)
}
-Bool_t AliTRDgtuTMU::Uniquifier(TList *inlist, TList *outlist)
+Bool_t AliTRDgtuTMU::Uniquifier(const TList *inlist, TList *outlist)
{
// remove multiple occurences of the same track
Bool_t RunTrackReconstruction(TList* ListOfTracks);
Bool_t CalculateTrackParams(AliTRDtrackGTU *track);
- Bool_t Uniquifier(TList* inlist, TList *outlist);
+ Bool_t Uniquifier(const TList* inlist, TList *outlist);
Bool_t CalculatePID(AliTRDtrackGTU *track);
protected:
fTiltCorr(kFALSE),
fPidGainCorr(kFALSE)
{
-
+ // default constructor
}
AliTRDltuParam::~AliTRDltuParam()
{
-
+ // destructor
}
Int_t AliTRDltuParam::GetDyCorrection(Int_t det, Int_t rob, Int_t mcm) const
Float_t AliTRDltuParam::GetElongation(Int_t det, Int_t rob, Int_t mcm, Int_t ch) const
{
+ // calculate the ratio of the distance to the primary vertex and the
+ // distance in x-direction for the given ADC channel
+
Int_t layer = det % 6;
Float_t elongation = TMath::Abs(GetDist(det, rob, mcm, ch) / fgX[layer]);
void AliTRDltuParam::GetCorrectionFactors(Int_t det, Int_t rob, Int_t mcm, Int_t ch,
UInt_t &cor0, UInt_t &cor1, Float_t gain) const
{
+ // calculate the gain correction factors for the given ADC channel
+
if (fPidGainCorr==kFALSE)
gain=1;
Int_t AliTRDltuParam::GetNtimebins() const
{
+ // return the number of timebins used
+
return fNtimebins;
}
Float_t AliTRDltuParam::GetX(Int_t det, Int_t /* rob */, Int_t /* mcm */) const
{
+ // return the distance to the beam axis in x-direction
+
Int_t layer = det%6;
return fgX[layer];
}
Float_t AliTRDltuParam::GetLocalY(Int_t det, Int_t rob, Int_t mcm, Int_t ch) const
{
+ // get local y-position (r-phi) w.r.t. the chamber centre
+
Int_t layer = det%6;
// calculate the pad position as in the TRAP
Float_t ypos = (-4 + 1 + (rob&0x1) * 4 + (mcm&0x3)) * 18 - ch - 0.5; // y position in bins of pad widths
Float_t AliTRDltuParam::GetLocalZ(Int_t det, Int_t rob, Int_t mcm) const
{
+ // get local z-position w.r.t. to the chamber boundary
+
Int_t stack = (det%30) / 6;
Int_t layer = det % 6;
Int_t row = (rob/2) * 4 + mcm/4;
Float_t AliTRDltuParam::GetPerp(Int_t det, Int_t rob, Int_t mcm, Int_t ch) const
{
+ // get transverse distance to the beam axis
+
return TMath::Sqrt(GetLocalY(det, rob, mcm, ch)*GetLocalY(det, rob, mcm, ch) +
GetX(det, rob, mcm)*GetX(det, rob, mcm) );
}
Float_t AliTRDltuParam::GetPhi(Int_t det, Int_t rob, Int_t mcm, Int_t ch) const
{
+ // calculate the azimuthal angle for the given ADC channel
+
return TMath::ATan2(GetLocalY(det, rob, mcm, ch), GetX(det, rob, mcm));
}
Float_t AliTRDltuParam::GetDist(Int_t det, Int_t rob, Int_t mcm, Int_t ch) const
{
+ // calculate the distance from the origin for the given ADC channel
+
return TMath::Sqrt(GetLocalY(det, rob, mcm, ch)*GetLocalY(det, rob, mcm, ch) +
GetX(det, rob, mcm)*GetX(det, rob, mcm) +
GetLocalZ(det, rob, mcm)*GetLocalZ(det, rob, mcm) );
}
}
-void AliTRDmcmSim::SetData( Int_t adc, Int_t* const data )
+void AliTRDmcmSim::SetData( Int_t adc, const Int_t* const data )
{
//
// Store ADC data into array of raw data
}
}
-void AliTRDmcmSim::SetDataByPad(AliTRDarrayADC* const adcArray, AliTRDdigitsManager * const digitsManager)
+void AliTRDmcmSim::SetDataByPad(const AliTRDarrayADC* const adcArray, AliTRDdigitsManager * const digitsManager)
{
// Set the ADC data from an AliTRDarrayADC
// (by pad, to be used during initial reading in simulation)
Int_t GetDataFiltered(Int_t iadc, Int_t timebin) const { return (fADCF[iadc][timebin] >> 2); }
// Get filtered ADC data
- void SetData(Int_t iadc, Int_t *adc); // Set ADC data with array
+ void SetData(Int_t iadc, const Int_t* const adc); // Set ADC data with array
void SetData(Int_t iadc, Int_t it, Int_t adc); // Set ADC data
void SetData(AliTRDarrayADC * const adcArray,
AliTRDdigitsManager * const digitsManager = 0x0); // Set ADC data from adcArray
- void SetDataByPad(AliTRDarrayADC *const adcArray,
+ void SetDataByPad(const AliTRDarrayADC *const adcArray,
AliTRDdigitsManager * const digitsManager = 0x0); // Set ADC data from adcArray
void SetDataPedestal(Int_t iadc); // Fill ADC data with pedestal values
void WriteData(AliTRDarrayADC *digits);
Bool_t StoreTracklets(); // Stores tracklets via runloader
- TString GetTrklBranchName() { return fTrklBranchName; }
+ TString GetTrklBranchName() const { return fTrklBranchName; }
void SetTrklBranchName(TString name) { fTrklBranchName = name; }
Int_t ProduceRawStream( UInt_t *buf, Int_t bufsize, UInt_t iEv = 0 ) const; // Produce raw data stream - Real data format
AliDebug(1, DumpRaw(Form("stack %i header", stack), fPayloadCurr, fCurrStackHeaderSize[stack]));
if (fPayloadCurr - fPayloadStart >= fPayloadSize - (Int_t) fCurrStackHeaderSize[stack]) {
- EquipmentError(kStackHeaderInvalid, "Stack index header %i aborted", stack);
+ EquipmentError(kStackHeaderInvalid, "Stack index header %i incomplete", stack);
// dumping stack header
AliError(DumpRaw(Form("stack %i header", stack), fPayloadCurr, fCurrStackHeaderSize[stack]));
return kFALSE;
}
-TString AliTRDrawStream::DumpRaw(TString title, UInt_t *start, Int_t length, UInt_t endmarker)
+TString AliTRDrawStream::DumpRaw(TString title, const UInt_t *start, Int_t length, UInt_t endmarker)
{
// dump raw data
#ifndef ALITRDRAWSTREAM_H
#define ALITRDRAWSTREAM_H
-#include "TObject.h"
-#include "TClonesArray.h"
#include "TTree.h"
-
#include "AliLog.h"
+#include "TClonesArray.h"
+class TObject;
class TObjArray;
class TString;
class TBranch;
Bool_t IsDumping() const { return (fNDumpMCMs > 0); }
Bool_t DumpingMCM(Int_t det, Int_t rob, Int_t mcm) const;
- TString DumpRaw(TString title, UInt_t *start, Int_t length, UInt_t endmarker = 0xffffffff);
+ TString DumpRaw(TString title, const UInt_t *start, Int_t length, UInt_t endmarker = 0xffffffff);
TString DumpMcmHeader(TString title, UInt_t word);
TString DumpAdcMask(TString title, UInt_t word);
fResiduals(0x0),
fClsCharges(0x0)
{
+ // constructor
+
fGeo = new AliTRDgeometry();
fLabel[0] = -1;
fLabel[1] = -1;
fResiduals(0x0),
fClsCharges(0x0)
{
+ // constructor
+
fGeo = new AliTRDgeometry();
fLabel[0] = -1;
fLabel[1] = -1;
fResiduals(0x0),
fClsCharges(0x0)
{
+ // constructor
+
fGeo = new AliTRDgeometry();
fLabel[0] = -1;
fLabel[1] = -1;
fResiduals(0x0),
fClsCharges(0x0)
{
+ // copy constructor
+
fGeo = new AliTRDgeometry();
fResiduals = new Float_t[fNClusters];
fClsCharges = new Float_t[fNClusters];
AliTRDtrackletMCM::~AliTRDtrackletMCM()
{
+ // destructor
+
delete [] fResiduals;
delete [] fClsCharges;
delete fGeo;
void AliTRDtrackletMCM::SetLabel(Int_t label[])
{
+ // set the labels (up to 3)
+
fLabel[0] = label[0];
fLabel[1] = label[1];
fLabel[2] = label[2];
AliTRDtrapConfig::~AliTRDtrapConfig()
{
+ // destructor
+
for(Int_t iAddr = 0; iAddr < fgkDmemWords; iAddr++) {
if(iAddr == fgkDmemAddrDeflCorr - fgkDmemStartAddress)
delete [] fDmem[iAddr];
void AliTRDtrapConfig::ResetDmem()
{
+ // reset the data memory
+
for(Int_t iAddr = 0; iAddr < fgkDmemWords; iAddr++) {
if(fDmemDepth[iAddr] == 0)
continue;
UInt_t AliTRDtrapConfig::GetDmemUnsigned(Int_t addr) const
{
+ // get the content of the data memory at the given address
+ // (only if the value is the same for all MCMs)
+
addr = addr - fgkDmemStartAddress;
if(addr < 0 || addr >= fgkDmemWords) {
AliError(Form("No DMEM address: 0x%08x", addr+fgkDmemStartAddress));
UInt_t AliTRDtrapConfig::GetDmemUnsigned(Int_t addr, Int_t det, Int_t rob, Int_t mcm) const
{
+ // get the content of the data memory at the given address
+ // for a given MCM
+
addr = addr - fgkDmemStartAddress;
Int_t roc = det%30;
Int_t loc;
void AliTRDtrapConfig::PrintMemDatx(ostream &os, Int_t addr) const
{
+ // print the content of the data memory as datx
+
PrintMemDatx(os, addr, 0, 0, 127);
}
void AliTRDtrapConfig::PrintMemDatx(ostream &os, Int_t addr, Int_t det, Int_t rob, Int_t mcm) const
{
+ // print the content of the data memory as datx
+
if(addr < fgkDmemStartAddress || addr >= fgkDmemStartAddress+fgkDmemWords) {
AliError(Form("Invalid DMEM address 0x%08x!", addr));
return;
void AliTRDtrapConfig::PrintMemDatx(ostream &os, TrapReg_t reg) const
{
+ // print the content of the data memory as datx
+
PrintMemDatx(os, reg, 0, 0, 127);
}
void AliTRDtrapConfig::PrintMemDatx(ostream &os, TrapReg_t reg, Int_t det, Int_t rob, Int_t mcm) const
{
+ // print the content of the data memory as datx
+
if(reg>= kLastReg) {
AliError(Form("Invalid register %i!", reg));
return;
void AliTRDtrapConfig::PrintDatx(ostream &os, UInt_t addr, UInt_t data, Int_t rob, Int_t mcm) const
{
+ // print the value at the given address as datx
+
os << std::setw(5) << 10
<< std::setw(8) << addr
<< std::setw(12) << data;
Bool_t AddValues(UInt_t det, UInt_t cmd, UInt_t extali, Int_t addr, UInt_t data);
// DMEM addresses
- static const Int_t fgkDmemAddrLUTcor0 = 0xC02A;
- static const Int_t fgkDmemAddrLUTcor1 = 0xC028;
- static const Int_t fgkDmemAddrLUTnbins = 0xC029;
+ static const Int_t fgkDmemAddrLUTcor0 = 0xC02A; // address for correction factor 0
+ static const Int_t fgkDmemAddrLUTcor1 = 0xC028; // address for correction factor 1
+ static const Int_t fgkDmemAddrLUTnbins = 0xC029; // address for number of timebins
static const Int_t fgkDmemAddrLUTStart = 0xC100; // LUT start address
static const Int_t fgkDmemAddrLUTEnd = 0xC3FF; // maximum possible end address for the LUT table
UInt_t* fDmem[fgkDmemWords]; // DMEM storage
Int_t fDmemDepth[fgkDmemWords]; // memory space indicator for fDmem
- static const Int_t fgkDmemSizeEmpty=0;
- static const Int_t fgkDmemSizeUniform = 1;
+ static const Int_t fgkDmemSizeEmpty=0; // size if no value stored
+ static const Int_t fgkDmemSizeUniform = 1; // size for global values
static const Int_t fgkDmemSizeSmIndividual = 30*8*16; // storage for each MCM within one supermodule
static const Int_t fgkDmemSizeTotalIndividual = 540*6*8*16; // one individual value for each and every MCM in the TRD
static const Int_t fgkDmemSizeSmRocIndividual = 540; // one individual value for each chamber in TRD
void ConfigureNTimebins(Int_t det); // timebins in the drift region
void ConfigurePIDcorr(Int_t det); // Calculate the mcm individual correction factors for the PID
- Double_t Square(Double_t val) { return val*val; }; // returns the square of a given number
+ Double_t Square(Double_t val) const { return val*val; }; // returns the square of a given number
AliTRDtrapConfigHandler(const AliTRDtrapConfigHandler &h); // not implemented
AliTRDtrapConfigHandler &operator=(const AliTRDtrapConfigHandler &h); // not implemented