94 |
var.ORB = 1; |
var.ORB = 1; |
95 |
var.TRG = 0; |
var.TRG = 0; |
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 |
|
L2->GetEntry(minevent); |
140 |
|
} else { |
141 |
|
otr->GetEntry(minevent); |
142 |
|
} |
143 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
144 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
145 |
lastevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
146 |
} else { |
} else { |
147 |
if ( var.ORB ){ |
if ( var.ORB ){ |
148 |
lastevno = L2->GetOrbitalInfo()->pkt_num; |
firstevno = L2->GetOrbitalInfo()->pkt_num; |
149 |
} else { |
} else { |
150 |
lastevno = 0; |
firstevno = 0; |
151 |
}; |
}; |
152 |
}; |
}; |
153 |
otr->GetEntry(minevent); |
// |
154 |
|
if ( level.file == 2 ){ |
155 |
|
L2->GetEntry(maxevent); |
156 |
|
} else { |
157 |
|
otr->GetEntry(maxevent); |
158 |
|
} |
159 |
|
// |
160 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
161 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
162 |
firstevno = (int)ph->Counter; |
lastevno = (int)ph->Counter; |
163 |
} else { |
} else { |
164 |
if ( var.ORB ){ |
if ( var.ORB ){ |
165 |
firstevno = L2->GetOrbitalInfo()->pkt_num; |
lastevno = L2->GetOrbitalInfo()->pkt_num; |
166 |
} else { |
} else { |
167 |
firstevno = 0; |
lastevno = 0; |
168 |
}; |
}; |
169 |
}; |
}; |
170 |
|
// |
171 |
} |
} |
172 |
|
|
173 |
void FEVdetector::ClearVariables(){ |
void FEVdetector::ClearVariables(){ |
192 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
193 |
thisentry = i; |
thisentry = i; |
194 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
195 |
|
L2->Clear(); |
196 |
L2->GetEntry(i); |
L2->GetEntry(i); |
197 |
ShowInfo("RunInfo"); |
ShowInfo("RunInfo"); |
198 |
ShowInfo("SoftInfo"); |
ShowInfo("SoftInfo"); |
|
ShowInfo("TrigLevel2"); |
|
199 |
ShowInfo("OrbitalInfo"); |
ShowInfo("OrbitalInfo"); |
200 |
|
ShowInfo("TrigLevel2"); |
201 |
ShowInfo("ToFLevel2"); |
ShowInfo("ToFLevel2"); |
202 |
ShowInfo("TrkLevel2"); |
ShowInfo("TrkLevel2"); |
203 |
ShowInfo("AcLevel2"); |
ShowInfo("AcLevel2"); |
207 |
ShowInfo("NDLevel2"); |
ShowInfo("NDLevel2"); |
208 |
} else { |
} else { |
209 |
otr->GetEntry(i); |
otr->GetEntry(i); |
210 |
|
ShowInfo("Pscu"); |
211 |
|
ShowInfo("Trigger"); |
212 |
|
ShowInfo("Tof"); |
213 |
|
ShowInfo("Tracker"); |
214 |
|
ShowInfo("Anticounter"); |
215 |
|
ShowInfo("Calorimeter"); |
216 |
|
ShowInfo("Neutron"); |
217 |
|
ShowInfo("S4"); |
218 |
}; |
}; |
219 |
} |
} |
220 |
|
|
344 |
// TObjArray *leaf_array = 0; |
// TObjArray *leaf_array = 0; |
345 |
// |
// |
346 |
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
if ( !strcmp(detector.Data(),"RunInfo") || !strcmp(detector.Data(),"SoftInfo") ){ |
347 |
if ( runtree ) b1 = runtree->FindBranch(detector.Data()); |
if ( L2->GetRunTree() ) b1 = L2->GetRunTree()->FindBranch(detector.Data()); |
348 |
} else { |
} else { |
349 |
b1 = otr->FindBranch(detector.Data()); |
b1 = otr->FindBranch(detector.Data()); |
350 |
}; |
}; |
377 |
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; |
378 |
Int_t length = min(len,dlen); |
Int_t length = min(len,dlen); |
379 |
// |
// |
380 |
// 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); |
381 |
switch (type){ |
switch (type){ |
382 |
case 0: |
case 0: |
383 |
// |
// |
410 |
// |
// |
411 |
// Unsigned integer |
// Unsigned integer |
412 |
// |
// |
413 |
if ( atype == -7 || atype == 13 ){ |
if ( atype == -7 || atype == 13 || atype == -9 || atype == -8 || atype == 12 ){ |
414 |
while ( j < length ){ |
while ( j < length ){ |
415 |
if ( j < length -1 ){ |
if ( j < length -1 ){ |
416 |
sprintf(o,"%s %i ,",o,(UInt_t)tb->GetValue(j,0)); |
sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0)); |
417 |
} else { |
} else { |
418 |
sprintf(o,"%s %i",o,(UInt_t)tb->GetValue(j,0)); |
sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0)); |
419 |
}; |
}; |
420 |
j++; |
j++; |
421 |
}; |
}; |
437 |
// Strings |
// Strings |
438 |
// |
// |
439 |
if ( atype == 45 ){ |
if ( atype == 45 ){ |
440 |
// TString *stringa = (TString*)(tb->GetValuePointer()); |
// TObjArray *cl = (TObjArray*)(tb->GetInfo()->GetOffsets())[tb->GetID()];//tb->GetValuePointer(); |
441 |
|
// TString *stringa = (TString*)(*cl)[0]; |
442 |
|
// TBranchElement *utb = (TBranchElement*)tb->GetBranchCount(); |
443 |
|
// TString** stringa = (TString*)(&tb->GetValuePointer()); |
444 |
|
//TStreamerElement *tste = (TStreamerElement*)tb->GetInfo()->GetCurrentElement(); |
445 |
|
|
446 |
|
// char *ladd; |
447 |
|
// ladd = tb->GetValuePointer() |
448 |
|
// TString *stringa = (TString*)((tste->GetOffset())); |
449 |
|
// TString& mstr = *stringa; |
450 |
|
// printf(" la mia stringa %s \n",mstr.Data()); |
451 |
|
// printf(" offset %i \n",(Int_t)utb->GetValue(0,0)); |
452 |
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
// int pointer = (tb->GetInfo()->GetOffsets())[tb->GetID()]; |
453 |
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
// TString *stringa = (TString*)(tb->GetInfo()->GetOffsets())[tb->GetID()]; |
454 |
// TString *stringa = (TString*)tb->GetAddress(); |
// TString *stringa = (TString*)tb->GetAddress(); |
455 |
// printf(" address 0x%X \n",tb->GetAddress()); |
// printf(" address 0x%X \n",tb->GetAddress()); |
456 |
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
// printf(" pointer 0x%X \n",tb->GetValuePointer()); |
457 |
// printf(" object 0x%X \n",tb->GetObject()); |
// printf(" object 0x%X \n",tb->GetObject()); |
458 |
// printf("stringa %s lung %i\n",stringa->Data(),stringa->Length()); |
// printf("stringa %s lung %i\n",stringa.Data(),stringa.Length()); |
459 |
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
// TLeaf *striglia = tb->FindLeaf(tb->GetName()); |
460 |
// if ( striglia ){ |
// if ( striglia ){ |
461 |
// char *pointer = (char *)striglia->GetValuePointer(); |
// char *pointer = (char *)striglia->GetValuePointer(); |
462 |
// TString *pr= (TString*)pointer; |
// TString *pr= (TString*)pointer; |
463 |
// printf("ciao %s \n",pr->Data()); |
// printf("ciao %s \n",pr->Data()); |
464 |
// }; |
// }; |
465 |
sprintf(o,"%s TString ",o); |
sprintf(o,"%s TString - not implemented yet -",o); |
466 |
}; |
}; |
467 |
// |
// |
468 |
// TArray |
// TArray |
562 |
// }; |
// }; |
563 |
// sprintf(o,"%s\n",o); |
// sprintf(o,"%s\n",o); |
564 |
// |
// |
565 |
sprintf(o,"%s TArray ",o); |
sprintf(o,"%s TArray - not implemented yet -",o); |
566 |
// |
// |
567 |
}; |
}; |
568 |
// |
// |
620 |
// |
// |
621 |
// Integer |
// Integer |
622 |
// |
// |
623 |
if ( satype == -17 ){ |
if ( satype == -17 || satype == -9 ){ |
624 |
// |
// |
625 |
setcolor(col,RESET, BLUE, WHITE); |
setcolor(col,RESET, BLUE, WHITE); |
626 |
setcolor(col2,RESET, BLACK, WHITE); |
setcolor(col2,RESET, BLACK, WHITE); |
853 |
trcs = (TString)trc.str().c_str(); |
trcs = (TString)trc.str().c_str(); |
854 |
} else { |
} else { |
855 |
headcold = headc; |
headcold = headc; |
856 |
|
if ( var.RUN ){ |
857 |
|
var.idrun = L2->GetRunInfo()->ID; |
858 |
|
var.idroot = L2->GetRunInfo()->ID_ROOT_L0; |
859 |
|
var.EVF = L2->GetRunInfo()->EV_FROM; |
860 |
|
}; |
861 |
if ( var.ORB ){ |
if ( var.ORB ){ |
862 |
headc = L2->GetOrbitalInfo()->pkt_num; |
headc = L2->GetOrbitalInfo()->pkt_num; |
863 |
OBT = L2->GetOrbitalInfo()->OBT; |
OBT = L2->GetOrbitalInfo()->OBT; |
1015 |
// |
// |
1016 |
file = &mainfile; |
file = &mainfile; |
1017 |
// |
// |
|
L2 = new PamLevel2(); |
|
|
// |
|
1018 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
1019 |
// |
// |
1020 |
printf(" %s \n",ddec.Data()); |
printf(" %s \n",ddec.Data()); |
1021 |
otr = L2->GetPamTree(gSystem->DirName(file->GetName()),file->GetName(),ddec.Data()); |
if ( !L2 ){ |
1022 |
runtree = L2->GetRunTree(gSystem->DirName(file->GetName()),file->GetName()); |
L2 = new PamLevel2("",file->GetName(),ddec.Data()); |
1023 |
|
otr = L2->GetPamTree(); |
1024 |
|
} else { |
1025 |
|
// |
1026 |
|
otr = L2->GetPamTree(gSystem->DirName(file->GetName()),file->GetName(),ddec.Data()); |
1027 |
|
L2->GetRunTree(gSystem->DirName(file->GetName()),file->GetName()); |
1028 |
|
// |
1029 |
|
}; |
1030 |
|
// |
1031 |
// |
// |
1032 |
if ( !otr ) return(0); |
if ( !otr ) return(0); |
1033 |
// |
// |
1034 |
|
// otr->CanDeleteRefs(true); |
1035 |
|
// if ( runtree ) runtree->CanDeleteRefs(true); |
1036 |
|
// |
1037 |
} else { |
} else { |
1038 |
// |
// |
1039 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
1074 |
}; |
}; |
1075 |
// |
// |
1076 |
// |
// |
|
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(); |
|
|
// |
|
1077 |
// Load level0 file if the case |
// Load level0 file if the case |
1078 |
// |
// |
1079 |
if ( level.file == 0 || level.file == -1 ){ |
if ( level.file == 0 || level.file == -1 ){ |
1080 |
|
// |
1081 |
|
trigger = new pamela::trigger::TriggerEvent(); |
1082 |
|
eh = new pamela::EventHeader(); |
1083 |
|
ph = new pamela::PscuHeader(); |
1084 |
|
de = new pamela::calorimeter::CalorimeterEvent(); |
1085 |
|
trk = new pamela::tracker::TrackerEvent(); |
1086 |
|
ne = new pamela::neutron::NeutronEvent(); |
1087 |
|
ace = new pamela::anticounter::AnticounterEvent(); |
1088 |
|
s4 = new pamela::S4::S4Event(); |
1089 |
|
tof = new pamela::tof::TofEvent(); |
1090 |
|
// |
1091 |
otr = new TChain("Physics"); |
otr = new TChain("Physics"); |
1092 |
otr->Add(file->GetName(),-1); |
otr->Add(file->GetName(),-1); |
1093 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
1865 |
void FEVdetector::ShowTOF(){ |
void FEVdetector::ShowTOF(){ |
1866 |
// |
// |
1867 |
// |
// |
|
// |
|
1868 |
if ( !var.TOF ) return; |
if ( !var.TOF ) return; |
1869 |
// |
// |
1870 |
Int_t tt = 0; |
Int_t tt = 0; |
2700 |
// |
// |
2701 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= repuntil-1 ) repeat = false; |
2702 |
// |
// |
2703 |
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
// printf(" numtr is %i \n",numtr); |
2704 |
|
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
2705 |
//ptrack = L2->GetTrack(numtr); |
//ptrack = L2->GetTrack(numtr); |
2706 |
//ptt = ptrack->GetToFTrack(); |
//ptt = ptrack->GetToFTrack(); |
2707 |
}; |
}; |
5516 |
|
|
5517 |
void FEVdetector::ShowTrack(){ |
void FEVdetector::ShowTrack(){ |
5518 |
// |
// |
5519 |
|
if ( level.file != 2 ) return; |
5520 |
// |
// |
5521 |
// |
// |
5522 |
if ( var.CALO && false ){ |
// |
5523 |
|
if ( var.CALO && var.CALOT ){ |
5524 |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
5525 |
Float_t calx[22]; |
Float_t calx[22]; |
5526 |
Float_t caly[22]; |
Float_t caly[22]; |
5615 |
}; |
}; |
5616 |
}; |
}; |
5617 |
// |
// |
5618 |
if ( !var.TRK || level.file != 2 ) return; |
if ( !var.TRK ) return; |
5619 |
// |
// |
5620 |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5621 |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5622 |
|
|
5623 |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5624 |
|
// printf("qui \n"); |
5625 |
PamTrack *ptrack = L2->GetTrack(nt); |
PamTrack *ptrack = L2->GetTrack(nt); |
5626 |
TrkTrack *track = ptrack->GetTrkTrack(); |
TrkTrack *track = ptrack->GetTrkTrack(); |
5627 |
|
// printf("qua \n"); |
5628 |
Int_t npoint = 100; |
Int_t npoint = 100; |
5629 |
Float_t zin[100]; |
Float_t zin[100]; |
5630 |
Double_t xout[100]; |
Double_t xout[100]; |
5832 |
Int_t se = 5; |
Int_t se = 5; |
5833 |
if ( !l && m%2 == 0 ) se = 3; |
if ( !l && m%2 == 0 ) se = 3; |
5834 |
if ( !l && m%2 != 0 ) se = 2; |
if ( !l && m%2 != 0 ) se = 2; |
5835 |
if ( l && m%2 == 0 ) se = 1; |
if ( l && m%2 != 0 ) se = 1; |
5836 |
if ( l && m%2 != 0 ) se = 0; |
if ( l && m%2 == 0 ) se = 0; |
5837 |
// |
// |
5838 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
5839 |
// |
// |
6040 |
Int_t se = 5; |
Int_t se = 5; |
6041 |
if (l == 0 && m%2 == 0) se = 3; |
if (l == 0 && m%2 == 0) se = 3; |
6042 |
if (l == 0 && m%2 != 0) se = 2; |
if (l == 0 && m%2 != 0) se = 2; |
6043 |
if (l == 1 && m%2 == 0) se = 1; |
if (l == 1 && m%2 != 0) se = 1; |
6044 |
if (l == 1 && m%2 != 0) se = 0; |
if (l == 1 && m%2 == 0) se = 0; |
6045 |
// |
// |
6046 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
6047 |
// |
// |