CMS 3D CMS Logo

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

#include <DQMOffline/DQMHOAlCaRecoStream/src/DQMHOAlCaRecoStream.cc>

Inheritance diagram for DQMHOAlCaRecoStream:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 DQMHOAlCaRecoStream (const edm::ParameterSet &)
 
 ~DQMHOAlCaRecoStream ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual 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 edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

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 64 of file DQMHOAlCaRecoStream.cc.

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

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

Definition at line 81 of file DQMHOAlCaRecoStream.cc.

82 {
83 
84  // do anything here that needs to be done at desctruction time
85  // (e.g. close files, deallocate resources etc.)
86 
87 }

Member Function Documentation

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

Definition at line 96 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(), reco::return(), and funct::tan().

97 {
98  using namespace edm;
99 
100  Nevents++;
101 
103  bool isCosMu = true;
104 
105  iEvent.getByToken(hoCalibVariableCollectionTag, HOCalib);
106 
107  if(!HOCalib.isValid()){
108  LogDebug("") << "DQMHOAlCaRecoStream:: Error! can't get HOCalib product!" << std::endl;
109  return ;
110  }
111 
112 
113  if (isCosMu) {
114  hMuonMultipl->Fill((*HOCalib).size(),1.);
115  if ((*HOCalib).size() >0 ) {
116  for (HOCalibVariableCollection::const_iterator hoC=(*HOCalib).begin(); hoC!=(*HOCalib).end(); hoC++){
117 // OK!!!!
118  float okt = 2.;
119  double okx = std::pow((*hoC).trkvx,okt) + std::pow((*hoC).trkvy,okt);
121  double dr=std::pow( okx, 0.5);
122  if (dr <m_lowRadPosInMuch || dr >m_highRadPosInMuch) continue;
123 
124  if ((*hoC).isect <0) continue;
125  if (fabs((*hoC).trkth-acos(-1.)/2)<0.000001) continue;
126  int ieta = int((std::abs((*hoC).isect)%10000)/100.)-30;
127 
128  if (std::abs(ieta)>=16) continue;
129 
130  Nmuons++;
131 
132 
133  hMuonMom->Fill((*hoC).trkmm, 1.0);
134  hMuonEta->Fill(-log(tan((*hoC).trkth/2.0)), 1.0);
135  hMuonPhi->Fill((*hoC).trkph, 1.0);
136  hDirCosine->Fill((*hoC).hoang, 1.0);
137  hHOTime->Fill((*hoC).htime, 1.0);
138 
139  double energy = (*hoC).hosig[4];
140  double pedval = (*hoC).hocro;
141  int iring = 0;
142  if (ieta >=-15 && ieta <=-11) {iring = -2;}
143  else if (ieta >=-10 && ieta <=-5) {iring = -1;}
144  else if (ieta >= 5 && ieta <= 10) {iring = 1;}
145  else if (ieta >= 11 && ieta <= 15) {iring = 2;}
146 
147  hSigRing[iring+2]->Fill(energy,1.0);
148  hPedRing[iring+2]->Fill(pedval,1.0);
149 
150  for (int k=0; k<9; k++) {
151  hSignal3x3[k]->Fill((*hoC).hosig[k]);
152  }
153  } //for (HOCalibVariableCollection::const_iterator hoC=(*HOCalib).begin()
154  } // if ((*HOCalib).size() >0 ) {
155  } // if (isCosMu) {
156 }
#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:460
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]
return(e1-e2)*(e1-e2)+dp *dp
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 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 161 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 fftjetcommon_cfi::title.

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

Referenced by bookHistograms(), and DQMHOAlCaRecoStream().

MonitorElement* DQMHOAlCaRecoStream::hDirCosine
private

Definition at line 27 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMHOAlCaRecoStream::hHOTime
private

Definition at line 28 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMHOAlCaRecoStream::hMuonEta
private

Definition at line 24 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMHOAlCaRecoStream::hMuonMom
private

Definition at line 23 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMHOAlCaRecoStream::hMuonMultipl
private

Definition at line 22 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMHOAlCaRecoStream::hMuonPhi
private

Definition at line 25 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 59 of file DQMHOAlCaRecoStream.h.

Referenced by analyze().

MonitorElement* DQMHOAlCaRecoStream::hPedRing[5]
private

Definition at line 36 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMHOAlCaRecoStream::hSignal3x3[9]
private

Definition at line 42 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* DQMHOAlCaRecoStream::hSigRing[5]
private

Definition at line 30 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

double DQMHOAlCaRecoStream::m_highEdge
private

Definition at line 56 of file DQMHOAlCaRecoStream.h.

Referenced by bookHistograms(), and DQMHOAlCaRecoStream().

double DQMHOAlCaRecoStream::m_highRadPosInMuch
private

Definition at line 52 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and DQMHOAlCaRecoStream().

double DQMHOAlCaRecoStream::m_lowEdge
private

Definition at line 55 of file DQMHOAlCaRecoStream.h.

Referenced by bookHistograms(), and DQMHOAlCaRecoStream().

double DQMHOAlCaRecoStream::m_lowRadPosInMuch
private

Definition at line 51 of file DQMHOAlCaRecoStream.h.

Referenced by DQMHOAlCaRecoStream().

int DQMHOAlCaRecoStream::m_nbins
private

Definition at line 54 of file DQMHOAlCaRecoStream.h.

Referenced by bookHistograms(), and DQMHOAlCaRecoStream().

double DQMHOAlCaRecoStream::m_sigmaValue
private

Definition at line 49 of file DQMHOAlCaRecoStream.h.

Referenced by DQMHOAlCaRecoStream().

int DQMHOAlCaRecoStream::Nevents
private

Definition at line 44 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

int DQMHOAlCaRecoStream::Nmuons
private

Definition at line 45 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and bookHistograms().

bool DQMHOAlCaRecoStream::saveToFile_
private

Definition at line 58 of file DQMHOAlCaRecoStream.h.

Referenced by DQMHOAlCaRecoStream().

std::string DQMHOAlCaRecoStream::theRootFileName
private

Definition at line 47 of file DQMHOAlCaRecoStream.h.

Referenced by DQMHOAlCaRecoStream().