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