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