1 ////////////////////////////////////////////////////
3 // SPD beam test raw 2 dig conv. //
5 // Origin: Jan Conrad Jan.Conrad@cern.ch //
7 ////////////////////////////////////////////////////
9 #include "AliITSdigitSPD.h"
10 #include "AliRawReader.h"
11 #include "AliRawReader.h"
12 #include "AliRawDataHeader.h"
13 #include "AliITSRawStreamSPD.h"
14 #include "AliITSBeamTestDigSPD.h"
15 #include "AliITSgeom.h"
18 #include "AliITSEventHeader.h"
19 ClassImp(AliITSBeamTestDigSPD)
23 //_____________________________________________________________
24 AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(): AliITSBeamTestDig()
33 //_____________________________________________________________
34 AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title)
43 //__________________________________________________________________
44 AliITSBeamTestDigSPD::~AliITSBeamTestDigSPD()
53 //_______________________________________________________________________
54 void AliITSBeamTestDigSPD::Exec(Option_t* /*opt*/)
56 //Reads raw data for SPD, fill SPD digits tree
60 Error("Exec","fITSgeom is null!");
63 TBranch* branch = fTreeD->GetBranch("ITSDigitsSPD");
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++;
78 Int_t maxn=nspd+nsdd+nssd;
80 TClonesArray** newdigits = new TClonesArray*[maxn];
83 Int_t* idig = new Int_t[maxn];
85 for (Int_t idet =0; idet <maxn;idet++){
86 newdigits[idet]=new TClonesArray("AliITSdigitSPD");
91 AliITSRawStreamSPD str(fReader);
93 fReader->SelectEquipment(17,211,211);
97 const AliRawDataHeader* rdh = fReader->GetDataHeader();
98 UChar_t blockAttributes = fReader->GetBlockAttributes();
99 UInt_t statusBits = fReader->GetStatusBits();
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;
110 Int_t modID = str.GetModuleID();
111 // Int_t triggernumber = str.GetTriggerEventNumber();
113 Int_t row = str.GetRow();
114 Int_t col = str.GetColumn();
116 const Int_t kdgt[3]={col,row,1};
117 // newdigits = new TClonesArray*[fBt->GetNSPD()];
119 new ((*newdigits[modID])[idig[modID]]) AliITSdigitSPD(kdgt);
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);
134 // fITSHeader->SetOrbitNumberSPD(OrbitNumber);
135 //printf("Bunch Crossing = %x\n ",BunchCross);
136 if ( blockAttributes != 0x3a ) {
137 Info("Exec","Block Attribs = %x\n ",blockAttributes);
142 } // while(str.Next());
145 for(Int_t n=0;n<maxn;n++){
146 branch->SetAddress(&newdigits[n]);
151 fTreeD->SetEntries(maxn);
158 for(Int_t n=0;n<maxn;n++){