CMS 3D CMS Logo

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

#include <DQMHOAlCaRecoStream.h>

Inheritance diagram for DQMHOAlCaRecoStream:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

 DQMHOAlCaRecoStream (const edm::ParameterSet &)
 
 ~DQMHOAlCaRecoStream () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

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
 

Detailed Description

DQMOffline/DQMHOAlCaRecoStream/src/DQMHOAlCaRecoStream.cc

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

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

Definition at line 10 of file DQMHOAlCaRecoStream.h.

Constructor & Destructor Documentation

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

Definition at line 58 of file DQMHOAlCaRecoStream.cc.

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

60  consumes<HOCalibVariableCollection>(iConfig.getParameter<edm::InputTag>("hoCalibVariableCollectionTag"))) {
61  // now do what ever initialization is needed
62 
63  theRootFileName = iConfig.getUntrackedParameter<string>("RootFileName", "tmp.root");
64  folderName_ = iConfig.getUntrackedParameter<string>("folderName");
65  m_sigmaValue = iConfig.getUntrackedParameter<double>("sigmaval", 0.2);
66  m_lowRadPosInMuch = iConfig.getUntrackedParameter<double>("lowradposinmuch", 400.0);
67  m_highRadPosInMuch = iConfig.getUntrackedParameter<double>("highradposinmuch", 480.0);
68  m_lowEdge = iConfig.getUntrackedParameter<double>("lowedge", -2.0);
69  m_highEdge = iConfig.getUntrackedParameter<double>("highedge", 6.0);
70  m_nbins = iConfig.getUntrackedParameter<int>("nbins", 40);
71  saveToFile_ = iConfig.getUntrackedParameter<bool>("saveToFile", false);
72 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< HOCalibVariableCollection > hoCalibVariableCollectionTag
DQMHOAlCaRecoStream::~DQMHOAlCaRecoStream ( )
override

Definition at line 74 of file DQMHOAlCaRecoStream.cc.

74  {
75  // do anything here that needs to be done at desctruction time
76  // (e.g. close files, deallocate resources etc.)
77 }

Member Function Documentation

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

Definition at line 84 of file DQMHOAlCaRecoStream.cc.

References funct::abs(), runTauDisplay::dr, MonitorElement::Fill(), edm::Event::getByToken(), hDirCosine, hHOTime, hMuonEta, hMuonMom, hMuonMultipl, hMuonPhi, hoCalibVariableCollectionTag, hPedRing, hSignal3x3, hSigRing, createfilelist::int, edm::HandleBase::isValid(), gen::k, cmsBatch::log, LogDebug, m_highRadPosInMuch, Nevents, Nmuons, funct::pow(), and funct::tan().

84  {
85  using namespace edm;
86 
87  Nevents++;
88 
90  bool isCosMu = true;
91 
93 
94  if (!HOCalib.isValid()) {
95  LogDebug("") << "DQMHOAlCaRecoStream:: Error! can't get HOCalib product!" << std::endl;
96  return;
97  }
98 
99  if (isCosMu) {
100  hMuonMultipl->Fill((*HOCalib).size(), 1.);
101  if (!(*HOCalib).empty()) {
102  for (HOCalibVariableCollection::const_iterator hoC = (*HOCalib).begin(); hoC != (*HOCalib).end(); hoC++) {
103  // OK!!!!
104  float okt = 2.;
105  double okx = std::pow((*hoC).trkvx, okt) + std::pow((*hoC).trkvy, okt);
107  double dr = std::pow(okx, 0.5);
108  if (dr < m_lowRadPosInMuch || dr > m_highRadPosInMuch)
109  continue;
110 
111  if ((*hoC).isect < 0)
112  continue;
113  if (fabs((*hoC).trkth - acos(-1.) / 2) < 0.000001)
114  continue;
115  int ieta = int((std::abs((*hoC).isect) % 10000) / 100.) - 30;
116 
117  if (std::abs(ieta) >= 16)
118  continue;
119 
120  Nmuons++;
121 
122  hMuonMom->Fill((*hoC).trkmm, 1.0);
123  hMuonEta->Fill(-log(tan((*hoC).trkth / 2.0)), 1.0);
124  hMuonPhi->Fill((*hoC).trkph, 1.0);
125  hDirCosine->Fill((*hoC).hoang, 1.0);
126  hHOTime->Fill((*hoC).htime, 1.0);
127 
128  double energy = (*hoC).hosig[4];
129  double pedval = (*hoC).hocro;
130  int iring = 0;
131  if (ieta >= -15 && ieta <= -11) {
132  iring = -2;
133  } else if (ieta >= -10 && ieta <= -5) {
134  iring = -1;
135  } else if (ieta >= 5 && ieta <= 10) {
136  iring = 1;
137  } else if (ieta >= 11 && ieta <= 15) {
138  iring = 2;
139  }
140 
141  hSigRing[iring + 2]->Fill(energy, 1.0);
142  hPedRing[iring + 2]->Fill(pedval, 1.0);
143 
144  for (int k = 0; k < 9; k++) {
145  hSignal3x3[k]->Fill((*hoC).hosig[k]);
146  }
147  } // for (HOCalibVariableCollection::const_iterator hoC=(*HOCalib).begin()
148  } // if ((*HOCalib).size() >0 ) {
149  } // if (isCosMu) {
150 }
#define LogDebug(id)
edm::EDGetTokenT< HOCalibVariableCollection > hoCalibVariableCollectionTag
MonitorElement * hMuonMultipl
MonitorElement * hPedRing[5]
MonitorElement * hMuonEta
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
MonitorElement * hSigRing[5]
void Fill(long long x)
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
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * hMuonPhi
int k[5][pyjets_maxn]
HLT enums.
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
MonitorElement * hDirCosine
void DQMHOAlCaRecoStream::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  irun,
edm::EventSetup const &  isetup 
)
overrideprivate

