// //
///////////////////////////////////////////////////////////////////////////////
-#include <Riostream.h>
-#include <stdlib.h>
-
+#include "TBRIK.h"
+#include "TGeometry.h"
+#include "TLorentzVector.h"
+#include "TNode.h"
#include "TVirtualMC.h"
-#include <TBRIK.h>
-#include <TGeometry.h>
-#include <TLorentzVector.h>
-#include <TNode.h>
-#include <TObject.h>
-#include <TVirtualMC.h>
-#include "AliLog.h"
#include "AliConst.h"
-#include "AliRun.h"
-#include "AliMC.h"
+#include "AliLog.h"
#include "AliMagF.h"
+#include "AliMC.h"
+#include "AliRun.h"
+#include "AliTrackReference.h"
#include "AliTOFGeometry.h"
#include "AliTOFGeometryV4.h"
#include "AliTOFv4T0.h"
+extern TDirectory *gDirectory;
+extern TVirtualMC *gMC;
+
+extern AliRun *gAlice;
+
ClassImp(AliTOFv4T0)
//_____________________________________________________________________________
-AliTOFv4T0::AliTOFv4T0()
+ AliTOFv4T0::AliTOFv4T0():
+ fIdFTOA(-1),
+ fIdFTOB(-1),
+ fIdFTOC(-1),
+ fIdFLTA(-1),
+ fIdFLTB(-1),
+ fIdFLTC(-1),
+ fTOFHoles(kFALSE)
{
//
// Default constructor
}
//_____________________________________________________________________________
-AliTOFv4T0::AliTOFv4T0(const char *name, const char *title)
- : AliTOF(name,title,"tzero")
+AliTOFv4T0::AliTOFv4T0(const char *name, const char *title):
+ AliTOF(name,title,"tzero"),
+ fIdFTOA(-1),
+ fIdFTOB(-1),
+ fIdFTOC(-1),
+ fIdFLTA(-1),
+ fIdFLTB(-1),
+ fIdFLTC(-1),
+ fTOFHoles(kFALSE)
{
//
// Standard constructor
// put TOF
- AliModule* frame=gAlice->GetModule("FRAME");
+ AliModule* frame = (AliModule*)gAlice->GetModule("FRAME");
if(!frame) {
AliFatal("TOF needs FRAME to be present");
} else{
TNode *node, *top;
const int kColorTOF = 27;
+ TGeometry *globalGeometry = (TGeometry*)gAlice->GetGeometry();
+
// Find top TNODE
- top = gAlice->GetGeometry()->GetNode("alice");
+ top = (TNode*)globalGeometry->GetNode("alice");
// Position the different copies
const Float_t krTof =(fTOFGeometry->Rmax()+fTOFGeometry->Rmin())/2.;
gMC->Gdopt("hide","off");
}
//_____________________________________________________________________________
-void AliTOFv4T0::DrawDetectorModules()
+void AliTOFv4T0::DrawDetectorModules() const
{
//
// Draw a shaded view of the TOF detector version 4
}
//_____________________________________________________________________________
-void AliTOFv4T0::DrawDetectorStrips()
+void AliTOFv4T0::DrawDetectorStrips() const
{
//
// Draw a shaded view of the TOF strips for version 4
// Revision: F. Pierella 18-VI-2002
//
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
- //
+ AliMagF *magneticField = (AliMagF*)gAlice->Field();
+
+ Int_t isxfld = magneticField->Integ();
+ Float_t sxmgmx = magneticField->Max();
+
//--- Quartz (SiO2) to simulate float glass
// density tuned to have correct float glass
// radiation length
TLorentzVector mom, pos;
Float_t xm[3],pm[3],xpad[3],ppad[3];
- Float_t hits[14],phi,phid,z;
+ Float_t hits[14];
Int_t vol[5];
Int_t sector, plate, padx, padz, strip;
Int_t copy, padzid, padxid, stripid, i;
if(
gMC->IsTrackEntering()
&& gMC->TrackCharge()
- && gMC->GetMedium()==idtmed[513]
+ //&& gMC->GetMedium()==idtmed[513]
+ && gMC->CurrentMedium()==idtmed[513]
&& gMC->CurrentVolID(copy)==fIdSens
)
{
- AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
+ AliMC *mcApplication = (AliMC*)gAlice->GetMCApp();
+
+ AddTrackReference(mcApplication->GetCurrentTrackNumber(), AliTrackReference::kTOF);
+ //AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
// getting information about hit volumes
incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
- z = pos[2];
+ const char * pathA="FTOA";
+ const char * pathB="FTOB";
+ const char * pathC="FTOC";
+ const char * path71="B071";
+ const char * path75="B075";
+ const char * path74="B074";
+ const char* volpath;
- plate = -1;
+ Int_t index=0;
+ volpath=gMC->CurrentVolOffName(6);
+ index=gMC->CurrentVolOffID(6,copy);
+ index=copy;
+
+
+ plate=-1;
+ if(strcmp(pathC,volpath)==0 && index==1)plate=0;
+ if(strcmp(pathB,volpath)==0 && index==1)plate=1;
+ if(strcmp(pathA,volpath)==0 && index==0)plate=2;
+ if(strcmp(pathB,volpath)==0 && index==2)plate=3;
+ if(strcmp(pathC,volpath)==0 && index==2)plate=4;
- if (TMath::Abs(z) <= fTOFGeometry->ZlenA()*0.5) plate = 2;
- if (z < (fTOFGeometry->ZlenA()*0.5+fTOFGeometry->ZlenB()) &&
- z > fTOFGeometry->ZlenA()*0.5) plate = 1;
- if (z >-(fTOFGeometry->ZlenA()*0.5+fTOFGeometry->ZlenB()) &&
- z < -fTOFGeometry->ZlenA()*0.5) plate = 3;
- if (z > (fTOFGeometry->ZlenA()*0.5+fTOFGeometry->ZlenB())) plate = 0;
- if (z <-(fTOFGeometry->ZlenA()*0.5+fTOFGeometry->ZlenB())) plate = 4;
if (plate==0) strip=fTOFGeometry->NStripC()-strip;
- phi = pos.Phi();
- if (phi>=0.) phid = phi*kRaddeg;
- else phid = phi*kRaddeg + 360.;
+ volpath=gMC->CurrentVolOffName(8);
+ index=gMC->CurrentVolOffID(8,copy);
+ index=copy;
- sector = Int_t (phid/20.);
+ sector=-1;
+ if(strcmp(path71,volpath)==0 && index <6) sector=12+index;
+ if(strcmp(path71,volpath)==0 && index >=6) sector=index-3;
+ if(strcmp(path75,volpath)==0) sector=index-1;
+ if(strcmp(path74,volpath)==0) sector=10+index;
for(i=0;i<3;++i) {
hits[i] = pos[i];
vol[3]= padx;
vol[4]= padz;
- AddT0Hit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
+ AddT0Hit(mcApplication->GetCurrentTrackNumber(),vol, hits);
+ //AddT0Hit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
}
}