exit(1);
}
- // Save the geometry
- TDirectory *saveDir = gDirectory;
- gAlice->GetRunLoader()->CdGAFile();
- fGeometry->Write("TRDgeometry");
- saveDir->cd();
-
// Allocate the hit array
fHits = new TClonesArray("AliTRDhit",405);
gAlice->GetMCApp()->AddHitList(fHits);
- //PH SetMarkerColor(kWhite);
-
}
//_____________________________________________________________________________
#include <TFile.h>
#include <AliMathBase.h>
#include "TTreeStream.h"
+
//AliRoot includes
#include "AliRawReader.h"
#include "AliRawReaderRoot.h"
#include "AliRawReaderDate.h"
+
#include "AliTRDRawStream.h"
+#include "AliTRDarrayF.h"
+#include "AliTRDgeometry.h"
#include "./Cal/AliTRDCalROC.h"
#include "./Cal/AliTRDCalPadStatus.h"
#include "./Cal/AliTRDCalSingleChamberStatus.h"
-#include "AliTRDarrayF.h"
-#include "AliTRDCommonParam.h"
-
#ifdef ALI_DATE
#include "event.h"
//header file
#include "AliTRDCalibPadStatus.h"
-
-
ClassImp(AliTRDCalibPadStatus) /*FOLD00*/
//_____________________________________________________________________
AliTRDCalibPadStatus::AliTRDCalibPadStatus() : /*FOLD00*/
TObject(),
+ fGeo(0),
fAdcMin(0),
fAdcMax(20),
fDetector(-1),
//
// default constructor
//
+
+ fGeo = new AliTRDgeometry();
+
}
//_____________________________________________________________________
AliTRDCalibPadStatus::AliTRDCalibPadStatus(const AliTRDCalibPadStatus &ped) : /*FOLD00*/
TObject(ped),
+ fGeo(0),
fAdcMin(ped.GetAdcMin()),
fAdcMax(ped.GetAdcMax()),
fDetector(ped.fDetector),
}
}
+
+ if (fGeo) {
+ delete fGeo;
+ }
+ fGeo = new AliTRDgeometry();
+
}
+
//_____________________________________________________________________
AliTRDCalibPadStatus& AliTRDCalibPadStatus::operator = (const AliTRDCalibPadStatus &source)
{
return *this;
}
+
//_____________________________________________________________________
AliTRDCalibPadStatus::~AliTRDCalibPadStatus() /*FOLD00*/
{
//
// destructor
//
+
+ if (fGeo) {
+ delete fGeo;
+ }
+
}
+
//_____________________________________________________________________
Int_t AliTRDCalibPadStatus::Update(const Int_t icdet, /*FOLD00*/
const Int_t icRow,
// fill one oroc and one iroc with random gaus
//
- AliTRDCommonParam *comParam = AliTRDCommonParam::Instance();
- if (!comParam) {
- return 0;
- }
gRandom->SetSeed(0);
for (Int_t ism=0; ism<18; ism++){
for (Int_t ich=0; ich < 5; ich++){
for (Int_t ipl=0; ipl < 6; ipl++){
- for(Int_t irow = 0; irow < comParam->GetRowMax(ipl,ich,ism); irow++){
- for(Int_t icol = 0; icol < comParam->GetColMax(ipl); icol++){
+ for(Int_t irow = 0; irow < fGeo->GetRowMax(ipl,ich,ism); irow++){
+ for(Int_t icol = 0; icol < fGeo->GetColMax(ipl); icol++){
for (Int_t iTimeBin=0; iTimeBin<(30*nevent); iTimeBin++){
Int_t signal=(Int_t)(ich+8+gRandom->Gaus(0,1.2));
- if ( signal>0 )Update((ipl+ich*6+ism*6*5),irow,icol,signal,comParam->GetRowMax(ipl,ich,ism));
+ if ( signal>0 )Update((ipl+ich*6+ism*6*5),irow,icol,signal,fGeo->GetRowMax(ipl,ich,ism));
}
}
}
// fill one oroc and one iroc with random gaus
//
- AliTRDCommonParam *comParam = AliTRDCommonParam::Instance();
- if (!comParam) {
- return 0;
- }
gRandom->SetSeed(0);
for (Int_t ism=0; ism<18; ism++){
for (Int_t ich=0; ich < 5; ich++){
for (Int_t ipl=0; ipl < 6; ipl++){
- for(Int_t irow = 0; irow < comParam->GetRowMax(ipl,ich,ism); irow++){
- for(Int_t icol = 0; icol < comParam->GetColMax(ipl); icol++){
+ for(Int_t irow = 0; irow < fGeo->GetRowMax(ipl,ich,ism); irow++){
+ for(Int_t icol = 0; icol < fGeo->GetColMax(ipl); icol++){
for (Int_t iTimeBin=0; iTimeBin<(30*nevent); iTimeBin++){
Int_t signal=(Int_t)(ich+8+gRandom->Gaus(0,1.2));
- if ( signal>0 )UpdateHisto((ipl+ich*6+ism*6*5),irow,icol,signal,comParam->GetRowMax(ipl,ich,ism));
+ if ( signal>0 )UpdateHisto((ipl+ich*6+ism*6*5),irow,icol,signal,fGeo->GetRowMax(ipl,ich,ism));
}
}
}
sprintf(name,"hCalib%s%.2d",type,det);
sprintf(title,"%s calibration histogram detector %.2d;ADC channel;Channel (pad)",type,det);
- AliTRDCommonParam *comParam = AliTRDCommonParam::Instance();
- if (!comParam) {
- return 0x0;
- }
- Int_t nbchannels = comParam->GetRowMax(GetPlane(det),GetChamber(det),GetSector(det))*comParam->GetColMax(GetPlane(det));
+ Int_t nbchannels = fGeo->GetRowMax(GetPlane(det),GetChamber(det),GetSector(det))
+ * fGeo->GetColMax(GetPlane(det));
// new histogram with calib information. One value for each pad!
TH2F* hist = new TH2F(name,title,
// if we are forced and histogram doesn't yes exist create it
AliTRDarrayF *croc = new AliTRDarrayF();
- AliTRDCommonParam *comParam = AliTRDCommonParam::Instance();
- if (!comParam) {
- return croc;
- }
- Int_t nbpad = comParam->GetRowMax(GetPlane(det),GetChamber(det),GetSector(det))*comParam->GetColMax(GetPlane(det));
+ Int_t nbpad = fGeo->GetRowMax(GetPlane(det),GetChamber(det),GetSector(det))
+ * fGeo->GetColMax(GetPlane(det));
// new AliTRDCalROC. One value for each pad!
croc->Expand(nbpad);
class TObjArray;
class TH2F;
class TTreeSRedirector;
+
+class AliRawReader;
+
class AliTRDCalROC;
class AliTRDCalPadStatus;
class AliTRDRawStream;
class AliTRDarrayF;
-class AliRawReader;
+class AliTRDgeometry;
+
struct eventHeaderStruct;
class AliTRDCalibPadStatus : public TObject {
private:
+ // Geometry
+ AliTRDgeometry *fGeo; //! The TRD geometry
+
Int_t fAdcMin; // min adc channel of pedestal value
Int_t fAdcMax; // max adc channel of pedestal value
Int_t fDetector; // Current detector
virtual Int_t GetChamber(Int_t d) const;
virtual Int_t GetSector(Int_t d) const;
-public:
-
- ClassDef(AliTRDCalibPadStatus,1)
+ ClassDef(AliTRDCalibPadStatus,2)
};
#include "AliLog.h"
#include "AliCDBManager.h"
+#include "AliRawReader.h"
+#include "AliRawReaderDate.h"
#include "AliTRDCalibraFillHisto.h"
#include "AliTRDCalibraMode.h"
#include "AliTRDcluster.h"
#include "AliTRDtrack.h"
#include "AliTRDRawStream.h"
-#include "AliRawReader.h"
-#include "AliRawReaderDate.h"
+#include "AliTRDgeometry.h"
#ifdef ALI_DATE
#include "event.h"
#endif
-
ClassImp(AliTRDCalibraFillHisto)
AliTRDCalibraFillHisto* AliTRDCalibraFillHisto::fgInstance = 0;
//______________________________________________________________________________________
AliTRDCalibraFillHisto::AliTRDCalibraFillHisto()
:TObject()
+ ,fGeo(0)
,fMITracking(kFALSE)
,fMcmTracking(kFALSE)
,fMcmCorrectAngle(kFALSE)
fNumberUsedCh[1] = 0;
fNumberUsedPh[0] = 0;
fNumberUsedPh[1] = 0;
+
+ fGeo = new AliTRDgeometry();
}
+
//______________________________________________________________________________________
AliTRDCalibraFillHisto::AliTRDCalibraFillHisto(const AliTRDCalibraFillHisto &c)
-:TObject(c)
-,fMITracking(c.fMITracking)
-,fMcmTracking(c.fMcmTracking)
-,fMcmCorrectAngle(c.fMcmCorrectAngle)
-,fCH2dOn(c.fCH2dOn)
-,fPH2dOn(c.fPH2dOn)
-,fPRF2dOn(c.fPRF2dOn)
-,fHisto2d(c.fHisto2d)
-,fVector2d(c.fVector2d)
-,fLinearFitterOn(c.fLinearFitterOn)
-,fLinearFitterDebugOn(c.fLinearFitterDebugOn)
-,fRelativeScale(c.fRelativeScale)
-,fThresholdClusterPRF2(c.fThresholdClusterPRF2)
-,fCalibraMode(0x0)
-,fDebugStreamer(0)
-,fDebugLevel(c.fDebugLevel)
-,fDetectorAliTRDtrack(c.fDetectorAliTRDtrack)
-,fDetectorPreviousTrack(c.fDetectorPreviousTrack)
-,fNumberClusters(c.fNumberClusters)
-,fProcent(c.fProcent)
-,fDifference(c.fDifference)
-,fNumberTrack(c.fNumberTrack)
-,fTimeMax(c.fTimeMax)
-,fSf(c.fSf)
-,fNumberBinCharge(c.fNumberBinCharge)
-,fNumberBinPRF(c.fNumberBinPRF)
-,fNgroupprf(c.fNgroupprf)
-,fListClusters(new TObjArray())
-,fPar0(c.fPar0)
-,fPar1(c.fPar1)
-,fPar2(c.fPar2)
-,fPar3(c.fPar3)
-,fPar4(c.fPar4)
-,fAmpTotal(c.fAmpTotal)
-,fPHPlace(c.fPHPlace)
-,fPHValue(c.fPHValue)
-,fGoodTracklet(c.fGoodTracklet)
-,fGoodTrack(c.fGoodTrack)
-,fEntriesCH(c.fEntriesCH)
-,fEntriesLinearFitter(fEntriesLinearFitter)
-,fCalibraVector(0x0)
-,fPH2d(0x0)
-,fPRF2d(0x0)
-,fCH2d(0x0)
-,fLinearFitterArray(0)
-,fLinearFitterHistoArray(0)
+ :TObject(c)
+ ,fGeo(0)
+ ,fMITracking(c.fMITracking)
+ ,fMcmTracking(c.fMcmTracking)
+ ,fMcmCorrectAngle(c.fMcmCorrectAngle)
+ ,fCH2dOn(c.fCH2dOn)
+ ,fPH2dOn(c.fPH2dOn)
+ ,fPRF2dOn(c.fPRF2dOn)
+ ,fHisto2d(c.fHisto2d)
+ ,fVector2d(c.fVector2d)
+ ,fLinearFitterOn(c.fLinearFitterOn)
+ ,fLinearFitterDebugOn(c.fLinearFitterDebugOn)
+ ,fRelativeScale(c.fRelativeScale)
+ ,fThresholdClusterPRF2(c.fThresholdClusterPRF2)
+ ,fCalibraMode(0x0)
+ ,fDebugStreamer(0)
+ ,fDebugLevel(c.fDebugLevel)
+ ,fDetectorAliTRDtrack(c.fDetectorAliTRDtrack)
+ ,fDetectorPreviousTrack(c.fDetectorPreviousTrack)
+ ,fNumberClusters(c.fNumberClusters)
+ ,fProcent(c.fProcent)
+ ,fDifference(c.fDifference)
+ ,fNumberTrack(c.fNumberTrack)
+ ,fTimeMax(c.fTimeMax)
+ ,fSf(c.fSf)
+ ,fNumberBinCharge(c.fNumberBinCharge)
+ ,fNumberBinPRF(c.fNumberBinPRF)
+ ,fNgroupprf(c.fNgroupprf)
+ ,fListClusters(new TObjArray())
+ ,fPar0(c.fPar0)
+ ,fPar1(c.fPar1)
+ ,fPar2(c.fPar2)
+ ,fPar3(c.fPar3)
+ ,fPar4(c.fPar4)
+ ,fAmpTotal(c.fAmpTotal)
+ ,fPHPlace(c.fPHPlace)
+ ,fPHValue(c.fPHValue)
+ ,fGoodTracklet(c.fGoodTracklet)
+ ,fGoodTrack(c.fGoodTrack)
+ ,fEntriesCH(c.fEntriesCH)
+ ,fEntriesLinearFitter(fEntriesLinearFitter)
+ ,fCalibraVector(0x0)
+ ,fPH2d(0x0)
+ ,fPRF2d(0x0)
+ ,fCH2d(0x0)
+ ,fLinearFitterArray(0)
+ ,fLinearFitterHistoArray(0)
{
//
// Copy constructor
}
}
}
+ if (fGeo) {
+ delete fGeo;
+ }
+ fGeo = new AliTRDgeometry();
+
}
+
//____________________________________________________________________________________
AliTRDCalibraFillHisto::~AliTRDCalibraFillHisto()
{
ClearHistos();
if ( fDebugStreamer ) delete fDebugStreamer;
+
+ if (fGeo) {
+ delete fGeo;
+ }
}
rowcol[0] = 0;
rowcol[1] = 0;
- // Get the parameter object
- AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
- if (!parCom) {
- AliInfo("Could not get CommonParam");
- return rowcol;
- }
-
// Localisation of the detector
Int_t detector = cl->GetDetector();
Int_t chamber = GetChamber(detector);
pos[2] = cl->GetZ();
// Position of the cluster
- AliTRDpadPlane *padplane = parCom->GetPadPlane(plane,chamber);
+ AliTRDpadPlane *padplane = fGeo->GetPadPlane(plane,chamber);
Int_t row = padplane->GetPadRowNumber(pos[2]);
//Do not take from here because it was corrected from ExB already....
//Double_t offsetz = padplane->GetPadRowOffset(row,pos[2]);
// This function will be called in the functions UpdateHistogram...
// to fill the find the parameter P1 of a track for the drift velocity calibration
//
-
- // Get the parameter object
- AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
- if (!parCom) {
- AliInfo("Could not get CommonParam");
- return kFALSE;
- }
//Number of points: if less than 3 return kFALSE
Int_t Npoints = fListClusters->GetEntriesFast();
Double_t tiltingangle = 0; // tiltingangle of the pad
Float_t dzdx = 0; // dz/dx now from dz/dl
Int_t nbli = 0; // number linear fitter points
- AliTRDpadPlane *padplane = parCom->GetPadPlane(GetPlane(detector),GetChamber(detector));
+ AliTRDpadPlane *padplane = fGeo->GetPadPlane(GetPlane(detector),GetChamber(detector));
linearFitterTracklet.StoreData(kFALSE);
linearFitterTracklet.ClearPoints();
// For the offline tracking
// Fit the tracklet with a line and take the position as reference for the PRF
//
-
- // Get the parameter object
- AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
- if (!parCom) {
- AliInfo("Could not get CommonParam");
- return kFALSE;
- }
//Number of points
Int_t Npoints = fListClusters->GetEntriesFast(); // number of total points
class TLinearFitter;
class AliLog;
+class AliRawReader;
+
class AliTRDCalibraMode;
class AliTRDCalibraVector;
-
-class AliRawReader;
class AliTRDRawStream;
class AliTRDcluster;
class AliTRDtrack;
class AliTRDmcmTracklet;
+class AliTRDgeometry;
class TTreeSRedirector;
struct eventHeaderStruct;
protected:
+ // Geometry
+ AliTRDgeometry *fGeo; //! The TRD geometry
+
// Choice to fill or not the 2D
Bool_t fMITracking; // Chose to fill the 2D histos or vectors during the offline MI tracking
Bool_t fMcmTracking; // Chose to fill the 2D histos or vectors during the tracking with tracklets
static Bool_t fgTerminated; // If terminated
- ClassDef(AliTRDCalibraFillHisto,2) // TRD Calibration class
+ ClassDef(AliTRDCalibraFillHisto,3) // TRD Calibration class
};
#include "AliTRDCalibraVector.h"
#include "AliTRDcalibDB.h"
#include "AliTRDgeometry.h"
-#include "AliTRDCommonParam.h"
#include "./Cal/AliTRDCalROC.h"
#include "./Cal/AliTRDCalPad.h"
#include "./Cal/AliTRDCalDet.h"
//______________________________________________________________________________________
AliTRDCalibraFit::AliTRDCalibraFit()
:TObject()
+ ,fGeo(0)
,fWriteNameCoef(0)
,fFitPHOn(kFALSE)
,fFitPol2On(kFALSE)
// Default constructor
//
+ fGeo = new AliTRDgeometry();
fCalibraMode = new AliTRDCalibraMode();
// Write
//______________________________________________________________________________________
AliTRDCalibraFit::AliTRDCalibraFit(const AliTRDCalibraFit &c)
:TObject(c)
+ ,fGeo(0)
,fWriteNameCoef(0)
,fFitPHOn(kFALSE)
,fFitPol2On(kFALSE)
ClearTree();
+ if (fGeo) {
+ delete fGeo;
+ }
+
}
//_____________________________________________________________________________
gStyle->SetPadLeftMargin(0.13);
gStyle->SetPadRightMargin(0.01);
- // Get the parameter object
- AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
- if (!parCom) {
- AliInfo("Could not get CommonParam");
- return kFALSE;
- }
-
// Mode groups of pads: the total number of bins!
Int_t numberofbinsexpected = 0;
fCalibraMode->ModePadCalibration(2,i);
AliInfo(Form("You will see the detector: iPlane %d, iChamb %d, iSect %d"
,fDet[0],fDet[1],fDet[2]));
// A little geometry:
- Int_t rowMax = parCom->GetRowMax(fDet[0],fDet[1],fDet[2]);
- Int_t colMax = parCom->GetColMax(fDet[0]);
+ Int_t rowMax = fGeo->GetRowMax(fDet[0],fDet[1],fDet[2]);
+ Int_t colMax = fGeo->GetColMax(fDet[0]);
// Create the histos to visualise
CreateFitHistoCHDB(rowMax,colMax);
if (fDebug == 4) {
AliInfo(Form("You will see the detector: iPlane %d, iChamb %d, iSect %d"
,fDet[0],fDet[1],fDet[2]));
// A little geometry:
- Int_t rowMax = parCom->GetRowMax(fDet[0],fDet[1],fDet[2]);
- Int_t colMax = parCom->GetColMax(fDet[0]);
+ Int_t rowMax = fGeo->GetRowMax(fDet[0],fDet[1],fDet[2]);
+ Int_t colMax = fGeo->GetColMax(fDet[0]);
// Create the histos to visualise
CreateFitHistoPHDB(rowMax,colMax);
CreateFitHistoT0DB(rowMax,colMax);
AliInfo(Form("You will see the detector: iPlane %d, iChamb %d, iSect %d"
,fDet[0],fDet[1],fDet[2]));
// A little geometry:
- Int_t rowMax = parCom->GetRowMax(fDet[0],fDet[1],fDet[2]);
- Int_t colMax = parCom->GetColMax(fDet[0]);
+ Int_t rowMax = fGeo->GetRowMax(fDet[0],fDet[1],fDet[2]);
+ Int_t colMax = fGeo->GetColMax(fDet[0]);
// Create the histos to visualise
CreateFitHistoPRFDB(rowMax,colMax);
if (fDebug == 4) {
// of the calibration group, the value present in the choosen database
// will be put. A negativ sign enables to know that a fit was not possible.
//
-
- // Get the parameter object
- AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
- if (!parCom) {
- AliInfo("Could not get CommonParam Manager");
- return kFALSE;
- }
-
+
// Get cal
AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
if (!cal) {
// Pointer to the branch
for (Int_t k = fCalibraMode->GetRowMin(2); k < fCalibraMode->GetRowMax(2); k++) {
for (Int_t j = fCalibraMode->GetColMin(2); j < fCalibraMode->GetColMax(2); j++) {
- if((parCom->GetColMax(GetPlane(fCountDet[2])) != (j+1)) && (j != 0)){
+ if((fGeo->GetColMax(GetPlane(fCountDet[2])) != (j+1)) && (j != 0)){
if (GetChamber(fCountDet[2]) == 2) {
fPRFPad[(Int_t)(j*12+k)] = -fPRFCoef[1];
}
// methods from the Fit functions
//
- // Get the parameter object
- AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
- if (!parCom) {
- AliInfo("Could not get CommonParam Manager");
- return kFALSE;
- }
-
// Get cal
AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
if (!cal) {
// Pointer to the branch
for (Int_t k = fCalibraMode->GetRowMin(2); k < fCalibraMode->GetRowMax(2); k++) {
for (Int_t j = fCalibraMode->GetColMin(2); j < fCalibraMode->GetColMax(2); j++) {
- if ((parCom->GetColMax(GetPlane(fCountDet[2])) != (j+1)) && (j != 0)) {
+ if ((fGeo->GetColMax(GetPlane(fCountDet[2])) != (j+1)) && (j != 0)) {
if (GetChamber(fCountDet[2]) == 2) {
fPRFPad[(Int_t)(j*12+k)] = fPRFCoef[fFitPRFNDB];
}
AliInfo("Could not get calibDB Manager");
return kFALSE;
}
- AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
- if (!parCom) {
- AliInfo("Could not get CommonParam Manager");
- return kFALSE;
- }
fChargeCoef[3] = 0.0;
return kFALSE;
}
- AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
- if (!parCom) {
- AliInfo("Could not get CommonParam Manager");
- return kFALSE;
- }
-
fPRFCoef[1] = 0.0;
Int_t cot = 0;
for (Int_t row = fCalibraMode->GetRowMin(2); row < fCalibraMode->GetRowMax(2); row++) {
for (Int_t col = fCalibraMode->GetColMin(2); col < fCalibraMode->GetColMax(2); col++) {
- if ((parCom->GetColMax(GetPlane(dect)) != (col+1)) && (col != 0)) {
+ if ((fGeo->GetColMax(GetPlane(dect)) != (col+1)) && (col != 0)) {
cot++;
if (fAccCDB) {
fPRFCoef[1] += (Float_t) cal->GetPRFWidth(dect,col,row);
class TF1;
class AliLog;
+
class AliTRDCalibraMode;
class AliTRDCalibraVector;
class AliTRDCalDet;
+class AliTRDgeometry;
class AliTRDCalibraFit : public TObject {
protected:
+ // Geometry
+ AliTRDgeometry *fGeo; //! The TRD geometry
+
// Write
Bool_t fWriteCoef[3]; // Do you want to write the result in a file?
TString fWriteNameCoef; // Where the coef Det are written
static AliTRDCalibraFit *fgInstance; // Instance
static Bool_t fgTerminated; // If terminated
- ClassDef(AliTRDCalibraFit,1) // TRD Calibration class
+ ClassDef(AliTRDCalibraFit,2) // TRD Calibration class
};
#include "AliLog.h"
#include "AliTRDCalibraMode.h"
-#include "AliTRDCommonParam.h"
+#include "AliTRDgeometry.h"
ClassImp(AliTRDCalibraMode)
//______________________________________________________________________________________
AliTRDCalibraMode::AliTRDCalibraMode()
:TObject()
+ ,fGeo(0)
{
//
// Default constructor
fNfragRphi[i] = -1;
fXbins[i] = -1;
}
-
+
+ fGeo = new AliTRDgeometry();
+
}
//______________________________________________________________________________________
AliTRDCalibraMode::AliTRDCalibraMode(const AliTRDCalibraMode &c)
:TObject(c)
+ ,fGeo(0)
{
//
// Copy constructor
fDetChamb2[k] = c.fDetChamb2[k];
}
+ if (fGeo) {
+ delete fGeo;
+ }
+ fGeo = new AliTRDgeometry();
+
}
+
//____________________________________________________________________________________
AliTRDCalibraMode::~AliTRDCalibraMode()
{
// AliTRDCalibraMode destructor
//
+ if (fGeo) {
+ delete fGeo;
+ }
+
}
//_____________________________________________________________________________
fNfragZ[i] = 0;
fNfragRphi[i] = 0;
-
- AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
- if (!parCom) {
- AliInfo("Could not get CommonParam Manager");
- return kFALSE;
- }
// A little geometry:
- Int_t rowMax = parCom->GetRowMax(iPlane,iChamb,iSect);
- Int_t colMax = parCom->GetColMax(iPlane);
+ Int_t rowMax = fGeo->GetRowMax(iPlane,iChamb,iSect);
+ Int_t colMax = fGeo->GetColMax(iPlane);
// The fragmentation
if (fNnZ[i] != 0) {
# include <TObject.h>
#endif
+class AliTRDgeometry;
+
class AliTRDCalibraMode : public TObject {
public:
protected:
+ // Geometry
+ AliTRDgeometry *fGeo; //! The TRD geometry
+
Short_t fNz[3]; // Mode of calibration
Short_t fNrphi[3]; // Mode of calibration
Short_t fNnZ[3]; // Number of pad rows in a group
virtual Int_t GetChamber(Int_t d) const;
virtual Int_t GetSector(Int_t d) const;
- ClassDef(AliTRDCalibraMode,1) // TRD Calibration class
+ ClassDef(AliTRDCalibraMode,2) // TRD Calibration class
};
#endif
#include "AliRun.h"
#include "AliTRDCommonParam.h"
-#include "AliTRDpadPlane.h"
-
ClassImp(AliTRDCommonParam)
:TObject()
,fExBOn(kFALSE)
,fSamplingFrequency(0.0)
- ,fPadPlaneArray(0)
{
//
// Default constructor
// Sampling Frequency in MHz
fSamplingFrequency = 10.0;
-
- // ----------------------------------------------------------------------------
- // The pad planes
- // ----------------------------------------------------------------------------
-
- fPadPlaneArray = new TObjArray(kNplan * kNcham);
-
- for (Int_t iplan = 0; iplan < kNplan; iplan++) {
- for (Int_t icham = 0; icham < kNcham; icham++) {
- Int_t ipp = iplan + icham * kNplan;
- fPadPlaneArray->AddAt(new AliTRDpadPlane(iplan,icham),ipp);
- }
- }
}
// Destructor
//
- if (fPadPlaneArray) {
- fPadPlaneArray->Delete();
- delete fPadPlaneArray;
- fPadPlaneArray = 0;
- }
-
}
//_____________________________________________________________________________
:TObject(p)
,fExBOn(p.fExBOn)
,fSamplingFrequency(p.fSamplingFrequency)
- ,fPadPlaneArray(0)
{
//
// Copy constructor
target->fSamplingFrequency = fSamplingFrequency;
}
-
-//_____________________________________________________________________________
-AliTRDpadPlane *AliTRDCommonParam::GetPadPlane(Int_t p, Int_t c) const
-{
- //
- // Returns the pad plane for a given plane <p> and chamber <c> number
- //
-
- Int_t ipp = p + c * kNplan;
- return ((AliTRDpadPlane *) fPadPlaneArray->At(ipp));
-
-}
-
-//_____________________________________________________________________________
-Int_t AliTRDCommonParam::GetRowMax(Int_t p, Int_t c, Int_t /*s*/) const
-{
- //
- // Returns the number of rows on the pad plane
- //
-
- return GetPadPlane(p,c)->GetNrows();
-
-}
-
-//_____________________________________________________________________________
-Int_t AliTRDCommonParam::GetColMax(Int_t p) const
-{
- //
- // Returns the number of rows on the pad plane
- //
-
- return GetPadPlane(p,0)->GetNcols();
-
-}
-
-//_____________________________________________________________________________
-Double_t AliTRDCommonParam::GetRow0(Int_t p, Int_t c, Int_t /*s*/) const
-{
- //
- // Returns the position of the border of the first pad in a row
- //
-
- return GetPadPlane(p,c)->GetRow0();
-
-}
-
-//_____________________________________________________________________________
-Double_t AliTRDCommonParam::GetCol0(Int_t p) const
-{
- //
- // Returns the position of the border of the first pad in a column
- //
-
- return GetPadPlane(p,0)->GetCol0();
-
-}
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;
Float_t GetSamplingFrequency() const { return fSamplingFrequency; }
protected:
Float_t fSamplingFrequency; // Sampling Frequency in MHz
- TObjArray *fPadPlaneArray; //! Array of pad plane objects
-
private:
// This is a singleton, constructor is private!
AliTRDCommonParam();
- ClassDef(AliTRDCommonParam,3) // The constant parameters common to simulation and reconstruction
+ ClassDef(AliTRDCommonParam,4) // The constant parameters common to simulation and reconstruction
+
};
#endif
#include "AliRawReader.h"
#include "AliTRDRawStream.h"
#include "AliTRDgeometry.h"
-#include "AliTRDCommonParam.h"
#include "AliTRDcalibDB.h"
ClassImp(AliTRDRawStream)
,fDataWord(NULL)
,fTimeBinsCalib(0)
,fGeo(NULL)
- ,fCommonParam(NULL)
- ,fCalibration(NULL)
{
//
// Default constructor
,fDataWord(NULL)
,fTimeBinsCalib(0)
,fGeo(NULL)
- ,fCommonParam(NULL)
- ,fCalibration(NULL)
{
//
// Create an object to read TRD raw digits
,fDataWord(NULL)
,fTimeBinsCalib(0)
,fGeo(NULL)
- ,fCommonParam(NULL)
- ,fCalibration(NULL)
{
//
// Copy constructor
//
// Destructor
//
-
- delete fGeo;
+
+ if (fGeo) {
+ delete fGeo;
+ }
+
}
//_____________________________________________________________________________
fRawReader = rawReader;
}
}
+
//_____________________________________________________________________________
Bool_t AliTRDRawStream::SetRawVersion(Int_t rv)
{
// Initialization
//
- fCommonParam = AliTRDCommonParam::Instance();
- if (!fCommonParam) {
- AliError("Could not get common parameters");
- return 0;
- }
-
- fCalibration = AliTRDcalibDB::Instance();
- if (!fCalibration) {
+ if (!AliTRDcalibDB::Instance()) {
AliError("Could not get calibration object");
return 0;
}
- if (!fGeo)
- {
- fGeo = new AliTRDgeometry();
- }
+ if (!fGeo) {
+ fGeo = new AliTRDgeometry();
+ }
- fTimeBinsCalib = fCalibration->GetNumberOfTimeBins();
+ fTimeBinsCalib = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
AliDebug(2, Form("Number of Timebins read from CDB: %d", fTimeBinsCalib));
// The number of data words needed for this number of time bins (there
{ // HC header
DecodeHCheader(fTimeBinsCalib); // This is the new header!
fDET = fGeo->GetDetector(fLAYER, fSTACK, fSM);
- fRowMax = fCommonParam->GetRowMax(fLAYER,fSTACK,fSM);
- fColMax = fCommonParam->GetColMax(fROC);
+ fRowMax = fGeo->GetRowMax(fLAYER,fSTACK,fSM);
+ fColMax = fGeo->GetColMax(fROC);
fMCMHctr2 = 0;
fHCdataCtr = 0;
class AliTRDgeometry;
class AliRawReader;
-class AliTRDCommonParam;
-class AliTRDcalibDB;
// Some constants:
const UInt_t kEndoftrackletmarker = 0xAAAAAAAA; /*This marks the end of tracklet data words*/
Bool_t fADCmask[21]; // Mask of active ADCs for zero suppression
UShort_t fChamberDone[540]; // Chamber was processed already (1=1HC, 2=full chamber)
- Int_t fRetVal; // Datadecode return
- Int_t fEqID; // Equipment id
- UInt_t fDataSize; // Size of the data available in the current buffer
- Bool_t fSizeOK; // Did we read anything
+ Int_t fRetVal; // Datadecode return
+ Int_t fEqID; // Equipment id
+ UInt_t fDataSize; // Size of the data available in the current buffer
+ Bool_t fSizeOK; // Did we read anything
UInt_t fCountBytes; // Bytes traversed in the buffer
UInt_t fBufSize; // Size of the current RawReader buffer
Bool_t fkBufferSet; // Is the RawReader buffer available
- UChar_t *fPos; // Position in the buffer of the RawReader
- UInt_t *fDataWord; // The pointer to the current 32 bit data word
+ UChar_t *fPos; // Position in the buffer of the RawReader
+ UInt_t *fDataWord; // The pointer to the current 32 bit data word
UInt_t fTimeBinsCalib; // N of time bins retrieved from calibration
enum ETRDzRawStreamError {
AliTRDgeometry *fGeo; // TRD geometry
- AliTRDCommonParam *fCommonParam;
- AliTRDcalibDB *fCalibration;
-
void DecodeHCheader(Int_t timeBins);
-
void DecodeMCMheader();
-
void DecodeTracklet();
-
void DecodeGTUlinkMask();
-
Int_t DecodeDataWord();
Int_t DecodeDataWordV1V2(); // Valid for fRawversion = 1, 2, ...
Int_t DecodeDataWordV3(); // Valid for fRawversion = 3, ...
enum { fkStart, fkStop, fkWordOK, fkNoMoreData, fkNextSM, fkNextHC, fkSeekNonEoTracklet, fkDecodeHC, fkNextMCM, fkNextData, fkReading};
- ClassDef(AliTRDRawStream, 4) // Class for reading TRD raw digits
+ ClassDef(AliTRDRawStream, 5) // Class for reading TRD raw digits
};
#endif
#include "AliTRDclusterizerV1.h"
#include "AliTRDtracker.h"
#include "AliTRDpidESD.h"
-#include "AliTRDtrigger.h"
-#include "AliTRDtrigParam.h"
#include "AliTRDgtuTrack.h"
#include "AliTRDrawData.h"
#include "AliTRDdigitsManager.h"
loader->UnloadRecPoints();
- //
- // Trigger (tracklets, LTU)
- //
-// loader->LoadTracks();
-// if (loader->TreeT()) {
-// AliError("Tracklets already exist");
-// return;
-// }
-// AliInfo("Trigger tracklets will be produced");
-
-// AliTRDtrigger trdTrigger("Trigger","Trigger class");
-
-// AliTRDtrigParam *trigp = new AliTRDtrigParam("TRDtrigParam"
-// ,"TRD Trigger parameters");
-
-// Float_t field = AliTracker::GetBz() * 0.1; // Tesla
-// AliInfo(Form("Trigger set for magnetic field = %f Tesla \n",field));
-// trigp->SetField(field);
-// trigp->Init();
-// trdTrigger.SetParameter(trigp);
-
-// rawReader->RewindEvents();
-
-// for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
-// if (!rawReader->NextEvent()) break;
-// trdTrigger.Open(runLoader->GetFileName(),iEvent);
-// trdTrigger.ReadDigits(rawReader);
-// trdTrigger.MakeTracklets();
-// trdTrigger.WriteTracklets(-1);
-// }
-
-// loader->UnloadTracks();
-
}
//_____________________________________________________________________________
clusterer.ReadDigits(rawReader);
clusterer.MakeClusters();
- //
- // No trigger, since we don't have the output tree for tracklets
- //
-
}
//_____________________________________________________________________________
clusterer.ReadDigits(digitsTree);
clusterer.MakeClusters();
- //
- // No trigger, since we don't have the output tree for tracklets
- //
-
}
//_____________________________________________________________________________
loader->UnloadRecPoints();
- //
- // Trigger (tracklets, LTU)
- //
- loader->LoadTracks("RECREATE");
- AliInfo("Trigger tracklets will be produced");
-
- AliTRDtrigger trdTrigger("Trigger","Trigger class");
-
- AliTRDtrigParam *trigp = new AliTRDtrigParam("TRDtrigParam"
- ,"TRD Trigger parameters");
-
- Float_t field = AliTracker::GetBz() * 0.1; // Tesla
- AliInfo(Form("Trigger set for magnetic field = %f Tesla \n",field));
- trigp->SetField(field);
- trigp->Init();
- trdTrigger.SetParameter(trigp);
-
- for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
- trdTrigger.Open(runLoader->GetFileName(),iEvent);
- trdTrigger.ReadDigits();
- trdTrigger.MakeTracklets();
- trdTrigger.WriteTracklets(-1);
- }
-
- loader->UnloadTracks();
-
}
//_____________________________________________________________________________
AliTRDpidESD trdPID;
trdPID.MakePID(esd);
- //
- // No trigger, since we don't have the output tree for tracklets
- //
-
}
//_____________________________________________________________________________
AliTRDpidESD trdPID;
trdPID.MakePID(esd);
- //
- // No trigger, since we don't have the output tree for tracklets
- //
-
}
//_____________________________________________________________________________
AliTRDpidESD trdPID;
trdPID.MakePID(esd);
- //
- // No trigger, since we don't have the output tree for tracklets
- //
-
}
//_____________________________________________________________________________
AliTRDpidESD trdPID;
trdPID.MakePID(esd);
- //
- // Trigger (tracks, GTU)
- //
-// AliTRDtrigger trdTrigger("Trigger","Trigger class");
-
-// AliTRDtrigParam *trigp = new AliTRDtrigParam("TRDtrigParam"
-// ,"TRD Trigger parameters");
-
-// Float_t field = AliTracker::GetBz() * 0.1; // Tesla
-// AliInfo(Form("Trigger set for magnetic field = %f Tesla \n",field));
-// trigp->SetField(field);
-// trigp->Init();
-
-// trdTrigger.SetParameter(trigp);
-// trdTrigger.SetRunLoader(runLoader);
-// trdTrigger.Init();
-
-// Int_t iEvent = runLoader->GetEventNumber();
-// runLoader->GetEvent(iEvent);
-// trdTrigger.ReadTracklets(runLoader);
-
-// AliESDTrdTrack *TrdTrack = new AliESDTrdTrack();
-// AliTRDgtuTrack *GtuTrack;
-
-// Int_t nTracks = trdTrigger.GetNumberOfTracks();
-// for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
-
-// GtuTrack = trdTrigger.GetTrack(iTrack);
-
-// TrdTrack->SetYproj(GtuTrack->GetYproj());
-// TrdTrack->SetZproj(GtuTrack->GetZproj());
-// TrdTrack->SetSlope(GtuTrack->GetSlope());
-// TrdTrack->SetDetector(GtuTrack->GetDetector());
-// TrdTrack->SetTracklets(GtuTrack->GetTracklets());
-// TrdTrack->SetPlanes(GtuTrack->GetPlanes());
-// TrdTrack->SetClusters(GtuTrack->GetClusters());
-// TrdTrack->SetPt(GtuTrack->GetPt());
-// TrdTrack->SetPhi(GtuTrack->GetPhi());
-// TrdTrack->SetEta(GtuTrack->GetEta());
-// TrdTrack->SetLabel(GtuTrack->GetLabel());
-// TrdTrack->SetPID(GtuTrack->GetPID());
-// TrdTrack->SetIsElectron(GtuTrack->IsElectron());
-
-// esd->AddTrdTrack(TrdTrack);
-
-// }
-
}
TString evfoldname = AliConfig::GetDefaultEventFolderName();
AliRunLoader *runLoader = AliRunLoader::GetRunLoader(evfoldname);
AliLoader *loader = runLoader->GetLoader("TRDLoader");
- AliTRDgeometry *geo = AliTRDgeometry::GetGeometry(runLoader);
- AliTRDtrigParam *trigp = new AliTRDtrigParam("TRDtrigParam","TRD Trigger parameters");
+ AliTRDgeometry geo;
AliTRDtrigger trdTrigger("Trigger","Trigger class");
Float_t field = AliTracker::GetBz() * 0.1; // Tesla
AliInfo(Form("Trigger set for magnetic field = %f Tesla \n",field));
- trigp->SetField(field);
- trigp->Init();
-
- trdTrigger.SetParameter(trigp);
trdTrigger.SetRunLoader(runLoader);
trdTrigger.Init();
// Trigger (tracks, GTU)
- Float_t highPt = trigp->GetHighPt();
- Float_t jetLowPt = trigp->GetJetLowPt();
- Float_t jetHighPt = trigp->GetJetHighPt();
+ Float_t highPt = AliTRDtrigParam::Instance()->GetHighPt();
+ Float_t jetLowPt = AliTRDtrigParam::Instance()->GetJetLowPt();
+ Float_t jetHighPt = AliTRDtrigParam::Instance()->GetJetHighPt();
Float_t pid;
Float_t pt;
isElectron = gtuTrack->IsElectron();
pt = gtuTrack->GetPt();
det = gtuTrack->GetDetector();
- sec = geo->GetSector(det);
+ sec = geo.GetSector(det);
if (isElectron) {
}
// Hadrons from jets
- if (hadronJetLowPt >= trigp->GetNPartJetLow() ) {
+ if (hadronJetLowPt >= AliTRDtrigParam::Instance()->GetNPartJetLow() ) {
SetInput("TRD_Jet_LPt_L1");
}
- if (hadronJetHighPt >= trigp->GetNPartJetHigh()) {
+ if (hadronJetHighPt >= AliTRDtrigParam::Instance()->GetNPartJetHigh()) {
SetInput("TRD_Jet_HPt_L1");
}
///////////////////////////////////////////////////////////////////////////////
#include "AliTRDcluster.h"
-#include "AliTRDrecPoint.h"
ClassImp(AliTRDcluster)
}
-//_____________________________________________________________________________
-AliTRDcluster::AliTRDcluster(const AliTRDrecPoint &p)
- :AliCluster()
- ,fDetector(p.GetDetector())
- ,fTimeBin(p.GetLocalTimeBin())
- ,fQ(p.GetEnergy())
- ,fNPads(0)
- ,fCenter(0)
- ,fPad(0)
-{
- //
- // Constructor from AliTRDrecPoint
- //
-
- SetLabel(p.GetTrackIndex(0),0);
- SetLabel(p.GetTrackIndex(1),1);
- SetLabel(p.GetTrackIndex(2),2);
- SetY(p.GetY());
- SetZ(p.GetZ());
-
- //fSigmaY2 = p.GetSigmaY2();
- //fSigmaZ2 = p.GetSigmaZ2();
- // Why is this ????
- SetSigmaY2(0.2);
- SetSigmaZ2(5.0);
-
-}
-
//_____________________________________________________________________________
AliTRDcluster::AliTRDcluster(const AliTRDcluster &c)
:AliCluster()
#include "AliCluster.h"
-class AliTRDrecPoint;
-
class AliTRDcluster : public AliCluster {
public:
AliTRDcluster();
AliTRDcluster(const AliTRDcluster &c);
- AliTRDcluster(const AliTRDrecPoint &p);
virtual void AddTrackIndex(Int_t *i);
///////////////////////////////////////////////////////////////////////////////
#include "AliTRDclusterMI.h"
-#include "AliTRDrecPoint.h"
ClassImp(AliTRDclusterMI)
//
}
-
-//_____________________________________________________________________________
-AliTRDclusterMI::AliTRDclusterMI(const AliTRDrecPoint &p)
- :AliTRDcluster(p)
- ,fRmsY(0)
- ,fNPads(0)
- ,fRelPos(0)
-{
- //
- // Constructor from AliTRDrecPoint
- //
-
-}
-
#include "AliTRDcluster.h"
#include "TMath.h"
-class AliTRDrecPoint;
-
class AliTRDclusterMI : public AliTRDcluster {
public:
AliTRDclusterMI();
AliTRDclusterMI(const AliTRDcluster &c);
- AliTRDclusterMI(const AliTRDrecPoint &p);
void SetRmsY(Float_t rmsy) { fRmsY = rmsy; }
void SetNPads(Int_t npads) { fNPads = npads; }
#include "AliTRDclusterizer.h"
#include "AliTRDcluster.h"
-#include "AliTRDrecPoint.h"
#include "AliTRDgeometry.h"
#include "AliTRDcalibDB.h"
#include "AliTRDCommonParam.h"
#include "AliTRDcalibDB.h"
#include "AliTRDSimParam.h"
#include "AliTRDRecParam.h"
-#include "AliTRDCommonParam.h"
#include "AliTRDcluster.h"
#include "Cal/AliTRDCalROC.h"
AliTRDdataArrayI *tracksIn;
// Get the geometry
- AliTRDgeometry *geo = AliTRDgeometry::GetGeometry(fRunLoader);
- if (!geo) {
- AliWarning("Loading default TRD geometry!");
- geo = new AliTRDgeometry();
- }
+ //AliTRDgeometry *geo = AliTRDgeometry::GetGeometry(fRunLoader);
+ //if (!geo) {
+ // AliWarning("Creating default TRD geometry!");
+ // geo = new AliTRDgeometry();
+ //}
+ AliTRDgeometry geo;
AliTRDcalibDB *calibration = AliTRDcalibDB::Instance();
if (!calibration) {
AliError("No AliTRDRecParam instance available\n");
return kFALSE;
}
-
- AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();
- if (!commonParam) {
- AliError("Could not get common parameters\n");
- return kFALSE;
- }
// ADC thresholds
Float_t ADCthreshold = simParam->GetADCthreshold();
for (iplan = planBeg; iplan < planEnd; iplan++) {
for (isect = sectBeg; isect < sectEnd; isect++) {
- Int_t idet = geo->GetDetector(iplan,icham,isect);
+ Int_t idet = geo.GetDetector(iplan,icham,isect);
Int_t ilayer = AliGeomManager::kTRD1 + iplan;
Int_t imodule = icham + chamEnd * isect;
UShort_t volid = AliGeomManager::LayerToVolUID(ilayer,imodule);
AliTRDdataArrayI *tracksTmp = fDigitsManager->GetDictionary(idet,0);
tracksTmp->Expand();
- Int_t nRowMax = commonParam->GetRowMax(iplan,icham,isect);
- Int_t nColMax = commonParam->GetColMax(iplan);
+ Int_t nRowMax = geo.GetRowMax(iplan,icham,isect);
+ Int_t nColMax = geo.GetColMax(iplan);
- AliTRDpadPlane *padPlane = commonParam->GetPadPlane(iplan,icham);
+ AliTRDpadPlane *padPlane = geo.GetPadPlane(iplan,icham);
// Calibration object with pad wise values for t0
AliTRDCalROC *calT0ROC = calibration->GetT0ROC(idet);
fTimeStruct2 = 0;
}
+ if (fGeo) {
+ delete fGeo;
+ fGeo = 0;
+ }
+
}
//_____________________________________________________________________________
}
// Get the geometry
- fGeo = fTRD->GetGeometry();
- AliDebug(1,Form("Geometry version %d",fGeo->IsVersion()));
+ fGeo = new AliTRDgeometry();
// Create a digits manager
delete fDigitsManager;
Float_t hittime = hit->GetTime();
Int_t plane = fGeo->GetPlane(detector);
Int_t chamber = fGeo->GetChamber(detector);
- padPlane = commonParam->GetPadPlane(plane,chamber);
+ padPlane = fGeo->GetPadPlane(plane,chamber);
Float_t row0 = padPlane->GetRow0ROC();
Int_t nRowMax = padPlane->GetNrows();
Int_t nColMax = padPlane->GetNcols();
Int_t plane = fGeo->GetPlane(iDet);
Int_t sector = fGeo->GetSector(iDet);
Int_t chamber = fGeo->GetChamber(iDet);
- Int_t nRowMax = commonParam->GetRowMax(plane,chamber,sector);
- Int_t nColMax = commonParam->GetColMax(plane);
+ Int_t nRowMax = fGeo->GetRowMax(plane,chamber,sector);
+ Int_t nColMax = fGeo->GetColMax(plane);
Double_t *inADC = new Double_t[nTimeTotal];
Double_t *outADC = new Double_t[nTimeTotal];
return kFALSE;
}
- AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();
- if (!commonParam) {
- AliFatal("Could not get common parameters");
- return kFALSE;
- }
-
AliTRDcalibDB *calibration = AliTRDcalibDB::Instance();
if (!calibration) {
AliFatal("Could not get calibration object");
Int_t plane = fGeo->GetPlane(iDet);
Int_t sector = fGeo->GetSector(iDet);
Int_t chamber = fGeo->GetChamber(iDet);
- Int_t nRowMax = commonParam->GetRowMax(plane,chamber,sector);
- Int_t nColMax = commonParam->GetColMax(plane);
+ Int_t nRowMax = fGeo->GetRowMax(plane,chamber,sector);
+ Int_t nColMax = fGeo->GetColMax(plane);
Double_t *inADC = new Double_t[nTimeTotal];
Double_t *outADC = new Double_t[nTimeTotal];
return kFALSE;
}
- AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();
- if (!commonParam) {
- AliFatal("Could not get common parameters");
- return kFALSE;
- }
-
AliTRDcalibDB *calibration = AliTRDcalibDB::Instance();
if (!calibration) {
AliFatal("Could not get calibration object");
Int_t plane = fGeo->GetPlane(iDet);
Int_t sector = fGeo->GetSector(iDet);
Int_t chamber = fGeo->GetChamber(iDet);
- Int_t nRowMax = commonParam->GetRowMax(plane,chamber,sector);
- Int_t nColMax = commonParam->GetColMax(plane);
+ Int_t nRowMax = fGeo->GetRowMax(plane,chamber,sector);
+ Int_t nColMax = fGeo->GetColMax(plane);
// Loop through the pixels of one detector and add the signals
digitsA = fSDigitsManager->GetDigits(iDet);
#include "AliTRD.h"
#include "AliTRDcalibDB.h"
-#include "AliTRDCommonParam.h"
#include "AliTRDgeometry.h"
#include "AliTRDpadPlane.h"
,fMatrixArray(0)
,fMatrixCorrectionArray(0)
,fMatrixGeo(0)
-
+ ,fPadPlaneArray(0)
{
//
// AliTRDgeometry default constructor
//_____________________________________________________________________________
AliTRDgeometry::AliTRDgeometry(const AliTRDgeometry &g)
:AliGeometry(g)
- ,fMatrixArray(g.fMatrixArray)
- ,fMatrixCorrectionArray(g.fMatrixCorrectionArray)
- ,fMatrixGeo(g.fMatrixGeo)
+ ,fMatrixArray(0)
+ ,fMatrixCorrectionArray(0)
+ ,fMatrixGeo(0)
+ ,fPadPlaneArray(0)
{
//
// AliTRDgeometry copy constructor
fMatrixGeo = 0;
}
+ if (fPadPlaneArray) {
+ fPadPlaneArray->Delete();
+ delete fPadPlaneArray;
+ fPadPlaneArray = 0;
+ }
+
}
//_____________________________________________________________________________
fRotB22[isect] = TMath::Cos(phi);
}
+ // Initialize the SM status
for (isect = 0; isect < fgkNsect; isect++) {
SetSMstatus(isect,1);
}
}
+//_____________________________________________________________________________
+void AliTRDgeometry::CreatePadPlaneArray()
+{
+ //
+ // Creates the array of AliTRDpadPlane objects
+ //
+
+ if (fPadPlaneArray) {
+ fPadPlaneArray->Delete();
+ delete fPadPlaneArray;
+ }
+
+ fPadPlaneArray = new TObjArray(fgkNplan * fgkNcham);
+ for (Int_t iplan = 0; iplan < fgkNplan; iplan++) {
+ for (Int_t icham = 0; icham < fgkNcham; icham++) {
+ Int_t ipp = GetDetectorSec(iplan,icham);
+ fPadPlaneArray->AddAt(CreatePadPlane(iplan,icham),ipp);
+ }
+ }
+
+}
+
+//_____________________________________________________________________________
+AliTRDpadPlane *AliTRDgeometry::CreatePadPlane(Int_t iplan, Int_t icham)
+{
+ //
+ // Creates an AliTRDpadPlane object
+ //
+
+ AliTRDpadPlane *padPlane = new AliTRDpadPlane();
+
+ padPlane->SetPlane(iplan);
+ padPlane->SetChamber(icham);
+
+ padPlane->SetRowSpacing(0.0);
+ padPlane->SetColSpacing(0.0);
+
+ padPlane->SetLengthRim(1.0);
+ padPlane->SetWidthRim(0.5);
+
+ padPlane->SetNcols(144);
+
+ //
+ // The pad plane parameter
+ //
+ switch (iplan) {
+ case 0:
+ if (icham == 2) {
+ // L0C0 type
+ padPlane->SetNrows(12);
+ padPlane->SetLength(108.0);
+ padPlane->SetWidth(92.2);
+ padPlane->SetLengthOPad(8.0);
+ padPlane->SetWidthOPad(0.515);
+ padPlane->SetLengthIPad(9.0);
+ padPlane->SetWidthIPad(0.635);
+ padPlane->SetTiltingAngle(-2.0);
+ }
+ else {
+ // L0C1 type
+ padPlane->SetNrows(16);
+ padPlane->SetLength(122.0);
+ padPlane->SetWidth(92.2);
+ padPlane->SetLengthOPad(7.5);
+ padPlane->SetWidthOPad(0.515);
+ padPlane->SetLengthIPad(7.5);
+ padPlane->SetWidthIPad(0.635);
+ padPlane->SetTiltingAngle(-2.0);
+ }
+ break;
+ case 1:
+ if (icham == 2) {
+ // L1C0 type
+ padPlane->SetNrows(12);
+ padPlane->SetLength(108.0);
+ padPlane->SetWidth(96.6);
+ padPlane->SetLengthOPad(8.0);
+ padPlane->SetWidthOPad(0.585);
+ padPlane->SetLengthIPad(9.0);
+ padPlane->SetWidthIPad(0.665);
+ padPlane->SetTiltingAngle(2.0);
+ }
+ else {
+ // L1C1 type
+ padPlane->SetNrows(16);
+ padPlane->SetLength(122.0);
+ padPlane->SetWidth(96.6);
+ padPlane->SetLengthOPad(7.5);
+ padPlane->SetWidthOPad(0.585);
+ padPlane->SetLengthIPad(7.5);
+ padPlane->SetWidthIPad(0.665);
+ padPlane->SetTiltingAngle(2.0);
+ }
+ break;
+ case 2:
+ if (icham == 2) {
+ // L2C0 type
+ padPlane->SetNrows(12);
+ padPlane->SetLength(108.0);
+ padPlane->SetWidth(101.1);
+ padPlane->SetLengthOPad(8.0);
+ padPlane->SetWidthOPad(0.705);
+ padPlane->SetLengthIPad(9.0);
+ padPlane->SetWidthIPad(0.695);
+ padPlane->SetTiltingAngle(-2.0);
+ }
+ else {
+ // L2C1 type
+ padPlane->SetNrows(16);
+ padPlane->SetLength(129.0);
+ padPlane->SetWidth(101.1);
+ padPlane->SetLengthOPad(7.5);
+ padPlane->SetWidthOPad(0.705);
+ padPlane->SetLengthIPad(8.0);
+ padPlane->SetWidthIPad(0.695);
+ padPlane->SetTiltingAngle(-2.0);
+ }
+ break;
+ case 3:
+ if (icham == 2) {
+ // L3C0 type
+ padPlane->SetNrows(12);
+ padPlane->SetLength(108.0);
+ padPlane->SetWidth(105.5);
+ padPlane->SetLengthOPad(8.0);
+ padPlane->SetWidthOPad(0.775);
+ padPlane->SetLengthIPad(9.0);
+ padPlane->SetWidthIPad(0.725);
+ padPlane->SetTiltingAngle(2.0);
+ }
+ else {
+ // L3C1 type
+ padPlane->SetNrows(16);
+ padPlane->SetLength(136.0);
+ padPlane->SetWidth(105.5);
+ padPlane->SetLengthOPad(7.5);
+ padPlane->SetWidthOPad(0.775);
+ padPlane->SetLengthIPad(8.5);
+ padPlane->SetWidthIPad(0.725);
+ padPlane->SetTiltingAngle(2.0);
+ }
+ break;
+ case 4:
+ if (icham == 2) {
+ // L4C0 type
+ padPlane->SetNrows(12);
+ padPlane->SetLength(108.0);
+ padPlane->SetWidth(109.9);
+ padPlane->SetLengthOPad(8.0);
+ padPlane->SetWidthOPad(0.845);
+ padPlane->SetLengthIPad(9.0);
+ padPlane->SetWidthIPad(0.755);
+ padPlane->SetTiltingAngle(-2.0);
+ }
+ else {
+ // L4C1 type
+ padPlane->SetNrows(16);
+ padPlane->SetLength(143.0);
+ padPlane->SetWidth(109.9);
+ padPlane->SetLengthOPad(7.5);
+ padPlane->SetWidthOPad(0.845);
+ padPlane->SetLengthIPad(9.0);
+ padPlane->SetWidthIPad(0.755);
+ padPlane->SetTiltingAngle(-2.0);
+ }
+ break;
+ case 5:
+ if (icham == 2) {
+ // L5C0 type
+ padPlane->SetNrows(12);
+ padPlane->SetLength(108.0);
+ padPlane->SetWidth(114.4);
+ padPlane->SetLengthOPad(8.0);
+ padPlane->SetWidthOPad(0.965);
+ padPlane->SetLengthIPad(9.0);
+ padPlane->SetWidthIPad(0.785);
+ padPlane->SetTiltingAngle(2.0);
+ }
+ else {
+ // L5C1 type
+ padPlane->SetNrows(16);
+ padPlane->SetLength(145.0);
+ padPlane->SetWidth(114.4);
+ padPlane->SetLengthOPad(8.5);
+ padPlane->SetWidthOPad(0.965);
+ padPlane->SetLengthIPad(9.0);
+ padPlane->SetWidthIPad(0.785);
+ padPlane->SetTiltingAngle(2.0);
+ }
+ break;
+ };
+
+ //
+ // The positions of the borders of the pads
+ //
+ // Row direction
+ //
+ Double_t row = fClength[iplan][icham] / 2.0
+ - fgkRpadW
+ - padPlane->GetLengthRim();
+ for (Int_t ir = 0; ir < padPlane->GetNrows(); ir++) {
+ padPlane->SetPadRow(ir,row);
+ row -= padPlane->GetRowSpacing();
+ if (ir == 0) {
+ row -= padPlane->GetLengthOPad();
+ }
+ else {
+ row -= padPlane->GetLengthIPad();
+ }
+ }
+ //
+ // Column direction
+ //
+ Double_t col = fCwidth[iplan] / 2.0
+ + fgkCroW
+ - padPlane->GetWidthRim();
+ for (Int_t ic = 0; ic < padPlane->GetNcols(); ic++) {
+ padPlane->SetPadCol(ic,col);
+ col -= padPlane->GetColSpacing();
+ if (ic == 0) {
+ col -= padPlane->GetWidthOPad();
+ }
+ else {
+ col -= padPlane->GetWidthIPad();
+ }
+ }
+ // Calculate the offset to translate from the local ROC system into
+ // the local supermodule system, which is used for clusters
+ Double_t rowTmp = fClength[iplan][0]
+ + fClength[iplan][1]
+ + fClength[iplan][2] / 2.0;
+ for (Int_t ic = 0; ic < icham; ic++) {
+ rowTmp -= fClength[iplan][ic];
+ }
+ padPlane->SetPadRowSMOffset(rowTmp - fClength[iplan][icham]/2.0);
+
+ return padPlane;
+
+}
+
//_____________________________________________________________________________
void AliTRDgeometry::CreateGeometry(Int_t *idtmed)
{
gMC->Matrix(matrix[1], 80.0, 0.0, 90.0, 90.0, 10.0, 180.0);
gMC->Matrix(matrix[2], 0.0, 0.0, 90.0, 90.0, 90.0, 0.0);
gMC->Matrix(matrix[3], 180.0, 0.0, 90.0, 90.0, 90.0, 180.0);
-
- AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();
- if (!commonParam) {
- AliError("Could not get common parameters\n");
- return;
- }
//
// The cooling arterias
for (iplan = 0; iplan < kNplan; iplan++) {
Int_t iDet = GetDetectorSec(iplan,icham);
Int_t iCopy = GetDetector(iplan,icham,0) * 100;
- Int_t nMCMrow = commonParam->GetRowMax(iplan,icham,0);
+ Int_t nMCMrow = GetRowMax(iplan,icham,0);
Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
/ ((Float_t) nMCMrow);
sprintf(cTagV,"UU%02d",iDet);
for (iplan = 0; iplan < kNplan; iplan++) {
Int_t iDet = GetDetectorSec(iplan,icham);
Int_t iCopy = GetDetector(iplan,icham,0) * 100;
- Int_t nMCMrow = commonParam->GetRowMax(iplan,icham,0);
+ Int_t nMCMrow = GetRowMax(iplan,icham,0);
Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
/ ((Float_t) nMCMrow);
sprintf(cTagV,"UU%02d",iDet);
for (iplan = 0; iplan < kNplan; iplan++) {
Int_t iDet = GetDetectorSec(iplan,icham);
Int_t iCopy = GetDetector(iplan,icham,0) * 1000;
- Int_t nMCMrow = commonParam->GetRowMax(iplan,icham,0);
+ Int_t nMCMrow = GetRowMax(iplan,icham,0);
Float_t ySize = (GetChamberLength(iplan,icham) - 2.0*fgkRpadW)
/ ((Float_t) nMCMrow);
Int_t nMCMcol = 8;
}
-//CL
//_____________________________________________________________________________
-Int_t AliTRDgeometry::GetPadRowFromMCM(Int_t irob, Int_t imcm) const
+AliTRDpadPlane *AliTRDgeometry::GetPadPlane(Int_t p, Int_t c)
{
+ //
+ // Returns the pad plane for a given plane <p> and chamber <c> number
+ //
- // return on which row this mcm sits
+ if (!fPadPlaneArray) {
+ CreatePadPlaneArray();
+ }
+
+ Int_t ipp = GetDetectorSec(p,c);
+ return ((AliTRDpadPlane *) fPadPlaneArray->At(ipp));
+
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDgeometry::GetRowMax(Int_t p, Int_t c, Int_t /*s*/)
+{
+ //
+ // Returns the number of rows on the pad plane
+ //
+
+ return GetPadPlane(p,c)->GetNrows();
+
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDgeometry::GetColMax(Int_t p)
+{
+ //
+ // Returns the number of rows on the pad plane
+ //
+
+ return GetPadPlane(p,0)->GetNcols();
+
+}
+
+//_____________________________________________________________________________
+Double_t AliTRDgeometry::GetRow0(Int_t p, Int_t c, Int_t /*s*/)
+{
+ //
+ // Returns the position of the border of the first pad in a row
+ //
+
+ return GetPadPlane(p,c)->GetRow0();
+
+}
+
+//_____________________________________________________________________________
+Double_t AliTRDgeometry::GetCol0(Int_t p)
+{
+ //
+ // Returns the position of the border of the first pad in a column
+ //
+
+ return GetPadPlane(p,0)->GetCol0();
+
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDgeometry::GetPadRowFromMCM(Int_t irob, Int_t imcm) const
+{
+ //
+ // Return on which row this mcm sits
+ //
return fgkMCMrow*(irob/2) + imcm/fgkMCMrow;
-;
}
//_____________________________________________________________________________
Int_t AliTRDgeometry::GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const
{
//
- // return which pad is connected to this adc channel. return -1 if it
+ // Return which pad is connected to this adc channel. return -1 if it
// is one of the not directly connected adc channels (0, 1 20)
//
//_____________________________________________________________________________
Int_t AliTRDgeometry::GetMCMfromPad(Int_t irow, Int_t icol) const
{
-
- // return on which mcm this pad is
+ //
+ // Return on which mcm this pad is
+ //
if ( irow < 0 || icol < 0 || irow > fgkRowmaxC1 || icol > fgkColmax ) return -1;
//_____________________________________________________________________________
Int_t AliTRDgeometry::GetROBfromPad(Int_t irow, Int_t icol) const
{
-
- // return on which rob this pad is
+ //
+ // Return on which rob this pad is
+ //
return (irow/fgkMCMrow)*2 + GetColSide(icol);
//_____________________________________________________________________________
Int_t AliTRDgeometry::GetRobSide(Int_t irob) const
{
-
- // return on which side this rob sits (A side = 0, B side = 1)
+ //
+ // Return on which side this rob sits (A side = 0, B side = 1)
+ //
if ( irob < 0 || irob >= fgkROBmaxC1 ) return -1;
//_____________________________________________________________________________
Int_t AliTRDgeometry::GetColSide(Int_t icol) const
-{
-
- // return on which side this column sits (A side = 0, B side = 1)
-
- if ( icol < 0 || icol >= fgkColmax ) return -1;
-
- return icol/(fgkColmax/2);
-
-}
-
-//_____________________________________________________________________________
-AliTRDgeometry *AliTRDgeometry::GetGeometry(AliRunLoader *runLoader)
{
//
- // Load the geometry from the galice file
+ // Return on which side this column sits (A side = 0, B side = 1)
//
- if (!runLoader) {
- runLoader = AliRunLoader::GetRunLoader();
- }
- if (!runLoader) {
- AliErrorGeneral("AliTRDgeometry::GetGeometry","No run loader");
- return NULL;
- }
-
- TDirectory *saveDir = gDirectory;
- runLoader->CdGAFile();
-
- // Try from the galice.root file
- static AliTRDgeometry *geom = (AliTRDgeometry *) gDirectory->Get("TRDgeometry");
-
- if (!geom) {
- // If it is not in the file, try to get it from the run loader
- if (runLoader->GetAliRun()) {
- AliTRD *trd = (AliTRD *) runLoader->GetAliRun()->GetDetector("TRD");
- geom = trd->GetGeometry();
- }
- }
- if (!geom) {
- AliErrorGeneral("AliTRDgeometry::GetGeometry","Geometry not found");
- return NULL;
- }
+ if ( icol < 0 || icol >= fgkColmax ) return -1;
- saveDir->cd();
- return geom;
+ return icol/(fgkColmax/2);
}
#include "TObjArray.h"
-class AliRunLoader;
class TGeoHMatrix;
+class AliRunLoader;
+
+class AliTRDpadPlane;
+
class AliTRDgeometry : public AliGeometry {
public:
void SetSMstatus(Int_t sm, Char_t status) { fSMstatus[sm] = status; }
- static AliTRDgeometry* GetGeometry(AliRunLoader *runLoader = NULL);
-
static Int_t GetDetectorSec(Int_t p, Int_t c);
static Int_t GetDetector(Int_t p, Int_t c, Int_t s);
virtual Int_t GetPlane(Int_t d) const;
virtual Int_t GetChamber(Int_t d) const;
virtual Int_t GetSector(Int_t d) const;
+ void CreatePadPlaneArray();
+ AliTRDpadPlane *CreatePadPlane(Int_t p, Int_t c);
+ AliTRDpadPlane *GetPadPlane(Int_t p, Int_t c);
+ Int_t GetRowMax(Int_t p, Int_t c, Int_t /*s*/);
+ Int_t GetColMax(Int_t p);
+ Double_t GetRow0(Int_t p, Int_t c, Int_t /*s*/);
+ Double_t GetCol0(Int_t p);
+
// Translation from MCM to Pad and vice versa
virtual Int_t GetPadRowFromMCM(Int_t irob, Int_t imcm) const;
virtual Int_t GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const;
TObjArray *fMatrixCorrectionArray; //! Transformation Cluster to Tracking systerm
TObjArray *fMatrixGeo; //! Geo matrices
- ClassDef(AliTRDgeometry,13) // TRD geometry class
+ TObjArray *fPadPlaneArray; //! Array of pad plane objects
+
+ ClassDef(AliTRDgeometry,14) // TRD geometry class
};
/*
$Log$
+Revision 1.4 2006/08/28 17:12:18 cblume
+Remove the last print statements
+
Revision 1.3 2006/08/11 17:58:05 cblume
Next round of effc++ changes
//_____________________________________________________________________________
AliTRDmcm::AliTRDmcm()
:TObject()
- ,fTrigParam(0)
,fNtrk(0)
,fRobId(0)
,fChaId(0)
}
//_____________________________________________________________________________
-AliTRDmcm::AliTRDmcm(AliTRDtrigParam *trigp, const Int_t id)
+AliTRDmcm::AliTRDmcm(const Int_t id)
:TObject()
- ,fTrigParam(trigp)
,fNtrk(0)
,fRobId(0)
,fChaId(0)
,fRow(0)
,fColFirst(0)
,fColLast(0)
- ,fTime1(trigp->GetTime1())
- ,fTime2(trigp->GetTime2())
- ,fClusThr(trigp->GetClusThr())
- ,fPadThr(trigp->GetPadThr())
+ ,fTime1(0)
+ ,fTime2(0)
+ ,fClusThr(0)
+ ,fPadThr(0)
,fNtrkSeeds(0)
,fR1(0)
,fR2(0)
fIsClus[i][j] = kFALSE;
}
}
+
+ fTime1 = AliTRDtrigParam::Instance()->GetTime1();
+ fTime2 = AliTRDtrigParam::Instance()->GetTime2();
+ fClusThr = AliTRDtrigParam::Instance()->GetClusThr();
+ fPadThr = AliTRDtrigParam::Instance()->GetPadThr();
- fTrigParam->GetFilterParam(fR1,fR2,fC1,fC2,fPedestal);
+ AliTRDtrigParam::Instance()->GetFilterParam(fR1,fR2,fC1,fC2,fPedestal);
}
//_____________________________________________________________________________
AliTRDmcm::AliTRDmcm(const AliTRDmcm &m)
:TObject(m)
- ,fTrigParam(NULL)
,fNtrk(m.fNtrk)
,fRobId(m.fRobId)
,fChaId(m.fChaId)
Int_t i = 0;
Int_t j = 0;
- ((AliTRDmcm &) m).fTrigParam = NULL;
((AliTRDmcm &) m).fNtrk = fNtrk;
((AliTRDmcm &) m).fRobId = fRobId;
((AliTRDmcm &) m).fChaId = fChaId;
Int_t iTime = 0;
Int_t iCol = 0;
- Int_t iPad = 0;
Int_t iPlus = 0;
Int_t i = 0;
Int_t j = 0;
}
}
- Int_t sum10 = fTrigParam->GetSum10();
- Int_t sum12 = fTrigParam->GetSum12();
+ Int_t sum10 = AliTRDtrigParam::Instance()->GetSum10();
+ Int_t sum12 = AliTRDtrigParam::Instance()->GetSum12();
// Build the 2padSum
Int_t nsum2seed = 0;
if ((fHit2padSum[0][i]+1) == fHit2padSum[0][i+1]) {
nSeeds--;
if (fHit2padSum[1][i] >= fHit2padSum[1][i+1]) {
- if (fTrigParam->GetDebugLevel() > 1) {
- AliWarning(Form("Reject seed %1d in col %02d. \n",i,fHit2padSum[0][i+1]));
- }
+ AliDebug(2,Form("Reject seed %1d in col %02d. \n",i,fHit2padSum[0][i+1]));
fSeedCol[i+1] = -1;
}
else {
- if (fTrigParam->GetDebugLevel() > 1) {
- AliWarning(Form("Reject seed %1d in col %02d. \n",i,fHit2padSum[0][i]));
- }
+ AliDebug(2,Form("Reject seed %1d in col %02d. \n",i,fHit2padSum[0][i]));
fSeedCol[i] = -1;
}
}
#include <TObject.h>
-class AliTRDtrigParam;
-
class AliTRDmcm : public TObject {
public:
AliTRDmcm();
AliTRDmcm(const AliTRDmcm &m);
- AliTRDmcm(AliTRDtrigParam *trigp, Int_t id);
+ AliTRDmcm(Int_t id);
virtual ~AliTRDmcm();
AliTRDmcm &operator=(const AliTRDmcm &m);
protected:
- AliTRDtrigParam *fTrigParam; //! Pointer to the trigger parameters class
-
Int_t fNtrk; // Number of found tracklets
Int_t fTrkIndex[kMaxTrackletsPerMCM]; // Index of found tracklets
Int_t fRobId; // ROB id
Int_t fId; // Dummy id
- ClassDef(AliTRDmcm,2) // TRD MCM class
+ ClassDef(AliTRDmcm,3) // TRD MCM class
};
//_____________________________________________________________________________
AliTRDmcmTracklet::AliTRDmcmTracklet()
:TObject()
+ ,fGeo(0)
,fDetector(-1)
,fRow(-1)
,fTrackLabel(-1)
fCol[time] = 0;
}
+ fGeo = new AliTRDgeometry();
+
}
//_____________________________________________________________________________
AliTRDmcmTracklet::AliTRDmcmTracklet(Int_t det, Int_t row, Int_t n)
:TObject()
+ ,fGeo(0)
,fDetector(det)
,fRow(row)
,fTrackLabel(-1)
fGPos = new TGraph(0);
fGAmp = new TGraph(0);
+ fGeo = new AliTRDgeometry();
+
}
//_____________________________________________________________________________
AliTRDmcmTracklet::AliTRDmcmTracklet(const AliTRDmcmTracklet &t)
:TObject(t)
+ ,fGeo(0)
,fDetector(t.fDetector)
,fRow(t.fRow)
,fTrackLabel(t.fTrackLabel)
((AliTRDmcmTracklet &) t).fCol[time] = 0;
}
+ if (fGeo) {
+ delete fGeo;
+ }
+ fGeo = new AliTRDgeometry();
+
}
//_____________________________________________________________________________
if (fGPos != 0) delete fGPos;
if (fGAmp != 0) delete fGAmp;
+ if (fGeo) {
+ delete fGeo;
+ }
+
}
//_____________________________________________________________________________
return;
}
- AliTRDCommonParam* commonParam = AliTRDCommonParam::Instance();
- if (!commonParam) {
+ if (!AliTRDCommonParam::Instance()) {
AliError("No common parameters.");
return;
}
iplan = geo->GetPlane(fDetector);
icham = geo->GetChamber(fDetector);
- AliTRDpadPlane *padPlane = commonParam->GetPadPlane(iplan,icham);
+ AliTRDpadPlane *padPlane = fGeo->GetPadPlane(iplan,icham);
- Float_t samplFreq = commonParam->GetSamplingFrequency();
+ Float_t samplFreq = AliTRDCommonParam::Instance()->GetSamplingFrequency();
Int_t time, col;
Float_t amp[3];
Int_t GetClusterCol(Int_t icl) const { return fCol[icl]; };
protected:
+ // Geometry
+ AliTRDgeometry *fGeo; //! The TRD geometry
Int_t fDetector; // TRD detector number (0 ... 539)
Int_t fRow; // Row number in the detector
Float_t fPt; // Transverse momentum
Float_t fdQdl; // Charge per unit length
- ClassDef(AliTRDmcmTracklet,2) // Track segment for the TRD (Tracklet)
+ ClassDef(AliTRDmcmTracklet,3) // Track segment for the TRD (Tracklet)
};
#include <TObject.h>
+#include "AliRun.h"
#include "AliLog.h"
#include "AliTRDgeometry.h"
//_____________________________________________________________________________
AliTRDmodule::AliTRDmodule()
- :TObject()
+ :TObject()
,fXprojPlane(0)
,fField(0)
- ,fTracklets(NULL)
- ,fTracks(NULL)
+ ,fTracklets(new TObjArray(400))
+ ,fTracks(new TObjArray(400))
,fDeltaY(0)
,fDeltaS(0)
,fLTUtrk(0)
// AliTRDmodule default constructor
//
-}
+ fXprojPlane = AliTRDtrigParam::Instance()->GetXprojPlane();
+ fDeltaY = AliTRDtrigParam::Instance()->GetDeltaY();
+ fDeltaS = AliTRDtrigParam::Instance()->GetDeltaS();
-//_____________________________________________________________________________
-AliTRDmodule::AliTRDmodule(AliTRDtrigParam *trigp)
- :TObject()
- ,fXprojPlane(trigp->GetXprojPlane())
- ,fField(trigp->GetField())
- ,fTracklets(new TObjArray(400))
- ,fTracks(new TObjArray(400))
- ,fDeltaY(trigp->GetDeltaY())
- ,fDeltaS(trigp->GetDeltaS())
- ,fLTUtrk(0)
- ,fGTUtrk(0)
-{
- //
- // AliTRDmodule constructor
- //
+ // The magnetic field strength
+ Double_t x[3] = { 0.0, 0.0, 0.0 };
+ Double_t b[3];
+ gAlice->Field(x,b); // b[] is in kilo Gauss
+ fField = b[2] * 0.1; // Tesla
for (Int_t iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) {
for (Int_t i = 0; i < kNsubZchan; i++) {
class AliTRDgtuTrack;
class AliTRDltuTracklet;
-class AliTRDtrigParam;
class AliTRDmodule : public TObject {
AliTRDmodule();
AliTRDmodule(const AliTRDmodule &m);
- AliTRDmodule(AliTRDtrigParam *trigp);
virtual ~AliTRDmodule();
AliTRDmodule &operator=(const AliTRDmodule &m);
//_____________________________________________________________________________
AliTRDpadPlane::AliTRDpadPlane()
:TObject()
- ,fGeo(0)
,fPla(0)
,fCha(0)
,fLength(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)
- ,fPadRowSMOffset(0)
-{
- //
- // Constructor that initializes a given pad plane type
- //
-
- fGeo = new AliTRDgeometry();
-
- fPla = p;
- fCha = c;
-
- fRowSpacing = 0.0;
- fColSpacing = 0.0;
-
- fLengthRim = 1.0;
- fWidthRim = 0.5;
-
- fNcols = 144;
-
- //
- // The pad plane parameter
- //
- switch (p) {
- case 0:
- if (c == 2) {
- // L0C0 type
- fNrows = 12;
- fLength = 108.0;
- fWidth = 92.2;
- fLengthOPad = 8.0;
- fWidthOPad = 0.515;
- fLengthIPad = 9.0;
- fWidthIPad = 0.635;
- fTiltingAngle = -2.0;
- }
- else {
- // L0C1 type
- fNrows = 16;
- fLength = 122.0;
- fWidth = 92.2;
- fLengthOPad = 7.5;
- fWidthOPad = 0.515;
- fLengthIPad = 7.5;
- fWidthIPad = 0.635;
- fTiltingAngle = -2.0;
- }
- break;
- case 1:
- if (c == 2) {
- // L1C0 type
- fNrows = 12;
- fLength = 108.0;
- fWidth = 96.6;
- fLengthOPad = 8.0;
- fWidthOPad = 0.585;
- fLengthIPad = 9.0;
- fWidthIPad = 0.665;
- fTiltingAngle = 2.0;
- }
- else {
- // L1C1 type
- fNrows = 16;
- fLength = 122.0;
- fWidth = 96.6;
- fLengthOPad = 7.5;
- fWidthOPad = 0.585;
- fLengthIPad = 7.5;
- fWidthIPad = 0.665;
- fTiltingAngle = 2.0;
- }
- break;
- case 2:
- if (c == 2) {
- // L2C0 type
- fNrows = 12;
- fLength = 108.0;
- fWidth = 101.1;
- fLengthOPad = 8.0;
- fWidthOPad = 0.705;
- fLengthIPad = 9.0;
- fWidthIPad = 0.695;
- fTiltingAngle = -2.0;
- }
- else {
- // L2C1 type
- fNrows = 16;
- fLength = 129.0;
- fWidth = 101.1;
- fLengthOPad = 7.5;
- fWidthOPad = 0.705;
- fLengthIPad = 8.0;
- fWidthIPad = 0.695;
- fTiltingAngle = -2.0;
- }
- break;
- case 3:
- if (c == 2) {
- // L3C0 type
- fNrows = 12;
- fLength = 108.0;
- fWidth = 105.5;
- fLengthOPad = 8.0;
- fWidthOPad = 0.775;
- fLengthIPad = 9.0;
- fWidthIPad = 0.725;
- fTiltingAngle = 2.0;
- }
- else {
- // L3C1 type
- fNrows = 16;
- fLength = 136.0;
- fWidth = 105.5;
- fLengthOPad = 7.5;
- fWidthOPad = 0.775;
- fLengthIPad = 8.5;
- fWidthIPad = 0.725;
- fTiltingAngle = 2.0;
- }
- break;
- case 4:
- if (c == 2) {
- // L4C0 type
- fNrows = 12;
- fLength = 108.0;
- fWidth = 109.9;
- fLengthOPad = 8.0;
- fWidthOPad = 0.845;
- fLengthIPad = 9.0;
- fWidthIPad = 0.755;
- fTiltingAngle = -2.0;
- }
- else {
- // L4C1 type
- fNrows = 16;
- fLength = 143.0;
- fWidth = 109.9;
- fLengthOPad = 7.5;
- fWidthOPad = 0.845;
- fLengthIPad = 9.0;
- fWidthIPad = 0.755;
- fTiltingAngle = -2.0;
- }
- break;
- case 5:
- if (c == 2) {
- // L5C0 type
- fNrows = 12;
- fLength = 108.0;
- fWidth = 114.4;
- fLengthOPad = 8.0;
- fWidthOPad = 0.965;
- fLengthIPad = 9.0;
- fWidthIPad = 0.785;
- fTiltingAngle = 2.0;
- }
- else {
- // L5C1 type
- fNrows = 16;
- fLength = 145.0;
- fWidth = 114.4;
- fLengthOPad = 8.5;
- fWidthOPad = 0.965;
- fLengthIPad = 9.0;
- fWidthIPad = 0.785;
- fTiltingAngle = 2.0;
- }
- break;
- };
-
- //
- // Store tilting angle as tangens
- //
- fTiltingTan = TMath::Tan(TMath::Pi()/180.0 * fTiltingAngle);
-
- //
- // The positions of the borders of the pads
- //
- // Row direction
- //
- fPadRow = new Double_t[fNrows];
- Double_t row = fGeo->GetChamberLength(p,c) / 2.0
- - fGeo->RpadW()
- - fLengthRim;
- for (Int_t ir = 0; ir < fNrows; ir++) {
- fPadRow[ir] = row;
- row -= fRowSpacing;
- if (ir == 0) {
- row -= fLengthOPad;
- }
- else {
- row -= fLengthIPad;
- }
- }
- //
- // Column direction
- //
- fPadCol = new Double_t[fNcols];
- Double_t col = fGeo->GetChamberWidth(p) / 2.0
- + fGeo->CroWid()
- - fWidthRim;
- for (Int_t ic = 0; ic < fNcols; ic++) {
- fPadCol[ic] = col;
- col -= fColSpacing;
- if (ic == 0) {
- col -= fWidthOPad;
- }
- else {
- col -= fWidthIPad;
- }
- }
- // Calculate the offset to translate from the local ROC system into
- // the local supermodule system, which is used for clusters
- Double_t rowTmp = fGeo->GetChamberLength(p,0)
- + fGeo->GetChamberLength(p,1)
- + fGeo->GetChamberLength(p,2) / 2.0;
- for (Int_t ic = 0; ic < c; ic++) {
- rowTmp -= fGeo->GetChamberLength(p,ic);
- }
- fPadRowSMOffset = rowTmp - fGeo->GetChamberLength(p,c)/2.0;
-
-}
-
//_____________________________________________________________________________
AliTRDpadPlane::AliTRDpadPlane(const AliTRDpadPlane &p)
:TObject(p)
- ,fGeo(0)
,fPla(p.fPla)
,fCha(p.fCha)
,fLength(p.fLength)
// AliTRDpadPlane destructor
//
- if (fGeo) {
- delete fGeo;
- fGeo = 0;
- }
-
if (fPadRow) {
delete [] fPadRow;
fPadRow = 0;
Int_t iBin = 0;
- ((AliTRDpadPlane &) p).fGeo = 0;
-
((AliTRDpadPlane &) p).fPla = fPla;
((AliTRDpadPlane &) p).fCha = fCha;
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-/* $Id: AliTRDpadPlane.h,v */
+/* $Id$ */
//////////////////////////////////////////////////
// //
#include <TObject.h>
-class AliTRDgeometry;
-
//_____________________________________________________________________________
class AliTRDpadPlane : public TObject {
public:
AliTRDpadPlane();
- AliTRDpadPlane(Int_t p, Int_t c);
AliTRDpadPlane(const AliTRDpadPlane &p);
virtual ~AliTRDpadPlane();
AliTRDpadPlane &operator=(const AliTRDpadPlane &p);
virtual void Copy(TObject &p) const;
+ void SetPlane(Int_t p) { fPla = p; };
+ void SetChamber(Int_t c) { fCha = c; };
+ void SetRowSpacing(Double_t s) { fRowSpacing = s; };
+ void SetColSpacing(Double_t s) { fColSpacing = s; };
+ void SetLengthRim(Double_t l) { fLengthRim = l; };
+ void SetWidthRim(Double_t w) { fWidthRim = w; };
+ void SetNcols(Int_t n) { fNcols = n;
+ if (fPadCol) delete[] fPadCol;
+ fPadCol = new Double_t[fNcols]; };
+ void SetNrows(Int_t n) { fNrows = n;
+ if (fPadRow) delete[] fPadRow;
+ fPadRow = new Double_t[fNrows]; };
+ void SetPadCol(Int_t ic, Double_t c) { if (ic < fNcols) fPadCol[ic] = c; };
+ void SetPadRow(Int_t ir, Double_t r) { if (ir < fNrows) fPadRow[ir] = r; };
+ void SetLength(Double_t l) { fLength = l; };
+ void SetWidth(Double_t w) { fWidth = w; };
+ void SetLengthOPad(Double_t l) { fLengthOPad = l; };
+ void SetWidthOPad(Double_t w) { fWidthOPad = w; };
+ void SetLengthIPad(Double_t l) { fLengthIPad = l; };
+ void SetWidthIPad(Double_t w) { fWidthIPad = w; };
+ void SetTiltingAngle(Double_t t) { fTiltingAngle = t;
+ fTiltingTan = TMath::Tan(TMath::Pi()/180.0 * fTiltingAngle); };
+ void SetPadRowSMOffset(Double_t o) { fPadRowSMOffset = o; };
+
Int_t GetPadRowNumber(Double_t z) const;
Int_t GetPadRowNumberROC(Double_t z) const;
Int_t GetPadColNumber(Double_t rphi) const;
return fWidthOPad;
else
return fWidthIPad; };
+
Double_t GetLengthRim() const { return fLengthRim; };
+ Double_t GetWidthRim() const { return fWidthRim; };
- protected:
+ Double_t GetRowSpacing() const { return fRowSpacing; };
+ Double_t GetColSpacing() const { return fColSpacing; };
- AliTRDgeometry *fGeo; //! TRD geometry
+ Double_t GetLengthOPad() const { return fLengthOPad; };
+ Double_t GetLengthIPad() const { return fLengthIPad; };
+
+ Double_t GetWidthOPad() const { return fWidthOPad; };
+ Double_t GetWidthIPad() const { return fWidthIPad; };
+
+ protected:
Int_t fPla; // Plane number
Int_t fCha; // Chamber number
Double_t fTiltingAngle; // Pad tilting angle
Double_t fTiltingTan; // Tangens of pad tilting angle
- Double_t *fPadRow; //! Pad border positions in row direction
- Double_t *fPadCol; //! Pad border positions in column direction
+ Double_t *fPadRow; // Pad border positions in row direction
+ Double_t *fPadCol; // Pad border positions in column direction
Double_t fPadRowSMOffset; // To be added to translate local ROC system to local SM system
- ClassDef(AliTRDpadPlane,3) // TRD ROC pad plane
+ ClassDef(AliTRDpadPlane,4) // TRD ROC pad plane
};
}
// Retrieve TRD geometry -> Maybe there is a better way to do this
- Bool_t kSelfGeom = kFALSE;
- AliTRDgeometry *TRDgeom =0x0;
- if(gAlice) TRDgeom = AliTRDgeometry::GetGeometry(gAlice->GetRunLoader());
- if(!TRDgeom){
- AliWarningGeneral("AliTRDpidESD::GetTrackSegmentKine()", "Cannot load TRD geometry from gAlice! Build a new one.\n");
- TRDgeom = new AliTRDgeometry();
- kSelfGeom = kTRUE;
- }
+ AliTRDgeometry trdGeom;
const Float_t kAmHalfWidth = AliTRDgeometry::AmThick() / 2.;
- const Float_t kDrWidth = AliTRDgeometry::DrThick();
+ const Float_t kDrWidth = AliTRDgeometry::DrThick();
// retrive the magnetic field
Double_t b[3], alpha;
gAlice->Field(xyz0,b); // b[] is in kilo Gauss
Float_t field = b[2] * 0.1; // Tesla
-
// find momentum at chamber entrance and track length in chamber
AliExternalTrackParam *param = (plan<3) ? new AliExternalTrackParam(*t->GetInnerParam()) : new AliExternalTrackParam(*t->GetOuterParam());
- param->PropagateTo(TRDgeom->GetTime0(plan)+kAmHalfWidth, field);
+ param->PropagateTo(trdGeom.GetTime0(plan)+kAmHalfWidth, field);
param->GetXYZ(xyz0);
alpha = param->GetAlpha();
- param->PropagateTo(TRDgeom->GetTime0(plan)-kAmHalfWidth-kDrWidth, field);
+ param->PropagateTo(trdGeom.GetTime0(plan)-kAmHalfWidth-kDrWidth, field);
// eliminate track segments which are crossing SM boundaries along chamber
if(TMath::Abs(alpha-param->GetAlpha())>.01){
delete param;
- if(kSelfGeom) delete TRDgeom;
return kFALSE;
}
param->GetXYZ(xyz1);
param->GetPxPyPz(xyz1);
mom = sqrt(xyz1[0]*xyz1[0] + xyz1[1]*xyz1[1] + xyz1[2]*xyz1[2]);
delete param;
- if(kSelfGeom) delete TRDgeom;
return kTRUE;
}
#include "AliTRDdataArrayI.h"
#include "AliTRDRawStream.h"
-#include "AliTRDCommonParam.h"
#include "AliTRDcalibDB.h"
ClassImp(AliTRDrawData)
AliTRDrawData::AliTRDrawData()
:TObject()
,fRawVersion(2) // Default Raw Data version set here
- ,fCommonParam(0)
- ,fCalibration(0)
,fGeo(0)
,fNumberOfDDLs(0)
{
AliTRDrawData::AliTRDrawData(const AliTRDrawData &r)
:TObject(r)
,fRawVersion(2) // Default Raw Data version set here
- ,fCommonParam(0)
- ,fCalibration(0)
,fGeo(0)
,fNumberOfDDLs(0)
{
fGeo = new AliTRDgeometry();
- fCommonParam = AliTRDCommonParam::Instance();
- if (!fCommonParam) {
- AliError("Could not get common params");
- delete fGeo;
- delete digitsManager;
- return kFALSE;
- }
-
- fCalibration = AliTRDcalibDB::Instance();
- if (!fCalibration) {
+ if (!AliTRDcalibDB::Instance()) {
AliError("Could not get calibration object");
delete fGeo;
delete digitsManager;
Int_t iDet = fGeo->GetDetector(plan, cham, sect);
// If chamber status is ok, we assume that the optical link is also OK.
// This is shown in the GTU link mask.
- if ( fCalibration->GetChamberStatus(iDet) )
+ if ( AliTRDcalibDB::Instance()->GetChamberStatus(iDet) )
GtuCdh = GtuCdh | (3 << (2*plan));
}
of->write((char *) (& GtuCdh), sizeof(GtuCdh));
Int_t plan = fGeo->GetPlane( det ); // Plane
Int_t cham = fGeo->GetChamber( det ); // Chamber
Int_t sect = fGeo->GetSector( det ); // Sector (=iDDL)
- Int_t nRow = fCommonParam->GetRowMax( plan, cham, sect );
- Int_t nCol = fCommonParam->GetColMax( plan );
- const Int_t nTBin = fCalibration->GetNumberOfTimeBins();
+ Int_t nRow = fGeo->GetRowMax( plan, cham, sect );
+ Int_t nCol = fGeo->GetColMax( plan );
+ const Int_t nTBin = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
Int_t kCtype = 0; // Chamber type (0:C0, 1:C1)
Int_t iEv = 0xA; // Event ID. Now fixed to 10, how do I get event id?
UInt_t x = 0; // General used number
class AliRawReader;
class AliTRDdigitsManager;
-class AliTRDCommonParam;
-class AliTRDcalibDB;
class AliTRDgeometry;
class AliTRDdataArrayI;
virtual Int_t ProduceHcDataV1andV2(AliTRDdataArrayI *digits, Int_t side, Int_t det, UInt_t *buf, Int_t maxSize);
Int_t fRawVersion; // Which version of raw simulator is used
- AliTRDCommonParam *fCommonParam; //! Common parameters
- AliTRDcalibDB *fCalibration; //! Offline database interface
AliTRDgeometry *fGeo; //! Geometry
Int_t fNumberOfDDLs; // Number of DDLs
- ClassDef(AliTRDrawData,3) // TRD raw data class
+ ClassDef(AliTRDrawData,4) // TRD raw data class
};
#endif
//
TDirectory *savedir = gDirectory;
- TFile *in = (TFile *) geomfile;
-
- if (!in->IsOpen()) {
- AliWarning("geometry file is not open!\n");
- AliWarning("FULL TRD geometry and DEFAULT TRD parameter will be used\n");
- }
- else {
- in->cd();
- fGeom = (AliTRDgeometry *) in->Get("TRDgeometry");
- }
- if (!fGeom) {
- AliWarning("Cannot find TRD geometry!\n");
- fGeom = new AliTRDgeometry();
- }
+ //TFile *in = (TFile *) geomfile;
+ //
+ //if (!in->IsOpen()) {
+ // AliWarning("geometry file is not open!\n");
+ // AliWarning("FULL TRD geometry and DEFAULT TRD parameter will be used\n");
+ //}
+ //else {
+ // in->cd();
+ // fGeom = (AliTRDgeometry *) in->Get("TRDgeometry");
+ //}
+ //
+ //if (!fGeom) {
+ // AliWarning("Cannot find TRD geometry!\n");
+ // fGeom = new AliTRDgeometry();
+ //}
+ fGeom = new AliTRDgeometry();
fGeom->ReadGeoMatrices();
- savedir->cd();
+ //savedir->cd();
for (Int_t geomS = 0; geomS < kTrackingSectors; geomS++) {
Int_t trS = geomS;
}
}
- AliTRDpadPlane *padPlane = AliTRDCommonParam::Instance()->GetPadPlane(0,0);
+ AliTRDpadPlane *padPlane = fGeom->GetPadPlane(0,0);
Float_t tiltAngle = TMath::Abs(padPlane->GetTiltingAngle());
if (tiltAngle < 0.1) {
fNoTilt = kTRUE;
delete fSeeds;
}
- delete fGeom;
+ if (fGeom) {
+ delete fGeom;
+ }
for (Int_t geomS = 0; geomS < kTrackingSectors; geomS++) {
delete fTrSec[geomS];
Double_t vdrift = AliTRDcalibDB::Instance()->GetVdrift(cluster->GetDetector(),0,0);
Double_t exB = AliTRDcalibDB::Instance()->GetOmegaTau(vdrift,-AliTracker::GetBz()*0.1);
- AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();
- AliTRDpadPlane *padPlane = commonParam->GetPadPlane(plane,chamber);
+ AliTRDpadPlane *padPlane = fGeom->GetPadPlane(plane,chamber);
Double_t zshiftIdeal = 0.5*(padPlane->GetRow0()+padPlane->GetRowEnd());
Double_t localPos[3];
Double_t localPosTracker[3];
}
}
- AliTRDpadPlane *padPlane = AliTRDCommonParam::Instance()->GetPadPlane(0,0);
+ AliTRDpadPlane *padPlane = fGeom->GetPadPlane(0,0);
Double_t h01 = TMath::Tan(-TMath::Pi() / 180.0 * padPlane->GetTiltingAngle());
Double_t hL[6]; // Tilting angle
Double_t xcl[6]; // X - position of reference cluster
Double_t *zc = new Double_t[kNchambers];
Double_t *zmax = new Double_t[kNchambers];
Double_t *zmaxsensitive = new Double_t[kNchambers];
-
- AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();
- if (!commonParam) {
- AliErrorGeneral("AliTRDtrackingSector::Ctor"
- ,"Could not get common parameters\n");
- return;
- }
for (Int_t plane = 0; plane < AliTRDgeometry::Nplan(); plane++) {
ymax = fGeom->GetChamberWidth(plane) / 2.0;
- padPlane = commonParam->GetPadPlane(plane,0);
+ padPlane = fGeom->GetPadPlane(plane,0);
ymaxsensitive = (padPlane->GetColSize(1) * padPlane->GetNcols() - 4.0) / 2.0;
for (Int_t ch = 0; ch < kNchambers; ch++) {
zmax[ch] = fGeom->GetChamberLength(plane,ch) / 2.0;
Float_t pad = padPlane->GetRowSize(1);
- Float_t row0 = commonParam->GetRow0(plane,ch,0);
- Int_t nPads = commonParam->GetRowMax(plane,ch,0);
+ Float_t row0 = fGeom->GetRow0(plane,ch,0);
+ Int_t nPads = fGeom->GetRowMax(plane,ch,0);
zmaxsensitive[ch] = Float_t(nPads) * pad / 2.0;
zc[ch] = -(pad * nPads) / 2.0 + row0;
}
dx = AliTRDcalibDB::Instance()->GetVdrift(0,0,0)
- / commonParam->GetSamplingFrequency();
+ / AliTRDCommonParam::Instance()->GetSamplingFrequency();
rho = 0.00295 * 0.85; //????
radLength = 11.0;
Int_t det = c->GetDetector();
Int_t plane = fGeom->GetPlane(det);
- AliTRDpadPlane *padPlane = AliTRDCommonParam::Instance()->GetPadPlane(plane,0);
+ AliTRDpadPlane *padPlane = fGeom->GetPadPlane(plane,0);
Double_t h01 = TMath::Tan(-TMath::Pi() / 180.0 * padPlane->GetTiltingAngle());
if (fNoTilt) {
#include "AliTrackReference.h"
#include "AliTRDcluster.h"
-#include "AliTRDCommonParam.h"
#include "AliTRDpadPlane.h"
#include "AliTRDcalibDB.h"
#include "AliTracker.h"
fClZXcl->Fill(cls->GetZ(), cls->GetX());
fClZXref->Fill(zref, cls->GetX());
- AliTRDpadPlane *padPlane = AliTRDCommonParam::Instance()->GetPadPlane(plane,0);
+ AliTRDpadPlane *padPlane = fGeo->GetPadPlane(plane,0);
Double_t h01 = TMath::Tan(-TMath::Pi() / 180.0 * padPlane->GetTiltingAngle());
//double dz = zref - padPlane->GetRow0();
fEsdTree = (TTree*)esdFile->Get("esdTree");
fESD = new AliESD();
-
- fEsdTree->SetBranchAddress("ESD", &fESD);
+ fESD->ReadFromTree(fEsdTree);
+ //fEsdTree->SetBranchAddress("ESD", &fESD);
}
//////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// //
-// //
// TRD trigger parameters class //
// //
+// Request an instance with AliTRDCommonParam::Instance() //
+// Then request the needed values //
+// //
// Author: //
// Bogdan Vulpescu //
// //
ClassImp(AliTRDtrigParam)
+AliTRDtrigParam *AliTRDtrigParam::fgInstance = 0;
+Bool_t AliTRDtrigParam::fgTerminated = kFALSE;
+
+//_ singleton implementation __________________________________________________
+AliTRDtrigParam *AliTRDtrigParam::Instance()
+{
+ //
+ // Singleton implementation
+ // Returns an instance of this class, it is created if neccessary
+ //
+
+ if (fgTerminated != kFALSE) {
+ return 0;
+ }
+
+ if (fgInstance == 0) {
+ fgInstance = new AliTRDtrigParam();
+ }
+
+ return fgInstance;
+
+}
+
//_____________________________________________________________________________
-AliTRDtrigParam::AliTRDtrigParam()
- :TNamed()
- ,fDebug(0)
- ,fTime1(0)
- ,fTime2(0)
- ,fClusThr(0)
- ,fPadThr(0)
- ,fSum10(0)
- ,fSum12(0)
- ,fTCOn(0)
- ,fTCnexp(0)
- ,fFilterType(0)
- ,fR1(0)
- ,fR2(0)
- ,fC1(0)
- ,fC2(0)
- ,fPedestal(0)
- ,fADCnoise(0)
- ,fDeltaY(0)
- ,fDeltaS(0)
- ,fXprojPlane(0)
- ,fLtuPtCut(0)
- ,fGtuPtCut(0)
- ,fField(0)
- ,fHighPt(0)
- ,fNPartJetLow(0)
- ,fNPartJetHigh(0)
- ,fJetLowPt(0)
- ,fJetHighPt(0)
+void AliTRDtrigParam::Terminate()
{
//
- // AliTRDtrigParam default constructor
+ // Singleton implementation
+ // Deletes the instance of this class and sets the terminated flag,
+ // instances cannot be requested anymore
+ // This function can be called several times.
//
+ fgTerminated = kTRUE;
+
+ if (fgInstance != 0) {
+ delete fgInstance;
+ fgInstance = 0;
+ }
+
}
//_____________________________________________________________________________
-AliTRDtrigParam::AliTRDtrigParam(const Text_t *name, const Text_t *title)
- :TNamed(name,title)
- ,fDebug(0)
+AliTRDtrigParam::AliTRDtrigParam()
+ :TObject()
,fTime1(2)
,fTime2(22)
,fClusThr(10.0)
,fXprojPlane(0)
,fLtuPtCut(2.3)
,fGtuPtCut(3.0)
- ,fField(0)
,fHighPt(10.0)
,fNPartJetLow(5)
,fNPartJetHigh(3)
,fJetHighPt(5.0)
{
//
- // AliTRDtrigParam constructor
+ // AliTRDtrigParam default constructor
//
// PASA.v.4
fC1 = 0.1141;
fC2 = 0.6241;
}
+
+ Init();
}
//_____________________________________________________________________________
AliTRDtrigParam::AliTRDtrigParam(const AliTRDtrigParam &p)
- :TNamed(p)
- ,fDebug(p.fDebug)
+ :TObject(p)
,fTime1(p.fTime1)
,fTime2(p.fTime2)
,fClusThr(p.fClusThr)
,fXprojPlane(p.fXprojPlane)
,fLtuPtCut(p.fLtuPtCut)
,fGtuPtCut(p.fGtuPtCut)
- ,fField(p.fField)
,fHighPt(p.fHighPt)
,fNPartJetLow(p.fNPartJetLow)
,fNPartJetHigh(p.fNPartJetHigh)
// Copy function
//
- ((AliTRDtrigParam &) p).fDebug = fDebug;
((AliTRDtrigParam &) p).fTime1 = fTime1;
((AliTRDtrigParam &) p).fTime2 = fTime2;
((AliTRDtrigParam &) p).fClusThr = fClusThr;
((AliTRDtrigParam &) p).fDeltaY = fDeltaY;
((AliTRDtrigParam &) p).fDeltaS = fDeltaS;
((AliTRDtrigParam &) p).fXprojPlane = fXprojPlane;
- ((AliTRDtrigParam &) p).fField = fField;
((AliTRDtrigParam &) p).fLtuPtCut = fLtuPtCut;
((AliTRDtrigParam &) p).fGtuPtCut = fGtuPtCut;
((AliTRDtrigParam &) p).fHighPt = fHighPt;
// //
///////////////////////////////////////////////////////////////////////////////
-#include <TNamed.h>
+#include "TObject.h"
-class AliTRDtrigParam : public TNamed {
+class AliTRDtrigParam : public TObject {
public:
- AliTRDtrigParam();
- AliTRDtrigParam(const Text_t* name, const Text_t* title);
AliTRDtrigParam(const AliTRDtrigParam &p);
virtual ~AliTRDtrigParam();
AliTRDtrigParam &operator=(const AliTRDtrigParam &p);
+ static AliTRDtrigParam *Instance();
+ static void Terminate();
+
virtual void Copy(TObject &p) const;
void Init();
c2 = fC2;
ped = fPedestal; };
Float_t GetADCnoise() const { return fADCnoise; };
- Int_t GetDebugLevel() const { return fDebug; };
Float_t GetDeltaY() const { return fDeltaY; };
Float_t GetDeltaS() const { return fDeltaS; };
Float_t GetXprojPlane() const { return fXprojPlane; };
- Float_t GetField() const { return fField; };
Float_t GetLtuPtCut() const { return fLtuPtCut; };
Float_t GetGtuPtCut() const { return fGtuPtCut; };
Float_t GetHighPt() const { return fHighPt; };
fC2 = c2;
fPedestal = ped; };
void SetADCnoise(Float_t adcn) { fADCnoise = adcn; };
- void SetDebugLevel(Int_t deb) { fDebug = deb; };
void SetDeltaY(Float_t dy) { fDeltaY = dy; };
void SetDeltaS(Float_t ds) { fDeltaS = ds; };
- void SetField(Float_t b) { fField = b; };
void SetLtuPtCut(Float_t ptcut) { fLtuPtCut = ptcut; };
void SetGtuPtCut(Float_t ptcut) { fGtuPtCut = ptcut; };
void SetHighPt(Float_t hpt) { fHighPt = hpt; };
protected:
- Int_t fDebug; // Debugging flag
+ static AliTRDtrigParam *fgInstance; // Instance of this class (singleton implementation)
+ static Bool_t fgTerminated; // Defines if this class has already been terminated
Int_t fTime1; // First time bin for tracking (incl.)
Int_t fTime2; // Last time bin for tracking (incl.)
Float_t fLtuPtCut; // Local pt cut
Float_t fGtuPtCut; // Global pt cut
- Float_t fField; // Magnetic field
-
Float_t fHighPt; // High pt selection
Int_t fNPartJetLow; // Number of tracks for jet (low)
Float_t fJetLowPt; // Low pt threshold for jet particles
Float_t fJetHighPt; // High pt threshold for jet particles
- ClassDef(AliTRDtrigParam,2) // TRD trigger parameter class
+ private:
+
+ // This is a singleton, constructor is private!
+ AliTRDtrigParam();
+
+ ClassDef(AliTRDtrigParam,3) // TRD trigger parameter class
};
#include "AliTRDgeometry.h"
#include "AliTRDdataArrayI.h"
#include "AliTRDcalibDB.h"
-#include "AliTRDCommonParam.h"
#include "AliTRDrawData.h"
#include "AliTRDtrigger.h"
#include "AliTRDmodule.h"
:TNamed()
,fField(0)
,fGeo(NULL)
- ,fCalib(NULL)
- ,fCParam(NULL)
- ,fTrigParam(NULL)
,fRunLoader(NULL)
,fDigitsManager(NULL)
,fTrackletTree(NULL)
:TNamed(name,title)
,fField(0)
,fGeo(NULL)
- ,fCalib(NULL)
- ,fCParam(NULL)
- ,fTrigParam(NULL)
,fRunLoader(NULL)
,fDigitsManager(new AliTRDdigitsManager())
,fTrackletTree(NULL)
:TNamed(p)
,fField(p.fField)
,fGeo(NULL)
- ,fCalib(NULL)
- ,fCParam(NULL)
- ,fTrigParam(NULL)
,fRunLoader(NULL)
,fDigitsManager(NULL)
,fTrackletTree(NULL)
// AliTRDtrigger copy constructor
//
+ if (fGeo) {
+ delete fGeo;
+ }
+ fGeo = new AliTRDgeometry();
+
}
///_____________________________________________________________________________
delete fTracks;
}
+ if (fGeo) {
+ delete fGeo;
+ }
+
}
//_____________________________________________________________________________
void AliTRDtrigger::Init()
{
- fModule = new AliTRDmodule(fTrigParam);
+ fModule = new AliTRDmodule();
fTracks->Clear();
- fField = fTrigParam->GetField();
- fGeo = (AliTRDgeometry*)AliTRDgeometry::GetGeometry(fRunLoader);
+ // The magnetic field strength
+ Double_t x[3] = { 0.0, 0.0, 0.0 };
+ Double_t b[3];
+ gAlice->Field(x,b); // b[] is in kilo Gauss
+ fField = b[2] * 0.1; // Tesla
+
+ fGeo = new AliTRDgeometry();
- fCalib = AliTRDcalibDB::Instance();
- if (!fCalib) {
+ if (!AliTRDcalibDB::Instance()) {
AliError("No instance of AliTRDcalibDB.");
return;
}
- fCParam = AliTRDCommonParam::Instance();
- if (!fCParam) {
- AliError("No common parameters.");
- return;
- }
-
}
//_____________________________________________________________________________
for (itrk = 0; itrk < tracklets->GetEntriesFast(); itrk++) {
- fTrk = (AliTRDmcmTracklet*)tracklets->UncheckedAt(itrk);
+ fTrk = (AliTRDmcmTracklet *) tracklets->UncheckedAt(itrk);
idet = fTrk->GetDetector();
iStack = idet / (AliTRDgeometry::Nplan());
Int_t sectEnd = AliTRDgeometry::Nsect();
fTrkTest = new AliTRDmcmTracklet(0,0,0);
- fMCM = new AliTRDmcm(fTrigParam,0);
+ fMCM = new AliTRDmcm(0);
Int_t time;
Int_t col;
}
}
- Int_t nRowMax = fCParam->GetRowMax(iplan,icham,isect);
- Int_t nColMax = fCParam->GetColMax(iplan);
- Int_t nTimeTotal = fCalib->GetNumberOfTimeBins();
+ Int_t nRowMax = fGeo->GetRowMax(iplan,icham,isect);
+ Int_t nColMax = fGeo->GetColMax(iplan);
+ Int_t nTimeTotal = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
// Get the digits
fDigits = fDigitsManager->GetDigits(idet);
}
}
- if (fTrigParam->GetTailCancelation()) {
- fMCM->Filter(fTrigParam->GetNexponential(),fTrigParam->GetFilterType());
+ if (AliTRDtrigParam::Instance()->GetTailCancelation()) {
+ fMCM->Filter(AliTRDtrigParam::Instance()->GetNexponential()
+ ,AliTRDtrigParam::Instance()->GetFilterType());
}
if (fMCM->Run()) {
continue;
}
- if (fTrigParam->GetDebugLevel() > 1) {
- AliInfo(Form("Add tracklet %d in col %02d \n",fNtracklets,fMCM->GetSeedCol()[iSeed]));
- }
+ AliDebug(2,Form("Add tracklet %d in col %02d \n",fNtracklets,fMCM->GetSeedCol()[iSeed]));
if (TestTracklet(idet,row,iSeed,0)) {
AddTracklet(idet,row,iSeed,fNtracklets++);
// Check first the tracklet pt
//
- Int_t nTimeTotal = fCalib->GetNumberOfTimeBins();
+ Int_t nTimeTotal = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
// Calibration fill 2D
AliTRDCalibraFillHisto *calibra = AliTRDCalibraFillHisto::Instance();
fTrkTest->MakeClusAmpGraph();
- if (TMath::Abs(fTrkTest->GetPt()) < fTrigParam->GetLtuPtCut()) {
+ if (TMath::Abs(fTrkTest->GetPt()) < AliTRDtrigParam::Instance()->GetLtuPtCut()) {
return kFALSE;
}
// Add a found tracklet
//
- Int_t nTimeTotal = fCalib->GetNumberOfTimeBins();
+ Int_t nTimeTotal = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
fTrk = new AliTRDmcmTracklet(det,row,n);
// LTU Pt cut
fTrk->MakeTrackletGraph(fGeo,fField);
fTrk->MakeClusAmpGraph();
- if (TMath::Abs(fTrk->GetPt()) < fTrigParam->GetLtuPtCut()) {
+ if (TMath::Abs(fTrk->GetPt()) < AliTRDtrigParam::Instance()->GetLtuPtCut()) {
return;
}
icham = fGeo->GetChamber(trk->GetDetector());
isect = fGeo->GetSector(trk->GetDetector());
- nRowMax = fCParam->GetRowMax(iplan,icham,isect);
+ nRowMax = fGeo->GetRowMax(iplan,icham,isect);
row = trk->GetRow();
fModule->AddTracklet(trk->GetDetector(),
AliTRDgtuTrack *gtutrk;
for (Int_t i = 0; i < nModTracks; i++) {
gtutrk = (AliTRDgtuTrack*)fModule->GetTrack(i);
- if (TMath::Abs(gtutrk->GetPt()) < fTrigParam->GetGtuPtCut()) continue;
+ if (TMath::Abs(gtutrk->GetPt()) < AliTRDtrigParam::Instance()->GetGtuPtCut()) continue;
gtutrk->CookLabel();
gtutrk->MakePID();
AddTrack(gtutrk,det);
class AliTRDgtuTrack;
class AliTRDmcm;
class AliTRDmodule;
-class AliTRDtrigParam;
class AliTRDdigitsManager;
class AliTRDdataArrayI;
class AliTRDgeometry;
-class AliTRDcalibDB;
-class AliTRDCommonParam;
class AliTRDtrigger : public TNamed {
Int_t GetNumberOfTracks() const;
Int_t GetNPrimary() const { return fNPrimary; };
- AliTRDtrigParam *GetParameter() const { return fTrigParam; };
AliTRDgtuTrack *GetTrack(Int_t i) const;
void SetRunLoader(AliRunLoader *rl) { fRunLoader = rl; };
void SetMCMcoordinates(Int_t imcm);
- void SetParameter(AliTRDtrigParam *trigp) { fTrigParam = trigp; };
-
protected:
Float_t fField; //! Magnetic field
AliTRDgeometry *fGeo; //! TRD geometry
- AliTRDcalibDB *fCalib; //! Calibration DB
- AliTRDCommonParam *fCParam; //! Common parameters
- AliTRDtrigParam *fTrigParam; //! Trigger class parameters
AliRunLoader *fRunLoader; //! Run Loader
AliTRDdigitsManager *fDigitsManager; //! TRD digits manager
TTree *fTrackletTree; //! Tree with tracklets
TClonesArray *fTracks; //! Array of GTU tracks
- ClassDef(AliTRDtrigger,3) // TRD trigger class
+ ClassDef(AliTRDtrigger,4) // TRD trigger class
};
#pragma link off all classes;
#pragma link off all functions;
-#pragma link C++ class AliTRDrecPoint+;
#pragma link C++ class AliTRDcluster+;
#pragma link C++ class AliTRDclusterMI+;
-SRCS= AliTRDrecPoint.cxx \
- AliTRDcluster.cxx \
+SRCS= AliTRDcluster.cxx \
AliTRDclusterMI.cxx \
AliTRDclusterizer.cxx \
AliTRDclusterizerV1.cxx \