34 #include <TApplication.h> 37 #include <TGeoManager.h> 39 #include <TMarker3DBox.h> 42 #include <TSliderBox.h> 45 #include <TVirtualX.h> 46 #include <TVirtualViewer3D.h> 135 fTimeout(
"gApplication->StopIdleing()", 10),
143 SetName(
"AliFMDDisplay");
144 SetTitle(
"3D Display of various kinds of FMD data");
161 fCanvas =
new TCanvas(Form(
"gl%s", GetName()),
162 Form(
"%s - Display", GetTitle()),
163 w, Int_t(w / (1-y1)));
167 fPad =
new TPad(
"glview",
"3DView", 0.0, y1, 1.0, 1.0, 1, 0, 0);
170 const char**
p = which;
186 fFactor =
new TSlider(
"pedFactor",
"Pedestal Factor", xb+.01, 0, 1, yb);
187 fFactor->SetMethod(
"AliFMDDisplay::Instance()->ChangeFactor()");
192 static_cast<TSliderBox*
>(
fFactor->GetListOfPrimitives()->
193 FindObject(
"TSliderBox"));
195 sbox->SetToolTipText(
"Adjust the noise suppression factor by moving " 206 fSlider =
new TSlider(
"genCut",
"Multiplicity cut", 0, 0, xb, yb);
207 fSlider->SetMethod(
"AliFMDDisplay::Instance()->ChangeCut()");
211 static_cast<TSliderBox*
>(
fSlider->GetListOfPrimitives()->
212 FindObject(
"TSliderBox"));
214 sbox->SetToolTipText(
"Adjust lower and upper limit on data signal");
223 while ((m = *(p++))) {
226 TButton*
b =
new TButton(m, Form(
"AliFMDDisplay::Instance()->%s()", m),
227 x0, yb, TMath::Min(x0 + dx,.999F), y1);
243 static bool once =
false;
246 AliInfo(
"Will only show the FMD");
248 top->InvisibleAll(kTRUE);
249 TGeoIterator next(top);
256 TGeoMaterial* si =
gGeoManager->GetMaterial(
"FMD_Si$");
258 TGeoMaterial* c =
gGeoManager->GetMaterial(
"FMD_Carbon$");
259 AliFMDDebug(1, (
"Getting material FMD_Aluminum$"));
260 TGeoMaterial* al =
gGeoManager->GetMaterial(
"FMD_Aluminum$");
262 TGeoMaterial* cu =
gGeoManager->GetMaterial(
"FMD_Copper$");
264 TGeoMaterial* pcb =
gGeoManager->GetMaterial(
"FMD_PCB$");
266 TGeoMaterial* chip =
gGeoManager->GetMaterial(
"FMD_Si Chip$");
268 while ((node = static_cast<TGeoNode*>(next()))) {
269 const char* name = node->GetName();
271 if (!(v = node->GetVolume()))
continue;
273 if (name[0] ==
'F') {
274 TGeoMaterial* m = (v->IsAssembly() ? 0 : v->GetMaterial());
276 if (m == si) col = kRed;
277 else if (m == c) col = kGray;
278 else if (m == al) col = kYellow+4;
279 else if (m == cu) col = kRed+6;
280 else if (m == pcb) col = kGreen+2;
281 else if (m == chip) col = kGreen+4;
283 v->SetLineColor(col);
284 v->SetFillColor(col);
286 if (name[2] ==
'M' && (name[3] ==
'T' || name[3] ==
'B')) {
297 else if (name[3] ==
'V' && (name[2] ==
'T' || name[2] ==
'B'))
299 else if (name[3] ==
'H' && (name[2] ==
'F' || name[2] ==
'B'))
301 else if (name[2] ==
'S' && name[3] ==
'U')
306 v->SetVisibility(kFALSE);
307 v->SetVisDaughters(kFALSE);
308 v->InvisibleAll(kTRUE);
311 while ((v = static_cast<TGeoVolume*>(i()))) {
312 if (!v->IsAssembly())
313 v->SetVisibility(kTRUE);
314 v->InvisibleAll(kFALSE);
315 v->SetVisDaughters(kTRUE);
329 if (px == 0 && py == 0)
return;
331 fPad->GetView()->ExecuteRotateView(event, px, py);
334 fPad->SetCursor(kCross);
337 fPad->TAttLine::Modify();
355 fPad->GetCanvas()->FeedbackMode(kFALSE);
384 fHits->SetOwner(kFALSE);
405 fAux =
new TCanvas(Form(
"aux_%s", GetName()),
406 Form(
"Aux - %s", GetTitle()));
408 fAux->SetFillColor(kWhite);
409 fAux->SetBorderMode(0);
410 fAux->SetBorderSize(0);
413 range->
fLow-dBin/2, range->
fHigh+dBin/2);
421 fSpec->SetXTitle(xTitle.Data());
422 fSpec->SetYTitle(
"events");
423 fSpec->SetFillColor(2);
424 fSpec->SetFillStyle(3001);
462 const char* m[] = {
"Continue",
477 Warning(
"End",
"No geometry manager");
486 if (
fPad->GetView()) {
487 fPad->GetView()->SetView(-200, -40, 80, irep);
488 fPad->GetView()->Zoom();
520 gApplication->StartIdleing();
521 gSystem->InnerLoop();
522 gApplication->StopIdleing();
549 Float_t
range = (max-min);
550 Float_t l =
fSlider->GetMinimum();
551 Float_t h =
fSlider->GetMaximum();
552 if (l == h) { l = 0; h = 1; }
553 Float_t cmin = range * l;
554 Float_t cmax = range * h;
555 Float_t crange = (cmax-cmin);
556 Int_t idx = Int_t((x-cmin) / crange *
gStyle->GetNumberOfColors());
557 return gStyle->GetColorPalette(idx);
598 Float_t l =
fSlider->GetMinimum();
599 Float_t h =
fSlider->GetMaximum();
602 AliInfo(Form(
"ADC range is now %4d - %4d",
int(l),
int(h)));
613 AliInfo(Form(
"Noise factor is now %4.1f", 10 *
fFactor->GetMinimum()));
650 TVirtualViewer3D*
viewer =
fPad->GetViewer3D(
"ogl");
657 TObject* o, Float_t s, Float_t min, Float_t max)
670 Float_t zsize = (s - min) / (max-min) * 10;
671 Float_t r = TMath::Sqrt(x * x + y * y);
672 Float_t theta = TMath::ATan2(r, z);
673 Float_t phi = TMath::ATan2(y, x);
674 Float_t rz = z + (z < 0 ? 1 : -1) * zsize;
675 TMarker3DBox* marker =
new TMarker3DBox(x,y,rz,size,size,zsize,theta,phi);
676 if (o) marker->SetRefObject(o);
683 TObject* o, Float_t s, Float_t min, Float_t max)
704 const Float_t& max)
const 717 Float_t r = max - min;
718 Float_t l =
fSlider->GetMinimum();
719 Float_t h =
fSlider->GetMaximum();
720 if (l == h) { l = 0; h = 1; }
721 if (val < r * l + min || val > r * h + min) {
722 AliFMDDebug(2, (
"Value %f is outside cut %f - %f (range %f - %f)",
723 val, min+r*l, min+r*h, min, max));
740 if (!hit) {
AliError(
"No hit");
return kFALSE; }
742 Float_t edep = hit->
Edep();
746 if (!
InsideCut(edep, rMin, rMax))
return kTRUE;
749 AddMarker(hit->
X(), hit->
Y(), hit->
Z(), hit, edep, rMin, rMax);
763 if (!digit) {
AliError(
"No digit");
return kFALSE; }
766 Char_t ring = digit->
Ring();
767 UShort_t sec = digit->
Sector();
768 UShort_t str = digit->
Strip();
770 Float_t counts = digit->
Counts();
771 if (threshold < 0) { counts += -threshold; threshold = 0; }
773 AliFMDDebug(10, (
"FMD%d%c[%02d,%03d] counts %4d threshold %4d",
774 det, ring, sec, str, Int_t(counts), Int_t(threshold)));
777 if (!
InsideCut(counts-threshold, rMin, rMax))
return kTRUE;
781 AddMarker(det, ring, sec, str, digit, counts, rMin, rMax);
795 if (!sdigit) {
AliError(
"No sdigit");
return kFALSE; }
798 Char_t ring = sdigit->
Ring();
799 UShort_t sec = sdigit->
Sector();
800 UShort_t str = sdigit->
Strip();
801 Float_t counts = sdigit->
Counts();
805 if (!
InsideCut(counts, rMin, rMax))
return kTRUE;
808 AddMarker(det, ring, sec, str, sdigit, counts, rMin, rMax);
819 AliFMDDebug(50, (
"Forwarding call of ProcessRaw to ProcessDigit " 820 "for FMD%d%c[%02d,%03d] %d",
838 if (!digit) {
AliError(
"No digit");
return kFALSE; }
842 Char_t ring = digit->
Ring();
843 UShort_t sec = digit->
Sector();
844 UShort_t str = digit->
Strip();
845 Double_t gain = parm->
GetPulseGain(det, ring, sec, str);
846 Double_t ped = parm->
GetPedestal(det, ring, sec, str);
848 Float_t counts = digit->
Counts();
849 if (threshold < 0) { counts += -threshold; threshold = 0; ped = 0; }
853 Double_t mult = (counts-ped) / (gain * parm->
GetDACPerMIP());
854 if (gain < 0.1 || gain > 10) mult = 0;
858 "(threshold %4d, gain %6.3f) -> mult %7.4f",
859 det, ring, sec, str,
int(counts),
int(threshold),
863 if (!
InsideCut(counts-threshold, aMin, aMax))
return kTRUE;
867 AddMarker(det, ring, sec, str, digit, mult, rMin, rMax);
882 if (!recpoint) {
AliError(
"No recpoint");
return kFALSE; }
895 Float_t, Float_t mult)
904 Double_t cmult = mult;
909 AddMarker(det,rng,sec,str, 0, cmult, rMin, rMax);
919 UShort_t s, UShort_t t)
const 936 Double_t threshold = 0;
940 threshold = ped + pedW * 10 *
fFactor->GetMinimum();
941 AliFMDDebug(10, (
"FMD%d%c[%2d,%3d] ped: %f +/- %f [factor: %f-%f]",
942 d, r, s, t, ped, pedW,
Float_t GetDACPerMIP() const
Reconstructed FMD points. It contains the pseudo-inclusive multiplicity.
AliFMDDisplay(Bool_t onlyFMD=kTRUE, const char *gAliceFile="galice.root")
virtual Int_t LookupColor(Float_t x, Float_t min, Float_t max) const
Geometry mananger for the FMD.
virtual Double_t GetADCThreshold(UShort_t d, Char_t r, UShort_t s, UShort_t t) const
UShort_t NoiseFactor(UShort_t ddl) const
virtual Bool_t Begin(Int_t event)
virtual void InitTransformations(Bool_t force=kFALSE)
static const Range_t fgkMultRange
This class is a singleton that handles various parameters of the FMD detectors. This class reads from...
Manager of FMD parameters.
Float_t GetPulseGain(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
AliTPCCalibViewerGUI * viewer
virtual Bool_t ProcessDigit(AliFMDDigit *digit)
UShort_t Detector() const
virtual Bool_t ProcessRawCalibDigit(AliFMDDigit *digit)
virtual Bool_t ProcessRecPoint(AliFMDRecPoint *recpoint)
virtual void SetFactor(Float_t f=1)
virtual void AddMarker(Float_t x, Float_t y, Float_t z, TObject *o, Float_t s, Float_t min, Float_t max)
Pseudo reconstructed charged particle multiplicity.
Bool_t IsZeroSuppressed(UShort_t ddl) const
static AliFMDDisplay * Instance()
virtual void ChangeFactor()
virtual Bool_t InsideCut(Float_t v, const Float_t &min, const Float_t &max) const
static AliFMDDisplay * fgInstance
Singleton object of FMD geometry descriptions and parameters. This class is a singleton that handles ...
TGeoManager * gGeoManager
#define AliFMDDebug(N, A)
virtual Bool_t ProcessSDigit(AliFMDSDigit *sdigit)
static AliFMDParameters * Instance()
void Detector2XYZ(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip, Double_t &x, Double_t &y, Double_t &z) const
virtual void MakeCanvas(const char **which)
virtual Bool_t ProcessRawDigit(AliFMDDigit *digit)
static const Range_t fgkAdcRange
virtual Bool_t ProcessESD(UShort_t d, Char_t r, UShort_t s, UShort_t t, Float_t eta, Float_t mult)
class for summable digits
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Utility class to visualize FMD data in geometry.
AliFMDhit is the hit class for the FMD. Hits are the information that comes from a Monte Carlo at eac...
UShort_t Detector() const
#define AliError(message)
virtual void SetCut(Float_t l=0., Float_t h=1.)
static AliFMDGeometry * Instance()
Float_t GetPedestal(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
Float_t GetPedestalWidth(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
static const Range_t fgkEdepRange
Float_t Particles() const
UShort_t Init(Bool_t forceReInit=kFALSE, UInt_t what=kAll)
virtual Bool_t ProcessHit(AliFMDHit *hit, TParticle *p)