CMS 3D CMS Logo

CastorLedAnalysis.h
Go to the documentation of this file.
1 #ifndef CastorLedAnalysis_H
2 #define CastorLedAnalysis_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 CastorPedestal;
24 class CastorDbService;
25 class CastorQIEShape;
26 class CastorQIECoder;
27 class TFile;
28 
30 public:
36  //void doPeds(const CastorPedestals* fInputPedestals);
37  void LedSampleAnalysis();
38  void LedDone();
40 
41 protected:
42 private:
43  //###
44  //# LEDBUNCH is used in map<HcalDetId,map<int, LEDBUNCH > > LEDTRENDS;
45  //# For each HcalDetId (channel) a map<int, LEDBUNCH> is associated;
46  //# int was originally cap-id and now is just dummy;
47  //# LEDBUNCH is a pair - first element is the main
48  //# histo with the ADC values and second one is another pair;
49  //# this pair contains map<int, std::vector<double> > as a first element;
50  //# vector contains some useful variables;
51  //# the second element is a vector of histos (pointers);
52  //# for the "trend" analysis the main histo (with ADC values) is reset every
53  //# m_nevtsample events and info is put in the other part of the LEDBUNCH;
54  //# so at the end we have the trends for the variables in concern
55  //# which are written in THE vector<TH1F*>;
56  //###
57  typedef std::pair<TH1F*, std::pair<std::map<int, std::vector<double> >, std::vector<TH1F*> > > LEDBUNCH;
58  typedef struct {
59  TProfile* avePulse[3];
60  TH1F* thisPulse[3];
61  TH1F* integPulse[3];
62  } CALIBBUNCH;
63  TFile* m_file;
64  void LedCastorHists(const HcalDetId& detid,
65  const CastorDataFrame& ledDigi,
66  std::map<HcalDetId, std::map<int, LEDBUNCH> >& toolT,
67  const CastorDbService& cond);
68  void SetupLEDHists(int id, const HcalDetId detid, std::map<HcalDetId, std::map<int, LEDBUNCH> >& toolT);
69  void GetLedConst(std::map<HcalDetId, std::map<int, LEDBUNCH> >& toolT);
70  void LedTrendings(std::map<HcalDetId, std::map<int, LEDBUNCH> >& toolT);
71  float BinsizeCorr(float time);
72 
76  std::ofstream m_outFile;
77  std::ofstream m_logFile;
78  std::ofstream m_outputFileXML;
79 
80  int m_startTS;
81  int m_endTS;
84  bool m_usecalib;
85  // analysis flag:
86  // m_fitflag = 0 - take mean TS value of averaged pulse shape
87  // 1 - take peak from landau fit to averaged pulse shape
88  // 2 - take average of mean TS values per event
89  // (preferred for laser & HF LED)
90  // 3 - take average of peaks from landau fits per event
91  // (preferred for LED)
92  // 4 - 0+1+2+3 REMOVED in 1_6
93  int m_fitflag;
94 
98  struct {
99  std::map<HcalDetId, std::map<int, LEDBUNCH> > LEDTRENDS;
100  TH1F* ALLLEDS;
101  TH1F* LEDRMS;
102  TH1F* LEDMEAN;
103  TH1F* CHI2;
104  } castorHists;
105  std::map<HcalDetId, std::map<int, LEDBUNCH> >::iterator _meol;
106  std::map<HcalDetId, std::map<int, float> > m_AllPedVals;
107  std::map<HcalDetId, std::map<int, float> >::iterator _meee;
108 
109  std::map<HcalCalibDetId, CALIBBUNCH>::iterator _meca;
110 
111  //const CastorPedestal* pedCan;
112  int evt;
113  int sample;
114  int evt_curr;
115  std::vector<bool> state;
116 };
117 
118 #endif
CastorLedAnalysis::m_shape
const CastorQIEShape * m_shape
Definition: CastorLedAnalysis.h:95
CastorLedAnalysis::m_endTS
int m_endTS
Definition: CastorLedAnalysis.h:81
CastorLedAnalysis::state
std::vector< bool > state
Definition: CastorLedAnalysis.h:115
CastorLedAnalysis::m_startTS
int m_startTS
Definition: CastorLedAnalysis.h:80
CastorLedAnalysis::m_AllPedVals
std::map< HcalDetId, std::map< int, float > > m_AllPedVals
Definition: CastorLedAnalysis.h:106
CastorLedAnalysis::m_outputFileX
std::string m_outputFileX
Definition: CastorLedAnalysis.h:75
CastorLedAnalysis::LedDone
void LedDone()
Definition: CastorLedAnalysis.cc:496
CastorLedAnalysis::m_outputFileText
std::string m_outputFileText
Definition: CastorLedAnalysis.h:74
CastorLedAnalysis::m_file
TFile * m_file
Definition: CastorLedAnalysis.h:63
protons_cff.time
time
Definition: protons_cff.py:35
edm::SortedCollection
Definition: SortedCollection.h:49
CastorLedAnalysis::LEDRMS
TH1F * LEDRMS
Definition: CastorLedAnalysis.h:101
CastorLedAnalysis::m_outFile
std::ofstream m_outFile
Definition: CastorLedAnalysis.h:76
EDAnalyzer.h
CastorLedAnalysis::m_nevtsample
int m_nevtsample
Definition: CastorLedAnalysis.h:82
CastorLedAnalysis::m_outputFileXML
std::ofstream m_outputFileXML
Definition: CastorLedAnalysis.h:78
CastorPedestal
Definition: CastorPedestal.h:16
CastorLedAnalysis::processLedEvent
void processLedEvent(const CastorDigiCollection &castor, const CastorDbService &cond)
Definition: CastorLedAnalysis.cc:522
CastorLedAnalysis::LEDTRENDS
std::map< HcalDetId, std::map< int, LEDBUNCH > > LEDTRENDS
Definition: CastorLedAnalysis.h:99
CastorLedAnalysis::LEDBUNCH
std::pair< TH1F *, std::pair< std::map< int, std::vector< double > >, std::vector< TH1F * > > > LEDBUNCH
Definition: CastorLedAnalysis.h:57
MakerMacros.h
CastorLedAnalysis::m_hiSaveflag
int m_hiSaveflag
Definition: CastorLedAnalysis.h:83
CastorLedAnalysis::SetupLEDHists
void SetupLEDHists(int id, const HcalDetId detid, std::map< HcalDetId, std::map< int, LEDBUNCH > > &toolT)
Definition: CastorLedAnalysis.cc:550
CastorLedAnalysis::LedCastorHists
void LedCastorHists(const HcalDetId &detid, const CastorDataFrame &ledDigi, std::map< HcalDetId, std::map< int, LEDBUNCH > > &toolT, const CastorDbService &cond)
Definition: CastorLedAnalysis.cc:592
CastorLedAnalysis::m_ped
const CastorPedestal * m_ped
Definition: CastorLedAnalysis.h:97
Service.h
CastorLedAnalysis::evt
int evt
Definition: CastorLedAnalysis.h:112
HcalDigiCollections.h
CastorLedAnalysis::CALIBBUNCH
Definition: CastorLedAnalysis.h:58
CastorLedAnalysis::castorHists
struct CastorLedAnalysis::@40 castorHists
CastorLedAnalysis::evt_curr
int evt_curr
Definition: CastorLedAnalysis.h:114
CastorLedAnalysis::LedSampleAnalysis
void LedSampleAnalysis()
Definition: CastorLedAnalysis.cc:450
cond
Definition: plugin.cc:23
CastorDataFrame
Definition: CastorDataFrame.h:15
CastorLedAnalysis::m_outputFileROOT
std::string m_outputFileROOT
Definition: CastorLedAnalysis.h:73
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
CastorLedAnalysis::CHI2
TH1F * CHI2
Definition: CastorLedAnalysis.h:103
CastorLedAnalysis::m_logFile
std::ofstream m_logFile
Definition: CastorLedAnalysis.h:77
CastorLedAnalysis::~CastorLedAnalysis
~CastorLedAnalysis()
Destructor.
Definition: CastorLedAnalysis.cc:137
CastorLedAnalysis::m_usecalib
bool m_usecalib
Definition: CastorLedAnalysis.h:84
CastorLedAnalysis::_meol
std::map< HcalDetId, std::map< int, LEDBUNCH > >::iterator _meol
Definition: CastorLedAnalysis.h:105
HcalDetId
Definition: HcalDetId.h:12
CastorLedAnalysis::GetLedConst
void GetLedConst(std::map< HcalDetId, std::map< int, LEDBUNCH > > &toolT)
Definition: CastorLedAnalysis.cc:160
CastorLedAnalysis::BinsizeCorr
float BinsizeCorr(float time)
Definition: CastorLedAnalysis.cc:669
CastorDbService
Definition: CastorDbService.h:25
CastorLedAnalysis::m_fitflag
int m_fitflag
Definition: CastorLedAnalysis.h:93
CastorLedAnalysis::CastorLedAnalysis
CastorLedAnalysis(const edm::ParameterSet &ps)
Constructor.
Definition: CastorLedAnalysis.cc:16
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CastorLedAnalysis::_meee
std::map< HcalDetId, std::map< int, float > >::iterator _meee
Definition: CastorLedAnalysis.h:107
CastorLedAnalysis::LedSetup
void LedSetup(const std::string &m_outputFileROOT)
Definition: CastorLedAnalysis.cc:152
CastorLedAnalysis::_meca
std::map< HcalCalibDetId, CALIBBUNCH >::iterator _meca
Definition: CastorLedAnalysis.h:109
CastorLedAnalysis
Definition: CastorLedAnalysis.h:29
CastorLedAnalysis::LedTrendings
void LedTrendings(std::map< HcalDetId, std::map< int, LEDBUNCH > > &toolT)
Definition: CastorLedAnalysis.cc:464
Frameworkfwd.h
CastorLedAnalysis::LEDMEAN
TH1F * LEDMEAN
Definition: CastorLedAnalysis.h:102
CastorLedAnalysis::ALLLEDS
TH1F * ALLLEDS
Definition: CastorLedAnalysis.h:100
CastorQIECoder
Definition: CastorQIECoder.h:21
genParticles_cff.map
map
Definition: genParticles_cff.py:11
ParameterSet.h
CastorLedAnalysis::sample
int sample
Definition: CastorLedAnalysis.h:113
CastorQIEShape
Definition: CastorQIEShape.h:14
castorDigitizer_cfi.castor
castor
Definition: castorDigitizer_cfi.py:9
CastorLedAnalysis::m_coder
const CastorQIECoder * m_coder
Definition: CastorLedAnalysis.h:96