Public Member Functions | |
anlzrname (const edm::ParameterSet &) | |
~anlzrname () | |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob (const edm::EventSetup &) |
virtual void | endJob () |
Private Attributes | |
example_histo TH1D * | histo |
example_track edm::InputTag | trackTags_ |
Implementation: <Notes on="" implementation>="">
Definition at line 42 of file edanalyzer.cc.
anlzrname::anlzrname | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 69 of file edanalyzer.cc.
References histo.
00070 : 00071 @example_track trackTags_(iConfig.getUntrackedParameter<edm::InputTag>("tracks")) 00072 00073 { 00074 //now do what ever initialization is needed 00075 @example_histo edm::Service<TFileService> fs; 00076 @example_histo histo = fs->make<TH1D>("charge" , "Charges" , 200 , -2 , 2 ); 00077 00078 }
anlzrname::~anlzrname | ( | ) |
Definition at line 81 of file edanalyzer.cc.
00082 { 00083 00084 // do anything here that needs to be done at desctruction time 00085 // (e.g. close files, deallocate resources etc.) 00086 00087 }
void anlzrname::analyze | ( | const edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 96 of file edanalyzer.cc.
References edm::EventSetup::get(), edm::Event::getByLabel(), histo, tracks, and trackTags_.
00097 { 00098 using namespace edm; 00099 00100 @example_track using reco::TrackCollection; 00101 00102 @example_track Handle<TrackCollection> tracks; 00103 @example_track iEvent.getByLabel(trackTags_,tracks); 00104 @example_track for(TrackCollection::const_iterator itTrack = tracks->begin(); 00105 @example_track itTrack != tracks->end(); 00106 @example_track ++itTrack) { 00107 @example_track_histo int charge = 0; 00108 @example_track charge = itTrack->charge(); 00109 @example_histo histo->Fill( charge ); 00110 @example_track } 00111 00112 #ifdef THIS_IS_AN_EVENT_EXAMPLE 00113 Handle<ExampleData> pIn; 00114 iEvent.getByLabel("example",pIn); 00115 #endif 00116 00117 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE 00118 ESHandle<SetupData> pSetup; 00119 iSetup.get<SetupRecord>().get(pSetup); 00120 #endif 00121 }
void anlzrname::beginJob | ( | const edm::EventSetup & | ) | [private, virtual] |
example_histo TH1D* anlzrname::histo [private] |
example_track edm::InputTag anlzrname::trackTags_ [private] |