CMS 3D CMS Logo

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