ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtViewerManagerSubject.cxx
Go to the documentation of this file.
2 
3 #include <FairRootManager.h>
4 #include <FairRunAna.h>
5 
6 #include <Rtypes.h>
7 #include <TString.h>
8 namespace DataHandling {
9 
10 void AtTreeEntry::Set(long entry)
11 {
12  fEntry = entry;
13  FairRunAna::Instance()->Run((Long64_t)fEntry);
14  Notify();
15 }
16 
17 void AtBranch::SetBranchName(const TString &name)
18 {
19  SetBranchId(FairRootManager::Instance()->GetBranchId(name));
20 }
21 
22 void AtBranch::SetBranchId(const int id)
23 {
24  if (fBranchId == id)
25  return;
26 
27  fOldBranchId = fBranchId;
28  fBranchId = id;
29  Notify();
30 }
31 
32 TString AtBranch::GetBranchName() const
33 {
34  return FairRootManager::Instance()->GetBranchName(fBranchId);
35 }
36 
38 {
39  return FairRootManager::Instance()->GetBranchName(fOldBranchId);
40 }
41 
42 } // namespace DataHandling
DataHandling::AtTreeEntry::Set
void Set(long entry)
Definition: AtViewerManagerSubject.cxx:10
DataHandling::AtBranch::GetBranchId
int GetBranchId() const
Definition: AtViewerManagerSubject.h:50
DataHandling::AtBranch::GetOldBranchName
TString GetOldBranchName() const
Definition: AtViewerManagerSubject.cxx:37
DataHandling::AtSubject::Notify
void Notify()
Notify all attached subjects that something changed.
Definition: AtDataSubject.cxx:7
DataHandling::AtTreeEntry::fEntry
long fEntry
Definition: AtViewerManagerSubject.h:19
AtViewerManagerSubject.h
DataHandling
Definition: AtDataObserver.h:4
DataHandling::AtBranch::SetBranchName
void SetBranchName(const TString &name)
Will notify on change.
Definition: AtViewerManagerSubject.cxx:17
DataHandling::AtBranch::GetBranchName
TString GetBranchName() const
Definition: AtViewerManagerSubject.cxx:32
DataHandling::AtBranch::SetBranchId
void SetBranchId(const int id)
Will notify on change.
Definition: AtViewerManagerSubject.cxx:22