33 #include "art_root_io/TFileService.h" 34 #include "art_root_io/TFileDirectory.h" 35 #include "canvas/Persistency/Common/FindMany.h" 99 #include "TTimeStamp.h" 121 template <
typename T>
138 template <
typename Array_t>
149 { std::memcpy((
char*) &(
data()), (
char*) &(from.
data()),
sizeof(Array_t)); }
157 Data_t*
begin() {
return reinterpret_cast<Data_t*
>(&
array); }
158 const Data_t*
begin()
const {
return reinterpret_cast<const Data_t*
>(&
array); }
165 auto operator[] (
size_t index) -> decltype(*array) {
return array[
index]; }
166 auto operator[] (
size_t index)
const -> decltype(*array) {
return array[
index]; }
174 operator decltype(&array[0]) () {
return &array[0]; }
175 operator decltype(&array[0]) ()
const {
return &array[0]; }
193 template <
typename T>
195 template <
typename T>
197 template <
typename T>
198 using HitData_t = std::vector<BoxedArray<T[kNplanes][kMaxTrackHits]>>;
199 template <
typename T>
285 { MaxTracks = maxTracks; Resize(MaxTracks); }
286 void Resize(
size_t nTracks);
287 void SetAddresses(TTree* pTree,
std::string tracker,
bool isCosmics);
300 template <
typename T>
318 { MaxVertices = maxVertices; Resize(MaxVertices); }
319 void Resize(
size_t nVertices);
320 void SetAddresses(TTree* pTree,
std::string tracker,
bool isCosmics);
339 template <
typename T>
341 template <
typename T>
343 template <
typename T>
344 using HitData_t = std::vector<BoxedArray<T[kNplanes][kMaxShowerHits]>>;
345 template <
typename T>
381 name(new_name), MaxShowers(maxShowers) { Clear(); }
388 void MarkMissing(TTree* pTree);
391 { MaxShowers = maxShowers; Resize(MaxShowers); }
392 void Resize(
size_t nShowers);
393 void SetAddresses(TTree* pTree);
413 template <
typename T>
415 template <
typename T>
417 template <
typename T>
450 MaxPFParticles(maxPFParticles) { Clear(); }
454 { MaxPFParticles = maxPFParticles; Resize(MaxPFParticles); }
455 void Resize(
size_t numPFParticles);
456 void SetAddresses(TTree* pTree);
480 tdPandoraNuVertex = 0x2000,
481 tdPFParticle = 0x4000,
484 tdSpacePoint = 0x20000,
501 potbnbETOR860 = -99999.;
502 potbnbETOR875 = -99999.;
503 potnumiETORTGT = -99999.;
703 size_t MaxGeniePrimaries = 0;
753 size_t MaxGEANTparticles = 0;
762 std::vector<Float_t>
Px;
763 std::vector<Float_t>
Py;
764 std::vector<Float_t>
Pz;
765 std::vector<Float_t>
P;
923 template <
typename T>
1001 void SetBits(
unsigned int setbits,
bool unset =
false)
1002 {
if (unset) bits &= ~setbits;
else bits |= setbits; }
1006 std::vector<std::string>
const& ShowerAlgos = {}):
1008 { SetTrackers(nTrackers); SetVertexAlgos(nVertexAlgos); SetShowerAlgos(ShowerAlgos); Clear(); }
1011 {
return TrackData.at(iTracker); }
1013 {
return TrackData.at(iTracker); }
1016 {
return ShowerData.at(iShower); }
1018 {
return ShowerData.at(iShower); }
1021 {
return VertexData.at(iVertex); }
1023 {
return VertexData.at(iVertex); }
1026 {
return PFParticleData; }
1028 {
return PFParticleData; }
1031 void ClearLocalData();
1044 void SetShowerAlgos(std::vector<std::string>
const& ShowerAlgos);
1047 void ResizeGEANT(
int nParticles);
1050 void ResizeGenie(
int nPrimaries);
1053 void ResizeCry(
int nPrimaries);
1056 void ResizeProto(
int nPrimaries);
1059 void ResizeMCShower(
int nMCShowers);
1062 void ResizeMCTrack(
int nMCTracks);
1065 void ResizeSpacePointSolver(
int nSpacePoints);
1070 std::vector<std::string>
const& trackers,
1071 std::vector<std::string>
const& vertexalgos,
1072 std::vector<std::string>
const& showeralgos,
1118 TBranch* pBranch = pTree->GetBranch(name.c_str());
1120 pTree->Branch(name.c_str(), address, leaflist.c_str() );
1122 <<
"Creating branch '" << name <<
" with leaf '" << leaflist <<
"'";
1124 else if (pBranch->GetAddress() != address) {
1125 pBranch->SetAddress(address);
1127 <<
"Reassigning address to branch '" << name <<
"'";
1131 <<
"Branch '" << name <<
"' is fine";
1136 {
return this->operator() (name, address, leaflist.str() ); }
1137 template <
typename T>
1140 {
return this->operator() (name, (
void*) data.data(), leaflist ); }
1142 template <
typename T>
1151 TBranch* pBranch = pTree->GetBranch(name.c_str());
1153 pTree->Branch(name.c_str(), &
data);
1157 <<
"Creating object branch '" << name
1158 <<
" with " << TClass::GetClass(
typeid(
T))->ClassName();
1161 (*(
reinterpret_cast<std::vector<T>**
>(pBranch->GetAddress())) != &
data)
1168 pBranch->SetObject(&data);
1170 <<
"Reassigning object to branch '" << name <<
"'";
1174 <<
"Branch '" << name <<
"' is fine";
1194 template <
typename A>
1198 template <
typename T>
1200 {
using type =
typename std::vector<T>::value_type; };
1232 const simb::MCParticle& part, TLorentzVector& start, TLorentzVector&
end,
unsigned int &starti,
unsigned int &endi);
1234 const sim::MCTrack& mctrack, TLorentzVector& tpcstart, TLorentzVector& tpcend, TLorentzVector& tpcmom);
1235 double length(
const simb::MCParticle& part, TLorentzVector& start, TLorentzVector& end,
unsigned int &starti,
unsigned int &endi);
1236 double bdist(
const TVector3&
pos);
1243 std::unique_ptr<AnalysisTreeDataStruct>
fData;
1306 double ActiveBounds[6];
1318 {
return { fShowerModuleLabel.begin(), fShowerModuleLabel.end() }; }
1326 fData->SetBits(AnalysisTreeDataStruct::tdCry, !fSaveCryInfo);
1327 fData->SetBits(AnalysisTreeDataStruct::tdGenie, !fSaveGenieInfo);
1328 fData->SetBits(AnalysisTreeDataStruct::tdProto, !fSaveProtoInfo);
1329 fData->SetBits(AnalysisTreeDataStruct::tdGeant, !fSaveGeantInfo);
1330 fData->SetBits(AnalysisTreeDataStruct::tdMCshwr, !fSaveMCShowerInfo);
1331 fData->SetBits(AnalysisTreeDataStruct::tdMCtrk, !fSaveMCTrackInfo);
1332 fData->SetBits(AnalysisTreeDataStruct::tdHit, !fSaveHitInfo);
1333 fData->SetBits(AnalysisTreeDataStruct::tdRawDigit, !fSaveRawDigitInfo);
1334 fData->SetBits(AnalysisTreeDataStruct::tdFlash, !fSaveFlashInfo);
1335 fData->SetBits(AnalysisTreeDataStruct::tdCount, !fSaveExternCounterInfo);
1336 fData->SetBits(AnalysisTreeDataStruct::tdShower, !fSaveShowerInfo);
1337 fData->SetBits(AnalysisTreeDataStruct::tdCluster,!fSaveClusterInfo);
1338 fData->SetBits(AnalysisTreeDataStruct::tdPandoraNuVertex,!fSavePandoraNuVertexInfo);
1339 fData->SetBits(AnalysisTreeDataStruct::tdTrack, !fSaveTrackInfo);
1340 fData->SetBits(AnalysisTreeDataStruct::tdVertex, !fSaveVertexInfo);
1341 fData->SetBits(AnalysisTreeDataStruct::tdAuxDet, !fSaveAuxDetInfo);
1342 fData->SetBits(AnalysisTreeDataStruct::tdPFParticle, !fSavePFParticleInfo);
1343 fData->SetBits(AnalysisTreeDataStruct::tdSpacePoint, !fSaveSpacePointSolverInfo);
1344 fData->SetBits(AnalysisTreeDataStruct::tdCnn, !fSaveCnnInfo);
1347 fData->SetTrackers(GetNTrackers());
1348 fData->SetVertexAlgos(GetNVertexAlgos());
1349 fData->SetShowerAlgos(GetShowerAlgos());
1351 if (bClearData) fData->Clear();
1358 CheckData(__func__); CheckTree(__func__);
1360 (fTree, fTrackModuleLabel, fVertexModuleLabel, fShowerModuleLabel, isCosmics);
1367 CheckData(__func__); CheckTree(__func__);
1368 if (iTracker >= fData->GetNTrackers()) {
1370 <<
"AnalysisTree::SetTrackerAddresses(): no tracker #" << iTracker
1371 <<
" (" << fData->GetNTrackers() <<
" available)";
1373 fData->GetTrackerData(iTracker)
1374 .SetAddresses(fTree, fTrackModuleLabel[iTracker], isCosmics);
1380 CheckData(__func__); CheckTree(__func__);
1381 if (iVertexAlg >= fData->GetNVertexAlgos()) {
1383 <<
"AnalysisTree::SetVertexAddresses(): no vertex alg #" << iVertexAlg
1384 <<
" (" << fData->GetNVertexAlgos() <<
" available)";
1386 fData->GetVertexData(iVertexAlg)
1387 .SetAddresses(fTree, fVertexModuleLabel[iVertexAlg], isCosmics);
1394 CheckData(__func__); CheckTree(__func__);
1395 if (iShower >= fData->GetNShowerAlgos()) {
1397 <<
"AnalysisTree::SetShowerAddresses(): no shower algo #" << iShower
1398 <<
" (" << fData->GetNShowerAlgos() <<
" available)";
1400 fData->GetShowerData(iShower).SetAddresses(fTree);
1407 CheckData(__func__); CheckTree(__func__);
1408 fData->GetPFParticleData().SetAddresses(fTree);
1412 void CreateTree(
bool bClearData =
false);
1422 <<
"AnalysisTree::" << caller <<
": no data";
1429 <<
"AnalysisTree::" << caller <<
": no tree";
1436 const std::map<Short_t, Short_t> &showerIDtoPFParticleIDMap
1442 std::vector<recob::Shower>
const& showers,
const bool fSavePFParticleInfo,
1443 const std::map<Short_t, Short_t> &showerIDtoPFParticleIDMap
1452 class AutoResettingStringSteam:
public std::ostringstream {
1454 AutoResettingStringSteam& operator() () {
str(
"");
return *
this; }
1458 template <
typename ITER,
typename TYPE>
1459 inline void FillWith(ITER from, ITER to, TYPE
value)
1463 template <
typename ITER,
typename TYPE>
1464 inline void FillWith(ITER from,
size_t n, TYPE value)
1468 template <
typename CONT,
typename V>
1469 inline void FillWith(CONT&
data,
const V& value)
1481 MaxTracks = nTracks;
1483 trkId.resize(MaxTracks);
1484 trkncosmictags_tagger.resize(MaxTracks);
1485 trkcosmicscore_tagger.resize(MaxTracks);
1486 trkcosmictype_tagger.resize(MaxTracks);
1487 trkncosmictags_containmenttagger.resize(MaxTracks);
1488 trkcosmicscore_containmenttagger.resize(MaxTracks);
1489 trkcosmictype_containmenttagger.resize(MaxTracks);
1490 trkncosmictags_flashmatch.resize(MaxTracks);
1491 trkcosmicscore_flashmatch.resize(MaxTracks);
1492 trkcosmictype_flashmatch.resize(MaxTracks);
1493 trkstartx.resize(MaxTracks);
1494 trkstarty.resize(MaxTracks);
1495 trkstartz.resize(MaxTracks);
1496 trkstartd.resize(MaxTracks);
1497 trkendx.resize(MaxTracks);
1498 trkendy.resize(MaxTracks);
1499 trkendz.resize(MaxTracks);
1500 trkendd.resize(MaxTracks);
1501 trkflashT0.resize(MaxTracks);
1502 trktrueT0.resize(MaxTracks);
1503 trktheta.resize(MaxTracks);
1504 trkphi.resize(MaxTracks);
1505 trkstartdcosx.resize(MaxTracks);
1506 trkstartdcosy.resize(MaxTracks);
1507 trkstartdcosz.resize(MaxTracks);
1508 trkenddcosx.resize(MaxTracks);
1509 trkenddcosy.resize(MaxTracks);
1510 trkenddcosz.resize(MaxTracks);
1511 trkthetaxz.resize(MaxTracks);
1512 trkthetayz.resize(MaxTracks);
1513 trkmom.resize(MaxTracks);
1514 trkmomrange.resize(MaxTracks);
1515 trkmommschi2.resize(MaxTracks);
1516 trkmommsllhd.resize(MaxTracks);
1517 trklen.resize(MaxTracks);
1518 trksvtxid.resize(MaxTracks);
1519 trkevtxid.resize(MaxTracks);
1521 trkpidpdg.resize(MaxTracks);
1522 trkpidchi.resize(MaxTracks);
1523 trkpidchipr.resize(MaxTracks);
1524 trkpidchika.resize(MaxTracks);
1525 trkpidchipi.resize(MaxTracks);
1526 trkpidchimu.resize(MaxTracks);
1527 trkpidpida.resize(MaxTracks);
1528 trkpidbestplane.resize(MaxTracks);
1529 trkpidmvamu.resize(MaxTracks);
1530 trkpidmvae.resize(MaxTracks);
1531 trkpidmvapich.resize(MaxTracks);
1532 trkpidmvaphoton.resize(MaxTracks);
1533 trkpidmvapr.resize(MaxTracks);
1535 trkke.resize(MaxTracks);
1536 trkrange.resize(MaxTracks);
1537 trkidtruth.resize(MaxTracks);
1538 trkorigin.resize(MaxTracks);
1539 trkpdgtruth.resize(MaxTracks);
1540 trkefftruth.resize(MaxTracks);
1541 trkpurtruth.resize(MaxTracks);
1542 trkpurity.resize(MaxTracks);
1543 trkcompleteness.resize(MaxTracks);
1544 trkg4id.resize(MaxTracks);
1545 trkorig.resize(MaxTracks);
1546 trkpitchc.resize(MaxTracks);
1547 ntrkhits.resize(MaxTracks);
1549 trkdedx.resize(MaxTracks);
1550 trkdqdx.resize(MaxTracks);
1551 trkresrg.resize(MaxTracks);
1552 trktpc.resize(MaxTracks);
1553 trkxyz.resize(MaxTracks);
1555 trkhasPFParticle.resize(MaxTracks);
1556 trkPFParticleID.resize(MaxTracks);
1564 FillWith(trkId , -9999 );
1565 FillWith(trkncosmictags_tagger, -9999 );
1566 FillWith(trkcosmicscore_tagger, -99999.);
1567 FillWith(trkcosmictype_tagger, -9999 );
1568 FillWith(trkncosmictags_containmenttagger, -9999 );
1569 FillWith(trkcosmicscore_containmenttagger, -99999.);
1570 FillWith(trkcosmictype_containmenttagger, -9999 );
1571 FillWith(trkncosmictags_flashmatch, -9999 );
1572 FillWith(trkcosmicscore_flashmatch, -99999.);
1573 FillWith(trkcosmictype_flashmatch, -9999 );
1574 FillWith(trkstartx , -99999.);
1575 FillWith(trkstarty , -99999.);
1576 FillWith(trkstartz , -99999.);
1577 FillWith(trkstartd , -99999.);
1578 FillWith(trkendx , -99999.);
1579 FillWith(trkendy , -99999.);
1580 FillWith(trkendz , -99999.);
1581 FillWith(trkendd , -99999.);
1582 FillWith(trkflashT0 , -99999.);
1583 FillWith(trktrueT0 , -99999.);
1584 FillWith(trkg4id , -99999 );
1585 FillWith(trkpurity , -99999.);
1586 FillWith(trkcompleteness, -99999.);
1587 FillWith(trkorig , -99999 );
1588 FillWith(trktheta , -99999.);
1589 FillWith(trkphi , -99999.);
1590 FillWith(trkstartdcosx, -99999.);
1591 FillWith(trkstartdcosy, -99999.);
1592 FillWith(trkstartdcosz, -99999.);
1593 FillWith(trkenddcosx , -99999.);
1594 FillWith(trkenddcosy , -99999.);
1595 FillWith(trkenddcosz , -99999.);
1596 FillWith(trkthetaxz , -99999.);
1597 FillWith(trkthetayz , -99999.);
1598 FillWith(trkmom , -99999.);
1599 FillWith(trkmomrange , -99999.);
1600 FillWith(trkmommschi2 , -99999.);
1601 FillWith(trkmommsllhd , -99999.);
1602 FillWith(trklen , -99999.);
1603 FillWith(trksvtxid , -1);
1604 FillWith(trkevtxid , -1);
1605 FillWith(trkpidbestplane, -1);
1606 FillWith(trkpidmvamu , -99999.);
1607 FillWith(trkpidmvae , -99999.);
1608 FillWith(trkpidmvapich, -99999.);
1609 FillWith(trkpidmvaphoton , -99999.);
1610 FillWith(trkpidmvapr , -99999.);
1612 FillWith(trkhasPFParticle, -1);
1613 FillWith(trkPFParticleID , -1);
1615 for (
size_t iTrk = 0; iTrk < MaxTracks; ++iTrk){
1619 FillWith(trkke[iTrk] , -99999.);
1620 FillWith(trkrange[iTrk] , -99999.);
1621 FillWith(trkidtruth[iTrk] , -99999 );
1622 FillWith(trkorigin[iTrk] , -1 );
1623 FillWith(trkpdgtruth[iTrk], -99999 );
1624 FillWith(trkefftruth[iTrk], -99999.);
1625 FillWith(trkpurtruth[iTrk], -99999.);
1626 FillWith(trkpitchc[iTrk] , -99999.);
1627 FillWith(ntrkhits[iTrk] , -9999 );
1629 FillWith(trkdedx[iTrk], 0.);
1630 FillWith(trkdqdx[iTrk], 0.);
1631 FillWith(trkresrg[iTrk], 0.);
1632 FillWith(trktpc[iTrk], -1);
1633 FillWith(trkxyz[iTrk], 0.);
1635 FillWith(trkpidpdg[iTrk] , -1);
1636 FillWith(trkpidchi[iTrk] , -99999.);
1637 FillWith(trkpidchipr[iTrk] , -99999.);
1638 FillWith(trkpidchika[iTrk] , -99999.);
1639 FillWith(trkpidchipi[iTrk] , -99999.);
1640 FillWith(trkpidchimu[iTrk] , -99999.);
1641 FillWith(trkpidpida[iTrk] , -99999.);
1650 if (MaxTracks == 0)
return;
1654 AutoResettingStringSteam sstr;
1656 std::string MaxTrackHitsIndexStr(
"[" + sstr.str() +
"]");
1661 BranchName =
"ntracks_" + TrackLabel;
1662 CreateBranch(BranchName, &
ntracks, BranchName +
"/S");
1663 std::string NTracksIndexStr =
"[" + BranchName +
"]";
1665 BranchName =
"trkId_" + TrackLabel;
1666 CreateBranch(BranchName, trkId, BranchName + NTracksIndexStr +
"/S");
1668 BranchName =
"trkncosmictags_tagger_" + TrackLabel;
1669 CreateBranch(BranchName, trkncosmictags_tagger, BranchName + NTracksIndexStr +
"/S");
1671 BranchName =
"trkcosmicscore_tagger_" + TrackLabel;
1672 CreateBranch(BranchName, trkcosmicscore_tagger, BranchName + NTracksIndexStr +
"/F");
1674 BranchName =
"trkcosmictype_tagger_" + TrackLabel;
1675 CreateBranch(BranchName, trkcosmictype_tagger, BranchName + NTracksIndexStr +
"/S");
1677 BranchName =
"trkncosmictags_containmenttagger_" + TrackLabel;
1678 CreateBranch(BranchName, trkncosmictags_containmenttagger, BranchName + NTracksIndexStr +
"/S");
1680 BranchName =
"trkcosmicscore_containmenttagger_" + TrackLabel;
1681 CreateBranch(BranchName, trkcosmicscore_containmenttagger, BranchName + NTracksIndexStr +
"/F");
1683 BranchName =
"trkcosmictype_containmenttagger_" + TrackLabel;
1684 CreateBranch(BranchName, trkcosmictype_containmenttagger, BranchName + NTracksIndexStr +
"/S");
1686 BranchName =
"trkncosmictags_flashmatch_" + TrackLabel;
1687 CreateBranch(BranchName, trkncosmictags_flashmatch, BranchName + NTracksIndexStr +
"/S");
1689 BranchName =
"trkcosmicscore_flashmatch_" + TrackLabel;
1690 CreateBranch(BranchName, trkcosmicscore_flashmatch, BranchName + NTracksIndexStr +
"/F");
1692 BranchName =
"trkcosmictype_flashmatch_" + TrackLabel;
1693 CreateBranch(BranchName, trkcosmictype_flashmatch, BranchName + NTracksIndexStr +
"/S");
1695 BranchName =
"trkke_" + TrackLabel;
1696 CreateBranch(BranchName, trkke, BranchName + NTracksIndexStr +
"[3]/F");
1698 BranchName =
"trkrange_" + TrackLabel;
1699 CreateBranch(BranchName, trkrange, BranchName + NTracksIndexStr +
"[3]/F");
1701 BranchName =
"trkidtruth_" + TrackLabel;
1702 CreateBranch(BranchName, trkidtruth, BranchName + NTracksIndexStr +
"[3]/I");
1704 BranchName =
"trkorigin_" + TrackLabel;
1705 CreateBranch(BranchName, trkorigin, BranchName + NTracksIndexStr +
"[3]/S");
1707 BranchName =
"trkpdgtruth_" + TrackLabel;
1708 CreateBranch(BranchName, trkpdgtruth, BranchName + NTracksIndexStr +
"[3]/I");
1710 BranchName =
"trkefftruth_" + TrackLabel;
1711 CreateBranch(BranchName, trkefftruth, BranchName + NTracksIndexStr +
"[3]/F");
1713 BranchName =
"trkpurtruth_" + TrackLabel;
1714 CreateBranch(BranchName, trkpurtruth, BranchName + NTracksIndexStr +
"[3]/F");
1716 BranchName =
"trkpitchc_" + TrackLabel;
1717 CreateBranch(BranchName, trkpitchc, BranchName + NTracksIndexStr +
"[3]/F");
1719 BranchName =
"ntrkhits_" + TrackLabel;
1720 CreateBranch(BranchName, ntrkhits, BranchName + NTracksIndexStr +
"[3]/S");
1723 BranchName =
"trkdedx_" + TrackLabel;
1724 CreateBranch(BranchName, trkdedx, BranchName + NTracksIndexStr +
"[3]" + MaxTrackHitsIndexStr +
"/F");
1726 BranchName =
"trkdqdx_" + TrackLabel;
1727 CreateBranch(BranchName, trkdqdx, BranchName + NTracksIndexStr +
"[3]" + MaxTrackHitsIndexStr +
"/F");
1729 BranchName =
"trkresrg_" + TrackLabel;
1730 CreateBranch(BranchName, trkresrg, BranchName + NTracksIndexStr +
"[3]" + MaxTrackHitsIndexStr +
"/F");
1732 BranchName =
"trktpc_" + TrackLabel;
1733 CreateBranch(BranchName, trktpc, BranchName + NTracksIndexStr +
"[3]" + MaxTrackHitsIndexStr +
"/I");
1735 BranchName =
"trkxyz_" + TrackLabel;
1736 CreateBranch(BranchName, trkxyz, BranchName + NTracksIndexStr +
"[3]" + MaxTrackHitsIndexStr +
"[3]" +
"/F");
1739 BranchName =
"trkstartx_" + TrackLabel;
1740 CreateBranch(BranchName, trkstartx, BranchName + NTracksIndexStr +
"/F");
1742 BranchName =
"trkstarty_" + TrackLabel;
1743 CreateBranch(BranchName, trkstarty, BranchName + NTracksIndexStr +
"/F");
1745 BranchName =
"trkstartz_" + TrackLabel;
1746 CreateBranch(BranchName, trkstartz, BranchName + NTracksIndexStr +
"/F");
1748 BranchName =
"trkstartd_" + TrackLabel;
1749 CreateBranch(BranchName, trkstartd, BranchName + NTracksIndexStr +
"/F");
1751 BranchName =
"trkendx_" + TrackLabel;
1752 CreateBranch(BranchName, trkendx, BranchName + NTracksIndexStr +
"/F");
1754 BranchName =
"trkendy_" + TrackLabel;
1755 CreateBranch(BranchName, trkendy, BranchName + NTracksIndexStr +
"/F");
1757 BranchName =
"trkendz_" + TrackLabel;
1758 CreateBranch(BranchName, trkendz, BranchName + NTracksIndexStr +
"/F");
1760 BranchName =
"trkendd_" + TrackLabel;
1761 CreateBranch(BranchName, trkendd, BranchName + NTracksIndexStr +
"/F");
1763 BranchName =
"trkflashT0_" + TrackLabel;
1764 CreateBranch(BranchName, trkflashT0, BranchName + NTracksIndexStr +
"/F");
1766 BranchName =
"trktrueT0_" + TrackLabel;
1767 CreateBranch(BranchName, trktrueT0, BranchName + NTracksIndexStr +
"/F");
1769 BranchName =
"trkg4id_" + TrackLabel;
1770 CreateBranch(BranchName, trkg4id, BranchName + NTracksIndexStr +
"/I");
1772 BranchName =
"trkorig_" + TrackLabel;
1773 CreateBranch(BranchName, trkorig, BranchName + NTracksIndexStr +
"/I");
1775 BranchName =
"trkpurity_" + TrackLabel;
1776 CreateBranch(BranchName, trkpurity, BranchName + NTracksIndexStr +
"/F");
1778 BranchName =
"trkcompleteness_" + TrackLabel;
1779 CreateBranch(BranchName, trkcompleteness, BranchName + NTracksIndexStr +
"/F");
1781 BranchName =
"trktheta_" + TrackLabel;
1782 CreateBranch(BranchName, trktheta, BranchName + NTracksIndexStr +
"/F");
1784 BranchName =
"trkphi_" + TrackLabel;
1785 CreateBranch(BranchName, trkphi, BranchName + NTracksIndexStr +
"/F");
1787 BranchName =
"trkstartdcosx_" + TrackLabel;
1788 CreateBranch(BranchName, trkstartdcosx, BranchName + NTracksIndexStr +
"/F");
1790 BranchName =
"trkstartdcosy_" + TrackLabel;
1791 CreateBranch(BranchName, trkstartdcosy, BranchName + NTracksIndexStr +
"/F");
1793 BranchName =
"trkstartdcosz_" + TrackLabel;
1794 CreateBranch(BranchName, trkstartdcosz, BranchName + NTracksIndexStr +
"/F");
1796 BranchName =
"trkenddcosx_" + TrackLabel;
1797 CreateBranch(BranchName, trkenddcosx, BranchName + NTracksIndexStr +
"/F");
1799 BranchName =
"trkenddcosy_" + TrackLabel;
1800 CreateBranch(BranchName, trkenddcosy, BranchName + NTracksIndexStr +
"/F");
1802 BranchName =
"trkenddcosz_" + TrackLabel;
1803 CreateBranch(BranchName, trkenddcosz, BranchName + NTracksIndexStr +
"/F");
1805 BranchName =
"trkthetaxz_" + TrackLabel;
1806 CreateBranch(BranchName, trkthetaxz, BranchName + NTracksIndexStr +
"/F");
1808 BranchName =
"trkthetayz_" + TrackLabel;
1809 CreateBranch(BranchName, trkthetayz, BranchName + NTracksIndexStr +
"/F");
1811 BranchName =
"trkmom_" + TrackLabel;
1812 CreateBranch(BranchName, trkmom, BranchName + NTracksIndexStr +
"/F");
1814 BranchName =
"trkmomrange_" + TrackLabel;
1815 CreateBranch(BranchName, trkmomrange, BranchName + NTracksIndexStr +
"/F");
1817 BranchName =
"trkmommschi2_" + TrackLabel;
1818 CreateBranch(BranchName, trkmommschi2, BranchName + NTracksIndexStr +
"/F");
1820 BranchName =
"trkmommsllhd_" + TrackLabel;
1821 CreateBranch(BranchName, trkmommsllhd, BranchName + NTracksIndexStr +
"/F");
1823 BranchName =
"trklen_" + TrackLabel;
1824 CreateBranch(BranchName, trklen, BranchName + NTracksIndexStr +
"/F");
1826 BranchName =
"trksvtxid_" + TrackLabel;
1827 CreateBranch(BranchName, trksvtxid, BranchName + NTracksIndexStr +
"/S");
1829 BranchName =
"trkevtxid_" + TrackLabel;
1830 CreateBranch(BranchName, trkevtxid, BranchName + NTracksIndexStr +
"/S");
1832 BranchName =
"trkpidmvamu_" + TrackLabel;
1833 CreateBranch(BranchName, trkpidmvamu, BranchName + NTracksIndexStr +
"/F");
1835 BranchName =
"trkpidmvae_" + TrackLabel;
1836 CreateBranch(BranchName, trkpidmvae, BranchName + NTracksIndexStr +
"/F");
1838 BranchName =
"trkpidmvapich_" + TrackLabel;
1839 CreateBranch(BranchName, trkpidmvapich, BranchName + NTracksIndexStr +
"/F");
1841 BranchName =
"trkpidmvaphoton_" + TrackLabel;
1842 CreateBranch(BranchName, trkpidmvaphoton, BranchName + NTracksIndexStr +
"/F");
1844 BranchName =
"trkpidmvapr_" + TrackLabel;
1845 CreateBranch(BranchName, trkpidmvapr, BranchName + NTracksIndexStr +
"/F");
1847 BranchName =
"trkpidpdg_" + TrackLabel;
1848 CreateBranch(BranchName, trkpidpdg, BranchName + NTracksIndexStr +
"[3]/I");
1850 BranchName =
"trkpidchi_" + TrackLabel;
1851 CreateBranch(BranchName, trkpidchi, BranchName + NTracksIndexStr +
"[3]/F");
1853 BranchName =
"trkpidchipr_" + TrackLabel;
1854 CreateBranch(BranchName, trkpidchipr, BranchName + NTracksIndexStr +
"[3]/F");
1856 BranchName =
"trkpidchika_" + TrackLabel;
1857 CreateBranch(BranchName, trkpidchika, BranchName + NTracksIndexStr +
"[3]/F");
1859 BranchName =
"trkpidchipi_" + TrackLabel;
1860 CreateBranch(BranchName, trkpidchipi, BranchName + NTracksIndexStr +
"[3]/F");
1862 BranchName =
"trkpidchimu_" + TrackLabel;
1863 CreateBranch(BranchName, trkpidchimu, BranchName + NTracksIndexStr +
"[3]/F");
1865 BranchName =
"trkpidpida_" + TrackLabel;
1866 CreateBranch(BranchName, trkpidpida, BranchName + NTracksIndexStr +
"[3]/F");
1868 BranchName =
"trkpidbestplane_" + TrackLabel;
1869 CreateBranch(BranchName, trkpidbestplane, BranchName + NTracksIndexStr +
"/S");
1871 BranchName =
"trkhasPFParticle_" + TrackLabel;
1872 CreateBranch(BranchName, trkhasPFParticle, BranchName + NTracksIndexStr +
"/S");
1874 BranchName =
"trkPFParticleID_" + TrackLabel;
1875 CreateBranch(BranchName, trkPFParticleID, BranchName + NTracksIndexStr +
"/S");
1883 MaxVertices = nVertices;
1884 vtxId.resize(MaxVertices);
1885 vtxx.resize(MaxVertices);
1886 vtxy.resize(MaxVertices);
1887 vtxz.resize(MaxVertices);
1889 vtxhasPFParticle.resize(MaxVertices);
1890 vtxPFParticleID.resize(MaxVertices);
1894 Resize(MaxVertices);
1897 FillWith(vtxId , -9999 );
1898 FillWith(vtxx , -9999 );
1899 FillWith(vtxy , -9999 );
1900 FillWith(vtxz , -9999 );
1901 FillWith(vtxhasPFParticle, -1 );
1902 FillWith(vtxPFParticleID , -1 );
1908 if (MaxVertices == 0)
return;
1912 AutoResettingStringSteam sstr;
1917 BranchName =
"nvtx_" + VertexLabel;
1918 CreateBranch(BranchName, &nvtx, BranchName +
"/S");
1919 std::string NVertexIndexStr =
"[" + BranchName +
"]";
1921 BranchName =
"vtxId_" + VertexLabel;
1922 CreateBranch(BranchName, vtxId, BranchName + NVertexIndexStr +
"/S");
1924 BranchName =
"vtxx_" + VertexLabel;
1925 CreateBranch(BranchName, vtxx, BranchName + NVertexIndexStr +
"/F");
1927 BranchName =
"vtxy_" + VertexLabel;
1928 CreateBranch(BranchName, vtxy, BranchName + NVertexIndexStr +
"/F");
1930 BranchName =
"vtxz_" + VertexLabel;
1931 CreateBranch(BranchName, vtxz, BranchName + NVertexIndexStr +
"/F");
1933 BranchName =
"vtxhasPFParticle_" + VertexLabel;
1934 CreateBranch(BranchName, vtxhasPFParticle, BranchName + NVertexIndexStr +
"/S");
1936 BranchName =
"vtxPFParticleID_" + VertexLabel;
1937 CreateBranch(BranchName, vtxPFParticleID, BranchName + NVertexIndexStr +
"/S");
1946 MaxPFParticles = nPFParticles;
1948 pfp_selfID.resize(MaxPFParticles);
1949 pfp_isPrimary.resize(MaxPFParticles);
1950 pfp_numDaughters.resize(MaxPFParticles);
1951 pfp_daughterIDs.resize(MaxPFParticles);
1952 pfp_parentID.resize(MaxPFParticles);
1953 pfp_vertexID.resize(MaxPFParticles);
1954 pfp_isShower.resize(MaxPFParticles);
1955 pfp_isTrack.resize(MaxPFParticles);
1956 pfp_trackID.resize(MaxPFParticles);
1957 pfp_showerID.resize(MaxPFParticles);
1958 pfp_pdgCode.resize(MaxPFParticles);
1959 pfp_numClusters.resize(MaxPFParticles);
1960 pfp_clusterIDs.resize(MaxPFParticles);
1961 pfp_isNeutrino.resize(MaxPFParticles);
1965 Resize(MaxPFParticles);
1967 nPFParticles = -9999;
1968 FillWith(pfp_selfID, -9999);
1969 FillWith(pfp_isPrimary, -9999);
1970 FillWith(pfp_numDaughters, -9999);
1971 FillWith(pfp_parentID, -9999);
1972 FillWith(pfp_vertexID, -9999);
1973 FillWith(pfp_isShower, -9999);
1974 FillWith(pfp_isTrack, -9999);
1975 FillWith(pfp_trackID, -9999);
1976 FillWith(pfp_showerID, -9999);
1977 FillWith(pfp_pdgCode, -9999);
1978 FillWith(pfp_isNeutrino, -9999);
1979 pfp_numNeutrinos = -9999;
1980 FillWith(pfp_neutrinoIDs, -9999);
1982 for (
size_t iPFParticle = 0; iPFParticle < MaxPFParticles; ++iPFParticle){
1985 FillWith(pfp_daughterIDs[iPFParticle], -9999);
1986 FillWith(pfp_clusterIDs[iPFParticle], -9999);
1994 if (MaxPFParticles == 0) {
return; }
1998 AutoResettingStringSteam sstr;
2000 std::string MaxNDaughtersIndexStr(
"[" + sstr.str() +
"]");
2004 std::string MaxNClustersIndexStr(
"[" + sstr.str() +
"]");
2008 std::string MaxNNeutrinosIndexStr(
"[" + sstr.str() +
"]");
2012 BranchName =
"nPFParticles";
2013 CreateBranch(BranchName, &nPFParticles, BranchName +
"/S");
2014 std::string NPFParticleIndexStr =
"[" + BranchName +
"]";
2016 BranchName =
"pfp_selfID";
2017 CreateBranch(BranchName, pfp_selfID, BranchName + NPFParticleIndexStr +
"/S");
2019 BranchName =
"pfp_isPrimary";
2020 CreateBranch(BranchName, pfp_isPrimary, BranchName + NPFParticleIndexStr +
"/S");
2022 BranchName =
"pfp_numDaughters";
2023 CreateBranch(BranchName, pfp_numDaughters, BranchName + NPFParticleIndexStr +
"/S");
2025 BranchName =
"pfp_daughterIDs";
2026 CreateBranch(BranchName, pfp_daughterIDs, BranchName + NPFParticleIndexStr + MaxNDaughtersIndexStr +
"/S");
2028 BranchName =
"pfp_parentID";
2029 CreateBranch(BranchName, pfp_parentID, BranchName + NPFParticleIndexStr +
"/S");
2031 BranchName =
"pfp_vertexID";
2032 CreateBranch(BranchName, pfp_vertexID, BranchName + NPFParticleIndexStr +
"/S");
2034 BranchName =
"pfp_isShower";
2035 CreateBranch(BranchName, pfp_isShower, BranchName + NPFParticleIndexStr +
"/S");
2037 BranchName =
"pfp_isTrack";
2038 CreateBranch(BranchName, pfp_isTrack, BranchName + NPFParticleIndexStr +
"/S");
2040 BranchName =
"pfp_trackID";
2041 CreateBranch(BranchName, pfp_trackID, BranchName + NPFParticleIndexStr +
"/S");
2043 BranchName =
"pfp_showerID";
2044 CreateBranch(BranchName, pfp_showerID, BranchName + NPFParticleIndexStr +
"/S");
2046 BranchName =
"pfp_pdgCode";
2047 CreateBranch(BranchName, pfp_pdgCode, BranchName + NPFParticleIndexStr +
"/I");
2049 BranchName =
"pfp_numClusters";
2050 CreateBranch(BranchName, pfp_numClusters, BranchName + NPFParticleIndexStr +
"/S");
2052 BranchName =
"pfp_clusterIDs";
2053 CreateBranch(BranchName, pfp_clusterIDs, BranchName + NPFParticleIndexStr + MaxNClustersIndexStr +
"/S");
2055 BranchName =
"pfp_isNeutrino";
2056 CreateBranch(BranchName, pfp_isNeutrino, BranchName + NPFParticleIndexStr +
"/S");
2058 BranchName =
"pfp_numNeutrinos";
2059 CreateBranch(BranchName, &pfp_numNeutrinos, BranchName +
"/S");
2061 BranchName =
"pfp_neutrinoIDs";
2062 CreateBranch(BranchName, pfp_neutrinoIDs, BranchName + MaxNNeutrinosIndexStr +
"/S");
2072 MaxShowers = nShowers;
2074 showerID.resize(MaxShowers);
2075 shwr_bestplane.resize(MaxShowers);
2076 shwr_length.resize(MaxShowers);
2077 shwr_startdcosx.resize(MaxShowers);
2078 shwr_startdcosy.resize(MaxShowers);
2079 shwr_startdcosz.resize(MaxShowers);
2080 shwr_startx.resize(MaxShowers);
2081 shwr_starty.resize(MaxShowers);
2082 shwr_startz.resize(MaxShowers);
2083 shwr_totEng.resize(MaxShowers);
2084 shwr_dedx.resize(MaxShowers);
2085 shwr_mipEng.resize(MaxShowers);
2086 shwr_pidmvamu.resize(MaxShowers);
2087 shwr_pidmvae.resize(MaxShowers);
2088 shwr_pidmvapich.resize(MaxShowers);
2089 shwr_pidmvaphoton.resize(MaxShowers);
2090 shwr_pidmvapr.resize(MaxShowers);
2092 shwr_hasPFParticle.resize(MaxShowers);
2093 shwr_PFParticleID.resize(MaxShowers);
2101 FillWith(showerID, -9999 );
2102 FillWith(shwr_bestplane, -9999 );
2103 FillWith(shwr_length, -99999.);
2104 FillWith(shwr_startdcosx, -99999.);
2105 FillWith(shwr_startdcosy, -99999.);
2106 FillWith(shwr_startdcosz, -99999.);
2107 FillWith(shwr_startx, -99999.);
2108 FillWith(shwr_starty, -99999.);
2109 FillWith(shwr_startz, -99999.);
2110 FillWith(shwr_pidmvamu, -99999.);
2111 FillWith(shwr_pidmvae, -99999.);
2112 FillWith(shwr_pidmvapich, -99999.);
2113 FillWith(shwr_pidmvaphoton, -99999.);
2114 FillWith(shwr_pidmvapr, -99999.);
2116 FillWith(shwr_hasPFParticle, -1);
2117 FillWith(shwr_PFParticleID, -1);
2119 for (
size_t iShw = 0; iShw < MaxShowers; ++iShw){
2122 FillWith(shwr_totEng[iShw], -99999.);
2123 FillWith(shwr_dedx[iShw], -99999.);
2124 FillWith(shwr_mipEng[iShw], -99999.);
2149 SetAddresses(pTree);
2160 if (MaxShowers == 0)
return;
2164 AutoResettingStringSteam sstr;
2166 std::string MaxShowerHitsIndexStr(
"[" + sstr.str() +
"]");
2171 BranchName =
"nshowers_" + ShowerLabel;
2172 CreateBranch(BranchName, &nshowers, BranchName +
"/S");
2173 std::string NShowerIndexStr =
"[" + BranchName +
"]";
2175 BranchName =
"showerID_" + ShowerLabel;
2176 CreateBranch(BranchName, showerID, BranchName + NShowerIndexStr +
"/S");
2178 BranchName =
"shwr_bestplane_" + ShowerLabel;
2179 CreateBranch(BranchName, shwr_bestplane, BranchName + NShowerIndexStr +
"/S");
2181 BranchName =
"shwr_length_" + ShowerLabel;
2182 CreateBranch(BranchName, shwr_length, BranchName + NShowerIndexStr +
"/F");
2184 BranchName =
"shwr_startdcosx_" + ShowerLabel;
2185 CreateBranch(BranchName, shwr_startdcosx, BranchName + NShowerIndexStr +
"/F");
2187 BranchName =
"shwr_startdcosy_" + ShowerLabel;
2188 CreateBranch(BranchName, shwr_startdcosy, BranchName + NShowerIndexStr +
"/F");
2190 BranchName =
"shwr_startdcosz_" + ShowerLabel;
2191 CreateBranch(BranchName, shwr_startdcosz, BranchName + NShowerIndexStr +
"/F");
2193 BranchName =
"shwr_startx_" + ShowerLabel;
2194 CreateBranch(BranchName, shwr_startx, BranchName + NShowerIndexStr +
"/F");
2196 BranchName =
"shwr_starty_" + ShowerLabel;
2197 CreateBranch(BranchName, shwr_starty, BranchName + NShowerIndexStr +
"/F");
2199 BranchName =
"shwr_startz_" + ShowerLabel;
2200 CreateBranch(BranchName, shwr_startz, BranchName + NShowerIndexStr +
"/F");
2202 BranchName =
"shwr_totEng_" + ShowerLabel;
2203 CreateBranch(BranchName, shwr_totEng, BranchName + NShowerIndexStr +
"[3]/F");
2205 BranchName =
"shwr_dedx_" + ShowerLabel;
2206 CreateBranch(BranchName, shwr_dedx, BranchName + NShowerIndexStr +
"[3]/F");
2208 BranchName =
"shwr_mipEng_" + ShowerLabel;
2209 CreateBranch(BranchName, shwr_mipEng, BranchName + NShowerIndexStr +
"[3]/F");
2211 BranchName =
"shwr_hasPFParticle_" + ShowerLabel;
2212 CreateBranch(BranchName, shwr_hasPFParticle, BranchName + NShowerIndexStr +
"/S");
2214 BranchName =
"shwr_PFParticleID_" + ShowerLabel;
2215 CreateBranch(BranchName, shwr_PFParticleID, BranchName + NShowerIndexStr +
"/S");
2217 BranchName =
"shwr_pidmvamu_" + ShowerLabel;
2218 CreateBranch(BranchName, shwr_pidmvamu, BranchName + NShowerIndexStr +
"/F");
2220 BranchName =
"shwr_pidmvae_" + ShowerLabel;
2221 CreateBranch(BranchName, shwr_pidmvae, BranchName + NShowerIndexStr +
"/F");
2223 BranchName =
"shwr_pidmvapich_" + ShowerLabel;
2224 CreateBranch(BranchName, shwr_pidmvapich, BranchName + NShowerIndexStr +
"/F");
2226 BranchName =
"shwr_pidmvaphoton_" + ShowerLabel;
2227 CreateBranch(BranchName, shwr_pidmvaphoton, BranchName + NShowerIndexStr +
"/F");
2229 BranchName =
"shwr_pidmvapr_" + ShowerLabel;
2230 CreateBranch(BranchName, shwr_pidmvapr, BranchName + NShowerIndexStr +
"/F");
2251 triggertime = -99999;
2252 beamgatetime = -99999;
2261 std::fill(hit_tpc, hit_tpc +
sizeof(hit_tpc)/
sizeof(hit_tpc[0]), -9999);
2262 std::fill(hit_plane, hit_plane +
sizeof(hit_plane)/
sizeof(hit_plane[0]), -9999);
2263 std::fill(hit_wire, hit_wire +
sizeof(hit_wire)/
sizeof(hit_wire[0]), -9999);
2264 std::fill(hit_channel, hit_channel +
sizeof(hit_channel)/
sizeof(hit_channel[0]), -9999);
2265 std::fill(hit_peakT, hit_peakT +
sizeof(hit_peakT)/
sizeof(hit_peakT[0]), -99999.);
2266 std::fill(hit_charge, hit_charge +
sizeof(hit_charge)/
sizeof(hit_charge[0]), -99999.);
2267 std::fill(hit_ph, hit_ph +
sizeof(hit_ph)/
sizeof(hit_ph[0]), -99999.);
2268 std::fill(hit_startT, hit_startT +
sizeof(hit_startT)/
sizeof(hit_startT[0]), -99999.);
2269 std::fill(hit_endT, hit_endT +
sizeof(hit_endT)/
sizeof(hit_endT[0]), -99999.);
2270 std::fill(hit_rms, hit_rms +
sizeof(hit_rms)/
sizeof(hit_rms[0]), -99999.);
2271 std::fill(hit_trueX, hit_trueX +
sizeof(hit_trueX)/
sizeof(hit_trueX[0]), -99999.);
2272 std::fill(hit_goodnessOfFit, hit_goodnessOfFit +
sizeof(hit_goodnessOfFit)/
sizeof(hit_goodnessOfFit[0]), -99999.);
2273 std::fill(hit_multiplicity, hit_multiplicity +
sizeof(hit_multiplicity)/
sizeof(hit_multiplicity[0]), -99999.);
2274 std::fill(hit_trkid, hit_trkid +
sizeof(hit_trkid)/
sizeof(hit_trkid[0]), -9999);
2275 std::fill(hit_trkKey, hit_trkKey +
sizeof(hit_trkKey)/
sizeof(hit_trkKey[0]), -9999);
2276 std::fill(hit_clusterid, hit_clusterid +
sizeof(hit_clusterid)/
sizeof(hit_clusterid[0]), -99999);
2277 std::fill(hit_clusterKey, hit_clusterKey +
sizeof(hit_clusterKey)/
sizeof(hit_clusterKey[0]), -9999);
2278 std::fill(hit_spacepointid, hit_spacepointid +
sizeof(hit_spacepointid)/
sizeof(hit_spacepointid[0]), -99999);
2279 std::fill(hit_spacepointKey, hit_spacepointKey +
sizeof(hit_spacepointKey)/
sizeof(hit_spacepointKey[0]), -9999);
2280 std::fill(hit_nelec, hit_nelec +
sizeof(hit_nelec)/
sizeof(hit_nelec[0]), -99999.);
2281 std::fill(hit_energy, hit_energy +
sizeof(hit_energy)/
sizeof(hit_energy[0]), -99999.);
2283 std::fill(rawD_ph, rawD_ph +
sizeof(rawD_ph)/
sizeof(rawD_ph[0]), -99999.);
2284 std::fill(rawD_peakT, rawD_peakT +
sizeof(rawD_peakT)/
sizeof(rawD_peakT[0]), -99999.);
2285 std::fill(rawD_charge, rawD_charge +
sizeof(rawD_charge)/
sizeof(rawD_charge[0]), -99999.);
2286 std::fill(rawD_fwhh, rawD_fwhh +
sizeof(rawD_fwhh)/
sizeof(rawD_fwhh[0]), -99999.);
2287 std::fill(rawD_rms, rawD_rms +
sizeof(rawD_rms)/
sizeof(rawD_rms[0]), -99999.);
2290 std::fill(flash_time, flash_time +
sizeof(flash_time)/
sizeof(flash_time[0]), -9999);
2291 std::fill(flash_pe, flash_pe +
sizeof(flash_pe)/
sizeof(flash_pe[0]), -9999);
2292 std::fill(flash_ycenter, flash_ycenter +
sizeof(flash_ycenter)/
sizeof(flash_ycenter[0]), -9999);
2293 std::fill(flash_zcenter, flash_zcenter +
sizeof(flash_zcenter)/
sizeof(flash_zcenter[0]), -9999);
2294 std::fill(flash_ywidth, flash_ywidth +
sizeof(flash_ywidth)/
sizeof(flash_ywidth[0]), -9999);
2295 std::fill(flash_zwidth, flash_zwidth +
sizeof(flash_zwidth)/
sizeof(flash_zwidth[0]), -9999);
2296 std::fill(flash_timewidth, flash_timewidth +
sizeof(flash_timewidth)/
sizeof(flash_timewidth[0]), -9999);
2298 no_ExternCounts = 0;
2299 std::fill(externcounts_time, externcounts_time +
sizeof(externcounts_time)/
sizeof(externcounts_time[0]), -9999);
2300 std::fill(externcounts_id, externcounts_id +
sizeof(externcounts_id)/
sizeof(externcounts_id[0]), -9999);
2303 std::fill(clusterId, clusterId +
sizeof(clusterId)/
sizeof(clusterId[0]), -9999);
2304 std::fill(clusterView, clusterView +
sizeof(clusterView)/
sizeof(clusterView[0]), -9999);
2305 std::fill(cluster_isValid, cluster_isValid +
sizeof(cluster_isValid)/
sizeof(cluster_isValid[0]), -1);
2306 std::fill(cluster_StartCharge, cluster_StartCharge +
sizeof(cluster_StartCharge)/
sizeof(cluster_StartCharge[0]), -99999.);
2307 std::fill(cluster_StartAngle, cluster_StartAngle +
sizeof(cluster_StartAngle)/
sizeof(cluster_StartAngle[0]), -99999.);
2308 std::fill(cluster_EndCharge, cluster_EndCharge +
sizeof(cluster_EndCharge)/
sizeof(cluster_EndCharge[0]), -99999.);
2309 std::fill(cluster_EndAngle , cluster_EndAngle +
sizeof(cluster_EndAngle)/
sizeof(cluster_EndAngle[0]), -99999.);
2310 std::fill(cluster_Integral , cluster_Integral +
sizeof(cluster_Integral)/
sizeof(cluster_Integral[0]), -99999.);
2311 std::fill(cluster_IntegralAverage, cluster_IntegralAverage +
sizeof(cluster_IntegralAverage)/
sizeof(cluster_IntegralAverage[0]), -99999.);
2312 std::fill(cluster_SummedADC, cluster_SummedADC +
sizeof(cluster_SummedADC)/
sizeof(cluster_SummedADC[0]), -99999.);
2313 std::fill(cluster_SummedADCaverage, cluster_SummedADCaverage +
sizeof(cluster_SummedADCaverage)/
sizeof(cluster_SummedADCaverage[0]), -99999.);
2314 std::fill(cluster_MultipleHitDensity, cluster_MultipleHitDensity +
sizeof(cluster_MultipleHitDensity)/
sizeof(cluster_MultipleHitDensity[0]), -99999.);
2315 std::fill(cluster_Width, cluster_Width +
sizeof(cluster_Width)/
sizeof(cluster_Width[0]), -99999.);
2316 std::fill(cluster_NHits, cluster_NHits +
sizeof(cluster_NHits)/
sizeof(cluster_NHits[0]), -9999);
2317 std::fill(cluster_StartWire, cluster_StartWire +
sizeof(cluster_StartWire)/
sizeof(cluster_StartWire[0]), -9999);
2318 std::fill(cluster_StartTick, cluster_StartTick +
sizeof(cluster_StartTick)/
sizeof(cluster_StartTick[0]), -9999);
2319 std::fill(cluster_EndWire, cluster_EndWire +
sizeof(cluster_EndWire)/
sizeof(cluster_EndWire[0]), -9999);
2320 std::fill(cluster_EndTick, cluster_EndTick +
sizeof(cluster_EndTick)/
sizeof(cluster_EndTick[0]), -9999);
2321 std::fill(cluncosmictags_tagger, cluncosmictags_tagger +
sizeof(cluncosmictags_tagger)/
sizeof(cluncosmictags_tagger[0]), -9999);
2322 std::fill(clucosmicscore_tagger, clucosmicscore_tagger +
sizeof(clucosmicscore_tagger)/
sizeof(clucosmicscore_tagger[0]), -99999.);
2323 std::fill(clucosmictype_tagger , clucosmictype_tagger +
sizeof(clucosmictype_tagger )/
sizeof(clucosmictype_tagger [0]), -9999);
2327 FillWith(SpacePointX, -99999.);
2328 FillWith(SpacePointY, -99999.);
2329 FillWith(SpacePointZ, -99999.);
2330 FillWith(SpacePointQ, -99999.);
2331 FillWith(SpacePointErrX, -99999.);
2332 FillWith(SpacePointErrY, -99999.);
2333 FillWith(SpacePointErrZ, -99999.);
2334 FillWith(SpacePointID, -99999);
2335 FillWith(SpacePointChisq, -99999.);
2338 FillWith(SpacePointEmScore, -99999.);
2341 std::fill(nuvtxx, nuvtxx +
sizeof(nuvtxx)/
sizeof(nuvtxx[0]), -99999.);
2342 std::fill(nuvtxy, nuvtxy +
sizeof(nuvtxy)/
sizeof(nuvtxy[0]), -99999.);
2343 std::fill(nuvtxz, nuvtxz +
sizeof(nuvtxz)/
sizeof(nuvtxz[0]), -99999.);
2344 std::fill(nuvtxpdg, nuvtxpdg +
sizeof(nuvtxpdg)/
sizeof(nuvtxpdg[0]), -99999);
2346 mcevts_truth = -99999;
2347 mcevts_truthcry = -99999;
2348 std::fill(nuPDG_truth, nuPDG_truth +
sizeof(nuPDG_truth)/
sizeof(nuPDG_truth[0]), -99999.);
2349 std::fill(ccnc_truth, ccnc_truth +
sizeof(ccnc_truth)/
sizeof(ccnc_truth[0]), -99999.);
2350 std::fill(mode_truth, mode_truth +
sizeof(mode_truth)/
sizeof(mode_truth[0]), -99999.);
2351 std::fill(enu_truth, enu_truth +
sizeof(enu_truth)/
sizeof(enu_truth[0]), -99999.);
2352 std::fill(Q2_truth, Q2_truth +
sizeof(Q2_truth)/
sizeof(Q2_truth[0]), -99999.);
2353 std::fill(W_truth, W_truth +
sizeof(W_truth)/
sizeof(W_truth[0]), -99999.);
2354 std::fill(X_truth, X_truth +
sizeof(X_truth)/
sizeof(X_truth[0]), -99999.);
2355 std::fill(Y_truth, Y_truth +
sizeof(Y_truth)/
sizeof(Y_truth[0]), -99999.);
2356 std::fill(hitnuc_truth, hitnuc_truth +
sizeof(hitnuc_truth)/
sizeof(hitnuc_truth[0]), -99999.);
2357 std::fill(nuvtxx_truth, nuvtxx_truth +
sizeof(nuvtxx_truth)/
sizeof(nuvtxx_truth[0]), -99999.);
2358 std::fill(nuvtxy_truth, nuvtxy_truth +
sizeof(nuvtxy_truth)/
sizeof(nuvtxy_truth[0]), -99999.);
2359 std::fill(nuvtxz_truth, nuvtxz_truth +
sizeof(nuvtxz_truth)/
sizeof(nuvtxz_truth[0]), -99999.);
2360 std::fill(nu_dcosx_truth, nu_dcosx_truth +
sizeof(nu_dcosx_truth)/
sizeof(nu_dcosx_truth[0]), -99999.);
2361 std::fill(nu_dcosy_truth, nu_dcosy_truth +
sizeof(nu_dcosy_truth)/
sizeof(nu_dcosy_truth[0]), -99999.);
2362 std::fill(nu_dcosz_truth, nu_dcosz_truth +
sizeof(nu_dcosz_truth)/
sizeof(nu_dcosz_truth[0]), -99999.);
2363 std::fill(lep_mom_truth, lep_mom_truth +
sizeof(lep_mom_truth)/
sizeof(lep_mom_truth[0]), -99999.);
2364 std::fill(lep_dcosx_truth, lep_dcosx_truth +
sizeof(lep_dcosx_truth)/
sizeof(lep_dcosx_truth[0]), -99999.);
2365 std::fill(lep_dcosy_truth, lep_dcosy_truth +
sizeof(lep_dcosy_truth)/
sizeof(lep_dcosy_truth[0]), -99999.);
2366 std::fill(lep_dcosz_truth, lep_dcosz_truth +
sizeof(lep_dcosz_truth)/
sizeof(lep_dcosz_truth[0]), -99999.);
2369 std::fill(vx_flux, vx_flux +
sizeof(vx_flux)/
sizeof(vx_flux[0]), -99999.);
2370 std::fill(vy_flux, vy_flux +
sizeof(vy_flux)/
sizeof(vy_flux[0]), -99999.);
2371 std::fill(vz_flux, vz_flux +
sizeof(vz_flux)/
sizeof(vz_flux[0]), -99999.);
2372 std::fill(pdpx_flux, pdpx_flux +
sizeof(pdpx_flux)/
sizeof(pdpx_flux[0]), -99999.);
2373 std::fill(pdpy_flux, pdpy_flux +
sizeof(pdpy_flux)/
sizeof(pdpy_flux[0]), -99999.);
2374 std::fill(pdpz_flux, pdpz_flux +
sizeof(pdpz_flux)/
sizeof(pdpz_flux[0]), -99999.);
2375 std::fill(ppdxdz_flux, ppdxdz_flux +
sizeof(ppdxdz_flux)/
sizeof(ppdxdz_flux[0]), -99999.);
2376 std::fill(ppdydz_flux, ppdydz_flux +
sizeof(ppdydz_flux)/
sizeof(ppdydz_flux[0]), -99999.);
2377 std::fill(pppz_flux, pppz_flux +
sizeof(pppz_flux)/
sizeof(pppz_flux[0]), -99999.);
2378 std::fill(ptype_flux, ptype_flux +
sizeof(ptype_flux)/
sizeof(ptype_flux[0]), -9999);
2379 std::fill(ppvx_flux, ppvx_flux +
sizeof(ppvx_flux)/
sizeof(ppvx_flux[0]), -99999.);
2380 std::fill(ppvy_flux, ppvy_flux +
sizeof(ppvy_flux)/
sizeof(ppvy_flux[0]), -99999.);
2381 std::fill(ppvz_flux, ppvz_flux +
sizeof(ppvz_flux)/
sizeof(ppvz_flux[0]), -99999.);
2382 std::fill(muparpx_flux, muparpx_flux +
sizeof(muparpx_flux)/
sizeof(muparpx_flux[0]), -99999.);
2383 std::fill(muparpy_flux, muparpy_flux +
sizeof(muparpy_flux)/
sizeof(muparpy_flux[0]), -99999.);
2384 std::fill(muparpz_flux, muparpz_flux +
sizeof(muparpz_flux)/
sizeof(muparpz_flux[0]), -99999.);
2385 std::fill(mupare_flux, mupare_flux +
sizeof(mupare_flux)/
sizeof(mupare_flux[0]), -99999.);
2386 std::fill(tgen_flux, tgen_flux +
sizeof(tgen_flux)/
sizeof(tgen_flux[0]), -9999);
2387 std::fill(tgptype_flux, tgptype_flux +
sizeof(tgptype_flux)/
sizeof(tgptype_flux[0]), -9999);
2388 std::fill(tgppx_flux, tgppx_flux +
sizeof(tgppx_flux)/
sizeof(tgppx_flux[0]), -99999.);
2389 std::fill(tgppy_flux, tgppy_flux +
sizeof(tgppy_flux)/
sizeof(tgppy_flux[0]), -99999.);
2390 std::fill(tgppz_flux, tgppz_flux +
sizeof(tgppz_flux)/
sizeof(tgppz_flux[0]), -99999.);
2391 std::fill(tprivx_flux, tprivx_flux +
sizeof(tprivx_flux)/
sizeof(tprivx_flux[0]), -99999.);
2392 std::fill(tprivy_flux, tprivy_flux +
sizeof(tprivy_flux)/
sizeof(tprivy_flux[0]), -99999.);
2393 std::fill(tprivz_flux, tprivz_flux +
sizeof(tprivz_flux)/
sizeof(tprivz_flux[0]), -99999.);
2394 std::fill(dk2gen_flux, dk2gen_flux +
sizeof(dk2gen_flux)/
sizeof(dk2gen_flux[0]), -99999.);
2395 std::fill(gen2vtx_flux, gen2vtx_flux +
sizeof(gen2vtx_flux)/
sizeof(gen2vtx_flux[0]), -99999.);
2396 std::fill(tpx_flux, tpx_flux +
sizeof(tpx_flux)/
sizeof(tpx_flux[0]), -99999.);
2397 std::fill(tpy_flux, tpy_flux +
sizeof(tpy_flux)/
sizeof(tpy_flux[0]), -99999.);
2398 std::fill(tpz_flux, tpz_flux +
sizeof(tpz_flux)/
sizeof(tpz_flux[0]), -99999.);
2399 std::fill(tptype_flux, tptype_flux +
sizeof(tptype_flux)/
sizeof(tptype_flux[0]), -99999.);
2401 genie_no_primaries = 0;
2402 cry_no_primaries = 0;
2403 proto_no_primaries = 0;
2406 geant_list_size_in_tpcAV = 0;
2410 FillWith(
pdg, -99999);
2411 FillWith(
status, -99999);
2412 FillWith(
Mass, -99999.);
2413 FillWith(Eng, -99999.);
2414 FillWith(EndE, -99999.);
2415 FillWith(Px, -99999.);
2416 FillWith(Py, -99999.);
2417 FillWith(Pz, -99999.);
2418 FillWith(
P, -99999.);
2419 FillWith(StartPointx, -99999.);
2420 FillWith(StartPointy, -99999.);
2421 FillWith(StartPointz, -99999.);
2422 FillWith(StartT, -99e7);
2423 FillWith(EndT, -99999.);
2424 FillWith(EndPointx, -99999.);
2425 FillWith(EndPointy, -99999.);
2426 FillWith(EndPointz, -99999.);
2427 FillWith(EndT, -99e7);
2428 FillWith(
theta, -99999.);
2429 FillWith(phi, -99999.);
2430 FillWith(theta_xz, -99999.);
2431 FillWith(theta_yz, -99999.);
2432 FillWith(pathlen, -99999.);
2433 FillWith(inTPCActive, -99999);
2434 FillWith(StartPointx_tpcAV, -99999.);
2435 FillWith(StartPointy_tpcAV, -99999.);
2436 FillWith(StartPointz_tpcAV, -99999.);
2437 FillWith(StartT_tpcAV, -99e7);
2438 FillWith(StartE_tpcAV, -99999.);
2439 FillWith(StartP_tpcAV, -99999.);
2440 FillWith(StartPx_tpcAV, -99999.);
2441 FillWith(StartPy_tpcAV, -99999.);
2442 FillWith(StartPz_tpcAV, -99999.);
2443 FillWith(EndPointx_tpcAV, -99999.);
2444 FillWith(EndPointy_tpcAV, -99999.);
2445 FillWith(EndPointz_tpcAV, -99999.);
2446 FillWith(EndT_tpcAV, -99e7);
2447 FillWith(EndE_tpcAV, -99999.);
2448 FillWith(EndP_tpcAV, -99999.);
2449 FillWith(EndPx_tpcAV, -99999.);
2450 FillWith(EndPy_tpcAV, -99999.);
2451 FillWith(EndPz_tpcAV, -99999.);
2452 FillWith(pathlen_drifted, -99999.);
2453 FillWith(inTPCDrifted, -99999);
2454 FillWith(StartPointx_drifted, -99999.);
2455 FillWith(StartPointy_drifted, -99999.);
2456 FillWith(StartPointz_drifted, -99999.);
2457 FillWith(StartT_drifted, -99e7);
2458 FillWith(StartE_drifted, -99999.);
2459 FillWith(StartP_drifted, -99999.);
2460 FillWith(StartPx_drifted, -99999.);
2461 FillWith(StartPy_drifted, -99999.);
2462 FillWith(StartPz_drifted, -99999.);
2463 FillWith(EndPointx_drifted, -99999.);
2464 FillWith(EndPointy_drifted, -99999.);
2465 FillWith(EndPointz_drifted, -99999.);
2466 FillWith(EndT_drifted, -99e7);
2467 FillWith(EndE_drifted, -99999.);
2468 FillWith(EndP_drifted, -99999.);
2469 FillWith(EndPx_drifted, -99999.);
2470 FillWith(EndPy_drifted, -99999.);
2471 FillWith(EndPz_drifted, -99999.);
2472 FillWith(NumberDaughters, -99999);
2473 FillWith(Mother, -99999);
2474 FillWith(TrackId, -99999);
2475 FillWith(process_primary, -99999);
2476 FillWith(processname,
"noname");
2477 FillWith(MergedId, -99999);
2478 FillWith(
origin, -99999);
2479 FillWith(MCTruthIndex, -99999);
2480 FillWith(genie_primaries_pdg, -99999);
2481 FillWith(genie_Eng, -99999.);
2482 FillWith(genie_Px, -99999.);
2483 FillWith(genie_Py, -99999.);
2484 FillWith(genie_Pz, -99999.);
2485 FillWith(genie_P, -99999.);
2486 FillWith(genie_status_code, -99999);
2487 FillWith(genie_mass, -99999.);
2488 FillWith(genie_trackID, -99999);
2489 FillWith(genie_ND, -99999);
2490 FillWith(genie_mother, -99999);
2491 FillWith(cry_primaries_pdg, -99999);
2492 FillWith(cry_Eng, -99999.);
2493 FillWith(cry_Px, -99999.);
2494 FillWith(cry_Py, -99999.);
2495 FillWith(cry_Pz, -99999.);
2496 FillWith(cry_P, -99999.);
2497 FillWith(cry_StartPointx, -99999.);
2498 FillWith(cry_StartPointy, -99999.);
2499 FillWith(cry_StartPointz, -99999.);
2500 FillWith(cry_StartPointt, -99999.);
2501 FillWith(cry_status_code, -99999);
2502 FillWith(cry_mass, -99999.);
2503 FillWith(cry_trackID, -99999);
2504 FillWith(cry_ND, -99999);
2505 FillWith(cry_mother, -99999);
2507 FillWith(proto_isGoodParticle,-99999);
2508 FillWith(proto_vx,-99999.);
2509 FillWith(proto_vy,-99999.);
2510 FillWith(proto_vz,-99999.);
2511 FillWith(proto_t,-99999.);
2512 FillWith(proto_px,-99999.);
2513 FillWith(proto_py,-99999.);
2514 FillWith(proto_pz,-99999.);
2515 FillWith(proto_momentum,-99999.);
2516 FillWith(proto_energy,-99999.);
2517 FillWith(proto_pdg,-99999);
2518 FillWith(proto_geantTrackID,-99999);
2519 FillWith(proto_geantIndex,-99999);
2521 FillWith(mcshwr_origin, -1);
2522 FillWith(mcshwr_pdg, -99999);
2523 FillWith(mcshwr_TrackId, -99999);
2524 FillWith(mcshwr_Process,
"noname");
2525 FillWith(mcshwr_startX, -99999.);
2526 FillWith(mcshwr_startY, -99999.);
2527 FillWith(mcshwr_startZ, -99999.);
2528 FillWith(mcshwr_endX, -99999.);
2529 FillWith(mcshwr_endY, -99999.);
2530 FillWith(mcshwr_endZ, -99999.);
2531 FillWith(mcshwr_CombEngX, -99999.);
2532 FillWith(mcshwr_CombEngY, -99999.);
2533 FillWith(mcshwr_CombEngZ, -99999.);
2534 FillWith(mcshwr_CombEngPx, -99999.);
2535 FillWith(mcshwr_CombEngPy, -99999.);
2536 FillWith(mcshwr_CombEngPz, -99999.);
2537 FillWith(mcshwr_CombEngE, -99999.);
2538 FillWith(mcshwr_dEdx, -99999.);
2539 FillWith(mcshwr_StartDirX, -99999.);
2540 FillWith(mcshwr_StartDirY, -99999.);
2541 FillWith(mcshwr_StartDirZ, -99999.);
2542 FillWith(mcshwr_isEngDeposited, -9999);
2543 FillWith(mcshwr_Motherpdg, -99999);
2544 FillWith(mcshwr_MotherTrkId, -99999);
2545 FillWith(mcshwr_MotherProcess,
"noname");
2546 FillWith(mcshwr_MotherstartX, -99999.);
2547 FillWith(mcshwr_MotherstartY, -99999.);
2548 FillWith(mcshwr_MotherstartZ, -99999.);
2549 FillWith(mcshwr_MotherendX, -99999.);
2550 FillWith(mcshwr_MotherendY, -99999.);
2551 FillWith(mcshwr_MotherendZ, -99999.);
2552 FillWith(mcshwr_Ancestorpdg, -99999);
2553 FillWith(mcshwr_AncestorTrkId, -99999);
2554 FillWith(mcshwr_AncestorProcess,
"noname");
2555 FillWith(mcshwr_AncestorstartX, -99999.);
2556 FillWith(mcshwr_AncestorstartY, -99999.);
2557 FillWith(mcshwr_AncestorstartZ, -99999.);
2558 FillWith(mcshwr_AncestorendX, -99999.);
2559 FillWith(mcshwr_AncestorendY, -99999.);
2560 FillWith(mcshwr_AncestorendZ, -99999.);
2563 FillWith(NAuxDets, 0);
2566 for (
auto& partInfo: AuxDetID) FillWith(partInfo, -9999);
2570 &entryX, &entryY, &entryZ, &entryT,
2571 &exitX , &exitY , &exitZ, &exitT, &exitPx, &exitPy, &exitPz,
2576 for (
auto& partInfo: *cont) FillWith(partInfo, -99999.);
2585 (TrackData.begin(), TrackData.end(), std::mem_fn(&TrackDataStruct::Clear));
2587 (VertexData.begin(), VertexData.end(), std::mem_fn(&VertexDataStruct::Clear));
2589 (ShowerData.begin(), ShowerData.end(), std::mem_fn(&ShowerDataStruct::Clear));
2594 (std::vector<std::string>
const& ShowerAlgos)
2597 size_t const nShowerAlgos = ShowerAlgos.size();
2598 ShowerData.resize(nShowerAlgos);
2599 for (
size_t iAlgo = 0; iAlgo < nShowerAlgos; ++iAlgo)
2600 ShowerData[iAlgo].SetName(ShowerAlgos[iAlgo]);
2608 MaxGEANTparticles = (size_t)
std::max(nParticles, 1);
2610 pdg.resize(MaxGEANTparticles);
2611 status.resize(MaxGEANTparticles);
2612 Mass.resize(MaxGEANTparticles);
2613 Eng.resize(MaxGEANTparticles);
2614 EndE.resize(MaxGEANTparticles);
2615 Px.resize(MaxGEANTparticles);
2616 Py.resize(MaxGEANTparticles);
2617 Pz.resize(MaxGEANTparticles);
2618 P.resize(MaxGEANTparticles);
2619 StartPointx.resize(MaxGEANTparticles);
2620 StartPointy.resize(MaxGEANTparticles);
2621 StartPointz.resize(MaxGEANTparticles);
2622 StartT.resize(MaxGEANTparticles);
2623 EndT.resize(MaxGEANTparticles);
2624 EndPointx.resize(MaxGEANTparticles);
2625 EndPointy.resize(MaxGEANTparticles);
2626 EndPointz.resize(MaxGEANTparticles);
2627 EndT.resize(MaxGEANTparticles);
2628 theta.resize(MaxGEANTparticles);
2629 phi.resize(MaxGEANTparticles);
2630 theta_xz.resize(MaxGEANTparticles);
2631 theta_yz.resize(MaxGEANTparticles);
2632 pathlen.resize(MaxGEANTparticles);
2633 inTPCActive.resize(MaxGEANTparticles);
2634 StartPointx_tpcAV.resize(MaxGEANTparticles);
2635 StartPointy_tpcAV.resize(MaxGEANTparticles);
2636 StartPointz_tpcAV.resize(MaxGEANTparticles);
2637 StartT_tpcAV.resize(MaxGEANTparticles);
2638 StartE_tpcAV.resize(MaxGEANTparticles);
2639 StartP_tpcAV.resize(MaxGEANTparticles);
2640 StartPx_tpcAV.resize(MaxGEANTparticles);
2641 StartPy_tpcAV.resize(MaxGEANTparticles);
2642 StartPz_tpcAV.resize(MaxGEANTparticles);
2643 EndPointx_tpcAV.resize(MaxGEANTparticles);
2644 EndPointy_tpcAV.resize(MaxGEANTparticles);
2645 EndPointz_tpcAV.resize(MaxGEANTparticles);
2646 EndT_tpcAV.resize(MaxGEANTparticles);
2647 EndE_tpcAV.resize(MaxGEANTparticles);
2648 EndP_tpcAV.resize(MaxGEANTparticles);
2649 EndPx_tpcAV.resize(MaxGEANTparticles);
2650 EndPy_tpcAV.resize(MaxGEANTparticles);
2651 EndPz_tpcAV.resize(MaxGEANTparticles);
2652 pathlen_drifted.resize(MaxGEANTparticles);
2653 inTPCDrifted.resize(MaxGEANTparticles);
2654 StartPointx_drifted.resize(MaxGEANTparticles);
2655 StartPointy_drifted.resize(MaxGEANTparticles);
2656 StartPointz_drifted.resize(MaxGEANTparticles);
2657 StartT_drifted.resize(MaxGEANTparticles);
2658 StartE_drifted.resize(MaxGEANTparticles);
2659 StartP_drifted.resize(MaxGEANTparticles);
2660 StartPx_drifted.resize(MaxGEANTparticles);
2661 StartPy_drifted.resize(MaxGEANTparticles);
2662 StartPz_drifted.resize(MaxGEANTparticles);
2663 EndPointx_drifted.resize(MaxGEANTparticles);
2664 EndPointy_drifted.resize(MaxGEANTparticles);
2665 EndPointz_drifted.resize(MaxGEANTparticles);
2666 EndT_drifted.resize(MaxGEANTparticles);
2667 EndE_drifted.resize(MaxGEANTparticles);
2668 EndP_drifted.resize(MaxGEANTparticles);
2669 EndPx_drifted.resize(MaxGEANTparticles);
2670 EndPy_drifted.resize(MaxGEANTparticles);
2671 EndPz_drifted.resize(MaxGEANTparticles);
2672 NumberDaughters.resize(MaxGEANTparticles);
2673 Mother.resize(MaxGEANTparticles);
2674 TrackId.resize(MaxGEANTparticles);
2675 process_primary.resize(MaxGEANTparticles);
2676 processname.resize(MaxGEANTparticles);
2677 MergedId.resize(MaxGEANTparticles);
2678 origin.resize(MaxGEANTparticles);
2679 MCTruthIndex.resize(MaxGEANTparticles);
2682 NAuxDets.resize(MaxGEANTparticles);
2683 AuxDetID.resize(MaxGEANTparticles);
2684 entryX.resize(MaxGEANTparticles);
2685 entryY.resize(MaxGEANTparticles);
2686 entryZ.resize(MaxGEANTparticles);
2687 entryT.resize(MaxGEANTparticles);
2688 exitX.resize(MaxGEANTparticles);
2689 exitY.resize(MaxGEANTparticles);
2690 exitZ.resize(MaxGEANTparticles);
2691 exitT.resize(MaxGEANTparticles);
2692 exitPx.resize(MaxGEANTparticles);
2693 exitPy.resize(MaxGEANTparticles);
2694 exitPz.resize(MaxGEANTparticles);
2695 CombinedEnergyDep.resize(MaxGEANTparticles);
2702 MaxGeniePrimaries = (size_t)
std::max(nPrimaries, 1);
2703 genie_primaries_pdg.resize(MaxGeniePrimaries);
2704 genie_Eng.resize(MaxGeniePrimaries);
2705 genie_Px.resize(MaxGeniePrimaries);
2706 genie_Py.resize(MaxGeniePrimaries);
2707 genie_Pz.resize(MaxGeniePrimaries);
2708 genie_P.resize(MaxGeniePrimaries);
2709 genie_status_code.resize(MaxGeniePrimaries);
2710 genie_mass.resize(MaxGeniePrimaries);
2711 genie_trackID.resize(MaxGeniePrimaries);
2712 genie_ND.resize(MaxGeniePrimaries);
2713 genie_mother.resize(MaxGeniePrimaries);
2718 cry_primaries_pdg.resize(nPrimaries);
2719 cry_Eng.resize(nPrimaries);
2720 cry_Px.resize(nPrimaries);
2721 cry_Py.resize(nPrimaries);
2722 cry_Pz.resize(nPrimaries);
2723 cry_P.resize(nPrimaries);
2724 cry_StartPointx.resize(nPrimaries);
2725 cry_StartPointy.resize(nPrimaries);
2726 cry_StartPointz.resize(nPrimaries);
2727 cry_StartPointt.resize(nPrimaries);
2728 cry_status_code.resize(nPrimaries);
2729 cry_mass.resize(nPrimaries);
2730 cry_trackID.resize(nPrimaries);
2731 cry_ND.resize(nPrimaries);
2732 cry_mother.resize(nPrimaries);
2738 proto_isGoodParticle.resize(nPrimaries);
2739 proto_vx.resize(nPrimaries);
2740 proto_vy.resize(nPrimaries);
2741 proto_vz.resize(nPrimaries);
2742 proto_t.resize(nPrimaries);
2743 proto_px.resize(nPrimaries);
2744 proto_py.resize(nPrimaries);
2745 proto_pz.resize(nPrimaries);
2746 proto_momentum.resize(nPrimaries);
2747 proto_energy.resize(nPrimaries);
2748 proto_pdg.resize(nPrimaries);
2749 proto_geantTrackID.resize(nPrimaries);
2750 proto_geantIndex.resize(nPrimaries);
2755 mcshwr_origin.resize(nMCShowers);
2756 mcshwr_pdg.resize(nMCShowers);
2757 mcshwr_TrackId.resize(nMCShowers);
2758 mcshwr_Process.resize(nMCShowers);
2759 mcshwr_startX.resize(nMCShowers);
2760 mcshwr_startY.resize(nMCShowers);
2761 mcshwr_startZ.resize(nMCShowers);
2762 mcshwr_endX.resize(nMCShowers);
2763 mcshwr_endY.resize(nMCShowers);
2764 mcshwr_endZ.resize(nMCShowers);
2765 mcshwr_CombEngX.resize(nMCShowers);
2766 mcshwr_CombEngY.resize(nMCShowers);
2767 mcshwr_CombEngZ.resize(nMCShowers);
2768 mcshwr_CombEngPx.resize(nMCShowers);
2769 mcshwr_CombEngPy.resize(nMCShowers);
2770 mcshwr_CombEngPz.resize(nMCShowers);
2771 mcshwr_CombEngE.resize(nMCShowers);
2772 mcshwr_dEdx.resize(nMCShowers);
2773 mcshwr_StartDirX.resize(nMCShowers);
2774 mcshwr_StartDirY.resize(nMCShowers);
2775 mcshwr_StartDirZ.resize(nMCShowers);
2776 mcshwr_isEngDeposited.resize(nMCShowers);
2777 mcshwr_Motherpdg.resize(nMCShowers);
2778 mcshwr_MotherTrkId.resize(nMCShowers);
2779 mcshwr_MotherProcess.resize(nMCShowers);
2780 mcshwr_MotherstartX.resize(nMCShowers);
2781 mcshwr_MotherstartY.resize(nMCShowers);
2782 mcshwr_MotherstartZ.resize(nMCShowers);
2783 mcshwr_MotherendX.resize(nMCShowers);
2784 mcshwr_MotherendY.resize(nMCShowers);
2785 mcshwr_MotherendZ.resize(nMCShowers);
2786 mcshwr_Ancestorpdg.resize(nMCShowers);
2787 mcshwr_AncestorTrkId.resize(nMCShowers);
2788 mcshwr_AncestorProcess.resize(nMCShowers);
2789 mcshwr_AncestorstartX.resize(nMCShowers);
2790 mcshwr_AncestorstartY.resize(nMCShowers);
2791 mcshwr_AncestorstartZ.resize(nMCShowers);
2792 mcshwr_AncestorendX.resize(nMCShowers);
2793 mcshwr_AncestorendY.resize(nMCShowers);
2794 mcshwr_AncestorendZ.resize(nMCShowers);
2799 mctrk_origin.resize(nMCTracks);
2800 mctrk_pdg.resize(nMCTracks);
2801 mctrk_TrackId.resize(nMCTracks);
2802 mctrk_Process.resize(nMCTracks);
2803 mctrk_startX.resize(nMCTracks);
2804 mctrk_startY.resize(nMCTracks);
2805 mctrk_startZ.resize(nMCTracks);
2806 mctrk_endX.resize(nMCTracks);
2807 mctrk_endY.resize(nMCTracks);
2808 mctrk_endZ.resize(nMCTracks);
2809 mctrk_startX_drifted.resize(nMCTracks);
2810 mctrk_startY_drifted.resize(nMCTracks);
2811 mctrk_startZ_drifted.resize(nMCTracks);
2812 mctrk_endX_drifted.resize(nMCTracks);
2813 mctrk_endY_drifted.resize(nMCTracks);
2814 mctrk_endZ_drifted.resize(nMCTracks);
2815 mctrk_len_drifted.resize(nMCTracks);
2816 mctrk_p_drifted.resize(nMCTracks);
2817 mctrk_px_drifted.resize(nMCTracks);
2818 mctrk_py_drifted.resize(nMCTracks);
2819 mctrk_pz_drifted.resize(nMCTracks);
2820 mctrk_Motherpdg.resize(nMCTracks);
2821 mctrk_MotherTrkId.resize(nMCTracks);
2822 mctrk_MotherProcess.resize(nMCTracks);
2823 mctrk_MotherstartX.resize(nMCTracks);
2824 mctrk_MotherstartY.resize(nMCTracks);
2825 mctrk_MotherstartZ.resize(nMCTracks);
2826 mctrk_MotherendX.resize(nMCTracks);
2827 mctrk_MotherendY.resize(nMCTracks);
2828 mctrk_MotherendZ.resize(nMCTracks);
2829 mctrk_Ancestorpdg.resize(nMCTracks);
2830 mctrk_AncestorTrkId.resize(nMCTracks);
2831 mctrk_AncestorProcess.resize(nMCTracks);
2832 mctrk_AncestorstartX.resize(nMCTracks);
2833 mctrk_AncestorstartY.resize(nMCTracks);
2834 mctrk_AncestorstartZ.resize(nMCTracks);
2835 mctrk_AncestorendX.resize(nMCTracks);
2836 mctrk_AncestorendY.resize(nMCTracks);
2837 mctrk_AncestorendZ.resize(nMCTracks);
2842 SpacePointX.resize(nSpacePoints);
2843 SpacePointY.resize(nSpacePoints);
2844 SpacePointZ.resize(nSpacePoints);
2845 SpacePointQ.resize(nSpacePoints);
2846 SpacePointErrX.resize(nSpacePoints);
2847 SpacePointErrY.resize(nSpacePoints);
2848 SpacePointErrZ.resize(nSpacePoints);
2849 SpacePointID.resize(nSpacePoints);
2850 SpacePointChisq.resize(nSpacePoints);
2852 SpacePointEmScore.resize(nSpacePoints);
2859 const std::vector<std::string>& trackers,
2860 const std::vector<std::string>& vertexalgos,
2861 const std::vector<std::string>& showeralgos,
2866 CreateBranch(
"run",&
run,
"run/I");
2867 CreateBranch(
"subrun",&subrun,
"subrun/I");
2868 CreateBranch(
"event",&
event,
"event/I");
2869 CreateBranch(
"evttime",&evttime,
"evttime/D");
2870 CreateBranch(
"beamtime",&beamtime,
"beamtime/D");
2871 CreateBranch(
"pot",&SubRunData.pot,
"pot/D");
2872 CreateBranch(
"isdata",&isdata,
"isdata/B");
2873 CreateBranch(
"taulife",&taulife,
"taulife/D");
2874 CreateBranch(
"triggernumber",&triggernumber,
"triggernumber/i");
2875 CreateBranch(
"triggertime",&triggertime,
"triggertime/D");
2876 CreateBranch(
"beamgatetime",&beamgatetime,
"beamgatetime/D");
2877 CreateBranch(
"triggerbits",&triggerbits,
"triggerbits/i");
2878 CreateBranch(
"potbnb",&potbnb,
"potbnb/D");
2879 CreateBranch(
"potnumitgt",&potnumitgt,
"potnumitgt/D");
2880 CreateBranch(
"potnumi101",&potnumi101,
"potnumi101/D");
2883 CreateBranch(
"no_hits",&no_hits,
"no_hits/I");
2884 CreateBranch(
"no_hits_stored",&no_hits_stored,
"no_hits_stored/I");
2885 CreateBranch(
"hit_tpc",hit_tpc,
"hit_tpc[no_hits_stored]/S");
2886 CreateBranch(
"hit_plane",hit_plane,
"hit_plane[no_hits_stored]/S");
2887 CreateBranch(
"hit_wire",hit_wire,
"hit_wire[no_hits_stored]/S");
2888 CreateBranch(
"hit_channel",hit_channel,
"hit_channel[no_hits_stored]/S");
2889 CreateBranch(
"hit_peakT",hit_peakT,
"hit_peakT[no_hits_stored]/F");
2890 CreateBranch(
"hit_charge",hit_charge,
"hit_charge[no_hits_stored]/F");
2891 CreateBranch(
"hit_ph",hit_ph,
"hit_ph[no_hits_stored]/F");
2892 CreateBranch(
"hit_startT",hit_startT,
"hit_startT[no_hits_stored]/F");
2893 CreateBranch(
"hit_endT",hit_endT,
"hit_endT[no_hits_stored]/F");
2894 CreateBranch(
"hit_rms",hit_rms,
"hit_rms[no_hits_stored]/F");
2895 CreateBranch(
"hit_trueX",hit_trueX,
"hit_trueX[no_hits_stored]/F");
2896 CreateBranch(
"hit_goodnessOfFit",hit_goodnessOfFit,
"hit_goodnessOfFit[no_hits_stored]/F");
2897 CreateBranch(
"hit_multiplicity",hit_multiplicity,
"hit_multiplicity[no_hits_stored]/S");
2898 CreateBranch(
"hit_trkid",hit_trkid,
"hit_trkid[no_hits_stored]/S");
2899 CreateBranch(
"hit_trkKey",hit_trkKey,
"hit_trkKey[no_hits_stored]/S");
2900 CreateBranch(
"hit_clusterid",hit_clusterid,
"hit_clusterid[no_hits_stored]/S");
2901 CreateBranch(
"hit_clusterKey",hit_clusterKey,
"hit_clusterKey[no_hits_stored]/S");
2902 CreateBranch(
"hit_spacepointid",hit_spacepointid,
"hit_spacepointid[no_hits_stored]/S");
2903 CreateBranch(
"hit_spacepointKey",hit_spacepointKey,
"hit_spacepointKey[no_hits_stored]/S");
2905 CreateBranch(
"hit_nelec",hit_nelec,
"hit_nelec[no_hits_stored]/F");
2906 CreateBranch(
"hit_energy",hit_energy,
"hit_energy[no_hits_stored]/F");
2908 if (hasRawDigitInfo()){
2909 CreateBranch(
"rawD_ph",rawD_ph,
"rawD_ph[no_hits_stored]/F");
2910 CreateBranch(
"rawD_peakT",rawD_peakT,
"rawD_peakT[no_hits_stored]/F");
2911 CreateBranch(
"rawD_charge",rawD_charge,
"rawD_charge[no_hits_stored]/F");
2912 CreateBranch(
"rawD_fwhh",rawD_fwhh,
"rawD_fwhh[no_hits_stored]/F");
2913 CreateBranch(
"rawD_rms",rawD_rms,
"rawD_rms[no_hits_stored]/D");
2917 if (hasPandoraNuVertexInfo()){
2918 CreateBranch(
"nnuvtx", &nnuvtx,
"nnuvtx/S");
2919 CreateBranch(
"nuvtxx", nuvtxx,
"nuvtxx[nnuvtx]/F");
2920 CreateBranch(
"nuvtxy", nuvtxy,
"nuvtxy[nnuvtx]/F");
2921 CreateBranch(
"nuvtxz", nuvtxz,
"nuvtxz[nnuvtx]/F");
2922 CreateBranch(
"nuvtxpdg", nuvtxpdg,
"nuvtxpdg[nnuvtx]/S");
2925 if (hasClusterInfo()){
2926 CreateBranch(
"nclusters",&nclusters,
"nclusters/S");
2927 CreateBranch(
"clusterId", clusterId,
"clusterId[nclusters]/S");
2928 CreateBranch(
"clusterView", clusterView,
"clusterView[nclusters]/S");
2929 CreateBranch(
"cluster_StartCharge", cluster_StartCharge,
"cluster_StartCharge[nclusters]/F");
2930 CreateBranch(
"cluster_StartAngle", cluster_StartAngle,
"cluster_StartAngle[nclusters]/F");
2931 CreateBranch(
"cluster_EndCharge", cluster_EndCharge,
"cluster_EndCharge[nclusters]/F");
2932 CreateBranch(
"cluster_EndAngle", cluster_EndAngle,
"cluster_EndAngle[nclusters]/F");
2933 CreateBranch(
"cluster_Integral", cluster_Integral,
"cluster_Integral[nclusters]/F");
2934 CreateBranch(
"cluster_IntegralAverage", cluster_IntegralAverage,
"cluster_IntegralAverage[nclusters]/F");
2935 CreateBranch(
"cluster_SummedADC", cluster_SummedADC,
"cluster_SummedADC[nclusters]/F");
2936 CreateBranch(
"cluster_SummedADCaverage", cluster_SummedADCaverage,
"cluster_SummedADCaverage[nclusters]/F");
2937 CreateBranch(
"cluster_MultipleHitDensity", cluster_MultipleHitDensity,
"cluster_MultipleHitDensity[nclusters]/F");
2938 CreateBranch(
"cluster_Width", cluster_Width,
"cluster_Width[nclusters]/F");
2939 CreateBranch(
"cluster_NHits", cluster_NHits,
"cluster_NHits[nclusters]/S");
2940 CreateBranch(
"cluster_StartWire", cluster_StartWire,
"cluster_StartWire[nclusters]/S");
2941 CreateBranch(
"cluster_StartTick", cluster_StartTick,
"cluster_StartTick[nclusters]/S");
2942 CreateBranch(
"cluster_EndWire", cluster_EndWire,
"cluster_EndWire[nclusters]/S");
2943 CreateBranch(
"cluster_EndTick", cluster_EndTick,
"cluster_EndTick[nclusters]/S");
2944 CreateBranch(
"cluncosmictags_tagger", cluncosmictags_tagger,
"cluncosmictags_tagger[nclusters]/S");
2945 CreateBranch(
"clucosmicscore_tagger", clucosmicscore_tagger,
"clucosmicscore_tagger[nclusters]/F");
2946 CreateBranch(
"clucosmictype_tagger", clucosmictype_tagger,
"clucosmictype_tagger[nclusters]/S");
2949 if (hasFlashInfo()){
2950 CreateBranch(
"no_flashes",&no_flashes,
"no_flashes/I");
2951 CreateBranch(
"flash_time",flash_time,
"flash_time[no_flashes]/F");
2952 CreateBranch(
"flash_pe",flash_pe,
"flash_pe[no_flashes]/F");
2953 CreateBranch(
"flash_ycenter",flash_ycenter,
"flash_ycenter[no_flashes]/F");
2954 CreateBranch(
"flash_zcenter",flash_zcenter,
"flash_zcenter[no_flashes]/F");
2955 CreateBranch(
"flash_ywidth",flash_ywidth,
"flash_ywidth[no_flashes]/F");
2956 CreateBranch(
"flash_zwidth",flash_zwidth,
"flash_zwidth[no_flashes]/F");
2957 CreateBranch(
"flash_timewidth",flash_timewidth,
"flash_timewidth[no_flashes]/F");
2960 if (hasExternCountInfo()){
2961 CreateBranch(
"no_ExternCounts",&no_ExternCounts,
"no_ExternCounts/I");
2962 CreateBranch(
"externcounts_time",externcounts_time,
"externcounts_time[no_ExternCounts]/F");
2963 CreateBranch(
"externcounts_id",externcounts_id,
"externcounts_id[no_ExternCounts]/F");
2966 if (hasTrackInfo()){
2967 kNTracker = trackers.size();
2968 CreateBranch(
"kNTracker",&kNTracker,
"kNTracker/B");
2969 for(
int i=0; i<kNTracker; i++){
2974 TrackData[i].SetAddresses(pTree, TrackLabel, isCosmics);
2978 if (hasVertexInfo()){
2979 kNVertexAlgos = vertexalgos.size();
2980 CreateBranch(
"kNVertexAlgos",&kNVertexAlgos,
"kNVertexAlgos/B");
2981 for(
int i=0; i<kNVertexAlgos; i++){
2986 VertexData[i].SetAddresses(pTree, VertexLabel, isCosmics);
2990 if (hasShowerInfo()){
2991 kNShowerAlgos = showeralgos.size();
2992 CreateBranch(
"kNShowerAlgos",&kNShowerAlgos,
"kNShowerAlgos/B");
2993 for(
int i=0; i<kNShowerAlgos; i++){
2996 ShowerData[i].SetAddresses(pTree);
3000 if (hasPFParticleInfo()){
3002 PFParticleData.SetAddresses(pTree);
3005 if (hasGenieInfo()){
3006 CreateBranch(
"mcevts_truth",&mcevts_truth,
"mcevts_truth/I");
3007 CreateBranch(
"nuPDG_truth",nuPDG_truth,
"nuPDG_truth[mcevts_truth]/I");
3008 CreateBranch(
"ccnc_truth",ccnc_truth,
"ccnc_truth[mcevts_truth]/I");
3009 CreateBranch(
"mode_truth",mode_truth,
"mode_truth[mcevts_truth]/I");
3010 CreateBranch(
"enu_truth",enu_truth,
"enu_truth[mcevts_truth]/F");
3011 CreateBranch(
"Q2_truth",Q2_truth,
"Q2_truth[mcevts_truth]/F");
3012 CreateBranch(
"W_truth",W_truth,
"W_truth[mcevts_truth]/F");
3013 CreateBranch(
"X_truth",X_truth,
"X_truth[mcevts_truth]/F");
3014 CreateBranch(
"Y_truth",Y_truth,
"Y_truth[mcevts_truth]/F");
3015 CreateBranch(
"hitnuc_truth",hitnuc_truth,
"hitnuc_truth[mcevts_truth]/I");
3016 CreateBranch(
"nuvtxx_truth",nuvtxx_truth,
"nuvtxx_truth[mcevts_truth]/F");
3017 CreateBranch(
"nuvtxy_truth",nuvtxy_truth,
"nuvtxy_truth[mcevts_truth]/F");
3018 CreateBranch(
"nuvtxz_truth",nuvtxz_truth,
"nuvtxz_truth[mcevts_truth]/F");
3019 CreateBranch(
"nu_dcosx_truth",nu_dcosx_truth,
"nu_dcosx_truth[mcevts_truth]/F");
3020 CreateBranch(
"nu_dcosy_truth",nu_dcosy_truth,
"nu_dcosy_truth[mcevts_truth]/F");
3021 CreateBranch(
"nu_dcosz_truth",nu_dcosz_truth,
"nu_dcosz_truth[mcevts_truth]/F");
3022 CreateBranch(
"lep_mom_truth",lep_mom_truth,
"lep_mom_truth[mcevts_truth]/F");
3023 CreateBranch(
"lep_dcosx_truth",lep_dcosx_truth,
"lep_dcosx_truth[mcevts_truth]/F");
3024 CreateBranch(
"lep_dcosy_truth",lep_dcosy_truth,
"lep_dcosy_truth[mcevts_truth]/F");
3025 CreateBranch(
"lep_dcosz_truth",lep_dcosz_truth,
"lep_dcosz_truth[mcevts_truth]/F");
3027 CreateBranch(
"vx_flux",vx_flux,
"vx_flux[mcevts_truth]/F");
3028 CreateBranch(
"vy_flux",vy_flux,
"vy_flux[mcevts_truth]/F");
3029 CreateBranch(
"vz_flux",vz_flux,
"vz_flux[mcevts_truth]/F");
3030 CreateBranch(
"pdpx_flux",pdpx_flux,
"pdpx_flux[mcevts_truth]/F");
3031 CreateBranch(
"pdpy_flux",pdpy_flux,
"pdpy_flux[mcevts_truth]/F");
3032 CreateBranch(
"pdpz_flux",pdpz_flux,
"pdpz_flux[mcevts_truth]/F");
3033 CreateBranch(
"ppdxdz_flux",ppdxdz_flux,
"ppdxdz_flux[mcevts_truth]/F");
3034 CreateBranch(
"ppdydz_flux",ppdydz_flux,
"ppdydz_flux[mcevts_truth]/F");
3035 CreateBranch(
"pppz_flux",pppz_flux,
"pppz_flux[mcevts_truth]/F");
3036 CreateBranch(
"ptype_flux",ptype_flux,
"ptype_flux[mcevts_truth]/I");
3037 CreateBranch(
"ppvx_flux",ppvx_flux,
"ppvx_flux[mcevts_truth]/F");
3038 CreateBranch(
"ppvy_flux",ppvy_flux,
"ppvy_flux[mcevts_truth]/F");
3039 CreateBranch(
"ppvz_flux",ppvz_flux,
"ppvz_flux[mcevts_truth]/F");
3040 CreateBranch(
"muparpx_flux",muparpx_flux,
"muparpx_flux[mcevts_truth]/F");
3041 CreateBranch(
"muparpy_flux",muparpy_flux,
"muparpy_flux[mcevts_truth]/F");
3042 CreateBranch(
"muparpz_flux",muparpz_flux,
"muparpz_flux[mcevts_truth]/F");
3043 CreateBranch(
"mupare_flux",mupare_flux,
"mupare_flux[mcevts_truth]/F");
3044 CreateBranch(
"tgen_flux",tgen_flux,
"tgen_flux[mcevts_truth]/I");
3045 CreateBranch(
"tgptype_flux",tgptype_flux,
"tgptype_flux[mcevts_truth]/I");
3046 CreateBranch(
"tgppx_flux",tgppx_flux,
"tgppx_flux[mcevts_truth]/F");
3047 CreateBranch(
"tgppy_flux",tgppy_flux,
"tgppy_flux[mcevts_truth]/F");
3048 CreateBranch(
"tgppz_flux",tgppz_flux,
"tgppz_flux[mcevts_truth]/F");
3049 CreateBranch(
"tprivx_flux",tprivx_flux,
"tprivx_flux[mcevts_truth]/F");
3050 CreateBranch(
"tprivy_flux",tprivy_flux,
"tprivy_flux[mcevts_truth]/F");
3051 CreateBranch(
"tprivz_flux",tprivz_flux,
"tprivz_flux[mcevts_truth]/F");
3052 CreateBranch(
"dk2gen_flux",dk2gen_flux,
"dk2gen_flux[mcevts_truth]/F");
3053 CreateBranch(
"gen2vtx_flux",gen2vtx_flux,
"gen2vtx_flux[mcevts_truth]/F");
3054 CreateBranch(
"tpx_flux",tpx_flux,
"tpx_flux[mcevts_truth]/F");
3055 CreateBranch(
"tpy_flux",tpy_flux,
"tpy_flux[mcevts_truth]/F");
3056 CreateBranch(
"tpz_flux",tpz_flux,
"tpz_flux[mcevts_truth]/F");
3057 CreateBranch(
"tptype_flux",tptype_flux,
"tptype_flux[mcevts_truth]/I");
3059 CreateBranch(
"genie_no_primaries",&genie_no_primaries,
"genie_no_primaries/I");
3060 CreateBranch(
"genie_primaries_pdg",genie_primaries_pdg,
"genie_primaries_pdg[genie_no_primaries]/I");
3061 CreateBranch(
"genie_Eng",genie_Eng,
"genie_Eng[genie_no_primaries]/F");
3062 CreateBranch(
"genie_Px",genie_Px,
"genie_Px[genie_no_primaries]/F");
3063 CreateBranch(
"genie_Py",genie_Py,
"genie_Py[genie_no_primaries]/F");
3064 CreateBranch(
"genie_Pz",genie_Pz,
"genie_Pz[genie_no_primaries]/F");
3065 CreateBranch(
"genie_P",genie_P,
"genie_P[genie_no_primaries]/F");
3066 CreateBranch(
"genie_status_code",genie_status_code,
"genie_status_code[genie_no_primaries]/I");
3067 CreateBranch(
"genie_mass",genie_mass,
"genie_mass[genie_no_primaries]/F");
3068 CreateBranch(
"genie_trackID",genie_trackID,
"genie_trackID[genie_no_primaries]/I");
3069 CreateBranch(
"genie_ND",genie_ND,
"genie_ND[genie_no_primaries]/I");
3070 CreateBranch(
"genie_mother",genie_mother,
"genie_mother[genie_no_primaries]/I");
3074 CreateBranch(
"mcevts_truthcry",&mcevts_truthcry,
"mcevts_truthcry/I");
3075 CreateBranch(
"cry_no_primaries",&cry_no_primaries,
"cry_no_primaries/I");
3076 CreateBranch(
"cry_primaries_pdg",cry_primaries_pdg,
"cry_primaries_pdg[cry_no_primaries]/I");
3077 CreateBranch(
"cry_Eng",cry_Eng,
"cry_Eng[cry_no_primaries]/F");
3078 CreateBranch(
"cry_Px",cry_Px,
"cry_Px[cry_no_primaries]/F");
3079 CreateBranch(
"cry_Py",cry_Py,
"cry_Py[cry_no_primaries]/F");
3080 CreateBranch(
"cry_Pz",cry_Pz,
"cry_Pz[cry_no_primaries]/F");
3081 CreateBranch(
"cry_P",cry_P,
"cry_P[cry_no_primaries]/F");
3082 CreateBranch(
"cry_StartPointx",cry_StartPointx,
"cry_StartPointx[cry_no_primaries]/F");
3083 CreateBranch(
"cry_StartPointy",cry_StartPointy,
"cry_StartPointy[cry_no_primaries]/F");
3084 CreateBranch(
"cry_StartPointz",cry_StartPointz,
"cry_StartPointz[cry_no_primaries]/F");
3085 CreateBranch(
"cry_StartPointt",cry_StartPointt,
"cry_StartPointt[cry_no_primaries]/F");
3086 CreateBranch(
"cry_status_code",cry_status_code,
"cry_status_code[cry_no_primaries]/I");
3087 CreateBranch(
"cry_mass",cry_mass,
"cry_mass[cry_no_primaries]/F");
3088 CreateBranch(
"cry_trackID",cry_trackID,
"cry_trackID[cry_no_primaries]/I");
3089 CreateBranch(
"cry_ND",cry_ND,
"cry_ND[cry_no_primaries]/I");
3090 CreateBranch(
"cry_mother",cry_mother,
"cry_mother[cry_no_primaries]/I");
3093 if (hasProtoInfo()) {
3094 CreateBranch(
"proto_no_primaries",&proto_no_primaries,
"proto_no_primaries/I");
3095 CreateBranch(
"proto_isGoodParticle",proto_isGoodParticle,
"proto_isGoodParticle[proto_no_primaries]/I");
3096 CreateBranch(
"proto_vx",proto_vx,
"proto_vx[proto_no_primaries]/F");
3097 CreateBranch(
"proto_vy",proto_vy,
"proto_vy[proto_no_primaries]/F");
3098 CreateBranch(
"proto_vz",proto_vz,
"proto_vz[proto_no_primaries]/F");
3099 CreateBranch(
"proto_t",proto_t,
"proto_t[proto_no_primaries]/F");
3100 CreateBranch(
"proto_px",proto_px,
"proto_px[proto_no_primaries]/F");
3101 CreateBranch(
"proto_py",proto_py,
"proto_py[proto_no_primaries]/F");
3102 CreateBranch(
"proto_pz",proto_pz,
"proto_pz[proto_no_primaries]/F");
3103 CreateBranch(
"proto_momentum",proto_momentum,
"proto_momentum[proto_no_primaries]/F");
3104 CreateBranch(
"proto_energy",proto_energy,
"proto_energy[proto_no_primaries]/F");
3105 CreateBranch(
"proto_pdg",proto_pdg,
"proto_pdg[proto_no_primaries]/I");
3106 CreateBranch(
"proto_geantTrackID",proto_geantTrackID,
"proto_geantTrackID[proto_no_primaries]/I");
3107 CreateBranch(
"proto_geantIndex",proto_geantIndex,
"proto_geantIndex[proto_no_primaries]/I");
3110 if (hasGeantInfo()){
3111 CreateBranch(
"no_primaries",&no_primaries,
"no_primaries/I");
3112 CreateBranch(
"geant_list_size",&geant_list_size,
"geant_list_size/I");
3113 CreateBranch(
"geant_list_size_in_tpcAV",&geant_list_size_in_tpcAV,
"geant_list_size_in_tpcAV/I");
3114 CreateBranch(
"pdg",
pdg,
"pdg[geant_list_size]/I");
3115 CreateBranch(
"status",
status,
"status[geant_list_size]/I");
3116 CreateBranch(
"Mass",
Mass,
"Mass[geant_list_size]/F");
3117 CreateBranch(
"Eng",Eng,
"Eng[geant_list_size]/F");
3118 CreateBranch(
"EndE",EndE,
"EndE[geant_list_size]/F");
3119 CreateBranch(
"Px",Px,
"Px[geant_list_size]/F");
3120 CreateBranch(
"Py",Py,
"Py[geant_list_size]/F");
3121 CreateBranch(
"Pz",Pz,
"Pz[geant_list_size]/F");
3122 CreateBranch(
"P",
P,
"P[geant_list_size]/F");
3123 CreateBranch(
"StartPointx",StartPointx,
"StartPointx[geant_list_size]/F");
3124 CreateBranch(
"StartPointy",StartPointy,
"StartPointy[geant_list_size]/F");
3125 CreateBranch(
"StartPointz",StartPointz,
"StartPointz[geant_list_size]/F");
3126 CreateBranch(
"StartT",StartT,
"StartT[geant_list_size]/F");
3127 CreateBranch(
"EndPointx",EndPointx,
"EndPointx[geant_list_size]/F");
3128 CreateBranch(
"EndPointy",EndPointy,
"EndPointy[geant_list_size]/F");
3129 CreateBranch(
"EndPointz",EndPointz,
"EndPointz[geant_list_size]/F");
3130 CreateBranch(
"EndT",EndT,
"EndT[geant_list_size]/F");
3131 CreateBranch(
"theta",
theta,
"theta[geant_list_size]/F");
3132 CreateBranch(
"phi",phi,
"phi[geant_list_size]/F");
3133 CreateBranch(
"theta_xz",theta_xz,
"theta_xz[geant_list_size]/F");
3134 CreateBranch(
"theta_yz",theta_yz,
"theta_yz[geant_list_size]/F");
3135 CreateBranch(
"pathlen",pathlen,
"pathlen[geant_list_size]/F");
3136 CreateBranch(
"inTPCActive",inTPCActive,
"inTPCActive[geant_list_size]/I");
3137 CreateBranch(
"StartPointx_tpcAV",StartPointx_tpcAV,
"StartPointx_tpcAV[geant_list_size]/F");
3138 CreateBranch(
"StartPointy_tpcAV",StartPointy_tpcAV,
"StartPointy_tpcAV[geant_list_size]/F");
3139 CreateBranch(
"StartPointz_tpcAV",StartPointz_tpcAV,
"StartPointz_tpcAV[geant_list_size]/F");
3140 CreateBranch(
"StartT_tpcAV",StartT_tpcAV,
"StartT_tpcAV[geant_list_size]/F");
3141 CreateBranch(
"StartE_tpcAV",StartE_tpcAV,
"StartE_tpcAV[geant_list_size]/F");
3142 CreateBranch(
"StartP_tpcAV",StartP_tpcAV,
"StartP_tpcAV[geant_list_size]/F");
3143 CreateBranch(
"StartPx_tpcAV",StartPx_tpcAV,
"StartPx_tpcAV[geant_list_size]/F");
3144 CreateBranch(
"StartPy_tpcAV",StartPy_tpcAV,
"StartPy_tpcAV[geant_list_size]/F");
3145 CreateBranch(
"StartPz_tpcAV",StartPz_tpcAV,
"StartPz_tpcAV[geant_list_size]/F");
3146 CreateBranch(
"EndPointx_tpcAV",EndPointx_tpcAV,
"EndPointx_tpcAV[geant_list_size]/F");
3147 CreateBranch(
"EndPointy_tpcAV",EndPointy_tpcAV,
"EndPointy_tpcAV[geant_list_size]/F");
3148 CreateBranch(
"EndPointz_tpcAV",EndPointz_tpcAV,
"EndPointz_tpcAV[geant_list_size]/F");
3149 CreateBranch(
"EndT_tpcAV",EndT_tpcAV,
"EndT_tpcAV[geant_list_size]/F");
3150 CreateBranch(
"EndE_tpcAV",EndE_tpcAV,
"EndE_tpcAV[geant_list_size]/F");
3151 CreateBranch(
"EndP_tpcAV",EndP_tpcAV,
"EndP_tpcAV[geant_list_size]/F");
3152 CreateBranch(
"EndPx_tpcAV",EndPx_tpcAV,
"EndPx_tpcAV[geant_list_size]/F");
3153 CreateBranch(
"EndPy_tpcAV",EndPy_tpcAV,
"EndPy_tpcAV[geant_list_size]/F");
3154 CreateBranch(
"EndPz_tpcAV",EndPz_tpcAV,
"EndPz_tpcAV[geant_list_size]/F");
3155 CreateBranch(
"pathlen_drifted",pathlen_drifted,
"pathlen_drifted[geant_list_size]/F");
3156 CreateBranch(
"inTPCDrifted",inTPCDrifted,
"inTPCDrifted[geant_list_size]/I");
3157 CreateBranch(
"StartPointx_drifted",StartPointx_drifted,
"StartPointx_drifted[geant_list_size]/F");
3158 CreateBranch(
"StartPointy_drifted",StartPointy_drifted,
"StartPointy_drifted[geant_list_size]/F");
3159 CreateBranch(
"StartPointz_drifted",StartPointz_drifted,
"StartPointz_drifted[geant_list_size]/F");
3160 CreateBranch(
"StartT_drifted",StartT_drifted,
"StartT_drifted[geant_list_size]/F");
3161 CreateBranch(
"StartE_drifted",StartE_drifted,
"StartE_drifted[geant_list_size]/F");
3162 CreateBranch(
"StartP_drifted",StartP_drifted,
"StartP_drifted[geant_list_size]/F");
3163 CreateBranch(
"StartPx_drifted",StartPx_drifted,
"StartPx_drifted[geant_list_size]/F");
3164 CreateBranch(
"StartPy_drifted",StartPy_drifted,
"StartPy_drifted[geant_list_size]/F");
3165 CreateBranch(
"StartPz_drifted",StartPz_drifted,
"StartPz_drifted[geant_list_size]/F");
3166 CreateBranch(
"EndPointx_drifted",EndPointx_drifted,
"EndPointx_drifted[geant_list_size]/F");
3167 CreateBranch(
"EndPointy_drifted",EndPointy_drifted,
"EndPointy_drifted[geant_list_size]/F");
3168 CreateBranch(
"EndPointz_drifted",EndPointz_drifted,
"EndPointz_drifted[geant_list_size]/F");
3169 CreateBranch(
"EndT_drifted",EndT_drifted,
"EndT_drifted[geant_list_size]/F");
3170 CreateBranch(
"EndE_drifted",EndE_drifted,
"EndE_drifted[geant_list_size]/F");
3171 CreateBranch(
"EndP_drifted",EndP_drifted,
"EndP_drifted[geant_list_size]/F");
3172 CreateBranch(
"EndPx_drifted",EndPx_drifted,
"EndPx_drifted[geant_list_size]/F");
3173 CreateBranch(
"EndPy_drifted",EndPy_drifted,
"EndPy_drifted[geant_list_size]/F");
3174 CreateBranch(
"EndPz_drifted",EndPz_drifted,
"EndPz_drifted[geant_list_size]/F");
3175 CreateBranch(
"NumberDaughters",NumberDaughters,
"NumberDaughters[geant_list_size]/I");
3176 CreateBranch(
"Mother",Mother,
"Mother[geant_list_size]/I");
3177 CreateBranch(
"TrackId",TrackId,
"TrackId[geant_list_size]/I");
3178 CreateBranch(
"MergedId", MergedId,
"MergedId[geant_list_size]/I");
3179 CreateBranch(
"origin",
origin,
"origin[geant_list_size]/I");
3180 CreateBranch(
"MCTruthIndex", MCTruthIndex,
"MCTruthIndex[geant_list_size]/I");
3181 CreateBranch(
"process_primary",process_primary,
"process_primary[geant_list_size]/I");
3182 CreateBranch(
"processname", processname);
3185 if (hasMCShowerInfo()){
3186 CreateBranch(
"no_mcshowers",&no_mcshowers,
"no_mcshowers/I");
3187 CreateBranch(
"mcshwr_origin",mcshwr_origin,
"mcshwr_origin[no_mcshowers]/I");
3188 CreateBranch(
"mcshwr_pdg",mcshwr_pdg,
"mcshwr_pdg[no_mcshowers]/I");
3189 CreateBranch(
"mcshwr_TrackId",mcshwr_TrackId,
"mcshwr_TrackId[no_mcshowers]/I");
3190 CreateBranch(
"mcshwr_Process",mcshwr_Process);
3191 CreateBranch(
"mcshwr_startX",mcshwr_startX,
"mcshwr_startX[no_mcshowers]/F");
3192 CreateBranch(
"mcshwr_startY",mcshwr_startY,
"mcshwr_startY[no_mcshowers]/F");
3193 CreateBranch(
"mcshwr_startZ",mcshwr_startZ,
"mcshwr_startZ[no_mcshowers]/F");
3194 CreateBranch(
"mcshwr_endX",mcshwr_endX,
"mcshwr_endX[no_mcshowers]/F");
3195 CreateBranch(
"mcshwr_endY",mcshwr_endY,
"mcshwr_endY[no_mcshowers]/F");
3196 CreateBranch(
"mcshwr_endZ",mcshwr_endZ,
"mcshwr_endZ[no_mcshowers]/F");
3197 CreateBranch(
"mcshwr_CombEngX",mcshwr_CombEngX,
"mcshwr_CombEngX[no_mcshowers]/F");
3198 CreateBranch(
"mcshwr_CombEngY",mcshwr_CombEngY,
"mcshwr_CombEngY[no_mcshowers]/F");
3199 CreateBranch(
"mcshwr_CombEngZ",mcshwr_CombEngZ,
"mcshwr_CombEngZ[no_mcshowers]/F");
3200 CreateBranch(
"mcshwr_CombEngPx",mcshwr_CombEngPx,
"mcshwr_CombEngPx[no_mcshowers]/F");
3201 CreateBranch(
"mcshwr_CombEngPy",mcshwr_CombEngPy,
"mcshwr_CombEngPy[no_mcshowers]/F");
3202 CreateBranch(
"mcshwr_CombEngPz",mcshwr_CombEngPz,
"mcshwr_CombEngPz[no_mcshowers]/F");
3203 CreateBranch(
"mcshwr_CombEngE",mcshwr_CombEngE,
"mcshwr_CombEngE[no_mcshowers]/F");
3204 CreateBranch(
"mcshwr_dEdx",mcshwr_dEdx,
"mcshwr_dEdx[no_mcshowers]/F");
3205 CreateBranch(
"mcshwr_StartDirX",mcshwr_StartDirX,
"mcshwr_StartDirX[no_mcshowers]/F");
3206 CreateBranch(
"mcshwr_StartDirY",mcshwr_StartDirY,
"mcshwr_StartDirY[no_mcshowers]/F");
3207 CreateBranch(
"mcshwr_StartDirZ",mcshwr_StartDirZ,
"mcshwr_StartDirZ[no_mcshowers]/F");
3208 CreateBranch(
"mcshwr_isEngDeposited",mcshwr_isEngDeposited,
"mcshwr_isEngDeposited[no_mcshowers]/I");
3209 CreateBranch(
"mcshwr_Motherpdg",mcshwr_Motherpdg,
"mcshwr_Motherpdg[no_mcshowers]/I");
3210 CreateBranch(
"mcshwr_MotherTrkId",mcshwr_MotherTrkId,
"mcshwr_MotherTrkId[no_mcshowers]/I");
3211 CreateBranch(
"mcshwr_MotherProcess",mcshwr_MotherProcess);
3212 CreateBranch(
"mcshwr_MotherstartX",mcshwr_MotherstartX,
"mcshwr_MotherstartX[no_mcshowers]/F");
3213 CreateBranch(
"mcshwr_MotherstartY",mcshwr_MotherstartY,
"mcshwr_MotherstartY[no_mcshowers]/F");
3214 CreateBranch(
"mcshwr_MotherstartZ",mcshwr_MotherstartZ,
"mcshwr_MotherstartZ[no_mcshowers]/F");
3215 CreateBranch(
"mcshwr_MotherendX",mcshwr_MotherendX,
"mcshwr_MotherendX[no_mcshowers]/F");
3216 CreateBranch(
"mcshwr_MotherendY",mcshwr_MotherendY,
"mcshwr_MotherendY[no_mcshowers]/F");
3217 CreateBranch(
"mcshwr_MotherendZ",mcshwr_MotherendZ,
"mcshwr_MotherendZ[no_mcshowers]/F");
3218 CreateBranch(
"mcshwr_Ancestorpdg",mcshwr_Ancestorpdg,
"mcshwr_Ancestorpdg[no_mcshowers]/I");
3219 CreateBranch(
"mcshwr_AncesotorTrkId",mcshwr_AncestorTrkId,
"mcshwr_AncestorTrkId[no_mcshowers]/I");
3220 CreateBranch(
"mcshwr_AncesotorProcess",mcshwr_AncestorProcess);
3221 CreateBranch(
"mcshwr_AncestorstartX",mcshwr_AncestorstartX,
"mcshwr_AncestorstartX[no_mcshowers]/F");
3222 CreateBranch(
"mcshwr_AncestorstartY",mcshwr_AncestorstartY,
"mcshwr_AncestorstartY[no_mcshowers]/F");
3223 CreateBranch(
"mcshwr_AncestorstartZ",mcshwr_AncestorstartZ,
"mcshwr_AncestorstartZ[no_mcshowers]/F");
3224 CreateBranch(
"mcshwr_AncestorendX",mcshwr_AncestorendX,
"mcshwr_AncestorendX[no_mcshowers]/F");
3225 CreateBranch(
"mcshwr_AncestorendY",mcshwr_AncestorendY,
"mcshwr_AncestorendY[no_mcshowers]/F");
3226 CreateBranch(
"mcshwr_AncestorendZ",mcshwr_AncestorendZ,
"mcshwr_AncestorendZ[no_mcshowers]/F");
3229 if (hasMCTrackInfo()){
3230 CreateBranch(
"no_mctracks",&no_mctracks,
"no_mctracks/I");
3231 CreateBranch(
"mctrk_origin",mctrk_origin,
"mctrk_origin[no_mctracks]/I");
3232 CreateBranch(
"mctrk_pdg",mctrk_pdg,
"mctrk_pdg[no_mctracks]/I");
3233 CreateBranch(
"mctrk_TrackId",mctrk_TrackId,
"mctrk_TrackId[no_mctracks]/I");
3234 CreateBranch(
"mctrk_Process",mctrk_Process);
3235 CreateBranch(
"mctrk_startX",mctrk_startX,
"mctrk_startX[no_mctracks]/F");
3236 CreateBranch(
"mctrk_startY",mctrk_startY,
"mctrk_startY[no_mctracks]/F");
3237 CreateBranch(
"mctrk_startZ",mctrk_startZ,
"mctrk_startZ[no_mctracks]/F");
3238 CreateBranch(
"mctrk_endX",mctrk_endX,
"mctrk_endX[no_mctracks]/F");
3239 CreateBranch(
"mctrk_endY",mctrk_endY,
"mctrk_endY[no_mctracks]/F");
3240 CreateBranch(
"mctrk_endZ",mctrk_endZ,
"mctrk_endZ[no_mctracks]/F");
3241 CreateBranch(
"mctrk_startX_drifted",mctrk_startX_drifted,
"mctrk_startX_drifted[no_mctracks]/F");
3242 CreateBranch(
"mctrk_startY_drifted",mctrk_startY_drifted,
"mctrk_startY_drifted[no_mctracks]/F");
3243 CreateBranch(
"mctrk_startZ_drifted",mctrk_startZ_drifted,
"mctrk_startZ_drifted[no_mctracks]/F");
3244 CreateBranch(
"mctrk_endX_drifted",mctrk_endX_drifted,
"mctrk_endX_drifted[no_mctracks]/F");
3245 CreateBranch(
"mctrk_endY_drifted",mctrk_endY_drifted,
"mctrk_endY_drifted[no_mctracks]/F");
3246 CreateBranch(
"mctrk_endZ_drifted",mctrk_endZ_drifted,
"mctrk_endZ_drifted[no_mctracks]/F");
3247 CreateBranch(
"mctrk_len_drifted",mctrk_len_drifted,
"mctrk_len_drifted[no_mctracks]/F");
3248 CreateBranch(
"mctrk_p_drifted",mctrk_p_drifted,
"mctrk_p_drifted[no_mctracks]/F");
3249 CreateBranch(
"mctrk_px_drifted",mctrk_px_drifted,
"mctrk_px_drifted[no_mctracks]/F");
3250 CreateBranch(
"mctrk_py_drifted",mctrk_py_drifted,
"mctrk_py_drifted[no_mctracks]/F");
3251 CreateBranch(
"mctrk_pz_drifted",mctrk_pz_drifted,
"mctrk_pz_drifted[no_mctracks]/F");
3252 CreateBranch(
"mctrk_Motherpdg",mctrk_Motherpdg,
"mctrk_Motherpdg[no_mctracks]/I");
3253 CreateBranch(
"mctrk_MotherTrkId",mctrk_MotherTrkId,
"mctrk_MotherTrkId[no_mctracks]/I");
3254 CreateBranch(
"mctrk_MotherProcess",mctrk_MotherProcess);
3255 CreateBranch(
"mctrk_MotherstartX",mctrk_MotherstartX,
"mctrk_MotherstartX[no_mctracks]/F");
3256 CreateBranch(
"mctrk_MotherstartY",mctrk_MotherstartY,
"mctrk_MotherstartY[no_mctracks]/F");
3257 CreateBranch(
"mctrk_MotherstartZ",mctrk_MotherstartZ,
"mctrk_MotherstartZ[no_mctracks]/F");
3258 CreateBranch(
"mctrk_MotherendX",mctrk_MotherendX,
"mctrk_MotherendX[no_mctracks]/F");
3259 CreateBranch(
"mctrk_MotherendY",mctrk_MotherendY,
"mctrk_MotherendY[no_mctracks]/F");
3260 CreateBranch(
"mctrk_MotherendZ",mctrk_MotherendZ,
"mctrk_MotherendZ[no_mctracks]/F");
3261 CreateBranch(
"mctrk_Ancestorpdg",mctrk_Ancestorpdg,
"mctrk_Ancestorpdg[no_mctracks]/I");
3262 CreateBranch(
"mctrk_AncesotorTrkId",mctrk_AncestorTrkId,
"mctrk_AncestorTrkId[no_mctracks]/I");
3263 CreateBranch(
"mctrk_AncesotorProcess",mctrk_AncestorProcess);
3264 CreateBranch(
"mctrk_AncestorstartX",mctrk_AncestorstartX,
"mctrk_AncestorstartX[no_mctracks]/F");
3265 CreateBranch(
"mctrk_AncestorstartY",mctrk_AncestorstartY,
"mctrk_AncestorstartY[no_mctracks]/F");
3266 CreateBranch(
"mctrk_AncestorstartZ",mctrk_AncestorstartZ,
"mctrk_AncestorstartZ[no_mctracks]/F");
3267 CreateBranch(
"mctrk_AncestorendX",mctrk_AncestorendX,
"mctrk_AncestorendX[no_mctracks]/F");
3268 CreateBranch(
"mctrk_AncestorendY",mctrk_AncestorendY,
"mctrk_AncestorendY[no_mctracks]/F");
3269 CreateBranch(
"mctrk_AncestorendZ",mctrk_AncestorendZ,
"mctrk_AncestorendZ[no_mctracks]/F");
3272 if (hasAuxDetector()) {
3275 if (!hasGeantInfo()){
3277 <<
"Saving Auxiliary detector information requies saving GEANT information, " 3278 <<
"please set fSaveGeantInfo flag to true in your fhicl file and rerun.\n";
3280 std::ostringstream sstr;
3283 CreateBranch(
"NAuxDets", NAuxDets,
"NAuxDets[geant_list_size]/s");
3284 CreateBranch(
"AuxDetID", AuxDetID,
"AuxDetID[geant_list_size]" + MaxAuxDetIndexStr +
"/S");
3285 CreateBranch(
"AuxDetEntryX", entryX,
"AuxDetEntryX[geant_list_size]" + MaxAuxDetIndexStr +
"/F");
3286 CreateBranch(
"AuxDetEntryY", entryY,
"AuxDetEntryY[geant_list_size]" + MaxAuxDetIndexStr +
"/F");
3287 CreateBranch(
"AuxDetEntryZ", entryZ,
"AuxDetEntryZ[geant_list_size]" + MaxAuxDetIndexStr +
"/F");
3288 CreateBranch(
"AuxDetEntryT", entryT,
"AuxDetEntryT[geant_list_size]" + MaxAuxDetIndexStr +
"/F");
3289 CreateBranch(
"AuxDetExitX", exitX,
"AuxDetExitX[geant_list_size]" + MaxAuxDetIndexStr +
"/F");
3290 CreateBranch(
"AuxDetExitY", exitY,
"AuxDetExitY[geant_list_size]" + MaxAuxDetIndexStr +
"/F");
3291 CreateBranch(
"AuxDetExitZ", exitZ,
"AuxDetExitZ[geant_list_size]" + MaxAuxDetIndexStr +
"/F");
3292 CreateBranch(
"AuxDetExitT", exitT,
"AuxDetExitT[geant_list_size]" + MaxAuxDetIndexStr +
"/F");
3293 CreateBranch(
"AuxDetExitPx", exitPx,
"AuxDetExitPx[geant_list_size]" + MaxAuxDetIndexStr +
"/F");
3294 CreateBranch(
"AuxDetExitPy", exitPy,
"AuxDetExitPy[geant_list_size]" + MaxAuxDetIndexStr +
"/F");
3295 CreateBranch(
"AuxDetExitPz", exitPz,
"AuxDetExitPz[geant_list_size]" + MaxAuxDetIndexStr +
"/F");
3296 CreateBranch(
"CombinedEnergyDep", CombinedEnergyDep,
3297 "CombinedEnergyDep[geant_list_size]" + MaxAuxDetIndexStr +
"/F");
3300 if(hasSpacePointSolverInfo()) {
3301 std::cout <<
"Creating branches.\n\n";
3302 CreateBranch(
"nspacepoints", &nspacepoints,
"nspacepoints/S");
3303 CreateBranch(
"SpacePointX", SpacePointX,
"SpacePointX[nspacepoints]/F");
3304 CreateBranch(
"SpacePointY", SpacePointY,
"SpacePointY[nspacepoints]/F");
3305 CreateBranch(
"SpacePointZ", SpacePointZ,
"SpacePointZ[nspacepoints]/F");
3306 CreateBranch(
"SpacePointQ", SpacePointQ,
"SpacePointQ[nspacepoints]/F");
3307 CreateBranch(
"SpacePointErrX", SpacePointErrX,
"SpacePointErrX[nspacepoints]/F");
3308 CreateBranch(
"SpacePointErrY", SpacePointErrY,
"SpacePointErrY[nspacepoints]/F");
3309 CreateBranch(
"SpacePointErrZ", SpacePointErrZ,
"SpacePointErrZ[nspacepoints]/F");
3310 CreateBranch(
"SpacePointID", SpacePointID,
"SpacePointID[nspacepoints]/I");
3311 CreateBranch(
"SpacePointChisq", SpacePointChisq,
"SpacePointChisq[nspacepoints]/F");
3314 CreateBranch(
"SpacePointEmScore", SpacePointEmScore,
"SpacePointEmScore[nspacepoints]/F");
3328 fTree(nullptr), fPOT(nullptr),
3329 fDigitModuleLabel (pset.
get<
std::
string >(
"DigitModuleLabel") ),
3330 fHitsModuleLabel (pset.
get<
std::
string >(
"HitsModuleLabel") ),
3331 fLArG4ModuleLabel (pset.
get<
std::
string >(
"LArGeantModuleLabel") ),
3332 fCalDataModuleLabel (pset.
get<
std::
string >(
"CalDataModuleLabel") ),
3333 fGenieGenModuleLabel (pset.
get<
std::
string >(
"GenieGenModuleLabel") ),
3334 fCryGenModuleLabel (pset.
get<
std::
string >(
"CryGenModuleLabel") ),
3335 fProtoGenModuleLabel (pset.
get<
std::
string >(
"ProtoGenModuleLabel") ),
3336 fG4ModuleLabel (pset.
get<
std::
string >(
"G4ModuleLabel") ),
3337 fClusterModuleLabel (pset.
get<
std::
string >(
"ClusterModuleLabel") ),
3338 fPandoraNuVertexModuleLabel (pset.
get<
std::
string >(
"PandoraNuVertexModuleLabel") ),
3339 fOpFlashModuleLabel (pset.
get<
std::
string >(
"OpFlashModuleLabel") ),
3340 fExternalCounterModuleLabel (pset.
get<
std::
string >(
"ExternalCounterModuleLabel") ),
3341 fMCShowerModuleLabel (pset.
get<
std::
string >(
"MCShowerModuleLabel") ),
3342 fMCTrackModuleLabel (pset.
get<
std::
string >(
"MCTrackModuleLabel") ),
3343 fSpacePointSolverModuleLabel (pset.
get<
std::
string >(
"SpacePointSolverModuleLabel")),
3344 fCnnModuleLabel (pset.
get<
std::
string >(
"CnnModuleLabel")),
3354 fPOTModuleLabel (pset.
get<
std::
string >(
"POTModuleLabel")),
3355 fCosmicClusterTaggerAssocLabel (pset.
get<
std::
string >(
"CosmicClusterTaggerAssocLabel")),
3356 fUseBuffer (pset.
get<
bool >(
"UseBuffers", false)),
3357 fSaveAuxDetInfo (pset.
get<
bool >(
"SaveAuxDetInfo", false)),
3358 fSaveCryInfo (pset.
get<
bool >(
"SaveCryInfo", false)),
3359 fSaveGenieInfo (pset.
get<
bool >(
"SaveGenieInfo", false)),
3360 fSaveProtoInfo (pset.
get<
bool >(
"SaveProtoInfo", false)),
3361 fSaveGeantInfo (pset.
get<
bool >(
"SaveGeantInfo", false)),
3362 fSaveMCShowerInfo (pset.
get<
bool >(
"SaveMCShowerInfo", false)),
3363 fSaveMCTrackInfo (pset.
get<
bool >(
"SaveMCTrackInfo", false)),
3364 fSaveHitInfo (pset.
get<
bool >(
"SaveHitInfo", false)),
3365 fSaveRawDigitInfo (pset.
get<
bool >(
"SaveRawDigitInfo", false)),
3366 fSaveTrackInfo (pset.
get<
bool >(
"SaveTrackInfo", false)),
3367 fSaveVertexInfo (pset.
get<
bool >(
"SaveVertexInfo", false)),
3368 fSaveClusterInfo (pset.
get<
bool >(
"SaveClusterInfo", false)),
3369 fSavePandoraNuVertexInfo (pset.
get<
bool >(
"SavePandoraNuVertexInfo", false)),
3370 fSaveFlashInfo (pset.
get<
bool >(
"SaveFlashInfo", false)),
3371 fSaveExternCounterInfo (pset.
get<
bool >(
"SaveExternCounterInfo", false)),
3372 fSaveShowerInfo (pset.
get<
bool >(
"SaveShowerInfo", false)),
3373 fSavePFParticleInfo (pset.
get<
bool >(
"SavePFParticleInfo", false)),
3374 fSaveSpacePointSolverInfo (pset.
get<
bool >(
"SaveSpacePointSolverInfo", false)),
3375 fSaveCnnInfo (pset.
get<
bool >(
"SaveCnnInfo", false)),
3377 fContainmentTaggerAssocLabel (pset.
get<
std::
vector<
std::
string > >(
"ContainmentTaggerAssocLabel") ),
3379 bIgnoreMissingShowers (pset.
get<
bool >(
"IgnoreMissingShowers", false)),
3381 fSaveCaloCosmics (pset.
get<
bool >(
"SaveCaloCosmics",false)),
3382 fG4minE (pset.
get<
float>(
"G4minE",0.01))
3390 <<
"\n UseBuffers: " << std::boolalpha <<
fUseBuffer 3394 <<
"AnalysisTree currently supports only up to " <<
kMaxTrackers 3395 <<
" tracking algorithms, but " <<
GetNTrackers() <<
" are specified." 3396 <<
"\nYou can increase kMaxTrackers and recompile.";
3436 <<
" tracking algorithms, but " <<
GetNVertexAlgos() <<
" are specified." 3437 <<
"\nYou can increase kMaxVertexAlgos and recompile.";
3444 auto const* geom = lar::providerFrom<geo::Geometry>();
3449 TPC.LocalToWorld(origin, center);
3450 double tpcDim[3] = {
TPC.HalfWidth(),
TPC.HalfHeight(), 0.5*
TPC.Length() };
3459 std::cout <<
"Active Boundaries: " 3475 fTree = tfs->make<TTree>(
"anatree",
"analysis tree");
3479 fPOT = tfs->make<TTree>(
"pottree",
"pot tree");
3512 if (potSummaryHandlebnbETOR860){
3520 if (potSummaryHandlebnbETOR875){
3528 if (potSummaryHandlenumiETORTGT){
3540 std::cout <<
"Analysing.\n\n";
3549 std::vector<art::Ptr<recob::Hit> > hitlist;
3556 std::vector<art::Ptr<recob::Cluster> > clusterlist;
3559 if (clusterListHandle)
3567 std::cout <<
"Saving SpacepointSolver info.";
3570 if (spacepointListHandle->size() != pointchargeListHandle->size()) {
3572 <<
"size of point and charge containers must be equal" <<
std::endl;
3577 std::vector<art::Ptr<recob::OpFlash> > flashlist;
3579 if (flashListHandle)
3583 std::vector<art::Ptr<raw::ExternalTrigger> > countlist;
3585 if (countListHandle)
3590 std::vector<art::Ptr<simb::MCTruth> > mclist;
3593 if (mctruthListHandle)
3599 std::vector<art::Ptr<simb::MCTruth> > mclistcry;
3602 if (mctruthcryListHandle) {
3608 mf::LogError(
"AnalysisTree") <<
"Requested CRY information but none exists, hence not saving CRY information.";
3614 std::vector<art::Ptr<simb::MCTruth> > mclistproto;
3617 if (mctruthprotoListHandle) {
3623 mf::LogError(
"AnalysisTree") <<
"Requested protoDUNE beam generator information but none exists, hence not saving protoDUNE beam generator information.";
3634 nMCShowers = mcshowerh->size();
3643 nMCTracks = mctrackh->size();
3646 int nCryPrimaries = 0;
3649 mctruthcry = mclistcry[0];
3654 int nProtoPrimaries = 0;
3656 mctruthproto = mclistproto[0];
3657 nProtoPrimaries = mctruthproto->
NParticles();
3660 int nGeniePrimaries = 0, nGEANTparticles = 0;
3668 auto const allmclists = evt.
getMany<std::vector<simb::MCTruth>>();
3669 for(
size_t mcl = 0; mcl < allmclists.size(); ++mcl){
3671 for(
size_t m = 0;
m < mclistHandle->size(); ++
m){
3679 if (!mclist.empty()){
3693 mctruth = mclist[0];
3698 const sim::ParticleList& plist = pi_serv->
ParticleList();
3699 nGEANTparticles = plist.size();
3705 << nGEANTparticles <<
" GEANT particles, " 3706 << nGeniePrimaries <<
" GENIE particles";
3710 int nSpacePoints = 0;
3712 nSpacePoints = spacepointListHandle->size();
3716 fData->ResizeGenie(nGeniePrimaries);
3718 fData->ResizeCry(nCryPrimaries);
3720 fData->ResizeProto(nProtoPrimaries);
3722 fData->ResizeGEANT(nGEANTparticles);
3724 fData->ResizeMCShower(nMCShowers);
3726 fData->ResizeMCTrack(nMCTracks);
3728 fData->ResizeSpacePointSolver(nSpacePoints);
3730 fData->ClearLocalData();
3734 const size_t NHits = hitlist.size();
3736 const size_t NClusters = clusterlist.size();
3737 const size_t NFlashes = flashlist.size();
3738 const size_t NExternCounts = countlist.size();
3749 std::vector<art::Ptr<raw::Trigger>> triggerlist;
3751 if (triggerListHandle)
3754 if (triggerlist.size()){
3755 fData->triggernumber = triggerlist[0]->TriggerNumber();
3756 fData->triggertime = triggerlist[0]->TriggerTime();
3757 fData->beamgatetime = triggerlist[0]->BeamGateTime();
3758 fData->triggerbits = triggerlist[0]->TriggerBits();
3762 std::vector< art::Handle< std::vector<recob::Vertex> > > vertexListHandle(NVertexAlgos);
3763 std::vector< std::vector<art::Ptr<recob::Vertex> > > vertexlist(NVertexAlgos);
3764 for (
unsigned int it = 0; it < NVertexAlgos; ++it){
3766 if (vertexListHandle[it])
3776 std::vector< art::Handle< std::vector<recob::Track> > > trackListHandle(NTrackers);
3777 std::vector< std::vector<art::Ptr<recob::Track> > > tracklist(NTrackers);
3778 for (
unsigned int it = 0; it < NTrackers; ++it){
3780 if (trackListHandle[it])
3789 std::vector<std::vector<recob::Shower>
const*> showerList;
3790 std::vector< art::Handle< std::vector<recob::Shower> > > showerListHandle;
3794 auto ShowerHandle = evt.
getHandle<std::vector<recob::Shower>>(ShowerInputTag);
3795 if (!ShowerHandle) {
3796 showerList.push_back(
nullptr);
3799 <<
"Showers with input tag '" << ShowerInputTag.encode()
3800 <<
"' were not found in the event." 3801 " If you really know what you are doing," 3802 " set AnalysisTree's configuration parameter IgnoreMissingShowers" 3803 " to \"true\"; the lack of any shower set will be tolerated," 3804 " and the shower list in the corresponding event will be set to" 3805 " a list of one shower, with an invalid ID.\n";
3810 <<
"No showers found for input tag '" << ShowerInputTag.encode()
3811 <<
"' ; FILLING WITH FAKE DATA AS FOR USER'S REQUEST";
3815 else showerList.push_back(ShowerHandle.product());
3817 showerListHandle.push_back(ShowerHandle);
3825 std::vector<const sim::AuxDetSimChannel*> fAuxDetSimChannels;
3830 std::vector<const sim::SimChannel*> fSimChannels;
3840 fData->evttime = tts.AsDouble();
3845 fData->beamtime = (double)
beam->get_t_ms();
3846 fData->beamtime/=1000.;
3847 std::map<std::string, std::vector<double>> datamap =
beam->GetDataMap();
3848 if (datamap[
"E:TOR860"].
size()){
3849 fData->potbnb = datamap[
"E:TOR860"][0];
3851 if (datamap[
"E:TORTGT"].
size()){
3852 fData->potnumitgt = datamap[
"E:TORTGT"][0];
3854 if (datamap[
"E:TOR101"].
size()){
3855 fData->potnumi101 = datamap[
"E:TOR101"][0];
3869 fData->no_hits_stored = TMath::Min( (
int) NHits, (
int)
kMaxHits);
3870 if (NHits > kMaxHits) {
3873 mf::LogError(
"AnalysisTree:limits") <<
"event has " << NHits
3874 <<
" hits, only kMaxHits=" << kMaxHits <<
" stored in tree";
3876 for (
size_t i = 0; i < NHits && i <
kMaxHits ; ++i){
3877 fData->hit_channel[i] = hitlist[i]->Channel();
3878 fData->hit_tpc[i] = hitlist[i]->WireID().TPC;
3879 fData->hit_plane[i] = hitlist[i]->WireID().Plane;
3880 fData->hit_wire[i] = hitlist[i]->WireID().Wire;
3881 fData->hit_peakT[i] = hitlist[i]->PeakTime();
3882 fData->hit_charge[i] = hitlist[i]->Integral();
3883 fData->hit_ph[i] = hitlist[i]->PeakAmplitude();
3884 fData->hit_startT[i] = hitlist[i]->PeakTimeMinusRMS();
3885 fData->hit_endT[i] = hitlist[i]->PeakTimePlusRMS();
3886 fData->hit_rms[i] = hitlist[i]->RMS();
3887 fData->hit_goodnessOfFit[i] = hitlist[i]->GoodnessOfFit();
3888 fData->hit_multiplicity[i] = hitlist[i]->Multiplicity();
3894 std::vector<const sim::IDE*> ides;
3901 fData->hit_trueX[i] = xyz[0];
3921 int dataSize = fmrd.at(i)[0]->Samples();
3922 short ped = fmrd.at(i)[0]->GetPedestal();
3924 std::vector<short> rawadc(dataSize);
3925 raw::Uncompress(fmrd.at(i)[0]->ADCs(), rawadc, fmrd.at(i)[0]->Compression());
3926 int t0 = hitlist[i]->PeakTime() - 3*(hitlist[i]->RMS());
3928 int t1 = hitlist[i]->PeakTime() + 3*(hitlist[i]->RMS());
3929 if (t1>=dataSize) t1 = dataSize-1;
3930 fData->rawD_ph[i] = -1;
3931 fData->rawD_peakT[i] = -1;
3932 for (
int j = t0; j<=
t1; ++j){
3933 if (rawadc[j]-ped>
fData->rawD_ph[i]){
3934 fData->rawD_ph[i] = rawadc[j]-ped;
3935 fData->rawD_peakT[i] = j;
3938 fData->rawD_charge[i] = 0;
3939 fData->rawD_fwhh[i] = 0;
3940 double mean_t = 0.0;
3941 double mean_t2 = 0.0;
3942 for (
int j = t0; j<=
t1; ++j){
3943 if (rawadc[j]-ped>=0.5*
fData->rawD_ph[i]){
3944 ++
fData->rawD_fwhh[i];
3946 if (rawadc[j]-ped>=0.1*
fData->rawD_ph[i]){
3947 fData->rawD_charge[i] += rawadc[j]-ped;
3948 mean_t += (double)j*(rawadc[j]-ped);
3949 mean_t2 += (double)j*(
double)j*(rawadc[j]-ped);
3952 mean_t/=
fData->rawD_charge[i];
3953 mean_t2/=
fData->rawD_charge[i];
3954 fData->rawD_rms[i] = sqrt(mean_t2-mean_t*mean_t);
3959 fData -> hit_nelec[i] = 0;
3960 fData -> hit_energy[i] = 0;
3962 for(
size_t sc = 0; sc < fSimChannels.size(); ++sc){
3963 if(fSimChannels[sc]->Channel() == hitlist[i]->Channel()) chan = fSimChannels[sc];
3966 for(
auto const& mapitr : chan->
TDCIDEMap()){
3968 for(
auto const& ide : mapitr.second){
3969 fData -> hit_nelec[i] += ide.numElectrons;
3970 fData -> hit_energy[i] += ide.energy;
3978 if (hitListHandle) {
3981 for (
size_t i = 0; i < NHits && i <
kMaxHits ; ++i){
3982 if (fmtk.isValid()){
3983 if (fmtk.at(i).size()!=0){
3984 fData->hit_trkid[i] = fmtk.at(i)[0]->ID();
3985 fData->hit_trkKey[i] = fmtk.at(i)[0].key();
3989 fData->hit_trkid[i] = -1;
3999 if (hitListHandle) {
4003 for (
size_t i = 0; i < NHits && i <
kMaxHits ; ++i){
4004 if (fmcl.isValid() && fmcl.at(i).size()!=0){
4005 fData->hit_clusterid[i] = fmcl.at(i)[0]->ID();
4006 fData->hit_clusterKey[i] = fmcl.at(i)[0].key();
4009 if(fmsp.isValid() && fmsp.at(i).size()!=0){
4010 fData->hit_spacepointid[i] = fmsp.at(i)[0]->ID();
4011 fData->hit_spacepointKey[i] = fmsp.at(i)[0].key();
4026 for (
unsigned int n = 0;
n < particleVector.size(); ++
n) {
4034 mf::LogError(
"AnalysisTree:limits") <<
"event has " << nprim
4035 <<
" nu neutrino vertices, only kMaxVertices=" <<
kMaxVertices <<
" stored in tree";
4038 fData->nnuvtx = nprim;
4041 for (
unsigned int n = 0;
n < particleVector.size(); ++
n) {
4045 if (particlesToVertices.end() != vIter) {
4047 if (!vertexVector.empty()) {
4048 if (vertexVector.size() == 1) {
4050 double xyz[3] = {0.0, 0.0, 0.0} ;
4052 fData->nuvtxx[iv] = xyz[0];
4053 fData->nuvtxy[iv] = xyz[1];
4054 fData->nuvtxz[iv] = xyz[2];
4066 fData->nclusters = (
int) NClusters;
4070 mf::LogError(
"AnalysisTree:limits") <<
"event has " << NClusters
4071 <<
" clusters, only kMaxClusters=" <<
kMaxClusters <<
" stored in tree";
4073 for(
unsigned int ic=0; ic<NClusters;++ic){
4076 fData->clusterId[ic] = cluster.
ID();
4077 fData->clusterView[ic] = cluster.
View();
4097 if (fmcct.isValid()){
4098 fData->cluncosmictags_tagger[ic] = fmcct.at(ic).size();
4099 if (fmcct.at(ic).size()>0){
4100 if(fmcct.at(ic).size()>1)
4101 std::cerr <<
"\n Warning : more than one cosmic tag per cluster in module! assigning the first tag to the cluster" <<
fCosmicClusterTaggerAssocLabel;
4102 fData->clucosmicscore_tagger[ic] = fmcct.at(ic).at(0)->CosmicScore();
4103 fData->clucosmictype_tagger[ic] = fmcct.at(ic).at(0)->CosmicType();
4110 fData->nspacepoints = (
unsigned int) nSpacePoints;
4116 size_t emLikeIdx = cluResults->getIndex(
"em");
4118 const art::FindManyP<recob::Hit> hitsFromClusters(cluResults->dataHandle(),
evt, cluResults->dataTag());
4121 std::vector<size_t> sizeScore(nSpacePoints, 0);
4123 for(
size_t c = 0;
c < cluResults->size(); ++
c) {
4124 const std::vector< art::Ptr<recob::Hit> > & hits = hitsFromClusters.at(
c);
4125 std::array<float, MVA_LENGTH> cnn_out = cluResults->getOutput(
c);
4127 for (
auto& hptr : hits) {
4128 const std::vector< art::Ptr<recob::SpacePoint> > & sp = spFromHits.at(hptr.key());
4129 for(
const auto & spptr : sp) {
4130 if(hits.size() > sizeScore[spptr.key()]) {
4131 sizeScore[spptr.key()] = hits.size();
4132 fData->SpacePointEmScore[spptr.key()] = cnn_out[emLikeIdx];
4140 for (
unsigned int is = 0; is < (
unsigned int)nSpacePoints;
4142 fData->SpacePointX[is] = (*spacepointListHandle)[is].XYZ()[0];
4143 fData->SpacePointY[is] = (*spacepointListHandle)[is].XYZ()[1];
4144 fData->SpacePointZ[is] = (*spacepointListHandle)[is].XYZ()[2];
4146 fData->SpacePointQ[is] = (*pointchargeListHandle)[is].charge();
4148 fData->SpacePointErrX[is] = (*spacepointListHandle)[is].ErrXYZ()[0];
4149 fData->SpacePointErrY[is] = (*spacepointListHandle)[is].ErrXYZ()[1];
4150 fData->SpacePointErrZ[is] = (*spacepointListHandle)[is].ErrXYZ()[2];
4152 fData->SpacePointID[is] = (*spacepointListHandle)[is].ID();
4154 fData->SpacePointID[is] = (*spacepointListHandle)[is].Chisq();
4159 fData->no_flashes = (
int) NFlashes;
4163 mf::LogError(
"AnalysisTree:limits") <<
"event has " << NFlashes
4164 <<
" flashes, only kMaxFlashes=" <<
kMaxFlashes <<
" stored in tree";
4169 for (
size_t i = 0; i < NFlashes && i <
kMaxFlashes ; ++i){
4170 fData->flash_time[i] = flashlist[i]->Time();
4171 fData->flash_pe[i] = flashlist[i]->TotalPE();
4172 fData->flash_ycenter[i] = flashlist[i]->YCenter();
4173 fData->flash_zcenter[i] = flashlist[i]->ZCenter();
4174 fData->flash_ywidth[i] = flashlist[i]->YWidth();
4175 fData->flash_zwidth[i] = flashlist[i]->ZWidth();
4176 fData->flash_timewidth[i] = flashlist[i]->TimeWidth();
4181 fData->no_ExternCounts = (
int) NExternCounts;
4185 mf::LogError(
"AnalysisTree:limits") <<
"event has " << NExternCounts
4186 <<
" External Counters, only kMaxExternCounts=" <<
kMaxExternCounts <<
" stored in tree";
4189 fData->externcounts_time[i] = countlist[i]->GetTrigTime();
4190 fData->externcounts_id[i] = countlist[i]->GetTrigID();
4196 std::map<Short_t, Short_t> trackIDtoPFParticleIDMap, vertexIDtoPFParticleIDMap, showerIDtoPFParticleIDMap;
4201 size_t NPFParticles = pfparticlelist.size();
4204 PFParticleData.
Clear();
4213 mf::LogError(
"AnalysisTree:limits") <<
"event has " << NPFParticles
4214 <<
" PFParticles, only " 4227 std::cerr <<
"Warning: there were " << neutrinoPFParticles.size() <<
" reconstructed PFParticle neutrinos; only the first " <<
kMaxNPFPNeutrinos <<
" being stored in tree" <<
std::endl;
4244 for (
size_t i = 0; i < NPFParticles && i < PFParticleData.
GetMaxPFParticles() ; ++i){
4245 PFParticleData.
pfp_selfID[i] = pfparticlelist[i]->Self();
4246 PFParticleData.
pfp_isPrimary[i] = (Short_t)pfparticlelist[i]->IsPrimary();
4248 PFParticleData.
pfp_parentID[i] = pfparticlelist[i]->Parent();
4249 PFParticleData.
pfp_pdgCode[i] = pfparticlelist[i]->PdgCode();
4253 std::vector<size_t> daughterIDs = pfparticlelist[i]->Daughters();
4255 for (
size_t j = 0; j < daughterIDs.size(); ++j)
4259 auto vertexMapIter = pfParticleToVertexMap.find(pfparticlelist[i]);
4260 if (vertexMapIter != pfParticleToVertexMap.end()) {
4263 if (pfParticleVertices.size() > 1)
4264 std::cerr <<
"Warning: there was more than one vertex found for PFParticle with ID " << pfparticlelist[i]->Self() <<
", storing only one" <<
std::endl;
4266 if (pfParticleVertices.size() > 0) {
4267 PFParticleData.
pfp_vertexID[i] = pfParticleVertices.at(0)->ID();
4268 vertexIDtoPFParticleIDMap.insert(std::make_pair(pfParticleVertices.at(0)->ID(), pfparticlelist[i]->Self()));
4272 std::cerr <<
"Warning: there was no vertex found for PFParticle with ID " << pfparticlelist[i]->Self() <<
std::endl;
4278 auto trackMapIter = pfParticleToTrackMap.find(pfparticlelist[i]);
4279 if (trackMapIter != pfParticleToTrackMap.end()) {
4282 if (pfParticleTracks.size() > 1)
4283 std::cerr <<
"Warning: there was more than one track found for PFParticle with ID " << pfparticlelist[i]->Self() <<
std::endl;
4285 if (pfParticleTracks.size() > 0) {
4286 PFParticleData.
pfp_trackID[i] = pfParticleTracks.at(0)->ID();
4287 trackIDtoPFParticleIDMap.insert(std::make_pair(pfParticleTracks.at(0)->ID(), pfparticlelist[i]->Self()));
4291 std::cerr <<
"Warning: there was no track found for track-like PFParticle with ID " << pfparticlelist[i]->Self() <<
std::endl;
4299 auto showerMapIter = pfParticleToShowerMap.find(pfparticlelist[i]);
4300 if (showerMapIter != pfParticleToShowerMap.end()) {
4303 if (pfParticleShowers.size() > 1)
4304 std::cerr <<
"Warning: there was more than one shower found for PFParticle with ID " << pfparticlelist[i]->Self() <<
std::endl;
4306 if (pfParticleShowers.size() > 0) {
4307 PFParticleData.
pfp_showerID[i] = pfParticleShowers.at(0)->ID();
4308 showerIDtoPFParticleIDMap.insert(std::make_pair(pfParticleShowers.at(0)->ID(), pfparticlelist[i]->Self()));
4312 std::cerr <<
"Warning: there was no shower found for shower-like PFParticle with ID " << pfparticlelist[i]->Self() <<
std::endl;
4318 auto clusterMapIter = pfParticleToClusterMap.find(pfparticlelist[i]);
4319 if (clusterMapIter != pfParticleToClusterMap.end()) {
4323 for (
size_t j = 0; j < pfParticleClusters.size(); ++j)
4324 PFParticleData.
pfp_clusterIDs[i][j] = pfParticleClusters[j]->ID();
4334 for (
size_t iShowerAlgo = 0; iShowerAlgo < NShowerAlgos; ++iShowerAlgo) {
4336 =
fData->GetShowerData(iShowerAlgo);
4337 std::vector<recob::Shower>
const* pShowers = showerList[iShowerAlgo];
4345 if(fmvapid.isValid()){
4346 for(
unsigned int iShower=0;iShower<showerHandle->size();++iShower){
4364 for (
unsigned int iTracker=0; iTracker < NTrackers; ++iTracker){
4367 size_t NTracks = tracklist[iTracker].size();
4370 TrackerData.
Clear();
4380 mf::LogError(
"AnalysisTree:limits") <<
"event has " << NTracks
4389 for(
size_t iTrk=0; iTrk < NTracks; ++iTrk){
4392 art::FindManyP<anab::T0> fmt0(trackListHandle[iTracker],evt,
fFlashT0FinderLabel[iTracker]);
4393 if (fmt0.isValid()){
4394 if(fmt0.at(iTrk).size()>0){
4395 if(fmt0.at(iTrk).size()>1)
4396 std::cerr <<
"\n Warning : more than one cosmic tag per track in module! assigning the first tag to the track" <<
fFlashT0FinderLabel[iTracker];
4397 TrackerData.
trkflashT0[iTrk] = fmt0.at(iTrk).at(0)->Time();
4402 art::FindManyP<anab::T0> fmmct0(trackListHandle[iTracker],evt,
fMCT0FinderLabel[iTracker]);
4403 if (fmmct0.isValid()){
4404 if(fmmct0.at(iTrk).size()>0){
4405 if(fmmct0.at(iTrk).size()>1)
4406 std::cerr <<
"\n Warning : more than one cosmic tag per track in module! assigning the first tag to the cluster" <<
fMCT0FinderLabel[iTracker];
4407 TrackerData.
trktrueT0[iTrk] = fmmct0.at(iTrk).at(0)->Time();
4413 if (fmct.isValid()){
4415 if (fmct.at(iTrk).size()>0){
4416 if(fmct.at(iTrk).size()>1)
4417 std::cerr <<
"\n Warning : more than one cosmic tag per track in module! assigning the first tag to the track" <<
fCosmicTaggerAssocLabel[iTracker];
4425 if (fmcnt.isValid()){
4427 if (fmcnt.at(iTrk).size()>0){
4428 if(fmcnt.at(iTrk).size()>1)
4429 std::cerr <<
"\n Warning : more than one containment tag per track in module! assigning the first tag to the track" <<
fContainmentTaggerAssocLabel[iTracker];
4437 art::FindManyP<anab::CosmicTag> fmbfm(trackListHandle[iTracker],evt,
fFlashMatchAssocLabel[iTracker]);
4438 if (fmbfm.isValid()){
4440 if (fmbfm.at(iTrk).size()>0){
4441 if(fmbfm.at(iTrk).size()>1)
4442 std::cerr <<
"\n Warning : more than one cosmic tag per track in module! assigning the first tag to the track" <<
fFlashMatchAssocLabel[iTracker];
4452 TVector3
pos, dir_start, dir_end,
end;
4454 double tlen = 0., mom = 0.;
4459 pos = track.
Vertex<TVector3>();
4462 end = track.
End<TVector3>();
4468 TrackID = track.
ID();
4470 double theta_xz = std::atan2(dir_start.X(), dir_start.Z());
4471 double theta_yz = std::atan2(dir_start.Y(), dir_start.Z());
4472 double dpos =
bdist(pos);
4473 double dend =
bdist(end);
4480 TrackerData.
trkendx[iTrk] = end.X();
4481 TrackerData.
trkendy[iTrk] = end.Y();
4482 TrackerData.
trkendz[iTrk] = end.Z();
4483 TrackerData.
trkendd[iTrk] = dend;
4484 TrackerData.
trktheta[iTrk] = dir_start.Theta();
4485 TrackerData.
trkphi[iTrk] = dir_start.Phi();
4494 TrackerData.
trkmom[iTrk] = mom;
4495 TrackerData.
trklen[iTrk] = tlen;
4496 TrackerData.
trkmomrange[iTrk] = trkm.GetTrackMomentum(tlen,13);
4501 auto mapIter = trackIDtoPFParticleIDMap.find(TrackID);
4502 if (mapIter != trackIDtoPFParticleIDMap.end()) {
4592 if(fmvapid.isValid()) {
4602 if (fmcal.isValid()){
4603 std::vector<const anab::Calorimetry*> calos = fmcal.at(iTrk);
4609 <<
" has " << calos.size() <<
" planes for calorimetry , only " 4612 for (
size_t ical = 0; ical<calos.size(); ++ical){
4613 if (!calos[ical])
continue;
4614 if (!calos[ical]->
PlaneID().isValid)
continue;
4615 int planenum = calos[ical]->PlaneID().Plane;
4616 if (planenum<0||planenum>2)
continue;
4617 TrackerData.
trkke[iTrk][planenum] = calos[ical]->KineticEnergy();
4618 TrackerData.
trkrange[iTrk][planenum] = calos[ical]->Range();
4620 TrackerData.
trkpitchc[iTrk][planenum]= calos[ical] -> TrkPitchC();
4621 const size_t NHits = calos[ical] ->
dEdx().size();
4622 TrackerData.
ntrkhits[iTrk][planenum] = (
int) NHits;
4627 <<
" has " << NHits <<
" hits on calorimetry plane #" << planenum
4632 for(
size_t iTrkHit = 0; iTrkHit < NHits && iTrkHit < TrackerData.
GetMaxHitsPerTrack(iTrk, planenum); ++iTrkHit) {
4633 TrackerData.
trkdedx[iTrk][planenum][iTrkHit] = (calos[ical] ->
dEdx())[iTrkHit];
4634 TrackerData.
trkdqdx[iTrk][planenum][iTrkHit] = (calos[ical] -> dQdx())[iTrkHit];
4635 TrackerData.
trkresrg[iTrk][planenum][iTrkHit] = (calos[ical] -> ResidualRange())[iTrkHit];
4636 TrackerData.
trktpc[iTrk][planenum][iTrkHit] = (calos[ical] ->
PlaneID()).
TPC;
4637 const auto& TrkPos = (calos[ical] -> XYZ())[iTrkHit];
4638 auto& TrkXYZ = TrackerData.
trkxyz[iTrk][planenum][iTrkHit];
4639 TrkXYZ[0] = TrkPos.X();
4640 TrkXYZ[1] = TrkPos.Y();
4641 TrkXYZ[2] = TrkPos.Z();
4659 art::FindManyP<recob::Hit> fmht(trackListHandle[iTracker], evt,
fTrackModuleLabel[iTracker]);
4660 std::vector< art::Ptr<recob::Hit> > allHits = fmht.at(iTrk);
4661 std::vector< art::Ptr<recob::Hit> > hits[
kNplanes];
4663 for(
size_t ah = 0; ah < allHits.size(); ++ah){
4665 allHits[ah]->
WireID().Plane < 3){
4666 hits[allHits[ah]->WireID().Plane].push_back(allHits[ah]);
4669 for (
size_t ipl = 0; ipl < 3; ++ipl){
4679 for (
auto ide: vide) {
4680 tote += ide->energy;
4690 if (TrackerData.
trkg4id[iTrk]>0){
4694 if (allHits.size()){
4695 std::vector<art::Ptr<recob::Hit> > all_hits;
4697 float totenergy = 0;
4698 if (evt.
get(allHits[0].id(), hithandle)){
4700 for(
size_t h = 0;
h < all_hits.size(); ++
h){
4703 std::vector<sim::IDE*> ides;
4707 for(
size_t e = 0;
e < eveIDs.size(); ++
e){
4709 if (eveIDs[
e].trackID==TrackerData.
trkg4id[iTrk]) totenergy += eveIDs[
e].energy;
4726 for (
unsigned int iVertexAlg=0; iVertexAlg < NVertexAlgos; ++iVertexAlg){
4729 size_t NVertices = vertexlist[iVertexAlg].size();
4734 VertexData.
nvtx = (short) NVertices;
4742 mf::LogError(
"AnalysisTree:limits") <<
"event has " << NVertices
4747 for (
size_t i = 0; i < NVertices && i <
kMaxVertices ; ++i){
4748 VertexData.
vtxId[i] = vertexlist[iVertexAlg][i]->ID();
4749 Double_t xyz[3] = {};
4750 vertexlist[iVertexAlg][i] -> XYZ(xyz);
4751 VertexData.
vtxx[i] = xyz[0];
4752 VertexData.
vtxy[i] = xyz[1];
4753 VertexData.
vtxz[i] = xyz[2];
4756 auto mapIter = vertexIDtoPFParticleIDMap.find(vertexlist[iVertexAlg][i]->
ID());
4757 if (mapIter != vertexIDtoPFParticleIDMap.end()) {
4767 art::FindMany<recob::PFParticle> fmPFParticle(vertexListHandle[iVertexAlg], evt,
fPFParticleModuleLabel);
4768 if(fmPFParticle.isValid()) {
4769 std::vector<const recob::PFParticle*> pfparticles = fmPFParticle.at(i);
4770 if(pfparticles.size() > 1)
4771 std::cerr <<
"Warning: more than one associated PFParticle found for a vertex. Only one stored in tree." <<
std::endl;
4772 if (pfparticles.size() == 0)
4789 art::FindOne<simb::MCFlux> find_mcflux(mctruthListHandle,
4794 fData->mcevts_truthcry = mclistcry.size();
4795 fData->cry_no_primaries = nCryPrimaries;
4797 for(Int_t iPartc = 0; iPartc < mctruthcry->NParticles(); ++iPartc){
4799 fData->cry_primaries_pdg[iPartc]=partc.PdgCode();
4800 fData->cry_Eng[iPartc]=partc.E();
4801 fData->cry_Px[iPartc]=partc.Px();
4802 fData->cry_Py[iPartc]=partc.Py();
4803 fData->cry_Pz[iPartc]=partc.Pz();
4804 fData->cry_P[iPartc]=partc.P();
4805 fData->cry_StartPointx[iPartc] = partc.Vx();
4806 fData->cry_StartPointy[iPartc] = partc.Vy();
4807 fData->cry_StartPointz[iPartc] = partc.Vz();
4808 fData->cry_StartPointt[iPartc] = partc.T();
4809 fData->cry_status_code[iPartc]=partc.StatusCode();
4810 fData->cry_mass[iPartc]=partc.Mass();
4811 fData->cry_trackID[iPartc]=partc.TrackId();
4812 fData->cry_ND[iPartc]=partc.NumberDaughters();
4813 fData->cry_mother[iPartc]=partc.Mother();
4819 fData->proto_no_primaries = nProtoPrimaries;
4820 for(Int_t iPartp = 0; iPartp < nProtoPrimaries; ++iPartp){
4823 fData->proto_isGoodParticle[iPartp] = (partp.Process() ==
"primary");
4824 fData->proto_vx[iPartp] = partp.Vx();
4825 fData->proto_vy[iPartp] = partp.Vy();
4826 fData->proto_vz[iPartp] = partp.Vz();
4827 fData->proto_t[iPartp] = partp.T();
4828 fData->proto_px[iPartp] = partp.Px();
4829 fData->proto_py[iPartp] = partp.Py();
4830 fData->proto_pz[iPartp] = partp.Pz();
4831 fData->proto_momentum[iPartp] = partp.P();
4832 fData->proto_energy[iPartp] = partp.E();
4833 fData->proto_pdg[iPartp] = partp.PdgCode();
4839 fData->mcevts_truth = mclist.size();
4840 if (
fData->mcevts_truth > 0){
4843 for(
unsigned int iList = 0; (iList < mclist.size()) && (neutrino_i <
kMaxTruth) ; ++iList){
4844 if (mclist[iList]->NeutrinoSet()){
4845 fData->nuPDG_truth[neutrino_i] = mclist[iList]->GetNeutrino().Nu().PdgCode();
4846 fData->ccnc_truth[neutrino_i] = mclist[iList]->GetNeutrino().CCNC();
4847 fData->mode_truth[neutrino_i] = mclist[iList]->GetNeutrino().Mode();
4848 fData->Q2_truth[neutrino_i] = mclist[iList]->GetNeutrino().QSqr();
4849 fData->W_truth[neutrino_i] = mclist[iList]->GetNeutrino().W();
4850 fData->X_truth[neutrino_i] = mclist[iList]->GetNeutrino().X();
4851 fData->Y_truth[neutrino_i] = mclist[iList]->GetNeutrino().Y();
4852 fData->hitnuc_truth[neutrino_i] = mclist[iList]->GetNeutrino().HitNuc();
4853 fData->enu_truth[neutrino_i] = mclist[iList]->GetNeutrino().Nu().E();
4854 fData->nuvtxx_truth[neutrino_i] = mclist[iList]->GetNeutrino().Nu().Vx();
4855 fData->nuvtxy_truth[neutrino_i] = mclist[iList]->GetNeutrino().Nu().Vy();
4856 fData->nuvtxz_truth[neutrino_i] = mclist[iList]->GetNeutrino().Nu().Vz();
4857 if (mclist[iList]->GetNeutrino().Nu().
P()){
4858 fData->nu_dcosx_truth[neutrino_i] = mclist[iList]->GetNeutrino().Nu().Px()/mclist[iList]->GetNeutrino().Nu().P();
4859 fData->nu_dcosy_truth[neutrino_i] = mclist[iList]->GetNeutrino().Nu().Py()/mclist[iList]->GetNeutrino().Nu().P();
4860 fData->nu_dcosz_truth[neutrino_i] = mclist[iList]->GetNeutrino().Nu().Pz()/mclist[iList]->GetNeutrino().Nu().P();
4862 fData->lep_mom_truth[neutrino_i] = mclist[iList]->GetNeutrino().Lepton().P();
4863 if (mclist[iList]->GetNeutrino().Lepton().
P()){
4864 fData->lep_dcosx_truth[neutrino_i] = mclist[iList]->GetNeutrino().Lepton().Px()/mclist[iList]->GetNeutrino().Lepton().P();
4865 fData->lep_dcosy_truth[neutrino_i] = mclist[iList]->GetNeutrino().Lepton().Py()/mclist[iList]->GetNeutrino().Lepton().P();
4866 fData->lep_dcosz_truth[neutrino_i] = mclist[iList]->GetNeutrino().Lepton().Pz()/mclist[iList]->GetNeutrino().Lepton().P();
4876 if (find_mcflux.isValid()) {
4877 auto flux_maybe_ref = find_mcflux.at(iList);
4878 if (flux_maybe_ref.isValid()) {
4879 auto flux_ref = flux_maybe_ref.ref();
4880 fData->vx_flux[neutrino_i] = flux_ref.fvx;
4881 fData->vy_flux[neutrino_i] = flux_ref.fvy;
4882 fData->vz_flux[neutrino_i] = flux_ref.fvz;
4883 fData->pdpx_flux[neutrino_i] = flux_ref.fpdpx;
4884 fData->pdpy_flux[neutrino_i] = flux_ref.fpdpy;
4885 fData->pdpz_flux[neutrino_i] = flux_ref.fpdpz;
4886 fData->ppdxdz_flux[neutrino_i] = flux_ref.fppdxdz;
4887 fData->ppdydz_flux[neutrino_i] = flux_ref.fppdydz;
4888 fData->pppz_flux[neutrino_i] = flux_ref.fpppz;
4890 fData->ptype_flux[neutrino_i] = flux_ref.fptype;
4891 fData->ppvx_flux[neutrino_i] = flux_ref.fppvx;
4892 fData->ppvy_flux[neutrino_i] = flux_ref.fppvy;
4893 fData->ppvz_flux[neutrino_i] = flux_ref.fppvz;
4894 fData->muparpx_flux[neutrino_i] = flux_ref.fmuparpx;
4895 fData->muparpy_flux[neutrino_i] = flux_ref.fmuparpy;
4896 fData->muparpz_flux[neutrino_i] = flux_ref.fmuparpz;
4897 fData->mupare_flux[neutrino_i] = flux_ref.fmupare;
4899 fData->tgen_flux[neutrino_i] = flux_ref.ftgen;
4900 fData->tgptype_flux[neutrino_i] = flux_ref.ftgptype;
4901 fData->tgppx_flux[neutrino_i] = flux_ref.ftgppx;
4902 fData->tgppy_flux[neutrino_i] = flux_ref.ftgppy;
4903 fData->tgppz_flux[neutrino_i] = flux_ref.ftgppz;
4904 fData->tprivx_flux[neutrino_i] = flux_ref.ftprivx;
4905 fData->tprivy_flux[neutrino_i] = flux_ref.ftprivy;
4906 fData->tprivz_flux[neutrino_i] = flux_ref.ftprivz;
4908 fData->dk2gen_flux[neutrino_i] = flux_ref.fdk2gen;
4909 fData->gen2vtx_flux[neutrino_i] = flux_ref.fgen2vtx;
4911 fData->tpx_flux[neutrino_i] = flux_ref.ftpx;
4912 fData->tpy_flux[neutrino_i] = flux_ref.ftpy;
4913 fData->tpz_flux[neutrino_i] = flux_ref.ftpz;
4914 fData->tptype_flux[neutrino_i] = flux_ref.ftptype;
4921 if (mctruth->NeutrinoSet()){
4923 fData->genie_no_primaries = mctruth->NParticles();
4925 size_t StoreParticles =
std::min((
size_t)
fData->genie_no_primaries,
fData->GetMaxGeniePrimaries());
4926 if (
fData->genie_no_primaries > (
int) StoreParticles) {
4930 <<
fData->genie_no_primaries <<
" MC particles, only " 4931 << StoreParticles <<
" stored in tree";
4933 for(
size_t iPart = 0; iPart < StoreParticles; ++iPart){
4935 fData->genie_primaries_pdg[iPart]=part.PdgCode();
4936 fData->genie_Eng[iPart]=part.E();
4937 fData->genie_Px[iPart]=part.Px();
4938 fData->genie_Py[iPart]=part.Py();
4939 fData->genie_Pz[iPart]=part.Pz();
4940 fData->genie_P[iPart]=part.P();
4941 fData->genie_status_code[iPart]=part.StatusCode();
4942 fData->genie_mass[iPart]=part.Mass();
4943 fData->genie_trackID[iPart]=part.TrackId();
4944 fData->genie_ND[iPart]=part.NumberDaughters();
4945 fData->genie_mother[iPart]=part.Mother();
4953 fData->no_mcshowers = nMCShowers;
4956 imcshwr != mcshowerh->end(); ++imcshwr) {
4965 fData->mcshwr_endX[shwr] = mcshwr.
End().
X();
4966 fData->mcshwr_endY[shwr] = mcshwr.
End().
Y();
4967 fData->mcshwr_endZ[shwr] = mcshwr.
End().
Z();
4969 fData->mcshwr_isEngDeposited[shwr] = 1;
4977 fData->mcshwr_dEdx[shwr] = mcshwr.
dEdx();
4983 fData->mcshwr_isEngDeposited[shwr] = 0;
5004 fData->mcshwr_Process.resize(shwr);
5005 fData->mcshwr_MotherProcess.resize(shwr);
5006 fData->mcshwr_AncestorProcess.resize(shwr);
5011 fData->no_mctracks = nMCTracks;
5015 TLorentzVector tpcstart, tpcend, tpcmom;
5016 double plen =
driftedLength(detProp, mctrk, tpcstart, tpcend, tpcmom);
5024 fData->mctrk_endX[trk] = mctrk.
End().
X();
5025 fData->mctrk_endY[trk] = mctrk.
End().
Y();
5026 fData->mctrk_endZ[trk] = mctrk.
End().
Z();
5046 fData->mctrk_len_drifted[trk] = plen;
5049 fData->mctrk_startX_drifted[trk] = tpcstart.X();
5050 fData->mctrk_startY_drifted[trk] = tpcstart.Y();
5051 fData->mctrk_startZ_drifted[trk] = tpcstart.Z();
5052 fData->mctrk_endX_drifted[trk] = tpcend.X();
5053 fData->mctrk_endY_drifted[trk] = tpcend.Y();
5054 fData->mctrk_endZ_drifted[trk] = tpcend.Z();
5055 fData->mctrk_p_drifted[trk] = tpcmom.Vect().Mag();
5056 fData->mctrk_px_drifted[trk] = tpcmom.X();
5057 fData->mctrk_py_drifted[trk] = tpcmom.Y();
5058 fData->mctrk_pz_drifted[trk] = tpcmom.Z();
5063 fData->mctrk_Process.resize(trk);
5064 fData->mctrk_MotherProcess.resize(trk);
5065 fData->mctrk_AncestorProcess.resize(trk);
5072 const sim::ParticleList& plist = pi_serv->ParticleList();
5077 size_t geant_particle=0;
5082 std::map<int, size_t> TrackIDtoIndex;
5083 std::vector<int> gpdg;
5084 std::vector<int> gmother;
5085 for(
size_t iPart = 0; (iPart < plist.size()) && (itPart != pend); ++iPart){
5089 <<
"GEANT particle #" << iPart <<
" returned a null pointer";
5093 bool isPrimary = pPart->
Process() == pri;
5095 TrackIDtoIndex.emplace(TrackID, iPart);
5096 gpdg.push_back(pPart->
PdgCode());
5097 gmother.push_back(pPart->
Mother());
5098 if (iPart < fData->GetMaxGEANTparticles()) {
5099 if (pPart->
E()<
fG4minE&&(!isPrimary))
continue;
5100 if (isPrimary) ++primary;
5102 TLorentzVector mcstart, mcend, mcstartdrifted, mcenddrifted;
5103 unsigned int pstarti, pendi, pstartdriftedi, penddriftedi;
5104 double plen =
length(*pPart, mcstart, mcend, pstarti, pendi);
5105 double plendrifted =
driftedLength(detProp, *pPart, mcstartdrifted, mcenddrifted, pstartdriftedi, penddriftedi);
5107 bool isActive = plen != 0;
5108 bool isDrifted = plendrifted!= 0;
5111 fData->process_primary[geant_particle] =
int(isPrimary);
5117 fData->Eng[geant_particle]=pPart->
E();
5118 fData->EndE[geant_particle]=pPart->
EndE();
5119 fData->Mass[geant_particle]=pPart->
Mass();
5120 fData->Px[geant_particle]=pPart->
Px();
5121 fData->Py[geant_particle]=pPart->
Py();
5122 fData->Pz[geant_particle]=pPart->
Pz();
5124 fData->StartPointx[geant_particle]=pPart->
Vx();
5125 fData->StartPointy[geant_particle]=pPart->
Vy();
5126 fData->StartPointz[geant_particle]=pPart->
Vz();
5127 fData->StartT[geant_particle] = pPart->
T();
5131 fData->EndT[geant_particle] = pPart->
EndT();
5134 fData->theta_xz[geant_particle] = std::atan2(pPart->
Px(), pPart->
Pz());
5135 fData->theta_yz[geant_particle] = std::atan2(pPart->
Py(), pPart->
Pz());
5136 fData->pathlen[geant_particle] = plen;
5137 fData->pathlen_drifted[geant_particle] = plendrifted;
5139 fData->inTPCActive[geant_particle] =
int(isActive);
5140 fData->inTPCDrifted[geant_particle] =
int(isDrifted);
5143 fData->origin[geant_particle] = mc_truth->
Origin();
5144 fData->MCTruthIndex[geant_particle] = mc_truth.
key();
5147 fData->StartPointx_tpcAV[geant_particle] = mcstart.X();
5148 fData->StartPointy_tpcAV[geant_particle] = mcstart.Y();
5149 fData->StartPointz_tpcAV[geant_particle] = mcstart.Z();
5150 fData->StartT_tpcAV[geant_particle] = mcstart.T();
5151 fData->StartE_tpcAV[geant_particle] = pPart->
E(pstarti);
5152 fData->StartP_tpcAV[geant_particle] = pPart->
P(pstarti);
5153 fData->StartPx_tpcAV[geant_particle] = pPart->
Px(pstarti);
5154 fData->StartPy_tpcAV[geant_particle] = pPart->
Py(pstarti);
5155 fData->StartPz_tpcAV[geant_particle] = pPart->
Pz(pstarti);
5156 fData->EndPointx_tpcAV[geant_particle] = mcend.X();
5157 fData->EndPointy_tpcAV[geant_particle] = mcend.Y();
5158 fData->EndPointz_tpcAV[geant_particle] = mcend.Z();
5159 fData->EndT_tpcAV[geant_particle] = mcend.T();
5160 fData->EndE_tpcAV[geant_particle] = pPart->
E(pendi);
5161 fData->EndP_tpcAV[geant_particle] = pPart->
P(pendi);
5162 fData->EndPx_tpcAV[geant_particle] = pPart->
Px(pendi);
5163 fData->EndPy_tpcAV[geant_particle] = pPart->
Py(pendi);
5164 fData->EndPz_tpcAV[geant_particle] = pPart->
Pz(pendi);
5167 fData->StartPointx_drifted[geant_particle] = mcstartdrifted.X();
5168 fData->StartPointy_drifted[geant_particle] = mcstartdrifted.Y();
5169 fData->StartPointz_drifted[geant_particle] = mcstartdrifted.Z();
5170 fData->StartT_drifted[geant_particle] = mcstartdrifted.T();
5171 fData->StartE_drifted[geant_particle] = pPart->
E(pstartdriftedi);
5172 fData->StartP_drifted[geant_particle] = pPart->
P(pstartdriftedi);
5173 fData->StartPx_drifted[geant_particle] = pPart->
Px(pstartdriftedi);
5174 fData->StartPy_drifted[geant_particle] = pPart->
Py(pstartdriftedi);
5175 fData->StartPz_drifted[geant_particle] = pPart->
Pz(pstartdriftedi);
5176 fData->EndPointx_drifted[geant_particle] = mcenddrifted.X();
5177 fData->EndPointy_drifted[geant_particle] = mcenddrifted.Y();
5178 fData->EndPointz_drifted[geant_particle] = mcenddrifted.Z();
5179 fData->EndT_drifted[geant_particle] = mcenddrifted.T();
5180 fData->EndE_drifted[geant_particle] = pPart->
E(penddriftedi);
5181 fData->EndP_drifted[geant_particle] = pPart->
P(penddriftedi);
5182 fData->EndPx_drifted[geant_particle] = pPart->
Px(penddriftedi);
5183 fData->EndPy_drifted[geant_particle] = pPart->
Py(penddriftedi);
5184 fData->EndPz_drifted[geant_particle] = pPart->
Pz(penddriftedi);
5189 unsigned short nAD = 0;
5196 const std::vector<sim::AuxDetIDE>& setOfIDEs =
c->AuxDetIDEs();
5203 setOfIDEs.begin(), setOfIDEs.end(),
5206 if (iIDE == setOfIDEs.end())
continue;
5214 for(
const auto& adtracks: setOfIDEs) {
5215 if( fabs(adtracks.trackID) ==
TrackID )
5216 totalE += adtracks.energyDeposited;
5221 fData->AuxDetID[geant_particle][nAD] =
c->AuxDetID();
5222 fData->entryX[geant_particle][nAD] = iIDE->entryX;
5223 fData->entryY[geant_particle][nAD] = iIDE->entryY;
5224 fData->entryZ[geant_particle][nAD] = iIDE->entryZ;
5225 fData->entryT[geant_particle][nAD] = iIDE->entryT;
5226 fData->exitX[geant_particle][nAD] = iIDE->exitX;
5227 fData->exitY[geant_particle][nAD] = iIDE->exitY;
5228 fData->exitZ[geant_particle][nAD] = iIDE->exitZ;
5229 fData->exitT[geant_particle][nAD] = iIDE->exitT;
5230 fData->exitPx[geant_particle][nAD] = iIDE->exitMomentumX;
5231 fData->exitPy[geant_particle][nAD] = iIDE->exitMomentumY;
5232 fData->exitPz[geant_particle][nAD] = iIDE->exitMomentumZ;
5233 fData->CombinedEnergyDep[geant_particle][nAD] = totalE;
5237 fData->NAuxDets[geant_particle] = nAD;
5242 <<
"particle #" << iPart
5243 <<
" touches " << nAD <<
" auxiliary detector cells, only " 5244 <<
kMaxAuxDets <<
" of them are saved in the tree";
5250 else if (iPart ==
fData->GetMaxGEANTparticles()) {
5254 << plist.size() <<
" MC particles, only " 5255 <<
fData->GetMaxGEANTparticles() <<
" will be stored in tree";
5259 fData->geant_list_size_in_tpcAV = active;
5260 fData->no_primaries = primary;
5261 fData->geant_list_size = geant_particle;
5262 fData->processname.resize(geant_particle);
5265 <<
fData->geant_list_size <<
" GEANT particles (" 5266 <<
fData->geant_list_size_in_tpcAV <<
" in AV), " 5267 <<
fData->no_primaries <<
" primaries, " 5268 <<
fData->genie_no_primaries <<
" GENIE particles";
5270 FillWith(
fData->MergedId, 0);
5305 for(Int_t prt = 0; prt < nProtoPrimaries; ++prt){
5306 for(Int_t gnt = 0; gnt <
fData->geant_list_size; ++gnt){
5308 if(
fData->proto_pdg[prt] ==
fData->pdg[gnt] && std::fabs(
fData->proto_px[prt] -
fData->Px[gnt]) < 0.0001){
5309 fData->proto_geantTrackID[prt] =
fData->TrackId[gnt];
5310 fData->proto_geantIndex[prt] = gnt;
5319 fData->taulife = detProp.ElectronLifetime();
5327 <<
"Tree data structure contains:" 5328 <<
"\n - " <<
fData->no_hits <<
" hits (" <<
fData->GetMaxHits() <<
")" 5329 <<
"\n - " <<
fData->genie_no_primaries <<
" genie primaries (" <<
fData->GetMaxGeniePrimaries() <<
")" 5330 <<
"\n - " <<
fData->geant_list_size <<
" GEANT particles (" <<
fData->GetMaxGEANTparticles() <<
"), " 5331 <<
fData->no_primaries <<
" primaries" 5332 <<
"\n - " <<
fData->geant_list_size_in_tpcAV <<
" GEANT particles in AV " 5333 <<
"\n - " << ((
int)
fData->kNTracker) <<
" trackers:" 5336 size_t iTracker = 0;
5337 for (
auto tracker =
fData->TrackData.cbegin();
5338 tracker !=
fData->TrackData.cend(); ++tracker, ++iTracker
5342 <<
" tracks (" << tracker->GetMaxTracks() <<
")" 5344 for (
int iTrk = 0; iTrk < tracker->ntracks; ++iTrk) {
5345 logStream <<
"\n [" << iTrk <<
"] "<< tracker->ntrkhits[iTrk][0];
5346 for (
size_t ipl = 1; ipl < tracker->GetMaxPlanesPerTrack(iTrk); ++ipl)
5347 logStream <<
" + " << tracker->ntrkhits[iTrk][ipl];
5348 logStream <<
" hits (" << tracker->GetMaxHitsPerTrack(iTrk, 0);
5349 for (
size_t ipl = 1; ipl < tracker->GetMaxPlanesPerTrack(iTrk); ++ipl)
5350 logStream <<
" + " << tracker->GetMaxHitsPerTrack(iTrk, ipl);
5360 MF_LOG_DEBUG(
"AnalysisTreeStructure") <<
"Freeing the tree data structure";
5368 const std::map<Short_t, Short_t> &showerIDtoPFParticleIDMap
5375 TVector3
const& dir_start = shower.
Direction();
5385 if (fSavePFParticleInfo) {
5386 auto mapIter = showerIDtoPFParticleIDMap.find(shower.
ID());
5387 if (mapIter != showerIDtoPFParticleIDMap.end()) {
5411 const std::map<Short_t, Short_t> &showerIDtoPFParticleIDMap
5414 const size_t NShowers = showers.size();
5431 mf::LogError(
"AnalysisTree:limits") <<
"event has " << NShowers
5432 <<
" " << showerData.
Name() <<
" showers, only " 5441 showerData.
nshowers = (Short_t) NShowers;
5444 for (
size_t i = 0; i < NShowers; ++i)
FillShower(showerData, i, showers[i], fSavePFParticleInfo, showerIDtoPFParticleIDMap);
5458 std::map<int,double> trkide;
5460 for(
size_t h = 0;
h < hits.size(); ++
h){
5463 std::vector<sim::IDE> ides;
5467 for(
size_t e = 0;
e < eveIDs.size(); ++
e){
5469 trkide[eveIDs[
e].trackID] += eveIDs[
e].energy;
5477 if ((ii->second)>maxe){
5479 trackid = ii->first;
5504 if (result<-1) result = -1;
5526 const sim::MCTrack& mctrack, TLorentzVector& tpcstart, TLorentzVector& tpcend, TLorentzVector& tpcmom){
5527 auto const* geom = lar::providerFrom<geo::Geometry>();
5531 double xrange[2] = {DBL_MAX, -DBL_MAX };
5532 for (
unsigned int c=0;
c<geom->Ncryostats(); ++
c) {
5533 for (
unsigned int t=0;
t<geom->NTPC(
c); ++
t) {
5545 for(
auto step: mctrack) {
5555 double newX =
step.X()+(
step.T()*vDrift);
5556 if (newX < xrange[0] || newX > xrange[1])
continue;
5561 tpcmom =
step.Momentum();
5566 result += disp.Mag();
5577 const simb::MCParticle&
p, TLorentzVector& start, TLorentzVector&
end,
unsigned int &starti,
unsigned int &endi)
5579 auto const* geom = lar::providerFrom<geo::Geometry>();
5583 double xrange[2] = {DBL_MAX, -DBL_MAX };
5584 for (
unsigned int c=0;
c<geom->Ncryostats(); ++
c) {
5585 for (
unsigned int t=0;
t<geom->NTPC(
c); ++
t) {
5607 double newX = p.
Vx(i)+(p.
T(i)*vDrift);
5608 if (newX < xrange[0] || newX > xrange[1])
continue;
5609 TLorentzVector
pos(newX,p.
Vy(i),p.
Vz(i),p.
T());
5617 result += disp.Mag();
5643 result += disp.Mag();
def analyze(root, level, gtrees, gbranches, doprint)
double E(const int i=0) const
std::vector< Float_t > Mass
std::vector< Float_t > mctrk_p_drifted
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
std::vector< Int_t > mcshwr_AncestorTrkId
code to link reconstructed objects back to the MC truth information
void DestroyData()
Destroy the local buffers (existing branches will point to invalid address!)
void XYZ(double *xyz) const
Legacy method to access vertex position, preserved to avoid breaking code. Please try to use Vertex::...
VertexData_t< Float_t > vtxz
std::vector< Float_t > mctrk_endZ_drifted
HitData_t< Float_t > trkdedx
std::vector< Int_t > mctrk_origin
void endSubRun(const art::SubRun &sr)
TrackData_t< Short_t > trkncosmictags_flashmatch
std::vector< Float_t > cry_mass
std::vector< Int_t > mctrk_AncestorTrkId
TrackData_t< Short_t > trkncosmictags_containmenttagger
bool fSaveRawDigitInfo
whether to extract and save Hit information
std::vector< Float_t > EndE_drifted
size_t GetMaxDaughtersPerPFParticle(int=0) const
std::vector< Float_t > mcshwr_endX
bool hasPandoraNuVertexInfo() const
Returns whether we have Pandora Nu Vertex data.
std::vector< Float_t > StartPointy_tpcAV
unsigned int NumberTrajectoryPoints() const
void CreateTree(bool bClearData=false)
Create the output tree and the data structures, if needed.
constexpr int kMaxNDaughtersPerPFP
bool hasSpacePointSolverInfo() const
Returns whether we have SpacePointSolver data.
TrackData_t< Float_t > trkenddcosz
const VertexDataStruct & GetVertexData(size_t iVertex) const
const TVector3 & ShowerStart() const
size_t GetMaxGeniePrimaries() const
Returns the number of GENIE primaries for which memory is allocated.
const TLorentzVector & Position(const int i=0) const
Short_t pfp_numNeutrinos
the number of reconstructed neutrinos
std::vector< Float_t > SpacePointChisq
simb::Origin_t Origin() const
std::vector< Float_t > mcshwr_MotherendY
TrackData_t< Float_t > trkthetaxz
HitData_t< Int_t > trktpc
constexpr std::uint32_t timeLow() const
std::vector< Float_t > mctrk_endY
std::vector< Float_t > mctrk_MotherstartX
PFParticleDataStruct(size_t maxPFParticles=0)
Creates a PFParticle data structure allowing up to maxPFParticles PFParticles.
const Data_t * begin() const
TrackData_t< Short_t > trkcosmictype_flashmatch
TrackData_t< Float_t > trkflashT0
double VertexMomentum() const
double driftedLength(detinfo::DetectorPropertiesData const &detProp, const simb::MCParticle &part, TLorentzVector &start, TLorentzVector &end, unsigned int &starti, unsigned int &endi)
PlaneData_t< Float_t > trkpidchipr
const MCStep & End() const
ShowerData_t< Float_t > shwr_startx
startx of shower
double Py(const int i=0) const
PlaneData_t< Float_t > trkpidchipi
float SummedADCaverage() const
Returns the average signal ADC counts of the cluster hits.
float IntegralAverage() const
Returns the average charge of the cluster hits.
std::vector< Float_t > EndPointy_drifted
bool fSavePFParticleInfo
whether to extract and save Shower information
TrackData_t< Float_t > trkenddcosx
size_t GetMaxVertices() const
std::vector< Float_t > genie_mass
std::vector< Float_t > SpacePointY
std::vector< Float_t > EndT_tpcAV
bool hasCnnInfo() const
Returns whether we have CNN data.
std::vector< Int_t > MergedId
std::vector< Float_t > SpacePointQ
Energy deposited on a readout channel by simulated tracks.
constexpr int kMaxTrackHits
std::vector< Int_t > cry_mother
Short_t pfp_neutrinoIDs[kMaxNPFPNeutrinos]
HitData_t< Float_t > trkresrg
std::string fMCTrackModuleLabel
constexpr int kMaxNPFPNeutrinos
const TLorentzVector & EndPosition() const
std::vector< Float_t > EndPointx_drifted
std::string fPOTModuleLabel
std::vector< Float_t > mcshwr_startY
void SetAddresses(TTree *pTree, std::string tracker, bool isCosmics)
PFParticleDataStruct & GetPFParticleData()
std::vector< std::string > fCosmicTaggerAssocLabel
whether to extract and save CNN information
size_t MaxPFParticles
maximum number of storable PFParticles
AuxDetMCData_t< Float_t > entryX
Entry X position of particle into AuxDet.
PlaneData_t< Float_t > trkefftruth
std::vector< Float_t > Px
std::vector< Float_t > EndPx_tpcAV
size_t GetNShowerAlgos() const
Returns the number of trackers for which data structures are allocated.
std::vector< Float_t > mctrk_AncestorendX
std::vector< Float_t > Eng
ShowerData_t< Float_t > shwr_startz
startz of shower
std::vector< Int_t > genie_ND
TrackData_t< Float_t > trkstartd
static constexpr size_t size()
begin/end interface
std::map< art::Ptr< recob::PFParticle >, ClusterVector > PFParticlesToClusters
std::string fGenieGenModuleLabel
TrackData_t< Float_t > trkmommschi2
PlaneData_t< Float_t > shwr_dedx
dE/dx of the shower per plane
ClusterData_t< Short_t > pfp_clusterIDs
the IDs of any associated clusters
A wrapper to a C array (needed to embed an array into a vector)
constexpr unsigned short kMaxAuxDets
max number of auxiliary detector cells per MC particle
unsigned int TrackID() const
static bool IsNeutrino(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as a neutrino.
ShowerData_t< Float_t > shwr_pidmvaphoton
bool hasShowerInfo() const
Returns whether we have Shower data.
bool fSaveAuxDetInfo
whether to extract and save auxiliary detector data
std::vector< Float_t > EndPz_drifted
std::vector< Float_t > EndPy_tpcAV
std::string fOpFlashModuleLabel
bool hasProtoInfo() const
Returns whether we have protoDUNE beam primaries.
std::vector< Float_t > mctrk_endY_drifted
Handle< PROD > getHandle(SelectorBase const &) const
std::vector< Int_t > cry_status_code
std::vector< Int_t > cry_trackID
void SetVertexAddresses(size_t iVertexAlg)
Creates a simple ROOT tree with tracking and calorimetry information.
void SetShowerAlgos(std::vector< std::string > const &ShowerAlgos)
Allocates data structures for the given number of trackers (no Clear())
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::vector< Float_t > SpacePointErrY
const simb::MCParticle * TrackIdToParticle_P(int id) const
const std::string & AncestorProcess() const
PFParticleData_t< Short_t > pfp_showerID
the ID of the shower object corresponding to this PFParticle, if isShower
std::vector< Float_t > mctrk_AncestorendZ
size_t GetMaxShowers() const
ShowerData_t< Float_t > shwr_pidmvapr
std::vector< T > VertexData_t
std::vector< Float_t > StartT
void SetShowerAddresses(size_t iShower)
AuxDetMCData_t< Float_t > exitX
Exit X position of particle out of AuxDet.
std::vector< Int_t > genie_trackID
TrackData_t< int > trkg4id
constexpr std::uint32_t timeHigh() const
simb::Origin_t Origin() const
std::vector< Float_t > cry_Pz
TrackData_t< Short_t > trkcosmictype_containmenttagger
TrackDataStruct()
Creates an empty tracker data structure.
TrackData_t< Short_t > trkId
void SetBits(unsigned int setbits, bool unset=false)
Sets the specified bits.
std::vector< Float_t > mctrk_pz_drifted
std::vector< T > ShowerData_t
Geometry information for a single TPC.
std::vector< Float_t > proto_energy
VertexData_t< Short_t > vtxId
const std::vector< double > & Energy() const
unsigned int bits
complementary information
TrackDataStruct & GetTrackerData(size_t iTracker)
double Px(const int i=0) const
std::vector< Float_t > mcshwr_CombEngPx
std::vector< Float_t > StartT_drifted
std::vector< std::string > mctrk_Process
bool hasMCTrackInfo() const
Returns whether we have MCTrack data.
std::vector< Float_t > mctrk_AncestorstartZ
AuxDetMCData_t< Short_t > AuxDetID
Which AuxDet this particle went through.
bool fSaveCaloCosmics
save calorimetry information for cosmics
std::vector< Float_t > StartPx_tpcAV
ChannelGroupService::Name Name
const MCStep & MotherEnd() const
unsigned int AncestorTrackID() const
std::vector< BoxedArray< T[kNplanes][kMaxTrackHits][3]>> HitCoordData_t
std::vector< Float_t > mctrk_AncestorstartX
bool hasMCShowerInfo() const
Returns whether we have MCShower data.
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
std::vector< Float_t > EndE_tpcAV
std::vector< std::string > mctrk_AncestorProcess
float StartWire() const
Returns the wire coordinate of the start of the cluster.
std::string fSpacePointSolverModuleLabel
Vector_t VertexDirection() const
std::vector< std::string > mcshwr_AncestorProcess
static bool IsShower(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as shower-like.
std::vector< Int_t > mcshwr_Ancestorpdg
VertexDataStruct & GetVertexData(size_t iVertex)
bool hasPFParticleInfo() const
Returns whether we have PFParticle data.
std::vector< Float_t > proto_vx
std::vector< std::string > fMVAPIDShowerModuleLabel
bool get(SelectorBase const &, Handle< PROD > &result) const
std::string fG4ModuleLabel
AuxDetMCData_t< Float_t > exitPz
Exit z momentum of particle out of AuxDet.
std::vector< const sim::IDE * > TrackIdToSimIDEs_Ps(int const &id) const
std::vector< Float_t > mcshwr_MotherstartX
std::vector< Float_t > proto_vy
double Mass(Resonance_t res)
resonance mass (GeV)
void SetTrackers(size_t nTrackers)
Allocates data structures for the given number of trackers (no Clear())
ShowerData_t< Float_t > shwr_pidmvae
std::vector< Float_t > phi
TrackData_t< Short_t > trkcosmictype_tagger
std::pair< float, std::string > P
Information about charge reconstructed in the active volume.
TrackData_t< Short_t > trkpidbestplane
int PdgCode() const
Return the type of particle as a PDG ID.
TrackDataStruct(size_t maxTracks)
Creates a tracker data structure allowing up to maxTracks tracks.
void SetPFParticleAddress()
std::vector< Float_t > cry_StartPointy
Set of hits with a 2D structure.
TrackData_t< Float_t > trkcompleteness
std::vector< Float_t > Pz
std::vector< art::Ptr< recob::Shower > > ShowerVector
TrackData_t< Float_t > trkmom
void ResizeGenie(int nPrimaries)
Resize the data strutcure for Genie primaries.
TrackData_t< Float_t > trkpurity
TrackData_t< int > trkorig
float EndTick() const
Returns the tick coordinate of the end of the cluster.
std::vector< T > TrackData_t
std::vector< Float_t > mctrk_px_drifted
std::vector< Float_t > SpacePointX
bool hasVertexInfo() const
Returns whether we have Vertex data.
std::vector< Float_t > EndPointy_tpcAV
float MultipleHitDensity() const
Density of wires in the cluster with more than one hit.
TrackData_t< Float_t > trkpidmvapr
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
Cluster finding and building.
ShowerData_t< Float_t > shwr_startdcosy
Y directional cosine at start of shower.
std::vector< Float_t > cry_P
std::vector< Int_t > MCTruthIndex
std::string fCryGenModuleLabel
std::string Process() const
std::vector< Float_t > mcshwr_endY
std::vector< std::string > fContainmentTaggerAssocLabel
int AncestorPdgCode() const
ShowerData_t< Float_t > shwr_length
Shower length.
std::vector< std::string > mcshwr_MotherProcess
TrackData_t< Float_t > trktrueT0
std::vector< Int_t > mctrk_Ancestorpdg
bool hasFlashInfo() const
Returns whether we have Flash data.
constexpr int kMaxExternCounts
bool isValid() const
Returns if the cluster is valid (that is, if its ID is not invalid)
const MCStep & End() const
float StartAngle() const
Returns the starting angle of the cluster.
ShowerData_t< Float_t > shwr_starty
starty of shower
std::vector< std::string > fMCT0FinderLabel
std::vector< Float_t > StartPointx_tpcAV
std::map< art::Ptr< recob::PFParticle >, TrackVector > PFParticlesToTracks
size_t GetMaxHits() const
Returns the number of hits for which memory is allocated.
std::vector< std::string > fVertexModuleLabel
int NumberDaughters() const
Class def header for mcstep data container.
std::vector< Float_t > mctrk_MotherendX
VertexDataStruct(size_t maxVertices)
unsigned int MotherTrackID() const
std::vector< Float_t > StartPointz
unsigned int triggernumber
void ResizeCry(int nPrimaries)
Resize the data strutcure for Cry primaries.
bool hasAuxDetector() const
Returns whether we have auxiliary detector data.
TrackData_t< Float_t > trkthetayz
object containing MC flux information
art framework interface to geometry description
std::vector< Float_t > mctrk_AncestorstartY
AnalysisTreeDataStruct(size_t nTrackers=0, size_t nVertexAlgos=0, std::vector< std::string > const &ShowerAlgos={})
Constructor; clears all fields.
TrackData_t< Float_t > trkpidmvamu
std::map< art::Ptr< recob::PFParticle >, VertexVector > PFParticlesToVertices
std::vector< Float_t > StartPz_drifted
std::vector< BoxedArray< T[kMaxNClustersPerPFP]>> ClusterData_t
TrackData_t< Float_t > trkcosmicscore_flashmatch
std::string fCalDataModuleLabel
total_extent<T>::value has the total number of elements of an array
std::vector< Int_t > proto_geantTrackID
std::vector< Float_t > mcshwr_startZ
std::vector< Float_t > mcshwr_AncestorstartX
std::vector< Float_t > mctrk_endX_drifted
std::vector< BoxedArray< T[kNplanes][kMaxShowerHits]>> HitData_t
void ClearLocalData()
Clear all fields if this object (not the tracker algorithm data)
ShowerDataStruct & GetShowerData(size_t iShower)
bool hasGenieInfo() const
Returns whether we have Genie data.
std::vector< Float_t > mcshwr_startX
void SetAddresses(TTree *pTree, std::string tracker, bool isCosmics)
void ResizeGEANT(int nParticles)
Resize the data strutcure for GEANT particles.
std::vector< Float_t > cry_Eng
constexpr int kMaxTrackers
QuadExpr operator-(double v, const QuadExpr &e)
static constexpr value_type value
std::vector< Float_t > EndP_drifted
TrackData_t< Float_t > trkendx
bool isValid() const noexcept
constexpr int kMaxVertexAlgos
bool hasCryInfo() const
Returns whether we have Cry data.
std::vector< std::string > fParticleIDModuleLabel
PlaneData_t< Float_t > shwr_mipEng
Total MIP energy of the shower per plane.
std::vector< Int_t > mcshwr_TrackId
std::vector< Int_t > mcshwr_isEngDeposited
void SetMaxTracks(size_t maxTracks)
std::vector< UShort_t > NAuxDets
Number of AuxDets crossed by this particle.
TrackData_t< Float_t > trkendd
VertexData_t< Short_t > vtxPFParticleID
std::vector< std::string > fFlashT0FinderLabel
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
AuxDetMCData_t< Float_t > exitPx
Exit x momentum of particle out of AuxDet.
std::vector< Float_t > theta_xz
const TVector3 & StartDir() const
PFParticleData_t< Short_t > pfp_selfID
the PFParticles' own IDs
Collection of particles crossing one auxiliary detector cell.
std::vector< Float_t > mcshwr_MotherstartZ
std::vector< Float_t > StartPointz_tpcAV
void CheckData(std::string caller) const
Helper function: throws if no data structure is available.
DaughterData_t< Short_t > pfp_daughterIDs
the IDs of the daughter PFParticles
void SetMaxShowers(size_t maxShowers)
TrackData_t< Float_t > trkendy
HitData_t< Float_t > trkdqdx
size_t GetNTrackers() const
Returns the number of trackers for which data structures are allocated.
bool fSaveExternCounterInfo
whether to extract and save Flash information
HitCoordData_t< Float_t > trkxyz
AuxDetMCData_t< Float_t > CombinedEnergyDep
Sum energy of all particles with this trackID (+ID or -ID) in AuxDet.
std::vector< Float_t > SpacePointErrZ
float EndCharge() const
Returns the charge on the last wire of the cluster.
BranchCreator(TTree *tree)
void SetAddresses(TTree *pTree)
std::vector< Float_t > StartPointy
std::vector< Float_t > cry_Px
ShowerData_t< Short_t > shwr_hasPFParticle
void Resize(size_t nTracks)
double dEdx(float dqdx, float Efield)
std::vector< Int_t > TrackId
TrackData_t< Float_t > trkphi
PFParticleData_t< Short_t > pfp_isShower
whether this PFParticle corresponds to a shower
float SummedADC() const
Returns the total charge of the cluster from signal ADC counts.
double bdist(const TVector3 &pos)
std::string fCosmicClusterTaggerAssocLabel
size_t GetMaxVertexAlgos() const
Returns the number of trackers for which memory is allocated.
PlaneData_t< Float_t > trkpidchi
simb::Origin_t Origin() const
std::vector< Float_t > mcshwr_endZ
double Length(size_t p=0) const
Access to various track properties.
std::vector< Int_t > mctrk_pdg
void ResizeSpacePointSolver(int nSpacePoints)
Resize the data structure for SpacePointSolver.
std::vector< Float_t > mcshwr_dEdx
std::map< art::Ptr< recob::PFParticle >, ShowerVector > PFParticlesToShowers
std::vector< std::string > fMVAPIDTrackModuleLabel
std::vector< Float_t > mctrk_MotherendZ
PFParticleData_t< Short_t > pfp_numDaughters
the number of daughters belonging to this PFParticle
bool hasHitInfo() const
Returns whether we have Hit data.
std::vector< Int_t > inTPCActive
std::remove_all_extents< Array_t >::type Data_t
size_t GetMaxClustersPerPFParticle(int=0) const
PlaneData_t< Short_t > trkorigin
const std::vector< double > & dEdx() const
#define DEFINE_ART_MODULE(klass)
AnalysisTreeDataStruct::SubRunData_t SubRunData
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
void SetMaxVertices(size_t maxVertices)
TTree * pTree
the tree to be worked on
std::vector< Float_t > EndPointx_tpcAV
const std::vector< double > & MIPEnergy() const
int MotherPdgCode() const
void SetAddresses()
Sets the addresses of all the tree branches, creating the missing ones.
std::vector< Float_t > proto_vz
const std::string & AncestorProcess() const
std::vector< Float_t > genie_Eng
std::vector< Int_t > proto_geantIndex
std::vector< Float_t > mcshwr_MotherstartY
Int_t geant_list_size_in_tpcAV
PlaneData_t< Float_t > trkpurtruth
std::vector< Float_t > mctrk_MotherendY
std::vector< art::Ptr< recob::PFParticle > > PFParticleVector
size_t GetMaxShowers() const
Returns the number of trackers for which memory is allocated.
size_t GetMaxPFParticles() const
std::vector< Float_t > StartPy_tpcAV
bool fSaveVertexInfo
whether to extract and save Track information
void Clear()
Clear all fields.
const art::Ptr< simb::MCTruth > & TrackIdToMCTruth_P(int id) const
TrackData_t< Float_t > trkpidmvaphoton
static void CollectShowers(const art::Event &evt, const std::string &label, ShowerVector &showerVector, PFParticlesToShowers &particlesToShowers)
Collect the reconstructed PFParticles and associated Showers from the ART event record.
std::vector< BoxedArray< T[kMaxNDaughtersPerPFP]>> DaughterData_t
std::vector< Handle< PROD > > getMany(SelectorBase const &selector=MatchAllSelector{}) const
std::vector< Float_t > StartP_tpcAV
double P(const int i=0) const
key_type key() const noexcept
T get(std::string const &key) const
std::vector< Float_t > mcshwr_CombEngE
float Width() const
A measure of the cluster width, in homogenized units.
TrackData_t< Float_t > trkstartdcosz
size_t GetNShowerAlgos() const
Returns the number of shower algorithms configured.
void MarkMissing(TTree *pTree)
Applies a special prescription to mark shower information as missing.
TrackData_t< Short_t > trkevtxid
TrackData_t< Short_t > trkncosmictags_tagger
Point_t const & Vertex() const
static void CollectVertices(const art::Event &evt, const std::string &label, VertexVector &vertexVector, PFParticlesToVertices &particlesToVertices)
Collect the reconstructed PFParticles and associated Vertices from the ART event record.
std::string fPandoraNuVertexModuleLabel
TrackData_t< Float_t > trkenddcosy
std::vector< Float_t > mcshwr_AncestorendY
double T(const int i=0) const
void ResizeProto(int nPrimaries)
Resize the data structure for ProtoDUNE primaries.
std::vector< Int_t > cry_ND
Little helper functor class to create or reset branches in a tree.
size_t MaxShowers
maximum number of storable showers
std::vector< Int_t > mcshwr_origin
std::vector< std::string > fCalorimetryModuleLabel
std::vector< Float_t > EndPointz
std::string fClusterModuleLabel
std::vector< Int_t > mcshwr_MotherTrkId
ShowerData_t< Float_t > shwr_pidmvamu
constexpr int kMaxClusters
struct recob::OpFlashPtrSortByPE_t OpFlashPtrSortByPE
unsigned int NumberTimeSamples() const
TrackData_t< Short_t > trkhasPFParticle
bool fUseBuffer
whether to use a permanent buffer (faster, huge memory)
ShowerData_t< Short_t > shwr_bestplane
Shower best plane.
SubRunNumber_t subRun() const
TrackData_t< Float_t > trkstartx
std::vector< Float_t > StartPointx
std::vector< std::string > mcshwr_Process
bool IsPrimary() const
Returns whether the particle is the root of the flow.
std::vector< BoxedArray< T[kNplanes][kMaxTrackHits]>> HitData_t
std::vector< Float_t > mcshwr_CombEngPz
bool hasTrackInfo() const
Returns whether we have Track data.
const TVector3 & Direction() const
CodeOutputInterface * code
std::vector< Int_t > inTPCDrifted
std::vector< Float_t > genie_Py
VertexData_t< Float_t > vtxy
std::vector< Float_t > mctrk_len_drifted
size_t GetMaxTrackers() const
Returns the number of trackers for which memory is allocated.
BoxedArray(const This_t &from)
std::vector< Float_t > SpacePointZ
std::vector< art::Ptr< recob::Track > > TrackVector
std::vector< Float_t > StartE_tpcAV
const MCStep & AncestorStart() const
static int max(int a, int b)
std::vector< Float_t > mctrk_startY_drifted
double DriftVelocity(double efield=0., double temperature=0.) const
cm/us
PlaneData_t< Int_t > trkpidpdg
size_t GetNVertexAlgos() const
size_t GetMaxHitsPerShower(int=0, int=0) const
std::vector< BoxedArray< T[kNplanes]>> PlaneData_t
std::string fCnnModuleLabel
ShowerData_t< Short_t > showerID
Shower ID.
size_t GetMaxPlanesPerTrack(int=0) const
std::vector< Float_t > EndT
AuxDetMCData_t< Float_t > exitZ
Exit Z position of particle out of AuxDet.
std::string fPFParticleModuleLabel
TrackData_t< Float_t > trkstartz
Class def header for mctrack data container.
std::vector< Float_t > proto_t
const MCStep & AncestorStart() const
ShowerData_t< Short_t > shwr_PFParticleID
static void CollectTracks(const art::Event &evt, const std::string &label, TrackVector &trackVector, PFParticlesToTracks &particlesToTracks)
Collect the reconstructed PFParticles and associated Tracks from the ART event record.
PlaneData_t< Float_t > trkrange
bool fSaveProtoInfo
whether to extract and save Genie information
AuxDetMCData_t< Float_t > entryT
Entry T position of particle into AuxDet.
const std::string & MotherProcess() const
std::vector< Int_t > genie_mother
PFParticleDataStruct PFParticleData
Definition of data types for geometry description.
std::vector< Float_t > StartPy_drifted
std::vector< Float_t > mcshwr_CombEngX
static void CollectPFParticles(const art::Event &evt, const std::string &label, PFParticleVector &particleVector)
Collect the reconstructed PFParticles from the ART event record.
bool fSaveTrackInfo
whether to extract and save Raw Digit information
size_t GetMaxGEANTparticles() const
Returns the number of GEANT particles for which memory is allocated.
std::string fProtoGenModuleLabel
bool fSaveClusterInfo
whether to extract and save Vertex information
unsigned int AncestorTrackID() const
std::vector< Int_t > Mother
bool hasClusterInfo() const
Returns whether we have Cluster data.
TrackData_t< Short_t > trkPFParticleID
std::vector< Float_t > StartPx_drifted
const MCStep & AncestorEnd() const
const MCStep & DetProfile() const
std::vector< Int_t > proto_pdg
VertexData_t< Float_t > vtxx
Detector simulation of raw signals on wires.
std::vector< Int_t > mctrk_MotherTrkId
std::vector< Float_t > EndPointy
std::vector< Float_t > StartT_tpcAV
const sim::ParticleList & ParticleList() const
bool isCosmics
if it contains cosmics
Short_t nshowers
number of showers
double ConvertTicksToX(double ticks, int p, int t, int c) const
std::vector< Float_t > pathlen_drifted
std::vector< Float_t > mcshwr_AncestorendZ
PlaneData_t< Short_t > ntrkhits
void SetAddresses(TTree *pTree, std::vector< std::string > const &trackers, std::vector< std::string > const &vertexalgos, std::vector< std::string > const &showeralgos, bool isCosmics)
Connect this object with a tree.
static void SelectNeutrinoPFParticles(const PFParticleVector &inputParticles, PFParticleVector &outputParticles)
Select reconstructed neutrino particles from a list of all reconstructed particles.
void SetMaxPFParticles(size_t maxPFParticles)
Short_t nPFParticles
the total number of PFParticles
std::vector< std::string > fTrackModuleLabel
std::vector< Float_t > proto_pz
void SetVertexAlgos(size_t nVertexAlgos)
Allocates data structures for the given number of vertex algos (no Clear())
std::vector< Float_t > mcshwr_CombEngZ
bool fSavePandoraNuVertexInfo
whether to extract and save Cluster information
const MCStep & Start() const
std::vector< Float_t > cry_StartPointz
std::vector< Float_t > mctrk_startZ
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::vector< Float_t > mcshwr_CombEngY
PFParticleData_t< Short_t > pfp_trackID
the ID of the track object corresponding to this PFParticle, if !isShower
std::string name
name of the shower algorithm (for branch names)
std::vector< Int_t > mcshwr_Motherpdg
TrackData_t< Float_t > trkstarty
constexpr int kMaxVertices
AuxDetMCData_t< Float_t > entryY
Entry Y position of particle into AuxDet.
double Vx(const int i=0) const
Class whose "type" contains the base data type of the container.
std::vector< Float_t > mcshwr_AncestorendX
PlaneData_t< Int_t > trkpdgtruth
size_t GetMaxPlanesPerShower(int=0) const
geo::View_t View() const
Returns the view for this cluster.
ShowerData_t< Float_t > shwr_pidmvapich
auto array(Array const &a)
Returns a manipulator which will print the specified array.
std::string fHitsModuleLabel
Declaration of signal hit object.
const MCStep & MotherStart() const
ShowerData_t< Float_t > shwr_startdcosx
X directional cosine at start of shower.
TrackData_t< Float_t > trkpidmvapich
void FillShower(AnalysisTreeDataStruct::ShowerDataStruct &showerData, size_t iShower, recob::Shower const &showers, const bool fSavePFParticleInfo, const std::map< Short_t, Short_t > &showerIDtoPFParticleIDMap) const
Stores the information of shower in slot iShower of showerData.
bool fSaveFlashInfo
whether to extract and save nu vertex information from Pandora
constexpr int kMaxNClustersPerPFP
std::vector< Float_t > EndPx_drifted
std::vector< Int_t > NumberDaughters
std::vector< Float_t > theta_yz
void ResizeMCTrack(int nMCTracks)
Resize the data strutcure for MC Tracks.
std::vector< Float_t > Py
constexpr int kMaxFlashes
PlaneData_t< Float_t > trkpidchimu
std::vector< Float_t > mctrk_endZ
PFParticleData_t< Int_t > pfp_pdgCode
the preliminary estimate of the PFParticle type using the PDG code
const Array_t & data() const
std::vector< Float_t > EndPointz_drifted
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
DoubleProduct operator+(DoubleProduct const &left, DoubleProduct const right)
int MotherPdgCode() const
std::vector< Float_t > EndT_drifted
information from the subrun
const MCStep & MotherEnd() const
std::vector< Int_t > mcshwr_pdg
size_t GetMaxTracks() const
std::string fExternalCounterModuleLabel
std::vector< Float_t > mcshwr_MotherendX
Contains all timing reference information for the detector.
float StartCharge() const
Returns the charge on the first wire of the cluster.
std::vector< Float_t > SpacePointEmScore
std::vector< BoxedArray< T[kNplanes]>> PlaneData_t
bool fSaveMCShowerInfo
whether to extract and save Geant information
bool fSaveMCTrackInfo
whether to extract and save MC Shower information
ID_t ID() const
Identifier of this cluster.
std::string fLArG4ModuleLabel
size_t GetMaxHitsPerTrack(int=0, int=0) const
std::vector< Float_t > StartPointx_drifted
AnalysisTree(fhicl::ParameterSet const &pset)
void analyze(const art::Event &evt)
read access to event
std::vector< Float_t > EndE
AuxDetMCData_t< Float_t > exitY
Exit Y position of particle out of AuxDet.
bool hasRawDigitInfo() const
Returns whether we have Hit data.
std::string fDigitModuleLabel
Vector_t EndDirection() const
PlaneData_t< Float_t > trkke
std::vector< Float_t > mcshwr_CombEngPy
std::vector< Int_t > proto_isGoodParticle
AuxDetMCData_t< Float_t > exitT
Exit T position of particle out of AuxDet.
size_t MaxTracks
maximum number of storable tracks
MC truth information to make RawDigits and do back tracking.
std::vector< Int_t > genie_status_code
SubRunData_t SubRunData
subrun data collected at begin of subrun
std::vector< sim::TrackIDE > HitToEveTrackIDEs(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
std::vector< Float_t > EndPy_drifted
size_t GetNVertexAlgos() const
Returns the number of Vertex algos for which data structures are allocated.
const TLorentzVector & Momentum(const int i=0) const
const std::string & Process() const
const std::string & MotherProcess() const
std::vector< Float_t > EndPointz_tpcAV
std::vector< Int_t > status
bool fSaveGeantInfo
whether to extract and save ProtDUNE beam simulation information
static bool IsTrack(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as track-like.
double Pz(const int i=0) const
std::vector< Float_t > mcshwr_StartDirZ
float fG4minE
Energy threshold to save g4 particle info.
Provides recob::Track data product.
void ResizeMCShower(int nMCShowers)
Resize the data strutcure for MC Showers.
size_t GetNTrackers() const
Returns the number of trackers configured.
void SetTrackerAddresses(size_t iTracker)
PFParticleData_t< Short_t > pfp_isNeutrino
whether this PFParticle is a neutrino
std::string fMCShowerModuleLabel
std::vector< Float_t > cry_Py
std::vector< Float_t > StartP_drifted
Class def header for MCShower data container.
PFParticleData_t< Short_t > pfp_vertexID
the ID of the vertex belonging to this PFParticle
unsigned int MotherTrackID() const
double Vz(const int i=0) const
std::vector< double > SimIDEsToXYZ(std::vector< sim::IDE > const &ides) const
const std::string & Process() const
ShowerDataStruct(std::string new_name="", size_t maxShowers=0)
Creates a shower data structure allowing up to maxShowers showers.
std::vector< art::Ptr< recob::Vertex > > VertexVector
std::vector< Int_t > process_primary
std::vector< Int_t > origin
std::vector< T > PFParticleData_t
std::unique_ptr< AnalysisTreeDataStruct > fData
std::vector< Float_t > proto_px
AuxDetMCData_t< Float_t > exitPy
Exit y momentum of particle out of AuxDet.
bool bIgnoreMissingShowers
whether to ignore missing shower information
EventNumber_t event() const
Point_t const & End() const
const MCStep & MotherStart() const
Access the description of detector geometry.
std::vector< Float_t > StartPointy_drifted
detail::Node< FrameID, bool > PlaneID
bool fSaveCnnInfo
whether to extract and save SpacePointSolver information
const MCStep & Start() const
PlaneData_t< Float_t > trkpitchc
TDCIDEs_t const & TDCIDEMap() const
Returns all the deposited energy information as stored.
std::vector< std::string > processname
std::vector< Int_t > mctrk_Motherpdg
TrackData_t< Float_t > trkcosmicscore_containmenttagger
std::vector< Float_t > StartPz_tpcAV
std::vector< std::string > GetShowerAlgos() const
Returns the name of configured shower algorithms (converted to string)
TrackData_t< Float_t > trklen
std::vector< Int_t > cry_primaries_pdg
std::vector< Float_t > cry_StartPointt
bool hasGeantInfo() const
Returns whether we have Geant data.
std::vector< Int_t > genie_primaries_pdg
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
void Resize(size_t nVertices)
std::vector< Float_t > mctrk_MotherstartY
std::vector< const sim::IDE * > HitToSimIDEs_Ps(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
const TrackDataStruct & GetTrackerData(size_t iTracker) const
std::vector< Float_t > genie_Px
size_t MaxVertices
maximum number of storable vertices
constexpr int kMaxShowerHits
std::vector< Float_t > mctrk_endX
PFParticleData_t< Short_t > pfp_numClusters
the number of associated clusters
std::vector< Float_t > StartPointz_drifted
std::vector< art::Ptr< recob::Cluster > > ClusterVector
unsigned int NHits() const
Number of hits in the cluster.
unsigned int TrackID() const
void CheckTree(std::string caller) const
Helper function: throws if no tree is available.
std::vector< std::string > mctrk_MotherProcess
std::vector< Int_t > SpacePointID
PlaneData_t< Int_t > trkidtruth
int AncestorPdgCode() const
TrackData_t< Float_t > trkstartdcosy
Contains ROOTTreeCode<>::code, ROOT tree character for branch of type T.
std::vector< Float_t > proto_momentum
std::vector< ShowerDataStruct > ShowerData
auto const & get(AssnsNode< L, R, D > const &r)
TrackData_t< Float_t > trkendz
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
const PFParticleDataStruct & GetPFParticleData() const
std::vector< Float_t > StartE_drifted
std::map< std::string, double > mvaOutput
ShowerData_t< Float_t > shwr_startdcosz
Z directional cosine at start of shower.
void CreateData(bool bClearData=false)
Creates the structure for the tree data; optionally initializes it.
float EndAngle() const
Returns the ending angle of the cluster.
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
AuxDetMCData_t< Float_t > entryZ
Entry Z position of particle into AuxDet.
std::vector< Float_t > mcshwr_AncestorstartY
void Resize(size_t numPFParticles)
std::vector< Float_t > mcshwr_MotherendZ
double length(const recob::Track &track)
second_as<> second
Type of time stored in seconds, in double precision.
std::vector< Float_t > mctrk_startX_drifted
TrackData_t< Float_t > trkmomrange
std::vector< Float_t > pathlen
std::vector< Float_t > mcshwr_AncestorstartZ
recob::tracking::Plane Plane
static constexpr double sr
std::vector< Float_t > cry_StartPointx
std::vector< std::string > fFlashMatchAssocLabel
QuadExpr operator*(double v, const QuadExpr &e)
void SetAddresses(TTree *pTree)
TrackData_t< Short_t > trksvtxid
bool hasExternCountInfo() const
Returns whether we have External Counter data.
void SetName(std::string new_name)
helper function for LArPandoraInterface producer module
Int_t no_primaries
! how many particles there is currently room for
float StartTick() const
Returns the tick coordinate of the start of the cluster.
std::vector< Float_t > mcshwr_StartDirX
void HitsPurity(detinfo::DetectorClocksData const &clockData, std::vector< art::Ptr< recob::Hit > > const &hits, Int_t &trackid, Float_t &purity, double &maxe)
std::vector< Float_t > SpacePointErrX
std::vector< std::string > fShowerModuleLabel
std::vector< VertexDataStruct > VertexData
std::vector< Float_t > EndP_tpcAV
TrackData_t< Float_t > trkstartdcosx
std::vector< Float_t > mctrk_startY
VertexData_t< Short_t > vtxhasPFParticle
PFParticleData_t< Short_t > pfp_isPrimary
whether the PFParticle is a primary particle
TrackData_t< Float_t > trkcosmicscore_tagger
void FillShowers(AnalysisTreeDataStruct::ShowerDataStruct &showerData, std::vector< recob::Shower > const &showers, const bool fSavePFParticleInfo, const std::map< Short_t, Short_t > &showerIDtoPFParticleIDMap) const
Stores the information of all showers into showerData.
PFParticleData_t< Short_t > pfp_parentID
the ID of this PFParticle's immediate parent
std::vector< Float_t > mctrk_MotherstartZ
TrackData_t< Float_t > trkmommsllhd
ShowerDataStruct const & GetShowerData(size_t iShower) const
std::vector< Float_t > mctrk_startX
std::vector< Float_t > theta
std::vector< BoxedArray< T[kNplanes][kMaxShowerHits][3]>> HitCoordData_t
bool fSaveHitInfo
whether to extract and save MC Track information
std::vector< Float_t > mctrk_startZ_drifted
std::vector< Float_t > genie_P
static std::unique_ptr< MVAReader > create(const art::Event &evt, const art::InputTag &tag)
double Vy(const int i=0) const
const MCStep & AncestorEnd() const
PlaneData_t< Float_t > shwr_totEng
Total energy of the shower per plane.
PlaneData_t< Float_t > trkpidchika
const Data_t * end() const
PlaneData_t< Float_t > trkpidpida
bool fSaveGenieInfo
whether to extract and save CRY particle data
PFParticleData_t< Short_t > pfp_isTrack
whether this PFParticle corresponds to a track
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
std::vector< TrackDataStruct > TrackData
constexpr Point origin()
Returns a origin position with a point of the specified type.
std::vector< BoxedArray< T[kMaxAuxDets]>> AuxDetMCData_t
cet::coded_exception< error, detail::translate > exception
TrackData_t< Float_t > trktheta
QTextStream & endl(QTextStream &s)
std::vector< Float_t > EndPz_tpcAV
std::vector< Float_t > mcshwr_StartDirY
Event finding and building.
std::vector< Float_t > genie_Pz
void Resize(size_t nShowers)
bool fSaveSpacePointSolverInfo
whether to extract and save PFParticle information
std::vector< Float_t > EndPointx
std::vector< Float_t > mctrk_AncestorendY
std::vector< Int_t > mctrk_TrackId
std::vector< Float_t > proto_py
std::vector< Float_t > mctrk_py_drifted
void beginSubRun(const art::SubRun &sr)
TrackData_t< Float_t > trkpidmvae
float Integral() const
Returns the total charge of the cluster from hit shape.
float EndWire() const
Returns the wire coordinate of the end of the cluster.
bool fSaveShowerInfo
whether to extract and save External Counter information