Common reconstruction SDHCal and SiW -ECal Testbeam Sept 2018

The common reconstruction consists in extracting hits from ECAL and HCAL raw data and mix them in a common format data file.

Fields needed for common reconstruction

  • d : detector id
  • x : horizontal coordinate in mm from the left part of HCAL
  • y : vertical coordinate in mm from the bottom of HCAL
  • z : depth in mm from the first ECAL slab
  • t : time in nanoseconds from the first BCID of the first spill of the run
    • Vincent: I would split this information into 2 numbers: tsp (spill time, in ms) and tbc (time in a spill, in ns). A single time in ns requires a precision of 3600s / 200 ns ~ 1/210^10 (~34 significative bits) coding to distinguish 2 BCID at the end of 1h run, i.e a coding as double (55bits mantissa). It will also allow easier cuts (on the position in a spill, etc).
  • e : measured energy or threshold

Detector id

a value for identifying the detector where the hit belongs

  • 100 for HCAL
  • 200 for ECAL

X coordinate

The x zero the bottom left corner of HCAL (view from the beam). The x coordinate is parallel to the ground (horizontal). It is expressed in mm. The distance from the left edge of ECAL and left edge of HCAL is 225 mm.

Let's note Ex_i the ith pixel in y of ECAL with i in 0..31

Let's note Hx_i the ith pixel in y of HCAL with i in 0..96

if a hit happens at Ey_i then its y coordinate is 225+i*5.5+2.25 mm

if a hit happens at Hy_i then its y coordinate is i*10.4+5.2 mm

Y coordinate

The y zero the bottom left corner of HCAL (view from the beam). The y coordinate is vertical. It is expressed in mm.

The low edge of the first pixel of HCAL is at 42mm from the ground. The low edge of the first pixel of ECAL is at 419mm from the ground, thus the shift between the two is 377mm.

The pixels of ECAL are 5.5mm high thus a correction of 2.25mm is needed to take the barycenter of the pixel

The pixels of HCAL are 10.4mm high thus a correction of 5mm is needed to take the barycenter of the pixel

Let's note Ey_i the ith pixel in y of ECAL with i in 0..31

Let's note Hy_i the ith pixel in y of HCAL with i in 0..96

if a hit happens at Ey_i then its y coordinate is 377+i*5.5+2.25 mm

if a hit happens at Hy_i then its y coordinate is i*10.4+5.2 mm

Z coordinate

The z zero is the first slab of the ECAL (the one in front of beam). The coordinate z is parallel to the beam. it is expressed in mm.

All ECAL slabs are separated by 15mm. The last one is at 70mm of the first absorber of HCAL. The first layer of HCAL is 28mm after this first absorber. The length of HCAL chambers in z is 8mm (including free space) thus the barycenter inside the chamber is at 4mm

Let's note Ez_i the ith layer of ECAL with i in 0..9

Let's note Hz_i the ith chamber of HCAL with i in 0..34

if a hit happens in Ez_i then its z coordinate is i*15 mm

if a hit happens in Hz_i then its z coordinate is 225+i*28+4 mm

dif name Ez
dif_1_1_1 9
dif_1_1_2 0
dif_1_1_3 7
dif_1_1_4 8
dif_1_1_5 3
dif_1_2_1 2
dif_1_2_2 1
dif_1_2_3 6
dif_1_2_4 5
dif_1_2_5 4
this has to be checked at dismount

Time reconstruction

The time coordinate is expressed in ns from the beginning of the run.

The time in ECAL is completely absolute and based on Spill number. Only the HCAL can give absolute time through its absolute bcid. Let's call AB_i the absolute bcid corresponding to the first relative bcid of the spill i. This absolute bcid has an evolution at 5MHz and begin from an indefinite value. Let's call Ref_AB=AB_0. The time coordinate of an absolute bcid AB value is (AB-Ref_AB)*200 ns.

