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 ) );
25 cout <<
">> processing event " << endl;
27 event.getByLabel(
"ctfWithMaterialTracks", tracks );
29 cout <<
">> tracks found:" << tracks->size() << endl;
30 for (
size_t i = 0;
i < tracks->size(); ++
i ) {
32 h_pt ->Fill( track.
pt() );
33 h_eta->Fill( track.
eta() );
34 cout <<
">> pt, eta: " << track.
pt() <<
", " << track.
eta() << endl;
39 cout <<
">> nothing to be done in post-processing" << endl;
43 cout <<
">> terminating" << endl;
45 draw( out, canvas,
kPt );
46 draw( out, canvas,
kEta );
50 TObject *
hist = out.FindObject( k );
53 canvas.SaveAs( (
string( k ) +
".jpg" ).c_str() );
55 cerr <<
">> no '" << k <<
"' histogram" << endl;
example_track example_track const char *const kPt
double eta() const
pseudorapidity of momentum vector
void process(const edm::Event &)
process one event
static void draw(const TList &, TCanvas &, const char *)
draw an histogram
double pt() const
track transverse momentum
static void terminate(TList &)
terminate processing
static const char * kPt
histogram names
TrackAnalysisAlgorithm(const TList *, TList &)
constructor
void postProcess(TList &)
post process