Guest User

Untitled

a guest
Jun 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. #include "icetray/I3Tray.h"
  2. #include "icetray/I3Frame.h"
  3. #include "dataclasses/physics/I3MCHit.h"
  4. #include "dataclasses/geometry/I3Geometry.h"
  5. #include "dataclasses/I3Units.h"
  6. #include "dataclasses/physics/I3Particle.h"
  7. #include "dataclasses/physics/I3MCTree.h"
  8. #include "dataclasses/physics/I3MCTreeUtils.h"
  9. #include "phys-services/I3RandomService.h"
  10. #include "monopole-propagator/HIT_Test_Module.h"
  11. #include "fstream"
  12.  
  13. I3_MODULE(HIT_Test_Module);
  14.  
  15.  
  16. HIT_Test_Module::HIT_Test_Module(const I3Context& ctx) :
  17. I3Module(ctx),
  18. mcMAP_("MCHitSeriesMap")
  19. {
  20.  
  21.  
  22. AddParameter("MCHitSeriesName","Name of I3MCHitSeriesMap",mcMAP_);
  23.  
  24. AddOutBox("OutBox");
  25. }
  26.  
  27. HIT_Test_Module::~HIT_Test_Module()
  28.  
  29. {
  30.  
  31. }
  32.  
  33. //__________________________________________________________
  34. void HIT_Test_Module::Configure()
  35. {
  36.  
  37. GetParameter("MCHitSeriesName",mcMAP_);
  38.  
  39. }
  40.  
  41. void HIT_Test_Module::Physics(I3FramePtr frame)
  42. {
  43. I3MCHitSeries mchits;
  44.  
  45. double hit_time = 0;
  46.  
  47. for(int i(0);i<=100;i++)
  48. {
  49. I3MCHit hit;
  50.  
  51. if ( i==0 ) hit_time = 936990;
  52. if ( i==100 ) hit_time = 1.17422e+06;
  53.  
  54. hit_time += (i+1) *I3Units::ns;
  55.  
  56. hit.SetTime(hit_time);
  57.  
  58.  
  59. mchits.push_back(hit);
  60. }
  61.  
  62. OMKey omKey;
  63.  
  64. unsigned int om = omKey.GetOM();
  65.  
  66.  
  67. I3MCHitSeriesMapPtr mcMap(new I3MCHitSeriesMap());
  68. if ( omKey.GetString()==66 ){
  69. for(om=22;om<26;om++)
  70. {
  71. omKey.SetOM(om);
  72.  
  73. (*mcMap)[omKey] = mchits;
  74. }
  75. }
  76. frame->Put(mcMAP_,mcMap);
  77.  
  78. PushFrame(frame,"OutBox");
  79.  
  80. }
Add Comment
Please, Sign In to add comment