74 #include <Riostream.h> 77 #include <TGeoManager.h> 78 #include <TGeoVolume.h> 81 static Int_t
FindNodeDepth(
const char* name,
const char* volname);
219 if (&other ==
this)
return *
this;
260 AliFMDDebug(1, (
"Initialising transforms for FMD geometry"));
292 for (Int_t i = 0; i < n; i++) {
293 AliFMDDebug(1, (
"Active vol id # %d: %d", i, active[i]));
326 for (Int_t i = 0; i <
fActive.fN; i++)
327 if (
fActive[i] == vol)
return kTRUE;
435 AliWarning(Form(
"Unknown detector %d", detector));
449 UShort_t& strip)
const 476 for (
int i = 1; i <= 3; i++) {
480 detector = det->
GetId();
491 Double_t& r, Double_t& eta,
492 Double_t& phi, Double_t& theta)
513 if (x == 0 && y == 0 && z == 0)
return kFALSE;
516 phi = TMath::ATan2(y, x);
517 r = TMath::Sqrt(y * y + x * x);
518 theta = TMath::ATan2(r, z);
519 eta = -TMath::Log(TMath::Tan(theta / 2));
557 UShort_t detector = UShort_t(local.X());
558 UShort_t sector = UShort_t(local.Y());
559 UShort_t strip = UShort_t(local.Z());
588 for (Int_t d = 1; d <= 3; d++)
607 Int_t ringDepth =
FindNodeDepth(Form(
"FITV_%d",
int(
'I')),
"ALIC");
617 sectorDepth, moduleDepth, ringDepth, detectorDepth));
618 if (sectorDepth < 0 && moduleDepth < 0) {
624 TGeoVolume* actiVol =
gGeoManager->GetVolume(
"FIAC");
625 TGeoVolume* actoVol =
gGeoManager->GetVolume(
"FOAC");
626 if (actiVol)
AddActive(actiVol->GetNumber());
627 if (actoVol)
AddActive(actoVol->GetNumber());
629 else if (sectorDepth < 0) {
633 fRingOff = (moduleDepth - ringDepth) + 1;
635 TGeoVolume* modiVol =
gGeoManager->GetVolume(
"FIMO");
636 TGeoVolume* modoVol =
gGeoManager->GetVolume(
"FOMO");
637 if (modiVol)
AddActive(modiVol->GetNumber());
638 if (modoVol)
AddActive(modoVol->GetNumber());
644 fModuleOff = (moduleDepth >= 0 ? (stripDepth - moduleDepth) : -1);
645 fRingOff = (stripDepth - ringDepth);
647 TGeoVolume* striVol =
gGeoManager->GetVolume(
"FIST");
648 TGeoVolume* stroVol =
gGeoManager->GetVolume(
"FOST");
649 if (striVol)
AddActive(striVol->GetNumber());
650 if (stroVol)
AddActive(stroVol->GetNumber());
663 CheckNodes(TGeoNode* node,
const char* name, Int_t& lvl)
666 if (!node)
return -1;
669 if (sname == node->GetName())
return lvl;
673 if (!nodes)
return -1;
676 TGeoNode* found =
static_cast<TGeoNode*
>(nodes->FindObject(name));
677 if (found)
return lvl;
680 for (Int_t i = 0; i < nodes->GetEntries(); i++) {
681 TGeoNode* sub =
static_cast<TGeoNode*
>(nodes->At(i));
684 if (CheckNodes(sub, name, lvl) >= 0)
return lvl;
699 std::cerr <<
"No top volume defined" << std::endl;
703 TGeoIterator next(vol);
706 while ((node = next())) {
707 if (sName == node->GetName()) {
710 return next.GetLevel();
717 std::cerr <<
"No nodes in top volume" << std::endl;
723 while ((node = static_cast<TGeoNode*>(next())))
724 if (CheckNodes(node, name, lvl) >= 0)
return lvl;
Geometry parameters of the FMD3 detector. FMD3 has a fairly complicated support structure. The cone also supports the beam-pipe.
Geometry mananger for the FMD.
Declaration of FMD1 declaration.
AliFMDDetector * GetDetector(Int_t i) const
virtual void InitTransformations(Bool_t force=kFALSE)
virtual void SetAlignableVolumes() const
static Int_t FindNodeDepth(const char *name, const char *volname)
virtual void Exec(Option_t *option="")
FMD ring geometry parameters.
void Detector2XYZ(Char_t ring, UShort_t sector, UShort_t strip, Double_t &x, Double_t &y, Double_t &z) const
AliFMDGeometryBuilder * fBuilder
Base class for the geometry description and parameters of the FMD sub detectors FMD1, FMD2, and FMD3.
virtual void UseAssembly(Bool_t use=kTRUE)
#define AliWarning(message)
Bool_t XYZ2Detector(Double_t x, Double_t y, Double_t z, UShort_t &detector, Char_t &ring, UShort_t §or, UShort_t &strip) const
Class to build the FMD geometry.
virtual Bool_t Impact(const TParticle *particle) const
Singleton object of FMD geometry descriptions and parameters. This class is a singleton that handles ...
virtual void SetDetailed(Bool_t use)
TGeoManager * gGeoManager
#define AliFMDDebug(N, A)
AliFMDGeometry & operator=(const AliFMDGeometry &other)
Geometry description and parameters of the FMD1 detector. The FMD1 has only one ring.
Builder of FMD geometry. This class takes care of actually building the geometry using the TGeo class...
void Detector2XYZ(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip, Double_t &x, Double_t &y, Double_t &z) const
void SetActive(Int_t *active, Int_t n)
virtual void GetLocalPosition(TVector3 &pos) const
Bool_t IsActive(Int_t vol) const
Bool_t XYZ2Detector(Double_t x, Double_t y, Double_t z, Char_t &ring, UShort_t §or, UShort_t &strip) const
virtual void SetAlignableVolumes() const
static Bool_t XYZ2REtaPhiTheta(Double_t x, Double_t y, Double_t z, Double_t &r, Double_t &eta, Double_t &phi, Double_t &theta)
Geometry description and parameters of a ring in the FMD detector.
Geometry parameters of the FMD3 detector.
AliFMDRing * GetRing(Char_t i) const
Geometry parameters of the FMD2 detector. This has two rings.
#define AliError(message)
static AliFMDGeometry * Instance()
virtual void InitTransformations()
static AliFMDGeometry * fgInstance
Geometry parameters of the FMD2 detector.
virtual void GetGlobal(const AliRecPoint *p, TVector3 &pos, TMatrixF &mat) const