CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 DQMHOAlCaRecoStream (const edm::ParameterSet &)
 
 ~DQMHOAlCaRecoStream ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 

Private Attributes

DQMStoredbe_
 
std::string folderName_
 
MonitorElementhDirCosine
 
MonitorElementhHOTime
 
MonitorElementhMuonEta
 
MonitorElementhMuonMom
 
MonitorElementhMuonMultipl
 
MonitorElementhMuonPhi
 
edm::EDGetTokenT
< HOCalibVariableCollection
hoCalibVariableCollectionTag
 
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::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 7 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 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 96 of file DQMHOAlCaRecoStream.cc.

References funct::abs(), relval_parameters_module::energy, MonitorElement::Fill(), edm::Event::getByToken(), hDirCosine, hHOTime, hMuonEta, hMuonMom, hMuonMultipl, hMuonPhi, hoCalibVariableCollectionTag, hPedRing, hSignal3x3, hSigRing, gen::k, create_public_lumi_plots::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:434
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
MonitorElement * hMuonPhi
int k[5][pyjets_maxn]
return(e1-e2)*(e1-e2)+dp *dp
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
MonitorElement * hDirCosine
void DQMHOAlCaRecoStream::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 161 of file DQMHOAlCaRecoStream.cc.

References DQMStore::book1D(), dbe_, folderName_, hDirCosine, hHOTime, hMuonEta, hMuonMom, hMuonMultipl, hMuonPhi, hPedRing, hSignal3x3, hSigRing, i, j, gen::k, m_highEdge, m_lowEdge, m_nbins, mergeVDriftHistosByStation::name, Nevents, Nmuons, cppFunctionSkipper::operator, MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), and indexGen::title.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 234 of file DQMHOAlCaRecoStream.cc.

References dbe_, MonitorElement::getTH1F(), hDirCosine, hHOTime, hMuonEta, hMuonMom, hMuonPhi, hPedRing, hSignal3x3, hSigRing, gen::k, max(), Nmuons, DQMStore::save(), saveToFile_, pileupReCalc_HLTpaths::scale, and theRootFileName.

234  {
235  if (saveToFile_) {
236 
237  // double scale = 1./max(1,Nevents);
238  double scale = 1./max(1,Nmuons);
239  hMuonMom->getTH1F()->Scale(scale);
240  hMuonEta->getTH1F()->Scale(scale);
241  hMuonPhi->getTH1F()->Scale(scale);
242  hDirCosine->getTH1F()->Scale(scale);
243  hHOTime->getTH1F()->Scale(scale);
244 
245  // scale = 1./max(1,Nmuons);
246  for (int k=0; k<5; k++) {
247  hSigRing[k]->getTH1F()->Scale(scale);
248  hPedRing[k]->getTH1F()->Scale(scale);
249  }
250 
251  for (int k=0; k<9; k++) {
252  hSignal3x3[k]->getTH1F()->Scale(scale);
253  }
254 
256  }
257 
258 }
MonitorElement * hPedRing[5]
MonitorElement * hMuonEta
MonitorElement * hSigRing[5]
const T & max(const T &a, const T &b)
MonitorElement * hHOTime
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2296
MonitorElement * hSignal3x3[9]
MonitorElement * hMuonMom
MonitorElement * hMuonPhi
int k[5][pyjets_maxn]
TH1F * getTH1F(void) const
MonitorElement * hDirCosine

Member Data Documentation

DQMStore* DQMHOAlCaRecoStream::dbe_
private

Definition at line 14 of file DQMHOAlCaRecoStream.h.

Referenced by beginJob(), and endJob().

std::string DQMHOAlCaRecoStream::folderName_
private

Definition at line 47 of file DQMHOAlCaRecoStream.h.

Referenced by beginJob(), and DQMHOAlCaRecoStream().

MonitorElement* DQMHOAlCaRecoStream::hDirCosine
private

Definition at line 26 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), beginJob(), and endJob().

MonitorElement* DQMHOAlCaRecoStream::hHOTime
private

Definition at line 27 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), beginJob(), and endJob().

MonitorElement* DQMHOAlCaRecoStream::hMuonEta
private

Definition at line 23 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), beginJob(), and endJob().

MonitorElement* DQMHOAlCaRecoStream::hMuonMom
private

Definition at line 22 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), beginJob(), and endJob().

MonitorElement* DQMHOAlCaRecoStream::hMuonMultipl
private

Definition at line 21 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and beginJob().

MonitorElement* DQMHOAlCaRecoStream::hMuonPhi
private

Definition at line 24 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), beginJob(), and endJob().

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

Definition at line 58 of file DQMHOAlCaRecoStream.h.

Referenced by analyze().

MonitorElement* DQMHOAlCaRecoStream::hPedRing[5]
private

Definition at line 35 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), beginJob(), and endJob().

MonitorElement* DQMHOAlCaRecoStream::hSignal3x3[9]
private

Definition at line 41 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), beginJob(), and endJob().

MonitorElement* DQMHOAlCaRecoStream::hSigRing[5]
private

Definition at line 29 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), beginJob(), and endJob().

double DQMHOAlCaRecoStream::m_highEdge
private

Definition at line 55 of file DQMHOAlCaRecoStream.h.

Referenced by beginJob(), and DQMHOAlCaRecoStream().

double DQMHOAlCaRecoStream::m_highRadPosInMuch
private

Definition at line 51 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and DQMHOAlCaRecoStream().

double DQMHOAlCaRecoStream::m_lowEdge
private

Definition at line 54 of file DQMHOAlCaRecoStream.h.

Referenced by beginJob(), and DQMHOAlCaRecoStream().

double DQMHOAlCaRecoStream::m_lowRadPosInMuch
private

Definition at line 50 of file DQMHOAlCaRecoStream.h.

Referenced by DQMHOAlCaRecoStream().

int DQMHOAlCaRecoStream::m_nbins
private

Definition at line 53 of file DQMHOAlCaRecoStream.h.

Referenced by beginJob(), and DQMHOAlCaRecoStream().

double DQMHOAlCaRecoStream::m_sigmaValue
private

Definition at line 48 of file DQMHOAlCaRecoStream.h.

Referenced by DQMHOAlCaRecoStream().

int DQMHOAlCaRecoStream::Nevents
private

Definition at line 43 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), and beginJob().

int DQMHOAlCaRecoStream::Nmuons
private

Definition at line 44 of file DQMHOAlCaRecoStream.h.

Referenced by analyze(), beginJob(), and endJob().

bool DQMHOAlCaRecoStream::saveToFile_
private

Definition at line 57 of file DQMHOAlCaRecoStream.h.

Referenced by DQMHOAlCaRecoStream(), and endJob().

std::string DQMHOAlCaRecoStream::theRootFileName
private

Definition at line 46 of file DQMHOAlCaRecoStream.h.

Referenced by DQMHOAlCaRecoStream(), and endJob().