else if (fTracks[2] == -1) fTracks[2] = track;
else
AliWarning(Form("While adding track label to %s for %s: "
- "All 3 track labels used, cannot add reference to track %d",
+ "All 3 track labels used, can't add reference to track %d",
ClassName(), GetName(), track));
}
{
// 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 += nTrack;
if (isPrimary) entry.fNPrim += nTrack;
if (fStoreTrackRefs) {
- Int_t oldN = entry.fLabels.fN;
- entry.fLabels.Set(entry.fN);
- for (Int_t i = 0; i < nTrack; i++)
+ 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) track %d",
- edep, detector, ring, sector, strip,
- entry.fEdep, (nTrack > 0 ? tracknos[0] : -1)));
+ 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 count2,
Short_t count3,
Short_t count4,
- UShort_t /* ntot */,
+ UShort_t ntot,
UShort_t /* nprim */,
const TArrayI& refs) const
{
// Add a digit or summable digit
-
fFMD->AddDigitByFields(detector, ring, sector, strip,
- count1, count2, count3, count4, refs);
+ count1, count2, count3, count4,
+ ntot, fStoreTrackRefs ? refs.fArray : 0);
}
//____________________________________________________________________
Short_t count2,
Short_t count3,
Short_t count4,
- const TArrayI& refs)
+ UShort_t nrefs,
+ Int_t* refs)
: AliFMDBaseDigit(detector, ring, sector, strip),
fCount1(count1),
fCount2(count2),
// count1 ADC count (a 10-bit word)
// count2 ADC count (a 10-bit word) -1 if not used
// count3 ADC count (a 10-bit word) -1 if not used
- for (Int_t i = 0; i < refs.fN; i++) AddTrack(refs.fArray[i]);
+ if (!refs) return;
+ for (Int_t i = 0; i < nrefs; i++) AddTrack(refs[i]);
}
//____________________________________________________________________
Short_t count2=-1,
Short_t count3=-1,
Short_t count4=-1,
- const TArrayI& refs=TArrayI());
+ UShort_t nrefs=0,
+ Int_t* refs=0);
/**
* DTOR
*/
fData[i].fEdep = 0;
fData[i].fN = 0;
fData[i].fNPrim = 0;
+ fData[i].fLabels.Reset();
};
}
{
// Reset to val
for (Int_t i = 0; i < fTotal; i++) {
- fData[i].fEdep = val.fEdep;
- fData[i].fN = val.fN;
- fData[i].fNPrim = val.fNPrim;
- fData[i].fLabels.Set(0);
+ fData[i].fEdep = val.fEdep;
+ fData[i].fN = val.fN;
+ fData[i].fNPrim = val.fNPrim;
+ fData[i].fLabels = val.fLabels;
};
}
}
// Read in the event
- AliFMDDebug(5, ("Now digitizing (Hits->%s) event # %d",
+ AliFMDDebug(1, ("Now digitizing (Hits->%s) event # %d",
(fOutput == kDigits ? "digits" : "sdigits"), event));
thisLoader->GetEvent(event);
}
// Extract parameters
+ AliFMDDebug(15,("Adding contribution %7.5f for FMD%d%c[%2d,%3d] "
+ " for trackno %6d (%s)",
+ fmdHit->Edep(),
+ fmdHit->Detector(),
+ fmdHit->Ring(),
+ fmdHit->Sector(),
+ fmdHit->Strip(),
+ trackno,
+ (isPrimary ? "primary" : "secondary")));
AddContribution(fmdHit->Detector(),
fmdHit->Ring(),
fmdHit->Sector(),
detector, ring, sector, strip,
count1, count2, count3, count4));
AliFMDBaseDigitizer::AddDigit(detector, ring, sector, strip, 0,
- count1, count2, count3, count4, 0, 0, refs);
+ count1, count2, count3, count4,
+ ntotal, nprim, refs);
return;
}
if (edep <= 0) {
count1, count2, count3, count4, nprim, ntotal, refs.fN));
fFMD->AddSDigitByFields(detector, ring, sector, strip, edep,
count1, count2, count3, count4,
- ntotal, nprim, refs);
+ ntotal, nprim, fStoreTrackRefs ? refs.fArray : 0);
}
//____________________________________________________________________
Short_t count4,
UShort_t npart,
UShort_t nprim,
- const TArrayI& refs)
+ Int_t* refs)
: AliFMDBaseDigit(detector, ring, sector, strip),
fEdep(edep),
fCount1(count1),
// count1 ADC count (a 10-bit word)
// count2 ADC count (a 10-bit word) -1 if not used
// count3 ADC count (a 10-bit word) -1 if not used
- for (Int_t i = 0; i < refs.fN; i++) AddTrack(refs.fArray[i]);
+ if (!refs) return;
+ for (Int_t i = 0; i < npart; i++) AddTrack(refs[i]);
}
//____________________________________________________________________
#ifndef ALIFMDBASEDIGIT_H
# include <AliFMDBaseDigit.h>
#endif
-#ifndef ROOT_TArrayI
-# include <TArrayI.h>
-#endif
+// #ifndef ROOT_TArrayI
+// # include <TArrayI.h>
+// #endif
//____________________________________________________________________
/** @class AliFMDSDigit AliFMDDigit.h <FMD/AliFMDDigit.h>
Short_t count4=-1,
UShort_t npart=0,
UShort_t nprim=0,
- const TArrayI& refs=TArrayI());
+ Int_t* refs=0);
/**
* DTOR
*/