QwAnalysis
VQwTrackingElement.h File Reference

Definition of virtual base class for all tracking elements. More...

#include <vector>
#include <TObject.h>
#include <TClonesArray.h>
#include "QwTypes.h"
#include "QwLog.h"
#include "QwDetectorInfo.h"
+ Include dependency graph for VQwTrackingElement.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  VQwTrackingElement
 Virtual base class for all tracking elements. More...
 
class  VQwTrackingElementContainer< T >
 

Macros

#define MAX_NUM_ELEMENTS   1000
 

Detailed Description

Definition of virtual base class for all tracking elements.

Author
Wouter Deconinck
Date
2009-12-08

Definition in file VQwTrackingElement.h.

Macro Definition Documentation

#define MAX_NUM_ELEMENTS   1000

Storage of tracking results

  • static TClonesArray: Pros: - new/delete cost reduced from O(n^2) to O(n) by preallocation Cons: - static array prevents multiple simultaneous events
    • could be prevented by using Clear() instead of delete, and with a non-static global list
    • nesting is difficult
  • local TClonesArray: Pros: - new/delete cost reduced from O(n^2) to O(n) by preallocation
    • multiple events each have own preallocated list, so Clear() should be used Cons: - nesting is still difficult
  • std::vector<TObject*>: Pros: - handled transparently by recent ROOT versions (> 4, it seems)
    • easier integration with non-ROOT QwAnalysis structures Cons: - preallocation not included, O(n^2) cost due to new/delete, but not copying full object, only pointers
    • need to store the actual objects somewhere else, these are just references

In all cases there still seems to be a problem with the ROOT TBrowser when two identical branches with TClonesArrays are in the same tree. When drawing leafs from the second branch, the first branch is drawn.

Definition at line 156 of file VQwTrackingElement.h.