]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSBeamTestDigSSD.cxx
Removing GetDebug and SetDebug from AliRun and AliModule. Using AliLog for the messages
[u/mrichter/AliRoot.git] / ITS / AliITSBeamTestDigSSD.cxx
CommitLineData
38300302 1/////////////////////////////////////////
2// Class for SSD raw2digits conv //
3// //
4// Author: Enrico Fragiacomo //
5// Date: October 2004 //
6////////////////////////////////////////
7
5ba31760 8#include "AliITS.h"
9#include "AliITSgeom.h"
38300302 10#include "AliITSdigitSSD.h"
8ace09b6 11#include "AliRawReader.h"
38300302 12#include "AliITSRawStreamSSDv1.h"
13#include "AliITSBeamTestDigSSD.h"
5ba31760 14#include <TBranch.h>
15#include <TTree.h>
38300302 16
17ClassImp(AliITSBeamTestDigSSD)
18
19//_____________________________________________________________
20AliITSBeamTestDigSSD::AliITSBeamTestDigSSD(): AliITSBeamTestDig() {
21 //
22 // Constructor
23 //
24}
25
26//_____________________________________________________________
27AliITSBeamTestDigSSD::AliITSBeamTestDigSSD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title) {
28 //
29 // Constructor
30 //
31}
32
33//__________________________________________________________________
34AliITSBeamTestDigSSD::~AliITSBeamTestDigSSD() {
35 //
36 // Destructor
37 //
38}
39
40//_______________________________________________________________________
41void AliITSBeamTestDigSSD::Exec(Option_t* /*opt*/) {
42 //Reads raw data for SSD, fill SSD digits tree, returns 1 if real data,
43 //returns 2 if calibration (injector) data, returns 3 if calibration (test pul //se) event
44
5ba31760 45 TBranch* branch = fTreeD->GetBranch("ITSDigitsSSD");
46 AliITSgeom* geom = fBt->GetITSgeom();
47 Int_t nsdd=0;
48 Int_t nspd=0;
49 Int_t nssd=0;
50 for(Int_t nlay=1;nlay<=geom->GetNlayers();nlay++){
51 for(Int_t nlad=1;nlad<=geom->GetNladders(nlay);nlad++){
52 for(Int_t ndet=1;ndet<=geom->GetNdetectors(nlay);ndet++){
53 Int_t index=geom->GetModuleIndex(nlay,nlad,ndet);
54 if(geom->GetModuleTypeName(index)=="kSPD") nspd++;
55 if(geom->GetModuleTypeName(index)=="kSDD") nsdd++;
56 if(geom->GetModuleTypeName(index)=="kSSD") nssd++;
57 }
58 }
59 }
60 Int_t maxn=nspd+nsdd+nssd;
38300302 61
5ba31760 62 TClonesArray** newdigits = new TClonesArray*[maxn];
38300302 63
5ba31760 64 Int_t* idig = new Int_t[maxn];
38300302 65
5ba31760 66 for (Int_t idet =0; idet <maxn;idet++) {
38300302 67 newdigits[idet] = new TClonesArray("AliITSdigitSSD");
68 idig[idet]=0;
69 }
70
71 // this constructor sets the flag to select SSD data only
72 // the Next method below will then jump to SSD data for this event
8ace09b6 73 AliITSRawStreamSSDv1 str(fReader);
38300302 74
75 // no selection of equipment
8ace09b6 76 //fReader->SelectEquipment(-1);
77 //fReader->SelectEquipment(17,102,102);
38300302 78
79 while(str.Next()){
80
81 //if((str.GetADModule()!=2)&&(str.GetADModule()!=6)) continue;
82
83 Int_t side = str.GetSideFlag();
84 Int_t strip = str.GetStrip();
85 Int_t signal = str.GetSignal();
86 Int_t module = str.GetModuleID();
5ba31760 87 Int_t module1= module-10+nsdd+nspd;
88 if( (module<10) || (module>13) ) continue;
89 if(module1>7) continue;
38300302 90 const Int_t kdgt[3]={side,strip,signal};
5ba31760 91 // SSD modules 10, 11, 12 and 13
92 new ( (*newdigits[module1])[idig[module1]] ) AliITSdigitSSD(kdgt);
93 idig[module1]++;
38300302 94 } // end while
95
5ba31760 96 for(Int_t n=0;n<maxn;n++){
38300302 97 branch->SetAddress(&newdigits[n]);
98 branch->Fill();
99 }
100
5ba31760 101 fTreeD->SetEntries(maxn);
38300302 102
8ace09b6 103 fReader->Reset();
38300302 104
105 fTreeD->AutoSave();
106
5ba31760 107 for(Int_t n=0;n<maxn;n++){
38300302 108 delete newdigits[n];
109 }
110
5ba31760 111 delete [] newdigits;
112 delete idig;
38300302 113}
114
115
116