31 @example_track #
include "FWCore/Utilities/interface/InputTag.h"
32 @example_track #
include "DataFormats/TrackReco/interface/Track.h"
33 @example_track #
include "DataFormats/TrackReco/interface/TrackFwd.h"
34 @example_histo #
include "FWCore/ServiceRegistry/interface/Service.h"
35 @example_histo #
include "CommonTools/UtilAlgos/interface/TFileService.h"
58 virtual void endJob()
override;
78 @example_track trackTags_(iConfig.getUntrackedParameter<
edm::InputTag>(
"tracks"))
82 usesResource(
"TFileService");
84 @example_histo
histo = fs->make<TH1D>(
"charge" ,
"Charges" , 200 , -2 , 2 );
112 @example_track
for(TrackCollection::const_iterator itTrack =
tracks->begin();
113 @example_track itTrack !=
tracks->end();
114 @example_track ++itTrack) {
115 @example_track
int charge = 0;
116 @example_track charge = itTrack->charge();
117 @example_histo
histo->Fill( charge );
120 #ifdef THIS_IS_AN_EVENT_EXAMPLE
125 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
127 iSetup.
get<SetupRecord>().
get(pSetup);
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_MODULE(type)
std::vector< Track > TrackCollection
collection of Tracks
example_track edm::InputTag trackTags_
example_histo TH1D * histo
void addDefault(ParameterSetDescription const &psetDescription)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
bool include(const CollT &coll, const ItemT &item)
virtual void endJob() override
virtual void beginJob() override