Go to the documentation of this file.00001 #ifndef SimG4CMS_DreamSD_h
00002 #define SimG4CMS_DreamSD_h
00003
00004 #include "SimG4CMS/Calo/interface/CaloSD.h"
00005
00006 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00007
00008 #include "G4String.hh"
00009 #include "G4PhysicsOrderedFreeVector.hh"
00010
00011 #include <map>
00012
00013 const int MAXPHOTONS = 500;
00014
00015 class G4LogicalVolume;
00016
00017 class TTree;
00018
00019 class DreamSD : public CaloSD {
00020
00021 public:
00022
00023 DreamSD(G4String, const DDCompactView &, SensitiveDetectorCatalog &,
00024 edm::ParameterSet const &, const SimTrackManager*);
00025 virtual ~DreamSD() {}
00026 virtual bool ProcessHits(G4Step * step,G4TouchableHistory * tHistory);
00027 virtual uint32_t setDetUnitId(G4Step*);
00028
00029 protected:
00030
00031 virtual G4bool getStepInfo(G4Step* aStep);
00032 virtual void initRun();
00033
00034 private:
00035
00036 typedef std::pair<double,double> Doubles;
00037 typedef std::map<G4LogicalVolume*,Doubles> DimensionMap;
00038
00039 void initMap(G4String, const DDCompactView &);
00040 double curve_LY(G4Step*, int);
00041 const double crystalLength(G4LogicalVolume*) const;
00042 const double crystalWidth(G4LogicalVolume*) const;
00043
00045 double cherenkovDeposit_( G4Step* aStep );
00047 double getAverageNumberOfPhotons_(const double charge,
00048 const double beta,
00049 const G4Material* aMaterial,
00050 G4MaterialPropertyVector* rIndex );
00052 double getPhotonEnergyDeposit_( const G4ParticleMomentum& p,
00053 const G4ThreeVector& x,
00054 const G4Step* aStep );
00056 bool setPbWO2MaterialProperties_( G4Material* aMaterial );
00057
00058 bool useBirk, doCherenkov_, readBothSide_;
00059 double birk1, birk2, birk3;
00060 double slopeLY;
00061 DimensionMap xtalLMap;
00062
00063 int side;
00064
00066 std::auto_ptr<G4PhysicsOrderedFreeVector> chAngleIntegrals_;
00067 G4MaterialPropertiesTable* materialPropertiesTable;
00068
00069 TTree* ntuple_;
00070 int nphotons_;
00071 float px_[MAXPHOTONS],py_[MAXPHOTONS],pz_[MAXPHOTONS];
00072 float x_[MAXPHOTONS],y_[MAXPHOTONS],z_[MAXPHOTONS];
00073
00074 };
00075
00076 #endif // DreamSD_h