1 ////////////////////////////////////////////////////
3 // SPD beam test raw 2 dig conv. //
5 // Origin: Jan Conrad Jan.Conrad@cern.ch //
7 ////////////////////////////////////////////////////
11 #include "AliITSdigitSPD.h"
12 #include "AliRawReader.h"
13 #include "AliRawReader.h"
14 #include "AliRawDataHeader.h"
15 #include "AliITSRawStreamSPD.h"
16 #include "AliITSBeamTestDigSPD.h"
17 #include "AliITSgeom.h"
20 #include "AliITSEventHeader.h"
21 ClassImp(AliITSBeamTestDigSPD)
25 //_____________________________________________________________
26 AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(): AliITSBeamTestDig(),
33 //_____________________________________________________________
34 AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title),
41 //__________________________________________________________________
42 AliITSBeamTestDigSPD::~AliITSBeamTestDigSPD()
51 //_______________________________________________________________________
52 void AliITSBeamTestDigSPD::Exec(Option_t* /*opt*/)
54 //Reads raw data for SPD, fill SPD digits tree
58 Error("Exec","fITSgeom is null!");
61 TBranch* branch = fTreeD->GetBranch("ITSDigitsSPD");
66 for(Int_t nlay=1;nlay<=fITSgeom->GetNlayers();nlay++){
67 for(Int_t nlad=1;nlad<=fITSgeom->GetNladders(nlay);nlad++){
68 for(Int_t ndet=1;ndet<=fITSgeom->GetNdetectors(nlay);ndet++){
69 Int_t index=fITSgeom->GetModuleIndex(nlay,nlad,ndet);
70 if(fITSgeom->GetModuleTypeName(index)=="kSPD") nspd++;
71 if(fITSgeom->GetModuleTypeName(index)=="kSDD") nsdd++;
72 if(fITSgeom->GetModuleTypeName(index)=="kSSD") nssd++;
76 Int_t maxn=nspd+nsdd+nssd;
78 TClonesArray** newdigits = new TClonesArray*[maxn];
81 Int_t* idig = new Int_t[maxn];
83 for (Int_t idet =0; idet <maxn;idet++){
84 newdigits[idet]=new TClonesArray("AliITSdigitSPD");
89 AliITSRawStreamSPD str(fReader);
91 // fReader->SelectEquipment(17,0,19);
95 const AliRawDataHeader* rdh = fReader->GetDataHeader();
96 UChar_t blockAttributes = fReader->GetBlockAttributes();
97 UInt_t statusBits = fReader->GetStatusBits();
98 UInt_t orbitNumber = rdh->GetEventID2();
99 UShort_t bunchCross = rdh->GetEventID1();
100 // UInt_t DataSize = rdh->fSize;
101 //UChar_t L1TrigType = rdh->fL1TriggerType;
102 //UInt_t MiniEvId = rdh->GetMiniEventID();
103 // ULong64_t TriggerCL = rdh->GetTriggerClasses();
104 //ULong64_t ROI = rdh->GetROI();
105 // UChar_t Version =rdh->fVersion;
108 Int_t modID = str.GetModuleID();
109 // Int_t triggernumber = str.GetTriggerEventNumber();
111 Int_t row = str.GetRow();
112 Int_t col = str.GetColumn();
114 const Int_t kdgt[3]={col,row,1};
115 // newdigits = new TClonesArray*[fBt->GetNSPD()];
117 new ((*newdigits[modID])[idig[modID]]) AliITSdigitSPD(kdgt);
121 fITSHeader->SetOrbitNumber(0,orbitNumber);
122 fITSHeader->SetStatusBits(0,statusBits);
123 fITSHeader->SetBlockAttributes(0,blockAttributes);
124 fITSHeader->SetBunchCross(0,bunchCross);
125 //fITSHeader->SetTriggerClass(0,TriggerCL);
126 //fITSHeader->SetSubDet(0,
127 //fITSHeader->SetMiniEvId(0,MiniEvId);
128 //fITSHeader->SetVersion(0,Version);
129 //fITSHeader->SetSubDet(0,Subdets);
130 //fITSHeader->SetL1TriggerType(0,L1TrigType);
132 //fITSHeader->SetOrbitNumberSPD(OrbitNumber);
133 //printf("Bunch Crossing = %x\n ",BunchCross);
134 //if ( blockAttributes != 0x3a ) {
135 //Info("Exec","Block Attribs = %x\n ",blockAttributes);
140 } // while(str.Next());
143 for(Int_t n=0;n<maxn;n++){
144 branch->SetAddress(&newdigits[n]);
149 fTreeD->SetEntries(maxn);
156 for(Int_t n=0;n<maxn;n++){