]>
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); | |
5af4a2d0 | 60 | TString dtype(fITSgeom->GetModuleTypeName(index)); |
61 | if(dtype.Contains("SPD")) nspd++; | |
62 | if(dtype.Contains("SDD")) nsdd++; | |
63 | if(dtype.Contains("SSD")) nssd++; | |
5ba31760 | 64 | } |
65 | } | |
66 | } | |
67 | Int_t maxn=nspd+nsdd+nssd; | |
38300302 | 68 | |
5ba31760 | 69 | TClonesArray** newdigits = new TClonesArray*[maxn]; |
38300302 | 70 | |
5ba31760 | 71 | Int_t* idig = new Int_t[maxn]; |
38300302 | 72 | |
5ba31760 | 73 | for (Int_t idet =0; idet <maxn;idet++) { |
38300302 | 74 | newdigits[idet] = new TClonesArray("AliITSdigitSSD"); |
75 | idig[idet]=0; | |
76 | } | |
77 | ||
78 | // this constructor sets the flag to select SSD data only | |
79 | // the Next method below will then jump to SSD data for this event | |
8ace09b6 | 80 | AliITSRawStreamSSDv1 str(fReader); |
38300302 | 81 | |
82 | // no selection of equipment | |
8ace09b6 | 83 | //fReader->SelectEquipment(-1); |
84 | //fReader->SelectEquipment(17,102,102); | |
38300302 | 85 | |
86 | while(str.Next()){ | |
87 | ||
88 | //if((str.GetADModule()!=2)&&(str.GetADModule()!=6)) continue; | |
89 | ||
90 | Int_t side = str.GetSideFlag(); | |
91 | Int_t strip = str.GetStrip(); | |
92 | Int_t signal = str.GetSignal(); | |
93 | Int_t module = str.GetModuleID(); | |
5ba31760 | 94 | Int_t module1= module-10+nsdd+nspd; |
95 | if( (module<10) || (module>13) ) continue; | |
96 | if(module1>7) continue; | |
38300302 | 97 | const Int_t kdgt[3]={side,strip,signal}; |
5ba31760 | 98 | // SSD modules 10, 11, 12 and 13 |
99 | new ( (*newdigits[module1])[idig[module1]] ) AliITSdigitSSD(kdgt); | |
100 | idig[module1]++; | |
38300302 | 101 | } // end while |
102 | ||
5ba31760 | 103 | for(Int_t n=0;n<maxn;n++){ |
38300302 | 104 | branch->SetAddress(&newdigits[n]); |
105 | branch->Fill(); | |
106 | } | |
107 | ||
5ba31760 | 108 | fTreeD->SetEntries(maxn); |
38300302 | 109 | |
8ace09b6 | 110 | fReader->Reset(); |
38300302 | 111 | |
112 | fTreeD->AutoSave(); | |
113 | ||
5ba31760 | 114 | for(Int_t n=0;n<maxn;n++){ |
38300302 | 115 | delete newdigits[n]; |
116 | } | |
117 | ||
5ba31760 | 118 | delete [] newdigits; |
119 | delete idig; | |
38300302 | 120 | } |
121 | ||
122 | ||
123 |