ATLAS Offline Software
TConvertingBranchElement.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 
3 /*
4  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5 */
42 #ifndef ROOTCONVERSIONS_TCONVERTINGBRANCHELEMENT_H
43 #define ROOTCONVERSIONS_TCONVERTINGBRANCHELEMENT_H
44 
45 #include <atomic>
46 
47 #if defined(__clang__)
48 # pragma clang diagnostic push
49 # if __has_warning("-Wformat-pedantic")
50 # pragma clang diagnostic ignored "-Wformat-pedantic"
51 # endif
52 #endif
53 #include "TBranchElement.h"
54 #if defined(__clang__)
55 # pragma clang diagnostic pop
56 #endif
57 
58 class TVirtualConverter;
59 
65 #ifndef __REFLEX__
66 #ifndef __CLING__
67  : public TBranchElement
68  // Need to hide the base class from reflex and cling so that it doesn't
69  // insist on generating the ClassDef functions.
70 #endif
71 #endif
72 {
73 public:
74  // --- Public methods ---
77 
79  virtual ~TConvertingBranchElement();
80 
84  static void Initialize();
85 
99  virtual Int_t GetEntry(Long64_t entry, Int_t getall);
100 
101  // Need to hide this from cling; otherwise, genreflex will try to
102  // generate an implementation for this.
103 #ifndef __CLING__
104 
108  virtual void Streamer(TBuffer& R__b);
109 #endif
110 
115  virtual void SetAddress(void* add);
116 
120  virtual void ResetAddress();
121 
122 
127  static void SetDoDel (bool flag);
128 
129 
130 
131 protected:
136  virtual void InitInfo();
137 
142  virtual void InitializeOffsets();
143 
148  void ReadLeavesCollectionConverting(TBuffer& b);
149 
151 
152 
153 private:
155  static constexpr unsigned int kIsDummy = BIT(20);
156 
166  static void* new_TConvertingBranchElement (void* p);
167 
171  void BuildConvertedElisions();
172 
177  void CheckForConversion();
178 
182  void ConvResetType();
183 
191  Int_t ReadSubBranches(Long64_t entry,
192  Int_t getall,
193  bool dont_reset);
194 
196  TClass *fConvClass;
197  char *fConvObject;
198  TObjArray *fConvOrigBranches;
199  // the branch list, we store the
200  // original one here, so that
201  // when we stream, we use the
202  // original.
204  // type is stored here, so that if
205  // we stream, we can save the original
206  // type. This is set to -1 before
207  // it's initialized.
209  // conversion.
211  // not reset the buffer pointer.
212  // See GetEntry().
213  static std::atomic<bool> fgDoDel;
214  // branch object when the branch
215  // is deleted.
216 
217 
220 };
221 
222 #endif // not ROOTCONVERSIONS_TCONVERTINGBRANCHELEMENT_H
223 
TConvertingBranchElement::operator=
TConvertingBranchElement & operator=(const TConvertingBranchElement &)
If true, try to delete the.
TConvertingBranchElement::fConvOrigBranches
TObjArray * fConvOrigBranches
Pointer to tmp obj used for conversion.
Definition: TConvertingBranchElement.h:198
TConvertingBranchElement::ConvResetType
void ConvResetType()
Recursively reset the type field of containers in conversions.
Definition: TConvertingBranchElement.cxx:738
TConvertingBranchElement::fgDoDel
static std::atomic< bool > fgDoDel
Flag that the next read should.
Definition: TConvertingBranchElement.h:213
TConvertingBranchElement::fConvDontReset
bool fConvDontReset
True if we're doing a container.
Definition: TConvertingBranchElement.h:210
TConvertingBranchElement::ReadSubBranches
Int_t ReadSubBranches(Long64_t entry, Int_t getall, bool dont_reset)
@branch Read in the subbranches of this branch.
Definition: TConvertingBranchElement.cxx:1110
TConvertingBranchElement::InitializeOffsets
virtual void InitializeOffsets()
Initialize data member offsets.
Definition: TConvertingBranchElement.cxx:1286
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
TConvertingBranchElement::GetEntry
virtual Int_t GetEntry(Long64_t entry, Int_t getall)
Read all branches into the previously-declared object.
Definition: TConvertingBranchElement.cxx:843
TVirtualConverter
Base class for converters for Root schema evolution.
Definition: TVirtualConverter.h:110
master.flag
bool flag
Definition: master.py:29
TConvertingBranchElement::ReadLeavesCollectionConverting
void ReadLeavesCollectionConverting(TBuffer &b)
Read leaves into I/O buffers for this branch.
Definition: TConvertingBranchElement.cxx:962
TConvertingBranchElement::ReadLeavesMemberBranchCountConverting
void ReadLeavesMemberBranchCountConverting(TBuffer &b)
Definition: TConvertingBranchElement.cxx:1054
TConvertingBranchElement::SetDoDel
static void SetDoDel(bool flag)
Set the deletion flag.
Definition: TConvertingBranchElement.cxx:1449
add
bool add(const std::string &hname, TKey *tobj)
Definition: fastadd.cxx:55
TConvertingBranchElement::fConvClass
TClass * fConvClass
Conversion for this branch.
Definition: TConvertingBranchElement.h:196
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
TConvertingBranchElement::Initialize
static void Initialize()
Set up to allow for conversions in split mode.
Definition: TConvertingBranchElement.cxx:335
TConvertingBranchElement::fConv
TVirtualConverter * fConv
Definition: TConvertingBranchElement.h:195
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:76
TConvertingBranchElement
A variant of TBranchElement that can call converters when reading objects in split mode.
Definition: TConvertingBranchElement.h:72
TConvertingBranchElement::~TConvertingBranchElement
virtual ~TConvertingBranchElement()
Destructor.
Definition: TConvertingBranchElement.cxx:304
TConvertingBranchElement::Streamer
virtual void Streamer(TBuffer &R__b)
Read or write this object.
Definition: TConvertingBranchElement.cxx:1253
TConvertingBranchElement::ResetAddress
virtual void ResetAddress()
Reset branch addresses and maybe delete the object.
Definition: TConvertingBranchElement.cxx:1373
TConvertingBranchElement::fConvObject
char * fConvObject
Class for conversion.
Definition: TConvertingBranchElement.h:197
TConvertingBranchElement::fConvOrigType
Int_t fConvOrigType
Saved branch list. If we change.
Definition: TConvertingBranchElement.h:203
TConvertingBranchElement::SetAddress
virtual void SetAddress(void *add)
Set the address of the object to use for I/O.
Definition: TConvertingBranchElement.cxx:1343
TConvertingBranchElement::InitInfo
virtual void InitInfo()
Initialize the TStreamerInfo pointer.
Definition: TConvertingBranchElement.cxx:706
TConvertingBranchElement::TConvertingBranchElement
TConvertingBranchElement()
Constructor.
Definition: TConvertingBranchElement.cxx:287
TConvertingBranchElement::CheckForConversion
void CheckForConversion()
Check to see if we need to worry about conversions for this branch.
Definition: TConvertingBranchElement.cxx:596
TConvertingBranchElement::kIsDummy
static constexpr unsigned int kIsDummy
Flag used to mark dummy nodes created by BuildConvertedElisions.
Definition: TConvertingBranchElement.h:155
TConvertingBranchElement::BuildConvertedElisions
void BuildConvertedElisions()
Add dummy nodes if needed to recover the correct tree structure.
Definition: TConvertingBranchElement.cxx:380
TConvertingBranchElement::fConvContainerFlag
bool fConvContainerFlag
Saved branch type. The original.
Definition: TConvertingBranchElement.h:208
TConvertingBranchElement::TConvertingBranchElement
TConvertingBranchElement(const TConvertingBranchElement &)
TConvertingBranchElement::new_TConvertingBranchElement
static void * new_TConvertingBranchElement(void *p)
new() method for this object.
Definition: TConvertingBranchElement.cxx:349