]>
Commit | Line | Data |
---|---|---|
38300302 | 1 | //////////////////////////////////////////////////// |
2 | // Class to define // | |
3 | // SPD beam test raw 2 dig conv. // | |
4 | // // | |
5 | // Origin: Jan Conrad Jan.Conrad@cern.ch // | |
6 | // // | |
7 | //////////////////////////////////////////////////// | |
8 | ||
9 | ||
10 | #include "AliITSdigitSPD.h" | |
11 | #include "AliRawReaderDate.h" | |
12 | #include "AliRawDataHeader.h" | |
13 | #include "AliITSRawStreamSPD.h" | |
14 | #include "AliITSBeamTestDigSPD.h" | |
15 | #include "AliITSBeamTest.h" | |
16 | ||
17 | ||
18 | ClassImp(AliITSBeamTestDigSPD) | |
19 | ||
20 | ||
21 | ||
22 | //_____________________________________________________________ | |
23 | AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(): AliITSBeamTestDig() | |
24 | { | |
25 | // | |
26 | // Constructor | |
27 | // | |
28 | ||
29 | ||
30 | } | |
31 | ||
32 | //_____________________________________________________________ | |
33 | AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title) | |
34 | { | |
35 | // | |
36 | // Constructor | |
37 | // | |
38 | ||
39 | ||
40 | } | |
41 | ||
42 | //__________________________________________________________________ | |
43 | AliITSBeamTestDigSPD::~AliITSBeamTestDigSPD() | |
44 | { | |
45 | // | |
46 | // Destructor | |
47 | // | |
48 | ||
49 | } | |
50 | ||
51 | ||
52 | //_______________________________________________________________________ | |
53 | void AliITSBeamTestDigSPD::Exec(Option_t* /*opt*/) | |
54 | { | |
55 | //Reads raw data for SPD, fill SPD digits tree | |
56 | ||
57 | ||
58 | TBranch* branch = fTreeD->GetBranch("ITSDigitSPD"); | |
59 | TClonesArray** newdigits = new TClonesArray*[fBt->GetNSPD()]; | |
60 | ||
61 | Int_t* idig = new Int_t[fBt->GetNSPD()]; | |
62 | ||
63 | ||
64 | ||
65 | for (Int_t idet =0; idet < fBt->GetNSPD();idet++){ | |
66 | newdigits[idet]=new TClonesArray("AliITSdigitSPD"); | |
67 | idig[idet]=0; | |
68 | } | |
69 | ||
70 | ||
71 | ||
72 | ||
73 | //cout <<"still here"<< endl; | |
74 | AliITSRawStreamSPD str(fReaderDate); | |
75 | ||
76 | fReaderDate->SelectEquipment(17,211,211); | |
77 | ||
78 | while(str.Next()){ | |
79 | ||
80 | const AliRawDataHeader* rdh = fReaderDate->GetDataHeader(); | |
81 | UChar_t blockAttributes = fReaderDate->GetBlockAttributes(); | |
82 | UInt_t statusBits = fReaderDate->GetStatusBits(); | |
83 | UInt_t orbitNumber = rdh->fEventID2; | |
84 | UShort_t bunchCross = rdh->fEventID1; | |
85 | // UInt_t DataSize = rdh->fSize; | |
86 | //UChar_t L1TrigType = rdh->fL1TriggerType; | |
87 | //UInt_t MiniEvId = rdh->GetMiniEventID(); | |
88 | // ULong64_t TriggerCL = rdh->GetTriggerClasses(); | |
89 | //ULong64_t ROI = rdh->GetROI(); | |
90 | // UChar_t Version =rdh->fVersion; | |
91 | ||
92 | ||
93 | Int_t modID = str.GetModuleID(); | |
94 | // Int_t triggernumber = str.GetTriggerEventNumber(); | |
95 | ||
96 | Int_t row = str.GetRow(); | |
97 | Int_t col = str.GetColumn(); | |
98 | ||
99 | ||
100 | ||
101 | // if (modID == 0 || modID == 1) { | |
102 | // cout <<"Mod ID " << modID <<" Row : "<< row << "Col : " << col << endl; | |
103 | //} | |
104 | ||
105 | ||
106 | const Int_t kdgt[3]={row,col,1}; | |
107 | ||
108 | // newdigits = new TClonesArray*[fBt->GetNSPD()]; | |
109 | ||
110 | new ((*newdigits[modID])[idig[modID]]) AliITSdigitSPD(kdgt); | |
111 | ||
112 | idig[modID]++; | |
113 | ||
114 | fITSHeader->SetOrbitNumber(0,orbitNumber); | |
115 | fITSHeader->SetStatusBits(0,statusBits); | |
116 | fITSHeader->SetBlockAttributes(0,blockAttributes); | |
117 | fITSHeader->SetBunchCross(0,bunchCross); | |
118 | //fITSHeader->SetTriggerClass(0,TriggerCL); | |
119 | //fITSHeader->SetSubDet(0, | |
120 | //fITSHeader->SetMiniEvId(0,MiniEvId); | |
121 | //fITSHeader->SetVersion(0,Version); | |
122 | //fITSHeader->SetSubDet(0,Subdets); | |
123 | //fITSHeader->SetL1TriggerType(0,L1TrigType); | |
124 | ||
125 | // fITSHeader->SetOrbitNumberSPD(OrbitNumber); | |
126 | //printf("Bunch Crossing = %x\n ",BunchCross); | |
127 | if ( blockAttributes != 0x3a ) { | |
128 | Info("Exec","Block Attribs = %x\n ",blockAttributes); | |
129 | } | |
130 | ||
131 | ||
132 | ||
133 | } // while(str.Next()); | |
134 | ||
135 | ||
136 | for(Int_t n=0;n<fBt->GetNSPD();n++){ | |
137 | branch->SetAddress(&newdigits[n]); | |
138 | branch->Fill(); | |
139 | } | |
140 | ||
141 | fTreeD->SetEntries(fBt->GetNSDD()+fBt->GetNSPD()+fBt->GetNSSD()); | |
142 | ||
143 | ||
144 | ||
145 | fReaderDate->Reset(); | |
146 | fTreeD->AutoSave(); | |
147 | ||
148 | ||
149 | for(Int_t n=0;n<fBt->GetNSPD();n++){ | |
150 | delete newdigits[n]; | |
151 | } | |
152 | ||
153 | delete[] newdigits; | |
154 | delete[] idig; | |
155 | ||
156 | } | |
157 | ||
158 |