234 fStoreTrackRefs(kTRUE),
243 :
AliDigitizer(digInput,
"AliFMDBaseDigitizer",
"FMD Digitizer base class"),
288 if (&o ==
this)
return *
this;
315 UShort_t strip)
const 321 Float_t mean =param->
GetPedestal(detector,ring,sector,strip);
323 return UShort_t(TMath::Max(gRandom->Gaus(mean, width), 0.));
340 AliFMDDebug(10, (
"Adding contribution %7.5f for FMD%d%c[%2d,%3d] " 341 " from %d tracks (%s)",
348 (isPrimary ?
"primary" :
"secondary")));
350 if (param->
IsDead(detector, ring, sector, strip)) {
351 AliFMDDebug(5, (
"FMD%d%c[%2d,%3d] is marked as dead",
352 detector, ring, sector, strip));
365 if (entry.
fEdep != 0)
366 AliFMDDebug(5, (
"Double digit in FMD%d%c[%2d,%3d]",
367 detector, ring, sector, strip));
370 Int_t oldN = entry.
fN;
373 if (isPrimary) entry.
fNPrim += nTrack;
376 AliFMDDebug(15, (
"== New label array size %d, was %d, added %d",
380 for (Int_t i = 0; i < nTrack; i++) {
381 AliFMDDebug(15, (
"=> Setting track label # %d", oldN+i));
382 entry.
fLabels[oldN + i] = tracknos[i]+offset;
383 AliFMDDebug(15, (
"<= Setting track label # %d", oldN+i));
386 AliFMDDebug(15,(
"Adding contribution %f to FMD%d%c[%2d,%3d] (%f) track %d (offset %d)",
387 edep, detector, ring, sector, strip,
388 entry.
fEdep, (nTrack > 0 ? tracknos[0] : -1),offset));
400 AliFMDDebug(5, (
"Will now digitize all the summed signals"));
405 for (UShort_t detector=1; detector <= 3; detector++) {
406 AliFMDDebug(10, (
"Processing hits in FMD%d", detector));
410 for (UShort_t ringi = 0; ringi <= 1; ringi++) {
411 Char_t ring = ringi == 0 ?
'I' :
'O';
412 AliFMDDebug(10, (
" Processing hits in FMD%d%c", detector,ring));
418 UShort_t nSectors = UShort_t(360. / r->
GetTheta());
420 for (UShort_t sector = 0; sector < nSectors; sector++) {
421 AliFMDDebug(10, (
" Processing hits in FMD%d%c[%2d]",
422 detector,ring,sector));
427 for (UShort_t strip = 0; strip < nStrips; strip++) {
432 if (strip % 128 == 0) last = 0;
435 Float_t edep = entry.
fEdep;
436 UShort_t ntot = entry.
fN;
437 UShort_t nprim = entry.
fNPrim;
438 const TArrayI& labels = entry.
fLabels;
441 edep, detector, ring, sector, strip));
442 ConvertToCount(edep, last, detector, ring, sector, strip, counts);
463 AddDigit(detector, ring, sector, strip, edep,
464 UShort_t(counts[0]), Short_t(counts[1]),
465 Short_t(counts[2]), Short_t(counts[3]),
466 ntot, nprim, labels);
467 AliFMDDebug(15, (
" Adding digit in FMD%d%c[%2d,%3d]=%d",
468 detector,ring,sector,strip,counts[0]));
474 CheckDigit(digit,
fEdep(detector, ring, sector, strip).fN,
482 AliWarning(Form(
"%d track labels could not be associated with digits " 483 "due to limited storage facilities in AliDigit",
495 TArrayI& counts)
const 540 AliWarning(Form(
"Maximum ADC is %d < 0, forcing it to 1023", maxAdc));
543 UShort_t rate = param->
GetSampleRate(detector,ring,sector,strip);
544 AliFMDDebug(15, (
"Sample rate for FMD%d%c[%2d,%3d] = %d",
545 detector, ring, sector, strip, rate));
546 if (rate < 1 || rate > 4) {
547 AliWarning(Form(
"Invalid sample rate for for FMD%d%c[%2d,%3d] = %d",
548 detector, ring, sector, strip, rate));
554 Float_t a = edep * convF + ped;
556 counts[0] = UShort_t(TMath::Min(a, Float_t(maxAdc)));
557 AliFMDDebug(15, (
"FMD%d%c[%2d,%3d]: converting ELoss %f to " 559 detector,ring,sector,strip,edep,counts[0],convF,ped));
566 for (Ssiz_t i = 0; i < rate; i++) {
567 Float_t t = Float_t(i) / rate + 1./rate;
568 Float_t s = edep + (last - edep) * TMath::Exp(-b * t);
569 Float_t a = Int_t(s * convF + ped);
571 counts[i] = UShort_t(TMath::Min(a, Float_t(maxAdc)));
573 AliFMDDebug(15, (
"Converted edep = %f to ADC (%x,%x,%x,%x) " 574 "[gain: %f=(%f/%f*%f), pedestal: %d, rate: %d]",
575 edep, counts[0], counts[1], counts[2], counts[3],
594 const TArrayI& refs)
const 598 count1, count2, count3, count4,
613 TTree* out = loader->
TreeD();
615 out = loader->
TreeD();
Float_t GetDACPerMIP() const
virtual void AddDigitByFields(UShort_t detector=0, Char_t ring='\0', UShort_t sector=0, UShort_t strip=0, UShort_t count1=0, Short_t count2=-1, Short_t count3=-1, Short_t count4=-1, UShort_t nrefs=0, Int_t *refs=0)
Bool_t IsDead(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
Geometry mananger for the FMD.
virtual void StoreDigits(const AliLoader *loader)
TClonesArray * Digits() const
AliFMDDetector * GetDetector(Int_t i) const
void SetLoader(AliLoader *loader)
virtual ~AliFMDBaseDigitizer()
virtual void MakeTree(Option_t *opt)
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
AliRunLoader * fRunLoader
FMD ring geometry parameters.
AliFMDRing * GetRing(Char_t id) const
void Print(Option_t *option="A") const
Float_t GetEdepMip() const
virtual TTree * MakeOutputTree(AliLoader *loader)
AliFMDBaseDigitizer & operator=(const AliFMDBaseDigitizer &o)
Base class for caches of per-strip information.This is used to index a strip. Data stored depends on ...
Base class for the geometry description and parameters of the FMD sub detectors FMD1, FMD2, and FMD3.
#define AliWarning(message)
FMD Digitizers declaration.
void SetShapingTime(Float_t B=10)
virtual void MakeBranch(Option_t *opt=" ")
virtual void AddContribution(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip, Float_t edep, Bool_t isPrimary, Int_t nTrackno, Int_t *tracknos, Int_t offset=0)
void UnloadDigits() const
Singleton object of FMD geometry descriptions and parameters. This class is a singleton that handles ...
virtual void DigitizeHits() const
Declaration of AliFMD detector driver.
AliDigitizer & operator=(const AliDigitizer &dig)
virtual void AddDigit(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip, Float_t edep, UShort_t count1, Short_t count2, Short_t count3, Short_t count4, UShort_t ntot, UShort_t nprim, const TArrayI &refs) const
#define AliFMDDebug(N, A)
static AliFMDParameters * Instance()
virtual Int_t WriteDigits(Option_t *opt="") const
Double_t GetTheta() const
AliLoader * GetLoader() const
Geometry description and parameters of a ring in the FMD detector.
static Int_t GetDebugLevel(const char *module, const char *className)
virtual void ConvertToCount(Float_t edep, Float_t last, UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip, TArrayI &counts) const
Int_t LoadDigits(Option_t *opt="")
virtual void ResetDigits()
static AliFMDGeometry * Instance()
Float_t GetPedestal(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
UShort_t GetAltroChannelSize() const
Float_t GetPedestalWidth(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
UShort_t GetSampleRate(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
Sub-detector base class declaration.
Cache of Energy deposited, hit information per strip. Contains a pair of energy deposited fEdep and n...
UShort_t Init(Bool_t forceReInit=kFALSE, UInt_t what=kAll)
AliFMDEdepMap fEdep
Run loader.
virtual UShort_t MakePedestal(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
Base class for digitizers.