244 if (firstCall)
outTree->Branch(
"FileNumber",&fFileNumber,
"FileNumber/I");
248 if (firstCall)
outTree->Branch(
"Event",&fEvent,
"Event/I");
253 vector<Int_t> fNType;
254 if (firstCall)
outTree->Branch(
"NType",&fNType);
258 if (firstCall)
outTree->Branch(
"Mode",&fMode);
262 if (firstCall)
outTree->Branch(
"InterT",&fInterT);
265 vector<Float_t> fMCVertX;
266 if (firstCall)
outTree->Branch(
"MCVertX",&fMCVertX);
269 vector<Float_t> fMCVertY;
270 if (firstCall)
outTree->Branch(
"MCVertY",&fMCVertY);
273 vector<Float_t> fMCVertZ;
274 if (firstCall)
outTree->Branch(
"MCVertZ",&fMCVertZ);
277 vector<Float_t> fMCNuPx;
278 if (firstCall)
outTree->Branch(
"MCNuPx",&fMCNuPx);
281 vector<Float_t> fMCNuPy;
282 if (firstCall)
outTree->Branch(
"MCNuPy",&fMCNuPy);
285 vector<Float_t> fMCNuPz;
286 if (firstCall)
outTree->Branch(
"MCNuPz",&fMCNuPz);
289 vector<Float_t> fMC_T;
290 if (firstCall)
outTree->Branch(
"MC_T",&fMC_T);
296 if (firstCall)
outTree->Branch(
"PDG",&fPDG);
299 vector<Int_t> fPDGMother;
300 if (firstCall)
outTree->Branch(
"PDGMother",&fPDGMother);
303 vector<Float_t> fMCPStartX;
304 if (firstCall)
outTree->Branch(
"MCPStartX",&fMCPStartX);
307 vector<Float_t> fMCPStartY;
308 if (firstCall)
outTree->Branch(
"MCPStartY",&fMCPStartY);
311 vector<Float_t> fMCPStartZ;
312 if (firstCall)
outTree->Branch(
"MCPStartZ",&fMCPStartZ);
315 vector<Float_t> fMCPStartPX;
316 if (firstCall)
outTree->Branch(
"MCPStartPX",&fMCPStartPX);
319 vector<Float_t> fMCPStartPY;
320 if (firstCall)
outTree->Branch(
"MCPStartPY",&fMCPStartPY);
323 vector<Float_t> fMCPStartPZ;
324 if (firstCall)
outTree->Branch(
"MCPStartPZ",&fMCPStartPZ);
329 TrackIDNumber(
inTree,
"TrackIDNumber",&iEntry);
330 vector<gar::rec::IDNumber> fTrackIDNumber;
331 if (firstCall)
outTree->Branch(
"TrackIDNumber",&fTrackIDNumber);
334 vector<Float_t> fTrackStartX;
335 if (firstCall)
outTree->Branch(
"TrackStartX",&fTrackStartX);
338 vector<Float_t> fTrackStartY;
339 if (firstCall)
outTree->Branch(
"TrackStartY",&fTrackStartY);
342 vector<Float_t> fTrackStartZ;
343 if (firstCall)
outTree->Branch(
"TrackStartZ",&fTrackStartZ);
346 vector<Float_t> fTrackStartPX;
347 if (firstCall)
outTree->Branch(
"TrackStartPX",&fTrackStartPX);
350 vector<Float_t> fTrackStartPY;
351 if (firstCall)
outTree->Branch(
"TrackStartPY",&fTrackStartPY);
354 vector<Float_t> fTrackStartPZ;
355 if (firstCall)
outTree->Branch(
"TrackStartPZ",&fTrackStartPZ);
358 vector<Int_t> fTrackStartQ;
359 if (firstCall)
outTree->Branch(
"TrackStartQ",&fTrackStartQ);
362 vector<Float_t> fTrackEndX;
363 if (firstCall)
outTree->Branch(
"TrackEndX",&fTrackEndX);
366 vector<Float_t> fTrackEndY;
367 if (firstCall)
outTree->Branch(
"TrackEndY",&fTrackEndY);
370 vector<Float_t> fTrackEndZ;
371 if (firstCall)
outTree->Branch(
"TrackEndZ",&fTrackEndZ);
374 vector<Float_t> fTrackEndPX;
375 if (firstCall)
outTree->Branch(
"TrackEndPX",&fTrackEndPX);
378 vector<Float_t> fTrackEndPY;
379 if (firstCall)
outTree->Branch(
"TrackEndPY",&fTrackEndPY);
382 vector<Float_t> fTrackEndPZ;
383 if (firstCall)
outTree->Branch(
"TrackEndPZ",&fTrackEndPZ);
386 vector<Int_t> fTrackEndQ;
387 if (firstCall)
outTree->Branch(
"TrackEndQ",&fTrackEndQ);
392 vector<Float_t> fTrackLenF;
393 if (firstCall)
outTree->Branch(
"TrackLenF",&fTrackLenF);
396 vector<Float_t> fTrackLenB;
397 if (firstCall)
outTree->Branch(
"TrackLenB",&fTrackLenB);
400 vector<Int_t> fNTPCClustersOnTrack;
401 if (firstCall)
outTree->Branch(
"NTPCClustersOnTrack",&fNTPCClustersOnTrack);
404 vector<Float_t> fTrackAvgIonF;
405 if (firstCall)
outTree->Branch(
"TrackAvgIonF",&fTrackAvgIonF);
408 vector<Float_t> fTrackAvgIonB;
409 if (firstCall)
outTree->Branch(
"TrackAvgIonB",&fTrackAvgIonB);
414 VertIDNumber(
inTree,
"VertIDNumber",&iEntry);
415 vector<gar::rec::IDNumber> fVertIDNumber;
416 if (firstCall)
outTree->Branch(
"VertIDNumber",&fVertIDNumber);
419 vector<Float_t> fVertX;
420 if (firstCall)
outTree->Branch(
"VertX",&fVertX);
423 vector<Float_t> fVertY;
424 if (firstCall)
outTree->Branch(
"VertY",&fVertY);
427 vector<Float_t> fVertZ;
428 if (firstCall)
outTree->Branch(
"VertZ",&fVertZ);
431 vector<Int_t> fVertN;
432 if (firstCall)
outTree->Branch(
"VertN",&fVertN);
435 vector<Int_t> fVertQ;
436 if (firstCall)
outTree->Branch(
"VertQ",&fVertQ);
441 VT_VertIDNumber(
inTree,
"VT_VertIDNumber",&iEntry);
442 vector<gar::rec::IDNumber> fVT_VertIDNumber;
443 if (firstCall)
outTree->Branch(
"VT_VertIDNumber",&fVT_VertIDNumber);
446 VT_TrackIDNumber(
inTree,
"VT_TrackIDNumber",&iEntry);
447 vector<gar::rec::IDNumber> fVT_TrackIDNumber;
448 if (firstCall)
outTree->Branch(
"VT_TrackIDNumber",&fVT_TrackIDNumber);
451 VT_TrackEnd(
inTree,
"VT_TrackEnd",&iEntry);
452 vector<gar::rec::TrackEnd> fVT_TrackEnd;
453 if (firstCall)
outTree->Branch(
"VT_TrackEnd",&fVT_TrackEnd);
459 ClusterIDNumber(
inTree,
"ClusterIDNumber",&iEntry);
460 vector<gar::rec::IDNumber> fClusterIDNumber;
461 if (firstCall)
outTree->Branch(
"ClusterIDNumber",&fClusterIDNumber);
464 vector<UInt_t> fClusterNhits;
465 if (firstCall)
outTree->Branch(
"ClusterNhits",&fClusterNhits);
468 vector<Float_t> fClusterEnergy;
469 if (firstCall)
outTree->Branch(
"ClusterEnergy",&fClusterEnergy);
472 vector<Float_t> fClusterX;
473 if (firstCall)
outTree->Branch(
"ClusterX",&fClusterX);
476 vector<Float_t> fClusterY;
477 if (firstCall)
outTree->Branch(
"ClusterY",&fClusterY);
480 vector<Float_t> fClusterZ;
481 if (firstCall)
outTree->Branch(
"ClusterZ",&fClusterZ);
486 ECALAssn_ClusIDNumber(
inTree,
"ECALAssn_ClusIDNumber",&iEntry);
487 vector<gar::rec::IDNumber> fECALAssn_ClusIDNumber;
488 if (firstCall)
outTree->Branch(
"ECALAssn_ClusIDNumber",&fECALAssn_ClusIDNumber);
491 ECALAssn_TrackIDNumber(
inTree,
"ECALAssn_TrackIDNumber",&iEntry);
492 vector<gar::rec::IDNumber> fECALAssn_TrackIDNumber;
493 if (firstCall)
outTree->Branch(
"ECALAssn_TrackIDNumber",&fECALAssn_TrackIDNumber);
496 ECALAssn_TrackEnd(
inTree,
"ECALAssn_TrackEnd",&iEntry);
497 vector<gar::rec::TrackEnd> fECALAssn_TrackEnd;
498 if (firstCall)
outTree->Branch(
"ECALAssn_TrackEnd",&fECALAssn_TrackEnd);
504 Long64_t nEntry =
inTree->GetEntries();
505 cout <<
"nEntry: " << nEntry <<
"\t Run Number: " << fileNumber <<
endl;
506 for (iEntry=0; iEntry<nEntry; ++iEntry) {
514 fFileNumber = fileNumber;
515 fEvent =
Event.getData();
517 fNType = NType.getDataVector();
518 fMode = Mode.getDataVector();
519 fInterT = InterT.getDataVector();
520 fMCVertX = MCVertX.getDataVector();
521 fMCVertY = MCVertY.getDataVector();
522 fMCVertZ = MCVertZ.getDataVector();
523 fMCNuPx = MCNuPx.getDataVector();
524 fMCNuPy = MCNuPy.getDataVector();
525 fMCNuPz = MCNuPz.getDataVector();
526 fMC_T = MC_T.getDataVector();
528 fPDG =
PDG.getDataVector();
529 fPDGMother = PDGMother.getDataVector();
530 fMCPStartX = MCPStartX.getDataVector();
531 fMCPStartY = MCPStartY.getDataVector();
532 fMCPStartZ = MCPStartZ.getDataVector();
533 fMCPStartPX = MCPStartPX.getDataVector();
534 fMCPStartPY = MCPStartPY.getDataVector();
535 fMCPStartPZ = MCPStartPZ.getDataVector();
537 fTrackIDNumber = TrackIDNumber.getDataVector();
538 fTrackStartX = TrackStartX.getDataVector();
539 fTrackStartY = TrackStartY.getDataVector();
540 fTrackStartZ = TrackStartZ.getDataVector();
541 fTrackStartPX = TrackStartPX.getDataVector();
542 fTrackStartPY = TrackStartPY.getDataVector();
543 fTrackStartPZ = TrackStartPZ.getDataVector();
544 fTrackStartQ = TrackStartQ.getDataVector();
545 fTrackEndX = TrackEndX.getDataVector();
546 fTrackEndY = TrackEndY.getDataVector();
547 fTrackEndZ = TrackEndZ.getDataVector();
548 fTrackEndPX = TrackEndPX.getDataVector();
549 fTrackEndPY = TrackEndPY.getDataVector();
550 fTrackEndPZ = TrackEndPZ.getDataVector();
551 fTrackEndQ = TrackEndQ.getDataVector();
553 fTrackLenF = TrackLenF.getDataVector();
554 fTrackLenB = TrackLenB.getDataVector();
555 fNTPCClustersOnTrack = NTPCClustersOnTrack.getDataVector();
556 fTrackAvgIonF = TrackAvgIonF.getDataVector();
557 fTrackAvgIonB = TrackAvgIonB.getDataVector();
559 fVertIDNumber = VertIDNumber.getDataVector();
560 fVertX = VertX.getDataVector();
561 fVertY = VertY.getDataVector();
562 fVertZ = VertZ.getDataVector();
563 fVertN = VertN.getDataVector();
564 fVertQ = VertQ.getDataVector();
566 fVT_VertIDNumber = VT_VertIDNumber.getDataVector();
567 fVT_TrackIDNumber = VT_TrackIDNumber.getDataVector();
568 fVT_TrackEnd = VT_TrackEnd.getDataVector();
571 fClusterIDNumber = ClusterIDNumber.getDataVector();
572 fClusterNhits = ClusterNhits.getDataVector();
573 fClusterEnergy = ClusterEnergy.getDataVector();
574 fClusterX = ClusterX.getDataVector();
575 fClusterY = ClusterY.getDataVector();
576 fClusterZ = ClusterZ.getDataVector();
578 fECALAssn_ClusIDNumber = ECALAssn_ClusIDNumber.getDataVector();
579 fECALAssn_TrackIDNumber = ECALAssn_TrackIDNumber.getDataVector();
580 fECALAssn_TrackEnd = ECALAssn_TrackEnd.getDataVector();
586 Float_t XvertMC, YvertMC, ZvertMC;
587 int nMCVerts = MCVertX.size();
588 for (
int iMCVert=0; iMCVert<nMCVerts; ++iMCVert) {
589 XvertMC = MCVertX.getData(iMCVert);
590 YvertMC = MCVertY.getData(iMCVert);
591 ZvertMC = MCVertZ.getData(iMCVert);
594 int interType = InterT.getData(iMCVert);
611 #ifdef killNoRecoVerts 612 if (fVertIDNumber.size()==0)
continue;
639 int nTracks = fTrackIDNumber.size();
640 for (
int iTrack=0; iTrack<nTracks; ++iTrack) {
641 Float_t Pstart =
Qadd(fTrackStartPX[iTrack],fTrackStartPY[iTrack],fTrackStartPZ[iTrack]);
642 Float_t Pend =
Qadd(fTrackEndPX[iTrack], fTrackEndPY[iTrack], fTrackEndPZ[iTrack]);
644 itTrackIDNumber = fTrackIDNumber.erase(itTrackIDNumber);
645 itTrackStartX = fTrackStartX.erase(itTrackStartX);
646 itTrackStartY = fTrackStartY.erase(itTrackStartY);
647 itTrackStartZ = fTrackStartZ.erase(itTrackStartZ);
648 itTrackStartPX = fTrackStartPX.erase(itTrackStartPX);
649 itTrackStartPY = fTrackStartPY.erase(itTrackStartPY);
650 itTrackStartPZ = fTrackStartPZ.erase(itTrackStartPZ);
651 itTrackStartQ = fTrackStartQ.erase(itTrackStartQ);
652 itTrackEndX = fTrackEndX.erase(itTrackEndX);
653 itTrackEndY = fTrackEndY.erase(itTrackEndY);
654 itTrackEndZ = fTrackEndZ.erase(itTrackEndZ);
655 itTrackEndPX = fTrackEndPX.erase(itTrackEndPX);
656 itTrackEndPY = fTrackEndPY.erase(itTrackEndPY);
657 itTrackEndPZ = fTrackEndPZ.erase(itTrackEndPZ);
658 itTrackEndQ = fTrackEndQ.erase(itTrackEndQ);
659 itTrackLenF = fTrackLenF.erase(itTrackLenF);
660 itTrackLenB = fTrackLenB.erase(itTrackLenB);
661 itNTPCClustersOnTrack = fNTPCClustersOnTrack.erase(itNTPCClustersOnTrack);
662 itTrackAvgIonF = fTrackAvgIonF.erase(itTrackAvgIonF);
663 itTrackAvgIonB = fTrackAvgIonB.erase(itTrackAvgIonB);
667 ++itTrackStartX; ++itTrackStartY; ++itTrackStartZ;
668 ++itTrackStartPX; ++itTrackStartPY; ++itTrackStartPZ; ++itTrackStartQ;
669 ++itTrackEndX; ++itTrackEndY; ++itTrackEndZ;
670 ++itTrackEndPX; ++itTrackEndPY; ++itTrackEndPZ; ++itTrackEndQ;
671 ++itTrackLenF; ++itTrackLenB; ++itNTPCClustersOnTrack;
672 ++itTrackAvgIonF; ++itTrackAvgIonB;
675 if (fTrackIDNumber.size()==0)
continue;
680 std::list<gar::rec::IDNumber> deadVertex;
681 int nAssns = fVT_VertIDNumber.size();
682 for (
int iAssn=0; iAssn<nAssns; ++iAssn) {
685 found = std::find(fTrackIDNumber.begin(),fTrackIDNumber.end(), thisIDNumber);
686 if ( found == fTrackIDNumber.end() ) {
688 deadVertex.push_back(fVT_VertIDNumber[iAssn]);
691 if (deadVertex.size()>0) {
696 deadEnd = std::unique(deadVertex.begin(),deadVertex.end());
707 int nVerts = fVertIDNumber.size();
708 for (
int iVert=0; iVert<nVerts; ++iVert) {
711 found = std::find(deadStart,deadEnd, thisIDNumber);
712 if ( found != deadEnd ) {
714 itVertIDNumber = fVertIDNumber.erase(itVertIDNumber);
715 itVertX = fVertX.erase(itVertX);
716 itVertY = fVertY.erase(itVertY);
717 itVertZ = fVertZ.erase(itVertZ);
718 itVertN = fVertN.erase(itVertN);
719 itVertQ = fVertQ.erase(itVertQ);
723 ++itVertX; ++itVertY; ++itVertZ; ++itVertN; ++itVertQ;
726 #ifdef killNoRecoVerts 727 if (fVertIDNumber.size()==0)
continue;
736 for (
int iAssn=0; iAssn<nAssns; ++iAssn) {
739 found = std::find(deadStart,deadEnd, thisIDNumber);
740 if ( found != deadEnd ) {
742 itVT_VertIDNumber = fVT_VertIDNumber.erase(itVT_VertIDNumber);
743 itVT_TrackIDNumber = fVT_TrackIDNumber.erase(itVT_TrackIDNumber);
744 itVT_TrackEnd = fVT_TrackEnd.erase(itVT_TrackEnd);
747 ++itVT_VertIDNumber; ++itVT_TrackIDNumber; ++itVT_TrackEnd;
758 nAssns = fECALAssn_ClusIDNumber.size();
759 for (
int iAssn=0; iAssn<nAssns; ++iAssn) {
762 found = std::find(fTrackIDNumber.begin(),fTrackIDNumber.end(), thisIDNumber);
763 if ( found == fTrackIDNumber.end() ) {
765 itECALAssn_ClusIDNumber = fECALAssn_ClusIDNumber.erase(itECALAssn_ClusIDNumber);
766 itECALAssn_TrackIDNumber = fECALAssn_TrackIDNumber.erase(itECALAssn_TrackIDNumber);
767 itECALAssn_TrackEnd = fECALAssn_TrackEnd.erase(itECALAssn_TrackEnd);
770 ++itECALAssn_ClusIDNumber; ++itECALAssn_TrackIDNumber; ++itECALAssn_TrackEnd;
neutral current quasi-elastic
charged current deep inelastic scatter
neutrino electron elastic scatter
bool inFiducial(double x, double y, double z)
double Qadd(double const x, double const y)
offset to account for adding in Nuance codes to this enum
charged current quasi-elastic
charged current deep inelastic scatter
resonant charged current, nu p -> l- p pi+
charged current coherent pion
QTextStream & endl(QTextStream &s)