CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
anlzrname Class Reference
Inheritance diagram for anlzrname:
edm::EDAnalyzer

Public Member Functions

 anlzrname (const edm::ParameterSet &)
 
 ~anlzrname ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 

Private Attributes

example_histo TH1D * histo
 
example_track edm::InputTag trackTags_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 42 of file edanalyzer.cc.

Constructor & Destructor Documentation

anlzrname::anlzrname ( const edm::ParameterSet iConfig)
explicit

Definition at line 76 of file edanalyzer.cc.

References trackerHits::histo.

77  :
78 @example_track trackTags_(iConfig.getUntrackedParameter<edm::InputTag>("tracks"))
79 
80 {
81  //now do what ever initialization is needed
82 @example_histo edm::Service<TFileService> fs;
83 @example_histo histo = fs->make<TH1D>("charge" , "Charges" , 200 , -2 , 2 );
84 
85 }
T getUntrackedParameter(std::string const &, T const &) const
example_track edm::InputTag trackTags_
Definition: edanalyzer.cc:61
example_histo TH1D * histo
Definition: edanalyzer.cc:62
anlzrname::~anlzrname ( )

Definition at line 88 of file edanalyzer.cc.

89 {
90 
91  // do anything here that needs to be done at desctruction time
92  // (e.g. close files, deallocate resources etc.)
93 
94 }

Member Function Documentation

void anlzrname::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 103 of file edanalyzer.cc.

References DeDxDiscriminatorTools::charge(), edm::EventSetup::get(), edm::Event::getByLabel(), histo, testEve_cfg::tracks, and trackTags_.

104 {
105  using namespace edm;
106 
107 @example_track using reco::TrackCollection;
108 
109 @example_track Handle<TrackCollection> tracks;
110 @example_track iEvent.getByLabel(trackTags_,tracks);
111 @example_track for(TrackCollection::const_iterator itTrack = tracks->begin();
112 @example_track itTrack != tracks->end();
113 @example_track ++itTrack) {
114 @example_track_histo int charge = 0;
115 @example_track charge = itTrack->charge();
116 @example_histo histo->Fill( charge );
117 @example_track }
118 
119 #ifdef THIS_IS_AN_EVENT_EXAMPLE
121  iEvent.getByLabel("example",pIn);
122 #endif
123 
124 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
125  ESHandle<SetupData> pSetup;
126  iSetup.get<SetupRecord>().get(pSetup);
127 #endif
128 }
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
double charge(const std::vector< uint8_t > &Ampls)
example_track edm::InputTag trackTags_
Definition: edanalyzer.cc:61
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
tuple tracks
Definition: testEve_cfg.py:39
const T & get() const
Definition: EventSetup.h:55
example_histo TH1D * histo
Definition: edanalyzer.cc:62
void anlzrname::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 133 of file edanalyzer.cc.

134 {
135 }
void anlzrname::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 157 of file edanalyzer.cc.

158 {
159 }
void anlzrname::beginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 145 of file edanalyzer.cc.

146 {
147 }
void anlzrname::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 139 of file edanalyzer.cc.

140 {
141 }
void anlzrname::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 163 of file edanalyzer.cc.

164 {
165 }
void anlzrname::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 151 of file edanalyzer.cc.

152 {
153 }
void anlzrname::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 169 of file edanalyzer.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

169  {
170  //The following says we do not know what parameters are allowed so do no validation
171  // Please change this to state exactly what you do use, even if it is no parameters
173  desc.setUnknown();
174  descriptions.addDefault(desc);
175 @example_track
176 @example_track //Specify that only 'tracks' is allowed
177 @example_track //To use, remove the default given above and uncomment below
178 @example_track //ParameterSetDescription desc;
179 @example_track //desc.addUntracked<edm::InputTag>("tracks","ctfWithMaterialTracks");
180 @example_track //descriptions.addDefault(desc);
181 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

example_histo TH1D* anlzrname::histo
private

Definition at line 62 of file edanalyzer.cc.

Referenced by analyze().

example_track edm::InputTag anlzrname::trackTags_
private

Definition at line 61 of file edanalyzer.cc.

Referenced by analyze().