CMS 3D CMS Logo

HcalLedAnalysis.h
Go to the documentation of this file.
1 #ifndef HcalLedAnalysis_H
2 #define HcalLedAnalysis_H
3 
11 
13 
14 #include "TH1F.h"
15 #include "TF1.h"
16 #include "TProfile.h"
17 
18 #include <memory>
19 //#include <iostream>
20 #include <fstream>
21 #include <vector>
22 #include <string>
23 
24 class HcalPedestal;
25 class HcalDbService;
26 class HcalQIEShape;
27 class HcalQIECoder;
28 class TFile;
29 
31 public:
37  //void doPeds(const HcalPedestals* fInputPedestals);
38  void LedSampleAnalysis();
39  void LedDone();
41  const HODigiCollection& ho,
42  const HFDigiCollection& hf,
44  const HcalDbService& cond);
45 
46 protected:
47 private:
48  //###
49  //# LEDBUNCH is used in map<HcalDetId,map<int, LEDBUNCH > > LEDTRENDS;
50  //# For each HcalDetId (channel) a map<int, LEDBUNCH> is associated;
51  //# int was originally cap-id and now is just dummy;
52  //# LEDBUNCH is a pair - first element is the main
53  //# histo with the ADC values and second one is another pair;
54  //# this pair contains map<int, std::vector<double> > as a first element;
55  //# vector contains some useful variables;
56  //# the second element is a vector of histos (pointers);
57  //# for the "trend" analysis the main histo (with ADC values) is reset every
58  //# m_nevtsample events and info is put in the other part of the LEDBUNCH;
59  //# so at the end we have the trends for the variables in concern
60  //# which are written in THE vector<TH1F*>;
61  //###
62  typedef std::pair<TH1F*, std::pair<std::map<int, std::vector<double> >, std::vector<TH1F*> > > LEDBUNCH;
63  typedef struct {
64  TProfile* avePulse;
65  TH1F* thisPulse;
66  TH1F* integPulse;
67  } CALIBBUNCH;
68  TFile* m_file;
69  void LedHBHEHists(const HcalDetId& detid,
70  const HBHEDataFrame& ledDigi,
71  std::map<HcalDetId, std::map<int, LEDBUNCH> >& toolT,
72  const HcalDbService& cond);
73  void LedHOHists(const HcalDetId& detid,
74  const HODataFrame& ledDigi,
75  std::map<HcalDetId, std::map<int, LEDBUNCH> >& toolT,
76  const HcalDbService& cond);
77  void LedHFHists(const HcalDetId& detid,
78  const HFDataFrame& ledDigi,
79  std::map<HcalDetId, std::map<int, LEDBUNCH> >& toolT,
80  const HcalDbService& cond);
81  void SetupLEDHists(int id, const HcalDetId detid, std::map<HcalDetId, std::map<int, LEDBUNCH> >& toolT);
82  void GetLedConst(std::map<HcalDetId, std::map<int, LEDBUNCH> >& toolT);
83  void LedTrendings(std::map<HcalDetId, std::map<int, LEDBUNCH> >& toolT);
84  void ProcessCalibEvent(int fiberChan, HcalCalibDetId calibId, const HcalCalibDataFrame& digi);
85  float BinsizeCorr(float time);
86 
90  std::ofstream m_outFile;
91  std::ofstream m_logFile;
92  std::ofstream m_outputFileXML;
93 
94  int m_startTS;
95  int m_endTS;
98  bool m_usecalib;
99  // analysis flag:
100  // m_fitflag = 0 - take mean TS value of averaged pulse shape
101  // 1 - take peak from landau fit to averaged pulse shape
102  // 2 - take average of mean TS values per event
103  // (preferred for laser & HF LED)
104  // 3 - take average of peaks from landau fits per event
105  // (preferred for LED)
106  // 4 - 0+1+2+3 REMOVED in 1_6
108 
112  struct {
113  std::map<HcalDetId, std::map<int, LEDBUNCH> > LEDTRENDS;
114  TH1F* ALLLEDS;
115  TH1F* LEDRMS;
116  TH1F* LEDMEAN;
117  TH1F* CHI2;
118  } hbHists, hfHists, hoHists;
119  std::map<HcalDetId, std::map<int, LEDBUNCH> >::iterator _meol;
120  std::map<HcalDetId, std::map<int, float> > m_AllPedVals;
121  std::map<HcalDetId, std::map<int, float> >::iterator _meee;
122 
123  std::map<HcalCalibDetId, CALIBBUNCH> calibHists;
124  std::map<HcalCalibDetId, CALIBBUNCH>::iterator _meca;
125 
126  //const HcalPedestal* pedCan;
127  int evt;
128  int sample;
129  int evt_curr;
130  std::vector<bool> state;
131 };
132 
133 #endif
HcalLedAnalysis::LEDRMS
TH1F * LEDRMS
Definition: HcalLedAnalysis.h:115
HcalLedAnalysis::state
std::vector< bool > state
Definition: HcalLedAnalysis.h:130
HcalLedAnalysis::m_endTS
int m_endTS
Definition: HcalLedAnalysis.h:95
HcalLedAnalysis::LedSetup
void LedSetup(const std::string &m_outputFileROOT)
Definition: HcalLedAnalysis.cc:180
ESHandle.h
HcalLedAnalysis::hfHists
struct HcalLedAnalysis::@56 hfHists
HcalLedAnalysis
Definition: HcalLedAnalysis.h:30
HcalCalibDetId
Definition: HcalCalibDetId.h:45
es_hardcode_cfi.hf
hf
Definition: es_hardcode_cfi.py:161
HcalLedAnalysis::m_usecalib
bool m_usecalib
Definition: HcalLedAnalysis.h:98
HcalLedAnalysis::ALLLEDS
TH1F * ALLLEDS
Definition: HcalLedAnalysis.h:114
HcalLedAnalysis::m_coder
const HcalQIECoder * m_coder
Definition: HcalLedAnalysis.h:110
HcalLedAnalysis::HcalLedAnalysis
HcalLedAnalysis(const edm::ParameterSet &ps)
Constructor.
Definition: HcalLedAnalysis.cc:11
edm::SortedCollection
Definition: SortedCollection.h:49
EDAnalyzer.h
HcalLedAnalysis::m_nevtsample
int m_nevtsample
Definition: HcalLedAnalysis.h:96
HcalLedAnalysis::m_shape
const HcalQIEShape * m_shape
Definition: HcalLedAnalysis.h:109
HcalLedAnalysis::_meca
std::map< HcalCalibDetId, CALIBBUNCH >::iterator _meca
Definition: HcalLedAnalysis.h:124
HcalLedAnalysis::LEDTRENDS
std::map< HcalDetId, std::map< int, LEDBUNCH > > LEDTRENDS
Definition: HcalLedAnalysis.h:113
HcalLedAnalysis::m_hiSaveflag
int m_hiSaveflag
Definition: HcalLedAnalysis.h:97
HcalLedAnalysis::LEDBUNCH
std::pair< TH1F *, std::pair< std::map< int, std::vector< double > >, std::vector< TH1F * > > > LEDBUNCH
Definition: HcalLedAnalysis.h:62
HcalLedAnalysis::ProcessCalibEvent
void ProcessCalibEvent(int fiberChan, HcalCalibDetId calibId, const HcalCalibDataFrame &digi)
Definition: HcalLedAnalysis.cc:999
MakerMacros.h
HcalLedAnalysis::LedDone
void LedDone()
Definition: HcalLedAnalysis.cc:510
Service.h
HcalDigiCollections.h
HcalLedAnalysis::m_outputFileROOT
std::string m_outputFileROOT
Definition: HcalLedAnalysis.h:87
HcalLedAnalysis::m_AllPedVals
std::map< HcalDetId, std::map< int, float > > m_AllPedVals
Definition: HcalLedAnalysis.h:120
HcalLedAnalysis::CHI2
TH1F * CHI2
Definition: HcalLedAnalysis.h:117
HcalPedestal
Definition: HcalPedestal.h:15
HcalLedAnalysis::m_outputFileXML
std::ofstream m_outputFileXML
Definition: HcalLedAnalysis.h:92
HcalLedAnalysis::hbHists
struct HcalLedAnalysis::@56 hbHists
HcalLedAnalysis::processLedEvent
void processLedEvent(const HBHEDigiCollection &hbhe, const HODigiCollection &ho, const HFDigiCollection &hf, const HcalCalibDigiCollection &calib, const HcalDbService &cond)
Definition: HcalLedAnalysis.cc:562
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalLedAnalysis::LedSampleAnalysis
void LedSampleAnalysis()
Definition: HcalLedAnalysis.cc:462
calib
Definition: CalibElectron.h:12
HcalLedAnalysis::m_logFile
std::ofstream m_logFile
Definition: HcalLedAnalysis.h:91
HcalLedAnalysis::GetLedConst
void GetLedConst(std::map< HcalDetId, std::map< int, LEDBUNCH > > &toolT)
Definition: HcalLedAnalysis.cc:215
HBHEDataFrame
Definition: HBHEDataFrame.h:14
HcalCalibDataFrame
Definition: HcalCalibDataFrame.h:15
cond
Definition: plugin.cc:23
HcalLedAnalysis::m_file
TFile * m_file
Definition: HcalLedAnalysis.h:68
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
HcalLedAnalysis::_meee
std::map< HcalDetId, std::map< int, float > >::iterator _meee
Definition: HcalLedAnalysis.h:121
HcalLedAnalysis::_meol
std::map< HcalDetId, std::map< int, LEDBUNCH > >::iterator _meol
Definition: HcalLedAnalysis.h:119
HcalDetId
Definition: HcalDetId.h:12
HcalLedAnalysis::LedHFHists
void LedHFHists(const HcalDetId &detid, const HFDataFrame &ledDigi, std::map< HcalDetId, std::map< int, LEDBUNCH > > &toolT, const HcalDbService &cond)
Definition: HcalLedAnalysis.cc:875
HFDataFrame
Definition: HFDataFrame.h:14
HcalLedAnalysis::CALIBBUNCH::integPulse
TH1F * integPulse
Definition: HcalLedAnalysis.h:66
HcalLedAnalysis::evt_curr
int evt_curr
Definition: HcalLedAnalysis.h:129
HcalLedAnalysis::hoHists
struct HcalLedAnalysis::@56 hoHists
HcalQIECoder
Definition: HcalQIECoder.h:20
photonIsolationHIProducer_cfi.hbhe
hbhe
Definition: photonIsolationHIProducer_cfi.py:8
HcalLedAnalysis::calibHists
std::map< HcalCalibDetId, CALIBBUNCH > calibHists
Definition: HcalLedAnalysis.h:123
HcalLedAnalysis::BinsizeCorr
float BinsizeCorr(float time)
Definition: HcalLedAnalysis.cc:954
HcalLedAnalysis::~HcalLedAnalysis
~HcalLedAnalysis()
Destructor.
Definition: HcalLedAnalysis.cc:149
HcalLedAnalysis::SetupLEDHists
void SetupLEDHists(int id, const HcalDetId detid, std::map< HcalDetId, std::map< int, LEDBUNCH > > &toolT)
Definition: HcalLedAnalysis.cc:650
HcalLedAnalysis::m_outputFileText
std::string m_outputFileText
Definition: HcalLedAnalysis.h:88
HcalDbService
Definition: HcalDbService.h:26
Frameworkfwd.h
HcalLedAnalysis::CALIBBUNCH::thisPulse
TH1F * thisPulse
Definition: HcalLedAnalysis.h:65
HODataFrame
Definition: HODataFrame.h:14
HcalLedAnalysis::m_startTS
int m_startTS
Definition: HcalLedAnalysis.h:94
HcalLedAnalysis::m_ped
const HcalPedestal * m_ped
Definition: HcalLedAnalysis.h:111
HcalQIEShape
Definition: HcalQIEShape.h:17
HcalLedAnalysis::CALIBBUNCH
Definition: HcalLedAnalysis.h:63
es_hardcode_cfi.ho
ho
Definition: es_hardcode_cfi.py:191
genParticles_cff.map
map
Definition: genParticles_cff.py:11
ParameterSet.h
HcalLedAnalysis::LEDMEAN
TH1F * LEDMEAN
Definition: HcalLedAnalysis.h:116
ntuplemaker.time
time
Definition: ntuplemaker.py:310
HcalLedAnalysis::m_fitflag
int m_fitflag
Definition: HcalLedAnalysis.h:107
HcalLedAnalysis::LedTrendings
void LedTrendings(std::map< HcalDetId, std::map< int, LEDBUNCH > > &toolT)
Definition: HcalLedAnalysis.cc:478
HcalLedAnalysis::m_outputFileX
std::string m_outputFileX
Definition: HcalLedAnalysis.h:89
HcalLedAnalysis::evt
int evt
Definition: HcalLedAnalysis.h:127
HcalLedAnalysis::LedHBHEHists
void LedHBHEHists(const HcalDetId &detid, const HBHEDataFrame &ledDigi, std::map< HcalDetId, std::map< int, LEDBUNCH > > &toolT, const HcalDbService &cond)
Definition: HcalLedAnalysis.cc:734
HcalLedAnalysis::CALIBBUNCH::avePulse
TProfile * avePulse
Definition: HcalLedAnalysis.h:64
HcalLedAnalysis::m_outFile
std::ofstream m_outFile
Definition: HcalLedAnalysis.h:90
HcalLedAnalysis::sample
int sample
Definition: HcalLedAnalysis.h:128
HcalLedAnalysis::LedHOHists
void LedHOHists(const HcalDetId &detid, const HODataFrame &ledDigi, std::map< HcalDetId, std::map< int, LEDBUNCH > > &toolT, const HcalDbService &cond)
Definition: HcalLedAnalysis.cc:805