- // Get the FMD branch
- TBranch* hitsBranch = hitsTree->GetBranch("FMD");
- if (hitsBranch) fmd->SetHitsAddressBranch(hitsBranch);
- else AliFatal("Branch FMD hit not found");
-
- // Get a list of hits from the FMD manager
- TClonesArray *fmdHits = fmd->Hits();
-
- // Get number of entries in the tree
- Int_t ntracks = Int_t(hitsTree->GetEntries());
-
- // Loop over the tracks in the
- for (Int_t track = 0; track < ntracks; track++) {
- // Read in entry number `track'
- hitsBranch->GetEntry(track);
-
- // Get the number of hits
- Int_t nhits = fmdHits->GetEntries ();
- for (Int_t hit = 0; hit < nhits; hit++) {
- // Get the hit number `hit'
- AliFMDHit* fmdHit =
- static_cast<AliFMDHit*>(fmdHits->UncheckedAt(hit));
-
- // Extract parameters
- UShort_t detector = fmdHit->Detector();
- Char_t ring = fmdHit->Ring();
- UShort_t sector = fmdHit->Sector();
- UShort_t strip = fmdHit->Strip();
- Float_t edep = fmdHit->Edep();
- if (fEdep(detector, ring, sector, strip).fEdep != 0)
- AliDebug(1, Form("Double hit in %d%c(%d,%d)",
- detector, ring, sector, strip));
-
- fEdep(detector, ring, sector, strip).fEdep += edep;
- fEdep(detector, ring, sector, strip).fN += 1;
- // Add this to the energy deposited for this strip
- } // hit loop
- } // track loop
-}
-
-//____________________________________________________________________
-void
-AliFMDBaseDigitizer::DigitizeHits(AliFMD* fmd) const
-{
- // For the stored energy contributions in the cache (fEdep), convert
- // the energy signal to ADC counts, and store the created digit in
- // the digits array (AliFMD::fDigits)
- //
- TArrayI counts(3);
- for (UShort_t detector=1; detector <= 3; detector++) {
- // Get pointer to subdetector
- AliFMDSubDetector* det = 0;
- switch (detector) {
- case 1: det = fmd->GetFMD1(); break;
- case 2: det = fmd->GetFMD2(); break;
- case 3: det = fmd->GetFMD3(); break;
- }
- if (!det) continue;
- for (UShort_t ringi = 0; ringi <= 1; ringi++) {
- // Get pointer to Ring
- AliFMDRing* r = 0;
- switch (ringi) {
- case 0: if (det->GetInner()) r = det->GetInner(); break;
- case 1: if (det->GetOuter()) r = det->GetOuter(); break;
- }
- if (!r) continue;
-
- // Get number of sectors
- UShort_t nSectors = UShort_t(360. / r->GetTheta());
- // Loop over the number of sectors
- for (UShort_t sector = 0; sector < nSectors; sector++) {
- // Get number of strips
- UShort_t nStrips = r->GetNStrips();
- // Loop over the stips
- Float_t last = 0;
- for (UShort_t strip = 0; strip < nStrips; strip++) {
- // Reset the counter array to the invalid value -1
- counts.Reset(-1);
- // Reset the last `ADC' value when we've get to the end of a
- // VA1_ALICE channel.
- if (strip % 128 == 0) last = 0;
-
- Float_t edep = fEdep(detector, r->GetId(), sector, strip).fEdep;
- ConvertToCount(edep, last, r->GetSiThickness(), fmd->GetSiDensity(),
- counts);
- last = edep;
- AddDigit(fmd, detector, r->GetId(), sector, strip,
- edep, UShort_t(counts[0]),
- Short_t(counts[1]), Short_t(counts[2]));
-#if 0
- // This checks if the digit created will give the `right'
- // number of particles when reconstructed, using a naiive
- // approach. It's here only as a quality check - nothing
- // else.
- CheckDigit(fEdep(detector, r->GetId(), sector, strip).fEdep,
- fEdep(detector, r->GetId(), sector, strip).fN,
- counts);