Definition at line 154 of file DQMHOAlCaRecoStream.cc.

References DQMStore::IBooker::book1D(), folderName_, hDirCosine, hHOTime, hMuonEta, hMuonMom, hMuonMultipl, hMuonPhi, hPedRing, hSignal3x3, hSigRing, mps_fire::i, gen::k, m_highEdge, m_lowEdge, m_nbins, dataset::name, Nevents, Nmuons, MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), and runGCPTkAlMap::title.

156  {
157  ibooker.setCurrentFolder(folderName_);
158 
159  char title[200];
160  char name[200];
161 
162  hMuonMom = ibooker.book1D("hMuonMom", "Muon momentum (GeV)", 50, -100, 100);
163  hMuonMom->setAxisTitle("Muon momentum (GeV)", 1);
164 
165  hMuonEta = ibooker.book1D("hMuonEta", "Pseudo-rapidity of muon", 50, -1.5, 1.5);
166  hMuonEta->setAxisTitle("Pseudo-rapidity of muon", 1);
167 
168  hMuonPhi = ibooker.book1D("hMuonPhi", "Azimuthal angle of muon", 24, -acos(-1), acos(-1));
169  hMuonPhi->setAxisTitle("Azimuthal angle of muon", 1);
170 
171  hMuonMultipl = ibooker.book1D("hMuonMultipl", "Muon Multiplicity", 10, 0.5, 10.5);
172  hMuonMultipl->setAxisTitle("Muon Multiplicity", 1);
173 
174  hDirCosine = ibooker.book1D("hDirCosine", "Direction Cosine of muon at HO tower", 50, -1., 1.);
175  hDirCosine->setAxisTitle("Direction Cosine of muon at HO tower", 1);
176 
177  hHOTime = ibooker.book1D("hHOTime", "HO time distribution", 60, -20, 100.);
178  hHOTime->setAxisTitle("HO time distribution", 1);
179 
180  for (int i = 0; i < 5; i++) {
181  sprintf(name, "hSigRing_%i", i - 2);
182  sprintf(title, "HO signal in Ring_%i", i - 2);
183  hSigRing[i] = ibooker.book1D(name, title, m_nbins, m_lowEdge, m_highEdge);
184  hSigRing[i]->setAxisTitle(title, 1);
185 
186  sprintf(name, "hPedRing_%i", i - 2);
187  sprintf(title, "HO Pedestal in Ring_%i", i - 2);
188  hPedRing[i] = ibooker.book1D(name, title, m_nbins, m_lowEdge, m_highEdge);
189  hPedRing[i]->setAxisTitle(title, 1);
190  }
191 
192  // hSigRingm1 = ibooker.book1D("hSigRingm1", "HO signal in Ring-1", m_nbins,
193  // m_lowEdge, m_highEdge); hSigRingm1->setAxisTitle("HO signal in Ring-1",1);
194 
195  // hSigRing00 = ibooker.book1D("hSigRing00", "HO signal in Ring_0", m_nbins,
196  // m_lowEdge, m_highEdge); hSigRing00->setAxisTitle("HO signal in Ring_0",1);
197 
198  // hSigRingp1 = ibooker.book1D("hSigRingp1", "HO signal in Ring-1", m_nbins,
199  // m_lowEdge, m_highEdge); hSigRingp1->setAxisTitle("HO signal in Ring+1",1);
200 
201  // hSigRingp2 = ibooker.book1D("hSigRingp2", "HO signal in Ring-2", m_nbins,
202  // m_lowEdge, m_highEdge); hSigRingp2->setAxisTitle("HO signal in Ring+2",1);
203 
204  // hPedRingm2 = ibooker.book1D("hPedRingm2", "HO pedestal in Ring-2",
205  // m_nbins, m_lowEdge, m_highEdge); hPedRingm1 = ibooker.book1D("hPedRingm1",
206  // "HO pedestal in Ring-1", m_nbins, m_lowEdge, m_highEdge); hPedRing00 =
207  // ibooker.book1D("hPedRing00", "HO pedestal in Ring_0", m_nbins, m_lowEdge,
208  // m_highEdge); hPedRingp1 = ibooker.book1D("hPedRingp1", "HO pedestal in
209  // Ring-1", m_nbins, m_lowEdge, m_highEdge); hPedRingp2 =
210  // ibooker.book1D("hPedRingp2", "HO pedestal in Ring-2", m_nbins, m_lowEdge,
211  // m_highEdge);
212 
213  for (int i = -1; i <= 1; i++) {
214  for (int j = -1; j <= 1; j++) {
215  int k = 3 * (i + 1) + j + 1;
216 
217  sprintf(title, "hSignal3x3_deta%i_dphi%i", i, j);
218  hSignal3x3[k] = ibooker.book1D(title, title, m_nbins, m_lowEdge, m_highEdge);
219  hSignal3x3[k]->setAxisTitle(title, 1);
220  }
221  }
222 
223  Nevents = 0;
224  Nmuons = 0;
225 }
MonitorElement * hMuonMultipl
MonitorElement * hPedRing[5]
MonitorElement * hMuonEta
MonitorElement * hSigRing[5]
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * hHOTime
MonitorElement * hSignal3x3[9]
MonitorElement * hMuonMom
MonitorElement * hMuonPhi
int k[5][pyjets_maxn]
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * hDirCosine

