CMS 3D CMS Logo

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