File indexing completed on 2024-04-06 11:58:05
0001 #ifndef HcalLedAnalysis_H
0002 #define HcalLedAnalysis_H
0003
0004 #include "FWCore/Framework/interface/Frameworkfwd.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006
0007 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
0008
0009 #include "TH1F.h"
0010 #include "TF1.h"
0011 #include "TProfile.h"
0012
0013 #include <memory>
0014
0015 #include <fstream>
0016 #include <vector>
0017 #include <string>
0018
0019 class HcalPedestal;
0020 class HcalDbService;
0021 class HcalQIEShape;
0022 class HcalQIECoder;
0023 class TFile;
0024
0025 class HcalLedAnalysis {
0026 public:
0027
0028 HcalLedAnalysis(const edm::ParameterSet& ps);
0029
0030 ~HcalLedAnalysis();
0031 void LedSetup(const std::string& m_outputFileROOT);
0032
0033 void LedSampleAnalysis();
0034 void LedDone();
0035 void processLedEvent(const HBHEDigiCollection& hbhe,
0036 const HODigiCollection& ho,
0037 const HFDigiCollection& hf,
0038 const HcalCalibDigiCollection& calib,
0039 const HcalDbService& cond);
0040
0041 protected:
0042 private:
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057 typedef std::pair<TH1F*, std::pair<std::map<int, std::vector<double> >, std::vector<TH1F*> > > LEDBUNCH;
0058 typedef struct {
0059 TProfile* avePulse;
0060 TH1F* thisPulse;
0061 TH1F* integPulse;
0062 } CALIBBUNCH;
0063 TFile* m_file;
0064 void LedHBHEHists(const HcalDetId& detid,
0065 const HBHEDataFrame& ledDigi,
0066 std::map<HcalDetId, std::map<int, LEDBUNCH> >& toolT,
0067 const HcalDbService& cond);
0068 void LedHOHists(const HcalDetId& detid,
0069 const HODataFrame& ledDigi,
0070 std::map<HcalDetId, std::map<int, LEDBUNCH> >& toolT,
0071 const HcalDbService& cond);
0072 void LedHFHists(const HcalDetId& detid,
0073 const HFDataFrame& ledDigi,
0074 std::map<HcalDetId, std::map<int, LEDBUNCH> >& toolT,
0075 const HcalDbService& cond);
0076 void SetupLEDHists(int id, const HcalDetId detid, std::map<HcalDetId, std::map<int, LEDBUNCH> >& toolT);
0077 void GetLedConst(std::map<HcalDetId, std::map<int, LEDBUNCH> >& toolT);
0078 void LedTrendings(std::map<HcalDetId, std::map<int, LEDBUNCH> >& toolT);
0079 void ProcessCalibEvent(int fiberChan, HcalCalibDetId calibId, const HcalCalibDataFrame& digi);
0080 float BinsizeCorr(float time);
0081
0082 std::string m_outputFileROOT;
0083 std::string m_outputFileText;
0084 std::string m_outputFileX;
0085 std::ofstream m_outFile;
0086 std::ofstream m_outputFileXML;
0087
0088 int m_startTS;
0089 int m_endTS;
0090 int m_nevtsample;
0091 int m_hiSaveflag;
0092 bool m_usecalib;
0093
0094
0095
0096
0097
0098
0099
0100
0101 int m_fitflag;
0102
0103 const HcalQIEShape* m_shape;
0104 const HcalQIECoder* m_coder;
0105 const HcalPedestal* m_ped;
0106 struct {
0107 std::map<HcalDetId, std::map<int, LEDBUNCH> > LEDTRENDS;
0108 TH1F* ALLLEDS;
0109 TH1F* LEDRMS;
0110 TH1F* LEDMEAN;
0111 TH1F* CHI2;
0112 } hbHists, hfHists, hoHists;
0113 std::map<HcalDetId, std::map<int, LEDBUNCH> >::iterator _meol;
0114 std::map<HcalDetId, std::map<int, float> > m_AllPedVals;
0115 std::map<HcalDetId, std::map<int, float> >::iterator _meee;
0116
0117 std::map<HcalCalibDetId, CALIBBUNCH> calibHists;
0118 std::map<HcalCalibDetId, CALIBBUNCH>::iterator _meca;
0119
0120
0121 int evt;
0122 int sample;
0123 int evt_curr;
0124 std::vector<bool> state;
0125 };
0126
0127 #endif