Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /irt/include/CherenkovEvent.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #pragma once
0002 
0003 #include <vector>
0004 
0005 #include "ChargedParticle.h"
0006 
0007 class OpticalPhoton;
0008 
0009 namespace IRT2 {
0010 
0011 class CherenkovEvent: public TObject {
0012  public:
0013   CherenkovEvent() {};
0014   ~CherenkovEvent() { Reset(); };
0015 
0016   void Reset( void ) { 
0017     for(auto particle: m_ChargedParticles)
0018       delete particle;
0019     m_ChargedParticles.clear();
0020 
0021     for(auto photon: m_OrphanPhotons)
0022       delete photon;
0023     m_OrphanPhotons.clear();
0024   };
0025 
0026   inline void AddChargedParticle(ChargedParticle *particle) { m_ChargedParticles.push_back(particle); };
0027   std::vector<ChargedParticle*> &ChargedParticles( void ) { return m_ChargedParticles; };
0028 
0029   inline void AddOrphanPhoton(OpticalPhoton *photon) { m_OrphanPhotons.push_back(photon); };
0030   std::vector<OpticalPhoton*> &OrphanPhotons( void ) { return m_OrphanPhotons; };
0031 
0032  private:
0033   // Insertion-ordered on purpose: iterating a std::set of pointers exposes heap addresses,
0034   // which makes downstream output ordering vary between runs and thread counts.
0035   std::vector<ChargedParticle*> m_ChargedParticles;
0036 
0037   std::vector<OpticalPhoton*> m_OrphanPhotons; 
0038 
0039 #ifndef DISABLE_ROOT_IO
0040   ClassDef(CherenkovEvent, 3);
0041 #endif
0042 };
0043 
0044 } // namespace IRT2