1 |
|
|
2 |
/** |
/** |
3 |
* FTrkQLook_EXPERT |
* FTrkQLook_EXPERT.cxx |
4 |
* |
* |
5 |
* autor: D.Fedele |
* autor: D.Fedele |
6 |
* version 2.0 |
* version v1r27 |
7 |
* Parameters: |
* Parameters: |
8 |
* file - the data file to analyze |
* file - the data file to analyze |
9 |
* fromevent - first event to analyze |
* fromevent - first event to analyze |
20 |
#include <TLatex.h> |
#include <TLatex.h> |
21 |
#include <TCanvas.h> |
#include <TCanvas.h> |
22 |
#include <TGraph.h> |
#include <TGraph.h> |
23 |
|
#include <TFile.h> |
24 |
#include <TTree.h> |
#include <TTree.h> |
25 |
#include <TStyle.h> |
#include <TStyle.h> |
26 |
// |
// |
27 |
#include <physics/tracker/TrackerEvent.h> |
#include <physics/tracker/TrackerEvent.h> |
28 |
#include <PscuHeader.h> |
#include <PscuHeader.h> |
29 |
#include <EventHeader.h> |
#include <EventHeader.h> |
30 |
|
#include <RunHeaderEvent.h> |
31 |
#include <TrkAlarmEvent.h> |
#include <TrkAlarmEvent.h> |
32 |
#include <tsbt/TsbTRecord.h> |
#include <tsbt/TsbTRecord.h> |
33 |
#include <tsbt/TsbTEvent.h> |
#include <tsbt/TsbTEvent.h> |
34 |
|
#include <tsbb/TsbBRecord.h> |
35 |
|
#include <tsbb/TsbBEvent.h> |
36 |
|
#include <EventCounter.h> |
37 |
|
#include <PacketType.h> |
38 |
// |
// |
39 |
|
#define MAXSTORAGE 50000 |
|
void stringcopy(TString& s1, const TString& s2, Int_t from=0, Int_t to=0){ |
|
|
if ( to == 0 ){ |
|
|
Int_t t2length = s2.Length(); |
|
|
s1 = ""; |
|
|
to = t2length; |
|
|
}; |
|
|
for (Int_t i = from; i<to; i++){ |
|
|
s1.Append(s2[i],1); |
|
|
}; |
|
|
}; |
|
|
|
|
40 |
|
|
41 |
void FTrkQLook_EXPERT(TString file,Int_t fromevent,Int_t toevent, TString outdir, TString outfile) |
void FTrkQLook_EXPERT(TString file,Int_t fromevent,Int_t toevent, TString outdir, TString outfile) |
42 |
{ |
{ |
43 |
// |
// |
44 |
// obtain information about the data file and select the output dir |
// obtain information about the data file and select the output dir |
45 |
const string filepath=file.Data(); |
Int_t dwpos = file.Last('/'); |
46 |
Int_t dwpos = filepath.rfind("DW_"); |
Int_t dwpos1 = file.Last('.'); |
|
Int_t dwpos1 = filepath.find(".root"); |
|
|
TString fpath=(filepath.c_str()); |
|
47 |
TString base,ffile ; |
TString base,ffile ; |
48 |
stringcopy(ffile,fpath,dwpos,dwpos1); |
ffile=file(dwpos+1,dwpos1-(dwpos+1)); |
49 |
stringcopy(base,fpath,0,dwpos); |
if(dwpos>0) base=file(0,dwpos); |
50 |
|
|
51 |
TString out; |
TString out; |
52 |
if(outdir.Length()==0){ |
if(outdir.Length()==0){ |
54 |
}else{ |
}else{ |
55 |
out = outdir; |
out = outdir; |
56 |
} |
} |
57 |
|
if(out.Last('/')+1<out.Length()) out+="/"; |
58 |
|
|
59 |
// |
// |
60 |
// inizialise the variables and open the file |
// inizialise the variables and open the file |
61 |
pamela::TsbTEvent *event = 0; |
pamela::TsbTEvent *event = 0; |
62 |
pamela::TsbTRecord *record = 0; |
pamela::TsbTRecord *record = 0; |
63 |
|
pamela::TsbBEvent *Bevent = 0; |
64 |
|
pamela::TsbBRecord *Brecord = 0; |
65 |
pamela::tracker::TrackerEvent *te=0; |
pamela::tracker::TrackerEvent *te=0; |
66 |
pamela::EventHeader *eh=0,*aleh=0; |
pamela::EventHeader *eh=0,*aleh=0,*eH=0,*eT=0,*eB=0; |
67 |
pamela::PscuHeader *ph=0; |
pamela::PscuHeader *ph=0,*pH=0; |
68 |
pamela::TrkAlarmEvent *al=0; |
pamela::TrkAlarmEvent *al=0; |
69 |
|
pamela::RunHeaderEvent *reh=0; |
70 |
|
pamela::EventCounter *cod=0; |
71 |
|
|
72 |
|
pamela::PacketType *pctp=0; |
73 |
|
|
74 |
TFile *datafile = new TFile(file); |
TFile *datafile = new TFile(file); |
75 |
|
if ( !datafile ){ |
76 |
|
printf("No data file, exiting...\n"); |
77 |
|
return; |
78 |
|
} |
79 |
|
|
80 |
TTree *tree = (TTree*)datafile->Get("TsbT"); |
TTree *tree = (TTree*)datafile->Get("TsbT"); |
81 |
tree->SetBranchAddress("TsbT",&event); |
tree->SetBranchAddress("TsbT",&event); |
82 |
|
tree->SetBranchAddress("Header",&eT); |
83 |
|
|
84 |
|
TTree *Btree = (TTree*)datafile->Get("TsbB"); |
85 |
|
Btree->SetBranchAddress("TsbB",&Bevent); |
86 |
|
Btree->SetBranchAddress("Header",&eB); |
87 |
|
|
88 |
TTree *altr = (TTree*)datafile->Get("TrkAlarm"); |
TTree *altr = (TTree*)datafile->Get("TrkAlarm"); |
89 |
altr->SetBranchAddress("TrkAlarm",&al); |
altr->SetBranchAddress("TrkAlarm",&al); |
93 |
tr->SetBranchAddress("Tracker",&te); |
tr->SetBranchAddress("Tracker",&te); |
94 |
tr->SetBranchAddress("Header",&eh); |
tr->SetBranchAddress("Header",&eh); |
95 |
|
|
96 |
|
TTree *otr = (TTree*)datafile->Get("RunHeader"); |
97 |
|
otr->SetBranchAddress("Header",&eH); |
98 |
|
otr->SetBranchAddress("RunHeader",&reh); |
99 |
|
|
100 |
Long64_t nevent = tr->GetEntries(); |
Long64_t nevent = tr->GetEntries(); |
101 |
|
Long64_t neventH = otr->GetEntries(); |
102 |
Long64_t tnevent = tree->GetEntries(); |
Long64_t tnevent = tree->GetEntries(); |
103 |
|
Long64_t bnevent = Btree->GetEntries(); |
104 |
Long64_t alnevent = altr->GetEntries(); |
Long64_t alnevent = altr->GetEntries(); |
105 |
Int_t minevent=0; |
Int_t minevent=0; |
106 |
Int_t maxevent=0; |
Int_t maxevent=0; |
107 |
|
|
108 |
printf("Number of total events: %lld\n",nevent); |
printf("Number of total events: %lld\n",nevent); |
109 |
|
printf("Number of header events: %lld\n",neventH); |
110 |
|
printf("Number of TsbT events: %lld\n",tnevent); |
111 |
|
printf("Number of TsbB events: %lld\n",bnevent); |
112 |
|
printf("Number of TrkAlarm packet events: %lld\n",alnevent); |
113 |
|
|
114 |
if (nevent<=0){ |
if (nevent<=0){ |
115 |
datafile->Close(); |
datafile->Close(); |
137 |
} else if (toevent > nevent) { |
} else if (toevent > nevent) { |
138 |
maxevent = nevent; |
maxevent = nevent; |
139 |
} else { |
} else { |
140 |
maxevent = toevent+1; |
maxevent = nevent; |
141 |
} |
} |
142 |
nevent=maxevent-minevent ; |
nevent=maxevent-minevent ; |
143 |
} |
} |
144 |
|
|
145 |
|
// |
146 |
if (fromevent!=0) |
// information about the RunHeader |
147 |
printf("\n Scan of events from %i to %i ... \n",minevent,maxevent-1); |
ULong_t HOBT[neventH]; |
148 |
else |
Int_t trk_cal_us[neventH]; |
149 |
printf("\n Scan of events from %i to %i ... \n",minevent+1,maxevent); |
ULong_t acq_info[neventH]; |
150 |
|
Int_t countnboot=1; |
151 |
|
for (Int_t vi=0; vi<neventH;vi++){ |
152 |
|
HOBT[vi]=0; |
153 |
|
trk_cal_us[vi]=0; |
154 |
|
acq_info[vi]=0; |
155 |
|
} |
156 |
|
for (Int_t ev=0; ev<neventH; ev++){ |
157 |
|
otr->GetEntry(ev); |
158 |
|
pH = eH->GetPscuHeader(); |
159 |
|
HOBT[ev]= pH->GetOrbitalTime(); |
160 |
|
trk_cal_us[ev]=reh->TRK_CALIB_USED; |
161 |
|
acq_info[ev]=reh->ACQ_BUILD_INFO; |
162 |
|
if((HOBT[ev]<HOBT[ev-1]) && ev>0) |
163 |
|
countnboot+=1; |
164 |
|
} |
165 |
|
countnboot+=(Int_t)(2*nevent/MAXSTORAGE); |
166 |
|
// printf("\ncountnboot=%d\n",countnboot); |
167 |
|
|
168 |
// |
// |
169 |
// other variables definitions |
// other variables definitions |
170 |
stringstream oss1,oss2,oss3,oss4,fromfile,isfile,tit; |
stringstream oss1,oss2,oss3,oss4,fromfile,isfile,tit; |
|
Int_t warning_dspnumber=0; |
|
171 |
Int_t ALARM=0; |
Int_t ALARM=0; |
172 |
Int_t WARNING[12]; |
Int_t WARNING[12]; |
|
const Int_t size=nevent; |
|
|
Int_t dsp=0; |
|
|
Double_t yd[size*12], yc[size*12], x[size], eventint[size]; |
|
|
Double_t yyc[size], hi=0, land[size*12][3], illum[size*12][3] ; |
|
173 |
|
|
|
TGraph *comprtime,*temp[5]; |
|
|
TGraph *eventnumb; |
|
|
TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; |
|
|
TPaveText *pt1; |
|
|
TPad *pt; |
|
|
|
|
174 |
// |
// |
175 |
// information about the entries for the temperatures |
// information about the entries for the temperatures |
176 |
Int_t tmpSize=0,siztmp=0,maxsize=0; |
Int_t tmpSize=0,siztmp=0,maxsize=0; |
180 |
maxsize+=tmpSize; |
maxsize+=tmpSize; |
181 |
} |
} |
182 |
const Int_t tsize=maxsize; |
const Int_t tsize=maxsize; |
183 |
Int_t tempt[tsize][5],xt[tsize], tempt_tmp[tsize]; |
Int_t tempt[tsize][5]; |
184 |
|
ULong_t xt[tsize]; |
185 |
|
|
186 |
|
Int_t cntpgtemp=1,cntpgdat=0,cntpgmag=0; |
187 |
|
// |
188 |
|
// information about the temperatures |
189 |
|
for (Int_t ev=0; ev<tnevent; ev++){ |
190 |
|
tree->GetEntry(ev); |
191 |
|
tmpSize = event->Records->GetEntries(); |
192 |
|
for (Int_t j = 0; j < tmpSize; j++){ |
193 |
|
record = (pamela::TsbTRecord*)event->Records->At(j); |
194 |
|
xt[siztmp]=record->RECORD_OBT; |
195 |
|
if((xt[siztmp]<xt[siztmp-1]) && siztmp>0) |
196 |
|
cntpgtemp+=1; |
197 |
|
|
198 |
|
for (Int_t z = 0; z < 5; z++){ |
199 |
|
tempt[siztmp][z] = record->TEMPERATURES[z+1]; |
200 |
|
} |
201 |
|
siztmp++; |
202 |
|
} |
203 |
|
} |
204 |
|
|
205 |
|
// |
206 |
|
// information about the entries for the magnetic field |
207 |
|
if(bnevent>0) cntpgmag=1; |
208 |
|
maxsize=0; |
209 |
|
for (Int_t ev=0; ev<bnevent; ev++){ |
210 |
|
Btree->GetEntry(ev); |
211 |
|
tmpSize = Bevent->Records->GetEntries(); |
212 |
|
maxsize+=tmpSize; |
213 |
|
} |
214 |
|
const Int_t bsize=maxsize; |
215 |
|
Int_t magt[bsize][5]; |
216 |
|
ULong_t xb[bsize]; |
217 |
|
siztmp=0; |
218 |
|
// |
219 |
|
// information about the magnetic field |
220 |
|
for (Int_t ev=0; ev<bnevent; ev++){ |
221 |
|
Btree->GetEntry(ev); |
222 |
|
tmpSize = Bevent->Records->GetEntries(); |
223 |
|
for (Int_t j = 0; j < tmpSize; j++){ |
224 |
|
Brecord = (pamela::TsbBRecord*)Bevent->Records->At(j); |
225 |
|
xb[siztmp]=Brecord->RECORD_OBT; |
226 |
|
if((xb[siztmp]<xb[siztmp-1]) && siztmp>0) |
227 |
|
cntpgmag+=1; |
228 |
|
for (Int_t z = 0; z < 5; z++){ |
229 |
|
magt[siztmp][z] = Brecord->B_FIELD[z+1]; |
230 |
|
} |
231 |
|
siztmp++; |
232 |
|
} |
233 |
|
} |
234 |
|
|
235 |
// |
// |
236 |
// open the output text files for the alarms |
// open the output text files for the alarms |
237 |
ofstream warning(out + "warning.txt",ios::out); |
TString fname1 = out+ffile; |
238 |
TString fname = out+ffile; |
TString fname = out+ffile; |
|
TString fname1 = out+ffile; |
|
239 |
int slen=fname.Length(); |
int slen=fname.Length(); |
240 |
int last=fname.Last('_'); |
int last=fname.Last('_'); |
241 |
if(last<(slen-1))fname.Append('_'); |
if(last<(slen-1))fname.Append('_'); |
242 |
fname.Append("Trk-ALARM-report.txt"); |
fname.Append("FTrk-DSP-report.txt"); |
243 |
ofstream alarm(fname,ios::out); |
ofstream alarm(fname,ios::out); |
244 |
alarm << "TRACKER ALARM REPORT - Downlink " << ffile<< endl; |
alarm << "TRACKER DSP REPORT - Downlink " << ffile<< endl; |
245 |
fname1.Append("_TrkAlarm-pkt-report.txt"); |
fname1.Append("_FTrkAlarm-pkt-report.txt"); |
246 |
ofstream alarm1(fname1,ios::out); |
ofstream alarm1(fname1,ios::out); |
247 |
alarm1 << "TrkAlarm pkt REPORT - Downlink " << ffile<< endl; |
alarm1 << "TrkAlarm pkt REPORT - Downlink " << ffile<< endl; |
248 |
|
|
250 |
// write the file for the TrkAlarm packet |
// write the file for the TrkAlarm packet |
251 |
if(alnevent==0) alarm1 <<endl<< "------> NO ALARM!!! <-------"<< endl; |
if(alnevent==0) alarm1 <<endl<< "------> NO ALARM!!! <-------"<< endl; |
252 |
else{ |
else{ |
253 |
|
ULong_t obt=0; |
254 |
for (Int_t ev=0; ev<alnevent; ev++){ |
for (Int_t ev=0; ev<alnevent; ev++){ |
255 |
altr->GetEntry(ev); |
altr->GetEntry(ev); |
256 |
ph = aleh->GetPscuHeader(); |
ph = aleh->GetPscuHeader(); |
257 |
|
|
258 |
|
if((ULong_t)ph->GetOrbitalTime()<obt && ev>0) |
259 |
|
alarm1<<endl<<"NEW CPU BOOT"<<endl; |
260 |
|
obt=ph->GetOrbitalTime(); |
261 |
|
|
262 |
alarm1 << "================================================="<< endl; |
alarm1 << "================================================="<< endl; |
263 |
alarm1 << "PSCU-Pkt N. "<< ph->GetCounter() ; |
alarm1 << "PSCU-Pkt N. "<< ph->GetCounter() ; |
264 |
alarm1 << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
alarm1 << " - OBT "<< (ULong_t)ph->GetOrbitalTime() << " ms"<<endl; |
265 |
alarm1 << "(ROOT-tree entry "<<ev<<")"<<endl; |
alarm1 << "(ROOT-tree entry "<<ev<<")"<<endl; |
266 |
alarm1 << "================================================="<< endl; |
alarm1 << "================================================="<< endl<<endl; |
267 |
|
|
268 |
alarm1 << " ALARM[1]= "<<(Int_t)al->ALARM[1]<<endl; |
alarm1 << "Alarm variables (range 0-1)"<<endl; |
269 |
alarm1 << " ALARM[2]= "<<(Int_t)al->ALARM[2]<<endl; |
alarm1 << " ALARM[1]= 0x"<< hex << (Int_t)al->ALARM[0]<<endl; |
270 |
alarm1 << " Aswr= "<<(Int_t)al->Aswr<<endl; |
alarm1 << " ALARM[2]= 0x"<< (Int_t)al->ALARM[1]<<endl; |
271 |
alarm1 << " BID[1]= "<<(Int_t)al->BID[0]<<endl; |
alarm1 << " CmdDuringTrig= 0x"<< (Int_t)al->CmdDuringTrig<<endl; |
272 |
alarm1 << " BID[2]= "<<(Int_t)al->BID[1]<<endl; |
alarm1 << " FinalCheck= 0x"<< (Int_t)al->FinalCheck<<endl; |
273 |
alarm1 << " BID[3]= "<<(Int_t)al->BID[2]<<endl; |
alarm1 << " FlashData= 0x"<< (Int_t)al->FlashData<<endl; |
274 |
alarm1 << " BID[4]= "<<(Int_t)al->BID[3]<<endl; |
alarm1 << " FlashShutdown= 0x"<< (Int_t)al->FlashShutdown<<endl; |
275 |
alarm1 << " BID[5]= "<<(Int_t)al->BID[4]<<endl; |
alarm1 << " FlashUpset= 0x"<< (Int_t)al->FlashUpset<<endl; |
276 |
alarm1 << " BID[6]= "<<(Int_t)al->BID[5]<<endl; |
alarm1 << " InterCheck= 0x"<< (Int_t)al->InterCheck<<endl; |
277 |
alarm1 << " BID[7]= "<<(Int_t)al->BID[6]<<endl; |
alarm1 << " UnknownCmd= 0x"<<(Int_t)al->UnknownCmd<<endl<<endl; |
278 |
alarm1 << " CmdDuringTrig= "<<(Int_t)al->CmdDuringTrig<<endl; |
|
279 |
alarm1 << " CmdIDMA= "<<(Int_t)al->CmdIDMA<<endl; |
alarm1 << "Alarm variables (range 0-3F)"<<endl; |
280 |
alarm1 << " CmdNum= "<<(Int_t)al->CmdNum<<endl; |
alarm1 << " CmdIDMA= 0x"<< (Int_t)al->CmdIDMA<<endl; |
281 |
alarm1 << " DSPBusy= "<<(Int_t)al->DSPBusy<<endl; |
alarm1 << " DSPSoft= 0x"<< (Int_t)al->DSPSoft<<endl; |
282 |
alarm1 << " DSPMask= "<<(Int_t)al->DSPMask<<endl; |
alarm1 << " TrigIDMA= 0x"<< (Int_t)al->TrigIDMA<<endl<<endl; |
283 |
alarm1 << " DSPSoft= "<<(Int_t)al->DSPSoft<<endl; |
|
284 |
alarm1 << " FinalCheck= "<<(Int_t)al->FinalCheck<<endl; |
alarm1 << "Control variables (range 0-3F)"<<endl; |
285 |
alarm1 << " FlashData= "<<(Int_t)al->FlashData<<endl; |
alarm1 << " DSPBusy= 0x"<< (Int_t)al->DSPBusy<<endl; |
286 |
alarm1 << " FlashOn= "<<(Int_t)al->FlashOn<<endl; |
alarm1 << " DSPMask= 0x"<< (Int_t)al->DSPMask<<endl<<endl; |
287 |
alarm1 << " FlashShutdown= "<<(Int_t)al->FlashShutdown<<endl; |
|
288 |
alarm1 << " FlashUpset= "<<(Int_t)al->FlashUpset<<endl; |
alarm1 << "Control variables (range 0-1)"<<endl; |
289 |
alarm1 << " InterCheck= "<<(Int_t)al->InterCheck<<endl; |
alarm1 << " FlashOn= 0x"<< (Int_t)al->FlashOn<<endl<<endl; |
290 |
alarm1 << " PNum= "<<(Int_t)al->PNum<<endl; |
|
291 |
alarm1 << " TrigIDMA= "<<(Int_t)al->TrigIDMA<<endl; |
alarm1 << "Control variables (range 0-3)"<<endl; |
292 |
alarm1 << " TrigMask= "<<(Int_t)al->TrigMask<<endl; |
alarm1 << " TrigMask= 0x"<< (Int_t)al->TrigMask<<endl<<endl; |
293 |
alarm1 << " UnknownCmd= "<<(Int_t)al->UnknownCmd<<endl; |
|
294 |
|
alarm1 << "Control bits fixed"<<endl; |
295 |
|
alarm1 << " Aswr= 0x"<< (Int_t)al->Aswr<<endl; |
296 |
|
alarm1 << " BID[1]= 0x"<< (Int_t)al->BID[0]<<endl; |
297 |
|
alarm1 << " BID[2]= 0x"<< (Int_t)al->BID[1]<<endl; |
298 |
|
alarm1 << " BID[3]= 0x"<< (Int_t)al->BID[2]<<endl; |
299 |
|
alarm1 << " BID[4]= 0x"<< (Int_t)al->BID[3]<<endl; |
300 |
|
alarm1 << " BID[5]= 0x"<< (Int_t)al->BID[4]<<endl; |
301 |
|
alarm1 << " BID[6]= 0x"<< (Int_t)al->BID[5]<<endl; |
302 |
|
alarm1 << " BID[7]= 0x"<< (Int_t)al->BID[6]<<endl; |
303 |
|
alarm1 << " CmdNum= 0x"<< (Int_t)al->CmdNum<<endl; |
304 |
|
alarm1 << " PNum= 0x"<< (Int_t)al->PNum<< dec <<endl; |
305 |
|
|
306 |
|
alarm1 << "================================================="<< endl<<endl; |
307 |
|
|
308 |
} |
} |
309 |
} |
} |
310 |
|
|
311 |
|
// |
312 |
|
// Set Style options |
313 |
|
gStyle->SetLabelSize(0.05,"x"); |
314 |
|
gStyle->SetLabelSize(0.06,"y"); |
315 |
|
gStyle->SetStatFontSize(0.075); |
316 |
|
gStyle->SetOptStat(1110); |
317 |
|
gStyle->SetFillColor(10); |
318 |
|
gStyle->SetStatColor(10); |
319 |
|
gStyle->SetTitleFillColor(10); |
320 |
|
gStyle->SetTitleFontSize(0.1); |
321 |
|
gStyle->SetTitleOffset(0.8,"y"); |
322 |
|
gStyle->SetTitleOffset(0.9,"x"); |
323 |
|
gStyle->SetTitleSize(0.06,"y"); |
324 |
|
gStyle->SetTitleSize(0.055,"x"); |
325 |
|
|
326 |
|
// |
327 |
|
// Define output canvas, histos and graphs |
328 |
|
TCanvas *CompTimeCanv[countnboot],*EventNumCanv[countnboot],*TempCanv[cntpgtemp],*BfieldCanv[cntpgmag]; |
329 |
|
TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3; |
330 |
|
|
331 |
|
TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; |
332 |
|
TGraph *comprtime[12][countnboot],*temp[5][cntpgtemp],*tempw[5][cntpgtemp],*eventnumb[countnboot],*mag[5][cntpgmag]; |
333 |
|
TPad *pad1[12],*pad2[12],*pad3[12],*pad4[12],*pad5[12],*pad6[5],*pad7[5]; |
334 |
|
|
335 |
|
for(Int_t n = 0; n<12; n++) { |
336 |
|
|
337 |
|
/* -----------> HISTOGRAMS */ |
338 |
|
|
339 |
|
tit<<"DSP "<<n+1; |
340 |
|
oss1<<"DSP "<<n+1; |
341 |
|
oss2<<"DSPh "<<n+1; |
342 |
|
oss3<<"DSP h "<<n+1; |
343 |
|
oss4<<"DSP h"<<n+1; |
344 |
|
|
345 |
|
landau1[n]= new TH1F(oss1.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
346 |
|
landau2[n]= new TH1F(oss2.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
347 |
|
landau3[n]= new TH1F(oss3.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
348 |
|
|
349 |
|
illuminazione[n]= new TH1F(oss4.str().c_str(),tit.str().c_str(),3073,-0.5,3072.5); |
350 |
|
|
351 |
|
tit.str(""); |
352 |
|
oss1.str(""); |
353 |
|
oss2.str(""); |
354 |
|
oss3.str(""); |
355 |
|
oss4.str(""); |
356 |
|
}; |
357 |
|
|
358 |
|
|
359 |
//*************************************************************************************** |
//*************************************************************************************** |
360 |
// LOOP on each event |
// LOOP on each event |
361 |
//*************************************************************************************** |
//*************************************************************************************** |
362 |
|
|
363 |
// |
if (fromevent!=0) |
364 |
// information about the temperatures |
printf("\n Scan of events from %i to %i ... \n",minevent,maxevent-1); |
365 |
for (Int_t ev=0; ev<tnevent; ev++){ |
else |
366 |
tree->GetEntry(ev); |
printf("\n Scan of events from %i to %i ... \n",minevent+1,maxevent); |
367 |
tmpSize = event->Records->GetEntries(); |
|
368 |
for (Int_t j = 0; j < tmpSize; j++){ |
TLatex *t=new TLatex(); |
369 |
record = (pamela::TsbTRecord*)event->Records->At(j); |
TLatex *t1=new TLatex(); |
370 |
xt[siztmp]=record->RECORD_OBT; //0.051*record->RECORD_OBT; |
|
371 |
for (Int_t z = 0; z < 5; z++){ |
TLine li,liva1; |
372 |
tempt[siztmp][z] = record->TEMPERATURES[z+1]; |
|
373 |
} |
Int_t minev=minevent,maxev=maxevent,countTEMP=0,countMAG=0; |
374 |
siztmp++; |
ULong_t countALARMx=0,countALARMy=0,countFC[12],countFL1[12],countFL2[12],countFL3[12],countFL4[12],countFL5[12],countFL6[12]; |
375 |
} |
|
376 |
|
for(int i=0; i<12; i++){ |
377 |
|
countFC[i]=0; |
378 |
|
countFL1[i]=0; |
379 |
|
countFL2[i]=0; |
380 |
|
countFL3[i]=0; |
381 |
|
countFL4[i]=0; |
382 |
|
countFL5[i]=0; |
383 |
|
countFL6[i]=0; |
384 |
} |
} |
385 |
|
|
386 |
// |
// |
387 |
// information about the tracker data |
// Fill temperature graphs |
388 |
for (Int_t ev=minevent; ev<maxevent; ev++){ |
for(Int_t ii=0; ii<cntpgtemp;ii++){ |
389 |
tr->GetEntry(ev); |
//**************************************************************************************** |
390 |
ph = eh->GetPscuHeader(); |
//Temperature Output Pages |
391 |
dsp=0; |
//**************************************************************************************** |
392 |
ALARM=0; |
fromfile.str(""); |
393 |
for(Int_t i=0; i<12; i++){ |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
394 |
dsp=te->DSPnumber[i]-1; |
isfile<<"Temperatures vs OBT pag"<<ii+1; |
395 |
yd[(ev-minevent)*12+dsp]= te->DATAlength[i]; |
TempCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
396 |
yc[(ev-minevent)*12+dsp]= 0.051*te->compressiontime[i]; |
TempCanv[ii]->SetFillColor(10); |
397 |
for(Int_t j=0;j<3;j++){ |
TempCanv[ii]->Range(0,0,100,100); |
398 |
illum[(ev-minevent)*12+dsp][j]=te->addrcluster[i][j]; |
|
399 |
if(!(dsp%2)&&(te->signcluster[i][j])!=0) |
t->SetTextFont(32); |
400 |
land[(ev-minevent)*12+dsp][j]=1024-(te->signcluster[i][j]); |
t->SetTextColor(1); |
401 |
else land[(ev-minevent)*12+dsp][j]=te->signcluster[i][j]; |
t->SetTextAlign(12); |
402 |
|
t->SetTextSize(0.02); |
403 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
404 |
|
t1->SetTextFont(32); |
405 |
|
t1->SetTextColor(1); |
406 |
|
t1->SetTextAlign(12); |
407 |
|
t1->SetTextSize(0.02); |
408 |
|
t1->DrawLatex(78.,98.7,isfile.str().c_str()); |
409 |
|
isfile.str(""); |
410 |
|
t1->SetTextSize(0.025); |
411 |
|
t1->SetTextColor(196); |
412 |
|
isfile<<"--> Values at 28.5^{o}C (if presents) correspond"; |
413 |
|
t1->DrawLatex(50.,22.,isfile.str().c_str()); |
414 |
|
isfile.str(""); |
415 |
|
isfile<<" to wrong readings ( > 100^{o}C) of the Tsb"; |
416 |
|
t1->DrawLatex(50.,19.,isfile.str().c_str()); |
417 |
|
isfile.str(""); |
418 |
|
isfile<<"--> Values at 25.5^{o}C (if presents) correspond"; |
419 |
|
t1->DrawLatex(50.,12.,isfile.str().c_str()); |
420 |
|
isfile.str(""); |
421 |
|
isfile<<" to wrong readings ( < 0^{o}C) of the Tsb"; |
422 |
|
t1->DrawLatex(50.,9.,isfile.str().c_str()); |
423 |
|
isfile.str(""); |
424 |
|
|
425 |
|
Float_t tposy = 0.95; // up y-coord - top pads |
426 |
|
Float_t thpad = 0; // pad height |
427 |
|
Float_t tposx1=0; // left x-coord - pad column |
428 |
|
Float_t tposx0=0; // x-coord - column division |
429 |
|
Float_t twrel = 0; // relative x size of first sub-column |
430 |
|
Float_t tmarg = 0.004; // margin among pads |
431 |
|
|
432 |
|
thpad = (tposy-tmarg*5)/3; |
433 |
|
twrel = (1-tmarg*4)/2; |
434 |
|
|
435 |
|
for(Int_t i=0; i<5; i++){ |
436 |
|
if ( (i+1)%2==1 ) { |
437 |
|
if(i>1) tposy = tposy-(tmarg*2+thpad); |
438 |
|
tposx1 = tmarg; |
439 |
|
tposx0 = tposx1 + twrel; |
440 |
} |
} |
441 |
x[(ev-minevent)]= ph->GetOrbitalTime(); |
else { |
442 |
|
tposx1 = tposx0 + 2*tmarg; |
443 |
|
tposx0 = tposx1 + twrel; |
444 |
|
} |
445 |
|
|
446 |
|
/* -----------> pad for histograms */ |
447 |
|
pad6[i] = new TPad("pad6"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); |
448 |
|
|
449 |
|
Int_t v=0,vv=0; |
450 |
|
Double_t xt_tmp[tsize], tempt_tmp[tsize]; |
451 |
|
Double_t xt_tmpw[tsize], tempt_tmpw[tsize]; |
452 |
|
for (Int_t ev=countTEMP; ev<tsize; ev++){ |
453 |
|
|
454 |
WARNING[i]=0; |
if(ev==tsize-1 && i==4 && ii==cntpgtemp-1) countTEMP=tsize-1; |
455 |
if(te->fc[i]!=0 || te->fl1[i]!=0 || te->fl2[i]!=0 || te->fl3[i]!=0 || te->fl4[i]!=0 || te->fl5[i]!=0 || te->fl6[i]!=0){ |
if(xt[ev]<xt[ev-1] && ev>countTEMP){ |
456 |
ALARM = 1; //general alarm |
if(i==4) countTEMP=ev; |
457 |
WARNING[i] = 1; // DSP warning |
break; |
458 |
}; |
} |
459 |
|
else{ |
460 |
if(te->alarm[i]!=0){ // hardware alarm |
tempt_tmp[v]=(Double_t)((Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231)); |
461 |
ALARM = 1; |
if(tempt_tmp[v]>100) { |
462 |
}; |
tempt_tmp[v]=28.5; |
463 |
|
tempt_tmpw[vv]=28.5; |
464 |
//************************************************************************************** |
xt_tmpw[vv++]=(Double_t)xt[ev]; |
465 |
// warning for internal number |
} |
466 |
//************************************************************************************** |
else if(tempt_tmp[v]<0){ |
467 |
if(i<=10){ |
tempt_tmp[v]=25.5; |
468 |
if(te->eventn[i]!=te->eventn[i+1]){ |
tempt_tmpw[vv]=25.5; |
469 |
warning_dspnumber++; |
xt_tmpw[vv++]=(Double_t)xt[ev]; |
470 |
warning<< "==> WARNING!! Check entry "<< ev<<" (DSP "<<dsp<<")" <<endl<< |
} |
471 |
"eventn["<<i<<"]= "<<te->eventn[i]<<"!= eventn["<<i+1<<"]= "<< te->eventn[i+1]<<endl; |
xt_tmp[v++]=(Double_t)xt[ev]; |
472 |
} |
} |
|
else |
|
|
eventint[(ev-minevent)]=te->eventn[0]; |
|
473 |
} |
} |
474 |
} |
TempCanv[ii]->cd(); |
475 |
|
tit<<"T"<<i+5<<" (magnetic module "<<i+1<<")"; |
476 |
if(ev<=maxevent-1){ |
pad6[i]->SetFillColor(10); |
477 |
|
pad6[i]->Draw(); |
478 |
|
pad6[i]->cd(); |
479 |
|
temp[i][ii]= new TGraph(v,xt_tmp,tempt_tmp); |
480 |
|
temp[i][ii]->SetTitle(tit.str().c_str()); |
481 |
|
if(v==1) temp[i][ii]->GetXaxis()->SetNdivisions(-501); |
482 |
|
temp[i][ii]->GetXaxis()->SetLabelSize(0.04); |
483 |
|
temp[i][ii]->GetXaxis()->SetTitleSize(0.04); |
484 |
|
temp[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
485 |
|
temp[i][ii]->GetXaxis()->CenterTitle(); |
486 |
|
temp[i][ii]->GetXaxis()->SetTitleOffset(0.85); |
487 |
|
temp[i][ii]->GetYaxis()->SetTitleOffset(1.2); |
488 |
|
temp[i][ii]->GetYaxis()->SetLabelOffset(0.001); |
489 |
|
temp[i][ii]->GetYaxis()->SetLabelSize(0.04); |
490 |
|
temp[i][ii]->GetYaxis()->SetTitleSize(0.04); |
491 |
|
temp[i][ii]->GetYaxis()->SetTitle("Temperatures ( ^{o}C)"); |
492 |
|
temp[i][ii]->GetYaxis()->CenterTitle(); |
493 |
|
temp[i][ii]->SetMarkerStyle(21); |
494 |
|
temp[i][ii]->SetMarkerSize(0.2); |
495 |
|
temp[i][ii]->Draw("ap"); |
496 |
|
tit.str(""); |
497 |
|
if(vv>0){ |
498 |
|
tempw[i][ii]= new TGraph(vv,xt_tmpw,tempt_tmpw); |
499 |
|
tempw[i][ii]->SetMarkerStyle(21); |
500 |
|
tempw[i][ii]->SetMarkerSize(0.2); |
501 |
|
tempw[i][ii]->SetMarkerColor(196); |
502 |
|
tempw[i][ii]->Draw("samep"); |
503 |
|
} |
504 |
|
TempCanv[ii]->Update(); |
505 |
|
|
506 |
|
|
507 |
|
} |
508 |
|
if(countTEMP==tsize-1 && ii==cntpgtemp-1){ |
509 |
|
break; |
510 |
|
} |
511 |
|
} |
512 |
|
|
513 |
if((ev-minevent)>=1 && eventint[(ev-minevent)]!=eventint[(ev-minevent)-1]+1 && eventint[(ev-minevent)]!=1){ |
// |
514 |
warning_dspnumber++; |
// Fill magnetic field graphs |
515 |
warning<< "==> WARNING!! Check entry "<< ev<<endl<< |
for(Int_t ii=0; ii<cntpgmag;ii++){ |
516 |
" DSP event num.= "<< eventint[(ev-minevent)]<< |
//**************************************************************************************** |
517 |
" is different from (previus+1) ="<<eventint[(ev-minevent)-1]+1 <<"\n"<<endl; |
//Magnetic Field Output Pages |
518 |
|
//**************************************************************************************** |
519 |
|
fromfile.str(""); |
520 |
|
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
521 |
|
isfile<<"Magnetic Axial Field vs OBT pag"<<ii+1; |
522 |
|
BfieldCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
523 |
|
BfieldCanv[ii]->SetFillColor(10); |
524 |
|
BfieldCanv[ii]->Range(0,0,100,100); |
525 |
|
|
526 |
|
t->SetTextFont(32); |
527 |
|
t->SetTextColor(1); |
528 |
|
t->SetTextAlign(12); |
529 |
|
t->SetTextSize(0.02); |
530 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
531 |
|
t1->SetTextFont(32); |
532 |
|
t1->SetTextColor(1); |
533 |
|
t1->SetTextAlign(12); |
534 |
|
t1->SetTextSize(0.02); |
535 |
|
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
536 |
|
isfile.str(""); |
537 |
|
|
538 |
|
li.SetLineStyle(1); |
539 |
|
li.SetLineWidth(1); |
540 |
|
li.SetLineColor(190); |
541 |
|
t1->SetTextColor(190); |
542 |
|
t1->SetTextSize(0.04); |
543 |
|
|
544 |
|
Float_t tposy = 0.95; // up y-coord - top pads |
545 |
|
Float_t thpad = 0; // pad height |
546 |
|
Float_t tposx1=0; // left x-coord - pad column |
547 |
|
Float_t tposx0=0; // x-coord - column division |
548 |
|
Float_t twrel = 0; // relative x size of first sub-column |
549 |
|
Float_t tmarg = 0.004; // margin among pads |
550 |
|
|
551 |
|
thpad = (tposy-tmarg*5)/3; |
552 |
|
twrel = (1-tmarg*4)/2; |
553 |
|
|
554 |
|
for(Int_t i=0; i<5; i++){ |
555 |
|
if ( (i+1)%2==1 ) { |
556 |
|
if(i>1) tposy = tposy-(tmarg*2+thpad); |
557 |
|
tposx1 = tmarg; |
558 |
|
tposx0 = tposx1 + twrel; |
559 |
|
} |
560 |
|
else { |
561 |
|
tposx1 = tposx0 + 2*tmarg; |
562 |
|
tposx0 = tposx1 + twrel; |
563 |
} |
} |
|
}; |
|
564 |
|
|
565 |
//******************************************************************************************** |
/* -----------> pad for histograms */ |
566 |
// file ALARM |
pad7[i] = new TPad("pad7"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); |
|
//******************************************************************************************** |
|
|
if(ALARM==1) { |
|
|
|
|
|
alarm << "================================================="<< endl; |
|
|
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
|
|
alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
|
|
alarm << "(ROOT-tree entry "<<ev<<")"<<endl; |
|
|
alarm << "================================================="<< endl; |
|
567 |
|
|
568 |
alarm << " DSPn"; |
Int_t v=0; |
569 |
alarm << " Event"; |
Double_t xb_tmp[bsize], magt_tmp[bsize]; |
570 |
alarm << " Words"; |
for (Int_t ev=countMAG; ev<bsize; ev++){ |
571 |
alarm << " crc"; |
|
572 |
alarm << " FC"; |
if(ev==bsize-1 && i==4 && ii==cntpgmag-1) countMAG=bsize-1; |
573 |
alarm << " FL1"; |
if(xb[ev]<xb[ev-1] && ev>countMAG){ |
574 |
alarm << " FL2"; |
if(i==4) countMAG=ev; |
575 |
alarm << " FL3"; |
break; |
576 |
alarm << " FL4"; |
} |
577 |
alarm << " FL5"; |
else{ |
578 |
alarm << " FL6" << endl; |
magt_tmp[v]=(Double_t)magt[ev][i]; |
579 |
|
xb_tmp[v++]=(Double_t)xb[ev]; |
580 |
|
} |
581 |
|
} |
582 |
|
BfieldCanv[ii]->cd(); |
583 |
|
tit<<"B"<<i+5<<" (magnetic module "<<i+1<<")"; |
584 |
|
pad7[i]->SetFillColor(10); |
585 |
|
pad7[i]->Draw(); |
586 |
|
pad7[i]->cd(); |
587 |
|
mag[i][ii]= new TGraph(v,xb_tmp,magt_tmp); |
588 |
|
mag[i][ii]->SetTitle(tit.str().c_str()); |
589 |
|
if(v==1) mag[i][ii]->GetXaxis()->SetNdivisions(-501); |
590 |
|
mag[i][ii]->GetXaxis()->SetLabelSize(0.04); |
591 |
|
mag[i][ii]->GetXaxis()->SetTitleSize(0.04); |
592 |
|
mag[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
593 |
|
mag[i][ii]->GetXaxis()->CenterTitle(); |
594 |
|
mag[i][ii]->GetXaxis()->SetTitleOffset(0.85); |
595 |
|
if(i!=4) mag[i][ii]->GetYaxis()->SetRangeUser(2047,2058); |
596 |
|
else mag[i][ii]->GetYaxis()->SetRangeUser(2059,2067); |
597 |
|
mag[i][ii]->GetYaxis()->SetTitleOffset(1.2); |
598 |
|
mag[i][ii]->GetYaxis()->SetLabelOffset(0.001); |
599 |
|
mag[i][ii]->GetYaxis()->SetLabelSize(0.03); |
600 |
|
mag[i][ii]->GetYaxis()->SetTitleSize(0.04); |
601 |
|
mag[i][ii]->GetYaxis()->SetTitle("Magnetic Field (au)"); |
602 |
|
mag[i][ii]->GetYaxis()->CenterTitle(); |
603 |
|
mag[i][ii]->SetMarkerStyle(21); |
604 |
|
mag[i][ii]->SetMarkerSize(0.4); |
605 |
|
mag[i][ii]->Draw("ap"); |
606 |
|
Double_t min=0.,max=0,xlat=0.; |
607 |
|
min=mag[i][ii]->GetXaxis()->GetXmin(); |
608 |
|
max=mag[i][ii]->GetXaxis()->GetXmax(); |
609 |
|
xlat=min+(max-min)/2; |
610 |
|
stringstream mi,ma; |
611 |
|
mi<<"minimum recorded value"; |
612 |
|
ma<<"maximum recorded value"; |
613 |
|
t->SetTextSize(0.1); |
614 |
|
switch(i){ |
615 |
|
case 0: |
616 |
|
li.DrawLine(min,2054.,max,2054.); |
617 |
|
li.DrawLine(min,2048.,max,2048.); |
618 |
|
t1->DrawLatex(xlat,2054.3,ma.str().c_str()); |
619 |
|
t1->DrawLatex(xlat,2047.7,mi.str().c_str()); |
620 |
|
break; |
621 |
|
|
622 |
|
case 1: |
623 |
|
li.DrawLine(min,2055.,max,2055.); |
624 |
|
li.DrawLine(min,2049.,max,2049.); |
625 |
|
t1->DrawLatex(xlat,2055.3,ma.str().c_str()); |
626 |
|
t1->DrawLatex(xlat,2048.7,mi.str().c_str()); |
627 |
|
break; |
628 |
|
|
629 |
|
case 2: |
630 |
|
li.DrawLine(min,2056.,max,2056.); |
631 |
|
li.DrawLine(min,2050.,max,2050.); |
632 |
|
t1->DrawLatex(xlat,2056.3,ma.str().c_str()); |
633 |
|
t1->DrawLatex(xlat,2049.7,mi.str().c_str()); |
634 |
|
break; |
635 |
|
|
636 |
for(Int_t i=0; i<12 ; i++){ |
case 3: |
637 |
alarm.width(5); alarm << te->DSPnumber[i]; |
li.DrawLine(min,2057.,max,2057.); |
638 |
alarm.width(6); alarm << te->eventn[i]; |
li.DrawLine(min,2051.,max,2051.); |
639 |
alarm.width(6); alarm << te->DATAlength[i]; |
t1->DrawLatex(xlat,2057.3,ma.str().c_str()); |
640 |
alarm.width(4); alarm << te->crc[i]; |
t1->DrawLatex(xlat,2050.7,mi.str().c_str()); |
641 |
alarm.width(4); alarm << te->fc[i]; |
break; |
642 |
alarm.width(4); alarm << te->fl1[i]; |
|
643 |
alarm.width(4); alarm << te->fl2[i]; |
case 4: |
644 |
alarm.width(4); alarm << te->fl3[i]; |
li.DrawLine(min,2066.,max,2066.); |
645 |
alarm.width(4); alarm << te->fl4[i]; |
li.DrawLine(min,2060.,max,2060.); |
646 |
alarm.width(4); alarm << te->fl5[i]; |
t1->DrawLatex(xlat,2066.2,ma.str().c_str()); |
647 |
alarm.width(4); alarm << te->fl6[i]; |
t1->DrawLatex(xlat,2059.8,mi.str().c_str()); |
648 |
if(te->alarm[i]!=0)alarm<<" >> ALARM "; |
break; |
649 |
if(WARNING[i]!=0)alarm<<" (DSP warning) "; |
|
|
alarm << endl; |
|
650 |
} |
} |
651 |
|
BfieldCanv[ii]->Update(); |
652 |
|
tit.str(""); |
653 |
|
} |
654 |
|
if(countMAG==bsize-1 && ii==cntpgmag-1){ |
655 |
|
break; |
656 |
} |
} |
657 |
} |
} |
658 |
if(ALARM==0) alarm << endl<< "------> NO ALARM!!! <-------"<<endl; |
|
659 |
|
|
660 |
if(warning_dspnumber==0) warning<<"NONE"<<endl; |
// |
661 |
|
// Fill compressiontime and eventnumber graphs and DSP warnings |
662 |
//***************************************** |
for(Int_t ii=0; ii<countnboot;ii++){ |
663 |
//close all files |
TPad *pt; //pad for histos |
664 |
//***************************************** |
|
665 |
warning.close(); |
//**************************************************************************************** |
666 |
alarm.close(); |
//COMPRESSIONTIME vs. OBT Output Pages |
667 |
datafile->Close(); |
//**************************************************************************************** |
668 |
|
fromfile.str(""); |
669 |
|
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
670 |
|
isfile<<"COMPRESSIONTIME vs. OBT pag"<<ii+1; |
671 |
|
CompTimeCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
672 |
|
CompTimeCanv[ii]->SetFillColor(10); |
673 |
|
CompTimeCanv[ii]->Range(0,0,100,100); |
674 |
|
t->SetTextFont(32); |
675 |
|
t->SetTextColor(1); |
676 |
|
t->SetTextAlign(12); |
677 |
|
t->SetTextSize(0.02); |
678 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
679 |
|
t1->SetTextFont(32); |
680 |
|
t1->SetTextColor(1); |
681 |
|
t1->SetTextAlign(12); |
682 |
|
t1->SetTextSize(0.02); |
683 |
|
t1->DrawLatex(62.,98.7,isfile.str().c_str()); |
684 |
|
isfile.str(""); |
685 |
|
|
686 |
|
//**************************************************************************************** |
687 |
|
//DSP EVENT NUMBER Output Pages |
688 |
|
//**************************************************************************************** |
689 |
|
|
690 |
|
isfile<<"DSP EVENT NUMBER vs. OBT pag"<<ii+1; |
691 |
|
EventNumCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
692 |
|
EventNumCanv[ii]->SetFillColor(10); |
693 |
|
EventNumCanv[ii]->Range(0,0,100,100); |
694 |
|
t->SetTextFont(32); |
695 |
|
t->SetTextColor(1); |
696 |
|
t->SetTextAlign(12); |
697 |
|
t->SetTextSize(0.02); |
698 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
699 |
|
t1->SetTextFont(32); |
700 |
|
t1->SetTextColor(1); |
701 |
|
t1->SetTextAlign(12); |
702 |
|
t1->SetTextSize(0.02); |
703 |
|
t1->DrawLatex(62.,98.7,isfile.str().c_str()); |
704 |
|
isfile.str(""); |
705 |
|
|
706 |
|
Float_t posy = 0.95; // up y-coord - top pads |
707 |
|
Float_t hpad = 0; // pad height |
708 |
|
Float_t posx1=0; // left x-coord - pad column |
709 |
|
Float_t posx0=0; // x-coord - column division |
710 |
|
Float_t wrel = 0; // relative x size of first sub-column |
711 |
|
Float_t marg = 0.004; // margin among pads |
712 |
|
|
713 |
|
hpad = (posy-marg*11)/6; |
714 |
|
wrel = (1-marg*4)/2; |
715 |
|
|
716 |
|
for(Int_t n = 0; n<12; n++) { |
717 |
|
|
718 |
|
if ( (n+1)%2==1 ) { |
719 |
|
if(n>1) posy = posy-(marg*2+hpad); |
720 |
|
posx1 = marg; |
721 |
|
posx0 = posx1 + wrel; |
722 |
|
} |
723 |
|
else { |
724 |
|
posx1 = posx0 + 2*marg; |
725 |
|
posx0 = posx1 + wrel; |
726 |
|
} |
727 |
|
|
728 |
|
/* -----------> pad for histograms */ |
729 |
|
pad1[n] = new TPad("pad1"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
730 |
|
pad2[n] = new TPad("pad2"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
731 |
|
pad3[n] = new TPad("pad3"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
732 |
|
pad4[n] = new TPad("pad4"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
733 |
|
pad5[n] = new TPad("pad5"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
734 |
|
} |
735 |
|
|
736 |
|
// |
737 |
|
// Obtain information about the tracker data |
738 |
|
// and fill graphs and histos |
739 |
|
|
740 |
|
Int_t al=0; |
741 |
|
ULong_t obtx=0; |
742 |
|
Double_t x[MAXSTORAGE]; |
743 |
|
Float_t yc[MAXSTORAGE][12]; |
744 |
|
Double_t eventint[MAXSTORAGE]; |
745 |
|
Int_t eventn[12]; |
746 |
|
|
747 |
|
for (Int_t ev=minev; ev<maxevent; ev++){ |
748 |
|
tr->GetEntry(ev); |
749 |
|
ph = eh->GetPscuHeader(); |
750 |
|
cod = eh->GetCounter(); |
751 |
|
|
752 |
|
|
753 |
gStyle->SetLabelSize(0.05,"x"); |
if(ev==maxevent-1) maxev=maxevent-1; |
|
gStyle->SetLabelSize(0.06,"y"); |
|
|
gStyle->SetStatFontSize(0.075); |
|
|
gStyle->SetOptStat(1110); |
|
|
gStyle->SetFillColor(10); |
|
|
gStyle->SetTitleFillColor(10); |
|
|
gStyle->SetTitleFontSize(0.1); |
|
|
gStyle->SetTitleOffset(0.8,"y"); |
|
|
gStyle->SetTitleOffset(0.9,"x"); |
|
|
gStyle->SetTitleSize(0.06,"y"); |
|
|
gStyle->SetTitleSize(0.055,"x"); |
|
754 |
|
|
755 |
//**************************************************************************************** |
if(((ULong_t)ph->GetOrbitalTime()<x[ev-minev-1] && ev-minev!=0) || ev-minev==MAXSTORAGE){ |
756 |
//Output figures --- First sheet: |
maxev=ev; |
757 |
//**************************************************************************************** |
break; |
758 |
|
} |
759 |
TCanvas *CompTimeCanv=new TCanvas("Tracker_Detector_Report_4/6","",900,1200); |
else{ |
760 |
CompTimeCanv->SetFillColor(10); |
obtx = ph->GetOrbitalTime(); |
761 |
CompTimeCanv->Range(0,0,100,100); |
x[(ev-minev)]=(Double_t)obtx; |
762 |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
ALARM=0; |
763 |
isfile<<"COMPRESSIONTIME vs. OBT"; |
Int_t dsp=0; |
764 |
TLatex *t=new TLatex(); |
Int_t noacq=0; |
765 |
t->SetTextFont(32); |
Int_t acq_dsp[12]; |
766 |
t->SetTextColor(1); |
ULong_t acq_info_tmp=0; |
767 |
t->SetTextAlign(12); |
if(cod->Get(pctp->RunHeader)>0) acq_info_tmp=acq_info[cod->Get(pctp->RunHeader)-1]; |
768 |
t->SetTextSize(0.02); |
else acq_info_tmp=acq_info[cod->Get(pctp->RunHeader)]; |
769 |
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
for(Int_t io=0;io<12;io++){ |
770 |
TLatex *t1=new TLatex(); |
acq_dsp[dsp]=(acq_info_tmp>>(12+io))&(~(~0<<1)); |
771 |
t1->SetTextFont(32); |
if(((acq_info_tmp>>(12+io))&(~(~0<<1)))==0) |
772 |
t1->SetTextColor(1); |
noacq+=1; |
773 |
t1->SetTextAlign(12); |
WARNING[io]=0; |
774 |
t1->SetTextSize(0.02); |
} |
|
t1->DrawLatex(64.,98.7,isfile.str().c_str()); |
|
|
isfile.str(""); |
|
775 |
|
|
776 |
//**************************************************************************************** |
for(Int_t i=0; i<12; i++){ |
|
//Output figures --- Second sheet: |
|
|
//**************************************************************************************** |
|
777 |
|
|
778 |
TCanvas *EventNumCanv=new TCanvas("Tracker_Detector_Report_5/6","",900,1200); |
if(i<12-noacq){ |
779 |
EventNumCanv->SetFillColor(10); |
if(te->DSPnumber[i]<1 || te->DSPnumber[i]>12) { |
780 |
EventNumCanv->Range(0,0,100,100); |
ALARM=1; |
781 |
isfile<<"WARNINGS on DSP EVENT NUMBER "; |
break; |
782 |
t->SetTextFont(32); |
} |
783 |
t->SetTextColor(1); |
|
784 |
t->SetTextAlign(12); |
dsp=te->DSPnumber[i]-1; |
785 |
t->SetTextSize(0.02); |
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
786 |
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
|
787 |
t1->SetTextFont(32); |
// |
788 |
t1->SetTextColor(1); |
// Fill Cluster Signal and Lighting of the view histos |
789 |
t1->SetTextAlign(12); |
for(Int_t j=0;j<3;j++){ |
790 |
t1->SetTextSize(0.02); |
if(te->signcluster[i][j]!=0){ |
791 |
t1->DrawLatex(68.4,98.7,isfile.str().c_str()); |
if((te->addrcluster[i][j]>6 && te->addrcluster[i][j]<505) ||(te->addrcluster[i][j]>518 && te->addrcluster[i][j]<1018)){ |
792 |
isfile.str(""); |
illuminazione[dsp]->Fill((Float_t)((j*1024.)+te->addrcluster[i][j])); |
793 |
|
} |
794 |
|
} |
795 |
|
} |
796 |
|
if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ |
797 |
|
if(!(dsp%2)){ |
798 |
|
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)(1024.-te->signcluster[i][0])); |
799 |
|
if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)(1024.-te->signcluster[i][1])); |
800 |
|
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)(1024.-te->signcluster[i][2])); |
801 |
|
} |
802 |
|
else{ |
803 |
|
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)te->signcluster[i][0]); |
804 |
|
if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)te->signcluster[i][1]); |
805 |
|
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)te->signcluster[i][2]); |
806 |
|
} |
807 |
|
} |
808 |
|
|
809 |
|
WARNING[i]=0; |
810 |
|
if(te->fc[i]!=0){ |
811 |
|
if(countFC[dsp]==0){ |
812 |
|
ALARM = 1; //general alarm |
813 |
|
WARNING[i] = 1; // DSP warning |
814 |
|
} |
815 |
|
countFC[dsp]+=1; |
816 |
|
}; |
817 |
|
|
818 |
|
if(te->fl1[i]!=0){ |
819 |
|
if(countFL1[dsp]==0){ |
820 |
|
ALARM = 1; //general alarm |
821 |
|
WARNING[i] = 1; // DSP warning |
822 |
|
} |
823 |
|
countFL1[dsp]+=1; |
824 |
|
}; |
825 |
|
|
826 |
|
if(te->fl2[i]!=0){ |
827 |
|
if(countFL2[dsp]==0){ |
828 |
|
ALARM = 1; //general alarm |
829 |
|
WARNING[i] = 1; // DSP warning |
830 |
|
} |
831 |
|
countFL2[dsp]+=1; |
832 |
|
}; |
833 |
|
|
834 |
|
if(te->fl3[i]!=0){ |
835 |
|
if(countFL3[dsp]==0){ |
836 |
|
ALARM = 1; //general alarm |
837 |
|
WARNING[i] = 1; // DSP warning |
838 |
|
} |
839 |
|
countFL3[dsp]+=1; |
840 |
|
}; |
841 |
|
|
842 |
|
if(te->fl4[i]!=0){ |
843 |
|
if(countFL4[dsp]==0){ |
844 |
|
ALARM = 1; //general alarm |
845 |
|
WARNING[i] = 1; // DSP warning |
846 |
|
} |
847 |
|
countFL4[dsp]+=1; |
848 |
|
}; |
849 |
|
|
850 |
|
if(te->fl5[i]!=0){ |
851 |
|
if(countFL5[dsp]==0){ |
852 |
|
ALARM = 1; //general alarm |
853 |
|
WARNING[i] = 1; // DSP warning |
854 |
|
} |
855 |
|
countFL5[dsp]+=1; |
856 |
|
}; |
857 |
|
|
858 |
|
if(te->fl6[i]!=0){ |
859 |
|
if(countFL6[dsp]==0){ |
860 |
|
ALARM = 1; //general alarm |
861 |
|
WARNING[i] = 1; // DSP warning |
862 |
|
} |
863 |
|
countFL6[dsp]+=1; |
864 |
|
}; |
865 |
|
|
866 |
|
if(dsp%2==0 && te->alarm[i]!=0){ // hardware alarm |
867 |
|
if(countALARMy==0) |
868 |
|
ALARM = 1; |
869 |
|
countALARMy+=1; |
870 |
|
}; |
871 |
|
|
872 |
|
if(dsp%2==1 && te->alarm[i]!=0){ // hardware alarm |
873 |
|
if(countALARMx==0) |
874 |
|
ALARM = 1; |
875 |
|
countALARMx+=1; |
876 |
|
}; |
877 |
|
|
878 |
|
//************************************************************************************** |
879 |
|
// warning for internal number |
880 |
|
//************************************************************************************** |
881 |
|
if(ev==minev && i<=10 && te->eventn[i]!=te->eventn[i+1]) ALARM=1; |
882 |
|
if((ev-minev)>=1 && eventn[i]+1!=te->eventn[i] && te->eventn[i]!=1) ALARM=1; |
883 |
|
} |
884 |
|
} |
885 |
|
eventint[(ev-minev)]=te->eventn[0]; |
886 |
|
|
887 |
|
//******************************************************************************************** |
888 |
|
// file DSP warning |
889 |
|
//******************************************************************************************** |
890 |
|
|
891 |
|
if(ALARM==1) { |
892 |
|
al=1; |
893 |
|
alarm <<endl<< "================================================="<< endl; |
894 |
|
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
895 |
|
alarm << " - OBT "<< (ULong_t)ph->GetOrbitalTime() << " ms"<<endl; |
896 |
|
alarm << "Total events "<<nevent<<endl; |
897 |
|
alarm << "(ROOT-tree entry "<<ev<<" in page "<<ii+1<<" )"<<endl; |
898 |
|
alarm << "================================================="<< endl; |
899 |
|
|
900 |
|
alarm << " DSPn"; |
901 |
|
alarm << " Counter"; |
902 |
|
alarm << " previous"; |
903 |
|
alarm << " Words"; |
904 |
|
alarm << " crc"; |
905 |
|
alarm << " FC"; |
906 |
|
alarm << " FL1"; |
907 |
|
alarm << " FL2"; |
908 |
|
alarm << " FL3"; |
909 |
|
alarm << " FL4"; |
910 |
|
alarm << " FL5"; |
911 |
|
alarm << " FL6" << endl; |
912 |
|
|
913 |
|
for(Int_t i=0; i<12 ; i++){ |
914 |
|
alarm.width(5); alarm << te->DSPnumber[i]; |
915 |
|
alarm.width(8); alarm << te->eventn[i]; |
916 |
|
alarm.width(8); alarm << eventn[i]; |
917 |
|
alarm.width(6); alarm << te->DATAlength[i]; |
918 |
|
alarm.width(4); alarm << te->crc[i]; |
919 |
|
alarm.width(4); alarm << te->fc[i]; |
920 |
|
alarm.width(4); alarm << te->fl1[i]; |
921 |
|
alarm.width(4); alarm << te->fl2[i]; |
922 |
|
alarm.width(4); alarm << te->fl3[i]; |
923 |
|
alarm.width(4); alarm << te->fl4[i]; |
924 |
|
alarm.width(4); alarm << te->fl5[i]; |
925 |
|
alarm.width(4); alarm << te->fl6[i]; |
926 |
|
if(te->alarm[i]!=0)alarm<<" >> ALARM "; |
927 |
|
if(WARNING[i]!=0)alarm<<" (DSP warning) "; |
928 |
|
alarm << endl; |
929 |
|
} |
930 |
|
} |
931 |
|
for(Int_t i=0; i<12 ; i++) |
932 |
|
eventn[i]=te->eventn[i]; |
933 |
|
} |
934 |
|
} |
935 |
|
if(al==0) alarm << endl<< "Page "<<ii+1<< ": ------> NO ALARM!!! <-------"<<endl; |
936 |
|
if(maxev==maxevent-1) { |
937 |
|
if(countALARMy!=0){ |
938 |
|
if(countALARMy%6!=0) alarm << endl<<endl<< "***** "<<countALARMy/6+1 <<" events with hardware alarm in Y-view *****"<<endl; |
939 |
|
else alarm << endl<<endl<< "***** "<<countALARMy/6 <<" events with hardware alarm in Y-view *****"<<endl; |
940 |
|
} |
941 |
|
if(countALARMx!=0){ |
942 |
|
if(countALARMx%6!=0) alarm << endl<<endl<< "***** "<<countALARMx/6+1 <<" events with hardware alarm in X-view *****"<<endl; |
943 |
|
else alarm << endl<<endl<< "***** "<<countALARMx/6 <<" events with hardware alarm in X-view *****"<<endl; |
944 |
|
} |
945 |
|
for(int p=0; p<12; p++){ |
946 |
|
if(countFC[p]!=0) alarm << endl<<endl<< "***** "<<countFC[p] <<" events with fc!=0 in DSP "<<p+1<<" *****"<<endl; |
947 |
|
if(countFL1[p]!=0) alarm << endl<<endl<< "***** "<<countFL1[p] <<" events with fl1!=0 in DSP "<<p+1<<" *****"<<endl; |
948 |
|
if(countFL2[p]!=0) alarm << endl<<endl<< "***** "<<countFL2[p] <<" events with fl2!=0 in DSP "<<p+1<<" *****"<<endl; |
949 |
|
if(countFL3[p]!=0) alarm << endl<<endl<< "***** "<<countFL3[p] <<" events with fl3!=0 in DSP "<<p+1<<" *****"<<endl; |
950 |
|
if(countFL4[p]!=0) alarm << endl<<endl<< "***** "<<countFL4[p] <<" events with fl4!=0 in DSP "<<p+1<<" *****"<<endl; |
951 |
|
if(countFL5[p]!=0) alarm << endl<<endl<< "***** "<<countFL5[p] <<" events with fl5!=0 in DSP "<<p+1<<" *****"<<endl; |
952 |
|
if(countFL6[p]!=0) alarm << endl<<endl<< "***** "<<countFL6[p] <<" events with fl6!=0 in DSP "<<p+1<<" *****"<<endl; |
953 |
|
} |
954 |
|
} |
955 |
|
|
956 |
|
// |
957 |
|
// Draw the graphs |
958 |
|
for (Int_t i=0; i<12 ; i++){ |
959 |
|
Double_t yyc[maxev-minev]; |
960 |
|
for (Int_t v=0; v<maxev-minev; v++){ |
961 |
|
yyc[v]=yc[v][i]; |
962 |
|
} |
963 |
|
|
964 |
|
CompTimeCanv[ii]->cd(); |
965 |
|
pad3[i]->SetFillColor(10); |
966 |
|
pad3[i]->SetFrameFillColor(10); |
967 |
|
pad3[i]->Draw(); |
968 |
|
pad3[i]->cd(); |
969 |
|
comprtime[i][ii]= new TGraph(maxev-minev,x,yyc); |
970 |
|
oss1<<"DSP "<<i+1; |
971 |
|
comprtime[i][ii]->SetTitle(oss1.str().c_str()); |
972 |
|
comprtime[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
973 |
|
comprtime[i][ii]->GetXaxis()->CenterTitle(); |
974 |
|
comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)"); |
975 |
|
comprtime[i][ii]->GetYaxis()->CenterTitle(); |
976 |
|
if(maxev-minev==1) comprtime[i][ii]->GetXaxis()->SetNdivisions(-501); |
977 |
|
// comprtime[i][ii]->GetYaxis()->SetRangeUser(0,3); |
978 |
|
comprtime[i][ii]->Draw("ap"); |
979 |
|
oss1.str(""); |
980 |
|
CompTimeCanv[ii]->Update(); |
981 |
|
} |
982 |
|
|
983 |
|
|
984 |
|
EventNumCanv[ii]->cd(); |
985 |
|
pt = new TPad("pt"," ",0.02,0.01,1.,0.98,18,0,0); |
986 |
|
pt->SetFillColor(10); |
987 |
|
pt->SetFrameFillColor(10); |
988 |
|
pt->Draw(); |
989 |
|
pt->cd(); |
990 |
|
eventnumb[ii]=new TGraph(maxev-minev,x,eventint); |
991 |
|
eventnumb[ii]->SetTitle(""); |
992 |
|
eventnumb[ii]->GetXaxis()->SetLabelSize(0.02); |
993 |
|
eventnumb[ii]->GetXaxis()->SetTitleSize(0.03); |
994 |
|
eventnumb[ii]->GetXaxis()->SetTitle("OBT (ms)"); |
995 |
|
eventnumb[ii]->GetXaxis()->CenterTitle(); |
996 |
|
eventnumb[ii]->GetXaxis()->SetTickLength(0.01); |
997 |
|
eventnumb[ii]->GetXaxis()->SetTitleOffset(1.1); |
998 |
|
eventnumb[ii]->GetYaxis()->SetLabelSize(0.02); |
999 |
|
eventnumb[ii]->GetYaxis()->SetTitleSize(0.03); |
1000 |
|
eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number"); |
1001 |
|
eventnumb[ii]->GetYaxis()->CenterTitle(); |
1002 |
|
if(maxev-minev==1) eventnumb[ii]->GetXaxis()->SetNdivisions(-501); |
1003 |
|
eventnumb[ii]->GetYaxis()->SetTitleOffset(2.); |
1004 |
|
eventnumb[ii]->SetMarkerStyle(21); |
1005 |
|
eventnumb[ii]->SetMarkerColor(kBlue); |
1006 |
|
eventnumb[ii]->SetMarkerSize(0.2); |
1007 |
|
oss1.str(""); |
1008 |
|
oss1<<"number of events in this graph: "<<maxev-minev; |
1009 |
|
t->SetTextColor(kBlue); |
1010 |
|
t->SetTextSize(0.02); |
1011 |
|
double xtex=0,ytex=0; |
1012 |
|
xtex=x[maxev-minev-1]-(x[maxev-minev-1]-x[0])/3; |
1013 |
|
ytex=1000.+eventnumb[ii]->GetYaxis()->GetXmax(); |
1014 |
|
t->DrawLatex(xtex,ytex,oss1.str().c_str()); |
1015 |
|
oss1.str(""); |
1016 |
|
eventnumb[ii]->Draw("ap"); |
1017 |
|
EventNumCanv[ii]->Update(); |
1018 |
|
|
1019 |
|
minev=maxev; |
1020 |
|
if(maxev==maxevent-1) { |
1021 |
|
cntpgdat=ii+1; |
1022 |
|
break; |
1023 |
|
} |
1024 |
|
|
1025 |
|
} |
1026 |
|
|
1027 |
|
alarm.close(); |
1028 |
|
|
1029 |
//**************************************************************************************** |
//**************************************************************************************** |
1030 |
//Output figures --- Third sheet: |
//Cluster Signal ladder1 Output Pages |
1031 |
//**************************************************************************************** |
//**************************************************************************************** |
1032 |
|
|
1033 |
TCanvas *LandauCanv1=new TCanvas("Landau ladder1","",900,1200); |
fromfile.str(""); |
1034 |
|
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
1035 |
|
isfile<<"Cluster Signal ladder1"; |
1036 |
|
LandauCanv1=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
1037 |
LandauCanv1->SetFillColor(10); |
LandauCanv1->SetFillColor(10); |
1038 |
LandauCanv1->Range(0,0,100,100); |
LandauCanv1->Range(0,0,100,100); |
|
isfile<<"Landau ladder1"; |
|
1039 |
|
|
1040 |
t->SetTextFont(32); |
t->SetTextFont(32); |
1041 |
t->SetTextColor(1); |
t->SetTextColor(1); |
1050 |
isfile.str(""); |
isfile.str(""); |
1051 |
|
|
1052 |
//**************************************************************************************** |
//**************************************************************************************** |
1053 |
//Output figures --- Third sheet: |
//Cluster Signal ladder2 Output Pages |
1054 |
//**************************************************************************************** |
//**************************************************************************************** |
1055 |
|
|
1056 |
TCanvas *LandauCanv2=new TCanvas("Landau ladder2","",900,1200); |
isfile<<"Cluster Signal ladder2"; |
1057 |
|
LandauCanv2=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
1058 |
LandauCanv2->SetFillColor(10); |
LandauCanv2->SetFillColor(10); |
1059 |
LandauCanv2->Range(0,0,100,100); |
LandauCanv2->Range(0,0,100,100); |
|
isfile<<"Landau ladder2"; |
|
1060 |
|
|
1061 |
t->SetTextFont(32); |
t->SetTextFont(32); |
1062 |
t->SetTextColor(1); |
t->SetTextColor(1); |
1071 |
isfile.str(""); |
isfile.str(""); |
1072 |
|
|
1073 |
//**************************************************************************************** |
//**************************************************************************************** |
1074 |
//Output figures --- Third sheet: |
//Cluster Signal ladder3 Output Pages |
1075 |
//**************************************************************************************** |
//**************************************************************************************** |
1076 |
|
|
1077 |
TCanvas *LandauCanv3=new TCanvas("Landau ladder3","",900,1200); |
isfile<<"Cluster Signal ladder3"; |
1078 |
|
LandauCanv3=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
1079 |
LandauCanv3->SetFillColor(10); |
LandauCanv3->SetFillColor(10); |
1080 |
LandauCanv3->Range(0,0,100,100); |
LandauCanv3->Range(0,0,100,100); |
|
isfile<<"Landau ladder3"; |
|
1081 |
|
|
1082 |
t->SetTextFont(32); |
t->SetTextFont(32); |
1083 |
t->SetTextColor(1); |
t->SetTextColor(1); |
1092 |
isfile.str(""); |
isfile.str(""); |
1093 |
|
|
1094 |
//**************************************************************************************** |
//**************************************************************************************** |
1095 |
//Output figures --- Fourth sheet: |
//Lighting of the views Output Pages |
1096 |
//**************************************************************************************** |
//**************************************************************************************** |
1097 |
|
|
1098 |
TCanvas *IlluminaCanv=new TCanvas("Illuminazione","",900,1200); |
isfile<<"lighting of the views"; |
1099 |
|
IlluminaCanv=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
1100 |
IlluminaCanv->SetFillColor(10); |
IlluminaCanv->SetFillColor(10); |
1101 |
IlluminaCanv->Range(0,0,100,100); |
IlluminaCanv->Range(0,0,100,100); |
|
isfile<<"lighting of the views"; |
|
1102 |
t->SetTextFont(32); |
t->SetTextFont(32); |
1103 |
t->SetTextColor(1); |
t->SetTextColor(1); |
1104 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
1110 |
t1->SetTextSize(0.02); |
t1->SetTextSize(0.02); |
1111 |
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
1112 |
isfile.str(""); |
isfile.str(""); |
1113 |
|
|
1114 |
//**************************************************************************************** |
isfile<<"Chips with white line at least once showed anomalous behaviour"; |
1115 |
//Output figures --- Fifth sheet: |
t->SetTextColor(17); |
1116 |
//**************************************************************************************** |
t->SetTextSize(0.018); |
1117 |
|
t->DrawLatex(.01,.96,isfile.str().c_str()); |
|
TCanvas *TempCanv=new TCanvas("Tracker_Detector_Temperaturt","",900,1200); |
|
|
TempCanv->SetFillColor(10); |
|
|
TempCanv->Range(0,0,100,100); |
|
|
isfile<<"Temperatures vs OBT"; |
|
|
|
|
|
t->SetTextFont(32); |
|
|
t->SetTextColor(1); |
|
|
t->SetTextAlign(12); |
|
|
t->SetTextSize(0.02); |
|
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
|
|
t1->SetTextFont(32); |
|
|
t1->SetTextColor(1); |
|
|
t1->SetTextAlign(12); |
|
|
t1->SetTextSize(0.02); |
|
|
t1->DrawLatex(80.,98.7,isfile.str().c_str()); |
|
1118 |
isfile.str(""); |
isfile.str(""); |
1119 |
|
|
1120 |
//************************************************************************************* |
isfile<<"Boxes so colored point out anomalous chips (not necessarily broken)"; |
1121 |
//book pads and histos |
t->SetTextColor(107); |
1122 |
//*************************************************************************************** |
// t->DrawLatex(7.,95.7,isfile.str().c_str()); |
1123 |
|
isfile.str(""); |
1124 |
TPad *pad1[12],*pad2[12],*pad3[12],*pad4[12],*pad5[12],*pad6[5]; //pad for histos |
t->SetTextColor(1); |
|
Double_t posy = 0.95; // up y-coord - top pads |
|
|
Double_t hpad = 0; // pad height |
|
|
Double_t posx1=0; // left x-coord - pad column |
|
|
Double_t posx0=0; // x-coord - column division |
|
|
Double_t wrel = 0; // relative x size of first sub-column |
|
|
Double_t marg = 0.004; // margin among pads |
|
|
Double_t tposy = 0.95; // up y-coord - top pads |
|
|
Double_t thpad = 0; // pad height |
|
|
Double_t tposx1=0; // left x-coord - pad column |
|
|
Double_t tposx0=0; // x-coord - column division |
|
|
Double_t twrel = 0; // relative x size of first sub-column |
|
|
Double_t tmarg = 0.004; // margin among pads |
|
|
|
|
|
hpad = (posy-marg*11)/6; |
|
|
wrel = (1-marg*4)/2; |
|
|
thpad = (tposy-tmarg*5)/3; |
|
|
twrel = (1-tmarg*4)/2; |
|
|
stringstream title; |
|
|
stringstream hid; |
|
|
|
|
|
for(Int_t n = 0; n<12; n++) { |
|
|
|
|
|
if ( (n+1)%2==1 ) { |
|
|
if(n>1) posy = posy-(marg*2+hpad); |
|
|
posx1 = marg; |
|
|
posx0 = posx1 + wrel; |
|
|
} |
|
|
else { |
|
|
posx1 = posx0 + 2*marg; |
|
|
posx0 = posx1 + wrel; |
|
|
} |
|
|
|
|
|
if ( (n+1)%2==1 ) { |
|
|
if(n>1) tposy = tposy-(tmarg*2+thpad); |
|
|
tposx1 = tmarg; |
|
|
tposx0 = tposx1 + twrel; |
|
|
} |
|
|
else { |
|
|
tposx1 = tposx0 + 2*tmarg; |
|
|
tposx0 = tposx1 + twrel; |
|
|
} |
|
|
|
|
|
|
|
|
/* -----------> pad for histograms */ |
|
|
pad1[n] = new TPad("pad1"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
|
|
pad2[n] = new TPad("pad2"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
|
|
pad3[n] = new TPad("pad3"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
|
|
pad4[n] = new TPad("pad4"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
|
|
pad5[n] = new TPad("pad5"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
|
|
if(n<5) pad6[n] = new TPad("pad6"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); |
|
|
|
|
|
|
|
|
/* -----------> HISTOGRAMS */ |
|
|
|
|
|
oss1<<"DSP "<<n+1; |
|
|
oss2<<"DSPh "<<n+1; |
|
|
oss3<<"DSP h "<<n+1; |
|
|
oss4<<"DSP h"<<n+1; |
|
|
|
|
|
landau1[n]=new TH1F(oss1.str().c_str(),oss1.str().c_str(),1200,0.5,1200.5); |
|
|
landau1[n]->GetXaxis()->SetTitle("max signal"); |
|
|
landau1[n]->GetXaxis()->CenterTitle(); |
|
|
landau2[n]=new TH1F(oss2.str().c_str(),oss1.str().c_str(),1200,0.5,1200.5); |
|
|
landau2[n]->GetXaxis()->SetTitle("max signal"); |
|
|
landau2[n]->GetXaxis()->CenterTitle(); |
|
|
landau3[n]=new TH1F(oss3.str().c_str(),oss1.str().c_str(),1200,0.5,1200.5); |
|
|
landau3[n]->GetXaxis()->SetTitle("max signal"); |
|
|
landau3[n]->GetXaxis()->CenterTitle(); |
|
|
|
|
|
illuminazione[n]=new TH1F(oss4.str().c_str(),oss1.str().c_str(),3072,0.5,3072.5); |
|
|
illuminazione[n]->GetXaxis()->SetTitle("strip with max signal"); |
|
|
illuminazione[n]->GetXaxis()->CenterTitle(); |
|
|
|
|
|
oss1.str(""); |
|
|
oss2.str(""); |
|
|
oss3.str(""); |
|
|
oss4.str(""); |
|
|
}; |
|
|
|
|
1125 |
|
|
1126 |
//********************************************************************************** |
// |
1127 |
// Fill Graphs and Histos |
// Draw the histos |
1128 |
//********************************************************************************** |
for (Int_t nn=0; nn<12 ; nn++){ |
1129 |
|
|
1130 |
|
TBox b; |
1131 |
|
|
1132 |
for (Int_t i=0; i<12 ; i++){ |
Float_t maxhist=0.,va1x=0.,minhist=0.; |
|
|
|
|
for (Int_t ev=minevent; ev<maxevent; ev++){ |
|
|
yyc[(ev-minevent)]=yc[12*(ev-minevent)+i]; |
|
|
landau1[i]->Fill(land[12*(ev-minevent)+i][1]); |
|
|
landau2[i]->Fill(land[12*(ev-minevent)+i][2]); |
|
|
landau3[i]->Fill(land[12*(ev-minevent)+i][3]); |
|
|
for(Int_t j=0;j<3;j++){ |
|
|
hi=(j*1024)+illum[12*(ev-minevent)+i][j]; |
|
|
illuminazione[i]->Fill(hi); |
|
|
} |
|
|
} |
|
|
|
|
1133 |
LandauCanv1->cd(); |
LandauCanv1->cd(); |
1134 |
pad1[i]->SetFillColor(10); |
pad1[nn]->SetFillColor(10); |
1135 |
pad1[i]->SetFrameFillColor(10); |
pad1[nn]->SetFrameFillColor(10); |
1136 |
pad1[i]->Draw(); |
pad1[nn]->Draw(); |
1137 |
pad1[i]->cd(); |
pad1[nn]->cd(); |
1138 |
landau1[i]->Draw(""); |
landau1[nn]->GetXaxis()->SetTitle("max signal"); |
1139 |
|
landau1[nn]->GetXaxis()->CenterTitle(); |
1140 |
|
landau1[nn]->Draw(""); |
1141 |
|
LandauCanv1->Update(); |
1142 |
|
|
1143 |
LandauCanv2->cd(); |
LandauCanv2->cd(); |
1144 |
pad4[i]->SetFillColor(10); |
pad4[nn]->SetFillColor(10); |
1145 |
pad4[i]->SetFrameFillColor(10); |
pad4[nn]->SetFrameFillColor(10); |
1146 |
pad4[i]->Draw(); |
pad4[nn]->Draw(); |
1147 |
pad4[i]->cd(); |
pad4[nn]->cd(); |
1148 |
landau2[i]->Draw(""); |
landau2[nn]->GetXaxis()->SetTitle("max signal"); |
1149 |
|
landau2[nn]->GetXaxis()->CenterTitle(); |
1150 |
|
landau2[nn]->Draw(""); |
1151 |
|
LandauCanv2->Update(); |
1152 |
|
|
1153 |
LandauCanv3->cd(); |
LandauCanv3->cd(); |
1154 |
pad5[i]->SetFillColor(10); |
pad5[nn]->SetFillColor(10); |
1155 |
pad5[i]->SetFrameFillColor(10); |
pad5[nn]->SetFrameFillColor(10); |
1156 |
pad5[i]->Draw(); |
pad5[nn]->Draw(); |
1157 |
pad5[i]->cd(); |
pad5[nn]->cd(); |
1158 |
landau3[i]->Draw(""); |
landau3[nn]->GetXaxis()->SetTitle("max signal"); |
1159 |
|
landau3[nn]->GetXaxis()->CenterTitle(); |
1160 |
|
landau3[nn]->Draw(""); |
1161 |
|
LandauCanv3->Update(); |
1162 |
|
|
1163 |
|
|
1164 |
|
li.SetLineColor(38); |
1165 |
|
li.SetLineStyle(4); |
1166 |
|
li.SetLineWidth(2); |
1167 |
|
liva1.SetLineColor(42); |
1168 |
|
liva1.SetLineStyle(3); |
1169 |
|
liva1.SetLineWidth(1); |
1170 |
|
|
1171 |
IlluminaCanv->cd(); |
IlluminaCanv->cd(); |
1172 |
pad2[i]->SetFillColor(10); |
pad2[nn]->SetFillColor(10); |
1173 |
pad2[i]->SetFrameFillColor(10); |
pad2[nn]->SetFrameFillColor(10); |
1174 |
pad2[i]->Draw(); |
pad2[nn]->SetLogy(); |
1175 |
pad2[i]->cd(); |
pad2[nn]->Draw(); |
1176 |
pad2[i]->SetLogy(); |
pad2[nn]->cd(); |
1177 |
illuminazione [i]->SetStats(kFALSE); |
illuminazione[nn]->GetXaxis()->SetTitle("strip with max signal"); |
1178 |
illuminazione[i]->Draw(""); |
illuminazione[nn]->GetXaxis()->CenterTitle(); |
1179 |
|
illuminazione[nn]->Draw(""); |
1180 |
CompTimeCanv->cd(); |
maxhist= illuminazione[nn]->GetMaximum(); |
1181 |
pad3[i]->SetFillColor(10); |
minhist=0.; |
1182 |
pad3[i]->SetFrameFillColor(10); |
b.SetFillColor(19); |
1183 |
pad3[i]->Draw(); |
b.SetFillStyle(3954); |
1184 |
pad3[i]->cd(); |
if(nn==0){ |
1185 |
comprtime= new TGraph(nevent,x,yyc); |
b.DrawBox(0.,minhist,2047.,maxhist); |
1186 |
oss1<<"DSP "<<i+1; |
} |
1187 |
comprtime->SetTitle(oss1.str().c_str()); |
else if(nn==1){ |
1188 |
comprtime->GetXaxis()->SetTitle("OBT (ms)"); |
b.DrawBox(128.,minhist,256.,maxhist); |
1189 |
comprtime->GetXaxis()->CenterTitle(); |
b.DrawBox(384.,minhist,512.,maxhist); |
1190 |
comprtime->GetYaxis()->SetTitle("compressiontime (ms)"); |
b.DrawBox(896.,minhist,1024.,maxhist); |
1191 |
comprtime->GetYaxis()->CenterTitle(); |
b.DrawBox(2048.,minhist,2432.,maxhist); |
1192 |
comprtime->GetYaxis()->SetRangeUser(0,2); |
b.DrawBox(2816.,minhist,2944.,maxhist); |
1193 |
comprtime->Draw("ap"); |
b.DrawBox(2944.,minhist,3070.,maxhist); |
1194 |
oss1.str(""); |
} |
1195 |
}; |
else if(nn==3){ |
1196 |
|
b.DrawBox(0.,minhist,256.,maxhist); |
1197 |
EventNumCanv->cd(); |
b.DrawBox(2816.,minhist,3070.,maxhist); |
1198 |
TPad *pt0=new TPad("pt0"," ",0.704,0.004,0.996,0.98); |
} |
1199 |
pt1 = new TPaveText(0.004,0.004,0.986,0.996); |
else if(nn==4){ |
1200 |
pt = new TPad("pt"," ",0.004,0.004,0.7,0.98,18,0,0); |
b.DrawBox(256.,minhist,512.,maxhist); |
1201 |
pt1->SetFillColor(10); |
b.DrawBox(1792.,minhist,1920.,maxhist); |
1202 |
pt1->ReadFile(out + "warning.txt"); |
b.DrawBox(2816.,minhist,3070.,maxhist); |
1203 |
pt1->SetTextAlign(22); |
} |
1204 |
pt1->SetTextSize(0.035); |
else if(nn==5){ |
1205 |
pt0->SetFillColor(10); |
b.DrawBox(0.,minhist,256.,maxhist); |
1206 |
pt0->SetFrameFillColor(10); |
b.DrawBox(896.,minhist,1024.,maxhist); |
1207 |
pt0->Draw(); |
b.DrawBox(1664.,minhist,1792.,maxhist); |
1208 |
pt0->cd(); |
} |
1209 |
pt1->Draw(); |
else if(nn==6){ |
1210 |
EventNumCanv->cd(); |
b.DrawBox(512.,minhist,768.,maxhist); |
1211 |
pt->SetFillColor(10); |
b.DrawBox(1024.,minhist,1280.,maxhist); |
1212 |
pt->SetFrameFillColor(10); |
b.DrawBox(1280.,minhist,1792.,maxhist); |
1213 |
pt->Draw(); |
b.DrawBox(2560.,minhist,2816.,maxhist); |
1214 |
pt->cd(); |
} |
1215 |
eventnumb=new TGraph(nevent,x,eventint); |
else if(nn==7){ |
1216 |
eventnumb->SetTitle(""); |
b.DrawBox(0.,minhist,1535.,maxhist); |
1217 |
eventnumb->GetXaxis()->SetLabelSize(0.04); |
b.DrawBox(2024.,minhist,2280.,maxhist); |
1218 |
eventnumb->GetXaxis()->SetTitleSize(0.04); |
} |
1219 |
eventnumb->GetXaxis()->SetTitle("OBT (ms)"); |
else if(nn==8){ |
1220 |
eventnumb->GetXaxis()->CenterTitle(); |
b.DrawBox(512.,minhist,768.,maxhist); |
1221 |
eventnumb->GetXaxis()->SetTickLength(0.01); |
} |
1222 |
eventnumb->GetXaxis()->SetTitleOffset(1.2); |
else if(nn==9){ |
1223 |
eventnumb->GetYaxis()->SetLabelSize(0.04); |
b.DrawBox(0.,minhist,128.,maxhist); |
1224 |
eventnumb->GetYaxis()->SetTitleSize(0.04); |
b.DrawBox(256.,minhist,384.,maxhist); |
1225 |
eventnumb->GetYaxis()->SetTitle("DSP event-number"); |
b.DrawBox(512.,minhist,640.,maxhist); |
1226 |
eventnumb->GetYaxis()->CenterTitle(); |
b.DrawBox(896.,minhist,1152.,maxhist); |
1227 |
eventnumb->GetYaxis()->SetTitleOffset(1.5); |
b.DrawBox(1280.,minhist,1535.,maxhist); |
1228 |
eventnumb->SetMarkerStyle(21); |
b.DrawBox(1664.,minhist,1920.,maxhist); |
1229 |
eventnumb->SetMarkerColor(kBlue); |
b.DrawBox(2048.,minhist,2304.,maxhist); |
1230 |
eventnumb->SetMarkerSize(0.3); |
} |
1231 |
eventnumb->Draw("ap"); |
else if(nn==10){ |
1232 |
|
b.DrawBox(0.,minhist,512.,maxhist); |
1233 |
for(Int_t i=0; i<5; i++){ |
b.DrawBox(1024.,minhist,3070.,maxhist); |
1234 |
for (Int_t ev=0; ev<tsize; ev++){ |
} |
1235 |
tempt_tmp[ev]=(Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231); |
else if(nn==11){ |
1236 |
} |
b.DrawBox(0.,minhist,512.,maxhist); |
1237 |
TempCanv->cd(); |
b.DrawBox(768.,minhist,1024.,maxhist); |
1238 |
tit<<"T"<<i+5<<" (magnetic module "<<i+1<<")"; |
b.DrawBox(1536.,minhist,1664.,maxhist); |
1239 |
pad6[i]->SetFillColor(10); |
b.DrawBox(1920.,minhist,2560.,maxhist); |
1240 |
pad6[i]->Draw(); |
b.DrawBox(2816.,minhist,3070.,maxhist); |
1241 |
pad6[i]->cd(); |
} |
1242 |
temp[i]= new TGraph(tsize,xt,tempt_tmp); |
for(int va=1; va<24; va++){ |
1243 |
temp[i]->SetTitle(tit.str().c_str()); |
va1x=128*va; |
1244 |
temp[i]->GetXaxis()->SetLabelSize(0.04); |
liva1.DrawLine(va1x,minhist,va1x,maxhist); |
1245 |
temp[i]->GetXaxis()->SetTitleSize(0.04); |
} |
1246 |
temp[i]->GetXaxis()->SetTitle("OBT (ms)"); |
li.DrawLine(1024.5,minhist,1024.5,maxhist); |
1247 |
temp[i]->GetXaxis()->CenterTitle(); |
li.DrawLine(2048.5,minhist,2048.5,maxhist); |
1248 |
temp[i]->GetXaxis()->SetTitleOffset(0.85); |
IlluminaCanv->Update(); |
|
temp[i]->GetYaxis()->SetTitleOffset(1.2); |
|
|
temp[i]->GetYaxis()->SetLabelOffset(0.001); |
|
|
temp[i]->GetYaxis()->SetLabelSize(0.04); |
|
|
temp[i]->GetYaxis()->SetTitleSize(0.04); |
|
|
temp[i]->GetYaxis()->SetTitle("Temperatures ( ^{o}C)"); |
|
|
temp[i]->GetYaxis()->CenterTitle(); |
|
|
temp[i]->SetMarkerStyle(21); |
|
|
temp[i]->SetMarkerSize(0.2); |
|
|
temp[i]->Draw("ap"); |
|
|
tit.str(""); |
|
1249 |
} |
} |
1250 |
CompTimeCanv->Update(); |
|
|
LandauCanv1->Update(); |
|
|
LandauCanv2->Update(); |
|
|
LandauCanv3->Update(); |
|
|
IlluminaCanv->Update(); |
|
|
TempCanv->Update(); |
|
|
|
|
1251 |
printf("... end of packets. \n"); |
printf("... end of packets. \n"); |
1252 |
|
|
1253 |
//************************************************************************* |
//************************************************************************* |
1254 |
// Save output Files |
// Save output Files |
1255 |
//************************************************************************* |
//************************************************************************* |
1256 |
stringstream out1,out2,out3,command; |
stringstream out1,out2,out3,command; |
1257 |
|
Int_t totpg=0; |
1258 |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
if(cntpgtemp>cntpgdat) totpg=cntpgtemp; |
1259 |
out1.str(""); |
else if(cntpgtemp<=cntpgdat) totpg=cntpgdat; |
1260 |
out2.str(""); |
|
1261 |
out3.str(""); |
for(Int_t fl=0;fl<totpg;fl++){ |
1262 |
|
|
1263 |
out1<<ffile<<"_FTrkQLook_EXPERT.ps("; |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
1264 |
out2<<ffile<<"_FTrkQLook_EXPERT.ps"; |
out1.str(""); |
1265 |
out3<<ffile<<"_FTrkQLook_EXPERT.ps)"; |
out2.str(""); |
1266 |
|
out3.str(""); |
1267 |
CompTimeCanv->Print(out+out1.str().c_str(),"Portrait"); |
|
1268 |
EventNumCanv->Print(out+out2.str().c_str(),"Portrait"); |
out1<<ffile<<"_FTrkQLook_EXPERT.ps("; |
1269 |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
out2<<ffile<<"_FTrkQLook_EXPERT.ps"; |
1270 |
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
out3<<ffile<<"_FTrkQLook_EXPERT.ps)"; |
|
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
|
|
IlluminaCanv->Print(out+out2.str().c_str(),"Portrait"); |
|
|
TempCanv->Print(out+out3.str().c_str(),"Portrait"); |
|
1271 |
|
|
1272 |
if(!strcmp(outfile.Data(),"pdf")){ |
if(totpg==1){ |
1273 |
stringstream com; |
CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
1274 |
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "<<out<<ffile<<"_FTrkQLook_EXPERT.pdf"; |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1275 |
system(com.str().c_str()); |
TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1276 |
printf("\n---> ps file converted in pdf format!\n"); |
BfieldCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1277 |
com.str(""); |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
1278 |
com<<"rm -f "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "; |
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
1279 |
system(com.str().c_str()); |
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
1280 |
printf("---> ps file removed!\n\n"); |
IlluminaCanv->Print(out+out3.str().c_str(),"Portrait"); |
1281 |
com.str(""); |
} |
1282 |
|
else if(totpg>1){ |
1283 |
|
if(fl==0) CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
1284 |
|
if(fl>0 && fl<cntpgdat) CompTimeCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1285 |
|
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1286 |
|
if(fl<cntpgmag) BfieldCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1287 |
|
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
1288 |
|
if(fl==totpg-1){ |
1289 |
|
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
1290 |
|
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
1291 |
|
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
1292 |
|
IlluminaCanv->Print(out+out3.str().c_str(),"Portrait"); |
1293 |
|
} |
1294 |
|
} |
1295 |
} |
} |
1296 |
|
else{ |
1297 |
|
out1.str(""); |
1298 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-CompTime-pag"<<fl+1<<"."<<outfile.Data(); |
1299 |
|
if(fl<cntpgdat) CompTimeCanv[fl]->Print(out+out1.str().c_str()); |
1300 |
|
out1.str(""); |
1301 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-BField-pag"<<fl+1<<"."<<outfile.Data(); |
1302 |
|
if(fl<cntpgmag) BfieldCanv[fl]->Print(out+out1.str().c_str()); |
1303 |
|
out1.str(""); |
1304 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-Temp-pag"<<fl+1<<"."<<outfile.Data(); |
1305 |
|
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out1.str().c_str()); |
1306 |
|
out1.str(""); |
1307 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-EvNum-pag"<<fl+1<<"."<<outfile.Data(); |
1308 |
|
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out1.str().c_str()); |
1309 |
|
if(fl==totpg-1){ |
1310 |
|
out1.str(""); |
1311 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1."<<outfile.Data(); |
1312 |
|
LandauCanv1->Print(out+out1.str().c_str()); |
1313 |
|
out1.str(""); |
1314 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL2."<<outfile.Data(); |
1315 |
|
LandauCanv2->Print(out+out1.str().c_str()); |
1316 |
|
out1.str(""); |
1317 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL3."<<outfile.Data(); |
1318 |
|
LandauCanv3->Print(out+out1.str().c_str()); |
1319 |
|
out1.str(""); |
1320 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-Lighting."<<outfile.Data(); |
1321 |
|
IlluminaCanv->Print(out+out1.str().c_str()); |
1322 |
|
} |
1323 |
|
} |
1324 |
|
} |
1325 |
|
|
1326 |
|
// |
1327 |
|
// Convert ps to pdf if required |
1328 |
|
if(!strcmp(outfile.Data(),"pdf")){ |
1329 |
|
stringstream com; |
1330 |
|
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "<<out<<ffile<<"_FTrkQLook_EXPERT.pdf"; |
1331 |
|
system(com.str().c_str()); |
1332 |
|
printf("\n---> ps file converted in pdf format!\n"); |
1333 |
|
com.str(""); |
1334 |
|
com<<"rm -f "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "; |
1335 |
|
system(com.str().c_str()); |
1336 |
|
printf("---> ps file removed!\n\n"); |
1337 |
|
com.str(""); |
1338 |
} |
} |
|
else{ |
|
|
out1.str(""); |
|
|
out1<<ffile<<"_FTrkQLook_EXPERT-CompTime."<<outfile.Data(); |
|
|
CompTimeCanv->Print(out+out1.str().c_str()); |
|
|
out1.str(""); |
|
|
out1<<ffile<<"_FTrkQLook_EXPERT-Temp."<<outfile.Data(); |
|
|
TempCanv->Print(out+out1.str().c_str()); |
|
|
out1.str(""); |
|
|
out1<<ffile<<"_FTrkQLook_EXPERT-EvNum."<<outfile.Data(); |
|
|
EventNumCanv->Print(out+out1.str().c_str()); |
|
|
out1.str(""); |
|
|
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1."<<outfile.Data(); |
|
|
LandauCanv1->Print(out+out1.str().c_str()); |
|
|
out1.str(""); |
|
|
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL2."<<outfile.Data(); |
|
|
LandauCanv2->Print(out+out1.str().c_str()); |
|
|
out1.str(""); |
|
|
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL3."<<outfile.Data(); |
|
|
LandauCanv3->Print(out+out1.str().c_str()); |
|
|
out1.str(""); |
|
|
out1<<ffile<<"_FTrkQLook_EXPERT-Lighting."<<outfile.Data(); |
|
|
IlluminaCanv->Print(out+out1.str().c_str()); |
|
|
} |
|
|
|
|
|
command.str(""); |
|
|
command<<"rm -f "<<out<<"warning.txt"; |
|
|
system(command.str().c_str()); |
|
1339 |
|
|
1340 |
gROOT->Reset(); |
gROOT->Reset(); |
1341 |
return; |
return; |