CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/SimG4CMS/Calo/interface/HCalSD.h

Go to the documentation of this file.
00001 #ifndef SimG4CMS_HCalSD_h
00002 #define SimG4CMS_HCalSD_h
00003 
00004 // File: HCalSD.h
00005 // Description: Stores hits of Hadron calorimeter in appropriate container
00006 // Use in your sensitive detector builder:
00007 //    HCalSD* hcalSD = new HCalSD(SDname, new CaloNumberingScheme());
00009 
00010 #include "SimG4CMS/Calo/interface/CaloSD.h"
00011 #include "SimG4CMS/Calo/interface/HFShower.h"
00012 #include "SimG4CMS/Calo/interface/HFShowerLibrary.h"
00013 #include "SimG4CMS/Calo/interface/HFShowerParam.h"
00014 #include "SimG4CMS/Calo/interface/HFShowerPMT.h"
00015 #include "SimG4CMS/Calo/interface/HFShowerFibreBundle.h"
00016 #include "SimG4CMS/Calo/interface/HcalNumberingScheme.h"
00017 #include "DetectorDescription/Core/interface/DDsvalues.h"
00018 #include "Geometry/HcalCommonData/interface/HcalNumberingFromDDD.h"
00019 
00020 #include "G4String.hh"
00021 #include <map>
00022 #include <string>
00023 #include <TH1F.h>
00024 
00025 class DDCompactView;
00026 class DDFilteredView;
00027 class G4LogicalVolume;
00028 class G4Material;
00029 class G4Step;
00030 
00031 class HCalSD : public CaloSD {
00032 
00033 public:    
00034 
00035   HCalSD(G4String , const DDCompactView &, SensitiveDetectorCatalog &,
00036          edm::ParameterSet const &, const SimTrackManager*);
00037   virtual ~HCalSD();
00038   virtual bool                  ProcessHits(G4Step * , G4TouchableHistory * );
00039   virtual double                getEnergyDeposit(G4Step* );
00040   virtual uint32_t              setDetUnitId(G4Step* step);
00041   void                          setNumberingScheme(HcalNumberingScheme* );
00042 
00043 protected:
00044 
00045   virtual void                  initRun();
00046   virtual bool                  filterHit(CaloG4Hit*, double);
00047 
00048 private:    
00049 
00050   uint32_t                      setDetUnitId(int, G4ThreeVector, int, int);
00051   std::vector<double>           getDDDArray(const std::string&, 
00052                                             const DDsvalues_type&);
00053   std::vector<G4String>         getNames(DDFilteredView&);
00054   bool                          isItHF(G4Step *);
00055   bool                          isItHF(G4String);
00056   bool                          isItFibre(G4LogicalVolume*);
00057   bool                          isItFibre(G4String);
00058   bool                          isItPMT(G4LogicalVolume*);
00059   bool                          isItStraightBundle(G4LogicalVolume*);
00060   bool                          isItConicalBundle(G4LogicalVolume*);
00061   bool                          isItScintillator(G4Material*);
00062   void                          getFromLibrary(G4Step * step);
00063   void                          hitForFibre(G4Step * step);
00064   void                          getFromParam(G4Step * step);
00065   void                          getHitPMT(G4Step * step);
00066   void                          getHitFibreBundle(G4Step * step, bool type);
00067   int                           setTrackID(G4Step * step);
00068   void                          readWeightFromFile(std::string);
00069   double                        layerWeight(int, G4ThreeVector, int, int);
00070   void                          plotProfile(G4Step* step, G4ThreeVector pos, 
00071                                             double edep, double time, int id);
00072 
00073   HcalNumberingFromDDD*         numberingFromDDD;
00074   HcalNumberingScheme*          numberingScheme;
00075   HFShowerLibrary *             showerLibrary;
00076   HFShower *                    hfshower;
00077   HFShowerParam *               showerParam;
00078   HFShowerPMT *                 showerPMT;
00079   HFShowerFibreBundle *         showerBundle;
00080   bool                          useBirk, useLayerWt, useFibreBundle, applyFidCut;
00081   double                        birk1, birk2, birk3, betaThr;
00082   bool                          useHF, useShowerLibrary, useParam, usePMTHit;
00083   double                        eminHitHB, eminHitHE, eminHitHO, eminHitHF;
00084   G4int                         mumPDG, mupPDG; 
00085   std::vector<double>           layer0wt;
00086   std::vector<G4LogicalVolume*> hfLV;
00087   std::vector<G4String>         hfNames;
00088   std::vector<int>              hfLevels;
00089   std::vector<G4LogicalVolume*> fibreLV;
00090   std::vector<G4String>         fibreNames;
00091   std::vector<G4String>         matNames;
00092   std::vector<G4Material*>      materials;
00093   std::vector<G4LogicalVolume*> pmtLV, fibre1LV, fibre2LV;
00094   std::map<uint32_t,double>     layerWeights;
00095   TH1F                          *hit_[9], *time_[9], *dist_[9];
00096 
00097 };
00098 
00099 #endif // HCalSD_h