1 ////////////////////////////////////////////////////
3 // SPD beam test raw 2 dig conv. //
5 // Origin: Jan Conrad Jan.Conrad@cern.ch //
7 ////////////////////////////////////////////////////
10 #include "AliITSdigitSPD.h"
11 #include "AliRawReaderDate.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
59 TBranch* branch = fTreeD->GetBranch("ITSDigitsSPD");
61 AliITSgeom* geom = fBt->GetITSgeom();
65 for(Int_t nlay=1;nlay<=geom->GetNlayers();nlay++){
66 for(Int_t nlad=1;nlad<=geom->GetNladders(nlay);nlad++){
67 for(Int_t ndet=1;ndet<=geom->GetNdetectors(nlay);ndet++){
68 Int_t index=geom->GetModuleIndex(nlay,nlad,ndet);
69 if(geom->GetModuleTypeName(index)=="kSPD") nspd++;
70 if(geom->GetModuleTypeName(index)=="kSDD") nsdd++;
71 if(geom->GetModuleTypeName(index)=="kSSD") nssd++;
75 Int_t maxn=nspd+nsdd+nssd;
77 TClonesArray** newdigits = new TClonesArray*[maxn];
80 Int_t* idig = new Int_t[maxn];
82 for (Int_t idet =0; idet <maxn;idet++){
83 newdigits[idet]=new TClonesArray("AliITSdigitSPD");
88 AliITSRawStreamSPD str(fReaderDate);
90 fReaderDate->SelectEquipment(17,211,211);
94 const AliRawDataHeader* rdh = fReaderDate->GetDataHeader();
95 UChar_t blockAttributes = fReaderDate->GetBlockAttributes();
96 UInt_t statusBits = fReaderDate->GetStatusBits();
97 UInt_t orbitNumber = rdh->fEventID2;
98 UShort_t bunchCross = rdh->fEventID1;
99 // UInt_t DataSize = rdh->fSize;
100 //UChar_t L1TrigType = rdh->fL1TriggerType;
101 //UInt_t MiniEvId = rdh->GetMiniEventID();
102 // ULong64_t TriggerCL = rdh->GetTriggerClasses();
103 //ULong64_t ROI = rdh->GetROI();
104 // UChar_t Version =rdh->fVersion;
107 Int_t modID = str.GetModuleID();
108 // Int_t triggernumber = str.GetTriggerEventNumber();
110 Int_t row = str.GetRow();
111 Int_t col = str.GetColumn();
113 const Int_t kdgt[3]={col,row,1};
114 // newdigits = new TClonesArray*[fBt->GetNSPD()];
116 new ((*newdigits[modID])[idig[modID]]) AliITSdigitSPD(kdgt);
120 fITSHeader->SetOrbitNumber(0,orbitNumber);
121 fITSHeader->SetStatusBits(0,statusBits);
122 fITSHeader->SetBlockAttributes(0,blockAttributes);
123 fITSHeader->SetBunchCross(0,bunchCross);
124 //fITSHeader->SetTriggerClass(0,TriggerCL);
125 //fITSHeader->SetSubDet(0,
126 //fITSHeader->SetMiniEvId(0,MiniEvId);
127 //fITSHeader->SetVersion(0,Version);
128 //fITSHeader->SetSubDet(0,Subdets);
129 //fITSHeader->SetL1TriggerType(0,L1TrigType);
131 // fITSHeader->SetOrbitNumberSPD(OrbitNumber);
132 //printf("Bunch Crossing = %x\n ",BunchCross);
133 if ( blockAttributes != 0x3a ) {
134 Info("Exec","Block Attribs = %x\n ",blockAttributes);
139 } // while(str.Next());
142 for(Int_t n=0;n<maxn;n++){
143 branch->SetAddress(&newdigits[n]);
148 fTreeD->SetEntries(maxn);
151 fReaderDate->Reset();
155 for(Int_t n=0;n<maxn;n++){