public:
AliFMDBoolMap(const AliFMDBoolMap& other);
AliFMDBoolMap(size_t maxDet = kMaxDetectors,
- size_t maxRing = kMaxRings,
- size_t maxSec = kMaxSectors,
- size_t maxStr = kMaxStrips);
+ size_t maxRing = kMaxRings,
+ size_t maxSec = kMaxSectors,
+ size_t maxStr = kMaxStrips);
virtual ~AliFMDBoolMap() { delete [] fData; }
AliFMDBoolMap& operator=(const AliFMDBoolMap& other);
virtual void Reset(const Bool_t& v=Bool_t());
//____________________________________________________________________
class AliFMDEdepHitPair
{
- public:
+public:
Float_t fEdep;
UShort_t fN;
AliFMDEdepHitPair() : fEdep(0), fN(0) {}
// maxStr Maximum # of strips
}
+//____________________________________________________________________
+Int_t
+AliFMDMap::CheckIndex(size_t det, Char_t ring, size_t sec, size_t str) const
+{
+ // Check that the index supplied is OK. Returns true index, or -1
+ // on error.
+ size_t ringi = (ring == 'I' || ring == 'i' ? 0 : 1);
+ size_t idx =
+ (det + fMaxDetectors * (ringi + fMaxRings * (sec + fMaxSectors * str)));
+ if (idx >= fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips)
+ return -1;
+ return idx;
+}
+
//____________________________________________________________________
size_t
AliFMDMap::CalcIndex(size_t det, Char_t ring, size_t sec, size_t str) const
//
// Returns appropriate index into storage
//
- size_t ringi = (ring == 'I' || ring == 'i' ? 0 : 1);
- size_t idx =
- (det + fMaxDetectors * (ringi + fMaxRings * (sec + fMaxSectors * str)));
- if (idx >= fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips) {
+ Int_t idx = CheckIndex(det, ring, sec, str);
+ if (idx < 0) {
+ size_t ringi = (ring == 'I' || ring == 'i' ? 0 : 1);
Fatal("CalcIndex", "Index (%d,'%c',%d,%d) out of bounds, "
- "in particular the %s index",
+ "in particular the %s index ",
det, ring, sec, str,
(det >= fMaxDetectors ? "Detector" :
(ringi >= fMaxRings ? "Ring" :
(sec >= fMaxSectors ? "Sector" : "Strip"))));
return 0;
}
- return idx;
+ return size_t(idx);
}
size_t maxSec = kMaxSectors,
size_t maxStr = kMaxStrips);
virtual ~AliFMDMap() {}
+ Int_t CheckIndex(size_t det, Char_t ring, size_t sec, size_t str) const;
protected:
size_t CalcIndex(size_t det, Char_t ring, size_t sec, size_t str) const;
size_t fMaxDetectors; // Maximum # of detectors
// - ENDIF
//
TVirtualMC* mc = TVirtualMC::GetMC();
+ static int nCall = 0;
if (!mc->IsTrackAlive()) return;
if (TMath::Abs(mc->TrackCharge()) <= 0) return;
Int_t copy;
Int_t vol = mc->CurrentVolID(copy);
if (vol != fInnerId && vol != fOuterId) {
- AliDebug(15, Form("Not an FMD volume %d '%s' (%d or %d)",
+ AliDebug(25, Form("Not an FMD volume %d '%s' (%d or %d)",
vol, mc->CurrentVolName(), fInnerId, fOuterId));
return;
}
+ nCall++;
// Check that the track is actually within the active area
Bool_t entering = mc->IsTrackEntering();
Bool_t inside = mc->IsTrackInside();
// Reset the energy deposition for this track, and update some of
// our parameters.
if (entering) {
- AliDebug(15, "Entering active FMD volume");
+ AliDebug(15, Form("Track # %8d entering active FMD volume %s: "
+ "Edep=%f (call # %d)",
+ gAlice->GetMCApp()->GetCurrentTrackNumber(),
+ mc->CurrentVolPath(), 1000 * mc->Edep(), nCall));
fCurrentDeltaE = 0;
// Get production vertex and momentum of the track
}
// If the track is inside, then update the energy deposition
- if (inside && fCurrentDeltaE >= 0)
- AliDebug(15, "Inside active FMD volume");
+ if (inside && fCurrentDeltaE >= 0) {
fCurrentDeltaE += 1000 * mc->Edep();
-
+ AliDebug(15, Form("Track # %8d inside active FMD volume %s: Edep=%f, "
+ "Accumulated Edep=%f (call # %d)",
+ gAlice->GetMCApp()->GetCurrentTrackNumber(),
+ mc->CurrentVolPath(), 1000 * mc->Edep(),
+ fCurrentDeltaE, nCall));
+ }
+
// The track exits the volume, or it disappeared in the volume, or
// the track is stopped because it no longer fulfills the cuts
// defined, then we create a hit.
if (out && fCurrentDeltaE >= 0) {
- AliDebug(15, Form("Leaving active FMD volume %s", mc->CurrentVolPath()));
Int_t strip = copy - 1;
Int_t sectordiv;
}
sector--;
fCurrentDeltaE += 1000 * mc->Edep();
+ AliDebug(15, Form("Track # %8d leaving active FMD volume %s: Edep=%f, "
+ "Accumulated Edep=%f (call # %d nCall)",
+ gAlice->GetMCApp()->GetCurrentTrackNumber(),
+ mc->CurrentVolPath(),
+ 1000 * mc->Edep(), fCurrentDeltaE, nCall));
AliDebug(20, Form("Processing hit in FMD%d%c[%2d,%3d]: %f",
detector, ring, sector, strip, fCurrentDeltaE));
void DrawFMD()
{
+ gSystem->Load("/usr/lib/libshift");
+ gSystem->Load("/usr/lib/libgfortran");
+ gSystem->Load("libgeant321");
+ gMC = new TGeant3TGeo;
gMC->Gsatt("*", "seen", -1);
gMC->Gsatt("alic", "seen", 0);
gROOT->LoadMacro("FMD/ViewFMD.C");
gInterpreter->ProcessLine("ViewFMD()");
+ gROOT->LoadMacro("ITS/ViewITS.C");
+ gInterpreter->ProcessLine("ViewITS()");
gMC->Gdopt("hide", "on");
gMC->Gdopt("shad", "on");
gMC->Gsatt("*", "fill", 7);
rec.SetRunLocalReconstruction("FMD");
rec.SetRunVertexFinder(kFALSE);
// rec.SetRunTracking(kFALSE);
- rec.SetFillESD("");
+ rec.SetFillESD("FMD");
rec.SetInput("./");
rec.Run();
}
// sim.SetMakeDigits("FMD");
sim.SetWriteRawData("FMD");
// sim.SetMakeDigitsFromHits("FMD");
- sim.Run(2);
+ sim.Run(1);
}
//
gMC->Gsatt("alic", "seen", 0);
gROOT->LoadMacro("FMD/ViewFMD.C");
gInterpreter->ProcessLine("ViewFMD()");
- gROOT->LoadMacro("VZERO/ViewVZERO.C");
- gInterpreter->ProcessLine("ViewVZERO()");
- gROOT->LoadMacro("START/ViewSTART.C");
- gInterpreter->ProcessLine("ViewSTART()");
+ // gROOT->LoadMacro("VZERO/ViewVZERO.C");
+ // gInterpreter->ProcessLine("ViewVZERO()");
+ // gROOT->LoadMacro("START/ViewSTART.C");
+ // gInterpreter->ProcessLine("ViewSTART()");
gROOT->LoadMacro("macros/ViewITS.C");
gInterpreter->ProcessLine("ViewITS()");
// gROOT->LoadMacro("FMD/scripts/ViewPIPE.C");
// gInterpreter->ProcessLine("ViewPIPE()");
// gMC->Gsatt("ITSV", "seen", 1);
- gMC->Gsatt("0STR", "seen", 1);
- gMC->Gsatt("0STL", "seen", 1);
- gMC->Gsatt("0SUP", "seen", 1);
+ // gMC->Gsatt("0STR", "seen", 1);
+ // gMC->Gsatt("0STL", "seen", 1);
+ // gMC->Gsatt("0SUP", "seen", 1);
// gMC->Gsatt("FMD1", "seen", 1);
// gMC->Gsatt("FMD2", "seen", 1);
- gMC->Gsatt("FMD3", "seen", 0);
- gMC->Gdopt("hide", "on");
- gMC->Gdopt("shad", "on");
- gMC->Gsatt("*", "fill", 7);
- gMC->SetClipBox(".");
- gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
- gMC->DefaultRange();
- gMC->Gdraw("alic", 60, 0, 0, 10, 10, .10, .10);
+ // gMC->Gsatt("FMD3", "seen", 0);
+ //gMC->Gdopt("hide", "on");
+ //gMC->Gdopt("shad", "on");
+ // gMC->Gsatt("*", "fill", 7);
+ // gMC->SetClipBox(".");
+ // gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
+ // gMC->DefaultRange();
+ // gMC->Gdraw("alic", 60, 0, 0, 10, 10, .10, .10);
// gMC->Gdhead(1111, "FMD3 detail");
// gMC->Gdman(16, 10, "MAN");
-
+ gGeoManager->GetTopVolume()->Draw();
gPad->Modified();
gPad->cd();
- gPad->Print("Inner.png");
+ // gPad->Print("Inner.png");
}