CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DQMHOAlCaRecoStream Class Reference

#include <DQMHOAlCaRecoStream.cc>

Inheritance diagram for DQMHOAlCaRecoStream:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 DQMHOAlCaRecoStream (const edm::ParameterSet &)
 
 ~DQMHOAlCaRecoStream () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

std::string folderName_
 
MonitorElementhDirCosine
 
MonitorElementhHOTime
 
MonitorElementhMuonEta
 
MonitorElementhMuonMom
 
MonitorElementhMuonMultipl
 
MonitorElementhMuonPhi
 
edm::EDGetTokenT< HOCalibVariableCollectionhoCalibVariableCollectionTag
 
MonitorElementhPedRing [5]
 
MonitorElementhSignal3x3 [9]
 
MonitorElementhSigRing [5]
 
double m_highEdge
 
double m_highRadPosInMuch
 
double m_lowEdge
 
double m_lowRadPosInMuch
 
int m_nbins
 
double m_sigmaValue
 
int Nevents
 
int Nmuons
 
bool saveToFile_
 
std::string theRootFileName
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

DQMOffline/DQMHOAlCaRecoStream/src/DQMHOAlCaRecoStream.cc

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 42 of file DQMHOAlCaRecoStream.cc.

Constructor & Destructor Documentation

◆ DQMHOAlCaRecoStream()

DQMHOAlCaRecoStream::DQMHOAlCaRecoStream ( const edm::ParameterSet iConfig)
explicit

Definition at line 86 of file DQMHOAlCaRecoStream.cc.

References folderName_, edm::ParameterSet::getUntrackedParameter(), m_highEdge, m_highRadPosInMuch, m_lowEdge, m_lowRadPosInMuch, m_nbins, m_sigmaValue, saveToFile_, AlCaHLTBitMon_QueryRunRegistry::string, and theRootFileName.

88  consumes<HOCalibVariableCollection>(iConfig.getParameter<edm::InputTag>("hoCalibVariableCollectionTag"))) {
89  // now do what ever initialization is needed
90 
91  theRootFileName = iConfig.getUntrackedParameter<std::string>("RootFileName", "tmp.root");
92  folderName_ = iConfig.getUntrackedParameter<std::string>("folderName");
93  m_sigmaValue = iConfig.getUntrackedParameter<double>("sigmaval", 0.2);
94  m_lowRadPosInMuch = iConfig.getUntrackedParameter<double>("lowradposinmuch", 400.0);
95  m_highRadPosInMuch = iConfig.getUntrackedParameter<double>("highradposinmuch", 480.0);
96  m_lowEdge = iConfig.getUntrackedParameter<double>("lowedge", -2.0);
97  m_highEdge = iConfig.getUntrackedParameter<double>("highedge", 6.0);
98  m_nbins = iConfig.getUntrackedParameter<int>("nbins", 40);
99  saveToFile_ = iConfig.getUntrackedParameter<bool>("saveToFile", false);
100 }
edm::EDGetTokenT< HOCalibVariableCollection > hoCalibVariableCollectionTag
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
T getUntrackedParameter(std::string const &, T const &) const

◆ ~DQMHOAlCaRecoStream()

DQMHOAlCaRecoStream::~DQMHOAlCaRecoStream ( )
override

Definition at line 102 of file DQMHOAlCaRecoStream.cc.

102  {
103  // do anything here that needs to be done at desctruction time
104  // (e.g. close files, deallocate resources etc.)
105 }

Member Function Documentation

◆ analyze()

void DQMHOAlCaRecoStream::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 112 of file DQMHOAlCaRecoStream.cc.

References funct::abs(), l1ctLayer1_cff::dr, HCALHighEnergyHPDFilter_cfi::energy, dqm::impl::MonitorElement::Fill(), hDirCosine, hHOTime, hMuonEta, hMuonMom, hMuonMultipl, hMuonPhi, hoCalibVariableCollectionTag, hPedRing, hSignal3x3, hSigRing, LEDCalibrationChannels::ieta, iEvent, createfilelist::int, edm::HandleBase::isValid(), dqmdumpme::k, dqm-mbProfile::log, LogDebug, m_highRadPosInMuch, Nevents, Nmuons, funct::pow(), and funct::tan().

