]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSBeamTestDigSPD.cxx
dead anodes + baselines treatment for SDD
[u/mrichter/AliRoot.git] / ITS / AliITSBeamTestDigSPD.cxx
CommitLineData
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
38300302 9#include "AliITSdigitSPD.h"
8ace09b6 10#include "AliRawReader.h"
11#include "AliRawReader.h"
38300302 12#include "AliRawDataHeader.h"
13#include "AliITSRawStreamSPD.h"
14#include "AliITSBeamTestDigSPD.h"
5ba31760 15#include "AliITSgeom.h"
16#include <TBranch.h>
17#include <TTree.h>
18#include "AliITSEventHeader.h"
38300302 19ClassImp(AliITSBeamTestDigSPD)
20
21
22
23//_____________________________________________________________
24 AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(): AliITSBeamTestDig()
25{
26 //
27 // Constructor
28 //
29
30
31}
32
33//_____________________________________________________________
34 AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title)
35{
36 //
37 // Constructor
38 //
39
40
41}
42
43//__________________________________________________________________
44AliITSBeamTestDigSPD::~AliITSBeamTestDigSPD()
45{
46 //
47 // Destructor
48 //
49
50 }
51
52
53//_______________________________________________________________________
54void AliITSBeamTestDigSPD::Exec(Option_t* /*opt*/)
55{
56 //Reads raw data for SPD, fill SPD digits tree
57
58
7d62fb64 59 if(!fITSgeom){
60 Error("Exec","fITSgeom is null!");
61 return;
62 }
5ba31760 63 TBranch* branch = fTreeD->GetBranch("ITSDigitsSPD");
64
5ba31760 65 Int_t nsdd=0;
66 Int_t nspd=0;
67 Int_t nssd=0;
7d62fb64 68 for(Int_t nlay=1;nlay<=fITSgeom->GetNlayers();nlay++){
69 for(Int_t nlad=1;nlad<=fITSgeom->GetNladders(nlay);nlad++){
70 for(Int_t ndet=1;ndet<=fITSgeom->GetNdetectors(nlay);ndet++){
71 Int_t index=fITSgeom->GetModuleIndex(nlay,nlad,ndet);
72 if(fITSgeom->GetModuleTypeName(index)=="kSPD") nspd++;
73 if(fITSgeom->GetModuleTypeName(index)=="kSDD") nsdd++;
74 if(fITSgeom->GetModuleTypeName(index)=="kSSD") nssd++;
5ba31760 75 }
76 }
77 }
78 Int_t maxn=nspd+nsdd+nssd;
79
80 TClonesArray** newdigits = new TClonesArray*[maxn];
38300302 81
38300302 82
5ba31760 83 Int_t* idig = new Int_t[maxn];
38300302 84
5ba31760 85 for (Int_t idet =0; idet <maxn;idet++){
38300302 86 newdigits[idet]=new TClonesArray("AliITSdigitSPD");
87 idig[idet]=0;
88 }
89
90
8ace09b6 91 AliITSRawStreamSPD str(fReader);
38300302 92
8ace09b6 93 fReader->SelectEquipment(17,211,211);
38300302 94
95 while(str.Next()){
96
8ace09b6 97 const AliRawDataHeader* rdh = fReader->GetDataHeader();
98 UChar_t blockAttributes = fReader->GetBlockAttributes();
99 UInt_t statusBits = fReader->GetStatusBits();
38300302 100 UInt_t orbitNumber = rdh->fEventID2;
101 UShort_t bunchCross = rdh->fEventID1;
102 // UInt_t DataSize = rdh->fSize;
103 //UChar_t L1TrigType = rdh->fL1TriggerType;
104 //UInt_t MiniEvId = rdh->GetMiniEventID();
105 // ULong64_t TriggerCL = rdh->GetTriggerClasses();
106 //ULong64_t ROI = rdh->GetROI();
107 // UChar_t Version =rdh->fVersion;
108
109
110 Int_t modID = str.GetModuleID();
111 // Int_t triggernumber = str.GetTriggerEventNumber();
112
113 Int_t row = str.GetRow();
114 Int_t col = str.GetColumn();
115
5ba31760 116 const Int_t kdgt[3]={col,row,1};
38300302 117 // newdigits = new TClonesArray*[fBt->GetNSPD()];
118
119 new ((*newdigits[modID])[idig[modID]]) AliITSdigitSPD(kdgt);
120
121 idig[modID]++;
122
123 fITSHeader->SetOrbitNumber(0,orbitNumber);
124 fITSHeader->SetStatusBits(0,statusBits);
125 fITSHeader->SetBlockAttributes(0,blockAttributes);
126 fITSHeader->SetBunchCross(0,bunchCross);
127 //fITSHeader->SetTriggerClass(0,TriggerCL);
128 //fITSHeader->SetSubDet(0,
129 //fITSHeader->SetMiniEvId(0,MiniEvId);
130 //fITSHeader->SetVersion(0,Version);
131 //fITSHeader->SetSubDet(0,Subdets);
132 //fITSHeader->SetL1TriggerType(0,L1TrigType);
133
134 // fITSHeader->SetOrbitNumberSPD(OrbitNumber);
135 //printf("Bunch Crossing = %x\n ",BunchCross);
136 if ( blockAttributes != 0x3a ) {
137 Info("Exec","Block Attribs = %x\n ",blockAttributes);
138 }
139
140
141
142 } // while(str.Next());
143
144
5ba31760 145 for(Int_t n=0;n<maxn;n++){
38300302 146 branch->SetAddress(&newdigits[n]);
5ba31760 147 branch->Fill();
148
38300302 149 }
150
5ba31760 151 fTreeD->SetEntries(maxn);
38300302 152
153
8ace09b6 154 fReader->Reset();
38300302 155 fTreeD->AutoSave();
156
157
5ba31760 158 for(Int_t n=0;n<maxn;n++){
159 delete newdigits[n];
38300302 160 }
161
162 delete[] newdigits;
163 delete[] idig;
164
165}
166
167