86 |
var.SHOWDEC = 0; |
var.SHOWDEC = 0; |
87 |
var.TOF = 0; |
var.TOF = 0; |
88 |
var.AC = 0; |
var.AC = 0; |
89 |
|
var.RUN = 1; |
90 |
var.TRK = 0; |
var.TRK = 0; |
91 |
var.CALO = 0; |
var.CALO = 0; |
92 |
var.S4 = 0; |
var.S4 = 0; |
123 |
}; |
}; |
124 |
} |
} |
125 |
|
|
126 |
|
void FEVdetector::SetDDEC(TString de){ |
127 |
|
ddec=de; |
128 |
|
}; |
129 |
|
|
130 |
void FEVdetector::GetWindow(){ |
void FEVdetector::GetWindow(){ |
131 |
otr->GetEntry(maxevent); |
otr->GetEntry(maxevent); |
132 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
133 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
134 |
lastevno = (int)ph->Counter; |
lastevno = (int)ph->Counter; |
135 |
} else { |
} else { |
136 |
lastevno = oinfoL2->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
lastevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
137 |
}; |
}; |
138 |
otr->GetEntry(minevent); |
otr->GetEntry(minevent); |
139 |
if ( level.file < 2 ){ |
if ( level.file < 2 ){ |
140 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
141 |
firstevno = (int)ph->Counter; |
firstevno = (int)ph->Counter; |
142 |
} else { |
} else { |
143 |
firstevno = oinfoL2->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
firstevno = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have pkt_counter in the level2 file! |
144 |
}; |
}; |
145 |
} |
} |
146 |
|
|
166 |
void FEVdetector::GetEntry(Int_t i){ |
void FEVdetector::GetEntry(Int_t i){ |
167 |
thisentry = i; |
thisentry = i; |
168 |
otr->GetEntry(i); |
otr->GetEntry(i); |
169 |
|
// PrintData(otr,-1LL,44); |
170 |
} |
} |
171 |
|
|
172 |
void FEVdetector::SetEntry(Int_t i){ |
void FEVdetector::SetEntry(Int_t i){ |
179 |
return((int)ph->Counter); |
return((int)ph->Counter); |
180 |
} else { |
} else { |
181 |
// return(thisentry); // to be changed as soon as we will have pkt_counter in the level2 file! |
// return(thisentry); // to be changed as soon as we will have pkt_counter in the level2 file! |
182 |
return((int)oinfoL2->pkt_num); // to be changed as soon as we will have pkt_counter in the level2 file! |
return((int)L2->GetOrbitalInfo()->pkt_num); // to be changed as soon as we will have pkt_counter in the level2 file! |
183 |
}; |
}; |
184 |
} |
} |
185 |
|
|
287 |
}; |
}; |
288 |
} |
} |
289 |
|
|
290 |
|
void FEVdetector::PrintLeaves(TTree *otr, Int_t i, TBranchElement *tb, Int_t lenmax){ |
291 |
|
// -- Prints values of leaves. |
292 |
|
|
293 |
|
// tb->ValidateAddress(); |
294 |
|
printf("son qua \n"); |
295 |
|
|
296 |
|
// if (otr->GetMakeClass()) { |
297 |
|
if (!tb->GetAddress()) { |
298 |
|
printf("esco \n"); |
299 |
|
return; |
300 |
|
} |
301 |
|
if (tb->GetType() == 3 || tb->GetType() == 4) { |
302 |
|
// TClonesArray or STL container top-level branch. |
303 |
|
printf("3 o 4 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
304 |
|
return; |
305 |
|
} else if (tb->GetType() == 31 || tb->GetType() == 41) { |
306 |
|
printf(" 31 o 41 \n"); |
307 |
|
// TClonesArray or STL container sub-branch. |
308 |
|
Int_t n = TMath::Min(10, tb->GetNdata()); |
309 |
|
Int_t atype = tb->GetStreamerType() + 20; |
310 |
|
if (tb->GetStreamerType() == 1) { |
311 |
|
// TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kChar is |
312 |
|
// printed as a string and could print weird characters. |
313 |
|
// So we print an unsigned char instead (not perfect, but better). |
314 |
|
atype = 20 + 11 ; |
315 |
|
} |
316 |
|
if (atype > 54) { |
317 |
|
// FIXME: More logic required here (like in ReadLeaves) |
318 |
|
printf(">54 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
319 |
|
return; |
320 |
|
} |
321 |
|
if (tb->GetStreamerType() > 20) { |
322 |
|
atype -= 20; |
323 |
|
TObjArray *prova= otr->GetListOfLeaves(); |
324 |
|
// TObjArray* leaf2 = (TObjArray*) prova->UncheckedAt(i); |
325 |
|
//TLeaf* leaf = (TLeaf*)(otr->GetLeaf(tb->GetName())); |
326 |
|
// TLeafElement* leaf = (TLeafElement*)((TLeaf*)(otr->GetListOfLeaves()->UncheckedAt(i))->GetBranch()->UncheckedAt(0)); |
327 |
|
TLeafElement* leaf = (TLeafElement*)(prova->UncheckedAt(0)); |
328 |
|
n = n * leaf->GetLenStatic(); |
329 |
|
} |
330 |
|
if (tb->GetInfo()) { |
331 |
|
// n = 16; |
332 |
|
tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, lenmax); |
333 |
|
//tb->GetObject()->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), atype, n, lenmax); |
334 |
|
} |
335 |
|
return; |
336 |
|
} else if (tb->GetType() <= 2) { |
337 |
|
printf(" <=2 \n"); |
338 |
|
// Branch in split mode. |
339 |
|
// FIXME: This should probably be < 60 instead. |
340 |
|
if ((tb->GetStreamerType() > 40) && (tb->GetStreamerType() < 55)) { |
341 |
|
Int_t atype = tb->GetStreamerType() - 20; |
342 |
|
TBranchElement* counterElement = (TBranchElement*) tb->GetBranchCount(); |
343 |
|
Int_t n = (Int_t) counterElement->GetValue(0, 0); |
344 |
|
if (tb->GetInfo()) { |
345 |
|
tb->GetInfo()->PrintValue(tb->GetName(), tb->GetAddress(), atype, n, lenmax); |
346 |
|
} |
347 |
|
} else { |
348 |
|
// if (tb->GetInfo()) { |
349 |
|
// tb->GetInfo()->PrintValue(tb->GetName(), tb->GetObject(), tb->GetID(), -1, lenmax); |
350 |
|
// } |
351 |
|
// } |
352 |
|
return; |
353 |
|
} |
354 |
|
} else if (tb->GetType() == 3) { |
355 |
|
printf("3 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
356 |
|
} else if (tb->GetType() == 31) { |
357 |
|
printf("31 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
358 |
|
// TClonesArray* clones = (TClonesArray*) tb->GetObject(); |
359 |
|
// if (tb->GetInfo()) { |
360 |
|
// tb->GetInfo()->PrintValueClones(tb->GetName(), clones, tb->GetID(), tb->GetOffset(), lenmax); |
361 |
|
// } |
362 |
|
} else if (tb->GetType() == 41) { |
363 |
|
printf("41 %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
364 |
|
// TVirtualCollectionProxy::TPushPop helper(((TBranchElement*) this)->GetCollectionProxy(), fObject); |
365 |
|
// if (GetInfo()) { |
366 |
|
// GetInfo()->PrintValueSTL(GetName(), ((TBranchElement*) this)->GetCollectionProxy(), fID, fOffset, lenmax); |
367 |
|
// } |
368 |
|
} else { |
369 |
|
printf("else %-15s = %d\n", tb->GetName(), tb->GetNdata()); |
370 |
|
// if (GetInfo()) { |
371 |
|
// GetInfo()->PrintValue(GetName(), fObject, fID, -1, lenmax); |
372 |
|
// } |
373 |
|
} |
374 |
|
|
375 |
|
// }; |
376 |
|
printf("esco qui\n"); |
377 |
|
}; |
378 |
|
|
379 |
|
void FEVdetector::PrintData(TTree *tree, Long64_t entry=-1LL,Int_t lenmax=44){ |
380 |
|
// -- Print values of all active leaves for entry. |
381 |
|
// |
382 |
|
// if entry==-1, print current entry (default) |
383 |
|
// if a leaf is an array, a maximum of lenmax elements is printed. |
384 |
|
// |
385 |
|
if (entry != -1) { |
386 |
|
tree->GetEntry(entry); |
387 |
|
} |
388 |
|
// printf("======> EVENT:%lld\n", thisentry); |
389 |
|
printf("======> EVENT:%i\n", thisentry); |
390 |
|
TObjArray* leaves = tree->GetListOfLeaves(); // |
391 |
|
Int_t nleaves = leaves->GetEntriesFast(); |
392 |
|
Int_t ltype; |
393 |
|
for (Int_t i = 0; i < nleaves; i++) { |
394 |
|
TLeaf* leaf = (TLeaf*) leaves->UncheckedAt(i); |
395 |
|
TBranch* branch = leaf->GetBranch(); |
396 |
|
// if (branch->TestBit(kDoNotProcess)) { |
397 |
|
// continue; |
398 |
|
// } |
399 |
|
Int_t len = leaf->GetLen(); |
400 |
|
if (len <= 0) { |
401 |
|
continue; |
402 |
|
} |
403 |
|
len = TMath::Min(len, lenmax); |
404 |
|
if (leaf->IsA() == TLeafElement::Class()) { |
405 |
|
// Double_t value = leaf->GetValue(lenmax); |
406 |
|
//printf(" ioqui %f \n",value); |
407 |
|
// ((TBranchElement*)leaf->GetBranch())->PrintValue(i); |
408 |
|
this->PrintLeaves(otr,i,((TBranchElement*)leaf->GetBranch()), lenmax); |
409 |
|
//leaf->PrintValue(lenmax); |
410 |
|
continue; |
411 |
|
} |
412 |
|
if (branch->GetListOfBranches()->GetEntriesFast() > 0) { |
413 |
|
continue; |
414 |
|
} |
415 |
|
ltype = 10; |
416 |
|
if (leaf->IsA() == TLeafF::Class()) { |
417 |
|
ltype = 5; |
418 |
|
} |
419 |
|
if (leaf->IsA() == TLeafD::Class()) { |
420 |
|
ltype = 5; |
421 |
|
} |
422 |
|
if (leaf->IsA() == TLeafC::Class()) { |
423 |
|
len = 1; |
424 |
|
ltype = 5; |
425 |
|
}; |
426 |
|
printf(" %-15s = ", leaf->GetName()); |
427 |
|
for (Int_t l = 0; l < len; l++) { |
428 |
|
Double_t value = leaf->GetValue(l); |
429 |
|
printf(" ioqui %f \n",value); |
430 |
|
// leaf->PrintValue(l); |
431 |
|
if (l == (len - 1)) { |
432 |
|
printf("\n"); |
433 |
|
continue; |
434 |
|
} |
435 |
|
printf(", "); |
436 |
|
if ((l % ltype) == 0) { |
437 |
|
printf("\n "); |
438 |
|
} |
439 |
|
} |
440 |
|
} |
441 |
|
}; |
442 |
|
|
443 |
void FEVdetector::GetGeneralInfo(){ |
void FEVdetector::GetGeneralInfo(){ |
444 |
// |
// |
445 |
// Get Orbital Time information and header event number |
// Get Orbital Time information and header event number |
485 |
trcs = (TString)trc.str().c_str(); |
trcs = (TString)trc.str().c_str(); |
486 |
} else { |
} else { |
487 |
headcold = headc; |
headcold = headc; |
488 |
headc = oinfoL2->pkt_num; // to be changed as soon as we will have obt in the level2 file! |
headc = L2->GetOrbitalInfo()->pkt_num; // to be changed as soon as we will have obt in the level2 file! |
489 |
OBT = oinfoL2->OBT; // to be changed as soon as we will have obt in the level2 file! |
OBT = L2->GetOrbitalInfo()->OBT; // to be changed as soon as we will have obt in the level2 file! |
490 |
DOBT = OBT - OOBT; |
DOBT = OBT - OOBT; |
491 |
OOBT = OBT; |
OOBT = OBT; |
492 |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
if ( thisentry == minevent || DOBT < 0 || (headc-headcold-1)!=0 ) DOBT = 0; |
495 |
// who gave the trigger? |
// who gave the trigger? |
496 |
// |
// |
497 |
calotrig = 0; |
calotrig = 0; |
498 |
if ( L2->patterntrig[0] ) calotrig = 1; |
if ( L2->GetTrigLevel2()->patterntrig[0] ) calotrig = 1; |
499 |
toftrig = 0; |
toftrig = 0; |
500 |
if ( L2->patterntrig[2] || L2->patterntrig[3] || L2->patterntrig[4] || L2->patterntrig[5] ) toftrig = 1; |
if ( L2->GetTrigLevel2()->patterntrig[2] || L2->GetTrigLevel2()->patterntrig[3] || L2->GetTrigLevel2()->patterntrig[4] || L2->GetTrigLevel2()->patterntrig[5] ) toftrig = 1; |
501 |
s4pulser = 0; |
s4pulser = 0; |
502 |
if ( L2->patterntrig[1] & (1<<0) ) s4pulser = 1; |
if ( L2->GetTrigLevel2()->patterntrig[1] & (1<<0) ) s4pulser = 1; |
503 |
// |
// |
504 |
// TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. |
// TOF and calorimeter when giving a trigger will always set this flag since the time window of the signal is greater than 100 ns. |
505 |
// S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": |
// S4 sometimes could not set the flag even if the trigger is given. This is a workaround to fix this "bug": |
506 |
// |
// |
507 |
if ( !calotrig && !toftrig ) s4pulser = 1; |
if ( !calotrig && !toftrig ) s4pulser = 1; |
508 |
// |
// |
509 |
Int_t trigconf = L2->trigconf; |
Int_t trigconf = L2->GetTrigLevel2()->trigconf; |
510 |
stringstream trc; |
stringstream trc; |
511 |
trc.str(""); |
trc.str(""); |
512 |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
if ( trigconf & (1<<0) ) trc << "TOF1"; |
628 |
// |
// |
629 |
} |
} |
630 |
|
|
631 |
void FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
Int_t FEVdetector::Load(TTree &mainotr, TFile &mainfile){ |
632 |
file = &mainfile; |
file = &mainfile; |
633 |
otr = &mainotr; |
otr = &mainotr; |
634 |
L2 = new PamLevel2(); |
L2 = new PamLevel2(); |
635 |
// |
// |
636 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
637 |
otr = L2->LoadPamTrees(file); |
// otr = L2->LoadPamTrees(file); |
638 |
|
// printf(" %s \n",ddec.Data()); |
639 |
|
otr = L2->GetPamTree(file,ddec.Data()); |
640 |
|
// |
641 |
|
if ( !otr ) return(0); |
642 |
// ******************** |
// ******************** |
643 |
// load magnetic field |
// load magnetic field |
644 |
// ******************** |
// ******************** |
646 |
// |
// |
647 |
stringstream magfie; |
stringstream magfie; |
648 |
magfie.str(""); |
magfie.str(""); |
649 |
|
// magfie << "/localdisk/mocchiut/test/calib/trk-param/field_param-0/"; |
650 |
magfie << pam_calib; |
magfie << pam_calib; |
651 |
magfie << "/trk-param/field_param-0/"; |
magfie << "/trk-param/field_param-0/"; |
652 |
// |
// |
653 |
L2->LoadField(magfie.str().c_str()); |
L2->GetTrkLevel2()->LoadField(magfie.str().c_str()); |
654 |
} else { |
} else { |
655 |
// |
// |
656 |
// load calorimeter ADC2MIP conversion file |
// load calorimeter ADC2MIP conversion file |
690 |
// |
// |
691 |
}; |
}; |
692 |
// |
// |
|
|
|
693 |
// |
// |
694 |
trigger = new pamela::trigger::TriggerEvent(); |
trigger = new pamela::trigger::TriggerEvent(); |
695 |
eh = new pamela::EventHeader(); |
eh = new pamela::EventHeader(); |
696 |
ph = new pamela::PscuHeader(); |
ph = new pamela::PscuHeader(); |
697 |
oinfoL2 = new OrbitalInfo(); |
// oinfoL2 = new OrbitalInfo(); |
698 |
runinfo = new ItoRunInfo(file); |
runinfo = new ItoRunInfo(file); |
699 |
// |
// |
700 |
de = new pamela::calorimeter::CalorimeterEvent(); |
de = new pamela::calorimeter::CalorimeterEvent(); |
708 |
otr->SetBranchAddress("Trigger", &trigger); |
otr->SetBranchAddress("Trigger", &trigger); |
709 |
otr->SetBranchAddress("Header", &eh); |
otr->SetBranchAddress("Header", &eh); |
710 |
}; |
}; |
711 |
if ( level.file == 2 ){ |
if ( level.file == 2 && var.RUN){ |
712 |
otr->AddFriend("OrbitalInfo", file); |
// otr->AddFriend("OrbitalInfo", file); |
713 |
otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
// otr->SetBranchAddress("OrbitalInfo", &oinfoL2); |
714 |
runinfo->Read(0ULL); |
runinfo->Read(0ULL); |
715 |
}; |
}; |
716 |
// |
// |
784 |
printf("Show the Time of Flight detector, LEVEL2 data \n"); |
printf("Show the Time of Flight detector, LEVEL2 data \n"); |
785 |
}; |
}; |
786 |
}; |
}; |
787 |
|
// |
788 |
|
return(1); |
789 |
// |
// |
790 |
} |
} |
791 |
|
|
980 |
// |
// |
981 |
// SHOW PALETTE |
// SHOW PALETTE |
982 |
// |
// |
983 |
|
thefigure->cd(); |
984 |
if ( var.PALETTE ) ShowPalette(); |
if ( var.PALETTE ) ShowPalette(); |
985 |
// |
// |
986 |
// SHOW VERBOSE INFOS |
// SHOW VERBOSE INFOS |
2187 |
ms11b[i] = 0.; |
ms11b[i] = 0.; |
2188 |
} else { |
} else { |
2189 |
ms11b[i] = 1.; |
ms11b[i] = 1.; |
2190 |
}; }; |
}; |
2191 |
|
}; |
2192 |
for ( Int_t i = 0; i<6; i++ ) { |
for ( Int_t i = 0; i<6; i++ ) { |
2193 |
mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]]; |
mt12[0][i] = tof->tdc[ch12a[i]][hb12a[i]]; |
2194 |
mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]]; |
mt12[1][i] = tof->tdc[ch12b[i]][hb12b[i]]; |
2287 |
// |
// |
2288 |
var.tofraw = 0; |
var.tofraw = 0; |
2289 |
// |
// |
2290 |
repuntil = L2->ToFLevel2::ntrk(); |
if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); |
2291 |
// printf("repuntil = %i \n",repuntil); |
// printf("repuntil = %i \n",repuntil); |
2292 |
//repuntil = L2->GetNTracks(); |
//repuntil = L2->GetNTracks(); |
2293 |
// |
// |
2302 |
// |
// |
2303 |
if ( repuntil == 1 || var.tofraw ){ |
if ( repuntil == 1 || var.tofraw ){ |
2304 |
numtr = 0; |
numtr = 0; |
2305 |
ptt = L2->GetToFTrkVar(0); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(0); |
2306 |
repeat = false; |
repeat = false; |
2307 |
} else { |
} else { |
2308 |
// |
// |
2309 |
// |
// |
2310 |
if ( numtr >= repuntil-1 ) repeat = false; |
if ( numtr >= repuntil-1 ) repeat = false; |
2311 |
// |
// |
2312 |
ptt = L2->GetToFTrkVar(numtr); |
ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); |
2313 |
}; |
}; |
2314 |
// |
// |
2315 |
xp11[0] = 0.; |
xp11[0] = 0.; |
2325 |
// |
// |
2326 |
Float_t adc[4][12]; |
Float_t adc[4][12]; |
2327 |
Float_t tdc[4][12]; |
Float_t tdc[4][12]; |
2328 |
L2->GetMatrix(numtr,adc,tdc); |
L2->GetToFLevel2()->GetMatrix(numtr,adc,tdc); |
2329 |
|
|
2330 |
// |
// |
2331 |
for ( Int_t i = 0; i<8; i++ ) { |
for ( Int_t i = 0; i<8; i++ ) { |
2335 |
if ( adc[ch11b[i]][hb11b[i]] < 1000. ){ |
if ( adc[ch11b[i]][hb11b[i]] < 1000. ){ |
2336 |
ms11b[i] = adc[ch11b[i]][hb11b[i]]; |
ms11b[i] = adc[ch11b[i]][hb11b[i]]; |
2337 |
}; |
}; |
2338 |
xp11[i] = 0.; |
// xp11[i] = 0.; |
2339 |
}; |
}; |
2340 |
|
|
2341 |
Int_t nmtof = 0; |
Int_t nmtof = 0; |
2375 |
if ( adc[ch12b[i]][hb12b[i]] < 1000. ) ms12b[i] = adc[ch12b[i]][hb12b[i]]; |
if ( adc[ch12b[i]][hb12b[i]] < 1000. ) ms12b[i] = adc[ch12b[i]][hb12b[i]]; |
2376 |
xp12[i] = 0.; |
xp12[i] = 0.; |
2377 |
}; |
}; |
2378 |
|
// |
2379 |
xp12[0] = ptt->xtofpos[0]; |
xp12[0] = ptt->xtofpos[0]; |
2380 |
// |
// |
2381 |
ii = 2; |
ii = 2; |
2383 |
ii--; |
ii--; |
2384 |
if ( adc[ch21a[i]][hb21a[i]] < 1000. ) ms21a[ii] = adc[ch21a[i]][hb21a[i]]; |
if ( adc[ch21a[i]][hb21a[i]] < 1000. ) ms21a[ii] = adc[ch21a[i]][hb21a[i]]; |
2385 |
if ( adc[ch21b[i]][hb21b[i]] < 1000. ) ms21b[ii] = adc[ch21b[i]][hb21b[i]]; |
if ( adc[ch21b[i]][hb21b[i]] < 1000. ) ms21b[ii] = adc[ch21b[i]][hb21b[i]]; |
2386 |
xp12[i] = 0.; |
xp21[i] = 0.; |
2387 |
}; |
}; |
2388 |
xp21[0] = ptt->xtofpos[1]; |
xp21[0] = ptt->xtofpos[1]; |
2389 |
// |
// |
2969 |
// full infos from ac |
// full infos from ac |
2970 |
// |
// |
2971 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
2972 |
hitmapA = L2->hitmap[0]; |
hitmapA = L2->GetAcLevel2()->hitmap[0]; |
2973 |
hitmapB = L2->hitmap[1]; |
hitmapB = L2->GetAcLevel2()->hitmap[1]; |
2974 |
hitstatusA = L2->hitstatus[0]; |
hitstatusA = L2->GetAcLevel2()->hitstatus[0]; |
2975 |
hitstatusB = L2->hitstatus[1]; |
hitstatusB = L2->GetAcLevel2()->hitstatus[1]; |
2976 |
}; |
}; |
2977 |
// |
// |
2978 |
// |
// |
4229 |
// |
// |
4230 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
4231 |
for ( Int_t j = 0; j<3; j++ ) { |
for ( Int_t j = 0; j<3; j++ ) { |
4232 |
if ( L2->S4adc != 32. ) ms4[j] = L2->S4calibrated; |
if ( L2->GetS4Level2()->S4adc != 32. ) ms4[j] = L2->GetS4Level2()->S4calibrated; |
4233 |
}; |
}; |
4234 |
}; |
}; |
4235 |
// |
// |
4314 |
}; |
}; |
4315 |
}; |
}; |
4316 |
if ( level.file == 2 ){ |
if ( level.file == 2 ){ |
4317 |
yUpperTrig = (Int_t)L2->trigPhysics; |
yUpperTrig = (Int_t)L2->GetNDLevel2()->trigPhysics; |
4318 |
yUpperBk = (Int_t)L2->upperBack; |
yUpperBk = (Int_t)L2->GetNDLevel2()->upperBack; |
4319 |
yBottomBk = (Int_t)L2->bottomBack; |
yBottomBk = (Int_t)L2->GetNDLevel2()->bottomBack; |
4320 |
}; |
}; |
4321 |
// |
// |
4322 |
var.trup = yUpperTrig; |
var.trup = yUpperTrig; |
4623 |
// |
// |
4624 |
// singlets X |
// singlets X |
4625 |
// |
// |
4626 |
for (Int_t sing = 0; sing < L2->nclsx(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsx(); sing++){ |
4627 |
TClonesArray &t = *(L2->SingletX); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletX); |
4628 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
4629 |
x = (singlet->coord[0]+singlet->coord[1])/2.; |
x = (singlet->coord[0]+singlet->coord[1])/2.; |
4630 |
// |
// |
4648 |
// |
// |
4649 |
// singlets Y |
// singlets Y |
4650 |
// |
// |
4651 |
for (Int_t sing = 0; sing < L2->nclsy(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsy(); sing++){ |
4652 |
TClonesArray &t = *(L2->SingletY); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletY); |
4653 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
4654 |
// |
// |
4655 |
Int_t planepad = (singlet->plane - 1)* 2; |
Int_t planepad = (singlet->plane - 1)* 2; |
4694 |
dcol = 2; |
dcol = 2; |
4695 |
}; |
}; |
4696 |
// |
// |
4697 |
if ( L2->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
4698 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
4699 |
TrkTrack *track = L2->GetTrack(nt); |
PamTrack *ptrack= L2->GetTrack(nt); |
4700 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
4701 |
if ( nt == 0 ){ |
if ( nt == 0 ){ |
4702 |
var.rig = 0.; |
var.rig = 0.; |
4703 |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
if ( track->al[4] != 0. ) var.rig = 1./track->al[4]; |
4793 |
// |
// |
4794 |
// first of all plot crosses relatives to tracks |
// first of all plot crosses relatives to tracks |
4795 |
// |
// |
4796 |
if ( L2->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
4797 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
4798 |
TrkTrack *track = L2->GetTrack(nt); |
TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
4799 |
for (Int_t plane = 0; plane<6; plane++){ |
for (Int_t plane = 0; plane<6; plane++){ |
4800 |
// |
// |
4801 |
x = track->xm[plane]; |
x = track->xm[plane]; |
4841 |
// |
// |
4842 |
// try to plot crosses relative to singlets |
// try to plot crosses relative to singlets |
4843 |
// |
// |
4844 |
if ( L2->nclsx() > 0 && L2->nclsy() > 0 ){ |
if ( L2->GetTrkLevel2()->nclsx() > 0 && L2->GetTrkLevel2()->nclsy() > 0 ){ |
4845 |
for (Int_t plane = 1; plane<7; plane++){ |
for (Int_t plane = 1; plane<7; plane++){ |
4846 |
// |
// |
4847 |
// count how many singlet in the x and y view for this plane: |
// count how many singlet in the x and y view for this plane: |
4855 |
TArrayF *array2 = new TArrayF(5000); |
TArrayF *array2 = new TArrayF(5000); |
4856 |
TArrayF *sigarrax = new TArrayF(5000); |
TArrayF *sigarrax = new TArrayF(5000); |
4857 |
TArrayF *sigarray = new TArrayF(5000); |
TArrayF *sigarray = new TArrayF(5000); |
4858 |
for (Int_t sing = 0; sing < L2->nclsx(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsx(); sing++){ |
4859 |
TClonesArray &t = *(L2->SingletX); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletX); |
4860 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
4861 |
if ( singlet->plane == plane ){ |
if ( singlet->plane == plane ){ |
4862 |
arrax->AddAt(((singlet->coord[0]+singlet->coord[1])/2.),totsx); |
arrax->AddAt(((singlet->coord[0]+singlet->coord[1])/2.),totsx); |
4885 |
totsx++; |
totsx++; |
4886 |
}; |
}; |
4887 |
}; |
}; |
4888 |
for (Int_t sing = 0; sing < L2->nclsy(); sing++){ |
for (Int_t sing = 0; sing < L2->GetTrkLevel2()->nclsy(); sing++){ |
4889 |
TClonesArray &t = *(L2->SingletY); |
TClonesArray &t = *(L2->GetTrkLevel2()->SingletY); |
4890 |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
TrkSinglet *singlet = (TrkSinglet*)t[sing]; |
4891 |
if ( singlet->plane == plane ){ |
if ( singlet->plane == plane ){ |
4892 |
array1->AddAt(singlet->coord[0],totsy); |
array1->AddAt(singlet->coord[0],totsy); |
5111 |
// |
// |
5112 |
// |
// |
5113 |
// |
// |
5114 |
|
if ( var.CALO && false ){ |
5115 |
|
if ( L2->GetCaloLevel2()->npcfit[0] > 0 && L2->GetCaloLevel2()->npcfit[1] > 0 ){ |
5116 |
|
Float_t calx[22]; |
5117 |
|
Float_t caly[22]; |
5118 |
|
Float_t calzx[22]; |
5119 |
|
Float_t calzy[22]; |
5120 |
|
Float_t zpiano[22]; |
5121 |
|
zpiano[0] = (CTZ+118.)*var.sfy/1000.; |
5122 |
|
for (Int_t plane = 1; plane < 22; plane++){ |
5123 |
|
if ( !(plane%2) ){ |
5124 |
|
zpiano[plane] = zpiano[plane-1] - 8.09*var.sfy/1000.; |
5125 |
|
}else { |
5126 |
|
zpiano[plane] = zpiano[plane-1] - 10.09*var.sfy/1000.; |
5127 |
|
}; |
5128 |
|
}; |
5129 |
|
for (Int_t plane = 0; plane < 22; plane++){ |
5130 |
|
calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;; |
5131 |
|
caly[plane] = (L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; |
5132 |
|
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
5133 |
|
calzx[plane] = zpiano[plane] + var.yxvc; |
5134 |
|
calzy[plane] = zpiano[plane] + var.yyvc; |
5135 |
|
// printf(" calx %f caly %f calzx %f calzy %f \n",calx[plane],caly[plane],calzx[plane],calzy[plane]); |
5136 |
|
}; |
5137 |
|
// |
5138 |
|
// Calorimeter track |
5139 |
|
// |
5140 |
|
Int_t trcol = 30; |
5141 |
|
if ( var.bw ){ |
5142 |
|
trcol = 14; |
5143 |
|
} else { |
5144 |
|
trcol = 44; |
5145 |
|
}; |
5146 |
|
thefigure->cd(); |
5147 |
|
TPolyLine *trakx = new TPolyLine(22,calx,calzx); |
5148 |
|
trakx->SetLineColor(trcol); |
5149 |
|
if ( L2->GetCaloLevel2()->fitmode[0] == 1 ) trakx->SetLineStyle(3); |
5150 |
|
if ( L2->GetCaloLevel2()->fitmode[0] == 2 ) trakx->SetLineStyle(4); |
5151 |
|
trakx->SetLineWidth(2); |
5152 |
|
trakx->Draw(); |
5153 |
|
TPolyLine *traky = new TPolyLine(22,caly,calzy); |
5154 |
|
traky->SetLineColor(trcol); |
5155 |
|
if ( L2->GetCaloLevel2()->fitmode[1] == 1 ) traky->SetLineStyle(3); |
5156 |
|
if ( L2->GetCaloLevel2()->fitmode[1] == 2 ) traky->SetLineStyle(4); |
5157 |
|
traky->SetLineWidth(2); |
5158 |
|
traky->Draw(); |
5159 |
|
}; |
5160 |
|
if ( L2->GetCaloLevel2()->npcfit[2] > 0 ){ |
5161 |
|
Float_t calx[22]; |
5162 |
|
Float_t caly[22]; |
5163 |
|
Float_t calzx[22]; |
5164 |
|
Float_t calzy[22]; |
5165 |
|
Float_t zpiano[22]; |
5166 |
|
zpiano[0] = (CTZ+118.)*var.sfy/1000.; |
5167 |
|
for (Int_t plane = 1; plane < 22; plane++){ |
5168 |
|
if ( !(plane%2) ){ |
5169 |
|
zpiano[plane] = zpiano[plane-1] - 8.09*var.sfy/1000.; |
5170 |
|
}else { |
5171 |
|
zpiano[plane] = zpiano[plane-1] - 10.09*var.sfy/1000.; |
5172 |
|
}; |
5173 |
|
}; |
5174 |
|
// |
5175 |
|
// |
5176 |
|
CaloTrkVar *ctra = L2->GetCaloStoredTrack(-1); |
5177 |
|
// |
5178 |
|
for (Int_t plane = 0; plane < 22; plane++){ |
5179 |
|
calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;; |
5180 |
|
caly[plane] = (ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; |
5181 |
|
// calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; |
5182 |
|
calzx[plane] = zpiano[plane] + var.yxvc; |
5183 |
|
calzy[plane] = zpiano[plane] + var.yyvc; |
5184 |
|
// printf(" calx %f caly %f calzx %f calzy %f \n",calx[plane],caly[plane],calzx[plane],calzy[plane]); |
5185 |
|
}; |
5186 |
|
// |
5187 |
|
// Calorimeter track |
5188 |
|
// |
5189 |
|
Int_t trcol = 30; |
5190 |
|
if ( var.bw ){ |
5191 |
|
trcol = 16; |
5192 |
|
} else { |
5193 |
|
trcol = 46; |
5194 |
|
}; |
5195 |
|
thefigure->cd(); |
5196 |
|
TPolyLine *trakx = new TPolyLine(22,calx,calzx); |
5197 |
|
trakx->SetLineColor(trcol); |
5198 |
|
trakx->SetLineStyle(3); |
5199 |
|
trakx->SetLineWidth(2); |
5200 |
|
trakx->Draw(); |
5201 |
|
TPolyLine *traky = new TPolyLine(22,caly,calzy); |
5202 |
|
traky->SetLineColor(trcol); |
5203 |
|
traky->SetLineStyle(3); |
5204 |
|
traky->SetLineWidth(2); |
5205 |
|
traky->Draw(); |
5206 |
|
}; |
5207 |
|
}; |
5208 |
|
// |
5209 |
if ( !var.TRK || level.file != 2 ) return; |
if ( !var.TRK || level.file != 2 ) return; |
5210 |
// |
// |
5211 |
if ( L2->GetNTracks() > 0 ){ |
if ( L2->GetTrkLevel2()->GetNTracks() > 0 ){ |
5212 |
for (Int_t nt = 0; nt < L2->GetNTracks(); nt++){ |
for (Int_t nt = 0; nt < L2->GetTrkLevel2()->GetNTracks(); nt++){ |
5213 |
TrkTrack *track = L2->GetTrack(nt); |
|
5214 |
|
// TrkTrack *track = L2->GetTrkLevel2()->GetTrack(nt); |
5215 |
|
PamTrack *ptrack = L2->GetTrack(nt); |
5216 |
|
TrkTrack *track = ptrack->GetTrkTrack(); |
5217 |
Int_t npoint = 100; |
Int_t npoint = 100; |
5218 |
Float_t zin[100]; |
Float_t zin[100]; |
5219 |
Double_t xout[100]; |
Double_t xout[100]; |
5283 |
}; |
}; |
5284 |
tzx[e] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yxvc; |
tzx[e] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yxvc; |
5285 |
tzy[e] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yyvc; |
tzy[e] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yyvc; |
5286 |
|
// printf("tx[e] %f ty [e] %f tzx %f tzy %f \n",tx[e],ty[e],tzx[e],tzy[e]); |
5287 |
}; |
}; |
5288 |
// |
// |
5289 |
// From S1 to CALO |
// From S1 to CALO |
5833 |
// |
// |
5834 |
stringstream xvev; |
stringstream xvev; |
5835 |
stringstream yvev; |
stringstream yvev; |
5836 |
for (Int_t ii = 0; ii < L2->nstrip; ii++){ |
for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){ |
5837 |
Int_t colo; |
Int_t colo; |
5838 |
Int_t l; |
Int_t l; |
5839 |
Int_t m; |
Int_t m; |
5840 |
Int_t n; |
Int_t n; |
5841 |
Float_t mip = L2->DecodeEstrip(ii,l,m,n); |
Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n); |
5842 |
if ( var.bw ){ |
if ( var.bw ){ |
5843 |
colo = -1; |
colo = -1; |
5844 |
} else { |
} else { |
5872 |
}; |
}; |
5873 |
pd1->Update(); |
pd1->Update(); |
5874 |
pd2->Update(); |
pd2->Update(); |
5875 |
var.qtot=(int)L2->qtot; |
var.qtot=(int)L2->GetCaloLevel2()->qtot; |
5876 |
var.nstrip=(int)L2->nstrip; |
var.nstrip=(int)L2->GetCaloLevel2()->nstrip; |
5877 |
}; |
}; |
5878 |
} |
} |
5879 |
|
|