AliFMDMap::kMaxSectors,
AliFMDMap::kMaxStrips),
fShapingTime(6),
- fStoreTrackRefs(kFALSE)
+ fStoreTrackRefs(kTRUE)
{
AliFMDDebug(1, ("Constructed"));
// Default ctor - don't use it
: AliDigitizer(manager, "AliFMDBaseDigitizer", "FMD Digitizer base class"),
fFMD(0),
fRunLoader(0),
- fEdep(AliFMDMap::kMaxDetectors,
- AliFMDMap::kMaxRings,
- AliFMDMap::kMaxSectors,
- AliFMDMap::kMaxStrips),
+ fEdep(0), // nDet==0 means 51200 slots
fShapingTime(6),
- fStoreTrackRefs(kFALSE)
+ fStoreTrackRefs(kTRUE)
{
// Normal CTOR
AliFMDDebug(1, ("Constructed"));
: AliDigitizer(name, title),
fFMD(0),
fRunLoader(0),
- fEdep(AliFMDMap::kMaxDetectors,
- AliFMDMap::kMaxRings,
- AliFMDMap::kMaxSectors,
- AliFMDMap::kMaxStrips),
+ fEdep(0), // nDet==0 means 51200 slots
fShapingTime(6),
- fStoreTrackRefs(kFALSE)
+ fStoreTrackRefs(kTRUE)
{
// Normal CTOR
AliFMDDebug(1, (" Constructed"));
UShort_t strip,
Float_t edep,
Bool_t isPrimary,
- Int_t trackno)
+ Int_t nTrack,
+ Int_t* tracknos)
{
// Add edep contribution from (detector,ring,sector,strip) to cache
AliFMDParameters* param = AliFMDParameters::Instance();
-
+ AliFMDDebug(10, ("Adding contribution %7.5f for FMD%d%c[%2d,%3d] "
+ " from %d tracks (%s)",
+ edep,
+ detector,
+ ring,
+ sector,
+ strip,
+ nTrack,
+ (isPrimary ? "primary" : "secondary")));
// Check if strip is `dead'
if (param->IsDead(detector, ring, sector, strip)) {
AliFMDDebug(5, ("FMD%d%c[%2d,%3d] is marked as dead",
detector, ring, sector, strip));
// Sum energy deposition
+ Int_t oldN = entry.fN;
entry.fEdep += edep;
- entry.fN += 1;
- if (isPrimary) entry.fNPrim += 1;
+ entry.fN += nTrack;
+ if (isPrimary) entry.fNPrim += nTrack;
if (fStoreTrackRefs) {
- entry.fLabels.Set(entry.fN);
- entry.fLabels[entry.fN-1] = trackno;
+ if (entry.fLabels.fN < entry.fN) {
+ AliFMDDebug(15, ("== New label array size %d, was %d, added %d",
+ entry.fN, entry.fLabels.fN, nTrack));
+ entry.fLabels.Set(entry.fN);
+ }
+ for (Int_t i = 0; i < nTrack; i++) {
+ AliFMDDebug(15, ("=> Setting track label # %d", oldN+i));
+ entry.fLabels[oldN + i] = tracknos[i];
+ AliFMDDebug(15, ("<= Setting track label # %d", oldN+i));
+ }
}
- AliFMDDebug(15, ("Adding contribution %f to FMD%d%c[%2d,%3d] (%f)",
- edep, detector, ring, sector, strip,
- entry.fEdep));
+ AliFMDDebug(15,("Adding contribution %f to FMD%d%c[%2d,%3d] (%f) track %d",
+ edep, detector, ring, sector, strip,
+ entry.fEdep, (nTrack > 0 ? tracknos[0] : -1)));
}
Short_t(counts[2]), Short_t(counts[3]),
ntot, nprim, labels);
AliFMDDebug(15, (" Adding digit in FMD%d%c[%2d,%3d]=%d",
- detector,ring,sector,strip,counts[0]));
+ detector,ring,sector,strip,counts[0]));
#if 0
// This checks if the digit created will give the `right'
// number of particles when reconstructed, using a naiive
Short_t count2,
Short_t count3,
Short_t count4,
- UShort_t /* ntot */,
+ UShort_t ntot,
UShort_t /* nprim */,
- const TArrayI& /* refs */) const
+ const TArrayI& refs) const
{
// Add a digit or summable digit
-
fFMD->AddDigitByFields(detector, ring, sector, strip,
- count1, count2, count3, count4);
+ count1, count2, count3, count4,
+ ntot, fStoreTrackRefs ? refs.fArray : 0);
}
//____________________________________________________________________