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; |
98 |
var.S4 = 0; |
var.S4 = 0; |
99 |
var.ND = 0; |
var.ND = 0; |
100 |
var.INFOS = 0; |
var.INFOS = 0; |
134 |
}; |
}; |
135 |
|
|
136 |
void FEVdetector::GetWindow(){ |
void FEVdetector::GetWindow(){ |
|
otr->GetEntry(maxevent); |
|
137 |
// |
// |
138 |
|
if ( level.file == 2 ){ |
139 |
|
// printf("0qui\n"); |
140 |
|
L2->GetEntry(minevent); |
141 |
|
} else { |
142 |
|
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 |
otr->GetEntry(minevent); |
// |
155 |
|
if ( level.file == 2 ){ |
156 |
|
// printf("1qui\n"); |
157 |
|
L2->GetEntry(maxevent); |
158 |
|
} else { |
159 |
|
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 |
|
// |
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 |
|
L2->Clear(); |
198 |
|
// printf("qui\n"); |
199 |
L2->GetEntry(i); |
L2->GetEntry(i); |
200 |
ShowInfo("RunInfo"); |
ShowInfo("RunInfo"); |
201 |
ShowInfo("SoftInfo"); |
ShowInfo("SoftInfo"); |
|
ShowInfo("TrigLevel2"); |
|
202 |
ShowInfo("OrbitalInfo"); |
ShowInfo("OrbitalInfo"); |
203 |
|
ShowInfo("TrigLevel2"); |
204 |
ShowInfo("ToFLevel2"); |
ShowInfo("ToFLevel2"); |
205 |
ShowInfo("TrkLevel2"); |
ShowInfo("TrkLevel2"); |
206 |
ShowInfo("AcLevel2"); |
ShowInfo("AcLevel2"); |
210 |
ShowInfo("NDLevel2"); |
ShowInfo("NDLevel2"); |
211 |
} else { |
} else { |
212 |
otr->GetEntry(i); |
otr->GetEntry(i); |
213 |
|
ShowInfo("Pscu"); |
214 |
|
ShowInfo("Trigger"); |
215 |
|
ShowInfo("Tof"); |
216 |
|
ShowInfo("Tracker"); |
217 |
|
ShowInfo("Anticounter"); |
218 |
|
ShowInfo("Calorimeter"); |
219 |
|
ShowInfo("Neutron"); |
220 |
|
ShowInfo("S4"); |
221 |
}; |
}; |
222 |
} |
} |
223 |
|
|
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 |
}; |
}; |
380 |
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
381 |
Int_t length = min(len,dlen); |
Int_t length = min(len,dlen); |
382 |
// |
// |
383 |
// 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); |
384 |
switch (type){ |
switch (type){ |
385 |
case 0: |
case 0: |
386 |
// |
// |
413 |
// |
// |
414 |
// Unsigned integer |
// Unsigned integer |
415 |
// |
// |
416 |
if ( atype == -7 || atype == 13 ){ |
if ( atype == -7 || atype == 13 || atype == -9 || atype == -8 || atype == 12 ){ |
417 |
while ( j < length ){ |
while ( j < length ){ |
418 |
if ( j < length -1 ){ |
if ( j < length -1 ){ |
419 |
sprintf(o,"%s %i ,",o,(UInt_t)tb->GetValue(j,0)); |
sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0)); |
420 |
} else { |
} else { |
421 |
sprintf(o,"%s %i",o,(UInt_t)tb->GetValue(j,0)); |
sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0)); |
422 |
}; |
}; |
423 |
j++; |
j++; |
424 |
}; |
}; |
440 |
// Strings |
// Strings |
441 |
// |
// |
442 |
if ( atype == 45 ){ |
if ( atype == 45 ){ |
443 |
// TString *stringa = (TString*)(tb->GetValuePointer()); |
// TObjArray *cl = (TObjArray*)(tb->GetInfo()->GetOffsets())[tb->GetID()];//tb->GetValuePointer(); |
444 |
|
// TString *stringa = (TString*)(*cl)[0]; |
445 |
|
// TBranchElement *utb = (TBranchElement*)tb->GetBranchCount(); |
446 |
|
// TString** stringa = (TString*)(&tb->GetValuePointer()); |
447 |
|
//TStreamerElement *tste = (TStreamerElement*)tb->GetInfo()->GetCurrentElement(); |
448 |
|
|
449 |
|
// char *ladd; |
450 |
|
// ladd = tb->GetValuePointer() |
451 |
|
// TString *stringa = (TString*)((tste->GetOffset())); |
452 |
|
// TString& mstr = *stringa; |
453 |
|
// printf(" la mia stringa %s \n",mstr.Data()); |
454 |
|
// printf(" offset %i \n",(Int_t)utb->GetValue(0,0)); |
455 |
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
456 |
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
457 |
// TString *stringa = (TString*)tb->GetAddress(); |
// TString *stringa = (TString*)tb->GetAddress(); |
458 |
// printf(" address 0x%X \n",tb->GetAddress()); |
// printf(" address 0x%X \n",tb->GetAddress()); |
459 |
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
460 |
// printf(" object 0x%X \n",tb->GetObject()); |
// printf(" object 0x%X \n",tb->GetObject()); |
461 |
// printf("stringa %s lung %i\n",stringa->Data(),stringa->Length()); |
// printf("stringa %s lung %i\n",stringa.Data(),stringa.Length()); |
462 |
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
463 |
// if ( striglia ){ |
// if ( striglia ){ |
464 |
// char *pointer = (char *)striglia->GetValuePointer(); |
// char *pointer = (char *)striglia->GetValuePointer(); |
465 |
// TString *pr= (TString*)pointer; |
// TString *pr= (TString*)pointer; |
466 |
// printf("ciao %s \n",pr->Data()); |
// printf("ciao %s \n",pr->Data()); |
467 |
// }; |
// }; |
468 |
sprintf(o,"%s TString ",o); |
sprintf(o,"%s TString - not implemented yet -",o); |
469 |
}; |
}; |
470 |
// |
// |
471 |
// TArray |
// TArray |
565 |
// }; |
// }; |
566 |
// sprintf(o,"%s\n",o); |
// sprintf(o,"%s\n",o); |
567 |
// |
// |
568 |
sprintf(o,"%s TArray ",o); |
sprintf(o,"%s TArray - not implemented yet -",o); |
569 |
// |
// |
570 |
}; |
}; |
571 |
// |
// |
623 |
// |
// |
624 |
// Integer |
// Integer |
625 |
// |
// |
626 |
if ( satype == -17 ){ |
if ( satype == -17 || satype == -9 ){ |
627 |
// |
// |
628 |
setcolor(col,RESET, BLUE, WHITE); |
setcolor(col,RESET, BLUE, WHITE); |
629 |
setcolor(col2,RESET, BLACK, WHITE); |
setcolor(col2,RESET, BLACK, WHITE); |
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){ |
1018 |
// |
// |
1019 |
file = &mainfile; |
// file = &mainfile; |
|
// |
|
|
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); |
1041 |
|
// if ( runtree ) runtree->CanDeleteRefs(true); |
1042 |
|
// |
1043 |
} else { |
} else { |
1044 |
// |
// |
1045 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
1080 |
}; |
}; |
1081 |
// |
// |
1082 |
// |
// |
|
trigger = new pamela::trigger::TriggerEvent(); |
|
|
eh = new pamela::EventHeader(); |
|
|
ph = new pamela::PscuHeader(); |
|
|
// runinfo = new ItoRunInfo(file); |
|
|
// |
|
|
de = new pamela::calorimeter::CalorimeterEvent(); |
|
|
trk = new pamela::tracker::TrackerEvent(); |
|
|
ne = new pamela::neutron::NeutronEvent(); |
|
|
ace = new pamela::anticounter::AnticounterEvent(); |
|
|
s4 = new pamela::S4::S4Event(); |
|
|
tof = new pamela::tof::TofEvent(); |
|
|
// |
|
1083 |
// Load level0 file if the case |
// Load level0 file if the case |
1084 |
// |
// |
1085 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1086 |
|
// |
1087 |
|
trigger = new pamela::trigger::TriggerEvent(); |
1088 |
|
eh = new pamela::EventHeader(); |
1089 |
|
ph = new pamela::PscuHeader(); |
1090 |
|
de = new pamela::calorimeter::CalorimeterEvent(); |
1091 |
|
trk = new pamela::tracker::TrackerEvent(); |
1092 |
|
ne = new pamela::neutron::NeutronEvent(); |
1093 |
|
ace = new pamela::anticounter::AnticounterEvent(); |
1094 |
|
s4 = new pamela::S4::S4Event(); |
1095 |
|
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 |
}; |
}; |
1871 |
void FEVdetector::ShowTOF(){ |
void FEVdetector::ShowTOF(){ |
1872 |
// |
// |
1873 |
// |
// |
|
// |
|
1874 |
if ( !var.TOF ) return; |
if ( !var.TOF ) return; |
1875 |
// |
// |
1876 |
Int_t tt = 0; |
Int_t tt = 0; |
2706 |
// |
// |
2707 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= repuntil-1 ) repeat = false; |
2708 |
// |
// |
2709 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
// printf(" numtr is %i \n",numtr); |
2710 |
|
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
2711 |
//ptrack = L2->GetTrack(numtr); |
//ptrack = L2->GetTrack(numtr); |
2712 |
//ptt = ptrack->GetToFTrack(); |
//ptt = ptrack->GetToFTrack(); |
2713 |
}; |
}; |
5522 |
|
|
5523 |
void FEVdetector::ShowTrack(){ |
void FEVdetector::ShowTrack(){ |
5524 |
// |
// |
5525 |
|
if ( level.file != 2 ) return; |
5526 |
// |
// |
5527 |
// |
// |
5528 |
if ( var.CALO && false ){ |
// |
5529 |
|
if ( var.CALO && var.CALOT ){ |
5530 |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
5531 |
Float_t calx[22]; |
Float_t calx[22]; |
5532 |
Float_t caly[22]; |
Float_t caly[22]; |
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 |
// |
// |