FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairLink.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 /*
9  * FairLink.cpp
10  *
11  * Created on: Dec 23, 2009
12  * Author: stockman
13  */
14 
15 #include "FairLink.h"
16 
17 #include "FairRootManager.h"
18 
20 
21 FairLink::FairLink(TString branchName, Int_t index, Float_t weight)
22  : fFile(0)
23  , fType(0)
24  , fEntry(-1)
25  , fIndex(index)
26  , fWeight(weight)
27 {
28  SetType(FairRootManager::Instance()->GetBranchId(branchName));
29 }
30 
31 FairLink::FairLink(Int_t file, Int_t entry, TString branchName, Int_t index, Float_t weight)
32  : fFile(0)
33  , fType(0)
34  , fEntry(entry)
35  , fIndex(index)
36  , fWeight(weight)
37 {
38  SetFile(file);
39  SetType(FairRootManager::Instance()->GetBranchId(branchName));
40 }
41 
42 void FairLink::PrintLinkInfo(std::ostream& out) const
43 {
44  out << "(" << GetFile() << "/" << GetEntry() << "/";
45  out << GetType() << "/" << GetIndex() << "/" << GetWeight() << ")";
46 }
static FairRootManager * Instance()
ClassImp(FairEventBuilder)