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(),
31 //_____________________________________________________________
32 AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title),
39 //__________________________________________________________________
40 AliITSBeamTestDigSPD::~AliITSBeamTestDigSPD()
49 //_______________________________________________________________________
50 void AliITSBeamTestDigSPD::Exec(Option_t* /*opt*/)
52 //Reads raw data for SPD, fill SPD digits tree
56 Error("Exec","fITSgeom is null!");
59 TBranch* branch = fTreeD->GetBranch("ITSDigitsSPD");
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++;
74 Int_t maxn=nspd+nsdd+nssd;
76 TClonesArray** newdigits = new TClonesArray*[maxn];
79 Int_t* idig = new Int_t[maxn];
81 for (Int_t idet =0; idet <maxn;idet++){
82 newdigits[idet]=new TClonesArray("AliITSdigitSPD");
87 AliITSRawStreamSPD str(fReader);
89 fReader->SelectEquipment(17,211,211);
93 const AliRawDataHeader* rdh = fReader->GetDataHeader();
94 UChar_t blockAttributes = fReader->GetBlockAttributes();
95 UInt_t statusBits = fReader->GetStatusBits();
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;
106 Int_t modID = str.GetModuleID();
107 // Int_t triggernumber = str.GetTriggerEventNumber();
109 Int_t row = str.GetRow();
110 Int_t col = str.GetColumn();
112 const Int_t kdgt[3]={col,row,1};
113 // newdigits = new TClonesArray*[fBt->GetNSPD()];
115 new ((*newdigits[modID])[idig[modID]]) AliITSdigitSPD(kdgt);
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);
130 // fITSHeader->SetOrbitNumberSPD(OrbitNumber);
131 //printf("Bunch Crossing = %x\n ",BunchCross);
132 if ( blockAttributes != 0x3a ) {
133 Info("Exec","Block Attribs = %x\n ",blockAttributes);
138 } // while(str.Next());
141 for(Int_t n=0;n<maxn;n++){
142 branch->SetAddress(&newdigits[n]);
147 fTreeD->SetEntries(maxn);
154 for(Int_t n=0;n<maxn;n++){