| 83 |
thefigure = &figure; |
thefigure = &figure; |
| 84 |
checkctrlword(); |
checkctrlword(); |
| 85 |
var.selex = false; |
var.selex = false; |
| 86 |
|
var.showall = false; |
| 87 |
|
|
| 88 |
|
var.showsi = false; |
| 89 |
|
var.shownd = false; |
| 90 |
|
var.shows4 = false; |
| 91 |
|
var.showorb = false; |
| 92 |
|
var.showtof = false; |
| 93 |
|
var.showtrg = false; |
| 94 |
|
var.showtrk = false; |
| 95 |
|
var.showcal = false; |
| 96 |
|
var.showrun = false; |
| 97 |
|
var.showac = false; |
| 98 |
} |
} |
| 99 |
|
|
| 100 |
void FEVdetector::checkctrlword(){ |
void FEVdetector::checkctrlword(){ |
| 104 |
var.RUN = 1; |
var.RUN = 1; |
| 105 |
var.TRK = 0; |
var.TRK = 0; |
| 106 |
var.ORB = 1; |
var.ORB = 1; |
| 107 |
var.TRG = 0; |
var.TRG = 1; |
| 108 |
var.CALO = 0; |
var.CALO = 0; |
| 109 |
var.CALOT = 0; |
var.CALOT = 0; |
| 110 |
var.S4 = 0; |
var.S4 = 0; |
| 146 |
}; |
}; |
| 147 |
|
|
| 148 |
void FEVdetector::GetWindow(){ |
void FEVdetector::GetWindow(){ |
|
printf(" ah \n"); |
|
| 149 |
// |
// |
| 150 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 151 |
L2->GetEntry(maxevent); |
// printf("0qui\n"); |
| 152 |
|
L2->GetEntry(minevent); |
| 153 |
} else { |
} else { |
| 154 |
otr->GetEntry(maxevent); |
otr->GetEntry(minevent); |
| 155 |
} |
} |
|
// |
|
| 156 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
| 157 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
| 158 |
lastevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
| 159 |
} else { |
} else { |
| 160 |
if ( var.ORB ){ |
if ( var.ORB ){ |
| 161 |
lastevno = L2->GetOrbitalInfo()->pkt_num; |
firstevno = L2->GetOrbitalInfo()->pkt_num; |
| 162 |
} else { |
} else { |
| 163 |
lastevno = 0; |
firstevno = 0; |
| 164 |
}; |
}; |
| 165 |
}; |
}; |
| 166 |
printf(" mmh minev %u \n",minevent); |
// |
| 167 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 168 |
L2->GetEntry(minevent); |
// printf("1qui\n"); |
| 169 |
|
L2->GetEntry(maxevent); |
| 170 |
} else { |
} else { |
| 171 |
otr->GetEntry(minevent); |
otr->GetEntry(maxevent); |
| 172 |
} |
} |
| 173 |
|
// |
| 174 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
| 175 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
| 176 |
firstevno = (int)ph->Counter; |
lastevno = (int)ph->Counter; |
| 177 |
} else { |
} else { |
| 178 |
if ( var.ORB ){ |
if ( var.ORB ){ |
| 179 |
firstevno = L2->GetOrbitalInfo()->pkt_num; |
lastevno = L2->GetOrbitalInfo()->pkt_num; |
| 180 |
} else { |
} else { |
| 181 |
firstevno = 0; |
lastevno = 0; |
| 182 |
}; |
}; |
| 183 |
}; |
}; |
| 184 |
printf(" aaah \n"); |
// |
| 185 |
} |
} |
| 186 |
|
|
| 187 |
void FEVdetector::ClearVariables(){ |
void FEVdetector::ClearVariables(){ |
| 206 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
| 207 |
thisentry = i; |
thisentry = i; |
| 208 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 209 |
printf("qui \n"); |
L2->Clear(); |
| 210 |
|
// printf("qui\n"); |
| 211 |
L2->GetEntry(i); |
L2->GetEntry(i); |
| 212 |
printf("qua \n"); |
if ( var.showall ){ |
| 213 |
ShowInfo("RunInfo"); |
ShowInfo("RunInfo"); |
| 214 |
ShowInfo("SoftInfo"); |
ShowInfo("SoftInfo"); |
| 215 |
ShowInfo("OrbitalInfo"); |
ShowInfo("OrbitalInfo"); |
| 216 |
ShowInfo("TrigLevel2"); |
ShowInfo("TrigLevel2"); |
| 217 |
ShowInfo("ToFLevel2"); |
ShowInfo("ToFLevel2"); |
| 218 |
ShowInfo("TrkLevel2"); |
ShowInfo("TrkLevel2"); |
| 219 |
ShowInfo("AcLevel2"); |
ShowInfo("AcLevel2"); |
| 220 |
ShowInfo("CaloLevel2"); |
ShowInfo("CaloLevel2"); |
| 221 |
ShowInfo("CaloLevel1"); |
ShowInfo("CaloLevel1"); |
| 222 |
ShowInfo("S4Level2"); |
ShowInfo("S4Level2"); |
| 223 |
ShowInfo("NDLevel2"); |
ShowInfo("NDLevel2"); |
| 224 |
|
} else { |
| 225 |
|
if ( var.showrun ) ShowInfo("RunInfo"); |
| 226 |
|
if ( var.showsi ) ShowInfo("SoftInfo"); |
| 227 |
|
if ( var.showorb ) ShowInfo("OrbitalInfo"); |
| 228 |
|
if ( var.showtrg ) ShowInfo("TrigLevel2"); |
| 229 |
|
if ( var.showtof ) ShowInfo("ToFLevel2"); |
| 230 |
|
if ( var.showtrk ) ShowInfo("TrkLevel2"); |
| 231 |
|
if ( var.showac ) ShowInfo("AcLevel2"); |
| 232 |
|
if ( var.showcal ) ShowInfo("CaloLevel2"); |
| 233 |
|
if ( var.showcal ) ShowInfo("CaloLevel1"); |
| 234 |
|
if ( var.shows4 ) ShowInfo("S4Level2"); |
| 235 |
|
if ( var.shownd ) ShowInfo("NDLevel2"); |
| 236 |
|
}; |
| 237 |
} else { |
} else { |
| 238 |
otr->GetEntry(i); |
otr->GetEntry(i); |
| 239 |
ShowInfo("Pscu"); |
if ( var.showall ){ |
| 240 |
ShowInfo("Trigger"); |
ShowInfo("Pscu"); |
| 241 |
ShowInfo("Tof"); |
ShowInfo("Trigger"); |
| 242 |
ShowInfo("Tracker"); |
ShowInfo("Tof"); |
| 243 |
ShowInfo("Anticounter"); |
ShowInfo("Tracker"); |
| 244 |
ShowInfo("Calorimeter"); |
ShowInfo("Anticounter"); |
| 245 |
ShowInfo("Neutron"); |
ShowInfo("Calorimeter"); |
| 246 |
ShowInfo("S4"); |
ShowInfo("S4"); |
| 247 |
|
ShowInfo("Neutron"); |
| 248 |
|
} else { |
| 249 |
|
if ( var.showorb ) ShowInfo("Pscu"); |
| 250 |
|
if ( var.showtrg ) ShowInfo("Trigger"); |
| 251 |
|
if ( var.showtof ) ShowInfo("Tof"); |
| 252 |
|
if ( var.showtrk ) ShowInfo("Tracker"); |
| 253 |
|
if ( var.showac ) ShowInfo("Anticounter"); |
| 254 |
|
if ( var.showcal ) ShowInfo("Calorimeter"); |
| 255 |
|
if ( var.shows4 ) ShowInfo("S4"); |
| 256 |
|
if ( var.shownd ) ShowInfo("Neutron"); |
| 257 |
|
}; |
| 258 |
}; |
}; |
| 259 |
} |
} |
| 260 |
|
|
| 384 |
// TObjArray *leaf_array = 0; |
// TObjArray *leaf_array = 0; |
| 385 |
// |
// |
| 386 |
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
| 387 |
if ( runtree ) b1 = runtree->FindBranch(detector.Data()); |
if ( L2->GetRunTree() ) b1 = L2->GetRunTree()->FindBranch(detector.Data()); |
| 388 |
} else { |
} else { |
| 389 |
b1 = otr->FindBranch(detector.Data()); |
b1 = otr->FindBranch(detector.Data()); |
| 390 |
}; |
}; |
| 893 |
trcs = (TString)trc.str().c_str(); |
trcs = (TString)trc.str().c_str(); |
| 894 |
} else { |
} else { |
| 895 |
headcold = headc; |
headcold = headc; |
| 896 |
|
if ( var.RUN ){ |
| 897 |
|
var.idrun = L2->GetRunInfo()->ID; |
| 898 |
|
var.idroot = L2->GetRunInfo()->ID_ROOT_L0; |
| 899 |
|
var.EVF = L2->GetRunInfo()->EV_FROM; |
| 900 |
|
}; |
| 901 |
if ( var.ORB ){ |
if ( var.ORB ){ |
| 902 |
headc = L2->GetOrbitalInfo()->pkt_num; |
headc = L2->GetOrbitalInfo()->pkt_num; |
| 903 |
OBT = L2->GetOrbitalInfo()->OBT; |
OBT = L2->GetOrbitalInfo()->OBT; |
| 1051 |
// |
// |
| 1052 |
} |
} |
| 1053 |
|
|
| 1054 |
TChain* FEVdetector::Load(TFile &mainfile){ |
TChain* FEVdetector::Load(TString file){ |
|
// |
|
|
gObjectTable->Print(); |
|
| 1055 |
// |
// |
| 1056 |
file = &mainfile; |
// file = &mainfile; |
|
// |
|
|
// if ( otr ) otr->Reset(); |
|
|
// if ( runtree ) runtree->Reset(); |
|
|
if ( runtree ){ |
|
|
printf(" runtree residuo \n"); |
|
|
if ( runtree->GetFile() ){ |
|
|
printf("chiudi file \n"); |
|
|
// runtree->GetFile()->Close("R"); |
|
|
}; |
|
|
}; |
|
|
// |
|
|
if ( runtree ){ |
|
|
printf(" clear runtree \n"); |
|
|
runtree->Clear(); |
|
|
printf(" delete runtree \n"); |
|
|
delete runtree; |
|
|
}; |
|
|
// if ( runtree ) runtree->Print(); |
|
|
if ( otr ){ |
|
|
printf(" otr residuo \n"); |
|
|
// if ( otr->GetFile() ) otr->GetFile()->Close("R"); |
|
|
// otr->ResetBranchAddresses(); |
|
|
}; |
|
|
if ( otr ){ |
|
|
printf("proviamo ad ammazzarlo di brutto\n"); |
|
|
// otr->Clear(); |
|
|
printf("proviamo ad ammazzarlo di brutto\n"); |
|
|
otr->Delete(); |
|
|
printf("proviamo ad ammazzarlo di brutto\n"); |
|
|
//delete otr; |
|
|
printf("speriamo sia rimasto secco\n"); |
|
|
}; |
|
|
// if ( otr ){ |
|
|
// otr->DropBaskets(); |
|
|
// otr->Delete("all"); |
|
|
// }; |
|
|
// if ( runtree ){ |
|
|
// runtree->DropBaskets(); |
|
|
// runtree->Delete("all"); |
|
|
// }; |
|
|
if ( runtree ) printf("2 runtree residuo \n"); |
|
|
// if ( runtree ) runtree->Print(); |
|
|
if ( otr ) printf("2 otr residuo \n"); |
|
|
// if ( otr ) otr->Print(); |
|
|
// |
|
|
L2 = new PamLevel2(); |
|
| 1057 |
// |
// |
| 1058 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 1059 |
// |
// |
| 1060 |
printf(" %s \n",ddec.Data()); |
printf(" %s \n",ddec.Data()); |
| 1061 |
otr = L2->GetPamTree(gSystem->DirName(file->GetName()),file->GetName(),ddec.Data()); |
if ( !L2 ){ |
| 1062 |
runtree = L2->GetRunTree(gSystem->DirName(file->GetName()),file->GetName()); |
L2 = new PamLevel2("",file.Data(),ddec.Data()); |
| 1063 |
|
otr = L2->GetPamTree(); |
| 1064 |
|
printf(" l2 constructor\n"); |
| 1065 |
|
// printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot); |
| 1066 |
|
} else { |
| 1067 |
|
// |
| 1068 |
|
printf(" l2 already exist \n"); |
| 1069 |
|
otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data()); |
| 1070 |
|
L2->GetRunTree(gSystem->DirName(file.Data()),file.Data()); |
| 1071 |
|
// |
| 1072 |
|
}; |
| 1073 |
|
// |
| 1074 |
// |
// |
| 1075 |
if ( !otr ) return(0); |
if ( !otr ) return(0); |
| 1076 |
// |
// |
| 1077 |
otr->CanDeleteRefs(true); |
// otr->CanDeleteRefs(true); |
| 1078 |
if ( runtree ) runtree->CanDeleteRefs(true); |
// if ( runtree ) runtree->CanDeleteRefs(true); |
| 1079 |
// |
// |
| 1080 |
} else { |
} else { |
| 1081 |
// |
// |
| 1132 |
tof = new pamela::tof::TofEvent(); |
tof = new pamela::tof::TofEvent(); |
| 1133 |
// |
// |
| 1134 |
otr = new TChain("Physics"); |
otr = new TChain("Physics"); |
| 1135 |
otr->Add(file->GetName(),-1); |
otr->Add(file.Data(),-1); |
| 1136 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
| 1137 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
| 1138 |
}; |
}; |
| 1589 |
if ( calotrig ){ |
if ( calotrig ){ |
| 1590 |
printf(" Pkt_num: %i - Progressive number: %i - CALO trigger -\n",(int)headc,thisentry+1); |
printf(" Pkt_num: %i - Progressive number: %i - CALO trigger -\n",(int)headc,thisentry+1); |
| 1591 |
}; |
}; |
| 1592 |
printf(" On Board Time: %i (delta %i) [ms]\n",OBT,DOBT); |
printf(" On Board Time: %u (delta %i) [ms]\n",OBT,DOBT); |
| 1593 |
const char *trc2 = trcs; |
const char *trc2 = trcs; |
| 1594 |
printf(" TRIGGER: %s \n",trc2); |
printf(" TRIGGER: %s \n",trc2); |
| 1595 |
printf(" AC: CARD hit = %i CAT hit = %i CAS hit = %i \n",var.hcard,var.hcat,var.hcas); |
printf(" AC: CARD hit = %i CAT hit = %i CAS hit = %i \n",var.hcard,var.hcat,var.hcas); |
| 5559 |
|
|
| 5560 |
void FEVdetector::ShowTrack(){ |
void FEVdetector::ShowTrack(){ |
| 5561 |
// |
// |
| 5562 |
|
if ( level.file != 2 ) return; |
| 5563 |
|
// |
| 5564 |
// |
// |
| 5565 |
// |
// |
| 5566 |
if ( var.CALO && var.CALOT ){ |
if ( var.CALO && var.CALOT ){ |
| 5658 |
}; |
}; |
| 5659 |
}; |
}; |
| 5660 |
// |
// |
| 5661 |
if ( !var.TRK || level.file != 2 ) return; |
if ( !var.TRK ) return; |
| 5662 |
// |
// |
| 5663 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5664 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5665 |
|
|
| 5666 |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
| 5667 |
|
// printf("qui \n"); |
| 5668 |
PamTrack *ptrack = L2->GetTrack(nt); |
PamTrack *ptrack = L2->GetTrack(nt); |
| 5669 |
TrkTrack *track = ptrack->GetTrkTrack(); |
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5670 |
|
// printf("qua \n"); |
| 5671 |
Int_t npoint = 100; |
Int_t npoint = 100; |
| 5672 |
Float_t zin[100]; |
Float_t zin[100]; |
| 5673 |
Double_t xout[100]; |
Double_t xout[100]; |
| 5875 |
Int_t se = 5; |
Int_t se = 5; |
| 5876 |
if ( !l && m%2 == 0 ) se = 3; |
if ( !l && m%2 == 0 ) se = 3; |
| 5877 |
if ( !l && m%2 != 0 ) se = 2; |
if ( !l && m%2 != 0 ) se = 2; |
| 5878 |
if ( l && m%2 == 0 ) se = 1; |
if ( l && m%2 != 0 ) se = 1; |
| 5879 |
if ( l && m%2 != 0 ) se = 0; |
if ( l && m%2 == 0 ) se = 0; |
| 5880 |
// |
// |
| 5881 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
| 5882 |
// |
// |
| 6083 |
Int_t se = 5; |
Int_t se = 5; |
| 6084 |
if (l == 0 && m%2 == 0) se = 3; |
if (l == 0 && m%2 == 0) se = 3; |
| 6085 |
if (l == 0 && m%2 != 0) se = 2; |
if (l == 0 && m%2 != 0) se = 2; |
| 6086 |
if (l == 1 && m%2 == 0) se = 1; |
if (l == 1 && m%2 != 0) se = 1; |
| 6087 |
if (l == 1 && m%2 != 0) se = 0; |
if (l == 1 && m%2 == 0) se = 0; |
| 6088 |
// |
// |
| 6089 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
| 6090 |
// |
// |