]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSBeamTestDigSSD.cxx
Removing compilation warnings (icc)
[u/mrichter/AliRoot.git] / ITS / AliITSBeamTestDigSSD.cxx
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
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
44   TBranch* branch = fTreeD->GetBranch("ITSDigitsSSD");
45   if(!fITSgeom){
46     Error("Exec","fITSgeom is null!");
47     return;
48   }
49
50   Int_t nsdd=0;
51   Int_t nspd=0;
52   Int_t nssd=0;
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++;
60       }
61     }
62   }
63   Int_t maxn=nspd+nsdd+nssd;
64
65   TClonesArray** newdigits = new TClonesArray*[maxn];
66
67   Int_t* idig = new Int_t[maxn];
68
69   for (Int_t idet =0; idet <maxn;idet++) {
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
76   AliITSRawStreamSSDv1 str(fReader);
77
78   // no selection of equipment 
79   //fReader->SelectEquipment(-1);
80   //fReader->SelectEquipment(17,102,102);
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();
90     Int_t module1= module-10+nsdd+nspd;
91      if( (module<10) || (module>13) ) continue;
92      if(module1>7) continue;
93     const Int_t kdgt[3]={side,strip,signal};
94      //  SSD modules 10, 11, 12 and 13
95     new ( (*newdigits[module1])[idig[module1]] ) AliITSdigitSSD(kdgt);    
96     idig[module1]++;
97   } // end while
98   
99   for(Int_t n=0;n<maxn;n++){
100     branch->SetAddress(&newdigits[n]);
101     branch->Fill();  
102   }
103   
104   fTreeD->SetEntries(maxn);
105     
106   fReader->Reset();
107   
108   fTreeD->AutoSave();
109   
110   for(Int_t n=0;n<maxn;n++){
111     delete newdigits[n];
112   }
113   
114   delete [] newdigits;
115   delete idig;
116 }
117
118   
119