Go to the documentation of this file.00001 #ifndef CastorLedAnalysis_H
00002 #define CastorLedAnalysis_H
00003
00004
00005 #include "FWCore/Framework/interface/Frameworkfwd.h"
00006 #include "FWCore/Framework/interface/EDAnalyzer.h"
00007 #include "FWCore/Framework/interface/Event.h"
00008 #include "FWCore/Framework/interface/MakerMacros.h"
00009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00010 #include "FWCore/ServiceRegistry/interface/Service.h"
00011 #include "FWCore/Framework/interface/ESHandle.h"
00012
00013 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
00014
00015
00016 #include "TH1F.h"
00017 #include "TF1.h"
00018 #include "TProfile.h"
00019
00020
00021 #include <memory>
00022
00023 #include <fstream>
00024 #include <vector>
00025 #include <string>
00026
00027 class CastorPedestal;
00028 class CastorDbService;
00029 class CastorQIEShape;
00030 class CastorQIECoder;
00031 class TFile;
00032
00033 class CastorLedAnalysis{
00034
00035 public:
00036
00038 CastorLedAnalysis(const edm::ParameterSet& ps);
00040 ~CastorLedAnalysis();
00041 void LedSetup(const std::string& m_outputFileROOT);
00042
00043 void LedSampleAnalysis();
00044 void LedDone();
00045 void processLedEvent(const CastorDigiCollection& castor,
00046 const CastorDbService& cond);
00047
00048 protected:
00049
00050
00051 private:
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 typedef std::pair<TH1F*,std::pair<std::map<int, std::vector<double> >,std::vector<TH1F*> > > LEDBUNCH;
00067 typedef struct{
00068 TProfile* avePulse[3];
00069 TH1F* thisPulse[3];
00070 TH1F* integPulse[3];
00071 } CALIBBUNCH;
00072 TFile* m_file;
00073 void LedCastorHists(const HcalDetId& detid, const CastorDataFrame& ledDigi, std::map<HcalDetId, std::map<int,LEDBUNCH> > &toolT, const CastorDbService& cond);
00074 void SetupLEDHists(int id, const HcalDetId detid, std::map<HcalDetId, std::map<int,LEDBUNCH> > &toolT);
00075 void GetLedConst(std::map<HcalDetId,std::map<int, LEDBUNCH > > &toolT);
00076 void LedTrendings(std::map<HcalDetId,std::map<int, LEDBUNCH > > &toolT);
00077 float BinsizeCorr(float time);
00078
00079 std::string m_outputFileROOT;
00080 std::string m_outputFileText;
00081 std::string m_outputFileX;
00082 std::ofstream m_outFile;
00083 std::ofstream m_logFile;
00084 std::ofstream m_outputFileXML;
00085 char output[100];
00086
00087 int m_startTS;
00088 int m_endTS;
00089 int m_nevtsample;
00090 int m_hiSaveflag;
00091 bool m_usecalib;
00092
00093
00094
00095
00096
00097
00098
00099
00100 int m_fitflag;
00101
00102 const CastorQIEShape* m_shape;
00103 const CastorQIECoder* m_coder;
00104 const CastorPedestal* m_ped;
00105 struct{
00106 std::map<HcalDetId,std::map<int, LEDBUNCH > > LEDTRENDS;
00107 TH1F* ALLLEDS;
00108 TH1F* LEDRMS;
00109 TH1F* LEDMEAN;
00110 TH1F* CHI2;
00111 } castorHists;
00112 std::map<HcalDetId,std::map<int, LEDBUNCH > >::iterator _meol;
00113 std::map<HcalDetId,std::map<int,float> > m_AllPedVals;
00114 std::map<HcalDetId,std::map<int,float> >::iterator _meee;
00115
00116 std::map<HcalCalibDetId,CALIBBUNCH>::iterator _meca;
00117
00118
00119 int evt;
00120 int sample;
00121 int evt_curr;
00122 std::vector<bool> state;
00123
00124 };
00125
00126 #endif