CMS 3D CMS Logo

Functions
TopElecFWLiteAnalyzer.cc File Reference
#include <memory>
#include <string>
#include <cstdlib>
#include <sstream>
#include <fstream>
#include <iostream>
#include "FWCore/FWLite/interface/FWLiteEnabler.h"
#include "DataFormats/PatCandidates/interface/Electron.h"
#include "TopQuarkAnalysis/Examples/bin/NiceStyle.cc"
#include "TopQuarkAnalysis/Examples/interface/RootSystem.h"
#include "TopQuarkAnalysis/Examples/interface/RootHistograms.h"
#include "TopQuarkAnalysis/Examples/interface/RootPostScript.h"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

===============================================================================================================================================================================================


variant2: for each run define phi-averaged A for normalization channel (Dref,16) and then, divide Rijk on it, i.e. get RRijk

eta=27

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=19

eta=17

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=20

eta=19

eta=18

eta=27 L1=1

eta=25 L1=1

eta=23 L1=1

eta=22 L1=1

eta=21 L1=1

eta=29 L1=1

eta=26 L1=1

eta=24 L1=1

eta=20 L1=1

eta=19 L1=1

eta=18 L1=1

eta=17 L1=1

eta=28 L7=1

eta=27 L7=1

eta=25 L7=1

eta=23 L7=1

eta=22 L7=1

eta=21 L7=1

eta=26 L7=1

eta=24 L7=1

eta=20 L7=1

eta=19 L7=1

eta=18 L7=1

eta=17 L7=1

eta=27

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=19

eta=17

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=20

eta=19

eta=18

eta=27 L1=1

eta=25 L1=1

eta=23 L1=1

eta=22 L1=1

eta=21 L1=1

eta=26 L1=1

eta=24 L1=1

eta=20 L1=1

eta=19 L1=1

eta=18 L1=1

eta=17 L1=1

eta=28 L7=1

eta=27 L7=1

eta=25 L7=1

eta=23 L7=1

eta=22 L7=1

eta=21 L7=1

eta=26 L7=1

eta=24 L7=1

eta=20 L7=1

eta=19 L7=1

eta=18 L7=1

eta=17 L7=1

eta=27

eta=28

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

RBX:

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

RBX:

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

RBX:

Prepare maps of good/bad channels:

Prepare maps of good/bad channels:


CALO JETS


PF JETS

Definition at line 16 of file TopElecFWLiteAnalyzer.cc.

16  {
17  if (argc < 3) {
18  // -------------------------------------------------
19  std::cerr << "ERROR:: "
20  << "Wrong number of arguments! Please specify:" << std::endl
21  << " * filepath" << std::endl
22  << " * process name" << std::endl;
23  // -------------------------------------------------
24  return -1;
25  }
26 
27  // load framework libraries
28  gSystem->Load("libFWCoreFWLite");
30 
31  // set nice style for histograms
32  setNiceStyle();
33 
34  // define some histograms
35  TH1I* noElecs = new TH1I("noElecs", "N_{Elecs}", 10, 0, 10);
36  TH1F* ptElecs = new TH1F("ptElecs", "pt_{Elecs}", 100, 0., 300.);
37  TH1F* enElecs = new TH1F("enElecs", "energy_{Elecs}", 100, 0., 300.);
38  TH1F* etaElecs = new TH1F("etaElecs", "eta_{Elecs}", 100, -3., 3.);
39  TH1F* phiElecs = new TH1F("phiElecs", "phi_{Elecs}", 100, -5., 5.);
40 
41  // -------------------------------------------------
42  std::cout << "open file: " << argv[1] << std::endl;
43  // -------------------------------------------------
44  TFile* inFile = TFile::Open(argv[1]);
45  TTree* events_ = nullptr;
46  if (inFile)
47  inFile->GetObject("Events", events_);
48  if (events_ == nullptr) {
49  // -------------------------------------------------
50  std::cerr << "ERROR:: "
51  << "Unable to retrieve TTree Events!" << std::endl
52  << " Eighter wrong file name or the the tree doesn't exists" << std::endl;
53  // -------------------------------------------------
54  return -1;
55  }
56 
57  // acess branch of elecs
58  char elecName[50];
59  sprintf(elecName, "patElectrons_selectedPatElectrons__%s.obj", argv[2]);
60  TBranch* elecs_ = events_->GetBranch(elecName);
61  assert(elecs_ != nullptr);
62 
63  // loop over events and fill histograms
64  std::vector<pat::Electron> elecs;
65  int nevt = events_->GetEntries();
66 
67  // -------------------------------------------------
68  std::cout << "start looping " << nevt << " events..." << std::endl;
69  // -------------------------------------------------
70  for (int evt = 0; evt < nevt; ++evt) {
71  // set branch address
72  elecs_->SetAddress(&elecs);
73  // get event
74  elecs_->GetEntry(evt);
75  events_->GetEntry(evt, 0);
76 
77  // -------------------------------------------------
78  if (evt > 0 && !(evt % 10))
79  std::cout << " processing event: " << evt << std::endl;
80  // -------------------------------------------------
81 
82  // fill histograms
83  noElecs->Fill(elecs.size());
84  for (unsigned idx = 0; idx < elecs.size(); ++idx) {
85  // fill histograms
86  ptElecs->Fill(elecs[idx].pt());
87  enElecs->Fill(elecs[idx].energy());
88  etaElecs->Fill(elecs[idx].eta());
89  phiElecs->Fill(elecs[idx].phi());
90  }
91  }
92  // -------------------------------------------------
93  std::cout << "close file" << std::endl;
94  // -------------------------------------------------
95  inFile->Close();
96 
97  // save histograms to file
98  TFile outFile("analyzeElecs.root", "recreate");
99  outFile.mkdir("analyzeElec");
100  outFile.cd("analyzeElec");
101  noElecs->Write();
102  ptElecs->Write();
103  enElecs->Write();
104  etaElecs->Write();
105  phiElecs->Write();
106  outFile.Close();
107 
108  // free allocated space
109  delete noElecs;
110  delete ptElecs;
111  delete enElecs;
112  delete etaElecs;
113  delete phiElecs;
114 
115  return 0;
116 }

References dir2webdir::argc, cmsBatch::argv, cms::cuda::assert(), EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, singleTopDQM_cfi::elecs, FWLiteEnabler::enable(), HCALHighEnergyHPDFilter_cfi::energy, PVValHelper::eta, heavyIonCSV_trainingSettings::idx, nevt, L1TdeCSCTF_cfi::outFile, PVValHelper::phi, DiDispStaMuonMonitor_cfi::pt, and setNiceStyle().

cmsBatch.argv
argv
Definition: cmsBatch.py:279
dir2webdir.argc
argc
Definition: dir2webdir.py:39
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
gather_cfg.cout
cout
Definition: gather_cfg.py:144
cms::cuda::assert
assert(be >=bs)
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
setNiceStyle
void setNiceStyle()
Definition: NiceStyle.cc:3
PVValHelper::eta
Definition: PVValidationHelpers.h:69
singleTopDQM_cfi.elecs
elecs
Definition: singleTopDQM_cfi.py:41
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
L1TdeCSCTF_cfi.outFile
outFile
Definition: L1TdeCSCTF_cfi.py:5
FWLiteEnabler::enable
static void enable()
enable automatic library loading
Definition: FWLiteEnabler.cc:46
PVValHelper::phi
Definition: PVValidationHelpers.h:68
nevt
int nevt
Definition: ReggeGribovPartonMCHadronizer.h:66
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8