| 71 |
// |
// |
| 72 |
Bool_t verbose = false; |
Bool_t verbose = false; |
| 73 |
// |
// |
| 74 |
Bool_t standalone = true; |
Bool_t standalone = false; |
| 75 |
// |
// |
| 76 |
if ( OrbitalInfoargc > 0 ){ |
if ( OrbitalInfoargc > 0 ){ |
| 77 |
i = 0; |
i = 0; |
| 623 |
// |
// |
| 624 |
// paranoid check |
// paranoid check |
| 625 |
// |
// |
| 626 |
if ( (atime > runinfo->RUNTRAILER_TIME) || (atime < runinfo->RUNHEADER_TIME) ) { |
if ( (atime > (runinfo->RUNTRAILER_TIME+1)) || (atime < (runinfo->RUNHEADER_TIME-1)) ) { |
| 627 |
if (verbose) printf(" OrbitalInfo - WARNING: event at time outside the run time window, skipping it\n"); |
if (verbose) printf(" OrbitalInfo - WARNING: event at time outside the run time window, skipping it\n"); |
| 628 |
jumped++; |
jumped++; |
| 629 |
// debug = true; |
// debug = true; |
| 981 |
orbitalinfo->BB0 = babs/bequ; |
orbitalinfo->BB0 = babs/bequ; |
| 982 |
orbitalinfo->L = xl; |
orbitalinfo->L = xl; |
| 983 |
// Set Stormer vertical cutoff using L shell. |
// Set Stormer vertical cutoff using L shell. |
| 984 |
orbitalinfo->cutoff[0] = 14.9/(xl*xl); |
orbitalinfo->cutoffsvl = 14.9/(xl*xl); |
| 985 |
// |
// |
| 986 |
}; |
}; |
| 987 |
// |
// |
| 997 |
TMatrixD Dij = PO->GreenwichtoGEO(orbitalinfo->lat,orbitalinfo->lon,Fij); |
TMatrixD Dij = PO->GreenwichtoGEO(orbitalinfo->lat,orbitalinfo->lon,Fij); |
| 998 |
TMatrixD Iij = PO->ColPermutation(Dij); |
TMatrixD Iij = PO->ColPermutation(Dij); |
| 999 |
// |
// |
| 1000 |
|
orbitalinfo->Iij.ResizeTo(Iij); |
| 1001 |
|
orbitalinfo->Iij = Iij; |
| 1002 |
|
// |
| 1003 |
A1 = Iij(0,2); |
A1 = Iij(0,2); |
| 1004 |
A2 = Iij(1,2); |
A2 = Iij(1,2); |
| 1005 |
A3 = Iij(2,2); |
A3 = Iij(2,2); |
| 1006 |
// |
// |
| 1007 |
orbitalinfo->pamzenitangle = (Float_t)PO->GetPitchAngle(1,0,0,A1,A2,A3); // Angle between zenit and Pamela's main axiz |
// orbitalinfo->pamzenitangle = (Float_t)PO->GetPitchAngle(1,0,0,A1,A2,A3); // Angle between zenit and Pamela's main axiz |
| 1008 |
orbitalinfo->pamBangle = (Float_t)PO->GetPitchAngle(A1,A2,A3,Bx,By,Bz); // Angle between Pamela's main axiz and B |
// orbitalinfo->pamBangle = (Float_t)PO->GetPitchAngle(A1,A2,A3,Bx,By,Bz); // Angle between Pamela's main axiz and B |
| 1009 |
// |
// |
| 1010 |
if ( !standalone && tof->ntrk() > 0 ){ |
if ( !standalone && tof->ntrk() > 0 ){ |
| 1011 |
// |
// |
| 1019 |
Double_t E22x = ptt->xtr_tof[3];//tr->x[3]; |
Double_t E22x = ptt->xtr_tof[3];//tr->x[3]; |
| 1020 |
Double_t E22y = ptt->ytr_tof[3];//tr->y[3]; |
Double_t E22y = ptt->ytr_tof[3];//tr->y[3]; |
| 1021 |
Double_t E22z = zin[3]; |
Double_t E22z = zin[3]; |
| 1022 |
if ( E11x < 100. && E11y < 100. && E22x < 100. && E22y < 100. ){ |
if ( (E11x < 100. && E11y < 100. && E22x < 100. && E22y < 100.) || ptt->trkseqno != -1 ){ |
| 1023 |
Double_t norm = sqrt(pow(E22x-E11x,2)+pow(E22y-E11y,2)+pow(E22z-E11z,2)); |
Double_t norm = sqrt(pow(E22x-E11x,2)+pow(E22y-E11y,2)+pow(E22z-E11z,2)); |
| 1024 |
Double_t MyAzim = TMath::RadToDeg()*atan(TMath::Abs(E22y-E11y)/TMath::Abs(E22x-E11x)); |
Double_t MyAzim = TMath::RadToDeg()*atan(TMath::Abs(E22y-E11y)/TMath::Abs(E22x-E11x)); |
| 1025 |
if(E22x-E11x>=0 && E22y-E11y <0) MyAzim = 360. - MyAzim; |
if(E22x-E11x>=0 && E22y-E11y <0) MyAzim = 360. - MyAzim; |
| 1030 |
Py = (E22y-E11y)/norm; |
Py = (E22y-E11y)/norm; |
| 1031 |
Pz = (E22z-E11z)/norm; |
Pz = (E22z-E11z)/norm; |
| 1032 |
// |
// |
|
TMatrixD Eij = PO->PamelatoGEO(Iij,Px,Py,Pz); |
|
|
// |
|
| 1033 |
t_orb->trkseqno = ptt->trkseqno; |
t_orb->trkseqno = ptt->trkseqno; |
| 1034 |
|
// |
| 1035 |
|
TMatrixD Eij = PO->PamelatoGEO(Iij,Px,Py,Pz); |
| 1036 |
|
t_orb->Eij.ResizeTo(Eij); |
| 1037 |
|
t_orb->Eij = Eij; |
| 1038 |
|
// |
| 1039 |
|
TMatrixD Sij = PO->PamelatoGEO(Fij,Px,Py,Pz); |
| 1040 |
|
t_orb->Sij.ResizeTo(Sij); |
| 1041 |
|
t_orb->Sij = Sij; |
| 1042 |
|
// |
| 1043 |
t_orb->pitch = (Float_t)PO->GetPitchAngle(Eij(0,0),Eij(1,0),Eij(2,0),Bx,By,Bz); |
t_orb->pitch = (Float_t)PO->GetPitchAngle(Eij(0,0),Eij(1,0),Eij(2,0),Bx,By,Bz); |
| 1044 |
|
// |
| 1045 |
|
// |
| 1046 |
|
Double_t omega = PO->GetPitchAngle(Eij(0,0),Eij(1,0),Eij(2,0),cos(orbitalinfo->lon+TMath::Pi()/2)-sin(orbitalinfo->lon+TMath::Pi()/2),cos(orbitalinfo->lon+TMath::Pi()/2)+sin(orbitalinfo->lon+TMath::Pi()/2),1); |
| 1047 |
|
// |
| 1048 |
|
t_orb->cutoff = 59.3/(pow(orbitalinfo->L,2)*pow((1+sqrt(1-pow(orbitalinfo->L,-3/2)*cos(omega))),2)); |
| 1049 |
|
// |
| 1050 |
|
if ( debug ) printf(" orbitalinfo->cutoffsvl %f vitaly %f \n",orbitalinfo->cutoffsvl,t_orb->cutoff); |
| 1051 |
// |
// |
| 1052 |
new(tor[nn]) OrbitalInfoTrkVar(*t_orb); |
new(tor[nn]) OrbitalInfoTrkVar(*t_orb); |
| 1053 |
nn++; |
nn++; |
| 1061 |
if ( debug ) printf(" mmm... mode %u standalone %i ntrk %i \n",orbitalinfo->mode,standalone,tof->ntrk()); |
if ( debug ) printf(" mmm... mode %u standalone %i ntrk %i \n",orbitalinfo->mode,standalone,tof->ntrk()); |
| 1062 |
}; |
}; |
| 1063 |
// |
// |
| 1064 |
|
} else { |
| 1065 |
|
if ( !standalone && tof->ntrk() > 0 ){ |
| 1066 |
|
// |
| 1067 |
|
Int_t nn = 0; |
| 1068 |
|
for(Int_t nt=0; nt < tof->ntrk(); nt++){ |
| 1069 |
|
// |
| 1070 |
|
ToFTrkVar *ptt = tof->GetToFTrkVar(nt); |
| 1071 |
|
if ( ptt->trkseqno != -1 ){ |
| 1072 |
|
// |
| 1073 |
|
t_orb->trkseqno = ptt->trkseqno; |
| 1074 |
|
// |
| 1075 |
|
t_orb->Eij = 0; |
| 1076 |
|
// |
| 1077 |
|
t_orb->Sij = 0; |
| 1078 |
|
// |
| 1079 |
|
t_orb->pitch = -1000.; |
| 1080 |
|
// |
| 1081 |
|
t_orb->cutoff = -1000.; |
| 1082 |
|
// |
| 1083 |
|
new(tor[nn]) OrbitalInfoTrkVar(*t_orb); |
| 1084 |
|
nn++; |
| 1085 |
|
// |
| 1086 |
|
t_orb->Clear(); |
| 1087 |
|
// |
| 1088 |
|
}; |
| 1089 |
|
// |
| 1090 |
|
}; |
| 1091 |
|
}; |
| 1092 |
}; |
}; |
| 1093 |
// |
// |
| 1094 |
// Fill the class |
// Fill the class |