00001
00010 #ifndef MIXINPUTSVC_H
00011 #define MIXINPUTSVC_H
00012
00013 #include "TRandom3.h"
00014
00015 #include "Context/TimeStamp.h"
00016 #include "RootIOSvc/RootIOCnvSvc.h"
00017 #include "MixInputSvc/IMixInputSvc.h"
00018
00019 #include "GaudiKernel/MsgStream.h"
00020
00021
00022 class PerSimHeader;
00023
00024 class IService;
00025 class IRootIOSvc;
00026 class IRndmGenSvc;
00027 class IConversionSvc;
00028
00029 class MixInputSvc : public RootIOCnvSvc, virtual public IMixInputSvc
00030 {
00031 public:
00032 MixInputSvc(const string& name, ISvcLocator* svc);
00033 virtual ~MixInputSvc();
00034
00035 virtual StatusCode initialize();
00036 virtual StatusCode queryInterface(const InterfaceID& riid, void** ppint);
00037 virtual void setInputFiles(const vector<string>& inputs)
00038 { m_defaultInputFilenames = inputs;}
00039
00040 virtual StatusCode prepareStream();
00041 virtual StatusCode getSimHeader(GenHeader*& gh, SimHeader*& sh);
00042
00043 private:
00044 StatusCode doInit();
00045 double nextTime(double tau);
00046 double flatdis(double maximum);
00047
00048
00049 map<string, vector<string> > m_inputSamples;
00050 map<string, RootInputStream*> m_simMap;
00051 map<string, RootInputStream*> m_genMap;
00052 map<string, map<string, RootInputStream*> > m_sampleInputStreamMap;
00053
00054 double m_maximum;
00055
00056
00057 double m_maintau;
00058 double m_lasttime;
00059 TimeStamp m_lastTime;
00060
00061
00062
00063 map<string, int> m_fileNum;
00064 map<string, int> m_fileindex;
00065 map<string, int> m_fileEntryNum;
00066 map<string, int> m_sfileentries;
00067 map<string, int> m_gfileentries;
00068 map<string, int> m_streamentries;
00069 map<string, double> m_nod;
00070 map<string, double> m_timeTau;
00071
00072 mutable MsgStream m_log;
00073 TRandom3 m_randomNum;
00074
00075
00076
00077
00078
00079
00080 IService* m_isvc;
00081 IRootIOSvc* m_rioSvc;
00082 IConversionSvc* m_convSvc;
00083 };
00084
00085 #endif //MixInputSvc_H