112  {
113  Nevents++;
114 
116  bool isCosMu = true;
117 
118  iEvent.getByToken(hoCalibVariableCollectionTag, HOCalib);
119 
120  if (!HOCalib.isValid()) {
121  LogDebug("") << "DQMHOAlCaRecoStream:: Error! can't get HOCalib product!" << std::endl;
122  return;
123  }
124 
125  if (isCosMu) {
126  hMuonMultipl->Fill((*HOCalib).size(), 1.);
127  if (!(*HOCalib).empty()) {
128  for (HOCalibVariableCollection::const_iterator hoC = (*HOCalib).begin(); hoC != (*HOCalib).end(); hoC++) {
129  // OK!!!!
130  float okt = 2.;
131  double okx = std::pow((*hoC).trkvx, okt) + std::pow((*hoC).trkvy, okt);
133  double dr = std::pow(okx, 0.5);
134  if (dr < m_lowRadPosInMuch || dr > m_highRadPosInMuch)
135  continue;
136 
137  if ((*hoC).isect < 0)
138  continue;
139  if (fabs((*hoC).trkth - acos(-1.) / 2) < 0.000001)
140  continue;
141  int ieta = int((std::abs((*hoC).isect) % 10000) / 100.) - 30;
142 
143  if (std::abs(ieta) >= 16)
144  continue;
145 
146  Nmuons++;
147 
148  hMuonMom->Fill((*hoC).trkmm, 1.0);
149  hMuonEta->Fill(-log(tan((*hoC).trkth / 2.0)), 1.0);
150  hMuonPhi->Fill((*hoC).trkph, 1.0);
151  hDirCosine->Fill((*hoC).hoang, 1.0);
152  hHOTime->Fill((*hoC).htime, 1.0);
153 
154  double energy = (*hoC).hosig[4];
155  double pedval = (*hoC).hocro;
156  int iring = 0;
157  if (ieta >= -15 && ieta <= -11) {
158  iring = -2;
159  } else if (ieta >= -10 && ieta <= -5) {
160  iring = -1;
161  } else if (ieta >= 5 && ieta <= 10) {
162  iring = 1;
163  } else if (ieta >= 11 && ieta <= 15) {
164  iring = 2;
165  }
166 
167  hSigRing[iring + 2]->Fill(energy, 1.0);
168  hPedRing[iring + 2]->Fill(pedval, 1.0);
169 
170  for (int k = 0; k < 9; k++) {
171  hSignal3x3[k]->Fill((*hoC).hosig[k]);
172  }
173  } // for (HOCalibVariableCollection::const_iterator hoC=(*HOCalib).begin()
174  } // if ((*HOCalib).size() >0 ) {
175  } // if (isCosMu) {
176 }
edm::EDGetTokenT< HOCalibVariableCollection > hoCalibVariableCollectionTag
MonitorElement * hMuonMultipl
MonitorElement * hPedRing[5]
MonitorElement * hMuonEta
MonitorElement * hSigRing[5]
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MonitorElement * hHOTime
MonitorElement * hSignal3x3[9]
MonitorElement * hMuonMom
MonitorElement * hMuonPhi
bool isValid() const
Definition: HandleBase.h:70
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
MonitorElement * hDirCosine
#define LogDebug(id)

◆ bookHistograms()

void DQMHOAlCaRecoStream::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  irun,
edm::EventSetup const &  isetup 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 180 of file DQMHOAlCaRecoStream.cc.

References dqm::implementation::IBooker::book1D(), folderName_, hDirCosine, hHOTime, hMuonEta, hMuonMom, hMuonMultipl, hMuonPhi, hPedRing, hSignal3x3, hSigRing, mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, m_highEdge, m_lowEdge, m_nbins, Skims_PA_cff::name, Nevents, Nmuons, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), and runGCPTkAlMap::title.

182  {
183  ibooker.setCurrentFolder(folderName_);
184 
185  char title[200];
186  char name[200];
187 
188  hMuonMom = ibooker.book1D("hMuonMom", "Muon momentum (GeV)", 50, -100, 100);
189  hMuonMom->setAxisTitle("Muon momentum (GeV)", 1);
190 
191  hMuonEta = ibooker.book1D("hMuonEta", "Pseudo-rapidity of muon", 50, -1.5, 1.5);
192  hMuonEta->setAxisTitle("Pseudo-rapidity of muon", 1);
193 
194  hMuonPhi = ibooker.book1D("hMuonPhi", "Azimuthal angle of muon", 24, -acos(-1), acos(-1));
195  hMuonPhi->setAxisTitle("Azimuthal angle of muon", 1);
196 
197  hMuonMultipl = ibooker.book1D("hMuonMultipl", "Muon Multiplicity", 10, 0.5, 10.5);
198  hMuonMultipl->setAxisTitle("Muon Multiplicity", 1);
199 
200  hDirCosine = ibooker.book1D("hDirCosine", "Direction Cosine of muon at HO tower", 50, -1., 1.);
201  hDirCosine->setAxisTitle("Direction Cosine of muon at HO tower", 1);
202 
203  hHOTime = ibooker.book1D("hHOTime", "HO time distribution", 60, -20, 100.);
204  hHOTime->setAxisTitle("HO time distribution", 1);
205 
206  for (int i = 0; i < 5; i++) {
207  sprintf(name, "hSigRing_%i", i - 2);
208  sprintf(title, "HO signal in Ring_%i", i - 2);
211 
212  sprintf(name, "hPedRing_%i", i - 2);
213  sprintf(title, "HO Pedestal in Ring_%i", i - 2);
216  }
217 
218  for (int i = -1; i <= 1; i++) {
219  for (int j = -1; j <= 1; j++) {
220  int k = 3 * (i + 1) + j + 1;
221 
222  sprintf(title, "hSignal3x3_deta%i_dphi%i", i, j);
225  }
226  }
227 
228  Nevents = 0;
229  Nmuons = 0;
230 }
MonitorElement * hMuonMultipl
MonitorElement * hPedRing[5]
MonitorElement * hMuonEta
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * hSigRing[5]
MonitorElement * hHOTime
MonitorElement * hSignal3x3[9]
MonitorElement * hMuonMom
MonitorElement * hMuonPhi
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * hDirCosine
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

