CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/SimTracker/TrackerMaterialAnalysis/plugins/TrackingMaterialProducer.h

Go to the documentation of this file.
00001 #ifndef TrackingMaterialProducer_h
00002 #define TrackingMaterialProducer_h
00003 #include <string>
00004 #include <vector>
00005  
00006 #include "SimG4Core/Watcher/interface/SimProducer.h"
00007 #include "SimG4Core/Notification/interface/Observer.h"
00008 
00009 #include "G4LogicalVolume.hh"
00010 
00011 #include "SimDataFormats/ValidationFormats/interface/MaterialAccountingTrack.h"
00012 
00013 class BeginOfJob;
00014 class BeginOfEvent;
00015 class BeginOfTrack;
00016 class EndOfTrack;
00017 class G4Step;
00018 
00019 class G4StepPoint;
00020 class G4VTouchable;
00021 class G4VPhysicalVolume;
00022 class G4LogicalVolume;
00023 
00024 class TrackingMaterialProducer : public SimProducer,
00025                                  public Observer<const BeginOfJob*>,
00026                                  public Observer<const BeginOfEvent*>,
00027                                  public Observer<const BeginOfTrack*>,
00028                                  public Observer<const G4Step*>,
00029                                  public Observer<const EndOfTrack*>
00030 {
00031 public:
00032   TrackingMaterialProducer(const edm::ParameterSet&);
00033   virtual ~TrackingMaterialProducer();
00034   
00035 private:
00036   void update(const BeginOfJob*);
00037   void update(const BeginOfEvent*);
00038   void update(const BeginOfTrack*);
00039   void update(const G4Step*);
00040   void update(const EndOfTrack*);
00041   void produce(edm::Event&, const edm::EventSetup&);
00042  
00043   bool isSelected( const G4VTouchable* touch );
00044 
00045 private:
00046   bool                                  m_primaryTracks;
00047   std::vector<std::string>              m_selectedNames; 
00048   std::vector<const G4LogicalVolume *>  m_selectedVolumes;
00049   MaterialAccountingTrack               m_track;
00050   std::vector<MaterialAccountingTrack>* m_tracks;  
00051 };
00052 
00053 #endif // TrackingMaterialProducer_h