File indexing completed on 2024-04-06 12:11:25
0001 #ifndef TRAJECTORYMANAGER_H
0002 #define TRAJECTORYMANAGER_H
0003
0004
0005 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
0006 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
0007 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0008
0009
0010 #include "FastSimulation/MaterialEffects/interface/MaterialEffects.h"
0011
0012 #include "Math/GenVector/AxisAngle.h"
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 #include <vector>
0038 #include <map>
0039
0040 class PythiaDecays;
0041 class TrackerInteractionGeometry;
0042 class TrackerLayer;
0043 class ParticlePropagator;
0044 class FSimEvent;
0045
0046 class RandomEngineAndDistribution;
0047 class TrajectoryStateOnSurface;
0048 class DetLayer;
0049 class MagneticField;
0050 class MagneticFieldMap;
0051 class GeometricSearchTracker;
0052 class TrackerGeometry;
0053 class TrackerTopology;
0054
0055 namespace edm {
0056 class ParameterSet;
0057 }
0058
0059 class TrajectoryManager
0060
0061 {
0062 public:
0063 typedef ROOT::Math::AxisAngle Rotation;
0064
0065
0066 TrajectoryManager() { ; }
0067
0068
0069 TrajectoryManager(FSimEvent* aSimEvent,
0070 const edm::ParameterSet& matEff,
0071 const edm::ParameterSet& simHits,
0072 const edm::ParameterSet& decays);
0073
0074
0075 ~TrajectoryManager();
0076
0077
0078 void reconstruct(const TrackerTopology* tTopo, RandomEngineAndDistribution const*);
0079
0080
0081 void createPSimHits(const TrackerLayer& layer,
0082 const ParticlePropagator& P_before,
0083 std::map<double, PSimHit>& theHitMap,
0084 int trackID,
0085 int partID,
0086 const TrackerTopology* tTopo);
0087
0088
0089 void propagateToCalorimeters(ParticlePropagator& PP, int fsimi, RandomEngineAndDistribution const*);
0090
0091
0092
0093 bool propagateToLayer(ParticlePropagator& PP, unsigned layer);
0094
0095
0096 const TrackerInteractionGeometry* theGeometry();
0097
0098
0099 void initializeRecoGeometry(const GeometricSearchTracker* geomSearchTracker,
0100 const TrackerInteractionGeometry* interactionGeometry,
0101 const MagneticFieldMap* aFieldMap);
0102
0103
0104 void initializeTrackerGeometry(const TrackerGeometry* geomTracker);
0105
0106
0107 void loadSimHits(edm::PSimHitContainer& c) const;
0108
0109 private:
0110
0111 void updateWithDaughters(ParticlePropagator& PP, int fsimi, RandomEngineAndDistribution const*);
0112
0113
0114 void moveAllDaughters(int fsimi, const Rotation& r, double rescale);
0115
0116
0117 void initializeLayerMap();
0118
0119
0120 TrajectoryStateOnSurface makeTrajectoryState(const DetLayer* layer,
0121 const ParticlePropagator& pp,
0122 const MagneticField* field) const;
0123
0124
0125 void makePSimHits(const GeomDet* det,
0126 const TrajectoryStateOnSurface& ts,
0127 std::map<double, PSimHit>& theHitMap,
0128 int tkID,
0129 float el,
0130 float thick,
0131 int pID,
0132 const TrackerTopology* tTopo);
0133
0134 std::pair<double, PSimHit> makeSinglePSimHit(const GeomDetUnit& det,
0135 const TrajectoryStateOnSurface& ts,
0136 int tkID,
0137 float el,
0138 float thick,
0139 int pID,
0140 const TrackerTopology* tTopo) const;
0141
0142
0143 const DetLayer* detLayer(const TrackerLayer& layer, float zpos) const;
0144
0145 private:
0146 FSimEvent* mySimEvent;
0147
0148 const TrackerInteractionGeometry* _theGeometry;
0149 const MagneticFieldMap* _theFieldMap;
0150
0151 MaterialEffects* theMaterialEffects;
0152
0153 PythiaDecays* myDecayEngine;
0154 std::string decayer;
0155 double distCut;
0156
0157 double pTmin;
0158 bool firstLoop;
0159 std::map<unsigned, std::map<double, PSimHit> > thePSimHits;
0160
0161 const TrackerGeometry* theGeomTracker;
0162 const GeometricSearchTracker* theGeomSearchTracker;
0163 std::vector<const DetLayer*> theLayerMap;
0164 int theNegLayerOffset;
0165
0166
0167
0168 bool use_hardcoded;
0169 };
0170 #endif