CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/FastSimulation/TrajectoryManager/interface/TrajectoryManager.h

Go to the documentation of this file.
00001 #ifndef TRAJECTORYMANAGER_H
00002 #define TRAJECTORYMANAGER_H
00003 
00004 //DataFormats
00005 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
00006 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
00007 
00008 //FAMOS Headers
00009 #include "FastSimulation/MaterialEffects/interface/MaterialEffects.h"
00010 
00011 #include "Math/GenVector/AxisAngle.h"
00012 
00036 #include <vector>
00037 #include <map>
00038 
00039 class PythiaDecays;
00040 class TrackerInteractionGeometry;
00041 class TrackerLayer;
00042 class ParticlePropagator;
00043 class FSimEvent;
00044 //class Histos;
00045 class RandomEngine;
00046 class TrajectoryStateOnSurface;
00047 class DetLayer;
00048 class GeomDet;
00049 class GeomDetUnit;
00050 class MagneticField;
00051 class MagneticFieldMap;
00052 class GeometricSearchTracker;
00053 class TrackerGeometry;
00054 
00055 namespace edm { 
00056   class ParameterSet;
00057 }
00058 
00059 class TrajectoryManager
00060 
00061 {
00062  public:
00063 
00064   typedef ROOT::Math::AxisAngle Rotation;
00065 
00067   TrajectoryManager() {;}
00068 
00070   TrajectoryManager(FSimEvent* aSimEvent, 
00071                     const edm::ParameterSet& matEff,
00072                     const edm::ParameterSet& simHits,
00073                     const edm::ParameterSet& decays,
00074                     const RandomEngine* engine);
00075 
00077   ~TrajectoryManager();
00078   
00080   void reconstruct();
00081 
00083   void createPSimHits(const TrackerLayer& layer,
00084                       const ParticlePropagator& P_before,
00085                       std::map<double,PSimHit>& theHitMap,
00086                       int trackID, int partID);
00087 
00089   void propagateToCalorimeters(ParticlePropagator& PP, 
00090                                int fsimi);
00091 
00092 
00095   bool propagateToLayer(ParticlePropagator& PP,unsigned layer);
00096 
00098   const TrackerInteractionGeometry* theGeometry();
00099 
00101   void initializeRecoGeometry(const GeometricSearchTracker* geomSearchTracker,
00102                               const TrackerInteractionGeometry* interactionGeometry,
00103                               const MagneticFieldMap* aFieldMap);
00104 
00106   void initializeTrackerGeometry(const TrackerGeometry* geomTracker);
00107 
00108   // load container from edm::Event
00109   void loadSimHits(edm::PSimHitContainer & c) const;
00110 
00111  private:
00112 
00114   void updateWithDaughters(ParticlePropagator& PP, int fsimi);
00115 
00117   void moveAllDaughters(int fsimi, const Rotation& r, double rescale);
00118 
00120   void initializeLayerMap();
00121 
00123   TrajectoryStateOnSurface makeTrajectoryState( const DetLayer* layer, 
00124                                                 const ParticlePropagator& pp,
00125                                                 const MagneticField* field) const;
00126 
00128   void makePSimHits( const GeomDet* det, const TrajectoryStateOnSurface& ts,
00129                      std::map<double,PSimHit>& theHitMap,
00130                      int tkID, float el, float thick, int pID);
00132   std::pair<double,PSimHit> makeSinglePSimHit( const GeomDetUnit& det,
00133                                                const TrajectoryStateOnSurface& ts, 
00134                                                int tkID, float el, float thick, int pID) const;
00135 
00137   const DetLayer* detLayer( const TrackerLayer& layer, float zpos) const;
00138 
00139  private:
00140 
00141   FSimEvent* mySimEvent;
00142 
00143   const TrackerInteractionGeometry* _theGeometry;
00144   const MagneticFieldMap* _theFieldMap;
00145   
00146   MaterialEffects* theMaterialEffects;
00147 
00148   PythiaDecays* myDecayEngine;
00149   std::string decayer;
00150   double distCut;
00151 
00152   double pTmin;
00153   bool firstLoop;
00154   std::map<unsigned,std::map<double,PSimHit> > thePSimHits;
00155 
00156   const TrackerGeometry*                      theGeomTracker;
00157   const GeometricSearchTracker*               theGeomSearchTracker;
00158   std::vector<const DetLayer*>                theLayerMap;
00159   int                                         theNegLayerOffset;
00160 
00161   //  Histos* myHistos;
00162 
00163   const RandomEngine* random;
00164 
00165 };
00166 #endif