CMS 3D CMS Logo

Functions
PatBasicFWLiteJetUnitTest.cc File Reference
#include <memory>
#include <string>
#include <vector>
#include <sstream>
#include <fstream>
#include <iostream>
#include <TH1F.h>
#include <TROOT.h>
#include <TFile.h>
#include <TSystem.h>
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/FWLite/interface/Event.h"
#include "DataFormats/PatCandidates/interface/Jet.h"
#include "FWCore/FWLite/interface/FWLiteEnabler.h"
#include "PhysicsTools/FWLite/interface/TFileService.h"
#include "TStopwatch.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:

Sticking ADC counts in neughbouring TS for HB:

Sticking ADC counts in neughbouring TS for HE:

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:

Prepare maps of good/bad channels:

Prepare maps of good/bad channels:


CALO JETS


PF JETS

Definition at line 20 of file PatBasicFWLiteJetUnitTest.cc.

References dir2webdir::argc, GCPpyPlots::argv, FWLiteEnabler::enable(), PVValHelper::eta, makeMEIFBenchmarkPlots::ev, compareTotals::fs, mps_fire::i, iEvent, testHGCalDigi_cfg::inFile, commonCuts_cff::jetLabel, PDWG_EXODelayedJetMET_cff::jets, TFileDirectory::make(), PVValHelper::phi, DiDispStaMuonMonitor_cfi::pt, HLT_2024v11_cff::svTagInfos, and align_cfg::TFileService.

20  {
21  // ----------------------------------------------------------------------
22  // First Part:
23  //
24  // * enable FWLite
25  // * book the histograms of interest
26  // * open the input file
27  // ----------------------------------------------------------------------
28 
29  if (argc < 4)
30  return 0;
31 
32  // load framework libraries
33  gSystem->Load("libFWCoreFWLite");
35 
36  // book a set of histograms
38  TFileDirectory theDir = fs.mkdir("analyzeBasicPat");
39  TH1F* jetPt_ = theDir.make<TH1F>("jetPt", "pt", 100, 0., 300.);
40  TH1F* jetEta_ = theDir.make<TH1F>("jetEta", "eta", 100, -3., 3.);
41  TH1F* jetPhi_ = theDir.make<TH1F>("jetPhi", "phi", 100, -5., 5.);
42  TH1F* disc_ = theDir.make<TH1F>("disc", "Discriminant", 100, 0.0, 10.0);
43  TH1F* constituentPt_ = theDir.make<TH1F>("constituentPt", "Constituent pT", 100, 0, 300.0);
44 
45  // open input file (can be located on castor)
46  TFile* inFile = TFile::Open(argv[1]);
47 
48  // ----------------------------------------------------------------------
49  // Second Part:
50  //
51  // * loop the events in the input file
52  // * receive the collections of interest via fwlite::Handle
53  // * fill the histograms
54  // * after the loop close the input file
55  // ----------------------------------------------------------------------
56 
57  // loop the events
58  unsigned int iEvent = 0;
60  TStopwatch timer;
61  timer.Start();
62 
63  unsigned int nEventsAnalyzed = 0;
64  for (ev.toBegin(); !ev.atEnd(); ++ev, ++iEvent) {
65  edm::EventBase const& event = ev;
66 
67  // Handle to the jet collection
70  event.getByLabel(jetLabel, jets);
71 
72  // loop jet collection and fill histograms
73  for (unsigned i = 0; i < jets->size(); ++i) {
74  jetPt_->Fill((*jets)[i].pt());
75  jetEta_->Fill((*jets)[i].eta());
76  jetPhi_->Fill((*jets)[i].phi());
77  reco::SecondaryVertexTagInfo const* svTagInfos = (*jets)[i].tagInfoSecondaryVertex("secondaryVertex");
78  if (svTagInfos != nullptr) {
79  if (svTagInfos->nVertices() > 0)
80  disc_->Fill(svTagInfos->flightDistance(0).value());
81  }
82  std::vector<CaloTowerPtr> const& caloConstituents = (*jets)[i].getCaloConstituents();
83  for (std::vector<CaloTowerPtr>::const_iterator ibegin = caloConstituents.begin(),
84  iend = caloConstituents.end(),
85  iconstituent = ibegin;
86  iconstituent != iend;
87  ++iconstituent) {
88  constituentPt_->Fill((*iconstituent)->pt());
89  }
90  }
91  ++nEventsAnalyzed;
92  }
93  // close input file
94  inFile->Close();
95 
96  timer.Stop();
97 
98  // print some timing statistics
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);
105 
106  // ----------------------------------------------------------------------
107  // Third Part:
108  //
109  // * never forget to free the memory of objects you created
110  // ----------------------------------------------------------------------
111 
112  // in this example there is nothing to do
113 
114  // that's it!
115  return 0;
116 }
T * make(const Args &...args) const
make new ROOT object
int iEvent
Definition: GenABIO.cc:224
static void enable()
enable automatic library loading