#include <HFPreLightCal.h>
Definition at line 11 of file HFPreLightCal.h.
HFPreLightCal::~HFPreLightCal |
( |
| ) |
|
|
virtual |
Implements edm::EDAnalyzer.
Definition at line 124 of file HFPreLightCal.cc.
References ecalMGPA::adc(), calib, gather_cfg::cout, HcalDetId::depth(), edm::EventID::event(), event_NN, HcalObjRepresent::Fill(), edm::Event::getByType(), HcalForward, HFDataFrame::id(), edm::EventBase::id(), HcalDetId::ieta(), HcalDetId::iphi(), edm::EventID::run(), run_NN, convertSQLiteXML::runNumber, HFDataFrame::size(), and HcalDetId::subdet().
129 int eventNumber = eventId.
event ();
132 if (
verbose)
std::cout <<
"========================================="<<std::endl
133 <<
"run/event: "<<runNumber<<
'/'<<eventNumber<<std::endl;
138 if (
verbose)
std::cout<<
"Analysis-> total CAL digis= "<<calib->size()<<std::endl;
166 if (
verbose)
std::cout<<
"Analysis-> total HF digis= "<<hf_digi->size()<<std::endl;
168 for (
unsigned ihit = 0; ihit < hf_digi->size (); ++ihit) {
171 int ieta = detId.
ieta();
172 int iphi = detId.
iphi();
173 int depth = detId.
depth();
175 <<ieta<<
'/'<<iphi<<
'/'<< depth << std::endl;
177 if (ieta>0) ieta = ieta-29;
178 else ieta = 13-ieta-29;
180 for (
int isample = 0; isample < frame.
size(); ++isample) {
181 int adc = frame[isample].adc();
182 int capid = frame[isample].capid ();
183 double linear_ADC = frame[isample].nominal_fC();
184 double nominal_fC = detId.
subdet () ==
HcalForward ? 2.6 * linear_ADC : linear_ADC;
187 <<
", capid=" << capid
189 <<
", linearized ADC=" << linear_ADC
190 <<
", nominal fC=" << nominal_fC << std::endl;
192 hts[ieta][(iphi-1)/2][depth-1]->
Fill(isample,linear_ADC);
int adc(sample_type sample)
get the ADC sample (12 bits)
EventNumber_t event() const
HcalSubdetector subdet() const
get the subdetector
bool getByType(Handle< PROD > &result) const
int depth() const
get the tower depth
MVATrainerComputer * calib
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
int ieta() const
get the cell ieta
int iphi() const
get the cell iphi
int size() const
total number of samples in the digi
const HcalDetId & id() const
void HFPreLightCal::beginJob |
( |
void |
| ) |
|
|
virtual |
Reimplemented from edm::EDAnalyzer.
Definition at line 48 of file HFPreLightCal.cc.
References gather_cfg::cout, cmsRelvalreport::exit, i, j, gen::k, and NULL.
51 std::cout<<std::endl<<
"HFPreLightCal beginJob: --> ";
55 printf(
"\nNo textfile open\n\n");
56 std::cout<<
"Problem with output Pre-textFILE => exit"<<std::endl;
60 htsmax =
new TH1F(
"htsmax",
"Max TS",100,0,10);
61 htspinmax =
new TH1F(
"htspinmax",
"Max TS PIN",100,0,10);
63 for (
int i=0;
i<13;
i++)
for (
int j=0;
j<36;
j++)
for (
int k=0;
k<2;
k++) {
64 if (
i>10 &&
j%2==0)
continue;
65 sprintf(htit,
"tspre_+%d_%d_%d",
i+29,
j*2+1,
k+1);
66 hts[
i][
j][
k] =
new TH1F(htit,htit,10,-0.5,9.5);
67 sprintf(htit,
"tspre_-%d_%d_%d",
i+29,
j*2+1,
k+1);
68 hts[
i+13][
j][
k] =
new TH1F(htit,htit,10,-0.5,9.5);
71 for (
int i=0;
i<4;
i++)
for (
int j=0;
j<3;
j++) {
72 sprintf(htit,
"tspre_PIN%d_+Q%d",
j+1,
i+1);
73 htspin[
i][
j] =
new TH1F(htit,htit,10,-0.5,9.5);
74 sprintf(htit,
"tspre_PIN%d_-Q%d",
j+1,
i+1);
75 htspin[
i+4][
j] =
new TH1F(htit,htit,10,-0.5,9.5);
void HFPreLightCal::endJob |
( |
void |
| ) |
|
|
virtual |
Reimplemented from edm::EDAnalyzer.
Definition at line 81 of file HFPreLightCal.cc.
References cont, gather_cfg::cout, event_NN, i, j, and gen::k.
86 std::cout<<std::endl<<
"HFPreLightCal endJob --> ";
88 for (
int i=0;
i<26;
i++)
for (
int j=0;
j<36;
j++)
for (
int k=0;
k<2;
k++) {
89 if (
i>10 &&
i<13 &&
j%2==0)
continue;
90 if (
i>23 &&
j%2==0)
continue;
92 for (
int ii=1; ii<=10; ii++) {
93 cont =
hts[
i][
j][
k]->GetBinContent(ii);
94 if (ii<3) cont=cont-(
hts[
i][
j][
k]->GetBinContent(ii+4)+
hts[
i][
j][
k]->GetBinContent(ii+8))/2;
95 else if (ii<5) cont=cont-
hts[
i][
j][
k]->GetBinContent(ii+4);
96 else if (ii<7) cont=cont-(
hts[
i][
j][
k]->GetBinContent(ii-4)+
hts[
i][
j][
k]->GetBinContent(ii+4))/2;
97 else if (ii<9) cont=cont-
hts[
i][
j][
k]->GetBinContent(ii-4);
98 else cont=cont-(
hts[
i][
j][
k]->GetBinContent(ii-4)+
hts[
i][
j][
k]->GetBinContent(ii-8))/2;
105 if (
i<13) fprintf(
tFile,
" %d %d %d %d\n",
i+29,
j*2+1,
k+1,tsmax);
106 else fprintf(
tFile,
" %d %d %d %d\n",13-
i-29,
j*2+1,
k+1,tsmax);
109 for (
int i=0;
i<8;
i++)
for (
int j=0;
j<3;
j++) {
111 tsmax =
htspin[
i][
j]->GetMaximumBin();
113 if (
i<4) fprintf(
tFile,
"%d %d %d\n",
i+1,
j+1,tsmax);
114 else fprintf(
tFile,
"%d %d %d\n",-
i+3,
j+1,tsmax);
std::string HFPreLightCal::histfile |
|
private |
TH1F* HFPreLightCal::hts[26][36][2] |
|
private |
TH1F* HFPreLightCal::htsmax |
|
private |
TH1F* HFPreLightCal::htspin[8][3] |
|
private |
TH1F * HFPreLightCal::htspinmax |
|
private |
TFile* HFPreLightCal::mFile |
|
private |
std::string HFPreLightCal::textfile |
|
private |
FILE* HFPreLightCal::tFile |
|
private |