ECAL bcid reconstruction : The frequency of the bcid clock can be 2.5MHz or 5Mhz depending on the DIF firmware. Let's call p_b the period of this clock (200 ns for 5MHz 400ns for 2.5MHz). Spill inherited from HCAL are typically longer than the bcid counter cycle (12 bits). Any time a cycle is finished, the counter value go back to zero. Thus any time a monotony disruption is detected, 4096 should be added to bcid. the algorithm is the following :

  • offset=0
  • last_bcid=-1
  • for b in bcid of one spill :
    • if bcid<last_bcid: offset=offset+4096
    • true_bcid=bcid+offset
    • last_bcid=bcid

(Vincent note: this algorithm is better if applied to a larger consistent - bcid-wise - sample: a slab, all slabs sharing with the same clock (frequency; 2.5 or 5 MHz).

There is a systematic shift between the different ECAL slabs depending on the DIF code. The shift values are in the array.

There is also a systematic timing shift between the two detectors : this should be discovered by analysing muons. Let's call S this shift in 5MHz bcid number. Let's call it s_i

Considering an ECAL event that happened at spill i (of absolute first bcid AB_i) and true_bcid tb, it's time coordinate is (AB_i-Ref_AB+S)*200+(s_i+tb)*p_b ns

Considering an HCAL event that happened on dif i at absolute bcid b, its time coordinate is (b-Ref_AB)*200 ns

dif name bcid freq. syst. shift
dif_1_1_1 2.5MHz +8
dif_1_1_2 5MHz +0
dif_1_1_3 2.5MHz +8
dif_1_1_4 2.5MHz +8
dif_1_1_5 5MHz +1838 +11
dif_1_2_1 2.5MHz +8
dif_1_2_2 2.5MHz +7
dif_1_2_3 5MHz +1838 + 11
dif_1_2_4 5MHz +1838 + 9
dif_1_2_5 5MHz +1838 + 11
For the ECAL, the typical tolerance in the same shower should be 4 bcid at 5 Mhz or 2 at 2.5 MHz


The energy field is simply the ADC read of ECAL and the 2 bits threshold for HCAL

Reconstruction steps

  • extract absolute bcid of first bcid of every spill from the SDHCal raw data (data : spill_nb abs_bcid)
  • extract fields from both datasets (see before)
  • fusion extracted fields
  • output in root and csv files

Standalone SiW -ECal event building of mip calibrated data

It is possible to find the ECAL data of the ECAL+SDHCAL runs for pions and muons in the eos

These files contain the events after time-event building, zero suppresion and pedestal & mip calibration have been applied*. We have one entry per every bcid.

*Indeed, for two of the slabs I still don't have the mip values but I used some "dummy" values which will be updated soon.

The important variables for common reconstruction are:

  • integers:
    • spill --> spill number
    • bcid --> relative clock time in 5MHz (0.2us). We had some desynchronization between our slabs, this is now corrected and only one offset between ECAL and SDHCAL is to be found. In principle, our detector DAQ start saturating after a couple of ms (specially since we have a couple of noisy slabs), so using the first ~4000bcid for the synchronization will be best.
  • vectors (size=nhit_chan)
    • hit_x,y --> position of the hits on the ECAL in mm. The (0,0) is in the center of our detector and we are looking at the map as if we are the particle incident: (+xmax,+ymax) is in the right upper corner.
    • hit_z --> layer posiition. The first one is the first one seeing the beam. All of them are separated by 15mm.
    • hit_energy --> energy of the hit in mip units.

Three different type of files are copied:

  • runX__merge.root --> native root files for all difs merged in one
  • runX__build.root --> the event building done using the previous file and previously calculated calibration constants as input
  • ECAL_XGeV_xparticle_build.root --> the merge of all the XXX_build.root for same conditions runs.
Edit | Attach | Watch | Print version | History: r12 | r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r8 - 2018-10-13 - AdrianIrles
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CALICE All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback