2 // #include "TBranch.h"
3 #include "TClonesArray.h"
9 // // // STEER includes
11 #include "AliRunLoader.h"
12 #include "AliHeader.h"
13 #include "AliLoader.h"
16 // // // MUON includes
18 #include "AliMUONData.h"
19 #include "AliMUONHit.h"
20 #include "AliMUONConstants.h"
21 #include "AliMUONDigit.h"
25 void rawddl5(Int_t evNumber1=0,Int_t evNumber2=0)
27 long int mappheader2,mapp2[123456];
28 FILE *fb = fopen("lutraw51.dat","r");
29 for(Int_t n=0;n<59136;n++)
31 fscanf(fb,"%ld",&mappheader2);
32 fscanf(fb,"%ld",&mapp2[mappheader2]);
35 long int mappheader4,mapp4[123456];
36 FILE *fc = fopen("lutraw52.dat","r");
37 for(Int_t n=0;n<59136;n++)
39 fscanf(fc,"%ld",&mappheader4);
40 fscanf(fc,"%ld",&mapp4[mappheader4]);
43 FILE *fp = fopen("ddl17.dat","w+");
44 FILE *fq = fopen("ddl18.dat","w+");
45 FILE *fr = fopen("ddl19.dat","w+");
46 FILE *fs = fopen("ddl20.dat","w+");
47 AliRunLoader * RunLoader = AliRunLoader::Open("galice.root","MUONFolder","REA
49 if (RunLoader ==0x0) {
50 printf(">>> Error : Error Opening %s file \n","galice.root");
53 // Loading MUON subsystem
54 AliLoader * MUONLoader = RunLoader->GetLoader("MUONLoader");
55 MUONLoader->LoadDigits("READ");
57 // Creating MUON data container
58 AliMUONData muondata(MUONLoader,"MUON","MUON");
60 Int_t ievent, nevents;
61 nevents = RunLoader->GetNumberOfEvents();
62 printf(">>> No. of Event %d \n",nevents);
63 AliMUONDigit * mDigit;
65 Int_t dspheader[1000][4];
66 Int_t dsphead[1000][100];
67 // Start loop over events
68 for (int ievent=evNumber1; ievent<= evNumber2; ievent++) // event start
70 printf("Event:%d\n",ievent+1);
71 for(Int_t ii=0;ii<1000;ii++)
73 for(Int_t ij=0;ij<100;ij++)
78 for(Int_t ik=0;ik<1000;ik++)
80 for(Int_t il=0;il<4;il++)
85 RunLoader->GetEvent(ievent);
87 muondata.SetTreeAddress("D");
90 for(Int_t icathode=0; icathode<ncathodes; icathode++) {
91 muondata.GetCathode(icathode);
94 for( ichamber=8; ichamber<10; ichamber++) {
95 Int_t idigit, ndigits;
96 ndigits = (Int_t) muondata.Digits(ichamber)->GetEntriesFast(); //9 or 10
97 for(idigit=0; idigit<ndigits; idigit++) {
98 mDigit = static_cast<AliMUONDigit*>(muondata.Digits(ichamber)->At(idigit)
101 Int_t dsp = 0, xydata=0, manu=0, adc=0;
102 Int_t index=0, counter=0;
103 Int_t iqpad = mDigit->Signal(); // charge per pad
106 Int_t iPx = mDigit->PadX(); // pad number on X
107 Int_t iPy = mDigit->PadY(); // pad number on Y
109 Int_t modx = abs(iPx);
112 xydata = 2048*modx+iPy;
113 manu=((mapp2[xydata]>>6)&1023);
114 adc=(((mapp2[xydata]<<11)>>11)&63);
119 xydata = 256*modx+iPy;
120 manu=((mapp4[xydata]>>6)&1023);
122 adc=(((mapp4[xydata]<<11)>>11)&63);
125 if(manu>625&&manu<=637)
127 if(manu>637&&manu<=656)
129 if(manu>656&&manu<=680)
131 if(manu>680&&manu<=716)
133 if(manu>716&&manu<=752)
135 if(manu>752&&manu<=788)
137 if(manu>788&&manu<=824)
139 if(manu>824&&manu<=860)
141 if(manu>860&&manu<=884)
143 if(manu>884&&manu<=903)
145 if(manu>903&&manu<=915)
147 if(manu>915&&manu<=924)
163 dspheader[dsp][index]+=1;
164 counter = dspheader[dsp][index];
165 dsphead[dsp][counter]=4096*(64*(manu)+adc)+iqpad;
179 dspheader[dsp][index]+=1;
180 counter = dspheader[dsp][index];
181 dsphead[dsp][counter]=4096*(64*(manu)+adc)+iqpad;
187 for(Int_t dsp=601;dsp<680;dsp++)
189 for(Int_t aa=0;aa<4;aa++)
191 Int_t dspcount=dspheader[dsp][aa];
195 fwrite(&dspcount,2,1,fp);
196 for(Int_t ax=1;ax<=dspcount;ax++)
197 fwrite(&dsphead[dsp][ax],4,1,fp);
202 fwrite(&dspcount,2,1,fq);
203 for(Int_t ax=1;ax<=dspcount;ax++)
204 fwrite(&dsphead[dsp][ax],4,1,fq);
209 fwrite(&dspcount,2,1,fr);
210 for(Int_t ax=1;ax<=dspcount;ax++)
211 fwrite(&dsphead[dsp][ax],4,1,fr);
216 fwrite(&dspcount,2,1,fs);
217 for(Int_t ax=1;ax<=dspcount;ax++)
218 fwrite(&dsphead[dsp][ax],4,1,fs);