Member Data Documentation

std::string DQMHOAlCaRecoStream::folderName_
private

Definition at line 45 of file DQMHOAlCaRecoStream.h.

Referenced by bookHistograms(), and DQMHOAlCaRecoStream().

MonitorElement* DQMHOAlCaRecoStream::hDirCosine
private

Definition at line 24 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMHOAlCaRecoStream::hHOTime
private

Definition at line 25 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMHOAlCaRecoStream::hMuonEta
private

Definition at line 21 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMHOAlCaRecoStream::hMuonMom
private

Definition at line 20 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMHOAlCaRecoStream::hMuonMultipl
private

Definition at line 19 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMHOAlCaRecoStream::hMuonPhi
private

Definition at line 22 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 56 of file DQMHOAlCaRecoStream.h.

Referenced by analyze().

MonitorElement* DQMHOAlCaRecoStream::hPedRing[5]
private

Definition at line 33 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMHOAlCaRecoStream::hSignal3x3[9]
private

Definition at line 39 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMHOAlCaRecoStream::hSigRing[5]
private

Definition at line 27 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

double DQMHOAlCaRecoStream::m_highEdge
private

Definition at line 53 of file DQMHOAlCaRecoStream.h.

Referenced by bookHistograms(), and DQMHOAlCaRecoStream().

double DQMHOAlCaRecoStream::m_highRadPosInMuch
private

Definition at line 49 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and DQMHOAlCaRecoStream().

double DQMHOAlCaRecoStream::m_lowEdge
private

Definition at line 52 of file DQMHOAlCaRecoStream.h.

Referenced by bookHistograms(), and DQMHOAlCaRecoStream().

double DQMHOAlCaRecoStream::m_lowRadPosInMuch
private

Definition at line 48 of file DQMHOAlCaRecoStream.h.

Referenced by DQMHOAlCaRecoStream().

int DQMHOAlCaRecoStream::m_nbins
private

Definition at line 51 of file DQMHOAlCaRecoStream.h.

Referenced by bookHistograms(), and DQMHOAlCaRecoStream().

double DQMHOAlCaRecoStream::m_sigmaValue
private

Definition at line 46 of file DQMHOAlCaRecoStream.h.

Referenced by DQMHOAlCaRecoStream().

int DQMHOAlCaRecoStream::Nevents
private

Definition at line 41 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

int DQMHOAlCaRecoStream::Nmuons
private

Definition at line 42 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

bool DQMHOAlCaRecoStream::saveToFile_
private

Definition at line 55 of file DQMHOAlCaRecoStream.h.

Referenced by DQMHOAlCaRecoStream().

std::string DQMHOAlCaRecoStream::theRootFileName
private

Definition at line 44 of file DQMHOAlCaRecoStream.h.

Referenced by DQMHOAlCaRecoStream().