test
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 | Static Private Member Functions | Private Attributes | Static Private Attributes
examples::TrackAnalysisAlgorithm Struct Reference

#include <TrackAnalysisAlgorithm.h>

Public Member Functions

void postProcess (TList &)
 post process More...
 
void process (const edm::Event &)
 process one event More...
 
 TrackAnalysisAlgorithm (const TList *, TList &)
 constructor More...
 

Static Public Member Functions

static void terminate (TList &)
 terminate processing More...
 

Static Private Member Functions

static void draw (const TList &, TCanvas &, const char *)
 draw an histogram More...
 

Private Attributes

TH1F * h_eta
 
TH1F * h_pt
 histograms More...
 

Static Private Attributes

static const char * kEta = "eta"
 
static const char * kPt = "pt"
 histogram names More...
 

Detailed Description

Definition at line 20 of file TrackAnalysisAlgorithm.h.

Constructor & Destructor Documentation

TrackAnalysisAlgorithm::TrackAnalysisAlgorithm ( const TList *  ,
TList &  out 
)

constructor

Definition at line 18 of file TrackAnalysisAlgorithm.cc.

References gather_cfg::cout, JetComb::kEta, and kPt.

18  {
19  cout << ">> booking histograms" << endl;
20  out.Add( h_pt = new TH1F( kPt , "pt" , 100, 0, 20 ) );
21  out.Add( h_eta = new TH1F( kEta, "#eta", 100, -3, 3 ) );
22 }
static const char * kPt
histogram names
tuple cout
Definition: gather_cfg.py:145

Member Function Documentation

void TrackAnalysisAlgorithm::draw ( const TList &  out,
TCanvas &  canvas,
const char *  k 
)
staticprivate

draw an histogram

Definition at line 49 of file TrackAnalysisAlgorithm.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, and estimatePileup::hist.

49  {
50  TObject * hist = out.FindObject( k );
51  if( 0 != hist ) {
52  hist->Draw();
53  canvas.SaveAs( ( string( k ) + ".jpg" ).c_str() );
54  } else {
55  cerr <<">> no '" << k << "' histogram" << endl;
56  }
57 }
def canvas
Definition: svgfig.py:481
void TrackAnalysisAlgorithm::postProcess ( TList &  )

post process

Definition at line 38 of file TrackAnalysisAlgorithm.cc.

References gather_cfg::cout.

38  {
39  cout << ">> nothing to be done in post-processing" << endl;
40 }
tuple cout
Definition: gather_cfg.py:145
void TrackAnalysisAlgorithm::process ( const edm::Event event)

process one event

Definition at line 24 of file TrackAnalysisAlgorithm.cc.

References gather_cfg::cout, reco::TrackBase::eta(), i, reco::TrackBase::pt(), and testEve_cfg::tracks.

Referenced by ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_PATFILTER(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder::scheduleSequence().

24  {
25  cout << ">> processing event " << endl;
27  event.getByLabel( "ctfWithMaterialTracks", tracks );
28 
29  cout << ">> tracks found:" << tracks->size() << endl;
30  for ( size_t i = 0; i < tracks->size(); ++i ) {
31  const Track & track = ( * tracks )[ i ];
32  h_pt ->Fill( track.pt() );
33  h_eta->Fill( track.eta() );
34  cout << ">> pt, eta: " << track.pt() << ", " << track.eta() << endl;
35  }
36 }
int i
Definition: DBlmapReader.cc:9
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:646
double pt() const
track transverse momentum
Definition: TrackBase.h:616
tuple tracks
Definition: testEve_cfg.py:39
tuple cout
Definition: gather_cfg.py:145
void TrackAnalysisAlgorithm::terminate ( TList &  out)
static

terminate processing

Definition at line 42 of file TrackAnalysisAlgorithm.cc.

References svgfig::canvas(), gather_cfg::cout, JetComb::kEta, and kPt.

42  {
43  cout << ">> terminating" << endl;
44  TCanvas canvas;
45  draw( out, canvas, kPt );
46  draw( out, canvas, kEta );
47 }
def canvas
Definition: svgfig.py:481
static void draw(const TList &, TCanvas &, const char *)
draw an histogram
static const char * kPt
histogram names
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

TH1F * examples::TrackAnalysisAlgorithm::h_eta
private

Definition at line 33 of file TrackAnalysisAlgorithm.h.

TH1F* examples::TrackAnalysisAlgorithm::h_pt
private

histograms

Definition at line 33 of file TrackAnalysisAlgorithm.h.

const char * TrackAnalysisAlgorithm::kEta = "eta"
staticprivate

Definition at line 35 of file TrackAnalysisAlgorithm.h.

const char * TrackAnalysisAlgorithm::kPt = "pt"
staticprivate

histogram names

Definition at line 35 of file TrackAnalysisAlgorithm.h.