1. Reading input from HGeantMdc
2. Evaluation of fired cells
3. Calculation of drift times / wire offsets
4. Storing in HMdcGeantCell category (not persistent)
5. Filling arrays of all hits for one cell from HMdcGeantCell
6. set efficiency flags to the hits (cell efficiency/layer efficiency/dead wires)
7. Filling real data into arrays if digitizer runs in embedding mode
8. sorting arrays with increasing arrival time of the signal (drift + error + tof + wireoffset)
9. selecting 1. and 2. valid hit in cell
10.filling output to HMdcCal1Sim
11.generation of noise

The Digitizer retrieves the GEANT data from
HGeantMdc (sector, module, layer, hit: xcoord, ycoord, tof, ptot, incidence:theta, phi, tracknumber). Evaluation of fired cells:
HMdcDigitizer::transform(Float_t xcoord, Float_t ycoord, Float_t theta, Float_t phi , Float_t tof , Int_t trkNum) calculates  which cells have been hit by the track. The Information about the layer geometry (pitch, cathode distance, wire orientation, number of wires per layer and number of central wire) is taken from HMdcLayerGeomPar. Output of the calculation is the minimum distance from the wire and the impact angle in the coordinate system of the cell. All values are stored in the HMdcGeantCell for a maximum number of 15 hits per cell via
HMdcDigitizer::storeCell( Float_t per, Float_t tof, Float_t myangle, Int_t trkNum, Bool_t flagCutEdge, Float_t wireOffset).

For each cell the drift time1 and time2 are calculated by corresponding functions of the HMdcCal2ParSim container which holds the calibration parameters for the "distance->drift time" calculation:
HMdcCal2ParSim::calcTimeDigitizer (sector, module, angle, minDist, &time1, &time1Error) and
HMdcCal2ParSim::calcTime2Digitizer(sector, module, angle, minDist, &time2, &time2Error).

calcWireOffset(xcoor, ycoor, wOrient) calculates the time the signal of a given cell would take to propagate from the hit point to the readout electronics. The speed of the signal is taken from HMdcDigitPar::getSignalSpeed() (ns/mm). Internal functions of HMdcSizesCells are called to calculate the path length of the signal.

For each cell the efficiency cuts are calculated by a function of
HMdcCellEff::calcEfficiency( module, minDist, angle, Level) which holds the information for the efficiency cuts on cell level. The level of the cuts can be specified by HMdcDigitizer::setEffLevel(90.,90.,90.,90.) per module. The cut is done on the basis of GARFIELD simulations which give information on the charge which is collected on the sense wire of each cell for all combinations of distance and impact angle. The numbers which have to be set are the percentage of maximum charge required to make a signal. Hits which are on the edge of the drift cell will not create a big amount of charge and therefore will be kicked out first. The second cut on the layer level is an overall layer efficiency (e.g. 0.98 for 98% Efficiency) and will reduce the overall number of fired cells. This value is taken from HMdcDigitPar container.

With setWireStatUse( kTRUE ) the dead wires of the real data are correctly taken into account. This cut is handled in the same way as the efficiency cuts and has the top priority (wire stat -> cell efficiency -> layer efficiency). In all cases the drift time will be set to -999. To get the correct result one has to analyze the status flags! The Information about the status of the wire is taken from HMdcWireStat.

According to the the cuts a list of status flags for each recorded track is filled. After all calculations the list of Tracks is sorted by the arrival time (tof + drift time + wire offset) by HMdcDigitizer::select( Int_t nHits ) because only the first track will create a signal. The first valid hit (status=1) inside the track list will be found by
HMdcDigitizer::findFirstValidHit( Int_t firsthit, Float_t* firsttime2, Int_t* endlist1) which returns the index number of the first valid hit and the the last hit which falls into the given time window defined by time2 of first valid hit.
HMdcDigitizer::findSecondValidHit( Int_t endlist1, Int_t* secondhit) finds a second valid hit starting with the last entry of the list of the first valid hit. All variables will return -999 if no valid hits are found.

According to the two different TDC modes the HMdcCal1Sim category is filled. If HMdcDigitizer::setTofUse( kFALSE ) is selected, the time of flight will be subtracted and only the drift time is written to the output. With HMdcDigitizer::setOffsets(1.5,2.5,4.5,5.5, 0 or 1) a common minimum offset (fast particles) per module type can be set and will be subtracted from the calculated time to be closer to the real measurement situation. With setErrorUse( kFALSE ) the digitizer can be forced to write the drift times without error smearing to the output.

Noise simulation should be used only in TDC mode 2 (leading + trailing edge) and not in embedding mode! The noise simulation is done after output data have been already filled to HMdcCal1 category. a loop over the category is performed and the noise is filled in 2 ways.
1. a loop over all existing cells in the setup of MDC is done and randomly picked cells are filled width noise and added to the category ("only noise" cells).
2. For the existing cells filled with GEANT data a comparison between the randomly created noise time and the real time is done (if setNoiseMode(1)). The earlier of both is taken and if the noise wins the status flags are changed accordingly.
With HMdcDigitizer::setNoiseLevel(5.,5.,5.,5.) the simulation of noise can be switched on. HMdcDigitizer::fillNoise() loops over all cells existing in the actual setup and will randomly pick cells according to the specified probability per module (5.==5%) and set the statusflag to 2. If a cell is selected for noise production a second random process generates the time in the range of the specified window set by HMdcDigitizer::setNoiseRange(low1,low2,low3,low4,hi1,hi2,hi3,hi4).
The behavior of the noise generation can be specified with
1. setNoiseBandWidth( width ) (time-above threshold bump 0-width ns)
2. setNoiseWhiteWidth( upperrange ) (upper range in time-above threshold for white noise outside the bump)
3. setNoiseWhiteRatio( ratio ) (ratio between bump/white noise
With HMdcDigitizer::setNoiseMode(1) (default) a given time in one of the original GEANT cells will be overwritten by the the noise time, if timenoise < time. In this case the statusflag of the cell will be set to 2 (valid hit but noise ).In the case of HMdcDigitizer::setNoiseMode(2) the original GEANT cells will not be touched.

In the embedding case of GEANT data into REAL data, the digitizer looks to the HMdcCal1Sim and gets the data words filled with the REAL data by the HMdcCalibrater1 which would fall in the same Cells as the GEANT data. If the embedding mode is set to 1 (default) the digitizer will do a "realistic" merging, that means, the first hit from REAL or GEANT data will be accepted. In embedding mode 2 the GEANT data will be always kept and the corresponding REAL data will be overwritten by GEANT data. The embedding
mode can be switched by HMdcDigitizer::setEmbeddingMode( Int_t) (1=realistic,2=keep GEANT data).
The status flag of REAL data will be 0, where as in the listStatus[5] the status flag will be 3 for
REAL data hits which are merged into GEANT cells.


-- JochenMarkert - 18 Feb 2004
Topic attachments
I Attachment Action Size Date Who Comment
hmdcdigitizer.htmlhtml hmdcdigitizer.html manage 11.6 K 26 Feb 2004 - 12:50 JochenMarkert hmdcdigitizer
Topic revision: r6 - 26 Feb 2004, JochenMarkert
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Hades Wiki? Send feedback
Imprint (in German)
Privacy Policy (in German)