File indexing completed on 2024-11-16 09:02:06
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef INCLUDE_EICSMEAR_HADRONIC_EVENTSMEAR_H_
0010 #define INCLUDE_EICSMEAR_HADRONIC_EVENTSMEAR_H_
0011
0012 #include <vector>
0013
0014 #include <Rtypes.h> // For ClassDef macro
0015 #include <TBranch.h>
0016
0017 #include "eicsmear/erhic/VirtualEvent.h"
0018 #include "eicsmear/hadronic/EventMC.h"
0019 #include "eicsmear/smear/EventFactory.h"
0020 #include "eicsmear/smear/ParticleMCS.h"
0021
0022 namespace erhic {
0023 namespace hadronic {
0024
0025
0026
0027
0028 class EventSmear : public VirtualEvent {
0029 public:
0030
0031
0032
0033 virtual ~EventSmear();
0034
0035
0036
0037
0038 EventSmear();
0039
0040
0041
0042
0043 virtual const Smear::ParticleMCS* GetTrack(UInt_t) const;
0044
0045
0046
0047
0048 virtual Smear::ParticleMCS* GetTrack(UInt_t);
0049
0050
0051
0052
0053 virtual UInt_t GetNTracks() const;
0054
0055
0056
0057
0058 virtual void AddLast(Smear::ParticleMCS*);
0059
0060 protected:
0061 std::vector<Smear::ParticleMCS*> particles;
0062
0063 ClassDef(erhic::hadronic::EventSmear, 1)
0064 };
0065
0066 }
0067 }
0068
0069 namespace Smear {
0070
0071
0072
0073
0074 class HadronicEventBuilder : public EventFactory<erhic::hadronic::EventSmear> {
0075 public:
0076
0077
0078
0079 virtual ~HadronicEventBuilder() { }
0080
0081
0082
0083
0084
0085
0086 HadronicEventBuilder(const Detector& d, TBranch& mcBranch)
0087 : mDetector(d)
0088 , mMcEvent(NULL) {
0089 mcBranch.SetAddress(&mMcEvent);
0090 }
0091
0092
0093
0094
0095
0096
0097
0098 virtual EventType* Create() {
0099 EventType* event = new EventType;
0100 for (unsigned j(0); j < mMcEvent->GetNTracks(); j++) {
0101 const erhic::VirtualParticle* ptr = mMcEvent->GetTrack(j);
0102 if (ptr) {
0103 event->AddLast(mDetector.Smear(*ptr));
0104 }
0105 }
0106 return event;
0107 }
0108
0109 protected:
0110 Detector mDetector;
0111 erhic::hadronic::EventMC* mMcEvent;
0112 };
0113
0114 }
0115
0116 #endif