CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/FastSimulation/MaterialEffects/interface/NuclearInteractionSimulator.h

Go to the documentation of this file.
00001 #ifndef FastSimulation_MaterialEffects_NuclearInteractionSimulator_H
00002 #define FastSimulation_MaterialEffects_NuclearInteractionSimulator_H
00003 
00016 #include "FastSimulation/MaterialEffects/interface/MaterialEffectsSimulator.h"
00017 
00018 #include <vector>
00019 #include <map>
00020 #include <string>
00021 #include <fstream>
00022 
00023 class TFile;
00024 class TTree;
00025 class TBranch;
00026 class NUEvent;
00027 
00028 class ParticlePropagator;
00029 class RandomEngine;
00030 //class DaqMonitorBEInterface;
00031 //class MonitorElement;
00032 
00033 class NuclearInteractionSimulator : public MaterialEffectsSimulator
00034 {
00035  public:
00036 
00038   NuclearInteractionSimulator(std::vector<double>& pionEnergies,
00039                               std::vector<int>& pionTypes,
00040                               std::vector<std::string>& pionNames,
00041                               std::vector<double>& pionMasses,
00042                               std::vector<double>& pionPMin,
00043                               double pionEnergy,
00044                               std::vector<double>& lengthRatio,
00045                               std::vector< std::vector<double> >& ratios,
00046                               std::map<int,int >& idMap,
00047                               std::string inputFile,
00048                               unsigned int distAlgo,
00049                               double distCut,
00050                               const RandomEngine* engine);
00051 
00053   ~NuclearInteractionSimulator();
00054 
00056   void save();
00057 
00059   bool read(std::string inputFile);
00060 
00061  private:
00062 
00064   void compute(ParticlePropagator& Particle);
00065 
00067   double distanceToPrimary(const RawParticle& Particle,
00068                            const RawParticle& aDaughter) const;
00069 
00071   unsigned index(int thePid);
00072 
00073   std::vector<double> thePionEN;
00074   std::vector<int> thePionID;
00075   std::vector<std::string> thePionNA;
00076   std::vector<double> thePionMA;
00077   std::vector<double> thePionPMin;
00078   double thePionEnergy;
00079   std::vector<double> theLengthRatio;
00080   std::vector< std::vector<double> > theRatios;
00081 
00082   std::vector< std::vector<TFile*> > theFiles;
00083   std::vector< std::vector<TTree*> > theTrees;
00084   std::vector< std::vector<TBranch*> > theBranches;
00085   std::vector< std::vector<NUEvent*> > theNUEvents;
00086   std::vector< std::vector<unsigned> > theCurrentEntry;
00087   std::vector< std::vector<unsigned> > theCurrentInteraction;
00088   std::vector< std::vector<unsigned> > theNumberOfEntries;
00089   std::vector< std::vector<unsigned> > theNumberOfInteractions;
00090   std::vector< std::vector<std::string> > theFileNames;
00091   std::vector< std::vector<double> > thePionCM;
00092   
00093   std::map< int, int > theIDMap;
00094   unsigned ien4;
00095   unsigned theDistAlgo;
00096   double theDistCut;
00097 
00098   std::ofstream myOutputFile;
00099   unsigned myOutputBuffer;
00100 
00101   //  DaqMonitorBEInterface * dbe;
00102   //  MonitorElement* hAfter;
00103   //  MonitorElement* hAfter2;
00104   //  MonitorElement* hAfter3;
00105   //  MonitorElement* htot;
00106   //  MonitorElement* helas;
00107   //  MonitorElement* hinel;
00108   //  MonitorElement* hscatter;
00109   //  MonitorElement* hscatter2;
00110 
00111 };
00112 #endif