X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=FMD%2FAliFMDPattern.cxx;h=800ee2b66f61c0a41e463aa1da7ce6748ba1ff1c;hb=f2597905eb67c24eccdfc2766a88fbb587fbc547;hp=932736d11b423abfe9db4a9905946c48c2c9bc0e;hpb=5cf05dbbfae57642fb7488402fb5ed9983167db4;p=u%2Fmrichter%2FAliRoot.git diff --git a/FMD/AliFMDPattern.cxx b/FMD/AliFMDPattern.cxx index 932736d11b4..800ee2b66f6 100644 --- a/FMD/AliFMDPattern.cxx +++ b/FMD/AliFMDPattern.cxx @@ -29,7 +29,7 @@ // Latest changes by Christian Holm Christensen // -// #include +#include // #include // #include @@ -66,7 +66,8 @@ AliFMDPattern::AliFMDPatternDetector::AliFMDPatternDetector(UShort_t id) fCounts(0), fGraphs(0), fFrame(0), - fInners(id == 1 ? 10 : 0) + fInners(10), + fOuters(id == 1 ? 0 : 20) { // CTOR // @@ -251,6 +252,12 @@ AliFMDPattern::AliFMDPatternDetector::AddMarker(Double_t x, this a usage of the TMath namespace declaration! Idiot */ Int_t i = TMath::Min(Int_t(fCounts.fN * s / max), Int_t(fGraphs.GetEntries()-1)); + if (i < 0 || i >= fCounts.fN) { + std::cerr << "Graph index " << i << " out of bounds [0," + << fCounts.fN << ") - " + << fCounts.fN << " * " << s << " / " << max << std::endl; + return; + } TGraph* g = static_cast(fGraphs.At(i)); if (!g) return; g->SetPoint(fCounts[i]++, x, y); @@ -276,7 +283,10 @@ AliFMDPattern::AliFMDPattern(const char* gAliceFile) fFMD2Sum(.2, .6, "# in FMD2: "), fFMD3Sum(.2, .5, "# in FMD3: "), fLine(.15, .47, .85, .47), - fTotal(.2, .35, "Total: ") + fTotal(.2, .35, "Total: "), + fFMD1Area(0), + fFMD2Area(0), + fFMD3Area(0) { // Constructor. // @@ -320,28 +330,50 @@ AliFMDPattern::Init() geom->Init(); geom->InitTransformations(); + fFMD1Area = 0; + fFMD2Area = 0; + fFMD3Area = 0; + + Double_t innerArea = 0; + Double_t outerArea = 0; + Char_t rs[] = { 'I' , 'O', '\0' }; Char_t *r = rs; do { AliFMDRing* ring = geom->GetRing(*r); if (!ring) continue; + + Double_t rl = ring->GetMinR(); + Double_t rh = ring->GetMaxR(); + Double_t area = rh * rh * TMath::Pi() - rl * rl * TMath::Pi(); + if (*r == 'I') innerArea = area; + else outerArea = area; + + const TObjArray& vs = ring->GetVerticies(); TObjArray& gs = (*r == 'I' ? fInners : fOuters); Float_t& mr = (*r == 'I' ? fInnerMax : fOuterMax); Int_t nm = ring->GetNModules(); AliFMDDebug(1, ("Making %d modules for %c", nm, *r)); for (Int_t m = 0; m < nm; m++) { - Int_t nv = vs.GetEntries(); + Int_t nv = 6; // vs.GetEntries(); Double_t a = TMath::Pi() / 180 * (m * 2 + 1) * ring->GetTheta(); TGraph* g = new TGraph(nv+1); Double_t x0 = 0, y0 = 0; gs.AddAtAndExpand(g, m); - for (Int_t c = 0; c < nv; c++) { + for (Int_t c = 1; c < 4; c++) { TVector2* v = static_cast(vs.At(c)); mr = TMath::Max(mr, Float_t(v->Mod())); TVector2 w(v->Rotate(a)); - if (c == 0) { x0 = w.X(); y0 = w.Y(); } - g->SetPoint(c, w.X(), w.Y()); + if (c == 1) { x0 = w.X(); y0 = w.Y(); } + g->SetPoint(c-1, w.X(), w.Y()); + } + for (Int_t c = 3; c > 0; c--) { + TVector2* v = static_cast(vs.At(c)); + TVector2 u(-v->X(), v->Y()); + mr = TMath::Max(mr, Float_t(u.Mod())); + TVector2 w(u.Rotate(a)); + g->SetPoint(3+(3-c), w.X(), w.Y()); } g->SetName(Form("FMDX%c_%02d%02d", *r, 2*m,2*m+1)); g->SetTitle(Form("FMDX%c, sectors %d and %d", *r, 2*m,2*m+1)); @@ -355,7 +387,11 @@ AliFMDPattern::Init() g->SetLineStyle(2); } } while (*(++r)); - + + fFMD1Area = innerArea; + fFMD2Area = innerArea + outerArea; + fFMD3Area = innerArea + outerArea; + return kTRUE; } @@ -441,17 +477,20 @@ AliFMDPattern::AtEnd() fFMD1.End(); fFMD1Pad->Modified(); - fFMD1Sum.SetTitle(Form("# hits in FMD1: %5d", fFMD1.Total())); + fFMD1Sum.SetTitle(Form("# hits in FMD1: %5d (%4.2f /cm^{2})", + fFMD1.Total(), fFMD1.Total()/fFMD1Area)); total += fFMD1.Total(); fFMD2.End(); fFMD2Pad->Modified(); - fFMD2Sum.SetTitle(Form("# hits in FMD2: %5d", fFMD2.Total())); + fFMD2Sum.SetTitle(Form("# hits in FMD2: %5d (%4.2f /cm^{2})", + fFMD2.Total(), fFMD2.Total()/fFMD2Area)); total += fFMD2.Total(); fFMD3.End(); fFMD3Pad->Modified(); - fFMD3Sum.SetTitle(Form("# hits in FMD3: %5d", fFMD3.Total())); + fFMD3Sum.SetTitle(Form("# hits in FMD3: %5d (%4.2f /cm^{2})", + fFMD3.Total(), fFMD3.Total()/fFMD3Area)); total += fFMD3.Total(); fTotal.SetTitle(Form("Total: %5d/51200 (%3d%%)",