FairShip
Loading...
Searching...
No Matches
ShipMuDIS::MuonInBranches Struct Reference

#include <MuDISDefs.h>

Collaboration diagram for ShipMuDIS::MuonInBranches:
[legend]

Public Member Functions

bool Setup (TTree *tree)
bool PrepareEntry (TTree *tree, Long64_t entry)

Public Attributes

std::vector< ShipMCTrack > * mcTrks = nullptr
std::vector< vetoPoint > * sbtPt = nullptr
std::vector< UpstreamTaggerPoint > * ubtPt = nullptr
std::vector< strawtubesPoint > * sstPt = nullptr
std::vector< TimeDetPoint > * tdPt = nullptr
double pathLength = 0.
std::array< double, nMats > pathLengthByMat = {}
MuonDISInBranches br [nMats]

Private Member Functions

void Clear ()

Private Attributes

std::vector< ShipMCTrack > fTracks
std::vector< vetoPoint > fSBT
std::vector< UpstreamTaggerPoint > fUBT
std::vector< strawtubesPoint > fSST
std::vector< TimeDetPoint > fTD
int fTreeNumber = -1
bool fValid = false

Detailed Description

Definition at line 315 of file MuDISDefs.h.

Member Function Documentation

◆ Clear()

void ShipMuDIS::MuonInBranches::Clear ( )
inlineprivate

Definition at line 353 of file MuDISDefs.h.

353 {
354 fTracks.clear();
355 fSBT.clear();
356 fUBT.clear();
357 fSST.clear();
358 fTD.clear();
359 mcTrks = &fTracks;
360 sbtPt = &fSBT;
361 ubtPt = &fUBT;
362 sstPt = &fSST;
363 tdPt = &fTD;
364 pathLength = 0.;
365 pathLengthByMat.fill(0.);
366 for (auto& material : br) material.Clear();
367 }
std::vector< TimeDetPoint > * tdPt
Definition MuDISDefs.h:320
std::vector< vetoPoint > fSBT
Definition MuDISDefs.h:369
std::vector< ShipMCTrack > fTracks
Definition MuDISDefs.h:368
std::vector< UpstreamTaggerPoint > * ubtPt
Definition MuDISDefs.h:318
std::vector< TimeDetPoint > fTD
Definition MuDISDefs.h:372
std::vector< vetoPoint > * sbtPt
Definition MuDISDefs.h:317
std::vector< strawtubesPoint > fSST
Definition MuDISDefs.h:371
std::vector< strawtubesPoint > * sstPt
Definition MuDISDefs.h:319
std::array< double, nMats > pathLengthByMat
Definition MuDISDefs.h:322
std::vector< ShipMCTrack > * mcTrks
Definition MuDISDefs.h:316
std::vector< UpstreamTaggerPoint > fUBT
Definition MuDISDefs.h:370
MuonDISInBranches br[nMats]
Definition MuDISDefs.h:323

◆ PrepareEntry()

bool ShipMuDIS::MuonInBranches::PrepareEntry ( TTree * tree,
Long64_t entry )
inline

Definition at line 331 of file MuDISDefs.h.

331 {
332 Clear();
333 if (tree->LoadTree(entry) < 0) return false;
334 if (tree->GetTreeNumber() != fTreeNumber) {
335 fTreeNumber = tree->GetTreeNumber();
336 auto* current = tree->GetTree();
337 fValid = BindInputBranch(current, "muon_MCTracks", &mcTrks);
338 fValid &= BindInputBranch(current, "muon_TDPoints", &tdPt);
339 fValid &= BindInputBranch(current, "muon_SBTPoints", &sbtPt);
340 fValid &= BindInputBranch(current, "muon_UBTPoints", &ubtPt);
341 fValid &= BindInputBranch(current, "muon_SSTPoints", &sstPt);
342 fValid &= BindInputBranch(current, "muon_path_length", &pathLength);
343 for (unsigned i = 0; i < nMats; ++i) {
344 const TString name = "muon_path_length_" + MatTypeStr[i];
345 fValid &= BindInputBranch(current, name, &pathLengthByMat[i]);
346 fValid &= br[i].SetupTree(current, MatTypeStr[i]);
347 }
348 }
349 return fValid;
350 }
int i
Definition ShipAna.py:108
bool BindInputBranch(TTree *tree, const TString &name, T *address, bool required=true)
Definition MuDISDefs.h:143
const std::array< TString, nMats > MatTypeStr
Definition MuDISDefs.h:45

◆ Setup()

bool ShipMuDIS::MuonInBranches::Setup ( TTree * tree)
inline

Definition at line 325 of file MuDISDefs.h.

325 {
326 fTreeNumber = -1;
327 Clear();
328 return tree->GetEntries() == 0 || PrepareEntry(tree, 0);
329 }
bool PrepareEntry(TTree *tree, Long64_t entry)
Definition MuDISDefs.h:331

Member Data Documentation

◆ br

MuonDISInBranches ShipMuDIS::MuonInBranches::br[nMats]

Definition at line 323 of file MuDISDefs.h.

◆ fSBT

std::vector<vetoPoint> ShipMuDIS::MuonInBranches::fSBT
private

Definition at line 369 of file MuDISDefs.h.

◆ fSST

std::vector<strawtubesPoint> ShipMuDIS::MuonInBranches::fSST
private

Definition at line 371 of file MuDISDefs.h.

◆ fTD

std::vector<TimeDetPoint> ShipMuDIS::MuonInBranches::fTD
private

Definition at line 372 of file MuDISDefs.h.

◆ fTracks

std::vector<ShipMCTrack> ShipMuDIS::MuonInBranches::fTracks
private

Definition at line 368 of file MuDISDefs.h.

◆ fTreeNumber

int ShipMuDIS::MuonInBranches::fTreeNumber = -1
private

Definition at line 373 of file MuDISDefs.h.

◆ fUBT

std::vector<UpstreamTaggerPoint> ShipMuDIS::MuonInBranches::fUBT
private

Definition at line 370 of file MuDISDefs.h.

◆ fValid

bool ShipMuDIS::MuonInBranches::fValid = false
private

Definition at line 374 of file MuDISDefs.h.

◆ mcTrks

std::vector<ShipMCTrack>* ShipMuDIS::MuonInBranches::mcTrks = nullptr

Definition at line 316 of file MuDISDefs.h.

◆ pathLength

double ShipMuDIS::MuonInBranches::pathLength = 0.

Definition at line 321 of file MuDISDefs.h.

◆ pathLengthByMat

std::array<double, nMats> ShipMuDIS::MuonInBranches::pathLengthByMat = {}

Definition at line 322 of file MuDISDefs.h.

322{};

◆ sbtPt

std::vector<vetoPoint>* ShipMuDIS::MuonInBranches::sbtPt = nullptr

Definition at line 317 of file MuDISDefs.h.

◆ sstPt

std::vector<strawtubesPoint>* ShipMuDIS::MuonInBranches::sstPt = nullptr

Definition at line 319 of file MuDISDefs.h.

◆ tdPt

std::vector<TimeDetPoint>* ShipMuDIS::MuonInBranches::tdPt = nullptr

Definition at line 320 of file MuDISDefs.h.

◆ ubtPt

std::vector<UpstreamTaggerPoint>* ShipMuDIS::MuonInBranches::ubtPt = nullptr

Definition at line 318 of file MuDISDefs.h.


The documentation for this struct was generated from the following file: