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