Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:01

0001 #ifndef IOMC_ParticleGuns_BeamMomentumGunProducer_H
0002 #define IOMC_ParticleGuns_BeamMomentumGunProducer_H
0003 
0004 #include "IOMC/ParticleGuns/interface/FlatBaseThetaGunProducer.h"
0005 
0006 #include <iostream>
0007 #include <string>
0008 #include <vector>
0009 
0010 #include "TFile.h"
0011 #include "TTree.h"
0012 
0013 namespace edm {
0014 
0015   class BeamMomentumGunProducer : public FlatBaseThetaGunProducer {
0016   public:
0017     BeamMomentumGunProducer(const ParameterSet &);
0018     ~BeamMomentumGunProducer() override {}
0019 
0020     void produce(Event &e, const EventSetup &es) override;
0021 
0022   private:
0023     // data members
0024     double xoff_, yoff_, zpos_;
0025     TFile *fFile_;
0026     TTree *fTree_;
0027     long int nentries_;
0028 
0029     // Declaration of leaf types
0030     int npar_, eventId_;
0031     std::vector<int> *parPDGId_;
0032     std::vector<float> *parX_, *parY_, *parZ_;
0033     std::vector<float> *parPx_, *parPy_, *parPz_;
0034 
0035     // List of branches
0036     TBranch *b_npar_, *b_eventId_, *b_parPDGId_;
0037     TBranch *b_parX_, *b_parY_, *b_parZ_;
0038     TBranch *b_parPx_, *b_parPy_, *b_parPz_;
0039 
0040     static constexpr double mm2cm_ = 0.1, cm2mm_ = 10.0;
0041     static constexpr double MeV2GeV_ = 0.001;
0042   };
0043 }  // namespace edm
0044 
0045 #endif