1 |
/** |
/** |
2 |
* FTrkQLook_EXPERT |
* FTrkQLook_EXPERT.cxx |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version 2.0 |
* version v1r04 |
6 |
* Parameters: |
* Parameters: |
7 |
* file - the data file to analyze |
* file - the data file to analyze |
8 |
* fromevent - first event to analyze |
* fromevent - first event to analyze |
19 |
#include <TLatex.h> |
#include <TLatex.h> |
20 |
#include <TCanvas.h> |
#include <TCanvas.h> |
21 |
#include <TGraph.h> |
#include <TGraph.h> |
22 |
|
#include <TFile.h> |
23 |
#include <TTree.h> |
#include <TTree.h> |
24 |
#include <TStyle.h> |
#include <TStyle.h> |
25 |
// |
// |
26 |
#include <physics/tracker/TrackerEvent.h> |
#include <physics/tracker/TrackerEvent.h> |
27 |
#include <PscuHeader.h> |
#include <PscuHeader.h> |
28 |
#include <EventHeader.h> |
#include <EventHeader.h> |
29 |
|
#include <RunHeaderEvent.h> |
30 |
#include <TrkAlarmEvent.h> |
#include <TrkAlarmEvent.h> |
31 |
#include <tsbt/TsbTRecord.h> |
#include <tsbt/TsbTRecord.h> |
32 |
#include <tsbt/TsbTEvent.h> |
#include <tsbt/TsbTEvent.h> |
33 |
|
#include <EventCounter.h> |
34 |
|
#include <PacketType.h> |
35 |
// |
// |
36 |
|
#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); |
|
|
}; |
|
|
}; |
|
|
|
|
37 |
|
|
38 |
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) |
39 |
{ |
{ |
40 |
// |
// |
41 |
// obtain information about the data file and select the output dir |
// obtain information about the data file and select the output dir |
42 |
const string filepath=file.Data(); |
const string filepath=file.Data(); |
43 |
Int_t dwpos = filepath.rfind("DW_"); |
Int_t dwpos = file.Last('/'); |
44 |
Int_t dwpos1 = filepath.find(".root"); |
Int_t dwpos1 = file.Last('.'); |
|
TString fpath=(filepath.c_str()); |
|
45 |
TString base,ffile ; |
TString base,ffile ; |
46 |
stringcopy(ffile,fpath,dwpos,dwpos1); |
ffile=file(dwpos+1,dwpos1-(dwpos+1)); |
47 |
stringcopy(base,fpath,0,dwpos); |
if(dwpos>0) base=file(0,dwpos); |
48 |
|
|
49 |
TString out; |
TString out; |
50 |
if(outdir.Length()==0){ |
if(outdir.Length()==0){ |
52 |
}else{ |
}else{ |
53 |
out = outdir; |
out = outdir; |
54 |
} |
} |
55 |
|
if(out.Last('/')+1<out.Length()) out+="/"; |
56 |
|
|
57 |
// |
// |
58 |
// inizialise the variables and open the file |
// inizialise the variables and open the file |
59 |
pamela::TsbTEvent *event = 0; |
pamela::TsbTEvent *event = 0; |
60 |
pamela::TsbTRecord *record = 0; |
pamela::TsbTRecord *record = 0; |
61 |
pamela::tracker::TrackerEvent *te=0; |
pamela::tracker::TrackerEvent *te=0; |
62 |
pamela::EventHeader *eh=0,*aleh=0; |
pamela::EventHeader *eh=0,*aleh=0,*eH=0,*eT=0; |
63 |
pamela::PscuHeader *ph=0; |
pamela::PscuHeader *ph=0,*pH=0; |
64 |
pamela::TrkAlarmEvent *al=0; |
pamela::TrkAlarmEvent *al=0; |
65 |
|
pamela::RunHeaderEvent *reh=0; |
66 |
|
pamela::EventCounter *cod=0; |
67 |
|
|
68 |
|
pamela::PacketType *pctp=0; |
69 |
|
|
70 |
TFile *datafile = new TFile(file); |
TFile *datafile = new TFile(file); |
71 |
|
if ( !datafile ){ |
72 |
|
printf("No data file, exiting...\n"); |
73 |
|
return; |
74 |
|
} |
75 |
|
|
76 |
TTree *tree = (TTree*)datafile->Get("TsbT"); |
TTree *tree = (TTree*)datafile->Get("TsbT"); |
77 |
tree->SetBranchAddress("TsbT",&event); |
tree->SetBranchAddress("TsbT",&event); |
78 |
|
tree->SetBranchAddress("Header",&eT); |
79 |
|
|
80 |
TTree *altr = (TTree*)datafile->Get("TrkAlarm"); |
TTree *altr = (TTree*)datafile->Get("TrkAlarm"); |
81 |
altr->SetBranchAddress("TrkAlarm",&al); |
altr->SetBranchAddress("TrkAlarm",&al); |
85 |
tr->SetBranchAddress("Tracker",&te); |
tr->SetBranchAddress("Tracker",&te); |
86 |
tr->SetBranchAddress("Header",&eh); |
tr->SetBranchAddress("Header",&eh); |
87 |
|
|
88 |
|
TTree *otr = (TTree*)datafile->Get("RunHeader"); |
89 |
|
otr->SetBranchAddress("Header",&eH); |
90 |
|
otr->SetBranchAddress("RunHeader",&reh); |
91 |
|
|
92 |
Long64_t nevent = tr->GetEntries(); |
Long64_t nevent = tr->GetEntries(); |
93 |
|
Long64_t neventH = otr->GetEntries(); |
94 |
Long64_t tnevent = tree->GetEntries(); |
Long64_t tnevent = tree->GetEntries(); |
95 |
Long64_t alnevent = altr->GetEntries(); |
Long64_t alnevent = altr->GetEntries(); |
96 |
Int_t minevent=0; |
Int_t minevent=0; |
97 |
Int_t maxevent=0; |
Int_t maxevent=0; |
98 |
|
|
99 |
printf("Number of total events: %lld\n",nevent); |
printf("Number of total events: %lld\n",nevent); |
100 |
|
printf("Number of header events: %lld\n",neventH); |
101 |
|
printf("Number of TsbT events: %lld\n",tnevent); |
102 |
|
printf("Number of TrkAlarm packet events: %lld\n",alnevent); |
103 |
|
|
104 |
if (nevent<=0){ |
if (nevent<=0){ |
105 |
datafile->Close(); |
datafile->Close(); |
132 |
nevent=maxevent-minevent ; |
nevent=maxevent-minevent ; |
133 |
} |
} |
134 |
|
|
135 |
|
// |
136 |
if (fromevent!=0) |
// information about the RunHeader |
137 |
printf("\n Scan of events from %i to %i ... \n",minevent,maxevent-1); |
ULong64_t HOBT[neventH]; |
138 |
else |
Int_t trk_cal_us[neventH]; |
139 |
printf("\n Scan of events from %i to %i ... \n",minevent+1,maxevent); |
for (Int_t vi=0; vi<neventH;vi++){ |
140 |
|
HOBT[vi]=0; |
141 |
|
trk_cal_us[vi]=0; |
142 |
|
} |
143 |
|
for (Int_t ev=0; ev<neventH; ev++){ |
144 |
|
otr->GetEntry(ev); |
145 |
|
pH = eH->GetPscuHeader(); |
146 |
|
HOBT[ev]= pH->GetOrbitalTime(); |
147 |
|
trk_cal_us[ev]=reh->TRK_CALIB_USED; |
148 |
|
} |
149 |
|
|
150 |
// |
// |
151 |
// other variables definitions |
// other variables definitions |
152 |
stringstream oss1,oss2,oss3,oss4,fromfile,isfile,tit; |
stringstream oss1,oss2,oss3,oss4,fromfile,isfile,tit; |
|
Int_t warning_dspnumber=0; |
|
153 |
Int_t ALARM=0; |
Int_t ALARM=0; |
154 |
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]; |
|
155 |
|
|
|
TGraph *comprtime,*temp[5]; |
|
|
TGraph *eventnumb; |
|
|
TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; |
|
|
TPaveText *pt1; |
|
|
TPad *pt; |
|
|
|
|
156 |
// |
// |
157 |
// information about the entries for the temperatures |
// information about the entries for the temperatures |
158 |
Int_t tmpSize=0,siztmp=0,maxsize=0; |
Int_t tmpSize=0,siztmp=0,maxsize=0; |
163 |
} |
} |
164 |
const Int_t tsize=maxsize; |
const Int_t tsize=maxsize; |
165 |
Int_t tempt[tsize][5],xt[tsize], tempt_tmp[tsize]; |
Int_t tempt[tsize][5],xt[tsize], tempt_tmp[tsize]; |
166 |
|
Int_t countnboot=1; |
167 |
|
// |
168 |
|
// information about the temperatures |
169 |
|
for (Int_t ev=0; ev<tnevent; ev++){ |
170 |
|
tree->GetEntry(ev); |
171 |
|
tmpSize = event->Records->GetEntries(); |
172 |
|
for (Int_t j = 0; j < tmpSize; j++){ |
173 |
|
record = (pamela::TsbTRecord*)event->Records->At(j); |
174 |
|
xt[siztmp]=record->RECORD_OBT; |
175 |
|
if((xt[siztmp]<xt[siztmp-1]) && siztmp>0) |
176 |
|
countnboot+=1; |
177 |
|
|
178 |
|
for (Int_t z = 0; z < 5; z++){ |
179 |
|
tempt[siztmp][z] = record->TEMPERATURES[z+1]; |
180 |
|
} |
181 |
|
siztmp++; |
182 |
|
} |
183 |
|
} |
184 |
|
countnboot+=2*(Int_t)nevent/MAXSTORAGE; |
185 |
|
// printf("\ncountnboot=%d\n",countnboot); |
186 |
|
|
187 |
// |
// |
188 |
// open the output text files for the alarms |
// open the output text files for the alarms |
189 |
ofstream warning(out + "warning.txt",ios::out); |
TString fname1 = out+ffile; |
190 |
TString fname = out+ffile; |
TString fname = out+ffile; |
|
TString fname1 = out+ffile; |
|
191 |
int slen=fname.Length(); |
int slen=fname.Length(); |
192 |
int last=fname.Last('_'); |
int last=fname.Last('_'); |
193 |
if(last<(slen-1))fname.Append('_'); |
if(last<(slen-1))fname.Append('_'); |
194 |
fname.Append("Trk-ALARM-report.txt"); |
fname.Append("FTrk-DSP-report.txt"); |
195 |
ofstream alarm(fname,ios::out); |
ofstream alarm(fname,ios::out); |
196 |
alarm << "TRACKER ALARM REPORT - Downlink " << ffile<< endl; |
alarm << "TRACKER DSP REPORT - Downlink " << ffile<< endl; |
197 |
fname1.Append("_TrkAlarm-pkt-report.txt"); |
fname1.Append("_FTrkAlarm-pkt-report.txt"); |
198 |
ofstream alarm1(fname1,ios::out); |
ofstream alarm1(fname1,ios::out); |
199 |
alarm1 << "TrkAlarm pkt REPORT - Downlink " << ffile<< endl; |
alarm1 << "TrkAlarm pkt REPORT - Downlink " << ffile<< endl; |
200 |
|
|
202 |
// write the file for the TrkAlarm packet |
// write the file for the TrkAlarm packet |
203 |
if(alnevent==0) alarm1 <<endl<< "------> NO ALARM!!! <-------"<< endl; |
if(alnevent==0) alarm1 <<endl<< "------> NO ALARM!!! <-------"<< endl; |
204 |
else{ |
else{ |
205 |
|
Long64_t obt=0; |
206 |
for (Int_t ev=0; ev<alnevent; ev++){ |
for (Int_t ev=0; ev<alnevent; ev++){ |
207 |
altr->GetEntry(ev); |
altr->GetEntry(ev); |
208 |
ph = aleh->GetPscuHeader(); |
ph = aleh->GetPscuHeader(); |
209 |
|
|
210 |
|
if(ph->GetOrbitalTime()<obt && ev>0) |
211 |
|
alarm1<<endl<<"NEW CPU BOOT"<<endl; |
212 |
|
obt=ph->GetOrbitalTime(); |
213 |
|
|
214 |
alarm1 << "================================================="<< endl; |
alarm1 << "================================================="<< endl; |
215 |
alarm1 << "PSCU-Pkt N. "<< ph->GetCounter() ; |
alarm1 << "PSCU-Pkt N. "<< ph->GetCounter() ; |
216 |
alarm1 << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
alarm1 << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
217 |
alarm1 << "(ROOT-tree entry "<<ev<<")"<<endl; |
alarm1 << "(ROOT-tree entry "<<ev<<")"<<endl; |
218 |
alarm1 << "================================================="<< endl; |
alarm1 << "================================================="<< endl<<endl; |
219 |
|
|
220 |
alarm1 << " ALARM[1]= "<<(Int_t)al->ALARM[1]<<endl; |
alarm1 << "Alarm variables (range 0-1)"<<endl; |
221 |
alarm1 << " ALARM[2]= "<<(Int_t)al->ALARM[2]<<endl; |
alarm1 << " ALARM[1]= 0x"<< hex << (Int_t)al->ALARM[1]<<endl; |
222 |
alarm1 << " Aswr= "<<(Int_t)al->Aswr<<endl; |
alarm1 << " ALARM[2]= 0x"<< (Int_t)al->ALARM[2]<<endl; |
223 |
alarm1 << " BID[1]= "<<(Int_t)al->BID[0]<<endl; |
alarm1 << " CmdDuringTrig= 0x"<< (Int_t)al->CmdDuringTrig<<endl; |
224 |
alarm1 << " BID[2]= "<<(Int_t)al->BID[1]<<endl; |
alarm1 << " FinalCheck= 0x"<< (Int_t)al->FinalCheck<<endl; |
225 |
alarm1 << " BID[3]= "<<(Int_t)al->BID[2]<<endl; |
alarm1 << " FlashData= 0x"<< (Int_t)al->FlashData<<endl; |
226 |
alarm1 << " BID[4]= "<<(Int_t)al->BID[3]<<endl; |
alarm1 << " FlashShutdown= 0x"<< (Int_t)al->FlashShutdown<<endl; |
227 |
alarm1 << " BID[5]= "<<(Int_t)al->BID[4]<<endl; |
alarm1 << " FlashUpset= 0x"<< (Int_t)al->FlashUpset<<endl; |
228 |
alarm1 << " BID[6]= "<<(Int_t)al->BID[5]<<endl; |
alarm1 << " InterCheck= 0x"<< (Int_t)al->InterCheck<<endl; |
229 |
alarm1 << " BID[7]= "<<(Int_t)al->BID[6]<<endl; |
alarm1 << " UnknownCmd= 0x"<<(Int_t)al->UnknownCmd<<endl<<endl; |
230 |
alarm1 << " CmdDuringTrig= "<<(Int_t)al->CmdDuringTrig<<endl; |
|
231 |
alarm1 << " CmdIDMA= "<<(Int_t)al->CmdIDMA<<endl; |
alarm1 << "Alarm variables (range 0-3F)"<<endl; |
232 |
alarm1 << " CmdNum= "<<(Int_t)al->CmdNum<<endl; |
alarm1 << " CmdIDMA= 0x"<< (Int_t)al->CmdIDMA<<endl; |
233 |
alarm1 << " DSPBusy= "<<(Int_t)al->DSPBusy<<endl; |
alarm1 << " DSPSoft= 0x"<< (Int_t)al->DSPSoft<<endl; |
234 |
alarm1 << " DSPMask= "<<(Int_t)al->DSPMask<<endl; |
alarm1 << " TrigIDMA= 0x"<< (Int_t)al->TrigIDMA<<endl<<endl; |
|
alarm1 << " DSPSoft= "<<(Int_t)al->DSPSoft<<endl; |
|
|
alarm1 << " FinalCheck= "<<(Int_t)al->FinalCheck<<endl; |
|
|
alarm1 << " FlashData= "<<(Int_t)al->FlashData<<endl; |
|
|
alarm1 << " FlashOn= "<<(Int_t)al->FlashOn<<endl; |
|
|
alarm1 << " FlashShutdown= "<<(Int_t)al->FlashShutdown<<endl; |
|
|
alarm1 << " FlashUpset= "<<(Int_t)al->FlashUpset<<endl; |
|
|
alarm1 << " InterCheck= "<<(Int_t)al->InterCheck<<endl; |
|
|
alarm1 << " PNum= "<<(Int_t)al->PNum<<endl; |
|
|
alarm1 << " TrigIDMA= "<<(Int_t)al->TrigIDMA<<endl; |
|
|
alarm1 << " TrigMask= "<<(Int_t)al->TrigMask<<endl; |
|
|
alarm1 << " UnknownCmd= "<<(Int_t)al->UnknownCmd<<endl; |
|
|
} |
|
|
} |
|
|
|
|
|
//*************************************************************************************** |
|
|
// LOOP on each event |
|
|
//*************************************************************************************** |
|
|
|
|
|
// |
|
|
// information about the temperatures |
|
|
for (Int_t ev=0; ev<tnevent; ev++){ |
|
|
tree->GetEntry(ev); |
|
|
tmpSize = event->Records->GetEntries(); |
|
|
for (Int_t j = 0; j < tmpSize; j++){ |
|
|
record = (pamela::TsbTRecord*)event->Records->At(j); |
|
|
xt[siztmp]=record->RECORD_OBT; //0.051*record->RECORD_OBT; |
|
|
for (Int_t z = 0; z < 5; z++){ |
|
|
tempt[siztmp][z] = record->TEMPERATURES[z+1]; |
|
|
} |
|
|
siztmp++; |
|
|
} |
|
|
} |
|
|
|
|
|
// |
|
|
// information about the tracker data |
|
|
for (Int_t ev=minevent; ev<maxevent; ev++){ |
|
|
tr->GetEntry(ev); |
|
|
ph = eh->GetPscuHeader(); |
|
|
dsp=0; |
|
|
ALARM=0; |
|
|
for(Int_t i=0; i<12; i++){ |
|
|
dsp=te->DSPnumber[i]-1; |
|
|
yd[(ev-minevent)*12+dsp]= te->DATAlength[i]; |
|
|
yc[(ev-minevent)*12+dsp]= 0.051*te->compressiontime[i]; |
|
|
for(Int_t j=0;j<3;j++){ |
|
|
illum[(ev-minevent)*12+dsp][j]=te->addrcluster[i][j]; |
|
|
if(!(dsp%2)&&(te->signcluster[i][j])!=0) |
|
|
land[(ev-minevent)*12+dsp][j]=1024-(te->signcluster[i][j]); |
|
|
else land[(ev-minevent)*12+dsp][j]=te->signcluster[i][j]; |
|
|
} |
|
|
x[(ev-minevent)]= ph->GetOrbitalTime(); |
|
|
|
|
|
WARNING[i]=0; |
|
|
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){ |
|
|
ALARM = 1; //general alarm |
|
|
WARNING[i] = 1; // DSP warning |
|
|
}; |
|
|
|
|
|
if(te->alarm[i]!=0){ // hardware alarm |
|
|
ALARM = 1; |
|
|
}; |
|
235 |
|
|
236 |
//************************************************************************************** |
alarm1 << "Control variables (range 0-3F)"<<endl; |
237 |
// warning for internal number |
alarm1 << " DSPBusy= 0x"<< (Int_t)al->DSPBusy<<endl; |
238 |
//************************************************************************************** |
alarm1 << " DSPMask= 0x"<< (Int_t)al->DSPMask<<endl<<endl; |
239 |
if(i<=10){ |
|
240 |
if(te->eventn[i]!=te->eventn[i+1]){ |
alarm1 << "Control variables (range 0-1)"<<endl; |
241 |
warning_dspnumber++; |
alarm1 << " FlashOn= 0x"<< (Int_t)al->FlashOn<<endl<<endl; |
242 |
warning<< "==> WARNING!! Check entry "<< ev<<" (DSP "<<dsp<<")" <<endl<< |
|
243 |
"eventn["<<i<<"]= "<<te->eventn[i]<<"!= eventn["<<i+1<<"]= "<< te->eventn[i+1]<<endl; |
alarm1 << "Control variables (range 0-3)"<<endl; |
244 |
} |
alarm1 << " TrigMask= 0x"<< (Int_t)al->TrigMask<<endl<<endl; |
245 |
else |
|
246 |
eventint[(ev-minevent)]=te->eventn[0]; |
alarm1 << "Control bits fixed"<<endl; |
247 |
} |
alarm1 << " Aswr= 0x"<< (Int_t)al->Aswr<<endl; |
248 |
} |
alarm1 << " BID[1]= 0x"<< (Int_t)al->BID[0]<<endl; |
249 |
|
alarm1 << " BID[2]= 0x"<< (Int_t)al->BID[1]<<endl; |
250 |
|
alarm1 << " BID[3]= 0x"<< (Int_t)al->BID[2]<<endl; |
251 |
|
alarm1 << " BID[4]= 0x"<< (Int_t)al->BID[3]<<endl; |
252 |
|
alarm1 << " BID[5]= 0x"<< (Int_t)al->BID[4]<<endl; |
253 |
|
alarm1 << " BID[6]= 0x"<< (Int_t)al->BID[5]<<endl; |
254 |
|
alarm1 << " BID[7]= 0x"<< (Int_t)al->BID[6]<<endl; |
255 |
|
alarm1 << " CmdNum= 0x"<< (Int_t)al->CmdNum<<endl; |
256 |
|
alarm1 << " PNum= 0x"<< (Int_t)al->PNum<< dec <<endl; |
257 |
|
|
258 |
if(ev<=maxevent-1){ |
alarm1 << "================================================="<< endl<<endl; |
|
|
|
|
if((ev-minevent)>=1 && eventint[(ev-minevent)]!=eventint[(ev-minevent)-1]+1 && eventint[(ev-minevent)]!=1){ |
|
|
warning_dspnumber++; |
|
|
warning<< "==> WARNING!! Check entry "<< ev<<endl<< |
|
|
" DSP event num.= "<< eventint[(ev-minevent)]<< |
|
|
" is different from (previus+1) ="<<eventint[(ev-minevent)-1]+1 <<"\n"<<endl; |
|
|
} |
|
|
}; |
|
259 |
|
|
|
//******************************************************************************************** |
|
|
// file ALARM |
|
|
//******************************************************************************************** |
|
|
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; |
|
|
|
|
|
alarm << " DSPn"; |
|
|
alarm << " Event"; |
|
|
alarm << " Words"; |
|
|
alarm << " crc"; |
|
|
alarm << " FC"; |
|
|
alarm << " FL1"; |
|
|
alarm << " FL2"; |
|
|
alarm << " FL3"; |
|
|
alarm << " FL4"; |
|
|
alarm << " FL5"; |
|
|
alarm << " FL6" << endl; |
|
|
|
|
|
for(Int_t i=0; i<12 ; i++){ |
|
|
alarm.width(5); alarm << te->DSPnumber[i]; |
|
|
alarm.width(6); alarm << te->eventn[i]; |
|
|
alarm.width(6); alarm << te->DATAlength[i]; |
|
|
alarm.width(4); alarm << te->crc[i]; |
|
|
alarm.width(4); alarm << te->fc[i]; |
|
|
alarm.width(4); alarm << te->fl1[i]; |
|
|
alarm.width(4); alarm << te->fl2[i]; |
|
|
alarm.width(4); alarm << te->fl3[i]; |
|
|
alarm.width(4); alarm << te->fl4[i]; |
|
|
alarm.width(4); alarm << te->fl5[i]; |
|
|
alarm.width(4); alarm << te->fl6[i]; |
|
|
if(te->alarm[i]!=0)alarm<<" >> ALARM "; |
|
|
if(WARNING[i]!=0)alarm<<" (DSP warning) "; |
|
|
alarm << endl; |
|
|
} |
|
260 |
} |
} |
261 |
} |
} |
|
if(ALARM==0) alarm << endl<< "------> NO ALARM!!! <-------"<<endl; |
|
|
|
|
|
if(warning_dspnumber==0) warning<<"NONE"<<endl; |
|
|
|
|
|
//***************************************** |
|
|
//close all files |
|
|
//***************************************** |
|
|
warning.close(); |
|
|
alarm.close(); |
|
|
datafile->Close(); |
|
|
|
|
262 |
|
|
263 |
|
// |
264 |
|
// Set Style options |
265 |
gStyle->SetLabelSize(0.05,"x"); |
gStyle->SetLabelSize(0.05,"x"); |
266 |
gStyle->SetLabelSize(0.06,"y"); |
gStyle->SetLabelSize(0.06,"y"); |
267 |
gStyle->SetStatFontSize(0.075); |
gStyle->SetStatFontSize(0.075); |
268 |
gStyle->SetOptStat(1110); |
gStyle->SetOptStat(1110); |
269 |
gStyle->SetFillColor(10); |
gStyle->SetFillColor(10); |
270 |
|
gStyle->SetStatColor(10); |
271 |
gStyle->SetTitleFillColor(10); |
gStyle->SetTitleFillColor(10); |
272 |
gStyle->SetTitleFontSize(0.1); |
gStyle->SetTitleFontSize(0.1); |
273 |
gStyle->SetTitleOffset(0.8,"y"); |
gStyle->SetTitleOffset(0.8,"y"); |
275 |
gStyle->SetTitleSize(0.06,"y"); |
gStyle->SetTitleSize(0.06,"y"); |
276 |
gStyle->SetTitleSize(0.055,"x"); |
gStyle->SetTitleSize(0.055,"x"); |
277 |
|
|
278 |
//**************************************************************************************** |
// |
279 |
//Output figures --- First sheet: |
// Define output canvas, histos and graphs |
280 |
//**************************************************************************************** |
TCanvas *CompTimeCanv[countnboot],*EventNumCanv[countnboot],*TempCanv[countnboot]; |
281 |
|
TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3; |
282 |
|
|
283 |
|
TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; |
284 |
|
TGraph *comprtime[12][countnboot],*temp[5][countnboot],*eventnumb[countnboot]; |
285 |
|
TPad *pad1[12],*pad2[12],*pad3[12],*pad4[12],*pad5[12],*pad6[5]; |
286 |
|
|
287 |
|
for(Int_t n = 0; n<12; n++) { |
288 |
|
|
289 |
|
/* -----------> HISTOGRAMS */ |
290 |
|
|
291 |
|
tit<<"DSP "<<n+1; |
292 |
|
oss1<<"DSP "<<n+1; |
293 |
|
oss2<<"DSPh "<<n+1; |
294 |
|
oss3<<"DSP h "<<n+1; |
295 |
|
oss4<<"DSP h"<<n+1; |
296 |
|
|
297 |
|
landau1[n]= new TH1F(oss1.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
298 |
|
landau2[n]= new TH1F(oss2.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
299 |
|
landau3[n]= new TH1F(oss3.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); |
300 |
|
|
301 |
|
illuminazione[n]= new TH1F(oss4.str().c_str(),tit.str().c_str(),3073,-0.5,3072.5); |
302 |
|
|
303 |
|
tit.str(""); |
304 |
|
oss1.str(""); |
305 |
|
oss2.str(""); |
306 |
|
oss3.str(""); |
307 |
|
oss4.str(""); |
308 |
|
}; |
309 |
|
|
310 |
|
|
311 |
|
//*************************************************************************************** |
312 |
|
// LOOP on each event |
313 |
|
//*************************************************************************************** |
314 |
|
|
315 |
|
if (fromevent!=0) |
316 |
|
printf("\n Scan of events from %i to %i ... \n",minevent,maxevent-1); |
317 |
|
else |
318 |
|
printf("\n Scan of events from %i to %i ... \n",minevent+1,maxevent); |
319 |
|
|
|
TCanvas *CompTimeCanv=new TCanvas("Tracker_Detector_Report_4/6","",900,1200); |
|
|
CompTimeCanv->SetFillColor(10); |
|
|
CompTimeCanv->Range(0,0,100,100); |
|
|
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
|
|
isfile<<"COMPRESSIONTIME vs. OBT"; |
|
320 |
TLatex *t=new TLatex(); |
TLatex *t=new TLatex(); |
|
t->SetTextFont(32); |
|
|
t->SetTextColor(1); |
|
|
t->SetTextAlign(12); |
|
|
t->SetTextSize(0.02); |
|
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
|
321 |
TLatex *t1=new TLatex(); |
TLatex *t1=new TLatex(); |
|
t1->SetTextFont(32); |
|
|
t1->SetTextColor(1); |
|
|
t1->SetTextAlign(12); |
|
|
t1->SetTextSize(0.02); |
|
|
t1->DrawLatex(64.,98.7,isfile.str().c_str()); |
|
|
isfile.str(""); |
|
322 |
|
|
323 |
//**************************************************************************************** |
Int_t cntpgtemp=0,cntpgdat=0; |
324 |
//Output figures --- Second sheet: |
Int_t minev=minevent,maxev=maxevent,countTEMP=0; |
|
//**************************************************************************************** |
|
325 |
|
|
326 |
TCanvas *EventNumCanv=new TCanvas("Tracker_Detector_Report_5/6","",900,1200); |
// |
327 |
EventNumCanv->SetFillColor(10); |
// Fill temperature graphs |
328 |
EventNumCanv->Range(0,0,100,100); |
for(Int_t ii=0; ii<countnboot;ii++){ |
329 |
isfile<<"WARNINGS on DSP EVENT NUMBER "; |
//**************************************************************************************** |
330 |
t->SetTextFont(32); |
//Temperature Output Pages |
331 |
t->SetTextColor(1); |
//**************************************************************************************** |
332 |
t->SetTextAlign(12); |
fromfile.str(""); |
333 |
t->SetTextSize(0.02); |
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
334 |
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
isfile<<"Temperatures vs OBT pag"<<ii+1; |
335 |
t1->SetTextFont(32); |
TempCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
336 |
t1->SetTextColor(1); |
TempCanv[ii]->SetFillColor(10); |
337 |
t1->SetTextAlign(12); |
TempCanv[ii]->Range(0,0,100,100); |
338 |
t1->SetTextSize(0.02); |
|
339 |
t1->DrawLatex(68.4,98.7,isfile.str().c_str()); |
t->SetTextFont(32); |
340 |
isfile.str(""); |
t->SetTextColor(1); |
341 |
|
t->SetTextAlign(12); |
342 |
|
t->SetTextSize(0.02); |
343 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
344 |
|
t1->SetTextFont(32); |
345 |
|
t1->SetTextColor(1); |
346 |
|
t1->SetTextAlign(12); |
347 |
|
t1->SetTextSize(0.02); |
348 |
|
t1->DrawLatex(78.,98.7,isfile.str().c_str()); |
349 |
|
isfile.str(""); |
350 |
|
|
351 |
|
Float_t tposy = 0.95; // up y-coord - top pads |
352 |
|
Float_t thpad = 0; // pad height |
353 |
|
Float_t tposx1=0; // left x-coord - pad column |
354 |
|
Float_t tposx0=0; // x-coord - column division |
355 |
|
Float_t twrel = 0; // relative x size of first sub-column |
356 |
|
Float_t tmarg = 0.004; // margin among pads |
357 |
|
|
358 |
|
thpad = (tposy-tmarg*5)/3; |
359 |
|
twrel = (1-tmarg*4)/2; |
360 |
|
|
361 |
|
for(Int_t i=0; i<5; i++){ |
362 |
|
if ( (i+1)%2==1 ) { |
363 |
|
if(i>1) tposy = tposy-(tmarg*2+thpad); |
364 |
|
tposx1 = tmarg; |
365 |
|
tposx0 = tposx1 + twrel; |
366 |
|
} |
367 |
|
else { |
368 |
|
tposx1 = tposx0 + 2*tmarg; |
369 |
|
tposx0 = tposx1 + twrel; |
370 |
|
} |
371 |
|
|
372 |
|
/* -----------> pad for histograms */ |
373 |
|
pad6[i] = new TPad("pad6"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); |
374 |
|
|
375 |
|
Int_t v=0,xt_tmp[tsize]; |
376 |
|
for (Int_t ev=countTEMP; ev<tsize; ev++){ |
377 |
|
|
378 |
|
if(ev==tsize-1 && i==4) countTEMP=tsize-1; |
379 |
|
if(xt[ev]<xt[ev-1] && ev>countTEMP){ |
380 |
|
if(i==4) countTEMP=ev; |
381 |
|
break; |
382 |
|
} |
383 |
|
else{ |
384 |
|
if(tempt[ev][i]!=65535){ |
385 |
|
tempt_tmp[v]=(Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231); |
386 |
|
if(tempt_tmp[v]>0) xt_tmp[v++]=xt[ev]; |
387 |
|
} |
388 |
|
} |
389 |
|
} |
390 |
|
TempCanv[ii]->cd(); |
391 |
|
tit<<"T"<<i+5<<" (magnetic module "<<i+1<<")"; |
392 |
|
pad6[i]->SetFillColor(10); |
393 |
|
pad6[i]->Draw(); |
394 |
|
pad6[i]->cd(); |
395 |
|
temp[i][ii]= new TGraph(v,xt_tmp,tempt_tmp); |
396 |
|
temp[i][ii]->SetTitle(tit.str().c_str()); |
397 |
|
temp[i][ii]->GetXaxis()->SetLabelSize(0.04); |
398 |
|
temp[i][ii]->GetXaxis()->SetTitleSize(0.04); |
399 |
|
temp[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
400 |
|
temp[i][ii]->GetXaxis()->CenterTitle(); |
401 |
|
temp[i][ii]->GetXaxis()->SetTitleOffset(0.85); |
402 |
|
temp[i][ii]->GetYaxis()->SetTitleOffset(1.2); |
403 |
|
temp[i][ii]->GetYaxis()->SetLabelOffset(0.001); |
404 |
|
temp[i][ii]->GetYaxis()->SetLabelSize(0.04); |
405 |
|
temp[i][ii]->GetYaxis()->SetTitleSize(0.04); |
406 |
|
temp[i][ii]->GetYaxis()->SetTitle("Temperatures ( ^{o}C)"); |
407 |
|
temp[i][ii]->GetYaxis()->CenterTitle(); |
408 |
|
temp[i][ii]->SetMarkerStyle(21); |
409 |
|
temp[i][ii]->SetMarkerSize(0.2); |
410 |
|
temp[i][ii]->Draw("ap"); |
411 |
|
tit.str(""); |
412 |
|
TempCanv[ii]->Update(); |
413 |
|
|
414 |
|
} |
415 |
|
if(countTEMP==tsize-1){ |
416 |
|
cntpgtemp=ii+1; |
417 |
|
break; |
418 |
|
} |
419 |
|
} |
420 |
|
|
421 |
|
|
422 |
|
// |
423 |
|
// Fill compressiontime and eventnumber graphs and DSP warnings |
424 |
|
for(Int_t ii=0; ii<countnboot;ii++){ |
425 |
|
TPad *pt; //pad for histos |
426 |
|
|
427 |
|
//**************************************************************************************** |
428 |
|
//COMPRESSIONTIME vs. OBT Output Pages |
429 |
|
//**************************************************************************************** |
430 |
|
fromfile.str(""); |
431 |
|
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
432 |
|
isfile<<"COMPRESSIONTIME vs. OBT pag"<<ii+1; |
433 |
|
CompTimeCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
434 |
|
CompTimeCanv[ii]->SetFillColor(10); |
435 |
|
CompTimeCanv[ii]->Range(0,0,100,100); |
436 |
|
t->SetTextFont(32); |
437 |
|
t->SetTextColor(1); |
438 |
|
t->SetTextAlign(12); |
439 |
|
t->SetTextSize(0.02); |
440 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
441 |
|
t1->SetTextFont(32); |
442 |
|
t1->SetTextColor(1); |
443 |
|
t1->SetTextAlign(12); |
444 |
|
t1->SetTextSize(0.02); |
445 |
|
t1->DrawLatex(62.,98.7,isfile.str().c_str()); |
446 |
|
isfile.str(""); |
447 |
|
|
448 |
|
//**************************************************************************************** |
449 |
|
//DSP EVENT NUMBER Output Pages |
450 |
|
//**************************************************************************************** |
451 |
|
|
452 |
|
isfile<<"DSP EVENT NUMBER vs. OBT pag"<<ii+1; |
453 |
|
EventNumCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
454 |
|
EventNumCanv[ii]->SetFillColor(10); |
455 |
|
EventNumCanv[ii]->Range(0,0,100,100); |
456 |
|
t->SetTextFont(32); |
457 |
|
t->SetTextColor(1); |
458 |
|
t->SetTextAlign(12); |
459 |
|
t->SetTextSize(0.02); |
460 |
|
t->DrawLatex(2.,98.7,fromfile.str().c_str()); |
461 |
|
t1->SetTextFont(32); |
462 |
|
t1->SetTextColor(1); |
463 |
|
t1->SetTextAlign(12); |
464 |
|
t1->SetTextSize(0.02); |
465 |
|
t1->DrawLatex(62.,98.7,isfile.str().c_str()); |
466 |
|
isfile.str(""); |
467 |
|
|
468 |
|
Float_t posy = 0.95; // up y-coord - top pads |
469 |
|
Float_t hpad = 0; // pad height |
470 |
|
Float_t posx1=0; // left x-coord - pad column |
471 |
|
Float_t posx0=0; // x-coord - column division |
472 |
|
Float_t wrel = 0; // relative x size of first sub-column |
473 |
|
Float_t marg = 0.004; // margin among pads |
474 |
|
|
475 |
|
hpad = (posy-marg*11)/6; |
476 |
|
wrel = (1-marg*4)/2; |
477 |
|
|
478 |
|
for(Int_t n = 0; n<12; n++) { |
479 |
|
|
480 |
|
if ( (n+1)%2==1 ) { |
481 |
|
if(n>1) posy = posy-(marg*2+hpad); |
482 |
|
posx1 = marg; |
483 |
|
posx0 = posx1 + wrel; |
484 |
|
} |
485 |
|
else { |
486 |
|
posx1 = posx0 + 2*marg; |
487 |
|
posx0 = posx1 + wrel; |
488 |
|
} |
489 |
|
|
490 |
|
/* -----------> pad for histograms */ |
491 |
|
pad1[n] = new TPad("pad1"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
492 |
|
pad2[n] = new TPad("pad2"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
493 |
|
pad3[n] = new TPad("pad3"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
494 |
|
pad4[n] = new TPad("pad4"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
495 |
|
pad5[n] = new TPad("pad5"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
496 |
|
} |
497 |
|
|
498 |
|
// |
499 |
|
// Obtain information about the tracker data |
500 |
|
// and fill graphs and histos |
501 |
|
|
502 |
|
Int_t al=0; |
503 |
|
Float_t x[MAXSTORAGE]; |
504 |
|
Float_t yc[MAXSTORAGE][12]; |
505 |
|
Float_t eventint[MAXSTORAGE]; |
506 |
|
|
507 |
|
for (Int_t ev=minev; ev<maxevent; ev++){ |
508 |
|
tr->GetEntry(ev); |
509 |
|
ph = eh->GetPscuHeader(); |
510 |
|
cod = eh->GetCounter(); |
511 |
|
|
512 |
|
if(ev==maxevent-1) maxev=maxevent-1; |
513 |
|
|
514 |
|
if((ph->GetOrbitalTime()<x[ev-minev-1] && ev-minev!=0) || ev-minev==MAXSTORAGE){ |
515 |
|
maxev=ev; |
516 |
|
break; |
517 |
|
} |
518 |
|
else{ |
519 |
|
x[(ev-minev)]= ph->GetOrbitalTime(); |
520 |
|
ALARM=0; |
521 |
|
|
522 |
|
Int_t dsp=0; |
523 |
|
for(Int_t i=0; i<12; i++){ |
524 |
|
dsp=te->DSPnumber[i]-1; |
525 |
|
yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; |
526 |
|
|
527 |
|
// |
528 |
|
// Fill Cluster Signal and Lighting of the view histos |
529 |
|
for(Int_t j=0;j<3;j++){ |
530 |
|
if(te->signcluster[i][j]!=0){ |
531 |
|
if((te->addrcluster[i][j]>6 && te->addrcluster[i][j]<505) ||(te->addrcluster[i][j]>518 && te->addrcluster[i][j]<1018)){ |
532 |
|
illuminazione[dsp]->Fill((Float_t)((j*1024.)+te->addrcluster[i][j])); |
533 |
|
} |
534 |
|
} |
535 |
|
} |
536 |
|
if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ |
537 |
|
if(!(dsp%2)){ |
538 |
|
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)(1024.-te->signcluster[i][0])); |
539 |
|
if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)(1024.-te->signcluster[i][1])); |
540 |
|
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)(1024.-te->signcluster[i][2])); |
541 |
|
} |
542 |
|
else{ |
543 |
|
if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)te->signcluster[i][0]); |
544 |
|
if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)te->signcluster[i][1]); |
545 |
|
if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)te->signcluster[i][2]); |
546 |
|
} |
547 |
|
} |
548 |
|
|
549 |
|
WARNING[i]=0; |
550 |
|
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){ |
551 |
|
ALARM = 1; //general alarm |
552 |
|
al=1; |
553 |
|
WARNING[i] = 1; // DSP warning |
554 |
|
}; |
555 |
|
|
556 |
|
if(te->alarm[i]!=0){ // hardware alarm |
557 |
|
ALARM = 1; |
558 |
|
al=1; |
559 |
|
}; |
560 |
|
|
561 |
|
//************************************************************************************** |
562 |
|
// warning for internal number |
563 |
|
//************************************************************************************** |
564 |
|
if(i<=10 && te->eventn[i]!=te->eventn[i+1]) ALARM=1; |
565 |
|
} |
566 |
|
eventint[(ev-minev)]=te->eventn[0]; |
567 |
|
if((ev-minev)>=1 && eventint[(ev-minev)]!=eventint[(ev-minev)-1]+1 && eventint[(ev-minev)]!=1) |
568 |
|
ALARM=1; |
569 |
|
|
570 |
|
//******************************************************************************************** |
571 |
|
// file DSP warning |
572 |
|
//******************************************************************************************** |
573 |
|
|
574 |
|
if(ALARM==1) { |
575 |
|
alarm <<endl<< "================================================="<< endl; |
576 |
|
alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; |
577 |
|
alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; |
578 |
|
alarm << "Total events "<<nevent<<endl; |
579 |
|
alarm << "(ROOT-tree entry "<<ev<<" in page "<<ii+1<<" )"<<endl; |
580 |
|
alarm << "================================================="<< endl; |
581 |
|
|
582 |
|
alarm << " DSPn"; |
583 |
|
alarm << " Counter"; |
584 |
|
alarm << " previous"; |
585 |
|
alarm << " Words"; |
586 |
|
alarm << " crc"; |
587 |
|
alarm << " FC"; |
588 |
|
alarm << " FL1"; |
589 |
|
alarm << " FL2"; |
590 |
|
alarm << " FL3"; |
591 |
|
alarm << " FL4"; |
592 |
|
alarm << " FL5"; |
593 |
|
alarm << " FL6" << endl; |
594 |
|
|
595 |
|
for(Int_t i=0; i<12 ; i++){ |
596 |
|
alarm.width(5); alarm << te->DSPnumber[i]; |
597 |
|
alarm.width(8); alarm << te->eventn[i]; |
598 |
|
alarm.width(8); alarm << eventint[(ev-minev)-1]; |
599 |
|
alarm.width(6); alarm << te->DATAlength[i]; |
600 |
|
alarm.width(4); alarm << te->crc[i]; |
601 |
|
alarm.width(4); alarm << te->fc[i]; |
602 |
|
alarm.width(4); alarm << te->fl1[i]; |
603 |
|
alarm.width(4); alarm << te->fl2[i]; |
604 |
|
alarm.width(4); alarm << te->fl3[i]; |
605 |
|
alarm.width(4); alarm << te->fl4[i]; |
606 |
|
alarm.width(4); alarm << te->fl5[i]; |
607 |
|
alarm.width(4); alarm << te->fl6[i]; |
608 |
|
if(te->alarm[i]!=0)alarm<<" >> ALARM "; |
609 |
|
if(WARNING[i]!=0)alarm<<" (DSP warning) "; |
610 |
|
alarm << endl; |
611 |
|
} |
612 |
|
} |
613 |
|
} |
614 |
|
} |
615 |
|
if(al==0) alarm << endl<< "Page "<<ii+1<< ": ------> NO ALARM!!! <-------"<<endl; |
616 |
|
|
617 |
|
// |
618 |
|
// Draw the graphs |
619 |
|
for (Int_t i=0; i<12 ; i++){ |
620 |
|
Float_t yyc[maxev-minev]; |
621 |
|
for (Int_t v=0; v<maxev-minev; v++){ |
622 |
|
yyc[v]=yc[v][i]; |
623 |
|
} |
624 |
|
|
625 |
|
CompTimeCanv[ii]->cd(); |
626 |
|
pad3[i]->SetFillColor(10); |
627 |
|
pad3[i]->SetFrameFillColor(10); |
628 |
|
pad3[i]->Draw(); |
629 |
|
pad3[i]->cd(); |
630 |
|
comprtime[i][ii]= new TGraph(maxev-minev,x,yyc); |
631 |
|
oss1<<"DSP "<<i+1; |
632 |
|
comprtime[i][ii]->SetTitle(oss1.str().c_str()); |
633 |
|
comprtime[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
634 |
|
comprtime[i][ii]->GetXaxis()->CenterTitle(); |
635 |
|
comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)"); |
636 |
|
comprtime[i][ii]->GetYaxis()->CenterTitle(); |
637 |
|
comprtime[i][ii]->GetYaxis()->SetRangeUser(0,3); |
638 |
|
comprtime[i][ii]->Draw("ap"); |
639 |
|
oss1.str(""); |
640 |
|
CompTimeCanv[ii]->Update(); |
641 |
|
} |
642 |
|
|
643 |
|
EventNumCanv[ii]->cd(); |
644 |
|
pt = new TPad("pt"," ",0.02,0.01,1.,0.98,18,0,0); |
645 |
|
pt->SetFillColor(10); |
646 |
|
pt->SetFrameFillColor(10); |
647 |
|
pt->Draw(); |
648 |
|
pt->cd(); |
649 |
|
eventnumb[ii]=new TGraph(maxev-minev,x,eventint); |
650 |
|
eventnumb[ii]->SetTitle(""); |
651 |
|
eventnumb[ii]->GetXaxis()->SetLabelSize(0.02); |
652 |
|
eventnumb[ii]->GetXaxis()->SetTitleSize(0.03); |
653 |
|
eventnumb[ii]->GetXaxis()->SetTitle("OBT (ms)"); |
654 |
|
eventnumb[ii]->GetXaxis()->CenterTitle(); |
655 |
|
eventnumb[ii]->GetXaxis()->SetTickLength(0.01); |
656 |
|
eventnumb[ii]->GetXaxis()->SetTitleOffset(1.1); |
657 |
|
eventnumb[ii]->GetYaxis()->SetLabelSize(0.02); |
658 |
|
eventnumb[ii]->GetYaxis()->SetTitleSize(0.03); |
659 |
|
eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number"); |
660 |
|
eventnumb[ii]->GetYaxis()->CenterTitle(); |
661 |
|
eventnumb[ii]->GetYaxis()->SetTitleOffset(2.); |
662 |
|
eventnumb[ii]->SetMarkerStyle(21); |
663 |
|
eventnumb[ii]->SetMarkerColor(kBlue); |
664 |
|
eventnumb[ii]->SetMarkerSize(0.2); |
665 |
|
eventnumb[ii]->Draw("ap"); |
666 |
|
EventNumCanv[ii]->Update(); |
667 |
|
|
668 |
|
|
669 |
|
minev=maxev; |
670 |
|
if(maxev==maxevent-1) { |
671 |
|
cntpgdat=ii+1; |
672 |
|
break; |
673 |
|
} |
674 |
|
} |
675 |
|
|
676 |
|
alarm.close(); |
677 |
|
|
678 |
//**************************************************************************************** |
//**************************************************************************************** |
679 |
//Output figures --- Third sheet: |
//Cluster Signal ladder1 Output Pages |
680 |
//**************************************************************************************** |
//**************************************************************************************** |
681 |
|
|
682 |
TCanvas *LandauCanv1=new TCanvas("Landau ladder1","",900,1200); |
fromfile.str(""); |
683 |
|
fromfile<<"FTrkQLook_EXPERT File: "<<ffile; |
684 |
|
isfile<<"Cluster Signal ladder1"; |
685 |
|
LandauCanv1=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
686 |
LandauCanv1->SetFillColor(10); |
LandauCanv1->SetFillColor(10); |
687 |
LandauCanv1->Range(0,0,100,100); |
LandauCanv1->Range(0,0,100,100); |
|
isfile<<"Landau ladder1"; |
|
688 |
|
|
689 |
t->SetTextFont(32); |
t->SetTextFont(32); |
690 |
t->SetTextColor(1); |
t->SetTextColor(1); |
699 |
isfile.str(""); |
isfile.str(""); |
700 |
|
|
701 |
//**************************************************************************************** |
//**************************************************************************************** |
702 |
//Output figures --- Third sheet: |
//Cluster Signal ladder2 Output Pages |
703 |
//**************************************************************************************** |
//**************************************************************************************** |
704 |
|
|
705 |
TCanvas *LandauCanv2=new TCanvas("Landau ladder2","",900,1200); |
isfile<<"Cluster Signal ladder2"; |
706 |
|
LandauCanv2=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
707 |
LandauCanv2->SetFillColor(10); |
LandauCanv2->SetFillColor(10); |
708 |
LandauCanv2->Range(0,0,100,100); |
LandauCanv2->Range(0,0,100,100); |
|
isfile<<"Landau ladder2"; |
|
709 |
|
|
710 |
t->SetTextFont(32); |
t->SetTextFont(32); |
711 |
t->SetTextColor(1); |
t->SetTextColor(1); |
720 |
isfile.str(""); |
isfile.str(""); |
721 |
|
|
722 |
//**************************************************************************************** |
//**************************************************************************************** |
723 |
//Output figures --- Third sheet: |
//Cluster Signal ladder3 Output Pages |
724 |
//**************************************************************************************** |
//**************************************************************************************** |
725 |
|
|
726 |
TCanvas *LandauCanv3=new TCanvas("Landau ladder3","",900,1200); |
isfile<<"Cluster Signal ladder3"; |
727 |
|
LandauCanv3=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
728 |
LandauCanv3->SetFillColor(10); |
LandauCanv3->SetFillColor(10); |
729 |
LandauCanv3->Range(0,0,100,100); |
LandauCanv3->Range(0,0,100,100); |
|
isfile<<"Landau ladder3"; |
|
730 |
|
|
731 |
t->SetTextFont(32); |
t->SetTextFont(32); |
732 |
t->SetTextColor(1); |
t->SetTextColor(1); |
741 |
isfile.str(""); |
isfile.str(""); |
742 |
|
|
743 |
//**************************************************************************************** |
//**************************************************************************************** |
744 |
//Output figures --- Fourth sheet: |
//Lighting of the views Output Pages |
745 |
//**************************************************************************************** |
//**************************************************************************************** |
746 |
|
|
747 |
TCanvas *IlluminaCanv=new TCanvas("Illuminazione","",900,1200); |
isfile<<"lighting of the views"; |
748 |
|
IlluminaCanv=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
749 |
IlluminaCanv->SetFillColor(10); |
IlluminaCanv->SetFillColor(10); |
750 |
IlluminaCanv->Range(0,0,100,100); |
IlluminaCanv->Range(0,0,100,100); |
|
isfile<<"lighting of the views"; |
|
751 |
t->SetTextFont(32); |
t->SetTextFont(32); |
752 |
t->SetTextColor(1); |
t->SetTextColor(1); |
753 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
759 |
t1->SetTextSize(0.02); |
t1->SetTextSize(0.02); |
760 |
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
t1->DrawLatex(70.,98.7,isfile.str().c_str()); |
761 |
isfile.str(""); |
isfile.str(""); |
|
|
|
|
//**************************************************************************************** |
|
|
//Output figures --- Fifth sheet: |
|
|
//**************************************************************************************** |
|
|
|
|
|
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()); |
|
|
isfile.str(""); |
|
762 |
|
|
763 |
//************************************************************************************* |
// |
764 |
//book pads and histos |
// Draw the histos |
|
//*************************************************************************************** |
|
|
|
|
|
TPad *pad1[12],*pad2[12],*pad3[12],*pad4[12],*pad5[12],*pad6[5]; //pad for histos |
|
|
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(),1201,-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(),1201,-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(),1201,-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(),3073,-0.5,3072.5); |
|
|
illuminazione[n]->GetXaxis()->SetTitle("strip with max signal"); |
|
|
illuminazione[n]->GetXaxis()->CenterTitle(); |
|
|
|
|
|
oss1.str(""); |
|
|
oss2.str(""); |
|
|
oss3.str(""); |
|
|
oss4.str(""); |
|
|
}; |
|
|
|
|
|
|
|
|
//********************************************************************************** |
|
|
// Fill Graphs and Histos |
|
|
//********************************************************************************** |
|
|
|
|
|
Double_t maxhist=0; |
|
|
TBox b; |
|
|
b.SetFillColor(5); |
|
|
|
|
765 |
for (Int_t i=0; i<12 ; i++){ |
for (Int_t i=0; i<12 ; i++){ |
766 |
|
|
767 |
for (Int_t ev=minevent; ev<maxevent; ev++){ |
TBox b; |
768 |
yyc[(ev-minevent)]=yc[12*(ev-minevent)+i]; |
b.SetFillColor(6); |
769 |
// if( land[12*(ev-minevent)+i][0]!=0 && illum[12*(ev-minevent)+i][0]>510 && illum[12*(ev-minevent)+i][0]<515) landau1[i]->Fill(land[12*(ev-minevent)+i][0]); |
b.SetFillStyle(3945); |
770 |
if( land[12*(ev-minevent)+i][0]!=0) landau1[i]->Fill(land[12*(ev-minevent)+i][0]); |
|
771 |
if( land[12*(ev-minevent)+i][1]!=0) landau2[i]->Fill(land[12*(ev-minevent)+i][1]); |
Float_t maxhist=0; |
|
if( land[12*(ev-minevent)+i][2]!=0) landau3[i]->Fill(land[12*(ev-minevent)+i][2]); |
|
|
for(Int_t j=0;j<3;j++){ |
|
|
if(land[12*(ev-minevent)+i][j]!=0){ |
|
|
hi=(j*1024)+illum[12*(ev-minevent)+i][j]; |
|
|
illuminazione[i]->Fill(hi); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
772 |
LandauCanv1->cd(); |
LandauCanv1->cd(); |
773 |
pad1[i]->SetFillColor(10); |
pad1[i]->SetFillColor(10); |
774 |
pad1[i]->SetFrameFillColor(10); |
pad1[i]->SetFrameFillColor(10); |
775 |
pad1[i]->Draw(); |
pad1[i]->Draw(); |
776 |
pad1[i]->cd(); |
pad1[i]->cd(); |
777 |
|
landau1[i]->GetXaxis()->SetTitle("max signal"); |
778 |
|
landau1[i]->GetXaxis()->CenterTitle(); |
779 |
landau1[i]->Draw(""); |
landau1[i]->Draw(""); |
780 |
|
LandauCanv1->Update(); |
781 |
|
|
782 |
LandauCanv2->cd(); |
LandauCanv2->cd(); |
783 |
pad4[i]->SetFillColor(10); |
pad4[i]->SetFillColor(10); |
784 |
pad4[i]->SetFrameFillColor(10); |
pad4[i]->SetFrameFillColor(10); |
785 |
pad4[i]->Draw(); |
pad4[i]->Draw(); |
786 |
pad4[i]->cd(); |
pad4[i]->cd(); |
787 |
|
landau2[i]->GetXaxis()->SetTitle("max signal"); |
788 |
|
landau2[i]->GetXaxis()->CenterTitle(); |
789 |
landau2[i]->Draw(""); |
landau2[i]->Draw(""); |
790 |
|
LandauCanv2->Update(); |
791 |
|
|
792 |
LandauCanv3->cd(); |
LandauCanv3->cd(); |
793 |
pad5[i]->SetFillColor(10); |
pad5[i]->SetFillColor(10); |
794 |
pad5[i]->SetFrameFillColor(10); |
pad5[i]->SetFrameFillColor(10); |
795 |
pad5[i]->Draw(); |
pad5[i]->Draw(); |
796 |
pad5[i]->cd(); |
pad5[i]->cd(); |
797 |
|
landau3[i]->GetXaxis()->SetTitle("max signal"); |
798 |
|
landau3[i]->GetXaxis()->CenterTitle(); |
799 |
landau3[i]->Draw(""); |
landau3[i]->Draw(""); |
800 |
|
LandauCanv3->Update(); |
801 |
|
|
802 |
IlluminaCanv->cd(); |
IlluminaCanv->cd(); |
803 |
pad2[i]->SetFillColor(10); |
pad2[i]->SetFillColor(10); |
804 |
pad2[i]->SetFrameFillColor(10); |
pad2[i]->SetFrameFillColor(10); |
805 |
|
pad2[i]->SetLogy(); |
806 |
pad2[i]->Draw(); |
pad2[i]->Draw(); |
807 |
pad2[i]->cd(); |
pad2[i]->cd(); |
808 |
pad2[i]->SetLogy(); |
illuminazione[i]->GetXaxis()->SetTitle("strip with max signal"); |
809 |
// illuminazione[i]->SetStats(KFALSE); |
illuminazione[i]->GetXaxis()->CenterTitle(); |
810 |
if(i==1){ |
illuminazione[i]->Draw(""); |
811 |
illuminazione[i]->Draw("ah"); |
if(i==1){ |
812 |
maxhist= illuminazione[i]->GetMaximum(); |
maxhist= illuminazione[i]->GetMaximum(); |
813 |
b.DrawBox(2816.,0.,3060.,maxhist); |
b.DrawBox(2816.,0.,3060.,maxhist); |
|
illuminazione[i]->Draw("axis same"); |
|
|
illuminazione[i]->Draw("same ]["); |
|
814 |
} |
} |
815 |
else if(i==6){ |
else if(i==6){ |
|
illuminazione[i]->Draw("ah"); |
|
816 |
maxhist= illuminazione[i]->GetMaximum(); |
maxhist= illuminazione[i]->GetMaximum(); |
817 |
b.DrawBox(2560.,0.,2816.,maxhist); |
b.DrawBox(2560.,0.,2816.,maxhist); |
818 |
b.DrawBox(512.,0.,768.,maxhist); |
b.DrawBox(512.,0.,768.,maxhist); |
819 |
b.DrawBox(1024.,0.,1792.,maxhist); |
b.DrawBox(1024.,0.,1792.,maxhist); |
|
illuminazione[i]->Draw("axis same"); |
|
|
illuminazione[i]->Draw("same]["); |
|
820 |
} |
} |
821 |
else if(i==11){ |
else if(i==11){ |
|
illuminazione[i]->Draw("ah"); |
|
822 |
maxhist= illuminazione[i]->GetMaximum(); |
maxhist= illuminazione[i]->GetMaximum(); |
823 |
b.DrawBox(768.,0.,1024.,maxhist); |
b.DrawBox(768.,0.,1024.,maxhist); |
|
illuminazione[i]->Draw("axis same"); |
|
|
illuminazione[i]->Draw("same]["); |
|
824 |
} |
} |
825 |
else illuminazione[i]->Draw(""); |
IlluminaCanv->Update(); |
|
|
|
|
CompTimeCanv->cd(); |
|
|
pad3[i]->SetFillColor(10); |
|
|
pad3[i]->SetFrameFillColor(10); |
|
|
pad3[i]->Draw(); |
|
|
pad3[i]->cd(); |
|
|
comprtime= new TGraph(nevent,x,yyc); |
|
|
oss1<<"DSP "<<i+1; |
|
|
comprtime->SetTitle(oss1.str().c_str()); |
|
|
comprtime->GetXaxis()->SetTitle("OBT (ms)"); |
|
|
comprtime->GetXaxis()->CenterTitle(); |
|
|
comprtime->GetYaxis()->SetTitle("compressiontime (ms)"); |
|
|
comprtime->GetYaxis()->CenterTitle(); |
|
|
comprtime->GetYaxis()->SetRangeUser(0,2); |
|
|
comprtime->Draw("ap"); |
|
|
oss1.str(""); |
|
|
}; |
|
|
|
|
|
EventNumCanv->cd(); |
|
|
TPad *pt0=new TPad("pt0"," ",0.704,0.004,0.996,0.98); |
|
|
pt1 = new TPaveText(0.004,0.004,0.986,0.996); |
|
|
pt = new TPad("pt"," ",0.004,0.004,0.7,0.98,18,0,0); |
|
|
pt1->SetFillColor(10); |
|
|
pt1->ReadFile(out + "warning.txt"); |
|
|
pt1->SetTextAlign(22); |
|
|
pt1->SetTextSize(0.035); |
|
|
pt0->SetFillColor(10); |
|
|
pt0->SetFrameFillColor(10); |
|
|
pt0->Draw(); |
|
|
pt0->cd(); |
|
|
pt1->Draw(); |
|
|
EventNumCanv->cd(); |
|
|
pt->SetFillColor(10); |
|
|
pt->SetFrameFillColor(10); |
|
|
pt->Draw(); |
|
|
pt->cd(); |
|
|
eventnumb=new TGraph(nevent,x,eventint); |
|
|
eventnumb->SetTitle(""); |
|
|
eventnumb->GetXaxis()->SetLabelSize(0.04); |
|
|
eventnumb->GetXaxis()->SetTitleSize(0.04); |
|
|
eventnumb->GetXaxis()->SetTitle("OBT (ms)"); |
|
|
eventnumb->GetXaxis()->CenterTitle(); |
|
|
eventnumb->GetXaxis()->SetTickLength(0.01); |
|
|
eventnumb->GetXaxis()->SetTitleOffset(1.2); |
|
|
eventnumb->GetYaxis()->SetLabelSize(0.04); |
|
|
eventnumb->GetYaxis()->SetTitleSize(0.04); |
|
|
eventnumb->GetYaxis()->SetTitle("DSP event-number"); |
|
|
eventnumb->GetYaxis()->CenterTitle(); |
|
|
eventnumb->GetYaxis()->SetTitleOffset(1.5); |
|
|
eventnumb->SetMarkerStyle(21); |
|
|
eventnumb->SetMarkerColor(kBlue); |
|
|
eventnumb->SetMarkerSize(0.3); |
|
|
eventnumb->Draw("ap"); |
|
|
|
|
|
for(Int_t i=0; i<5; i++){ |
|
|
for (Int_t ev=0; ev<tsize; ev++){ |
|
|
tempt_tmp[ev]=(Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231); |
|
|
} |
|
|
TempCanv->cd(); |
|
|
tit<<"T"<<i+5<<" (magnetic module "<<i+1<<")"; |
|
|
pad6[i]->SetFillColor(10); |
|
|
pad6[i]->Draw(); |
|
|
pad6[i]->cd(); |
|
|
temp[i]= new TGraph(tsize,xt,tempt_tmp); |
|
|
temp[i]->SetTitle(tit.str().c_str()); |
|
|
temp[i]->GetXaxis()->SetLabelSize(0.04); |
|
|
temp[i]->GetXaxis()->SetTitleSize(0.04); |
|
|
temp[i]->GetXaxis()->SetTitle("OBT (ms)"); |
|
|
temp[i]->GetXaxis()->CenterTitle(); |
|
|
temp[i]->GetXaxis()->SetTitleOffset(0.85); |
|
|
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(""); |
|
826 |
} |
} |
827 |
CompTimeCanv->Update(); |
|
|
LandauCanv1->Update(); |
|
|
LandauCanv2->Update(); |
|
|
LandauCanv3->Update(); |
|
|
IlluminaCanv->Update(); |
|
|
TempCanv->Update(); |
|
|
|
|
828 |
printf("... end of packets. \n"); |
printf("... end of packets. \n"); |
829 |
|
|
830 |
//************************************************************************* |
//************************************************************************* |
831 |
// Save output Files |
// Save output Files |
832 |
//************************************************************************* |
//************************************************************************* |
833 |
stringstream out1,out2,out3,command; |
stringstream out1,out2,out3,command; |
834 |
|
Int_t totpg=0; |
835 |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
if(cntpgtemp>cntpgdat) totpg=cntpgtemp; |
836 |
out1.str(""); |
else if(cntpgtemp<=cntpgdat) totpg=cntpgdat; |
837 |
out2.str(""); |
|
838 |
out3.str(""); |
for(Int_t fl=0;fl<totpg;fl++){ |
839 |
|
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
840 |
out1<<ffile<<"_FTrkQLook_EXPERT.ps("; |
out1.str(""); |
841 |
out2<<ffile<<"_FTrkQLook_EXPERT.ps"; |
out2.str(""); |
842 |
out3<<ffile<<"_FTrkQLook_EXPERT.ps)"; |
out3.str(""); |
843 |
|
|
844 |
CompTimeCanv->Print(out+out1.str().c_str(),"Portrait"); |
out1<<ffile<<"_FTrkQLook_EXPERT.ps("; |
845 |
EventNumCanv->Print(out+out2.str().c_str(),"Portrait"); |
out2<<ffile<<"_FTrkQLook_EXPERT.ps"; |
846 |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
out3<<ffile<<"_FTrkQLook_EXPERT.ps)"; |
|
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
|
|
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
|
|
IlluminaCanv->Print(out+out2.str().c_str(),"Portrait"); |
|
|
TempCanv->Print(out+out3.str().c_str(),"Portrait"); |
|
847 |
|
|
848 |
if(!strcmp(outfile.Data(),"pdf")){ |
if(totpg==1){ |
849 |
stringstream com; |
CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
850 |
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "<<out<<ffile<<"_FTrkQLook_EXPERT.pdf"; |
EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
851 |
system(com.str().c_str()); |
TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
852 |
printf("\n---> ps file converted in pdf format!\n"); |
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
853 |
com.str(""); |
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
854 |
com<<"rm -f "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "; |
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
855 |
system(com.str().c_str()); |
IlluminaCanv->Print(out+out3.str().c_str(),"Portrait"); |
856 |
printf("---> ps file removed!\n\n"); |
} |
857 |
com.str(""); |
else if(totpg>1){ |
858 |
|
if(fl==0) CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); |
859 |
|
if(fl>0 && fl<cntpgdat) CompTimeCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
860 |
|
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
861 |
|
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); |
862 |
|
if(fl==totpg-1){ |
863 |
|
LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); |
864 |
|
LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); |
865 |
|
LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); |
866 |
|
IlluminaCanv->Print(out+out3.str().c_str(),"Portrait"); |
867 |
|
} |
868 |
|
} |
869 |
} |
} |
870 |
|
else{ |
871 |
|
out1.str(""); |
872 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-CompTime-pag"<<fl+1<<"."<<outfile.Data(); |
873 |
|
if(fl<cntpgdat) CompTimeCanv[fl]->Print(out+out1.str().c_str()); |
874 |
|
out1.str(""); |
875 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-Temp-pag"<<fl+1<<"."<<outfile.Data(); |
876 |
|
if(fl<cntpgtemp) TempCanv[fl]->Print(out+out1.str().c_str()); |
877 |
|
out1.str(""); |
878 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-EvNum-pag"<<fl+1<<"."<<outfile.Data(); |
879 |
|
if(fl<cntpgdat) EventNumCanv[fl]->Print(out+out1.str().c_str()); |
880 |
|
if(fl==totpg-1){ |
881 |
|
out1.str(""); |
882 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL1."<<outfile.Data(); |
883 |
|
LandauCanv1->Print(out+out1.str().c_str()); |
884 |
|
out1.str(""); |
885 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL2."<<outfile.Data(); |
886 |
|
LandauCanv2->Print(out+out1.str().c_str()); |
887 |
|
out1.str(""); |
888 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-LandauL3."<<outfile.Data(); |
889 |
|
LandauCanv3->Print(out+out1.str().c_str()); |
890 |
|
out1.str(""); |
891 |
|
out1<<ffile<<"_FTrkQLook_EXPERT-Lighting."<<outfile.Data(); |
892 |
|
IlluminaCanv->Print(out+out1.str().c_str()); |
893 |
|
} |
894 |
|
} |
895 |
|
} |
896 |
|
|
897 |
|
// |
898 |
|
// Convert ps to pdf if required |
899 |
|
if(!strcmp(outfile.Data(),"pdf")){ |
900 |
|
stringstream com; |
901 |
|
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "<<out<<ffile<<"_FTrkQLook_EXPERT.pdf"; |
902 |
|
system(com.str().c_str()); |
903 |
|
printf("\n---> ps file converted in pdf format!\n"); |
904 |
|
com.str(""); |
905 |
|
com<<"rm -f "<<out<<ffile<<"_FTrkQLook_EXPERT.ps "; |
906 |
|
system(com.str().c_str()); |
907 |
|
printf("---> ps file removed!\n\n"); |
908 |
|
com.str(""); |
909 |
} |
} |
|
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()); |
|
910 |
|
|
911 |
gROOT->Reset(); |
gROOT->Reset(); |
912 |
return; |
return; |