18 #include "TStopwatch.h" 31 if ( argc < 4 )
return 0;
34 gSystem->Load(
"libFWCoreFWLite" );
40 TH1F* jetPt_ = theDir.
make<TH1F>(
"jetPt",
"pt", 100, 0.,300.);
41 TH1F* jetEta_ = theDir.
make<TH1F>(
"jetEta",
"eta", 100, -3., 3.);
42 TH1F* jetPhi_ = theDir.
make<TH1F>(
"jetPhi",
"phi", 100, -5., 5.);
43 TH1F* disc_ = theDir.
make<TH1F>(
"disc",
"Discriminant", 100, 0.0, 10.0);
44 TH1F* constituentPt_ = theDir.
make<TH1F>(
"constituentPt",
"Constituent pT", 100, 0, 300.0);
47 TFile* inFile = TFile::Open( argv[1] );
64 unsigned int nEventsAnalyzed = 0;
71 event.getByLabel(jetLabel, jets);
74 for(
unsigned i=0;
i<jets->size(); ++
i){
75 jetPt_ ->Fill( (*jets)[
i].
pt() );
76 jetEta_->Fill( (*jets)[
i].
eta() );
77 jetPhi_->Fill( (*jets)[
i].
phi() );
79 if ( svTagInfos != 0 ) {
83 std::vector<CaloTowerPtr>
const & caloConstituents = (*jets)[
i].getCaloConstituents();
84 for ( std::vector<CaloTowerPtr>::const_iterator ibegin = caloConstituents.begin(),
85 iend = caloConstituents.end(),
86 iconstituent = ibegin;
87 iconstituent != iend; ++iconstituent ) {
88 constituentPt_->Fill( (*iconstituent)->pt() );
99 Double_t rtime = timer.RealTime();
100 Double_t ctime = timer.CpuTime();
101 printf(
"Analyzed events: %d \n",nEventsAnalyzed);
102 printf(
"RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
103 printf(
"%4.2f events / RealTime second .\n", (
double)nEventsAnalyzed/rtime);
104 printf(
"%4.2f events / CpuTime second .\n", (
double)nEventsAnalyzed/ctime);
Event const & toBegin() override
Go to the very first Event.
bool atEnd() const override
static void enable()
enable automatic library loading
T * make(const Args &...args) const
make new ROOT object
unsigned int nVertices() const
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
int main(int argc, char *argv[])
Measurement1D flightDistance(unsigned int index, int dim=0) const