]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - ITS/AliITSBeamTestDigSSD.cxx
Produce sample with given amp, delegate ADC2GeV conversion to OCDB
[u/mrichter/AliRoot.git] / ITS / AliITSBeamTestDigSSD.cxx
... / ...
CommitLineData
1/////////////////////////////////////////
2// Class for SSD raw2digits conv //
3// //
4// Author: Enrico Fragiacomo //
5// Date: October 2004 //
6////////////////////////////////////////
7
8#include "AliITSgeom.h"
9#include "AliITSdigitSSD.h"
10#include "AliRawReader.h"
11#include "AliITSRawStreamSSDv1.h"
12#include "AliITSBeamTestDigSSD.h"
13#include <TBranch.h>
14#include <TTree.h>
15
16ClassImp(AliITSBeamTestDigSSD)
17
18//_____________________________________________________________
19AliITSBeamTestDigSSD::AliITSBeamTestDigSSD(): AliITSBeamTestDig(),
20fFlagHeader(0)
21{
22 //
23 // Constructor
24 //
25}
26
27//_____________________________________________________________
28AliITSBeamTestDigSSD::AliITSBeamTestDigSSD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title),
29fFlagHeader(0){
30 //
31 // Constructor
32 //
33}
34
35//__________________________________________________________________
36AliITSBeamTestDigSSD::~AliITSBeamTestDigSSD() {
37 //
38 // Destructor
39 //
40}
41
42//_______________________________________________________________________
43void 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
47 TBranch* branch = fTreeD->GetBranch("ITSDigitsSSD");
48 if(!fITSgeom){
49 Error("Exec","fITSgeom is null!");
50 return;
51 }
52
53 Int_t nsdd=0;
54 Int_t nspd=0;
55 Int_t nssd=0;
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 TString dtype(fITSgeom->GetModuleTypeName(index));
61 if(dtype.Contains("SPD")) nspd++;
62 if(dtype.Contains("SDD")) nsdd++;
63 if(dtype.Contains("SSD")) nssd++;
64 }
65 }
66 }
67 Int_t maxn=nspd+nsdd+nssd;
68
69 TClonesArray** newdigits = new TClonesArray*[maxn];
70
71 Int_t* idig = new Int_t[maxn];
72
73 for (Int_t idet =0; idet <maxn;idet++) {
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
80 AliITSRawStreamSSDv1 str(fReader);
81
82 // no selection of equipment
83 //fReader->SelectEquipment(-1);
84 //fReader->SelectEquipment(17,102,102);
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();
94 Int_t module1= module-10+nsdd+nspd;
95 if( (module<10) || (module>13) ) continue;
96 if(module1>7) continue;
97 const Int_t kdgt[3]={side,strip,signal};
98 // SSD modules 10, 11, 12 and 13
99 new ( (*newdigits[module1])[idig[module1]] ) AliITSdigitSSD(kdgt);
100 idig[module1]++;
101 } // end while
102
103 for(Int_t n=0;n<maxn;n++){
104 branch->SetAddress(&newdigits[n]);
105 branch->Fill();
106 }
107
108 fTreeD->SetEntries(maxn);
109
110 fReader->Reset();
111
112 fTreeD->AutoSave();
113
114 for(Int_t n=0;n<maxn;n++){
115 delete newdigits[n];
116 }
117
118 delete [] newdigits;
119 delete idig;
120}
121
122
123