◆ folderName_

std::string DQMHOAlCaRecoStream::folderName_
private

Definition at line 69 of file DQMHOAlCaRecoStream.cc.

Referenced by bookHistograms(), and DQMHOAlCaRecoStream().

◆ hDirCosine

MonitorElement* DQMHOAlCaRecoStream::hDirCosine
private

Definition at line 58 of file DQMHOAlCaRecoStream.cc.

Referenced by analyze(), and bookHistograms().

◆ hHOTime

MonitorElement* DQMHOAlCaRecoStream::hHOTime
private

Definition at line 59 of file DQMHOAlCaRecoStream.cc.

Referenced by analyze(), and bookHistograms().

◆ hMuonEta

MonitorElement* DQMHOAlCaRecoStream::hMuonEta
private

Definition at line 55 of file DQMHOAlCaRecoStream.cc.

Referenced by analyze(), and bookHistograms().

◆ hMuonMom

MonitorElement* DQMHOAlCaRecoStream::hMuonMom
private

Definition at line 54 of file DQMHOAlCaRecoStream.cc.

Referenced by analyze(), and bookHistograms().

◆ hMuonMultipl

MonitorElement* DQMHOAlCaRecoStream::hMuonMultipl
private

Definition at line 53 of file DQMHOAlCaRecoStream.cc.

Referenced by analyze(), and bookHistograms().

◆ hMuonPhi

MonitorElement* DQMHOAlCaRecoStream::hMuonPhi
private

Definition at line 56 of file DQMHOAlCaRecoStream.cc.

Referenced by analyze(), and bookHistograms().

◆ hoCalibVariableCollectionTag

edm::EDGetTokenT<HOCalibVariableCollection> DQMHOAlCaRecoStream::hoCalibVariableCollectionTag
private

Definition at line 80 of file DQMHOAlCaRecoStream.cc.

Referenced by analyze().

◆ hPedRing

MonitorElement* DQMHOAlCaRecoStream::hPedRing[5]
private

Definition at line 62 of file DQMHOAlCaRecoStream.cc.

Referenced by analyze(), and bookHistograms().

◆ hSignal3x3

MonitorElement* DQMHOAlCaRecoStream::hSignal3x3[9]
private

Definition at line 63 of file DQMHOAlCaRecoStream.cc.

Referenced by analyze(), and bookHistograms().

◆ hSigRing

MonitorElement* DQMHOAlCaRecoStream::hSigRing[5]
private

Definition at line 61 of file DQMHOAlCaRecoStream.cc.

Referenced by analyze(), and bookHistograms().

◆ m_highEdge

double DQMHOAlCaRecoStream::m_highEdge
private

Definition at line 77 of file DQMHOAlCaRecoStream.cc.

Referenced by bookHistograms(), and DQMHOAlCaRecoStream().

◆ m_highRadPosInMuch

double DQMHOAlCaRecoStream::m_highRadPosInMuch
private

Definition at line 73 of file DQMHOAlCaRecoStream.cc.

Referenced by analyze(), and DQMHOAlCaRecoStream().

◆ m_lowEdge

double DQMHOAlCaRecoStream::m_lowEdge
private

Definition at line 76 of file DQMHOAlCaRecoStream.cc.

Referenced by bookHistograms(), and DQMHOAlCaRecoStream().

◆ m_lowRadPosInMuch

double DQMHOAlCaRecoStream::m_lowRadPosInMuch
private

Definition at line 72 of file DQMHOAlCaRecoStream.cc.

Referenced by DQMHOAlCaRecoStream().

◆ m_nbins

int DQMHOAlCaRecoStream::m_nbins
private

Definition at line 75 of file DQMHOAlCaRecoStream.cc.

Referenced by bookHistograms(), and DQMHOAlCaRecoStream().

◆ m_sigmaValue

double DQMHOAlCaRecoStream::m_sigmaValue
private

Definition at line 70 of file DQMHOAlCaRecoStream.cc.

Referenced by DQMHOAlCaRecoStream().

◆ Nevents

int DQMHOAlCaRecoStream::Nevents
private

Definition at line 65 of file DQMHOAlCaRecoStream.cc.

Referenced by analyze(), and bookHistograms().

◆ Nmuons

int DQMHOAlCaRecoStream::Nmuons
private

Definition at line 66 of file DQMHOAlCaRecoStream.cc.

Referenced by analyze(), and bookHistograms().

◆ saveToFile_

bool DQMHOAlCaRecoStream::saveToFile_
private

Definition at line 79 of file DQMHOAlCaRecoStream.cc.

Referenced by DQMHOAlCaRecoStream().

◆ theRootFileName

std::string DQMHOAlCaRecoStream::theRootFileName
private

Definition at line 68 of file DQMHOAlCaRecoStream.cc.

Referenced by DQMHOAlCaRecoStream().