maxStepSize,maxEnergyLoss,precision,minStepSize);
}
+ // Stainless steel
+ {
+ Float_t as[] = { 55.847, 51.9961, 58.6934, 28.0855 };
+ Float_t zs[] = { 26., 24., 28., 14. };
+ Float_t ws[] = { .715, .18, .1, .005 };
+ density = 7.88;
+ id = kSteelId;
+ AliMixture(id, "Steel$", as, zs, density, 4, ws);
+ AliMedium(kSteelId, "Steel$", id, 0, fieldType, maxField, maxBending,
+ maxStepSize, maxEnergyLoss, precision, minStepSize);
+ }
// Plastic
{
Float_t as[] = { 1.01, 12.01 };
AliMedium(kPlasticId, "Plastic$", id,0,fieldType,maxField,maxBending,
maxStepSize,maxEnergyLoss,precision,minStepSize);
}
+
}
//____________________________________________________________________
kAlId, // ID index of Al medium
kCarbonId, // ID index of Carbon medium
kCopperId, // ID index of Copper Medium
- kKaptonId // ID index of Kapton Medium
+ kKaptonId, // ID index of Kapton Medium
+ kSteelId // ID index of Steel medium
};
TObjArray* fBad; //! debugging - bad hits
// Initialize
AliFMDDetector::Init();
SetInnerHoneyHighR(GetOuterHoneyHighR());
- Double_t zdist = fConeLength - fBackLength - fNoseLength;
+ Double_t zdist = fConeLength;
Double_t tdist = fBackHighR - fNoseHighR;
- Double_t innerZh = fInnerZ - fInner->GetRingDepth() - fHoneycombThickness;
- Double_t outerZh = fOuterZ - fOuter->GetRingDepth() - fHoneycombThickness;
+ Double_t innerZh = (fInnerZ - fInner->GetRingDepth());
+ Double_t outerZh = (fOuterZ - fOuter->GetRingDepth() -
+ fOuter->GetHoneycombThickness());
Double_t minZ = TMath::Min(fNoseZ - fConeLength, outerZh);
fAlpha = tdist / zdist;
fZ = fNoseZ + (minZ - fNoseZ) / 2;
- fInnerHoneyHighR = ConeR(innerZh + fHoneycombThickness,"O") - 1;
+ fInnerHoneyHighR = ConeR(innerZh,"I");
fOuterHoneyHighR = GetBackLowR();
}
AliWarning(Form("z=%lf is before start of cone %lf", z, fNoseZ));
return -1;
}
- if (z < fOuterZ - fOuter->GetRingDepth() - fHoneycombThickness) {
+ if (z < fOuterZ - fOuter->GetFullDepth()) {
AliWarning(Form("z=%lf is after end of cone %lf", z,
- fOuterZ - fOuter->GetRingDepth() - fHoneycombThickness));
+ fOuterZ - fOuter->GetFullDepth()));
return -1;
}
- Double_t e = fBeamThickness / TMath::Cos(TMath::ATan(fAlpha));
- if (opt[0] == 'I' || opt[1] == 'i') e *= -1;
- if (z > fNoseZ - fNoseLength) return fNoseHighR + e;
- if (z < fNoseZ - fConeLength + fBackLength) return fBackHighR + e;
- Double_t r = fNoseHighR + fAlpha * TMath::Abs(z - fNoseZ + fNoseLength) + e;
- return r;
+ Bool_t inner = opt[0] == 'I' || opt[1] == 'i';
+ Double_t off1 = (inner ? fNoseLowR : fNoseHighR);
+ Double_t off2 = (inner ? fBackLowR : fBackHighR);
+ Double_t off3 = (inner ? 0 : fBeamThickness/fAlpha);
+ if (z > fNoseZ - fNoseLength) return off1;
+ if (z < fNoseZ - fConeLength + fBackLength) return off2;
+ return (off1 + off3 + fAlpha * TMath::Abs(z - fNoseZ + fNoseLength));
}
/** @param t Thickness of support beams */
void SetBeamThickness(Double_t t=.5) { fBeamThickness = t; }
/** @param w Width of support beams */
- void SetBeamWidth(Double_t w=6) { fBeamWidth = w; }
+ void SetBeamWidth(Double_t w=5) { fBeamWidth = w; }
/** @param l Length of the cone in Z */
void SetConeLength(Double_t l=30.9) { fConeLength = l; }
/** @param r Outer radius of flanges */
#include <TGeoNode.h>
// #include <TGeoVolume.h>
#include <TROOT.h>
+#include <TClass.h>
//====================================================================
ClassImp(AliFMDAlignFaker)
#define IS_NODE_SENSOR(name) \
(name[0] == 'F' && name[2] == 'S' && name[3] == 'E')
+//__________________________________________________________________
+Bool_t
+AliFMDAlignFaker::GetGeometry(Bool_t toCdb, const TString& storage)
+{
+ if (!toCdb) {
+ //load geom from default CDB storage
+ AliGeomManager::LoadGeometry();
+ return kTRUE;
+ }
+ if(!storage.BeginsWith("local://") &&
+ !storage.BeginsWith("alien://")) {
+ AliErrorClass(Form("STORAGE=\"%s\" invalid. Exiting\n", storage.Data()));
+ return kFALSE;
+ }
+
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ AliCDBStorage* store = cdb->GetStorage(storage.Data());
+ if(!store){
+ AliErrorClass(Form("Unable to open storage %s\n", storage.Data()));
+ return kFALSE;
+ }
+
+ AliCDBPath path("GRP","Geometry","Data");
+ AliCDBEntry* entry = store->Get(path.GetPath(),cdb->GetRun());
+ if(!entry) {
+ AliErrorClass("Could not get the specified CDB entry!");
+ return kFALSE;
+ }
+
+
+ entry->SetOwner(0);
+ TGeoManager* geom = static_cast<TGeoManager*>(entry->GetObject());
+ AliGeomManager::SetGeometry(geom);
+ return kTRUE;
+}
+
//__________________________________________________________________
void
AliFMDAlignFaker::Exec(Option_t*)
return;
}
file->cd();
- fArray->Write("FMDAlignment");
+ fArray->Write("FMDAlignment",TObject::kSingleKey);
file->Write();
file->Close();
}
/** Make the alignment objects.
@param option Not used. */
void Exec(Option_t* option="");
+ /** Get the geometry */
+ static Bool_t GetGeometry(Bool_t toCdb=kFALSE,
+ const TString& storage=TString());
protected:
AliFMDAlignFaker(const AliFMDAlignFaker& o)
: TTask(o),
fId(id),
fInnerZ(0.),
fOuterZ(0.),
- fHoneycombThickness(0.),
- fAlThickness(0.),
fInnerHoneyLowR(0.),
fInnerHoneyHighR(0.),
fOuterHoneyLowR(0.),
// INNER Inner ring geometry
// OUTER Outer ring geometry (if any)
//
- SetHoneycombThickness();
- SetAlThickness();
SetInnerHoneyLowR(0);
SetInnerHoneyHighR(0);
SetInnerZ(0);
fId(other.fId),
fInnerZ(0.),
fOuterZ(0.),
- fHoneycombThickness(0.),
- fAlThickness(0.),
fInnerHoneyLowR(0.),
fInnerHoneyHighR(0.),
fOuterHoneyLowR(0.),
fOuterTransforms(other.fOuterTransforms)
{
// Copy constructor
- SetHoneycombThickness(other.GetHoneycombThickness());
- SetAlThickness(other.GetAlThickness());
SetInnerHoneyLowR(other.GetInnerHoneyLowR());
SetInnerHoneyHighR(other.GetInnerHoneyHighR());
SetInnerZ(other.GetInnerZ());
fOuter = other.fOuter;
fInnerTransforms = other.fInnerTransforms;
fOuterTransforms = other.fOuterTransforms;
- SetHoneycombThickness(other.GetHoneycombThickness());
- SetAlThickness(other.GetAlThickness());
SetInnerHoneyLowR(other.GetInnerHoneyLowR());
SetInnerHoneyHighR(other.GetInnerHoneyHighR());
SetInnerZ(other.GetInnerZ());
#define IS_NODE_THIS(name) \
(name[0] == 'F' && name[2] == 'M' && name[1] == Char_t(48+fId) && \
(name[3] == 'T' || name[3] == 'B'))
-#define IS_NODE_SENSOR(name) \
- (name[0] == 'F' && name[2] == 'S' && name[3] == 'E')
+#define IS_NODE_SENSOR(name) \
+ (name[0] == 'F' && (name[2] == 'B' || name[2] == 'F') && name[3] == 'H')
+//#define IS_NODE_SENSOR(name) \
+// (name[0] == 'F' && name[2] == 'S' && name[3] == 'E')
#define IS_NODE_HALF(name) \
(name[0] == 'F' && name[2] == 'M' && (name[3] == 'B' || name[3] == 'T'))
#define HALF_FORMAT "FMD/FMD%d_%c"
# define DEGRAD TMath::Pi() / 180.
Double_t local[] = { rho * TMath::Cos(phi * DEGRAD),
rho * TMath::Sin(phi * DEGRAD),
- -modThick + siThick / 2 };
+ /* -modThick + */ siThick / 2 };
Double_t master[3];
AliFMDDebug(30, ("Local (%7.3f,%7.3f,%7.3f)",local[0], local[1], local[2]));
m->LocalToMaster(local, master);
void SetInnerZ(Double_t x) { fInnerZ = x; }
/** @param x Position of outer ring along z */
void SetOuterZ(Double_t x) { fOuterZ = x; }
- /** @param x Thickness of honeycomb plate */
- void SetHoneycombThickness(Double_t x=1) { fHoneycombThickness = x; }
- /** @param x Thickness of aluminium of honeycomb */
- void SetAlThickness(Double_t x=.1) { fAlThickness = x; }
/** @param x Inner radius of inner honeycomb */
void SetInnerHoneyLowR(Double_t x) { fInnerHoneyLowR = x; }
/** @param x Outer radius of inner honeycomb */
Double_t GetInnerZ() const { return fInnerZ; }
/** @return Position of outer ring along z */
Double_t GetOuterZ() const { return fOuterZ; }
- /** @return Thickness of honeycomb plate */
- Double_t GetHoneycombThickness() const { return fHoneycombThickness; }
- /** @return Thickness of aluminium of honeycomb */
- Double_t GetAlThickness() const { return fAlThickness; }
/** @return Inner radius of inner honeycomb */
Double_t GetInnerHoneyLowR() const { return fInnerHoneyLowR; }
/** @return Outer radius of inner honeycomb */
Int_t fId; // Detector number
Double_t fInnerZ; // Position of outer ring along z
Double_t fOuterZ; // Position of outer ring along z
- Double_t fHoneycombThickness; // Thickness of honeycomb plate
- Double_t fAlThickness; // Thickness of aluminium of honeycomb
Double_t fInnerHoneyLowR; // Inner radius of inner honeycomb
Double_t fInnerHoneyHighR; // Outer radius of inner honeycomb
Double_t fOuterHoneyLowR; // Inner radius of outer honeycomb
TObjArray* fInnerTransforms; // List of inner module global
TObjArray* fOuterTransforms; // List of outer module global
- ClassDef(AliFMDDetector, 1); //
+ ClassDef(AliFMDDetector, 2); //
};
#endif
#include <TMarker3DBox.h>
#include <TMath.h>
#include <TSlider.h>
+#include <TSliderBox.h>
#include <TStyle.h>
#include <TView.h>
#include <TVirtualX.h>
+#include <TVirtualViewer3D.h>
+#include <TList.h>
// #include <TArrayF.h>
// #include <TParticle.h>
fPad(0),
fButtons(0),
fSlider(0),
+ fFactor(0),
fZoomMode(kFALSE),
fX0(0),
fY0(0),
fX1(0),
fY1(0),
- fMultCut(0),
- fPedestalFactor(0),
fXPixel(0),
fYPixel(0),
fOldXPixel(0),
fOnlyFMD(onlyFMD),
fSpec(0),
fSpecCut(0),
- fAux(0)
+ fAux(0),
+ fReturn(kFALSE)
{
// Constructor of an FMD display object.
// Must be called
AddLoad(kGeometry);
if (fgInstance) delete fgInstance;
fgInstance = this;
- SetMultiplicityCut();
- SetPedestalFactor();
}
//____________________________________________________________________
// Parameters:
// which Which button to put up.
gStyle->SetPalette(1);
+ // gStyle->SetCanvasPreferGL(kTRUE);
Double_t y1 = .10;
Int_t w = 700;
- fCanvas = new TCanvas("display", "Display", w, Int_t(w / (1-y1)));
+ fCanvas = new TCanvas("gldisplay", "Display", w, Int_t(w / (1-y1)));
fCanvas->SetFillColor(1);
fCanvas->ToggleEventStatus();
fCanvas->cd();
- fPad = new TPad("view", "3DView", 0.0, y1, 1.0, 1.0, 1, 0, 0);
+ fPad = new TPad("glview", "3DView", 0.0, y1, 1.0, 1.0, 1, 0, 0);
fPad->Draw();
+
+ const char** p = which;
+ const char* m;
+ Int_t n = 0;
+ Int_t j = 0;
+ while (*(p++)) n++;
+ AliInfo(Form("Got %d buttons", n));
+ if (n <= 0) return;
Double_t yb = 0;
+ Double_t xb = 1;
fCanvas->cd();
- if (TESTBIT(fTreeMask, kESD) ||
+ if (TESTBIT(fTreeMask, kDigits)) {
+ yb = .05;
+ xb = .66;
+ fFactor = new TSlider("pedFactor", "Pedestal Factor", xb+.01, 0, 1, yb);
+ fFactor->SetMethod("AliFMDDisplay::Instance()->ChangeFactor()");
+ fFactor->SetRange(3./10, 1);
+ fFactor->Draw();
+ TSliderBox *sbox =
+ static_cast<TSliderBox*>(fFactor->GetListOfPrimitives()->
+ FindObject("TSliderBox"));
+ if (sbox) {
+ sbox->SetToolTipText("Adjust the noise suppression factor by moving "
+ "lower limit");
+ }
+ }
+ if (TESTBIT(fTreeMask, kHits) ||
+ TESTBIT(fTreeMask, kESD) ||
TESTBIT(fTreeMask, kDigits) ||
TESTBIT(fTreeMask, kRaw)) {
yb = .05;
- fSlider = new TSlider("multCut", "Multiplicity cut", 0, 0, 1, yb);
+ fSlider = new TSlider("genCut", "Multiplicity cut", 0, 0, xb, yb);
fSlider->SetMethod("AliFMDDisplay::Instance()->ChangeCut()");
+ fSlider->SetRange(0,1);
fSlider->Draw();
- fSlider->SetMinimum(TESTBIT(fTreeMask, kESD) ? fMultCut * 10 :
- fPedestalFactor * 10);
+ TSliderBox *sbox =
+ static_cast<TSliderBox*>(fSlider->GetListOfPrimitives()->
+ FindObject("TSliderBox"));
+ if (sbox) {
+ sbox->SetToolTipText("Adjust lower and upper limit on data signal");
+ }
}
- const char** p = which;
- const char* m;
- Int_t n = 0;
- Int_t j = 0;
- while (*(p++)) n++;
- AliInfo(Form("Got %d buttons", n));
Float_t x0 = 0;
Float_t dx = 1. / n;
p = which;
fCanvas->cd();
AliInfo(Form("Adding button %s", m));
TButton* b = new TButton(m, Form("AliFMDDisplay::Instance()->%s()", m),
- x0, yb, x0 + dx, y1);
+ x0, yb, TMath::Min(x0 + dx,.999F), y1);
b->Draw();
fButtons.Add(b);
x0 += dx;
Bool_t hasFMD1 = kFALSE;
Bool_t hasFMD2 = kFALSE;
Bool_t hasFMD3 = kFALSE;
- TObjArray toshow;
+ AliInfo("Getting material FMD_Si$");
+ TGeoMaterial* si = gGeoManager->GetMaterial("FMD_Si$"); // kRed
+ AliInfo("Getting material FMD_Carbon$");
+ TGeoMaterial* c = gGeoManager->GetMaterial("FMD_Carbon$"); // kGray
+ AliInfo("Getting material FMD_Aluminum$");
+ TGeoMaterial* al = gGeoManager->GetMaterial("FMD_Aluminum$");// kGray-2
+ AliInfo("Getting material FMD_Copper$");
+ TGeoMaterial* cu = gGeoManager->GetMaterial("FMD_Copper$"); // kGreen-2
+ AliInfo("Getting material FMD_PCB$");
+ TGeoMaterial* pcb = gGeoManager->GetMaterial("FMD_PCB$"); // kGreen+2
+ AliInfo("Getting material FMD_PCB$");
+ TGeoMaterial* chip = gGeoManager->GetMaterial("FMD_Si Chip$");// kGreen+2
+ TObjArray toshow;
while ((node = static_cast<TGeoNode*>(next()))) {
const char* name = node->GetName();
if (!name) continue;
if (!(v = node->GetVolume())) continue;
if (name[0] == 'F') {
+ TGeoMaterial* m = (v->IsAssembly() ? 0 : v->GetMaterial());
+ Int_t col = -1;
+ if (m == si) col = kRed;
+ else if (m == c) col = kGray;
+ else if (m == al) col = kYellow+4;
+ else if (m == cu) col = kRed+6;
+ else if (m == pcb) col = kGreen+2;
+ else if (m == chip) col = kGreen+4;
+ if (col >= 0) {
+ v->SetLineColor(col);
+ v->SetFillColor(col);
+ }
if (name[2] == 'M' && (name[3] == 'T' || name[3] == 'B')) {
// Virtual Master half-ring volume - top-level
Int_t det = node->GetNumber();
}
else if (name[3] == 'V' && (name[2] == 'T' || name[2] == 'B'))
toshow.Add(v); // Virtual Half-ring, bare detectors
+ else if (name[3] == 'H' && (name[2] == 'F' || name[2] == 'B'))
+ toshow.Add(v); // Virtual Hybrid container
+ else if (name[2] == 'S' && name[3] == 'U')
+ toshow.Add(v); // Virtual support structre
// else if (name[3] == 'H' && (name[2] == 'F' || name[2] == 'B'))
// toshow.Add(v); // Virtual Hybrid container
}
}
TIter i(&toshow);
while ((v = static_cast<TGeoVolume*>(i()))) {
- v->SetVisibility(kTRUE);
- v->SetVisDaughters(kTRUE);
+ if (!v->IsAssembly())
+ v->SetVisibility(kTRUE);
v->InvisibleAll(kFALSE);
+ v->SetVisDaughters(kTRUE);
+
}
}
// Parameters:
// event The event number
if (!fCanvas) {
- const char* m[] = { "Continue", "Zoom", "Pick", "Redisplay", 0 };
+ const char* m[] = { "Continue",
+ "Break",
+ "Zoom",
+ "Pick",
+ "Redisplay",
+ "Render",
+ 0 };
MakeCanvas(m);
}
MakeAux();
-
+ fReturn = kFALSE;
+
// AliInfo("Clearing canvas");
// fCanvas->Clear();
if (!fGeoManager) {
// End of event. Draw everything
AtEnd();
Idle();
+ if (fReturn) return kFALSE;
return AliFMDInput::End();
}
//____________________________________________________________________
Int_t
-AliFMDDisplay::LookupColor(Float_t x, Float_t max) const
+AliFMDDisplay::LookupColor(Float_t x, Float_t min, Float_t max) const
{
// Look-up color.
// Get a colour from the current palette depending
// on the ratio x/max
- Int_t idx = Int_t(x / max * gStyle->GetNumberOfColors());
+ Float_t range = (max-min);
+ Float_t l = fSlider->GetMinimum();
+ Float_t h = fSlider->GetMaximum();
+ if (l == h) { l = 0; h = 1; }
+ Float_t cmin = range * l;
+ Float_t cmax = range * h;
+ Float_t crange = (cmax-cmin);
+ Int_t idx = Int_t((x-cmin) / crange * gStyle->GetNumberOfColors());
return gStyle->GetColorPalette(idx);
-}
+}
//____________________________________________________________________
void
// Change the cut on the slider.
// The factor depends on what is
// drawn in the AUX canvas
- fMultCut = fSlider->GetMinimum() * 10;
- fPedestalFactor = fSlider->GetMinimum() * 10;
- AliInfo(Form("Multiplicity cut: %7.5f, Pedestal factor: %7.4f (%6.5f)",
- fMultCut, fPedestalFactor, fSlider->GetMinimum()));
+ AliInfo(Form("Range is now %3.1f - %3.1f", fSlider->GetMinimum(),
+ fSlider->GetMaximum()));
+ Redisplay();
+}
+//____________________________________________________________________
+void
+AliFMDDisplay::ChangeFactor()
+{
+ // Change the cut on the slider.
+ // The factor depends on what is
+ // drawn in the AUX canvas
+ AliInfo(Form("Noise factor is now %4.1f, pedestal factor %3.1f",
+ fFactor->GetMinimum()*10,fFactor->GetMaximum()));
Redisplay();
}
Event();
AtEnd();
}
+//____________________________________________________________________
+void
+AliFMDDisplay::Break()
+{
+ // Redisplay stuff.
+ // Redraw markers, hits,
+ // spectra
+ if (fMarkers) fMarkers->Delete();
+ if (fHits) fHits->Clear();
+ if (fSpec) fSpec->Reset();
+ if (fSpecCut) fSpecCut->Reset();
+ fReturn = kTRUE;
+ fWait = kFALSE;
+}
+//____________________________________________________________________
+void
+AliFMDDisplay::Render()
+{
+ fPad->cd();
+ TVirtualViewer3D* viewer = fPad->GetViewer3D("ogl");
+ if (!viewer) return;
+}
//____________________________________________________________________
void
-AliFMDDisplay::AddMarker(UShort_t det, Char_t rng, UShort_t sec, UShort_t str,
- TObject* o, Float_t s, Float_t max)
+AliFMDDisplay::AddMarker(Float_t x, Float_t y, Float_t z,
+ TObject* o, Float_t s, Float_t min, Float_t max)
{
// Add a marker to the display
//
// s Signal
// max Maximum of signal
//
- AliFMDGeometry* geom = AliFMDGeometry::Instance();
- Double_t x, y, z;
- geom->Detector2XYZ(det, rng, sec, str, x, y, z);
Float_t size = .1;
- Float_t zsize = s / max * 10;
+ Float_t zsize = (s - min) / (max-min) * 10;
Float_t r = TMath::Sqrt(x * x + y * y);
Float_t theta = TMath::ATan2(r, z);
Float_t phi = TMath::ATan2(y, x);
Float_t rz = z + (z < 0 ? 1 : -1) * zsize;
TMarker3DBox* marker = new TMarker3DBox(x,y,rz,size,size,zsize,theta,phi);
if (o) marker->SetRefObject(o);
- marker->SetLineColor(LookupColor(s, max));
+ marker->SetLineColor(LookupColor(s, min, max));
fMarkers->Add(marker);
}
+//____________________________________________________________________
+void
+AliFMDDisplay::AddMarker(UShort_t det, Char_t rng, UShort_t sec, UShort_t str,
+ TObject* o, Float_t s, Float_t min, Float_t max)
+{
+ // Add a marker to the display
+ //
+ // det Detector
+ // rng Ring
+ // sec Sector
+ // str Strip
+ // o Object to refer to
+ // s Signal
+ // max Maximum of signal
+ //
+ AliFMDGeometry* geom = AliFMDGeometry::Instance();
+ Double_t x, y, z;
+ geom->Detector2XYZ(det, rng, sec, str, x, y, z);
+ AddMarker(x,y,z,o,s,min,max);
+}
+//____________________________________________________________________
+Bool_t
+AliFMDDisplay::InsideCut(Float_t val, const Float_t& min,
+ const Float_t& max) const
+{
+ Float_t r = max - min;
+ Float_t l = fSlider->GetMinimum();
+ Float_t h = fSlider->GetMaximum();
+ if (l == h) { l = 0; h = 1; }
+ if (val < r * l + min || val > r * h + min) return kFALSE;
+ return kTRUE;
+}
+
//____________________________________________________________________
Bool_t
// Process a hit.
// Parameters:
// hit Hit data
+
+ static const Float_t rMin = 0;
+ static const Float_t rMax = .1;
+
if (!hit) { AliError("No hit"); return kFALSE; }
// if (!p) { AliError("No track"); return kFALSE; }
if (fHits) fHits->Add(hit);
- Float_t size = .1;
- Float_t zsize = TMath::Sqrt(hit->Edep() * 20);
- Float_t z = hit->Z() + (hit->Z() < 0 ? 1 : -1) * zsize;
- Float_t pt = TMath::Sqrt(hit->Py()*hit->Py()+hit->Px()*hit->Px());
- Float_t theta = TMath::ATan2(pt, hit->Pz());
- Float_t phi = TMath::ATan2(hit->Py(), hit->Px());
- TMarker3DBox* marker = new TMarker3DBox(hit->X(), hit->Y(), z,
- size, size, zsize, theta, phi);
- marker->SetLineColor(LookupColor(hit->Edep(), 1));
- marker->SetRefObject(hit);
- fMarkers->Add(marker);
+ Float_t edep = hit->Edep();
+
+ if (!InsideCut(edep, rMin, rMax)) return kTRUE;
+
+ AddMarker(hit->X(), hit->Y(), hit->Z(), hit, edep, rMin, rMax);
return kTRUE;
}
// Process a digit
// Parameters:
// digit Digit information
+
+ static const Float_t rMin = 0;
+ static const Float_t rMax = 1023;
if (!digit) { AliError("No digit"); return kFALSE; }
AliFMDParameters* parm = AliFMDParameters::Instance();
UShort_t str = digit->Strip();
Double_t ped = parm->GetPedestal(det,ring, sec, str);
Double_t pedW = parm->GetPedestalWidth(det,ring, sec, str);
- Double_t threshold = ped + fPedestalFactor * pedW;
+ Double_t threshold = (ped * fFactor->GetMaximum()
+ + pedW * fFactor->GetMinimum());
Float_t counts = digit->Counts();
- AliFMDDebug(10, ("FMD%d%c[%2d,%3d] ADC: %d > %d (=%4.2f+%4.2f*%4.2f)",
- digit->Detector(), digit->Ring(), digit->Sector(),
- digit->Strip(), Int_t(counts), Int_t(threshold),
- ped, fPedestalFactor, pedW));
- if (fSpec) fSpec->Fill(counts);
- if (counts < threshold) return kTRUE;
- if (fHits) fHits->Add(digit);
- if (fSpecCut) fSpecCut->Fill(counts);
-
- AddMarker(det, ring, sec, str, digit, counts, 1024);
+
+ if (fHits) fHits->Add(digit);
+ if (fSpec) fSpec->Fill(counts);
+ if (!InsideCut(counts-threshold, rMin, rMax)) return kTRUE;
+ if (fSpecCut) fSpecCut->Fill(counts);
+
+
+ AddMarker(det, ring, sec, str, digit, counts, rMin, rMax);
return kTRUE;
}
// Process reconstructed point
// Parameters:
// recpoint Reconstructed multiplicity/energy
+ static const Float_t rMin = 0;
+ static const Float_t rMax = 20;
+
if (!recpoint) { AliError("No recpoint"); return kFALSE; }
- if (recpoint->Particles() < fMultCut) return kTRUE;
+
+ if (!InsideCut(recpoint->Particles(), rMin, rMax)) return kTRUE;
+
if (fHits) fHits->Add(recpoint);
AddMarker(recpoint->Detector(), recpoint->Ring(), recpoint->Sector(),
- recpoint->Strip(), recpoint, recpoint->Particles(), 20);
+ recpoint->Strip(), recpoint, recpoint->Particles(), rMin, rMax);
return kTRUE;
}
// Parameters
// det,rng,sec,str Detector coordinates.
// mult Multiplicity.
+ static const Float_t rMin = 0;
+ static const Float_t rMax = 20;
+
Double_t cmult = mult;
if (fSpec) fSpec->Fill(cmult);
- if (cmult < fMultCut || cmult == AliESDFMD::kInvalidMult) return kTRUE;
- AddMarker(det,rng,sec,str, 0, cmult, 20);
+ if (!InsideCut(cmult, rMin, rMax) || cmult == AliESDFMD::kInvalidMult)
+ return kTRUE;
+
+ AddMarker(det,rng,sec,str, 0, cmult, rMin, rMax);
+
if (fSpecCut) fSpecCut->Fill(cmult);
+
return kTRUE;
}
void Pick() { fZoomMode = kFALSE; }
/** Redisplay the event */
virtual void Redisplay(); // *MENU*
+ /** Break */
+ virtual void Break();
+ /** Render in 3D */
+ virtual void Render();
+
/** Change cut */
virtual void ChangeCut();
+ /** Change cut */
+ virtual void ChangeFactor();
/** Called when a mouse or similar event happens in the display.
@param event Event type
@param px where the event happened in pixels along X
@param x Value
@param max Maximum (for example 1023 for digits)
@return @c false on error */
- virtual Int_t LookupColor(Float_t x, Float_t max) const;
- /** Set multiplicity cut
- @param cut Cut-off in multiplicity */
- virtual void SetMultiplicityCut(Float_t c=.01) { fMultCut = c; }//*MENU*
- /** Set pedestal width factor
- @param fac Factor */
- virtual void SetPedestalFactor(Float_t f=3) { fPedestalFactor = f; }//*MENU*
+ virtual Int_t LookupColor(Float_t x, Float_t min, Float_t max) const;
protected:
/** Copy constructor
@param o Object to copy from */
fPad(0),
fButtons(0),
fSlider(0),
+ fFactor(0),
fZoomMode(0),
fX0(0),
fY0(0),
fX1(0),
fY1(0),
- fMultCut(0),
- fPedestalFactor(0),
fXPixel(0),
fYPixel(0),
fOldXPixel(0),
fOnlyFMD(kTRUE),
fSpec(0),
fSpecCut(0),
- fAux(0)
+ fAux(0),
+ fReturn(kFALSE)
{ }
/** Assignment operator
@return Reference to this object */
AliFMDDisplay& operator=(const AliFMDDisplay&) { return *this; }
+ /** Add a marker to the display
+ @param x X position
+ @param y Y position
+ @param z Z position
+ @param o Object to refer to
+ @param s Signal
+ @param max Maximum of signal */
+ virtual void AddMarker(Float_t x, Float_t y, Float_t z,
+ TObject* o, Float_t s, Float_t min, Float_t max);
/** Add a marker to the display
@param det Detector
@param rng Ring
@param s Signal
@param max Maximum of signal */
virtual void AddMarker(UShort_t det, Char_t rng, UShort_t sec, UShort_t str,
- TObject* o, Float_t s, Float_t max);
+ TObject* o, Float_t s, Float_t min, Float_t max);
/** Show only the FMD detectors. */
void ShowOnlyFMD();
virtual void DrawAux();
virtual void Idle();
virtual void AtEnd();
+ virtual Bool_t InsideCut(Float_t v, const Float_t& min,
+ const Float_t& max) const;
static AliFMDDisplay* fgInstance; // Static instance
Bool_t fWait; // Wait until user presses `Continue'
TPad* fPad; // View pad.
TObjArray fButtons; // Continue button
TSlider* fSlider; // Cut slider
+ TSlider* fFactor; // Factor slider
Bool_t fZoomMode; // Whether we're in Zoom mode
Float_t fX0; // X at lower left corner or range
Float_t fY0; // Y at lower left corner or range
Float_t fX1; // X at upper right corner or range
Float_t fY1; // Y at upper right corner or range
- Float_t fMultCut; // Multiplicity cut
- Float_t fPedestalFactor; // ADC acceptance factor
Int_t fXPixel; // X pixel of mark
Int_t fYPixel; // Y pixel of mark
Int_t fOldXPixel; // Old x pixel of mark
TH1* fSpec; // Spectra
TH1* fSpecCut; // Cut spectra
TCanvas* fAux; // Aux canvas.
+ Bool_t fReturn; // Stop
ClassDef(AliFMDDisplay,0) // FMD specialised event display
};
{
// Process a hit.
AddMarker(hit->Detector(), hit->Ring(), hit->Sector(), hit->Strip(),
- hit, hit->Edep(), 0);
+ hit, hit->Edep(), 0, 20);
return kTRUE;
}
//____________________________________________________________________
//____________________________________________________________________
void
AliFMDFancy::AddMarker(UShort_t det, Char_t rng, UShort_t sec, UShort_t str,
- TObject*, Float_t, Float_t)
+ TObject*, Float_t, Float_t, Float_t)
{
// Add a marker to the display
//
AliFMDFancy(const AliFMDFancy& );
/** Assignement operator */
AliFMDFancy& operator=(const AliFMDFancy& ) { return *this; }
+ virtual void AddMarker(Float_t x, Float_t y, Float_t z,
+ TObject* o, Float_t s, Float_t min, Float_t max)
+ {
+ AliFMDDisplay::AddMarker(x, y, z, o, s, min, max);
+ }
/** Add a marker to the display
@param det Detector
@param rng Ring
@param s Signal
@param max Maximum of signal */
virtual void AddMarker(UShort_t det, Char_t rng, UShort_t sec,
- UShort_t str, TObject* o, Float_t s, Float_t max);
+ UShort_t str, TObject* o, Float_t s,
+ Float_t min, Float_t max);
/** Process a hit
@param hit hit to process */
virtual Bool_t ProcessHit(AliFMDHit* hit, TParticle*);
#include <TGeoManager.h> // ROOT_TGeoManager
#include <TGeoMatrix.h> // ROOT_TGeoMatrix
#include <TGeoTube.h> // ROOT_TGeoTube
-#include <TGeoTube.h> // ROOT_TGeoTube
+#include <TGeoTrd1.h> // ROOT_TGeoTrd1
+#include <TGeoCone.h> // ROOT_TGeoTrd1
#include <TGeoVolume.h> // ROOT_TGeoVolume
#include <TGeoXtru.h> // ROOT_TGeoXtru
+#include <TGeoCompositeShape.h>
#include <TMath.h>
#include <TVector2.h> // ROOT_TVector2
//#include <TGeoMaterial.h> // ROOT_TGeoMaterial
const Char_t* AliFMDGeometryBuilder::fgkHCName = "F%dH%c";
const Char_t* AliFMDGeometryBuilder::fgkIHCName = "F%dI%c";
const Char_t* AliFMDGeometryBuilder::fgkNoseName = "F3SN";
-const Char_t* AliFMDGeometryBuilder::fgkBackName = "F3SB";
-const Char_t* AliFMDGeometryBuilder::fgkBeamName = "F3SL";
-const Char_t* AliFMDGeometryBuilder::fgkFlangeName = "F3SF";
+const Char_t* AliFMDGeometryBuilder::fgkBackName = "F%dSB";
+const Char_t* AliFMDGeometryBuilder::fgkTopName = "F%dSU";
+const Char_t* AliFMDGeometryBuilder::fgkBeamName = "F%dSL";
+const Char_t* AliFMDGeometryBuilder::fgkFlangeName = "F%dSF";
+const Char_t* AliFMDGeometryBuilder::fgkFMDDCuName = "F%cDC";
+const Char_t* AliFMDGeometryBuilder::fgkFMDDPCBName = "F%cDP";
+const Char_t* AliFMDGeometryBuilder::fgkFMDDChipName = "F%cDI";
+const Char_t* AliFMDGeometryBuilder::fgkFMDDName = "F%cDD";
const Char_t* AliFMDGeometryBuilder::fgkFMDName = "F%dM%c";
//____________________________________________________________________
fChip(0),
fAir(0),
fPlastic(0),
- fCopper(0)
+ fCopper(0),
+ fSteel(0)
{
// Default constructor
fActiveId.Set(2);
fChip(0),
fAir(0),
fPlastic(0),
- fCopper(0)
+ fCopper(0),
+ fSteel(0)
{
// Normal constructor
//
fDetectorOff = 3;
if (fDetailed) {
fSectorOff = 1;
- fModuleOff = 3;
- fRingOff = 4;
- fDetectorOff = 5;
+ fModuleOff = 4;
+ fRingOff = 5;
+ fDetectorOff = 6;
// Virtual volume shape to divide - This volume is only defined if
// the geometry is set to be detailed.
TGeoTubeSeg* activeShape = new TGeoTubeSeg(rmin, rmax, siThick/2,
// Short leg shape
TGeoTube* shortLegShape = new TGeoTube(0, legr, legl / 2);
TGeoVolume* shortLegVolume = new TGeoVolume(Form(fgkShortLegName, id),
- shortLegShape, fPlastic);
+ shortLegShape, fCopper);
// Long leg shape
TGeoTube* longLegShape = new TGeoTube(0, legr, (legl + modSpace) / 2);
TGeoVolume* longLegVolume = new TGeoVolume(Form(fgkLongLegName, id),
- longLegShape, fPlastic);
+ longLegShape, fCopper);
// Back container volume
TGeoVolume* backVolume = new TGeoVolumeAssembly(Form(fgkBackVName, id));
Double_t x = 0;
Double_t y = 0;
- Double_t z = pcbThick / 2;
+ Double_t z = siThick + space + pcbThick / 2;
backVolume->AddNode(pcbVolume, 0, new TGeoTranslation(x,y,z));
z += (pcbThick + cuThick) / 2;
backVolume->AddNode(cuVolume, 0, new TGeoTranslation(0, 0, z));
TGeoVolume* frontVolume = new TGeoVolumeAssembly(Form(fgkFrontVName, id));
x = 0;
y = 0;
- z = pcbThick / 2;
+ z = siThick + space + pcbThick / 2;
frontVolume->AddNode(pcbVolume, 1, new TGeoTranslation(x,y,z));
z += (pcbThick + cuThick) / 2;
frontVolume->AddNode(cuVolume, 0, new TGeoTranslation(0, 0, z));
frontVolume->AddNode(longLegVolume, 1, new TGeoTranslation(x,y,z));
y = -y;
frontVolume->AddNode(longLegVolume, 2, new TGeoTranslation(x,y,z));
+
+
+ // FMDD
+ Double_t ddlr = r->GetFMDDLowR();
+ Double_t ddhr = r->GetFMDDHighR();
+ Double_t ddpt = r->GetFMDDPrintboardThickness();
+ Double_t ddct = r->GetFMDDCopperThickness();
+ Double_t ddit = r->GetFMDDChipThickness();
+ Double_t ddt = ddpt + ddct + ddit;
+ TGeoShape* fmddPcbShape = new TGeoTubeSeg(ddlr, ddhr, ddpt/2,0,180);
+ TGeoShape* fmddCuShape = new TGeoTubeSeg(ddlr, ddhr, ddct/2,0,180);
+ TGeoShape* fmddChipShape = new TGeoTubeSeg(ddlr, ddhr, ddit/2,0,180);
+ fmddPcbShape->SetName(Form(fgkFMDDPCBName, id));
+ fmddCuShape->SetName(Form(fgkFMDDCuName, id));
+ fmddChipShape->SetName(Form(fgkFMDDChipName, id));
+ if (id == 'O' || id == 'o') {
+ TString pcbName(fmddPcbShape->GetName());
+ TString cuName(fmddCuShape->GetName());
+ TString chipName(fmddChipShape->GetName());
+
+ fmddPcbShape->SetName(Form("%s_inner", pcbName.Data()));
+ fmddCuShape->SetName(Form("%s_inner", cuName.Data()));
+ fmddChipShape->SetName(Form("%s_inner", chipName.Data()));
+ new TGeoBBox(Form("%s_clip", pcbName.Data()), ddlr+3, ddhr/2, ddpt);
+ new TGeoBBox(Form("%s_clip", cuName.Data()), ddlr+3, ddhr/2, ddpt);
+ new TGeoBBox(Form("%s_clip", chipName.Data()),ddlr+3, ddhr/2, ddpt);
+ TGeoTranslation* trans = new TGeoTranslation(Form("%s_trans",
+ pcbName.Data()),
+ 0, ddhr/2, 0);
+ trans->RegisterYourself();
+ fmddPcbShape = new TGeoCompositeShape(pcbName.Data(),
+ Form("%s_inner*%s_clip:%s_trans",
+ pcbName.Data(),
+ pcbName.Data(),
+ pcbName.Data()));
+ fmddCuShape = new TGeoCompositeShape(cuName.Data(),
+ Form("%s_inner*%s_clip:%s_trans",
+ cuName.Data(),
+ cuName.Data(),
+ pcbName.Data()));
+ fmddChipShape = new TGeoCompositeShape(chipName.Data(),
+ Form("%s_inner*%s_clip:%s_trans",
+ chipName.Data(),
+ chipName.Data(),
+ pcbName.Data()));
+ }
+
+ TGeoVolume* fmddPcbVolume = new TGeoVolume(Form(fgkFMDDPCBName, id),
+ fmddPcbShape, fPCB);
+ TGeoVolume* fmddCuVolume = new TGeoVolume(Form(fgkFMDDCuName, id),
+ fmddCuShape, fCopper);
+ TGeoVolume* fmddChipVolume= new TGeoVolume(Form(fgkFMDDChipName, id),
+ fmddChipShape, fChip);
// Half ring mother volumes.
TGeoVolume* ringTopVolume = new TGeoVolumeAssembly(Form(fgkRingTopName,id));
TGeoVolume* ringBotVolume = new TGeoVolumeAssembly(Form(fgkRingBotName,id));
for (Int_t i = 0; i < nmod; i++) {
if (i == nmod / 2) halfRing = ringBotVolume;
Bool_t front = (i % 2 == 0);
- Double_t z1 = siThick / 2 + (i % 2) * modSpace;
+ TGeoVolume* vol = (front ? frontVolume : backVolume);
+ vol->AddNode(sensorVolume, i, new TGeoTranslation(0,0,siThick/2));
+ Double_t z1 = (i % 2) * modSpace;
+ Double_t th = (2 * i + 1) * theta;
+ TGeoMatrix* mat1 = new TGeoCombiTrans(0,0,z1,0);
+ mat1->RotateZ(th);
+ halfRing->AddNode(vol, i, mat1);
+#if 0
Double_t z2 = z1 + siThick / 2 + space;
Double_t th = (2 * i + 1) * theta;
- TGeoVolume* vol = (front ? frontVolume : backVolume);
AliFMDDebug(20, ("Placing copy %d of %s and %s in %s at z=%f and %f, "
"and theta=%f", i, sensorVolume->GetName(),
vol->GetName(), halfRing->GetName(), z1, z2, th));
TGeoMatrix* mat2 = new TGeoCombiTrans(0,0,z2,0);
mat2->RotateZ(th);
halfRing->AddNode(vol, i, mat2);
+#endif
+ }
+
+ // Add the FMDD
+ Double_t zi = r->GetFullDepth() - ddt;
+ Int_t n = 2;
+ for (Int_t i = 0; i < n; i++) {
+ TGeoVolume* halfRing = (i == 0 ? ringTopVolume : ringBotVolume);
+ Double_t phi = 360. / n * i;
+ TGeoRotation* rot = new TGeoRotation(Form("FMDD%c rotation %d", id, i));
+ rot->RotateZ(phi);
+ z = zi + ddpt / 2;
+ halfRing->AddNode(fmddPcbVolume, i, new TGeoCombiTrans(0,0,z,rot));
+ z += (ddpt + ddct) / 2;
+ halfRing->AddNode(fmddCuVolume, i, new TGeoCombiTrans(0,0,z,rot));
+ z += (ddct + ddit) / 2;
+ halfRing->AddNode(fmddChipVolume, i, new TGeoCombiTrans(0,0,z,rot));
}
+
return 0;
}
if (!r) continue;
Char_t c = r->GetId();
Int_t id = d->GetId();
- Double_t hcThick = d->GetHoneycombThickness();
- Double_t alThick = d->GetAlThickness();
+ Double_t hcThick = r->GetHoneycombThickness();
+ Double_t alThick = r->GetAlThickness();
Double_t z = TMath::Abs(rz - zMother);
// Place ring in mother volume
// TGeoMatrix*matrix=new TGeoTranslation(Form("FMD%d%c trans",id,c),0,0,0);
- AliFMDDebug(5, ("Placing volumes %s and %s in %s and %s at z=%f",
+ AliFMDDebug(1, ("Placing volumes %s and %s in %s and %s at z=%f",
tvol->GetName(), bvol->GetName(),
topMother->GetName(), botMother->GetName(), z));
topMother->AddNode(tvol, Int_t(c), new TGeoTranslation(0,0,z));
hcVol->AddNode(ihcVol, 0);
hcVol->VisibleDaughters(kFALSE);
hcVol->SetVisibility(kTRUE);
-
+
z += (r->GetSiThickness() +
r->GetSpacing() +
r->GetPrintboardThickness() +
r->GetChipThickness() +
r->GetModuleSpacing() +
r->GetLegLength() +
+ r->GetHoneycombThickness() +
+ r->GetFMDDPrintboardThickness() -
hcThick / 2);
AliFMDDebug(15, ("Placing a copy of %s in %s and %s at z=%f",
// See also AliFMDGeometryBuilder::DetectorGeometry
//
if (!fmd1 || !innerTop || !innerBot) return 0;
+ AliFMDRing* r = fmd1->GetInner();
Double_t z = fmd1->GetInnerZ();
+ Double_t disce = 2;
+ Double_t backlr = fmd1->GetInnerHoneyHighR();
+ Double_t backhr = fmd1->GetInnerHoneyHighR()+5;
+ Double_t backth = 0.2;
+ Double_t toplr = r->GetLowR();
+ Double_t tophr = fmd1->GetInnerHoneyHighR()+disce;
+ Double_t wallbh = (r->GetFullDepth() + disce);
+ Double_t wallth = wallbh+0.1;
+
TGeoVolume* fmd1TopVolume = new TGeoVolumeAssembly(Form(fgkFMDName,
fmd1->GetId(), 'T'));
TGeoVolume* fmd1BotVolume = new TGeoVolumeAssembly(Form(fgkFMDName,
DetectorGeometry(fmd1, fmd1TopVolume, fmd1BotVolume, z,
innerTop, innerBot, 0, 0);
+
+ // Back
+ TGeoTubeSeg* backShape = new TGeoTubeSeg(backlr, backhr, backth / 2, 0, 180);
+ TGeoTubeSeg* wallbShape = new TGeoTubeSeg(backlr, backlr + backth,
+ wallbh/2, 0, 180);
+ TGeoTubeSeg* topShape = new TGeoTubeSeg(toplr, tophr, backth / 2, 0, 180);
+ TGeoTubeSeg* walltShape = new TGeoTubeSeg(tophr, tophr + backth,
+ wallth/2, 0, 180);
+ TGeoVolume* backVolume = new TGeoVolume(Form(fgkBackName, fmd1->GetId()),
+ backShape, fC);
+ TGeoVolume* wallbVolume= new TGeoVolume(Form(fgkFlangeName, fmd1->GetId()),
+ wallbShape, fC);
+ TGeoVolume* topVolume = new TGeoVolume(Form(fgkTopName, fmd1->GetId()),
+ topShape, fC);
+ TGeoVolume* walltVolume= new TGeoVolume(Form(fgkBeamName, fmd1->GetId()),
+ walltShape, fC);
+ backVolume->SetFillColor(kGray);
+ topVolume->SetFillColor(kGray);
+ wallbVolume->SetFillColor(kGray);
+ walltVolume->SetFillColor(kGray);
+
+ // Place volumes
+ Double_t zb = TMath::Abs(fmd1->GetInnerZ() - z);
+ Double_t zi = zb;
+ Int_t n = 2;
+
+ // Place top cover
+ zi -= disce / 2 + backth / 2;
+ zb = zi;
+ for (Int_t i = 0; i < 2; i++) {
+ TGeoVolume* mother = (i == 0 ? fmd1TopVolume : fmd1BotVolume);
+ Double_t phi = 360. / n * i;
+ TGeoRotation* rot = new TGeoRotation(Form("FMD1 top rotation %d",
+ i));
+ rot->RotateZ(phi);
+ TGeoMatrix* matrix = new TGeoCombiTrans(Form("FMD1 top wall trans %d",
+ i),
+ 0, 0, zi, rot);
+ mother->AddNode(topVolume, i, matrix);
+ }
+ // Place outer wall
+ zi += wallth / 2 + backth / 2;
+ for (Int_t i = 0; i < 2; i++) {
+ TGeoVolume* mother = (i == 0 ? fmd1TopVolume : fmd1BotVolume);
+ Double_t phi = 360. / n * i;
+ TGeoRotation* rot = new TGeoRotation(Form("FMD1 outer wall rotation %d",
+ i));
+ rot->RotateZ(phi);
+ TGeoMatrix* matrix = new TGeoCombiTrans(Form("FMD1 outer wall trans %d",
+ i),
+ 0, 0, zi, rot);
+ mother->AddNode(walltVolume, i, matrix);
+ }
+ // Place back
+ zi += wallth / 2 + backth / 2; // + disce / 2;
+ for (Int_t i = 0; i < 2; i++) {
+ TGeoVolume* mother = (i == 0 ? fmd1TopVolume : fmd1BotVolume);
+ Double_t phi = 360. / n * i;
+ TGeoRotation* rot = new TGeoRotation(Form("FMD1 back rotation %d", i));
+ rot->RotateZ(phi);
+ TGeoMatrix* matrix = new TGeoCombiTrans(Form("FMD1 back trans %d", i),
+ 0, 0, zi, rot);
+ mother->AddNode(backVolume, i, matrix);
+ }
+ // Place inner wall
+ zi -= wallbh / 2 + backth / 2; // + disce / 2;
+ for (Int_t i = 0; i < 2; i++) {
+ TGeoVolume* mother = (i == 0 ? fmd1TopVolume : fmd1BotVolume);
+ Double_t phi = 360. / n * i;
+ TGeoRotation* rot = new TGeoRotation(Form("FMD1 inner wall rotation %d",
+ i));
+ rot->RotateZ(phi);
+ TGeoMatrix* matrix = new TGeoCombiTrans(Form("FMD1 inner wall trans %d",
+ i),
+ 0, 0, zi, rot);
+ mother->AddNode(wallbVolume, i, matrix);
+ }
+
+
// Must add this after filling the assembly.
TGeoVolume* top = gGeoManager->GetVolume("ALIC");
// TGeoMatrix* matrix = new TGeoTranslation("FMD1 trans", 0, 0, z);
// See also AliFMDGeometryBuilder::DetectorGeometry
//
if (!fmd2 || !innerTop || !innerBot || !outerTop || !outerBot) return 0;
- Double_t z = fmd2->GetOuterZ();
+ AliFMDRing* r = fmd2->GetOuter();
+ Double_t z = fmd2->GetOuterZ();
+ Double_t framelr = fmd2->GetOuterHoneyHighR()+0.5;
+ Double_t framehr = fmd2->GetOuterHoneyHighR()+1.8;
+ Double_t framelz = -1;
+ Double_t framehz = (fmd2->GetInnerZ()-z) + r->GetFullDepth() + 1;
+ Double_t framel = framehz - framelz;
+ Double_t coverlr = fmd2->GetInner()->GetLowR()+1;
+ Double_t backth = 0.05;
+
TGeoVolume* fmd2TopVolume = new TGeoVolumeAssembly(Form(fgkFMDName,
fmd2->GetId(), 'T'));
TGeoVolume* fmd2BotVolume = new TGeoVolumeAssembly(Form(fgkFMDName,
DetectorGeometry(fmd2, fmd2TopVolume, fmd2BotVolume, z,
innerTop, innerBot, outerTop, outerBot);
+ TGeoShape* cylinderShape = new TGeoTubeSeg(framelr,framehr,framel/2,0,180);
+ TGeoVolume* cylinderVolume = new TGeoVolume(Form(fgkBackName, fmd2->GetId()),
+ cylinderShape, fC);
+ TGeoShape* coverShape = new TGeoTubeSeg(coverlr,framehr,backth/2,0,180);
+ TGeoVolume* coverVolume = new TGeoVolume(Form(fgkTopName, fmd2->GetId()),
+ coverShape, fC);
+ cylinderVolume->SetTransparency(63);
+ coverVolume->SetTransparency(63);
+
+ for (Int_t i = 0; i < 2; i++) {
+ TGeoVolume* mother = (i == 0 ? fmd2TopVolume : fmd2BotVolume);
+
+ Double_t phi = 360. / 2 * i;
+ TGeoRotation* rot = new TGeoRotation(Form("FMD2 support rot %d",i));
+ rot->RotateZ(phi);
+ TGeoMatrix* matrix = new TGeoCombiTrans(Form("FMD2 cyl trans %d", i),
+ 0, 0, framelz+framel/2, rot);
+ mother->AddNode(cylinderVolume, i, matrix);
+ matrix = new TGeoCombiTrans(Form("FMD2 fcov trans %d", i),
+ 0, 0, framelz-backth/2, rot);
+ mother->AddNode(coverVolume, 2*i+0, matrix);
+ matrix = new TGeoCombiTrans(Form("FMD2 bcov trans %d", i),
+ 0, 0, framelz+framel+backth/2,
+ rot);
+ mother->AddNode(coverVolume, 2*i+1, matrix);
+ }
+
+
+ Double_t f1l = 10;
+ Double_t f1w = 6;
+ Double_t f1d = 1.2;
+
+ TGeoBBox* flange1Shape = new TGeoBBox(f1l/2, f1w/2, f1d/2);
+ TGeoVolume* flange1Volume = new TGeoVolume(Form(fgkFlangeName, fmd2->GetId()),
+ flange1Shape, fAl);
+ TGeoBBox* flange2Shape = new TGeoBBox(f1w/2, f1d/2, (framel+backth)/2);
+ TGeoVolume* flange2Volume = new TGeoVolume(Form("F%dSG", fmd2->GetId()),
+ flange2Shape, fAl);
+ flange1Volume->SetTransparency(42);
+ for (Int_t i = 0; i < 4; i++) {
+ TGeoVolume* mother = (i < 2 ? fmd2TopVolume : fmd2BotVolume);
+
+ Double_t phi = 360. / 4 * i - 45;
+ Double_t rphi = TMath::Pi()*phi/180;
+ Double_t x = (framelr + f1l/2) * TMath::Sin(rphi);
+ Double_t y = (framelr + f1l/2) * TMath::Cos(rphi);
+ TGeoRotation* rot = new TGeoRotation(Form("FMD2 support rot %d",i));
+ rot->RotateZ(phi);
+ TGeoMatrix* matrix = new TGeoCombiTrans(Form("FMD2 flange 1 trans %d", i),
+ x,y, framelz-backth-f1d/2, rot);
+ mother->AddNode(flange1Volume, 2*i+0, matrix);
+ matrix = new TGeoCombiTrans(Form("FMD2 flange 2 trans %d", i),
+ x,y,framelz+framel+backth+f1d/2,
+ rot);
+ mother->AddNode(flange1Volume, 2*i+1, matrix);
+ Double_t x1 = x - (f1w-f1d) / 2 * TMath::Cos(rphi);
+ Double_t y1 = y + (f1w-f1d) / 2 * TMath::Sin(rphi);
+ matrix = new TGeoCombiTrans(Form("FMD2 flange 3 trans %d", i),
+ x1,y1,framelz+framel/2, rot);
+ mother->AddNode(flange2Volume, 2*i+0, matrix);
+ Double_t x2 = x + (f1w-f1d) / 2 * TMath::Cos(rphi);
+ Double_t y2 = y - (f1w-f1d) / 2 * TMath::Sin(rphi);
+ matrix = new TGeoCombiTrans(Form("FMD2 flange 4 trans %d", i),
+ x2,y2,framelz+framel/2, rot);
+ mother->AddNode(flange2Volume, 2*i+1, matrix);
+ }
+
+
+
// Must be done after filling the assemblies
TGeoVolume* top = gGeoManager->GetVolume("ALIC");
TGeoMatrix* matrix = new TGeoTranslation("FMD2 trans", 0, 0, z);
top->AddNode(fmd2TopVolume, fmd2->GetId(), matrix);
top->AddNode(fmd2BotVolume, fmd2->GetId(), matrix);
+
return 0;
}
Double_t nz = fmd3->GetNoseZ();
Double_t noser1 = fmd3->GetNoseLowR();
Double_t noser2 = fmd3->GetNoseHighR();
+ Double_t conet = fmd3->GetBeamThickness();
Double_t conel = fmd3->GetConeLength();
Double_t backl = fmd3->GetBackLength();
Double_t backr1 = fmd3->GetBackLowR();
DetectorGeometry(fmd3, fmd3TopVolume, fmd3BotVolume, z,
innerTop, innerBot, outerTop, outerBot);
-
- // Nose volume
- TGeoTubeSeg* noseShape = new TGeoTubeSeg(noser1, noser2, nlen / 2, 0, 180);
- TGeoVolume* noseVolume = new TGeoVolume(fgkNoseName, noseShape, fC);
- zi = -nz + nlen / 2 + z;
-
- fmd3TopVolume->AddNode(noseVolume, 0, new TGeoTranslation(0, 0, zi));
- TGeoMatrix* nmatrix = new TGeoCombiTrans(0, 0, zi, 0);
- nmatrix->RotateZ(180);
- fmd3BotVolume->AddNode(noseVolume, 1, nmatrix);
- // Back
- TGeoTubeSeg* backShape = new TGeoTubeSeg(backr1, backr2, backl / 2, 0, 180);
- TGeoVolume* backVolume = new TGeoVolume(fgkBackName, backShape, fC);
- zi = -nz + conel - backl / 2 + z;
- fmd3TopVolume->AddNode(backVolume, 0, new TGeoTranslation(0, 0, zi));
- TGeoMatrix* bmatrix = new TGeoCombiTrans(0, 0, zi, 0);
- bmatrix->RotateZ(180);
- fmd3BotVolume->AddNode(backVolume, 1, bmatrix);
+ TGeoVolumeAssembly* support = new TGeoVolumeAssembly("F3SU");
+ // Nose volume
+ TGeoTubeSeg* noseShape = new TGeoTubeSeg(noser1, noser2, nlen / 2, 0, 180);
+ TGeoVolume* noseVolume = new TGeoVolume(fgkNoseName, noseShape, fC);
+ support->AddNode(noseVolume, 0, new TGeoTranslation(0, 0, nlen/2));
+
+ // Steel bolts
+ TGeoTube* boltShape = new TGeoTube("F3SB", 0, 0.3, conet / 2);
+ TGeoVolume* boltVolume = new TGeoVolume("F3SB", boltShape, fSteel);
+ Double_t z1 = -10;
+ Double_t x1 = (fmd3->ConeR(nz+z1));
+ TGeoRotation* r1 = new TGeoRotation();
+ r1->RotateY(theta);
+ TGeoCombiTrans* t = new TGeoCombiTrans("F3SB1",x1,0,-z1,r1);
+ support->AddNode(boltVolume, 1, t);
+ z1 = -20;
+ x1 = (fmd3->ConeR(nz+z1));
+ t = new TGeoCombiTrans("F3SB2",x1,0,-z1,r1);
+ support->AddNode(boltVolume, 2, t);
+
+ // Cooling plates
+ TGeoTrd1* plateShape = new TGeoTrd1(2, 8, 0.1, (conel-2-2)/2-.1);
+ TGeoVolume* plateVolume = new TGeoVolume("F3CO", plateShape, fAl);
+
+ // Shape for carbon half-cone
+ new TGeoConeSeg("F3SC_inner", conel/2,noser2-conet, noser2,
+ backr2-conet, backr2, 0., 180.);
+ new TGeoTrd1("F3SC_hole",2,8,conet*3,(conel-2-2)/2);
+ Double_t holeAng = TMath::ATan2(backr2 - noser2, conel);
+ Double_t holeX = ((conel-2) / 2 * TMath::Sin(holeAng) +
+ conet * TMath::Cos(holeAng) +
+ noser2);
+ TGeoRotation* holeRot = new TGeoRotation();
+ holeRot->RotateZ(90);
+ holeRot->RotateY(holeAng*180./TMath::Pi());
+ TGeoCombiTrans* holeTrans = new TGeoCombiTrans(holeX, 0, -2, holeRot);
+
+ // Build-up the composite shape for the cone, and add cooling plates
+ // at the same time.
+ TString coneExp("F3SC_inner-(");
+ for (int i = 0; i < 4; i++) {
+ Double_t thisAng = 360. / 8 * (i + .5);
+ TGeoCombiTrans* thisTrans = new TGeoCombiTrans(*holeTrans);
+ thisTrans->RotateZ(thisAng);
+ thisTrans->SetName(Form("F3SC_rot%d", i));
+ thisTrans->RegisterYourself();
+ coneExp.Append(Form("F3SC_hole:F3SC_rot%d+", i));
+
+ const Double_t* tt = thisTrans->GetTranslation();
+ Double_t x = tt[0]+1*TMath::Cos(thisAng*TMath::Pi()/180);
+ Double_t y = tt[1]+1*TMath::Sin(thisAng*TMath::Pi()/180);
+ TGeoCombiTrans* plateTrans = new TGeoCombiTrans(x,y,tt[2]-1+nlen+conel/2,
+ thisTrans->GetRotation());
+ support->AddNode(plateVolume, i, plateTrans);
+ }
+ // Remove bolt holes
+ coneExp.Append("F3SB:F3SB1+F3SB:F3SB2)");
+
+ // Finalize the half-cone shape and add volume
+ TGeoCompositeShape* coneShape = new TGeoCompositeShape(coneExp.Data());
+ TGeoVolume* coneVolume = new TGeoVolume("F3SC", coneShape, fC);
+ support->AddNode(coneVolume,1,new TGeoTranslation(0,0,nlen+conel/2));
- Int_t n;
- Double_t r;
// The flanges
- TGeoBBox* flangeShape = new TGeoBBox((flanger - backr2) / 2,
- fmd3->GetBeamWidth() / 2,
- backl / 2);
- TGeoVolume* flangeVolume = new TGeoVolume(fgkFlangeName, flangeShape, fC);
- n = fmd3->GetNFlange();
- r = backr2 + (flanger - backr2) / 2;
- TGeoVolume* mother = fmd3TopVolume;
- for (Int_t i = 0; i < n; i++) {
- if (i >= n / 2) mother = fmd3BotVolume;
+ TGeoBBox* flangeShape = new TGeoBBox((flanger - backr2) / 2,
+ fmd3->GetBeamWidth() / 2,
+ backl / 2);
+ TGeoVolume* flangeVolume = new TGeoVolume(Form(fgkFlangeName, fmd3->GetId()),
+ flangeShape, fC);
+ Int_t n = fmd3->GetNFlange();
+ Double_t r = backr2 + (flanger - backr2) / 2;
+ for (Int_t i = 0; i < n/2; i++) {
Double_t phi = 360. / n * i + 180. / n;
Double_t x = r * TMath::Cos(TMath::Pi() / 180 * phi);
Double_t y = r * TMath::Sin(TMath::Pi() / 180 * phi);
- AliFMDDebug(15, ("Placing flange %d in %s at (%f,%f,%f) r=%f, phi=%f",
- i, mother->GetName(), x, y, zi, r, phi));
- TGeoRotation* rot = new TGeoRotation;
+ TGeoRotation* rot = new TGeoRotation;
rot->RotateZ(phi);
- TGeoMatrix* matrix = new TGeoCombiTrans(x, y, zi, rot);
- mother->AddNode(flangeVolume, i, matrix);
+ TGeoMatrix* matrix = new TGeoCombiTrans(x, y, nlen+conel-backl/2, rot);
+ support->AddNode(flangeVolume, i, matrix);
}
- // The Beams
- TGeoBBox* beamShape = new TGeoBBox(fmd3->GetBeamThickness() / 2,
- fmd3->GetBeamWidth() / 2 - .1,
- beaml / 2);
- TGeoVolume* beamVolume = new TGeoVolume(fgkBeamName, beamShape, fC);
- n = fmd3->GetNBeam();
- r = noser2 + tdist / 2;
- zi = - nz + nlen + zdist / 2 + z;
- mother = fmd3TopVolume;
- for (Int_t i = 0; i < n; i++) {
- if (i >= n / 2) mother = fmd3BotVolume;
- Double_t phi = 360. / n * i;
- Double_t x = r * TMath::Cos(TMath::Pi() / 180 * phi);
- Double_t y = r * TMath::Sin(TMath::Pi() / 180 * phi);
- TGeoRotation* rot = new TGeoRotation(Form("FMD3 beam rotation %d", i));
- // Order is important
- rot->RotateY(-theta);
- rot->RotateZ(phi);
- TGeoMatrix* matrix = new TGeoCombiTrans(Form("FMD3 beam trans %d", i),
- x, y, zi, rot);
- mother->AddNode(beamVolume, i, matrix);
- }
-
- z = fmd3->GetInnerZ();
- TGeoRotation* rot = new TGeoRotation("FMD3 rotatation");
+ // Place support volumes in half-detector volumes
+ z = fmd3->GetInnerZ();
+ z1 = z-nz;
+ fmd3TopVolume->AddNode(support, 1, new TGeoTranslation(0,0,z1));
+ r1 = new TGeoRotation();
+ r1->RotateZ(180);
+ t = new TGeoCombiTrans(0,0,z1,r1);
+ fmd3BotVolume->AddNode(support, 2, t);
+
+ TGeoRotation* rot = new TGeoRotation("FMD3 rotatation");
rot->RotateY(180);
- TGeoVolume* top = gGeoManager->GetVolume("ALIC");
- TGeoMatrix* mmatrix = new TGeoCombiTrans("FMD3 trans", 0, 0, z, rot);
+ TGeoVolume* top = gGeoManager->GetVolume("ALIC");
+ TGeoMatrix* mmatrix = new TGeoCombiTrans("FMD3 trans", 0, 0, z, rot);
AliFMDDebug(5, ("Placing volumes %s and %s in ALIC at z=%f",
fmd3TopVolume->GetName(), fmd3BotVolume->GetName(), z));
top->AddNode(fmd3TopVolume, fmd3->GetId(), mmatrix);
fPCB = gGeoManager->GetMedium("FMD_PCB$");
fPlastic = gGeoManager->GetMedium("FMD_Plastic$");
fCopper = gGeoManager->GetMedium("FMD_Copper$");
+ fSteel = gGeoManager->GetMedium("FMD_Steel$");
- if (!fSi||!fC||!fAl||!fChip||!fAir||!fPCB||!fPlastic||!fCopper) {
+ if (!fSi||!fC||!fAl||!fChip||!fAir||!fPCB||!fPlastic||!fCopper||!fSteel) {
AliError("Failed to get some or all tracking mediums");
return;
}
fChip(o.fChip),
fAir(o.fAir),
fPlastic(o.fPlastic),
- fCopper(o.fCopper)
+ fCopper(o.fCopper),
+ fSteel(o.fSteel)
{}
/** Assignment operator */
AliFMDGeometryBuilder& operator=(const AliFMDGeometryBuilder&){return *this;}
TGeoMedium* fAir; //! Air Medium
TGeoMedium* fPlastic; //! Plastic Medium
TGeoMedium* fCopper; //! Copper Medium
+ TGeoMedium* fSteel; //! Steel Medium
static const Char_t* fgkActiveName; // Name of Active volumes
static const Char_t* fgkSectorName; // Name of Sector volumes
static const Char_t* fgkIHCName; // Name of Inner honeycomb volumes
static const Char_t* fgkNoseName; // Name of Nose volumes
static const Char_t* fgkBackName; // Name of Back volumes
+ static const Char_t* fgkTopName; // Name of Back volumes
static const Char_t* fgkBeamName; // Name of Beam volumes
static const Char_t* fgkFlangeName; // Name of Flange volumes
+ static const Char_t* fgkFMDDCuName; // Name of FMDD copper volumes
+ static const Char_t* fgkFMDDPCBName; // Name of FMDD PCB volumes
+ static const Char_t* fgkFMDDChipName; // Name of FMDD chip volumes
+ static const Char_t* fgkFMDDName; // Name of FMDD volumes
static const Char_t* fgkFMDName; // Name of Half FMD volumes
ClassDef(AliFMDGeometryBuilder,1)
void
AliFMDPattern::AddMarker(UShort_t det, Char_t rng,
UShort_t sec, UShort_t str,
- TObject*, Float_t s, Float_t max)
+ TObject*, Float_t s, Float_t min, Float_t max)
{
// Add a marker to the display
//
/** Assignement operator
-- Not implemented */
AliFMDPattern& operator=(const AliFMDPattern&);
+ virtual void AddMarker(Float_t x, Float_t y, Float_t z,
+ TObject* o, Float_t s, Float_t min, Float_t max)
+ {
+ AliFMDDisplay::AddMarker(x, y, z, o, s, min, max);
+ }
/** Add a marker to the display
@param det Detector
@param rng Ring
@param s Signal
@param max Maximum of signal */
virtual void AddMarker(UShort_t det, Char_t rng, UShort_t sec,
- UShort_t str, TObject* o, Float_t s, Float_t max);
+ UShort_t str, TObject* o, Float_t s,
+ Float_t min, Float_t max);
/** @param hit Hit to process */
virtual Bool_t ProcessHit(AliFMDHit* hit, TParticle*);
/** Re-draw the patterns */
fCopperThickness(0),
fChipThickness(0),
fSpacing(0),
+ fHoneycombThickness(0.),
+ fAlThickness(0.),
fVerticies(0)
{
// CTOR
SetCopperThickness();
SetChipThickness();
SetSpacing();
+ SetHoneycombThickness();
+ SetAlThickness();
if (fId == 'I' || fId == 'i') {
SetLowR(4.3);
return (strip + .5) * dstrip + stripoff; // fLowR
}
+//____________________________________________________________________
+Double_t
+AliFMDRing::GetFullDepth() const
+{
+ return (GetSiThickness() +
+ GetSpacing() +
+ GetPrintboardThickness() +
+ GetCopperThickness() +
+ GetChipThickness() +
+ GetModuleSpacing() +
+ GetLegLength() +
+ GetHoneycombThickness() +
+ GetFMDDPrintboardThickness() +
+ GetFMDDCopperThickness() +
+ GetFMDDChipThickness()
+ + 0.5);
+}
+
//____________________________________________________________________
void
AliFMDRing::Detector2XYZ(UShort_t sector,
/** @param x Value of Size of wafer the sensor was made from */
void SetWaferRadius(Double_t x=13.4/2) { fWaferRadius = x; }
/** @param x Value of Thickness of sensor */
- void SetSiThickness(Double_t x=.03) { fSiThickness = x; }
+ void SetSiThickness(Double_t x=.032) { fSiThickness = x; }
/** @param x Value of Lower radius of ring */
void SetLowR(Double_t x) { fLowR = x; }
/** @param x Value of Upper radius of ring */
void SetChipThickness(Double_t x=.01) { fChipThickness = x; }
/** @param x Value of spacing between si and PCB */
void SetSpacing(Double_t x=.05) { fSpacing = x; }
+ /** @param x Thickness of honeycomb plate */
+ void SetHoneycombThickness(Double_t x=1) { fHoneycombThickness = x; }
+ /** @param x Thickness of aluminium of honeycomb */
+ void SetAlThickness(Double_t x=.1) { fAlThickness = x; }
/** @return The Id of this ring type */
Char_t GetId() const { return fId; }
Double_t GetChipThickness() const { return fChipThickness; }
/** @return Value of spacing between si and PCB */
Double_t GetSpacing() const { return fSpacing; }
+ /** @return Thickness of honeycomb plate */
+ Double_t GetHoneycombThickness() const { return fHoneycombThickness; }
+ /** @return Thickness of aluminium of honeycomb */
+ Double_t GetAlThickness() const { return fAlThickness; }
/** @return The strip pitch */
Double_t GetPitch() const { return (fMaxR - fMinR) / fNStrips; }
/** @return Radius (in cm) correspondig to strip @a strip */
Double_t GetStripRadius(UShort_t strip) const;
-
+ /** @return Full depth of this (half) ring */
+ Double_t GetFullDepth() const;
+ /** Get the inner radius of the digitizer cards */
+ Double_t GetFMDDLowR() const { return 1.2*GetLowR(); }
+ /** Get the outer radius of the digitizer cards */
+ Double_t GetFMDDHighR() const { return .95*GetHighR(); }
+ /** @return Thickness of print board */
+ Double_t GetFMDDPrintboardThickness() const { return 2*fPrintboardThickness; }
+ /** @return Thickness copper of print board */
+ Double_t GetFMDDCopperThickness() const { return 2*fCopperThickness; }
+ /** @return Thickness chip of print board */
+ Double_t GetFMDDChipThickness() const { return 2*fChipThickness; }
+
/** @return List of verticies */
const TObjArray& GetVerticies() const { return fVerticies; }
/** @return Number of verticies */
Double_t fCopperThickness; // Thickness of Cu on print board
Double_t fChipThickness; // Thickness of chip on print board
Double_t fSpacing; // Spacing between si and PCB
+ Double_t fHoneycombThickness; // Thickness of honeycomb plate
+ Double_t fAlThickness; // Thickness of aluminium of honeycomb
TObjArray fVerticies; // List of verticies
// This part for configuration
// EG_t eg = test50;
// EG_t eg = kParam_fmd;
- EG_t eg = kParam_2000; // kPythia;
+ EG_t eg = kFMDFlat; // kParam_2000; // kPythia;
// EG_t eg = kFMDFlat;
Geo_t geo = kNoHoles;
Rad_t rad = kGluonRadiation;
if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
cdb->SetRun(0);
- Bool_t toCdb = TString(gSystem->Getenv("TOCDB")) == TString("kTRUE");
- TString storage = gSystem->Getenv("STORAGE");
-
- if(toCdb) {
- if(!storage.BeginsWith("local://") &&
- !storage.BeginsWith("alien://")) {
- Error(macroname,"STORAGE=\"%s\" is not valid. Exiting\n", storage.Data());
- return;
- }
-
- AliCDBStorage* store = cdb->GetStorage(storage.Data());
- if(!store){
- Error(macroname,"Unable to open storage %s\n", storage.Data());
- return;
- }
-
- AliCDBPath path("GRP","Geometry","Data");
- AliCDBEntry* entry = storage->Get(path.GetPath(),cdb->GetRun());
- if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
-
- entry->SetOwner(0);
- TGeoManager* geom = static_cast<TGeoManager*>(entry->GetObject());
- AliGeomManager::SetGeometry(geom);
- }else
- //load geom from default CDB storage
- AliGeomManager::LoadGeometry();
+ Bool_t toCdb = TString(gSystem->Getenv("TOCDB")) == TString("kTRUE");
+ TString storage = gSystem->Getenv("STORAGE");
+ TString output = "FMDfullMisalignment.root";
+ if(toCdb) output = storage;
gSystem->Load("libFMDutil.so");
- AliFMDAlignFaker* faker = (toCdb ?
- // save on file
- new AliFMDAlignFaker(AliFMDAlignFaker::kAll,
- "geometry.root",
- "FMDfullMisalignment.root") :
- // save in CDB storage
- new AliFMDAlignFaker(AliFMDAlignFaker::kAll,
- "geometry.root",
- storage.Data()));
-
+ AliFMDAlignFaker::GetGeometry(toCdb, storage);
+ AliFMDAlignFaker* faker = new AliFMDAlignFaker(AliFMDAlignFaker::kAll,
+ "geometry.root",
+ output.Data());
+
// Displacements and rotations
faker->SetSensorDisplacement(-0.005, -0.005, -0.005, 0.005, 0.005, 0.005);
faker->SetSensorRotation(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
cdb->SetRun(0);
- Bool_t toCdb = TString(gSystem->Getenv("TOCDB")) == TString("kTRUE");
- TString storage = gSystem->Getenv("STORAGE");
-
- if(toCdb) {
- if(!storage.BeginsWith("local://") &&
- !storage.BeginsWith("alien://")) {
- Error(macroname,"STORAGE=\"%s\" is not valid. Exiting\n", storage.Data());
- return;
- }
-
- AliCDBStorage* store = cdb->GetStorage(storage.Data());
- if(!store){
- Error(macroname,"Unable to open storage %s\n", storage.Data());
- return;
- }
-
- AliCDBPath path("GRP","Geometry","Data");
- AliCDBEntry* entry = storage->Get(path.GetPath(),cdb->GetRun());
- if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
-
- entry->SetOwner(0);
- TGeoManager* geom = static_cast<TGeoManager*>(entry->GetObject());
- AliGeomManager::SetGeometry(geom);
- }else
- //load geom from default CDB storage
- AliGeomManager::LoadGeometry();
+ Bool_t toCdb = TString(gSystem->Getenv("TOCDB")) == TString("kTRUE");
+ TString storage = gSystem->Getenv("STORAGE");
+ TString output = "FMDfullMisalignment.root";
+ if(toCdb) output = storage;
gSystem->Load("libFMDutil.so");
- AliFMDAlignFaker* faker = (toCdb ?
- // save on file
- new AliFMDAlignFaker(AliFMDAlignFaker::kAll,
- "geometry.root",
- "FMDfullMisalignment.root") :
- // save in CDB storage
- new AliFMDAlignFaker(AliFMDAlignFaker::kAll,
- "geometry.root",
- storage.Data()));
+ AliFMDAlignFaker::GetGeometry(toCdb, storage);
+ AliFMDAlignFaker* faker = new AliFMDAlignFaker(AliFMDAlignFaker::kAll,
+ "geometry.root",
+ output.Data());
+
faker->SetSensorDisplacement(-0.005, -0.005, -0.005, 0.005, 0.005, 0.005);
faker->SetSensorRotation(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5);
if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
cdb->SetRun(0);
- Bool_t toCdb = TString(gSystem->Getenv("TOCDB")) == TString("kTRUE");
- TString storage = gSystem->Getenv("STORAGE");
-
- if(toCdb) {
- if(!storage.BeginsWith("local://") &&
- !storage.BeginsWith("alien://")) {
- Error(macroname,"STORAGE=\"%s\" is not valid. Exiting\n", storage.Data());
- return;
- }
-
- AliCDBStorage* store = cdb->GetStorage(storage.Data());
- if(!store){
- Error(macroname,"Unable to open storage %s\n", storage.Data());
- return;
- }
-
- AliCDBPath path("GRP","Geometry","Data");
- AliCDBEntry* entry = storage->Get(path.GetPath(),cdb->GetRun());
- if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
-
- entry->SetOwner(0);
- TGeoManager* geom = static_cast<TGeoManager*>(entry->GetObject());
- AliGeomManager::SetGeometry(geom);
- }else
- //load geom from default CDB storage
- AliGeomManager::LoadGeometry();
+ Bool_t toCdb = TString(gSystem->Getenv("TOCDB")) == TString("kTRUE");
+ TString storage = gSystem->Getenv("STORAGE");
+ TString output = "FMDfullMisalignment.root";
+ if(toCdb) output = storage;
gSystem->Load("libFMDutil.so");
- AliFMDAlignFaker* faker = (toCdb ?
- // save on file
- new AliFMDAlignFaker(AliFMDAlignFaker::kAll,
- "geometry.root",
- "FMDfullMisalignment.root") :
- // save in CDB storage
- new AliFMDAlignFaker(AliFMDAlignFaker::kAll,
- "geometry.root",
- storage.Data()));
-
+ AliFMDAlignFaker::GetGeometry(toCdb, storage);
+ AliFMDAlignFaker* faker = new AliFMDAlignFaker(AliFMDAlignFaker::kAll,
+ "geometry.root",
+ output.Data());
faker->SetSensorDisplacement(0., 0., 0., 0., 0., 0.);
faker->SetSensorRotation(0., 0., 0., 0., 0., 0.);
/** Script to do test the FMD digitization class.
*/
void
-Simulate(Int_t n=10)
+Simulate(Int_t n=1)
{
AliSimulation sim;
// AliLog::SetModuleDebugLevel("FMD", 1);
--- /dev/null
+void
+CheckOverlaps(Bool_t align=kTRUE, Bool_t sample=kTRUE)
+{
+ AliGeomManager::LoadGeometry("geometry.root");
+ if (align)
+ AliGeomManager::ApplyAlignObjsToGeom("FMDfullMisalignment.root",
+ "FMDAlignment");
+ TObjArray* l = gGeoManager->GetListOfPhysicalNodes();
+ TIter next(l);
+ TGeoPhysicalNode* pn = 0;
+ TGeoVolume* v = 0;
+ while ((pn = static_cast<TGeoPhysicalNode*>(next()))) {
+ pn->cd();
+ v = gGeoManager->GetCurrentVolume();
+ std::cout << "Checking " << v->GetName() << std::endl;
+ v->CheckOverlaps(0.01);
+ if (gGeoManager->GetListOfOverlaps()->GetEntriesFast())
+ gGeoManager->GetListOfOverlaps()->ls();
+
+ if (!sample) continue;
+
+ gGeoManager->ClearOverlaps();
+ gGeoManager->SetCheckingOverlaps();
+ TGeoNode* start = gGeoManager->GetCurrentNode();
+ TGeoVolume* vol = start->GetVolume();
+ TGeoIterator gnext(vol);
+ TGeoNode* node;
+ TString path;
+ while ((node = gnext())) {
+ gnext.GetPath(path);
+ // std::cout << " Checking: " << path.Data() << std::endl;
+ node->GetVolume()->CheckOverlaps(0.01,"s");
+ }
+ gGeoManager->SetCheckingOverlaps(kFALSE);
+ if (gGeoManager->GetListOfOverlaps()->GetEntriesFast()) {
+ gGeoManager->GetListOfOverlaps()->ls();
+ pn->Print();
+ }
+ }
+}
+
if (!TGeoManager::Import("geometry.root"))
gAlice->Init("$ALICE_ROOT/FMD/Config.C");
AliCDBManager* cdb = AliCDBManager::Instance();
- cdb->SetDefaultStorage("$ALICE_ROOT");
+ if(!cdb->IsDefaultStorageSet())
+ cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
AliLog::SetModuleDebugLevel("FMD", 1);
gSystem->Load("libFMDutil.so");
AliFMDAlignFaker f(AliFMDAlignFaker::kAll, "geometry.root", 0);