96 |
var.showcal = false; |
var.showcal = false; |
97 |
var.showrun = false; |
var.showrun = false; |
98 |
var.showac = false; |
var.showac = false; |
99 |
|
L2 = 0; |
100 |
} |
} |
101 |
|
|
102 |
void FEVdetector::Reset(){ |
void FEVdetector::Reset(){ |
427 |
TBranchElement *tb = (TBranchElement*)branch_array->At(l); |
TBranchElement *tb = (TBranchElement*)branch_array->At(l); |
428 |
Int_t type = tb->GetType(); |
Int_t type = tb->GetType(); |
429 |
Int_t atype = tb->GetStreamerType() - 20; |
Int_t atype = tb->GetStreamerType() - 20; |
430 |
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
// Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
431 |
|
Int_t len = tb->GetInfo()->GetLength(tb->GetID()); |
432 |
Int_t length = min(len,dlen); |
Int_t length = min(len,dlen); |
433 |
// |
// |
434 |
// printf("Branches : type is %i type is %i tb getname %s slen %i slength %i\n",atype,type,tb->GetName(),len,length); |
// printf("Branches : type is %i type is %i tb getname %s slen %i slength %i\n",atype,type,tb->GetName(),len,length); |
661 |
TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); |
TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); |
662 |
Int_t stype = stb->GetType(); |
Int_t stype = stb->GetType(); |
663 |
Int_t satype = stb->GetStreamerType() - 20; |
Int_t satype = stb->GetStreamerType() - 20; |
664 |
Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; |
// Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; |
665 |
|
Int_t slen = stb->GetInfo()->GetLength(stb->GetID()); |
666 |
Int_t slength = min(slen,dlen); |
Int_t slength = min(slen,dlen); |
667 |
// printf("SubBranches : atype is %i type is %i tb getname %s slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); |
// printf("SubBranches : atype is %i type is %i tb getname %s slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); |
668 |
switch (stype){ |
switch (stype){ |
1109 |
// |
// |
1110 |
// printf(" %s \n",ddec.Data()); |
// printf(" %s \n",ddec.Data()); |
1111 |
if ( !L2 ){ |
if ( !L2 ){ |
1112 |
|
// printf(" l2 constructor\n"); |
1113 |
L2 = new PamLevel2("",file.Data(),ddec.Data()); |
L2 = new PamLevel2("",file.Data(),ddec.Data()); |
1114 |
if ( NODB ) L2->NoDBconnections(); |
if ( NODB ) L2->NoDBconnections(); |
1115 |
otr = L2->GetPamTree(); |
otr = L2->GetPamTree(); |
|
// printf(" l2 constructor\n"); |
|
1116 |
// printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot); |
// printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot); |
1117 |
} else { |
} else { |
1118 |
// |
// |
1276 |
// |
// |
1277 |
void FEVdetector::ShowTRG(){ |
void FEVdetector::ShowTRG(){ |
1278 |
// |
// |
1279 |
|
if ( level.file != 2 ) return; |
1280 |
// |
// |
1281 |
if ( !var.TRG ) return; |
if ( !var.TRG ) return; |
1282 |
// |
// |
1631 |
testo3 << "S4: ";// << setprecision(2); |
testo3 << "S4: ";// << setprecision(2); |
1632 |
testo3 << var.s4sig << " [MIP] TOF: #beta = "; |
testo3 << var.s4sig << " [MIP] TOF: #beta = "; |
1633 |
testo3 << setprecision(3) << var.beta[4]; |
testo3 << setprecision(3) << var.beta[4]; |
1634 |
|
if ( level.file == 2 ){ |
1635 |
|
testo3 << " SVL cutoff: "; |
1636 |
|
testo3 << setprecision(3) << L2->GetOrbitalInfo()->GetCutoffSVL();//quiquiqui |
1637 |
|
} |
1638 |
text->DrawLatex(0.33,txthi,testo3.str().c_str()); |
text->DrawLatex(0.33,txthi,testo3.str().c_str()); |
1639 |
txthi -= 0.03; |
txthi -= 0.03; |
1640 |
testo3.str(""); |
testo3.str(""); |
3283 |
if ( higp > 0.164 ) higp = 0.164; |
if ( higp > 0.164 ) higp = 0.164; |
3284 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[rj] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[rj] != 0.))){ |
3285 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
3286 |
Float_t nyc1[5]={ 0.0015, 0.0015, ws13-0.0015, ws13-0.0015, 0.0015}; |
Float_t nyc1[5]={ 0.0015, 0.0015, (float)(ws13-0.0015), (float)(ws13-0.0015), 0.0015}; |
3287 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3288 |
Float_t nyc[5]; |
Float_t nyc[5]; |
3289 |
for (Int_t i = 0; i<5 ; i++) { |
for (Int_t i = 0; i<5 ; i++) { |
3369 |
if ( higp > 0.203 ) higp = 0.203; |
if ( higp > 0.203 ) higp = 0.203; |
3370 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp12[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp12[j] != 0.))){ |
3371 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
3372 |
Float_t nyc1[5]={ -0.0015, -0.0015, -ws13+0.0015, -ws13+0.0015, -0.0015}; |
Float_t nyc1[5]={ -0.0015, -0.0015, (float)(-ws13+0.0015), (float)(-ws13+0.0015), -0.0015}; |
3373 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3374 |
Float_t nyc[5]; |
Float_t nyc[5]; |
3375 |
for (Int_t i = 0; i<5 ; i++) { |
for (Int_t i = 0; i<5 ; i++) { |
3458 |
if ( higp > 0.089 ) higp = 0.089; |
if ( higp > 0.089 ) higp = 0.089; |
3459 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp21[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp21[j] != 0.))){ |
3460 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
3461 |
Float_t nyc1[5]={ 0.0015, 0.0015, ws2-0.0015, ws2-0.0015, 0.}; |
Float_t nyc1[5]={ 0.0015, 0.0015, (float)(ws2-0.0015), (float)(ws2-0.0015), 0.}; |
3462 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3463 |
Float_t nyc[5]; |
Float_t nyc[5]; |
3464 |
for (Int_t i = 0; i<5 ; i++) { |
for (Int_t i = 0; i<5 ; i++) { |
3549 |
if ( higp > 0.074 ) higp = 0.074; |
if ( higp > 0.074 ) higp = 0.074; |
3550 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[rj] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[rj] != 0.))){ |
3551 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
3552 |
Float_t nyc1[5]={ -0.0015, -0.0015, -ws2+0.0015, -ws2+0.0015, -0.0015}; |
Float_t nyc1[5]={ -0.0015, -0.0015, (float)(-ws2+0.0015), (float)(-ws2+0.0015), -0.0015}; |
3553 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3554 |
Float_t nyc[5]; |
Float_t nyc[5]; |
3555 |
for (Int_t i = 0; i<5 ; i++) { |
for (Int_t i = 0; i<5 ; i++) { |
3640 |
if ( higp > 0.074 ) higp = 0.074; |
if ( higp > 0.074 ) higp = 0.074; |
3641 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[rj] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[rj] != 0.))){ |
3642 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
3643 |
Float_t nyc1[5]={ 0.0015, 0.0015, ws13-0.0015, ws13-0.0015, 0.0015}; |
Float_t nyc1[5]={ 0.0015, 0.0015, (float)(ws13-0.0015), (float)(ws13-0.0015), 0.0015}; |
3644 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3645 |
Float_t nyc[5]; |
Float_t nyc[5]; |
3646 |
for (Int_t i = 0; i<5 ; i++) { |
for (Int_t i = 0; i<5 ; i++) { |
3728 |
if ( higp > 0.089 ) higp = 0.089; |
if ( higp > 0.089 ) higp = 0.089; |
3729 |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp32[j] != 0.))){ |
if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp32[j] != 0.))){ |
3730 |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; |
3731 |
Float_t nyc1[5]={ -0.0015, -0.0015, -ws13+0.0015, -ws13+0.0015, -0.0015}; |
Float_t nyc1[5]={ -0.0015, -0.0015, (float)(-ws13+0.0015), (float)(-ws13+0.0015), -0.0015}; |
3732 |
Float_t nxc[5]; |
Float_t nxc[5]; |
3733 |
Float_t nyc[5]; |
Float_t nyc[5]; |
3734 |
for (Int_t i = 0; i<5 ; i++) { |
for (Int_t i = 0; i<5 ; i++) { |
4104 |
// |
// |
4105 |
if ( true ){ |
if ( true ){ |
4106 |
// PMTs |
// PMTs |
4107 |
Float_t xc1[5]={ 0., 0.014*var.sfx, 0.014*var.sfx-var.sfx*var.sfx*pmt1*cos(apmt1), -var.sfx*var.sfx*pmt1*cos(apmt1), 0.}; |
Float_t xc1[5]={ 0., (float)(0.014*var.sfx), (float)(0.014*var.sfx-var.sfx*var.sfx*pmt1*cos(apmt1)), (float)(-var.sfx*var.sfx*pmt1*cos(apmt1)), 0.}; |
4108 |
Float_t yc1[5]={ 0., 0.011*var.sfy, 0.011*var.sfy+var.sfy*var.sfy*pmt1*sin(apmt1), var.sfy*var.sfy*pmt1*sin(apmt1), 0.}; |
Float_t yc1[5]={ 0., (float)(0.011*var.sfy), (float)(0.011*var.sfy+var.sfy*var.sfy*pmt1*sin(apmt1)), (float)(var.sfy*var.sfy*pmt1*sin(apmt1)), 0.}; |
4109 |
Float_t xc2[5]={ 0., 0.011*var.sfx, 0.011*var.sfx-pmt2*var.sfx*var.sfx*cos(apmt2), -pmt2*var.sfx*var.sfx*cos(apmt2), 0.}; |
Float_t xc2[5]={ 0., (float)(0.011*var.sfx), (float)(0.011*var.sfx-pmt2*var.sfx*var.sfx*cos(apmt2)), (float)(-pmt2*var.sfx*var.sfx*cos(apmt2)), 0.}; |
4110 |
Float_t yc2[5]={ 0., 0.015*var.sfy, 0.015*var.sfy+var.sfy*pmt2*var.sfy*sin(apmt2), var.sfy*pmt2*var.sfy*sin(apmt2), 0.}; |
Float_t yc2[5]={ 0., (float)(0.015*var.sfy), (float)(0.015*var.sfy+var.sfy*pmt2*var.sfy*sin(apmt2)), (float)(var.sfy*pmt2*var.sfy*sin(apmt2)), 0.}; |
4111 |
// SCINTs |
// SCINTs |
4112 |
Float_t xcc1[10]={-0.149, -0.090165, -0.090165, -0.149, -0.242, -0.257, -0.212, -0.257, -0.242, -0.149}; |
Float_t xcc1[10]={-0.149, -0.090165, -0.090165, -0.149, -0.242, -0.257, -0.212, -0.257, -0.242, -0.149}; |
4113 |
Float_t ycc1[10]={ 0.169, 0.108165, -0.108165, -0.169, -0.169, -0.158, 0., 0.158, 0.169, 0.169}; |
Float_t ycc1[10]={ 0.169, 0.108165, -0.108165, -0.169, -0.169, -0.158, 0., 0.158, 0.169, 0.169}; |
5542 |
linea->SetLineWidth(2); |
linea->SetLineWidth(2); |
5543 |
linea->SetLineColor(sigcol2); |
linea->SetLineColor(sigcol2); |
5544 |
linea->Draw(); |
linea->Draw(); |
5545 |
Float_t tx[5] = {x-0.3, x+0.3, x+0.3, x-0.3, x-0.3}; |
Float_t tx[5] = {(float)(x-0.3), (float)(x+0.3), (float)(x+0.3), (float)(x-0.3), (float)(x-0.3)}; |
5546 |
Float_t tz[5] = {0., 0., 0.5, 0.5, 0.}; |
Float_t tz[5] = {0., 0., 0.5, 0.5, 0.}; |
5547 |
TPolyLine *tlinea = new TPolyLine(5,tx,tz); |
TPolyLine *tlinea = new TPolyLine(5,tx,tz); |
5548 |
tlinea->SetLineWidth(1); |
tlinea->SetLineWidth(1); |
5572 |
linea->SetLineWidth(2); |
linea->SetLineWidth(2); |
5573 |
linea->SetLineColor(sigcol2); |
linea->SetLineColor(sigcol2); |
5574 |
linea->Draw(); |
linea->Draw(); |
5575 |
Float_t tx[5] = {x-0.3, x+0.3, x+0.3, x-0.3, x-0.3}; |
Float_t tx[5] = {(float)(x-0.3), (float)(x+0.3), (float)(x+0.3), (float)(x-0.3), (float)(x-0.3)}; |
5576 |
Float_t tz[5] = {0., 0., 0.5, 0.5, 0.}; |
Float_t tz[5] = {0., 0., 0.5, 0.5, 0.}; |
5577 |
TPolyLine *tlinea = new TPolyLine(5,tx,tz); |
TPolyLine *tlinea = new TPolyLine(5,tx,tz); |
5578 |
tlinea->SetLineColor(dcol); |
tlinea->SetLineColor(dcol); |
6040 |
// printf("qua \n"); |
// printf("qua \n"); |
6041 |
Int_t npoint = 100; |
Int_t npoint = 100; |
6042 |
Float_t zin[100]; |
Float_t zin[100]; |
6043 |
Double_t xout[100]; |
// Double_t xout[100]; |
6044 |
Double_t yout[100]; |
// Double_t yout[100]; |
6045 |
Int_t ifail = 0; |
Int_t ifail = 0; |
6046 |
Int_t trcol = 10; |
Int_t trcol = 10; |
6047 |
// |
// |
6059 |
Float_t tzy1[15]; |
Float_t tzy1[15]; |
6060 |
// |
// |
6061 |
for ( Int_t e = 0; e < 100 ; e++) { |
for ( Int_t e = 0; e < 100 ; e++) { |
6062 |
xout[e] = 0.; |
// xout[e] = 0.; |
6063 |
yout[e] = 0.; |
// yout[e] = 0.; |
6064 |
// |
// |
6065 |
tx[e] = 0.; |
tx[e] = 0.; |
6066 |
ty[e] = 0.; |
ty[e] = 0.; |
6235 |
// |
// |
6236 |
stringstream xevent; |
stringstream xevent; |
6237 |
stringstream yevent; |
stringstream yevent; |
6238 |
Float_t sdexy[2][22][96]; |
// Float_t sdexy[2][22][96]; |
6239 |
Float_t sdexyc[2][22][96]; |
// Float_t sdexyc[2][22][96]; |
6240 |
// |
// |
6241 |
for (Int_t m = 0; m < 22; m++){ |
for (Int_t m = 0; m < 22; m++){ |
6242 |
for (Int_t l = 0; l < 2; l++){ |
for (Int_t l = 0; l < 2; l++){ |
6251 |
// |
// |
6252 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
6253 |
// |
// |
6254 |
bool isCOMP = 0; |
// bool isCOMP = 0; |
6255 |
bool isFULL = 0; |
// bool isFULL = 0; |
6256 |
bool isRAW = 0; |
bool isRAW = 0; |
6257 |
if ( de->stwerr[se] & (1 << 16) ) isCOMP = 1; |
// if ( de->stwerr[se] & (1 << 16) ) isCOMP = 1; |
6258 |
if ( de->stwerr[se] & (1 << 17) ) isFULL = 1; |
// if ( de->stwerr[se] & (1 << 17) ) isFULL = 1; |
6259 |
if ( de->stwerr[se] & (1 << 3) ) isRAW = 1; |
if ( de->stwerr[se] & (1 << 3) ) isRAW = 1; |
6260 |
// |
// |
6261 |
// save the prevoius energy deposit and calibration in sbase, sdexy, sdexyc |
// save the prevoius energy deposit and calibration in sbase, sdexy, sdexyc |
6265 |
for (Int_t nn = 0; nn < 96; nn++){ |
for (Int_t nn = 0; nn < 96; nn++){ |
6266 |
if ( nn%16 == 0 ) pre++; |
if ( nn%16 == 0 ) pre++; |
6267 |
evento.base[l][m][pre] = calib.calbase[l][m][pre]; |
evento.base[l][m][pre] = calib.calbase[l][m][pre]; |
6268 |
sdexy[l][m][nn] = evento.dexy[l][m][nn]; |
// sdexy[l][m][nn] = evento.dexy[l][m][nn]; |
6269 |
evento.dexy[l][m][nn] = de->dexy[l][m][nn] ; |
evento.dexy[l][m][nn] = de->dexy[l][m][nn] ; |
6270 |
sdexyc[l][m][nn] = evento.dexy[l][m][nn]; |
// sdexyc[l][m][nn] = evento.dexy[l][m][nn]; |
6271 |
evento.dexyc[l][m][nn] = de->dexy[l][m][nn] ; |
evento.dexyc[l][m][nn] = de->dexy[l][m][nn] ; |
6272 |
}; |
}; |
6273 |
}; |
}; |
6363 |
// Define variables |
// Define variables |
6364 |
// |
// |
6365 |
UInt_t etime = var.etime; |
UInt_t etime = var.etime; |
6366 |
Float_t estrip[2][22][96], ener, basel,sdexy[2][22][96],sdexyc[2][22][96]; |
Float_t estrip[2][22][96], ener, basel;//,sdexy[2][22][96],sdexyc[2][22][96]; |
6367 |
Int_t badstrip = 0; |
Int_t badstrip = 0; |
6368 |
qtot = 0.; |
qtot = 0.; |
6369 |
nstrip = 0; |
nstrip = 0; |
6459 |
// |
// |
6460 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
6461 |
// |
// |
6462 |
bool isCOMP = 0; |
// bool isCOMP = 0; |
6463 |
bool isFULL = 0; |
// bool isFULL = 0; |
6464 |
bool isRAW = 0; |
bool isRAW = 0; |
6465 |
if ( de->stwerr[se] & (1 << 16) ) isCOMP = 1; |
// if ( de->stwerr[se] & (1 << 16) ) isCOMP = 1; |
6466 |
if ( de->stwerr[se] & (1 << 17) ) isFULL = 1; |
// if ( de->stwerr[se] & (1 << 17) ) isFULL = 1; |
6467 |
if ( de->stwerr[se] & (1 << 3) ) isRAW = 1; |
if ( de->stwerr[se] & (1 << 3) ) isRAW = 1; |
6468 |
// |
// |
6469 |
// save the prevoius energy deposit and calibration in sbase, sdexy, sdexyc |
// save the prevoius energy deposit and calibration in sbase, sdexy, sdexyc |
6473 |
for (Int_t nn = 0; nn < 96; nn++){ |
for (Int_t nn = 0; nn < 96; nn++){ |
6474 |
if ( nn%16 == 0 ) pre++; |
if ( nn%16 == 0 ) pre++; |
6475 |
evento.base[l][m][pre] = calib.calbase[l][m][pre]; |
evento.base[l][m][pre] = calib.calbase[l][m][pre]; |
6476 |
sdexy[l][m][nn] = evento.dexy[l][m][nn]; |
// sdexy[l][m][nn] = evento.dexy[l][m][nn]; |
6477 |
evento.dexy[l][m][nn] = de->dexy[l][m][nn] ; |
evento.dexy[l][m][nn] = de->dexy[l][m][nn] ; |
6478 |
sdexyc[l][m][nn] = evento.dexy[l][m][nn]; |
// sdexyc[l][m][nn] = evento.dexy[l][m][nn]; |
6479 |
evento.dexyc[l][m][nn] = de->dexy[l][m][nn] ; |
evento.dexyc[l][m][nn] = de->dexy[l][m][nn] ; |
6480 |
}; |
}; |
6481 |
}; |
}; |
6484 |
// |
// |
6485 |
Int_t done = 0; |
Int_t done = 0; |
6486 |
Int_t rdone = 0; |
Int_t rdone = 0; |
6487 |
Int_t fdone = 0; |
// Int_t fdone = 0; |
6488 |
pre = -1; |
pre = -1; |
6489 |
for (Int_t n =0 ; n < 96; n++){ |
for (Int_t n =0 ; n < 96; n++){ |
6490 |
if ( n%16 == 0 ) { |
if ( n%16 == 0 ) { |
6491 |
pre++; |
pre++; |
6492 |
done = 0; |
done = 0; |
6493 |
rdone = 0; |
rdone = 0; |
6494 |
fdone = 0; |
// fdone = 0; |
6495 |
}; |
}; |
6496 |
// |
// |
6497 |
// baseline check and calculation |
// baseline check and calculation |
6713 |
} |
} |
6714 |
|
|
6715 |
void FEVdetector::Calo1stcalib(){ |
void FEVdetector::Calo1stcalib(){ |
6716 |
Float_t estrip[2][22][96]; |
// Float_t estrip[2][22][96]; |
6717 |
// |
// |
6718 |
// this is the value of the mip for each strip. To be changed when we will have the real values |
// this is the value of the mip for each strip. To be changed when we will have the real values |
6719 |
// |
// |
6731 |
for (Int_t k = 0; k < 22; k++ ){ |
for (Int_t k = 0; k < 22; k++ ){ |
6732 |
for (Int_t l = 0; l < 96; l++ ){ |
for (Int_t l = 0; l < 96; l++ ){ |
6733 |
calib.calped[m][k][l] = 0. ; |
calib.calped[m][k][l] = 0. ; |
6734 |
estrip[m][k][l] = 0.; |
// estrip[m][k][l] = 0.; |
6735 |
}; |
}; |
6736 |
}; |
}; |
6737 |
} |
} |