204 #include <TParticle.h> 215 "FMD Hit->Digit digitizer" :
216 "FMD Hit->SDigit digitizer")),
234 if (&o ==
this)
return *
this;
255 AliError(
"Failed to get loader from detector object");
263 AliError(
"Failed to get run loader from loader");
269 for (Int_t event = 0;
event < nEvents;
event++) {
273 AliError(
"Failed to get event folder from loader");
280 static_cast<AliRunLoader*
>(folder->FindObject(loaderName));
282 AliError(Form(
"Failed to get loader '%s' from event folder", loaderName));
287 AliFMDDebug(1, (
"Now digitizing (Hits->%s) event # %d",
295 AliError(
"Failed to get kinematics from event loader");
307 TTree* hitsTree = loader->
TreeH();
308 TBranch* hitsBranch = hitsTree->GetBranch(
fFMD->GetName());
310 AliError(
"Failed to get hits branch in tree");
317 AliError(
"Failed to get output tree");
322 outTree->GetName()));
324 TFile* file = outTree->GetCurrentFile();
329 AliFMDDebug(5, (
"Output tree file %s content:", file->GetName()));
345 Int_t write = outTree->Fill();
346 AliFMDDebug(5, (
"Wrote %d bytes to digit tree", write));
369 TTree* out = loader->
TreeS();
371 out = loader->
TreeS();
392 TClonesArray *fmdHits =
fFMD->
Hits();
397 Int_t ntracks = Int_t(hitsBranch->GetEntries());
404 read += hitsBranch->GetEntry(
track);
407 Int_t nhits = fmdHits->GetEntries ();
408 for (Int_t hit = 0; hit < nhits; hit++) {
411 static_cast<AliFMDHit*
>(fmdHits->UncheckedAt(hit));
418 Bool_t isPrimary = kTRUE;
421 trackno = fmdHit->
Track();
422 AliFMDDebug(10, (
"Will get track # %d/%d from entry # %d",
425 AliError(Form(
"Track number %d/%d out of bounds",
431 #else // This is our hand-crafted code. We use the ALICE definition 433 isPrimary = part->IsPrimary();
436 Int_t mother1 = part->GetFirstMother();
438 if (!mother || mother->GetStatusCode() > 1)
441 (
"Track %d secondary, mother: %d - %s - status %d: %s",
443 (mother ?
"found" :
"not found"),
444 (mother ? mother->GetStatusCode() : -1),
445 (isPrimary ?
"primary" :
"secondary")));
451 AliFMDDebug(15,(
"Adding contribution %7.5f for FMD%d%c[%2d,%3d] " 452 " for trackno %6d (%s)",
459 (isPrimary ?
"primary" :
"secondary")));
470 AliFMDDebug(5, (
"Size of cache: %d bytes, read %d bytes",
471 int(
sizeof(
fEdep)), read));
480 UShort_t strip)
const 502 const TArrayI& refs)
const 506 AliFMDDebug(15,(
"Adding digit for FMD%d%c[%2d,%3d] = (%x,%x,%x,%x)",
507 detector, ring, sector, strip,
508 count1, count2, count3, count4));
510 count1, count2, count3, count4,
511 ntotal, nprim, refs);
515 AliFMDDebug(15, (
"Digit edep = %f <= 0 for FMD%d%c[%2d,%3d]",
516 edep, detector, ring, sector, strip));
519 if (count1 == 0 && count2 <= 0 && count3 <= 0 && count4 <= 0) {
520 AliFMDDebug(15, (
"Digit counts = (%x,%x,%x,%x) <= 0 for FMD%d%c[%2d,%3d]",
521 count1, count2, count3, count4,
522 detector, ring, sector, strip));
525 AliFMDDebug(15, (
"Adding sdigit for FMD%d%c[%2d,%3d] = " 526 "(%x,%x,%x,%x) [%d/%d] %d",
527 detector, ring, sector, strip,
528 count1, count2, count3, count4, nprim, ntotal, refs.fN));
530 count1, count2, count3, count4,
539 const TArrayI& counts)
544 Char_t ring = digit->
Ring();
545 UShort_t sec = digit->
Sector();
546 UShort_t str = digit->
Strip();
547 Float_t mean = param->
GetPedestal(det,ring,sec,str);
551 Int_t integral = counts[0];
552 if (counts[1] >= 0) integral += counts[1];
553 if (counts[2] >= 0) integral += counts[2];
554 if (counts[3] >= 0) integral += counts[3];
555 integral -= Int_t(mean + 2 * width);
556 if (integral < 0) integral = 0;
558 Float_t convF = Float_t(range) / size;
559 Float_t mips = integral * convF;
560 if (mips > Float_t(nhits) + .5 || mips < Float_t(nhits) - .5)
561 Warning(
"CheckDigit",
"Digit -> %4.2f MIPS != %d +/- .5 hits",
virtual void StoreDigits(const AliLoader *loader)
TClonesArray * Hits() const
virtual void ResetSDigits()
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.
UShort_t MakePedestal(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip) const
void SumContributions(TBranch *hitsBranch)
virtual void AddSDigitByFields(UShort_t detector=0, Char_t ring='\0', UShort_t sector=0, UShort_t strip=0, Float_t edep=0, UShort_t count1=0, Short_t count2=-1, Short_t count3=-1, Short_t count4=-1, UShort_t ntot=0, UShort_t nprim=0, Int_t *refs=0)
void CheckDigit(AliFMDDigit *digit, UShort_t nhits, const TArrayI &counts)
void Print(Option_t *option="A") const
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 &trackrefs) const
Forward Multiplicity Detector based on Silicon wafers. This class is the driver for especially simula...
static TString GetRunLoaderName()
virtual TTree * MakeOutputTree(AliLoader *loader)
FMD Digitizers declaration.
AliFMDBaseDigitizer & operator=(const AliFMDBaseDigitizer &o)
#define AliWarning(message)
TTree * MakeOutputTree(AliLoader *loader)
Int_t LoadSDigits(Option_t *opt="")
Bool_t IsPhysicalPrimary(Int_t i, Bool_t useInEmbedding=kFALSE)
virtual void MakeBranch(Option_t *opt=" ")
virtual Int_t GetNtrack() const
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)
virtual Int_t WriteSDigits(Option_t *opt="") const
void Digitize(Option_t *option="")
virtual void DigitizeHits() const
virtual TClonesArray * SDigits()
Declaration of AliFMD detector driver.
virtual void SetTreeAddress()
AliRunLoader * GetRunLoader()
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
UShort_t Detector() const
#define AliFMDDebug(N, A)
static AliFMDParameters * Instance()
Int_t GetNumberOfEvents()
Concrete digitizer to make digits from hits. See also AliFMDBaseDigitizer documentation.
Int_t LoadHits(Option_t *opt="")
Int_t GetEvent(Int_t evno)
TParticle * Particle(Int_t id, Bool_t useInEmbedding=kFALSE)
void StoreDigits(const AliLoader *loader)
AliLoader * GetLoader() const
void UnloadSDigits() const
AliFMDhit is the hit class for the FMD. Hits are the information that comes from a Monte Carlo at eac...
UShort_t Detector() const
static Int_t GetDebugLevel(const char *module, const char *className)
#define AliError(message)
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
TFolder * GetEventFolder()
UShort_t Init(Bool_t forceReInit=kFALSE, UInt_t what=kAll)
AliFMDHitDigitizer & operator=(const AliFMDHitDigitizer &o)
Int_t LoadKinematics(Option_t *option="READ")
UShort_t GetVA1MipRange() const
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.