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