| 92 |
var.RUN = 1; |
var.RUN = 1; |
| 93 |
var.TRK = 0; |
var.TRK = 0; |
| 94 |
var.ORB = 1; |
var.ORB = 1; |
| 95 |
var.TRG = 0; |
var.TRG = 1; |
| 96 |
var.CALO = 0; |
var.CALO = 0; |
| 97 |
var.CALOT = 0; |
var.CALOT = 0; |
| 98 |
var.S4 = 0; |
var.S4 = 0; |
| 134 |
}; |
}; |
| 135 |
|
|
| 136 |
void FEVdetector::GetWindow(){ |
void FEVdetector::GetWindow(){ |
|
printf(" ah \n"); |
|
| 137 |
// |
// |
| 138 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 139 |
L2->GetEntry(maxevent); |
// printf("0qui\n"); |
| 140 |
|
L2->GetEntry(minevent); |
| 141 |
} else { |
} else { |
| 142 |
otr->GetEntry(maxevent); |
otr->GetEntry(minevent); |
| 143 |
} |
} |
|
// |
|
| 144 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
| 145 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
| 146 |
lastevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
| 147 |
} else { |
} else { |
| 148 |
if ( var.ORB ){ |
if ( var.ORB ){ |
| 149 |
lastevno = L2->GetOrbitalInfo()->pkt_num; |
firstevno = L2->GetOrbitalInfo()->pkt_num; |
| 150 |
} else { |
} else { |
| 151 |
lastevno = 0; |
firstevno = 0; |
| 152 |
}; |
}; |
| 153 |
}; |
}; |
| 154 |
printf(" mmh minev %u \n",minevent); |
// |
| 155 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 156 |
L2->GetEntry(minevent); |
// printf("1qui\n"); |
| 157 |
|
L2->GetEntry(maxevent); |
| 158 |
} else { |
} else { |
| 159 |
otr->GetEntry(minevent); |
otr->GetEntry(maxevent); |
| 160 |
} |
} |
| 161 |
|
// |
| 162 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
| 163 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
| 164 |
firstevno = (int)ph->Counter; |
lastevno = (int)ph->Counter; |
| 165 |
} else { |
} else { |
| 166 |
if ( var.ORB ){ |
if ( var.ORB ){ |
| 167 |
firstevno = L2->GetOrbitalInfo()->pkt_num; |
lastevno = L2->GetOrbitalInfo()->pkt_num; |
| 168 |
} else { |
} else { |
| 169 |
firstevno = 0; |
lastevno = 0; |
| 170 |
}; |
}; |
| 171 |
}; |
}; |
| 172 |
printf(" aaah \n"); |
// |
| 173 |
} |
} |
| 174 |
|
|
| 175 |
void FEVdetector::ClearVariables(){ |
void FEVdetector::ClearVariables(){ |
| 194 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
| 195 |
thisentry = i; |
thisentry = i; |
| 196 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 197 |
printf("qui \n"); |
L2->Clear(); |
| 198 |
|
// printf("qui\n"); |
| 199 |
L2->GetEntry(i); |
L2->GetEntry(i); |
|
printf("qua \n"); |
|
| 200 |
ShowInfo("RunInfo"); |
ShowInfo("RunInfo"); |
| 201 |
ShowInfo("SoftInfo"); |
ShowInfo("SoftInfo"); |
| 202 |
ShowInfo("OrbitalInfo"); |
ShowInfo("OrbitalInfo"); |
| 347 |
// TObjArray *leaf_array = 0; |
// TObjArray *leaf_array = 0; |
| 348 |
// |
// |
| 349 |
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
| 350 |
if ( runtree ) b1 = runtree->FindBranch(detector.Data()); |
if ( L2->GetRunTree() ) b1 = L2->GetRunTree()->FindBranch(detector.Data()); |
| 351 |
} else { |
} else { |
| 352 |
b1 = otr->FindBranch(detector.Data()); |
b1 = otr->FindBranch(detector.Data()); |
| 353 |
}; |
}; |
| 856 |
trcs = (TString)trc.str().c_str(); |
trcs = (TString)trc.str().c_str(); |
| 857 |
} else { |
} else { |
| 858 |
headcold = headc; |
headcold = headc; |
| 859 |
|
if ( var.RUN ){ |
| 860 |
|
var.idrun = L2->GetRunInfo()->ID; |
| 861 |
|
var.idroot = L2->GetRunInfo()->ID_ROOT_L0; |
| 862 |
|
var.EVF = L2->GetRunInfo()->EV_FROM; |
| 863 |
|
}; |
| 864 |
if ( var.ORB ){ |
if ( var.ORB ){ |
| 865 |
headc = L2->GetOrbitalInfo()->pkt_num; |
headc = L2->GetOrbitalInfo()->pkt_num; |
| 866 |
OBT = L2->GetOrbitalInfo()->OBT; |
OBT = L2->GetOrbitalInfo()->OBT; |
| 1014 |
// |
// |
| 1015 |
} |
} |
| 1016 |
|
|
| 1017 |
TChain* FEVdetector::Load(TFile &mainfile){ |
TChain* FEVdetector::Load(TString file){ |
|
// |
|
|
gObjectTable->Print(); |
|
| 1018 |
// |
// |
| 1019 |
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(); |
|
| 1020 |
// |
// |
| 1021 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
| 1022 |
// |
// |
| 1023 |
printf(" %s \n",ddec.Data()); |
printf(" %s \n",ddec.Data()); |
| 1024 |
otr = L2->GetPamTree(gSystem->DirName(file->GetName()),file->GetName(),ddec.Data()); |
if ( !L2 ){ |
| 1025 |
runtree = L2->GetRunTree(gSystem->DirName(file->GetName()),file->GetName()); |
L2 = new PamLevel2("",file.Data(),ddec.Data()); |
| 1026 |
|
otr = L2->GetPamTree(); |
| 1027 |
|
printf(" l2 constructor\n"); |
| 1028 |
|
// printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot); |
| 1029 |
|
} else { |
| 1030 |
|
// |
| 1031 |
|
printf(" l2 already exist \n"); |
| 1032 |
|
otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data()); |
| 1033 |
|
L2->GetRunTree(gSystem->DirName(file.Data()),file.Data()); |
| 1034 |
|
// |
| 1035 |
|
}; |
| 1036 |
|
// |
| 1037 |
// |
// |
| 1038 |
if ( !otr ) return(0); |
if ( !otr ) return(0); |
| 1039 |
// |
// |
| 1040 |
otr->CanDeleteRefs(true); |
// otr->CanDeleteRefs(true); |
| 1041 |
if ( runtree ) runtree->CanDeleteRefs(true); |
// if ( runtree ) runtree->CanDeleteRefs(true); |
| 1042 |
// |
// |
| 1043 |
} else { |
} else { |
| 1044 |
// |
// |
| 1095 |
tof = new pamela::tof::TofEvent(); |
tof = new pamela::tof::TofEvent(); |
| 1096 |
// |
// |
| 1097 |
otr = new TChain("Physics"); |
otr = new TChain("Physics"); |
| 1098 |
otr->Add(file->GetName(),-1); |
otr->Add(file.Data(),-1); |
| 1099 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
| 1100 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
| 1101 |
}; |
}; |
| 5522 |
|
|
| 5523 |
void FEVdetector::ShowTrack(){ |
void FEVdetector::ShowTrack(){ |
| 5524 |
// |
// |
| 5525 |
|
if ( level.file != 2 ) return; |
| 5526 |
|
// |
| 5527 |
// |
// |
| 5528 |
// |
// |
| 5529 |
if ( var.CALO && var.CALOT ){ |
if ( var.CALO && var.CALOT ){ |
| 5621 |
}; |
}; |
| 5622 |
}; |
}; |
| 5623 |
// |
// |
| 5624 |
if ( !var.TRK || level.file != 2 ) return; |
if ( !var.TRK ) return; |
| 5625 |
// |
// |
| 5626 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
| 5627 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
| 5628 |
|
|
| 5629 |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
| 5630 |
|
// printf("qui \n"); |
| 5631 |
PamTrack *ptrack = L2->GetTrack(nt); |
PamTrack *ptrack = L2->GetTrack(nt); |
| 5632 |
TrkTrack *track = ptrack->GetTrkTrack(); |
TrkTrack *track = ptrack->GetTrkTrack(); |
| 5633 |
|
// printf("qua \n"); |
| 5634 |
Int_t npoint = 100; |
Int_t npoint = 100; |
| 5635 |
Float_t zin[100]; |
Float_t zin[100]; |
| 5636 |
Double_t xout[100]; |
Double_t xout[100]; |
| 5838 |
Int_t se = 5; |
Int_t se = 5; |
| 5839 |
if ( !l && m%2 == 0 ) se = 3; |
if ( !l && m%2 == 0 ) se = 3; |
| 5840 |
if ( !l && m%2 != 0 ) se = 2; |
if ( !l && m%2 != 0 ) se = 2; |
| 5841 |
if ( l && m%2 == 0 ) se = 1; |
if ( l && m%2 != 0 ) se = 1; |
| 5842 |
if ( l && m%2 != 0 ) se = 0; |
if ( l && m%2 == 0 ) se = 0; |
| 5843 |
// |
// |
| 5844 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
| 5845 |
// |
// |
| 6046 |
Int_t se = 5; |
Int_t se = 5; |
| 6047 |
if (l == 0 && m%2 == 0) se = 3; |
if (l == 0 && m%2 == 0) se = 3; |
| 6048 |
if (l == 0 && m%2 != 0) se = 2; |
if (l == 0 && m%2 != 0) se = 2; |
| 6049 |
if (l == 1 && m%2 == 0) se = 1; |
if (l == 1 && m%2 != 0) se = 1; |
| 6050 |
if (l == 1 && m%2 != 0) se = 0; |
if (l == 1 && m%2 == 0) se = 0; |
| 6051 |
// |
// |
| 6052 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
| 6053 |
// |
// |