#include "AliMagF.h"
#include "AliRun.h"
#include "AliTrackReference.h"
+#include "AliRawReader.h"
#include "AliTRD.h"
#include "AliTRDdigit.h"
#include "AliTRDpoints.h"
#include "AliTRDrawData.h"
#include "AliTRDSimParam.h"
-#include "AliTRDRecParam.h"
#include "AliTRDCommonParam.h"
#include "AliTRDcalibDB.h"
,fGeometry(0)
,fGasDensity(0)
,fFoilDensity(0)
+ ,fGasNobleFraction(0)
,fDrawTR(0)
,fDisplayType(0)
{
,fGeometry(0)
,fGasDensity(0)
,fFoilDensity(0)
+ ,fGasNobleFraction(0)
,fDrawTR(0)
,fDisplayType(0)
{
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);
-
}
//_____________________________________________________________________________
AliTRDdigitizer digitizer("TRDdigitizer","TRD digitizer class");
AliLog::SetClassDebugLevel("TRDdigitizer",AliDebugLevel());
-
+
// Initialization
digitizer.InitDetector();
,q
,time);
- printf("AliTRD::AddHit --- time = %f\n",time);
-
if (inDrift) {
hit->SetDrift();
}
Float_t zmax1;
Float_t zmax2;
- Int_t iPlan;
+ Int_t iLayer;
const Int_t kColorTRD = 46;
if (fDisplayType == 0) {
- pgon = new TPGON("S_TRD","TRD","void",0,360,AliTRDgeometry::Nsect(),4);
+ pgon = new TPGON("S_TRD","TRD","void",0,360,AliTRDgeometry::Nsector(),4);
rmin = kRmin;
rmax = kRmax;
pgon->DefineSection(0,-kZmax1,rmax,rmax);
zmax2 = kZmax2 + slope * thickness;
zmax1 = zmax2 + slope * AliTRDgeometry::DrThick();
- for (iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) {
+ for (iLayer = 0; iLayer < AliTRDgeometry::Nlayer(); iLayer++) {
- sprintf(name,"S_TR1%d",iPlan);
- pgon = new TPGON(name,"TRD","void",0,360,AliTRDgeometry::Nsect(),4);
+ sprintf(name,"S_TR1%d",iLayer);
+ pgon = new TPGON(name,"TRD","void",0,360,AliTRDgeometry::Nsector(),4);
pgon->DefineSection(0,-zmax1,rmax,rmax);
pgon->DefineSection(1,-zmax2,rmin,rmax);
pgon->DefineSection(2, zmax2,rmin,rmax);
zmax2 = kZmax2 + slope * thickness;
zmax1 = zmax2 + slope * AliTRDgeometry::AmThick();
- for (iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) {
+ for (iLayer = 0; iLayer < AliTRDgeometry::Nlayer(); iLayer++) {
- sprintf(name,"S_TR2%d",iPlan);
- pgon = new TPGON(name,"TRD","void",0,360,AliTRDgeometry::Nsect(),4);
+ sprintf(name,"S_TR2%d",iLayer);
+ pgon = new TPGON(name,"TRD","void",0,360,AliTRDgeometry::Nsector(),4);
pgon->DefineSection(0,-zmax1,rmax,rmax);
pgon->DefineSection(1,-zmax2,rmin,rmax);
pgon->DefineSection(2, zmax2,rmin,rmax);
Float_t aco[2] = { 12.011 , 15.9994 };
Float_t zco[2] = { 6.0 , 8.0 };
Float_t wco[2] = { 1.0 , 2.0 };
- Float_t dco = 0.00186;
+ Float_t dco = 0.00186; // at 20C
// For water
Float_t awa[2] = { 1.0079, 15.9994 };
Float_t wwa[2] = { 2.0 , 1.0 };
Float_t dwa = 1.0;
- // For isobutane (C4H10)
- Float_t ais[2] = { 12.011 , 1.0079 };
- Float_t zis[2] = { 6.0 , 1.0 };
- Float_t wis[2] = { 4.0 , 10.0 };
- Float_t dis = 0.00267;
-
// For plexiglas (C5H8O2)
Float_t apg[3] = { 12.011 , 1.0079, 15.9994 };
Float_t zpg[3] = { 6.0 , 1.0 , 8.0 };
Float_t wXeCO2[3] = { 8.5 , 1.5 , 3.0 };
// Xe-content of the Xe/CO2-mixture (85% / 15%)
Float_t fxc = 0.85;
- Float_t dxe = 0.00549;
- Float_t dgm = fxc * dxe + (1.0 - fxc) * dco;
+ Float_t dxe = 0.00549; // at 20C
+ Float_t dgmXe = fxc * dxe + (1.0 - fxc) * dco;
+
+ // For Ar/CO2-gas-mixture
+ Float_t aArCO2[3] = { 39.948 , 12.0107 , 15.9994 };
+ Float_t zArCO2[3] = { 18.0 , 6.0 , 8.0 };
+ Float_t wArCO2[3] = { 8.2 , 1.8 , 3.6 };
+ // Ar-content of the Ar/CO2-mixture (82% / 18%)
+ Float_t fac = 0.82;
+ Float_t dar = 0.00166; // at 20C
+ Float_t dgmAr = fac * dar + (1.0 - fac) * dco;
// General tracking parameter
Float_t tmaxfd = -10.0;
AliMixture(2, "Air" , aAir, zAir, dAir, 4, wAir );
AliMixture(3, "Polyethilene", ape, zpe, dpe, -2, wpe );
AliMixture(8, "CO2", aco, zco, dco, -2, wco );
- AliMixture(9, "Isobutane", ais, zis, dis, -2, wis );
- AliMixture(10,"Gas mixture", aXeCO2, zXeCO2, dgm, -3, wXeCO2);
+ if (AliTRDSimParam::Instance()->IsXenon()) {
+ AliMixture(10,"XeCO2", aXeCO2, zXeCO2, dgmXe, -3, wXeCO2);
+ }
+ else if (AliTRDSimParam::Instance()->IsArgon()) {
+ AliInfo("Gas mixture: Ar C02 (80/20)");
+ AliMixture(10,"ArCO2", aArCO2, zArCO2, dgmAr, -3, wArCO2);
+ }
+ else {
+ AliFatal("Wrong gas mixture");
+ exit(1);
+ }
AliMixture(12,"G10", aG10, zG10, dG10, 4, wG10 );
AliMixture(13,"Water", awa, zwa, dwa, -2, wwa );
AliMixture(14,"Plexiglas", apg, zpg, dpg, -3, wpg );
// Save the density values for the TRD absorbtion
Float_t dmy = 1.39;
fFoilDensity = dmy;
- fGasDensity = dgm;
+ if (AliTRDSimParam::Instance()->IsXenon()) {
+ fGasDensity = dgmXe;
+ fGasNobleFraction = fxc;
+ }
+ else if (AliTRDSimParam::Instance()->IsArgon()) {
+ fGasDensity = dgmAr;
+ fGasNobleFraction = fac;
+ }
}
gMC->Gdman(18, 4, "MAN");
}
-
-//_____________________________________________________________________________
-Int_t AliTRD::DistancetoPrimitive(Int_t , Int_t )
-{
- //
- // Distance between the mouse and the TRD detector on the screen
- // Dummy routine
- //
-
- return 9999;
-
-}
//_____________________________________________________________________________
void AliTRD::Init()
if (fGeometry->IsVersion() != 1) {
AliError("Not a valid geometry");
}
+
// Special tracking options for charged particles for XeCO2
- gMC->Gstpar((* fIdtmed)[9],"DRAY",1.0);
- gMC->Gstpar((* fIdtmed)[9],"STRA",1.0);
-
+ gMC->Gstpar((* fIdtmed)[9],"DRAY" , 1.0);
+ gMC->Gstpar((* fIdtmed)[9],"STRA" , 1.0);
+ gMC->Gstpar((* fIdtmed)[9],"LOSS" ,13.0); // Specific energy loss
+ gMC->Gstpar((* fIdtmed)[9],"PRIMIO_E",23.53); // 1st ionisation potential
+ gMC->Gstpar((* fIdtmed)[9],"PRIMIO_N",19.344431); // Number of primaries
+
}
//_____________________________________________________________________________
}
//_____________________________________________________________________________
-AliTRD &AliTRD::operator=(const AliTRD &trd)
+Bool_t AliTRD::Raw2SDigits(AliRawReader *rawReader)
{
//
- // Assignment operator
+ // Converts RAW data to SDigits
//
- if (this != &trd) {
- ((AliTRD &) trd).Copy(*this);
+ AliLoader *loader = fRunLoader->GetLoader("TRDLoader");
+ if (!loader) {
+ AliError("Can not get TRD loader from Run Loader");
+ return kFALSE;
+ }
+
+ TTree *tree = 0;
+ tree = loader->TreeS();
+ if (!tree) {
+ loader->MakeTree("S");
+ tree = loader->TreeS();
+ }
+
+ AliTRDrawData *rawdata = new AliTRDrawData();
+ AliTRDdigitsManager *sdigitsManager = rawdata->Raw2Digits(rawReader);
+ if (sdigitsManager) {
+ sdigitsManager->SetSDigits(kTRUE);
+ sdigitsManager->MakeBranch(tree);
+ sdigitsManager->WriteDigits();
+ return kTRUE;
+ }
+ else {
+ return kFALSE;
}
- return *this;
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+}
+//_____________________________________________________________________________
+AliLoader* AliTRD::MakeLoader(const char* topfoldername)
+{
+ fLoader = new AliLoader(GetName(),topfoldername);
+ AliInfo("Adding Tracklets-loader");
+ AliDataLoader *dl = new AliDataLoader("TRD.Tracklets.root","tracklets", "tracklets");
+ fLoader->AddDataLoader(dl);
+ return fLoader;
+}
+//_____________________________________________________________________________
+AliTRD &AliTRD::operator=(const AliTRD &trd)
+{
+ //
+ // Assignment operator
+ //
+ if (this != &trd) {
+ ((AliTRD &) trd).Copy(*this);
+ }
+ return *this;
+}