]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HMPID/AliHMPIDDigit.cxx
next50 trigger mask in AliHLTGlobalEsdConverterComponent
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDDigit.cxx
CommitLineData
d3da6dc4 1// **************************************************************************
2// * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3// * *
4// * Author: The ALICE Off-line Project. *
5// * Contributors are mentioned in the code where appropriate. *
6// * *
7// * Permission to use, copy, modify and distribute this software and its *
8// * documentation strictly for non-commercial purposes is hereby granted *
9// * without fee, provided that the above copyright notice appears in all *
10// * copies and that both the copyright notice and this permission notice *
11// * appear in the supporting documentation. The authors make no claims *
12// * about the suitability of this software for any purpose. It is *
13// * provided "as is" without express or implied warranty. *
14// **************************************************************************
15
1d4857c5 16#include "AliHMPIDDigit.h" //class header
17#include <TClonesArray.h> //WriteRaw()
18#include <TBox.h> //Draw()
8c1bbb8a 19#include <TPolyLine.h> //Draw()
ae5a42aa 20#include "AliHMPIDParam.h"
1d4857c5 21#include <AliDAQ.h> //WriteRaw()
ea925242 22#include "Riostream.h" //WriteRaw()
08f92f14 23#include "AliFstream.h"
24
d3da6dc4 25ClassImp(AliHMPIDDigit)
26
27/*
b8588e09 28 Preface: all geometrical information (like left-right sides) is reported as seen from electronic side.
29
2ac899f2 30 d10 d1 d10 d1
b8588e09 31 _______________ _______________
409d1dee 32r1 | | | |126.16 r24
b8588e09 33 | 4 | | 5 |
34 | | | |
35 |_______________| |_______________|85.84
36 _______________ _______________
37 | | | |83.24
38 | 2 | | 3 |
39 | | | |
40 |_______________| |_______________|42.92
41 _______________ _______________
42 | | | |40.32
43 | 0 | | 1 |
44 | | | |
409d1dee 45r24 |_______________| |_______________|0 r1 //updated: 15/02/2008
2ac899f2 46 0 64.0 66.6 130.6 //corrected: 05/08/2009 clm
1d4857c5 47
d3da6dc4 48
da08475b 49
50The DDL file starts with common header which size and structure is standartized and mandatory for all detectors.
d3da6dc4 51The header contains among other words, so called Equipment ID word. This unique value for each D-RORC is calculated as detector ID << 8 + DDL index.
52For HMPID the detector ID is 6 (reffered in the code as kRichRawId) while DDL indexes are from 0 to 13.
53
54Common header might be followed by the private one although HMPID has no any private header, just uses the common one.
55
da08475b 56Single HMPID D-RORC (with 2 channels) serves a single chamber so that channel 0 serves left half (PCs 0-2-4)
57 1 serves right half(PCs 1-3-5)
d3da6dc4 58
59So the LDC -chamber-ddl map is:
da08475b 60DDL index 0 -> ch 0 left -> DDL ID 0x600 DDL index 1 -> ch 1 right -> DDL ID 0x601
61DDL index 2 -> ch 1 left -> DDL ID 0x602 DDL index 3 -> ch 2 right -> DDL ID 0x603
62DDL index 4 -> ch 2 left -> DDL ID 0x604 DDL index 5 -> ch 3 right -> DDL ID 0x605
63DDL index 6 -> ch 3 left -> DDL ID 0x606 DDL index 7 -> ch 4 right -> DDL ID 0x607
64DDL index 8 -> ch 4 left -> DDL ID 0x608 DDL index 9 -> ch 5 right -> DDL ID 0x609
65DDL index 10 -> ch 5 left -> DDL ID 0x60a DDL index 11 -> ch 6 right -> DDL ID 0x60b
66DDL index 12 -> ch 6 left -> DDL ID 0x60c DDL index 13 -> ch 7 right -> DDL ID 0x60d
d3da6dc4 67
68HMPID FEE as seen by single D-RORC is composed from a number of DILOGIC chips organized in vertical stack of rows.
da08475b 69Each DILOGIC chip serves 48 channels for the 8x6 pads Channels counted from 0 to 47.
d3da6dc4 70
71The mapping inside DILOGIC chip has the following structure (see from electronics side):
da08475b 72pady
d3da6dc4 73
da08475b 745 04 10 16 22 28 34 40 46 due to repetition in column structure we may introduce per column map:
754 02 08 14 20 26 32 38 44 pady= 0 1 2 3 4 5
763 00 06 12 18 24 30 36 42 addr= 5 3 1 0 2 4
772 01 07 13 19 25 31 37 43 or vice versa
781 03 09 15 21 27 33 39 45 addr= 0 1 2 3 4 5
790 05 11 17 23 29 35 41 47 pady= 3 2 4 1 5 0
d3da6dc4 80
81 0 1 2 3 4 5 6 7 padx
82
8310 DILOGIC chips composes so called "row" in horizontal direction (reffered in the code as kNdil), so the row is 80x6 pads structure.
84DILOGIC chips in the row are counted from right to left as seen from electronics side, from 1 to 10.
8524 rows are piled up forming the whole FEE served by single D-RORC, so one DDL sees 80x144 pads separated in 3 photocathodes.
86Rows are counted from 1 to 24 from top to bottom for right half of the chamber (PCs 1-3-5) as seen from electronics side, meaning even LDC number
87 and from bottom to top for left half of the chamber (PCs 0-2-4) as seen from electronics side, meaning odd LDC number.
88
89HMPID raw word is 32 bits with the structure:
90 00000 rrrrr dddd aaaaaa qqqqqqqqqqqq
91 5 bits zero 5 bits row number (1..24) 4 bits DILOGIC chip number (1..10) 6 bits DILOGIC address (0..47) 12 bits QDC value (0..4095)
92*/
93//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
d1bf51e1 94void AliHMPIDDigit::Draw(Option_t*)
95{
e4a3eae8 96// TMarker *pMark=new TMarker(LorsX(),LorsY(),25); pMark->SetMarkerColor(kGreen);pMark->Draw();
ae5a42aa 97 TBox *pad = new
98
99TBox(LorsX()-0.5*AliHMPIDParam::SizePadX(),LorsY()-0.5*AliHMPIDParam::SizePadY(),LorsX()+0.5*AliHMPIDParam::SizePadX(),LorsY()+0.5*AliHMPIDParam::SizePadY());
8c1bbb8a 100 TPolyLine *line=new TPolyLine(5);
ae5a42aa 101 line->SetPoint(0,LorsX()-0.5*AliHMPIDParam::SizePadX(),LorsY()-0.5*AliHMPIDParam::SizePadY());
102 line->SetPoint(1,LorsX()-0.5*AliHMPIDParam::SizePadX(),LorsY()+0.5*AliHMPIDParam::SizePadY());
103 line->SetPoint(2,LorsX()+0.5*AliHMPIDParam::SizePadX(),LorsY()+0.5*AliHMPIDParam::SizePadY());
104 line->SetPoint(3,LorsX()+0.5*AliHMPIDParam::SizePadX(),LorsY()-0.5*AliHMPIDParam::SizePadY());
105 line->SetPoint(4,LorsX()-0.5*AliHMPIDParam::SizePadX(),LorsY()-0.5*AliHMPIDParam::SizePadY());
b8588e09 106 Int_t slice=(Int_t)fQ/20;
107 switch(slice){
108 case 0: pad->SetFillColor(kBlue); break;
109 case 1: pad->SetFillColor(kBlue+4); break;
110 case 2: pad->SetFillColor(kCyan); break;
111 case 3: pad->SetFillColor(kCyan+4); break;
112 case 4: pad->SetFillColor(kGreen); break;
113 case 5: pad->SetFillColor(kGreen+4); break;
114 case 6: pad->SetFillColor(kYellow); break;
115 case 7: pad->SetFillColor(kYellow+4); break;
116 default: pad->SetFillColor(kRed); break;
117 }
118 pad->SetUniqueID((Int_t)fQ);
8c1bbb8a 119 pad->Draw();line->Draw();
d1bf51e1 120}
121//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1d4857c5 122void AliHMPIDDigit::Print(Option_t *opt)const
d3da6dc4 123{
124// Print current digit
125// Arguments: option string not used
126// Returns: none
1d4857c5 127 UInt_t w32; Int_t ddl,r,d,a;
128 Raw(w32,ddl,r,d,a);
129 Printf("%sDIG:(ch=%1i,pc=%1i,x=%2i,y=%2i) (%7.3f,%7.3f) Q=%8.3f TID=(%5i,%5i,%5i) raw=0x%x (ddl=%2i,r=%2i,d=%2i,a=%2i) %s",
ae5a42aa 130 opt, AliHMPIDParam::A2C(fPad),AliHMPIDParam::A2P(fPad),AliHMPIDParam::A2X(fPad),AliHMPIDParam::A2Y(fPad),LorsX(),LorsY(), Q(),
131 fTracks[0],fTracks[1],fTracks[2],w32,ddl,r,d,a, (AliHMPIDParam::IsOverTh(Q()))?"":"below thr");
d3da6dc4 132}
133//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++