1 | #include <stdexcept>
|
---|
2 | #include <iostream>
|
---|
3 | #include <fstream>
|
---|
4 | #include <sstream>
|
---|
5 | #include <string>
|
---|
6 |
|
---|
7 | #include <stdlib.h>
|
---|
8 | #include <signal.h>
|
---|
9 | #include <stdio.h>
|
---|
10 |
|
---|
11 | #include "TROOT.h"
|
---|
12 | #include "TApplication.h"
|
---|
13 |
|
---|
14 | #include "TFile.h"
|
---|
15 | #include "TClonesArray.h"
|
---|
16 | #include "TChain.h"
|
---|
17 |
|
---|
18 | #include <cstdlib>
|
---|
19 | #include <TH2D.h>
|
---|
20 | #include <TCanvas.h>
|
---|
21 | #include <TRandom.h>
|
---|
22 | #include <TStyle.h>
|
---|
23 |
|
---|
24 |
|
---|
25 | #include "classes/DelphesClasses.h"
|
---|
26 |
|
---|
27 | #include "external/ExRootAnalysis/ExRootTreeReader.h"
|
---|
28 | #include "external/ExRootAnalysis/ExRootProgressBar.h"
|
---|
29 |
|
---|
30 | #include <iomanip>
|
---|
31 | #include <cmath>
|
---|
32 |
|
---|
33 | using namespace std;
|
---|
34 |
|
---|
35 | int main()
|
---|
36 | {
|
---|
37 |
|
---|
38 | // Create chain of root trees
|
---|
39 | TChain chain("Delphes");
|
---|
40 | //chain.Add("events_7TeV.root");
|
---|
41 | chain.Add("events_new.root");
|
---|
42 |
|
---|
43 |
|
---|
44 | // Create object of class ExRootTreeReader
|
---|
45 | ExRootTreeReader *treeReader = new ExRootTreeReader(&chain);
|
---|
46 | Long64_t numberOfEntries = treeReader->GetEntries();
|
---|
47 |
|
---|
48 | // Get pointers to branches used in this analysis
|
---|
49 |
|
---|
50 | TClonesArray *branchJet = treeReader->UseBranch("Jet");
|
---|
51 |
|
---|
52 | // define the number of B-jets in the event
|
---|
53 | int NofBs = 0;
|
---|
54 |
|
---|
55 | // Loop over all events
|
---|
56 | for(Int_t entry = 0; entry < numberOfEntries; ++entry)
|
---|
57 | {
|
---|
58 | // Load selected branches with data from specified event
|
---|
59 | treeReader->ReadEntry(entry);
|
---|
60 |
|
---|
61 | // set the number of B-jets in the event to 0
|
---|
62 | NofBs = 0;
|
---|
63 |
|
---|
64 | // If event contains at least 1 jet
|
---|
65 | for(unsigned int i = 0; i < branchJet->GetEntries(); i++)
|
---|
66 | {
|
---|
67 | // Take first jet
|
---|
68 | Jet *jet = (Jet*) branchJet->At(i);
|
---|
69 |
|
---|
70 | if (jet->BTag == 1) NofBs++;
|
---|
71 | }
|
---|
72 | cout << NofBs << endl;
|
---|
73 | }
|
---|
74 |
|
---|
75 | }
|
---|