Go to the documentation of this file.00001 #ifndef SimG4CMS_ShowerLibraryProducer_HFWedgeSD_h
00002 #define SimG4CMS_ShowerLibraryProducer_HFWedgeSD_h
00003
00004 #include "SimG4Core/SensitiveDetector/interface/SensitiveCaloDetector.h"
00005 #include "SimG4Core/Application/interface/SimTrackManager.h"
00006
00007 #include "SimG4CMS/ShowerLibraryProducer/interface/HFShowerG4Hit.h"
00008 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00009
00010
00011 #include "G4VPhysicalVolume.hh"
00012 #include "G4Track.hh"
00013
00014 #include <iostream>
00015 #include <fstream>
00016 #include <vector>
00017 #include <map>
00018
00019 class G4Step;
00020 class G4HCofThisEvent;
00021
00022 class HFWedgeSD : public SensitiveCaloDetector {
00023
00024 public:
00025
00026 HFWedgeSD(std::string name, const DDCompactView & cpv,
00027 SensitiveDetectorCatalog & clg,
00028 edm::ParameterSet const & p, const SimTrackManager*);
00029 virtual ~HFWedgeSD();
00030
00031 virtual void Initialize(G4HCofThisEvent * HCE);
00032 virtual bool ProcessHits(G4Step * step,G4TouchableHistory * tHistory);
00033 virtual void EndOfEvent(G4HCofThisEvent * eventHC);
00034 virtual void clear();
00035 virtual void DrawAll();
00036 virtual void PrintAll();
00037
00038 protected:
00039
00040 G4bool hitExists();
00041 HFShowerG4Hit* createNewHit();
00042 void updateHit(HFShowerG4Hit*);
00043
00044 virtual void clearHits();
00045 virtual uint32_t setDetUnitId(G4Step*);
00046 virtual void fillHits(edm::PCaloHitContainer&, std::string);
00047
00048
00049 private:
00050
00051 std::string theName;
00052 const SimTrackManager* m_trackManager;
00053
00054 int hcID;
00055 HFShowerG4HitsCollection* theHC;
00056 std::map<int,HFShowerG4Hit*> hitMap;
00057
00058 int currentID, previousID, trackID;
00059 double edep, time;
00060 G4ThreeVector globalPos, localPos, momDir;
00061 HFShowerG4Hit* currentHit;
00062 };
00063
00064 #endif