Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:41

0001 // @(#)root/eve7:$Id$
0002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007, 2018
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT7_REveVSDStructs
0013 #define ROOT7_REveVSDStructs
0014 
0015 #include "TParticle.h"
0016 
0017 #include <ROOT/REveVector.hxx>
0018 
0019 ////////////////////////////////////////////////////////////////////////////////
0020 /// VSD Structures
0021 ////////////////////////////////////////////////////////////////////////////////
0022 
0023 // Basic structures for Reve VSD concept. Design criteria:
0024 //
0025 //  * provide basic cross-referencing functionality;
0026 //
0027 //  * small memory/disk footprint (floats / count on compression in
0028 //    split mode);
0029 //
0030 //  * simple usage from tree selections;
0031 //
0032 //  * placement in TClonesArray (composites are TObject derived);
0033 //
0034 //  * minimal member-naming (impossible to make everybody happy).
0035 //
0036 
0037 namespace ROOT {
0038 namespace Experimental {
0039 
0040 ////////////////////////////////////////////////////////////////////////////////
0041 /// REveMCTrack
0042 ////////////////////////////////////////////////////////////////////////////////
0043 
0044 class REveMCTrack : public TParticle // ?? Copy stuff over ??
0045 {
0046 public:
0047    Int_t fLabel{-1};    // Label of the track
0048    Int_t fIndex{-1};    // Index of the track (in some source array)
0049    Int_t fEvaLabel{-1}; // Label of primary particle
0050 
0051    Bool_t fDecayed{kFALSE}; // True if decayed during tracking.
0052    // ?? Perhaps end-of-tracking point/momentum would be better.
0053    Float_t fTDecay{0};    // Decay time
0054    REveVector fVDecay; // Decay vertex
0055    REveVector fPDecay; // Decay momentum
0056 
0057    REveMCTrack() = default;
0058    ~REveMCTrack() override {}
0059 
0060    REveMCTrack &operator=(const TParticle &p)
0061    {
0062       *((TParticle *)this) = p;
0063       return *this;
0064    }
0065 
0066    void ResetPdgCode() { fPdgCode = 0; }
0067 
0068    ClassDefOverride(REveMCTrack, 1); // Monte Carlo track (also used in VSD).
0069 };
0070 
0071 ////////////////////////////////////////////////////////////////////////////////
0072 /// REveHit
0073 /// Monte Carlo hit (also used in VSD).
0074 ///
0075 /// Representation of a hit.
0076 /// Members det_id (and fSubdetId) serve for cross-referencing into
0077 /// geometry. Hits should be stored in fDetId (+some label ordering) in
0078 /// order to maximize branch compression.
0079 ////////////////////////////////////////////////////////////////////////////////
0080 
0081 
0082 class REveHit
0083 {
0084 public:
0085    UShort_t fDetId{0};    // Custom detector id.
0086    UShort_t fSubdetId{0}; // Custom sub-detector id.
0087    Int_t fLabel{0};       // Label of particle that produced the hit.
0088    Int_t fEvaLabel{0};    // Label of primary particle, ancestor of label.
0089    REveVector fV;      // Hit position.
0090 
0091    // Float_t charge; probably specific.
0092 
0093    REveHit() = default;
0094    virtual ~REveHit() {}
0095 };
0096 
0097 ////////////////////////////////////////////////////////////////////////////////
0098 /// REveCluster
0099 /// Reconstructed cluster (also used in VSD).
0100 ////////////////////////////////////////////////////////////////////////////////
0101 
0102 // Base class for reconstructed clusters
0103 
0104 // ?? Should REveHit and cluster have common base? No.
0105 
0106 class REveCluster // : public TObject
0107 {
0108 public:
0109    UShort_t fDetId{0};    // Custom detector id.
0110    UShort_t fSubdetId{0}; // Custom sub-detector id.
0111    Int_t fLabel[3];    // Labels of particles that contributed hits.
0112 
0113    // ?? Should include reconstructed track(s) using it? Rather not, separate.
0114 
0115    REveVector fV; // Vertex.
0116    // REveVector   fW;      // Cluster widths.
0117    // Coord system? Errors and/or widths Wz, Wy?
0118 
0119    REveCluster() { fLabel[0] = fLabel[1] = fLabel[2] = 0; }
0120    virtual ~REveCluster() {}
0121 };
0122 
0123 ////////////////////////////////////////////////////////////////////////////////
0124 /// REveRecTrack
0125 /// Template for reconstructed track (also used in VSD).
0126 ////////////////////////////////////////////////////////////////////////////////
0127 
0128 template <typename TT>
0129 class REveRecTrackT
0130 {
0131 public:
0132    Int_t fLabel{-1};       // Label of the track.
0133    Int_t fIndex{-1};       // Index of the track (in some source array).
0134    Int_t fStatus{0};      // Status as exported from reconstruction.
0135    Int_t fSign{0};        // Charge of the track.
0136    REveVectorT<TT> fV; // Start vertex from reconstruction.
0137    REveVectorT<TT> fP; // Reconstructed momentum at start vertex.
0138    TT fBeta{0};           // Relativistic beta factor.
0139    Double32_t fDcaXY{0};  // dca xy to the primary vertex
0140    Double32_t fDcaZ{0};   // dca z to the primary vertex
0141    Double32_t fPVX{0};    //
0142    Double32_t fPVY{0};    //
0143    Double32_t fPVZ{0};    //
0144    // PID data missing
0145 
0146    REveRecTrackT() = default;
0147    virtual ~REveRecTrackT() {}
0148 
0149    Float_t Pt() { return fP.Perp(); }
0150 };
0151 
0152 typedef REveRecTrackT<Float_t> REveRecTrack;
0153 typedef REveRecTrackT<Float_t> REveRecTrackF;
0154 typedef REveRecTrackT<Double_t> REveRecTrackD;
0155 
0156 ////////////////////////////////////////////////////////////////////////////////
0157 /// REveRecKink
0158 /// Reconstructed kink (also used in VSD).
0159 ////////////////////////////////////////////////////////////////////////////////
0160 
0161 class REveRecKink // : public TObject
0162 {
0163 public:
0164    REveVector fVKink;        // Kink vertex: reconstructed position of the kink
0165    REveVector fPMother;      // Momentum of the mother track
0166    REveVector fVMother;      // Vertex of the mother track
0167    REveVector fPDaughter;    // Momentum of the daughter track
0168    REveVector fVDaughter;    // Vertex of the daughter track
0169    Double32_t fKinkAngle[3]; // three angles
0170    Int_t fSign{0};           // sign of the track
0171    Int_t fStatus{0};         // Status as exported from reconstruction
0172 
0173    // Data from simulation
0174    Int_t fKinkLabel[2]; // Labels of the mother and daughter tracks
0175    Int_t fKinkIndex[2]; // Indices of the mother and daughter tracks
0176    Int_t fKinkPdg[2];   // PDG code of mother and daughter.
0177 
0178    REveRecKink()
0179    {
0180       fKinkAngle[0] = fKinkAngle[1] = fKinkAngle[2] = 0;
0181       fKinkLabel[0] = fKinkLabel[1] = 0;
0182       fKinkIndex[0] = fKinkIndex[1] = 0;
0183       fKinkPdg[0] = fKinkPdg[1] = 0;
0184    }
0185    virtual ~REveRecKink() {}
0186 };
0187 
0188 ////////////////////////////////////////////////////////////////////////////////
0189 /// REveRecV0
0190 ////////////////////////////////////////////////////////////////////////////////
0191 
0192 class REveRecV0
0193 {
0194 public:
0195    Int_t fStatus{0};
0196 
0197    REveVector fVNeg; // Vertex of negative track.
0198    REveVector fPNeg; // Momentum of negative track.
0199    REveVector fVPos; // Vertex of positive track.
0200    REveVector fPPos; // Momentum of positive track.
0201 
0202    REveVector fVCa;     // Point of closest approach.
0203    REveVector fV0Birth; // Reconstructed birth point of neutral particle.
0204 
0205    // ? Data from simulation.
0206    Int_t fLabel{0};     // Neutral mother label read from kinematics.
0207    Int_t fPdg{0};       // PDG code of mother.
0208    Int_t fDLabel[2];    // Daughter labels.
0209 
0210    REveRecV0() { fDLabel[0] = fDLabel[1] = 0; }
0211    virtual ~REveRecV0() {}
0212 };
0213 
0214 ////////////////////////////////////////////////////////////////////////////////
0215 /// REveRecCascade
0216 ////////////////////////////////////////////////////////////////////////////////
0217 
0218 class REveRecCascade
0219 {
0220 public:
0221    Int_t fStatus{0};
0222 
0223    REveVector fVBac; // Vertex of bachelor track.
0224    REveVector fPBac; // Momentum of bachelor track.
0225 
0226    REveVector fCascadeVCa;   // Point of closest approach for Cascade.
0227    REveVector fCascadeBirth; // Reconstructed birth point of cascade particle.
0228 
0229    // ? Data from simulation.
0230    Int_t fLabel{0};  // Cascade mother label read from kinematics.
0231    Int_t fPdg{0};    // PDG code of mother.
0232    Int_t fDLabel{0}; // Daughter label.
0233 
0234    REveRecCascade() = default;
0235    virtual ~REveRecCascade() {}
0236 };
0237 
0238 ////////////////////////////////////////////////////////////////////////////////
0239 /// REveMCRecCrossRef
0240 /// Cross-reference of sim/rec data per particle (also used in VSD).
0241 ////////////////////////////////////////////////////////////////////////////////
0242 
0243 class REveMCRecCrossRef {
0244 public:
0245    Bool_t fIsRec{kFALSE}; // Is reconstructed.
0246    Bool_t fHasV0{kFALSE};
0247    Bool_t fHasKink{kFALSE};
0248    Int_t fLabel{0};
0249    Int_t fNHits{0};
0250    Int_t fNClus{0};
0251 
0252    REveMCRecCrossRef() = default;
0253    virtual ~REveMCRecCrossRef() {}
0254 };
0255 
0256 ////////////////////////////////////////////////////////////////////////////////
0257 /// Missing primary vertex class.
0258 ////////////////////////////////////////////////////////////////////////////////
0259 
0260 /******************************************************************************/
0261 /******************************************************************************/
0262 
0263 // This whole construction is somewhat doubtable. It requires
0264 // shameless copying of experiment data. What is good about this
0265 // scheme:
0266 //
0267 // 1) Filters can be applied at copy time so that only part of the
0268 // data is copied over.
0269 //
0270 // 2) Once the data is extracted it can be used without experiment
0271 // software. Thus, external service can provide this data and local
0272 // client can be really thin.
0273 //
0274 // 3) Some pretty advanced visualization schemes/selections can be
0275 // implemented in a general framework by providing data extractors
0276 // only. This is also good for PR or VIP displays.
0277 //
0278 // 4) These classes can be extended by particular implementations. The
0279 // container classes will use TClonesArray with user-specified element
0280 // class.
0281 
0282 // The common behaviour could be implemented entirely without usage of
0283 // a common base classes, by just specifying names of members that
0284 // retrieve specific data. This is fine as long as one only uses tree
0285 // selections but becomes painful for extraction of data into local
0286 // structures (could a) use interpreter but this is an overkill and
0287 // would cause serious trouble for multi-threaded environment; b) use
0288 // member offsets and data-types from the dictionary).
0289 
0290 } // namespace Experimental
0291 } // namespace ROOT
0292 
0293 #endif