CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
CSCAFEBThrAnalysis Class Reference

#include <CSCAFEBThrAnalysis.h>

Public Member Functions

void analyze (const CSCWireDigiCollection &wirecltn)
 
 CSCAFEBThrAnalysis ()
 
void done ()
 
void setup (const std::string &histoFileName)
 

Private Member Functions

void bookForId (int flag, const int &idint, const std::string &ids)
 
void hf1ForId (std::map< int, TH1 * > &mp, int flag, const int &id, float &x, float w)
 
void hf2ForId (std::map< int, TH2 * > &mp, int flag, const int &id, float &x, float &y, float w)
 

Private Attributes

int BegDac
 
const CSCToAFEB csctoafeb
 Layer, wire to AFEB, channel conversion. More...
 
int EndDac
 
int EvDac
 
TFile * hist_file
 ROOT hist file. More...
 
int unsigned indDac
 
std::map< int, std::vector
< std::vector< float > > > 
m_res_for_db
 
std::map< int, std::vector
< std::vector< int > > > 
m_wire_dac
 
std::map< int, std::vector< int > > m_wire_ev
 Maps - per event, threshold curve, fit results. More...
 
std::map< int, TH2 * > mh_AfebChi2perNDF
 
std::map< int, TH2 * > mh_AfebDac
 
std::map< int, TH2 * > mh_AfebNDF
 
std::map< int, TH2 * > mh_AfebNoisePar
 
std::map< int, TH2 * > mh_AfebThrPar
 
std::map< int, TH1 * > mh_ChanEff
 Histogram maps. More...
 
std::map< int, TH2 * > mh_FirstTime
 
int nmbev
 Statistics. More...
 
int nmbev_no_wire
 
int npulses
 DAC info. More...
 
int StepDac
 
std::vector< float > vecDac
 
std::vector< int > vecDacOccup
 

Detailed Description

Author

Definition at line 18 of file CSCAFEBThrAnalysis.h.

Constructor & Destructor Documentation

CSCAFEBThrAnalysis::CSCAFEBThrAnalysis ( )

Definition at line 10 of file CSCAFEBThrAnalysis.cc.

References BegDac, EndDac, EvDac, hist_file, indDac, m_res_for_db, m_wire_dac, mh_AfebDac, mh_ChanEff, mh_FirstTime, nmbev, nmbev_no_wire, npulses, StepDac, vecDac, and vecDacOccup.

10  {
11  hist_file = nullptr; // set to null
12 
13  nmbev = 0;
14  nmbev_no_wire = 0;
15 
16  npulses = 100;
17  vecDac.clear();
18  BegDac = 1;
19  EndDac = 29;
20  EvDac = 1;
21  StepDac = 1;
22  indDac = 0;
23 
24  vecDacOccup.assign(150, 0);
25  m_wire_dac.clear();
26  m_res_for_db.clear();
27  mh_ChanEff.clear();
28  mh_FirstTime.clear();
29  mh_AfebDac.clear();
30 }
std::map< int, TH2 * > mh_FirstTime
std::map< int, std::vector< std::vector< float > > > m_res_for_db
std::map< int, TH1 * > mh_ChanEff
Histogram maps.
std::vector< int > vecDacOccup
std::map< int, TH2 * > mh_AfebDac
std::vector< float > vecDac
int nmbev
Statistics.
TFile * hist_file
ROOT hist file.
std::map< int, std::vector< std::vector< int > > > m_wire_dac

Member Function Documentation

void CSCAFEBThrAnalysis::analyze ( const CSCWireDigiCollection wirecltn)

Store DAC

Plot time bin of the first hit vs AFEB channels

Store time bin of the first hit into map

Accumulate hits into map of wires vs DAC

Definition at line 127 of file CSCAFEBThrAnalysis.cc.

References BegDac, csctoafeb, CSCDetId::endcap(), EndDac, CSCToAFEB::getAfebCh(), CSCToAFEB::getAfebPos(), CSCToAFEB::getMaxWire(), hf2ForId(), mps_fire::i, indDac, dqmiolumiharvest::j, phase1PixelTopology::layer, m_wire_dac, m_wire_ev, mh_FirstTime, nmbev, nmbev_no_wire, sistrip::SpyUtilities::range(), relativeConstraints::ring, contentValuesCheck::ss, relativeConstraints::station, StepDac, vecDac, vecDacOccup, x, and y.

Referenced by CSCAFEBAnalyzer::analyze().

127  {
128  std::ostringstream ss;
129  std::map<int, std::vector<int> >::iterator intIt;
130  std::map<int, std::vector<std::vector<int> > >::iterator wiredacIt;
131 
132  std::vector<int> vec;
133  int afeb, ch;
134  float x, y;
135 
136  m_wire_ev.clear();
137 
139 
140  nmbev++;
141  //indDac=(nmbev-1)/EvDac;
142  float dac = BegDac + StepDac * indDac;
143  if (vecDac.size() <= indDac)
144  vecDac.push_back(dac);
145 
146  //std::cout<<" Event "<<nmbev;
147  //std::cout<<" "<<indDac<<" "<<vecDac[indDac]<<std::endl;
148 
149  //Anode wires
150 
152  if (wirecltn.begin() == wirecltn.end())
153  nmbev_no_wire++;
154 
155  if (wirecltn.begin() != wirecltn.end()) {
157 
158  for (wiredetUnitIt = wirecltn.begin(); wiredetUnitIt != wirecltn.end(); ++wiredetUnitIt) {
159  const CSCDetId& id = (*wiredetUnitIt).first;
160 
161  const int idchamber = id.endcap() * 10000 + id.station() * 1000 + id.ring() * 100 + id.chamber();
162  const int idlayer =
163  id.endcap() * 100000 + id.station() * 10000 + id.ring() * 1000 + id.chamber() * 10 + id.layer();
164 
165  // std::cout<<idchamber<<" "<<idlayer<<std::endl;
166 
167  const int maxwire = csctoafeb.getMaxWire(id.station(), id.ring());
168  std::vector<int> wireplane(maxwire, 0);
169 
170  const CSCWireDigiCollection::Range& range = (*wiredetUnitIt).second;
171  for (CSCWireDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; ++digiIt) {
172  int iwire = (*digiIt).getWireGroup();
173  if (iwire <= maxwire) {
174  if (wireplane[iwire - 1] == 0) {
175  wireplane[iwire - 1] = (*digiIt).getBeamCrossingTag() + 1;
176  ch = csctoafeb.getAfebCh(id.layer(), (*digiIt).getWireGroup());
177  afeb = csctoafeb.getAfebPos(id.layer(), (*digiIt).getWireGroup());
178 
180 
181  x = (afeb - 1) * 16 + ch;
182  y = wireplane[iwire - 1];
183  hf2ForId(mh_FirstTime, 100, idchamber, x, y, 1.0);
184 
185  } // end if wireplane[iwire-1]==0
186  } // end if iwire<=csctoafeb.getMaxWire(id.station(),id.ring()
187  } // end of for digis in layer
188 
190 
191  if (m_wire_ev.find(idlayer) == m_wire_ev.end())
192  m_wire_ev[idlayer] = wireplane;
193 
194  } // end of cycle on detUnit
195 
197 
198  for (intIt = m_wire_ev.begin(); intIt != m_wire_ev.end(); ++intIt) {
199  const int idwirev = (*intIt).first;
200  const std::vector<int> wiretemp = (*intIt).second; // What for?
201  int nsize = EndDac - BegDac + 1;
202  std::vector<int> zer(nsize, 0);
203 
204  wiredacIt = m_wire_dac.find(idwirev);
205  if (wiredacIt == m_wire_dac.end()) {
206  for (unsigned int j = 0; j < wiretemp.size(); j++)
207  m_wire_dac[idwirev].push_back(zer);
208  wiredacIt = m_wire_dac.find(idwirev);
209  // std::cout<<idwirev<<" "<<wiredacIt->second.size()<<" "<<
210  // wiredacIt->second[0].size()<<std::endl;
211  }
212  for (unsigned int i = 0; i < (*intIt).second.size(); i++)
213  if ((*intIt).second[i] > 0)
214  wiredacIt->second[i][indDac] = wiredacIt->second[i][indDac] + 1;
215  } // end of adding hits to the map of wire/DAC
216  } // end of if wire collection not empty
217  indDac++;
218  if (dac == (float)EndDac)
219  indDac = 0;
220 } // end of void CSCAFEBThrAnalysis
int getAfebCh(int layer, int wiregroup) const
return AFEB channel number
Definition: CSCToAFEB.cc:14
std::map< int, TH2 * > mh_FirstTime
std::map< int, std::vector< int > > m_wire_ev
Maps - per event, threshold curve, fit results.
constexpr std::array< uint8_t, layerIndexSize > layer
const uint16_t range(const Frame &aFrame)
int endcap() const
Definition: CSCDetId.h:85
std::vector< int > vecDacOccup
int getMaxWire(int station, int ring) const
return max. number of wiregroups per layer
Definition: CSCToAFEB.cc:53
std::vector< float > vecDac
const CSCToAFEB csctoafeb
Layer, wire to AFEB, channel conversion.
std::pair< const_iterator, const_iterator > Range
std::vector< DigiType >::const_iterator const_iterator
int nmbev
Statistics.
int getAfebPos(int layer, int wiregroup) const
return AFEB position number
Definition: CSCToAFEB.cc:20
std::map< int, std::vector< std::vector< int > > > m_wire_dac
void hf2ForId(std::map< int, TH2 * > &mp, int flag, const int &id, float &x, float &y, float w)
void CSCAFEBThrAnalysis::bookForId ( int  flag,
const int &  idint,
const std::string &  ids 
)
private

Definition at line 38 of file CSCAFEBThrAnalysis.cc.

References hist_file, mh_AfebChi2perNDF, mh_AfebDac, mh_AfebNDF, mh_AfebNoisePar, mh_AfebThrPar, mh_ChanEff, mh_FirstTime, and contentValuesCheck::ss.

Referenced by hf1ForId(), and hf2ForId().

38  {
39  hist_file->cd();
40 
41  std::ostringstream ss;
42 
43  if (flag == 100) {
44  ss << idint << "_Anode_First_Time";
45  mh_FirstTime[idint] = new TH2F(ss.str().c_str(), "", 675, 0.0, 675.0, 50, 0.0, 10.0);
46  mh_FirstTime[idint]->GetXaxis()->SetTitle("(AFEB-1)*16+ch");
47  mh_FirstTime[idint]->GetYaxis()->SetTitle("Anode First Time Bin");
48  mh_FirstTime[idint]->SetOption("BOX");
49  ss.str(""); // clear
50  }
51 
52  if (flag == 101) {
53  ss << idint << "_Anode_Chan_Eff";
54  mh_ChanEff[idint] = new TH1F(ss.str().c_str(), "", 675, 0.0, 675.0);
55  mh_ChanEff[idint]->GetXaxis()->SetTitle("(AFEB-1)*16+ch");
56  mh_ChanEff[idint]->GetYaxis()->SetTitle("Entries");
57  ss.str(""); // clear
58  }
59 
60  if (flag == 200) {
61  ss << idint << "_Anode_AfebDac";
62  mh_AfebDac[idint] = new TH2F(ss.str().c_str(), "", 75, 0.0, 75.0, 50, 0.0, 50.0);
63  mh_AfebDac[idint]->GetXaxis()->SetTitle("Threshold DAC");
64  mh_AfebDac[idint]->GetYaxis()->SetTitle("AFEB Channel Occupancy");
65  mh_AfebDac[idint]->SetOption("COL");
66  ss.str(""); // clear
67  }
68 
69  if (flag == 300) {
70  ss << idint << "_Anode_AfebThrPar";
71  mh_AfebThrPar[idint] = new TH2F(ss.str().c_str(), "", 700, 0.0, 700.0, 50, 0.0, 50.0);
72  mh_AfebThrPar[idint]->GetXaxis()->SetTitle("(AFEB-1)*16+ch");
73  mh_AfebThrPar[idint]->GetYaxis()->SetTitle("AFEB Channel Threshold (DAC)");
74  mh_AfebThrPar[idint]->SetOption("BOX");
75  ss.str(""); // clear
76  }
77 
78  if (flag == 400) {
79  ss << idint << "_Anode_AfebNoisePar";
80  mh_AfebNoisePar[idint] = new TH2F(ss.str().c_str(), "", 700, 0.0, 700.0, 50, 0.0, 5.0);
81  mh_AfebNoisePar[idint]->GetXaxis()->SetTitle("(AFEB-1)*16+ch");
82  mh_AfebNoisePar[idint]->GetYaxis()->SetTitle("AFEB Channel Noise (DAC)");
83  mh_AfebNoisePar[idint]->SetOption("BOX");
84  ss.str(""); // clear
85  }
86 
87  if (flag == 500) {
88  ss << idint << "_Anode_AfebNDF";
89  mh_AfebNDF[idint] = new TH2F(ss.str().c_str(), "", 700, 0.0, 700.0, 25, -5.0, 20.0);
90  mh_AfebNDF[idint]->GetXaxis()->SetTitle("(AFEB-1)*16+ch");
91  mh_AfebNDF[idint]->GetYaxis()->SetTitle("AFEB Channel Fit NDF");
92  mh_AfebNDF[idint]->SetOption("BOX");
93  ss.str(""); // clear
94  }
95 
96  if (flag == 600) {
97  ss << idint << "_Anode_AfebChi2perNDF";
98  mh_AfebChi2perNDF[idint] = new TH2F(ss.str().c_str(), "", 700, 0.0, 700.0, 50, 0.0, 10.0);
99  mh_AfebChi2perNDF[idint]->GetXaxis()->SetTitle("(AFEB-1)*16+ch");
100  mh_AfebChi2perNDF[idint]->GetYaxis()->SetTitle("AFEB Channel Fit Chi2/NDF");
101  mh_AfebChi2perNDF[idint]->SetOption("BOX");
102  ss.str(""); // clear
103  }
104 }
std::map< int, TH2 * > mh_FirstTime
std::map< int, TH1 * > mh_ChanEff
Histogram maps.
std::map< int, TH2 * > mh_AfebChi2perNDF
std::map< int, TH2 * > mh_AfebDac
std::map< int, TH2 * > mh_AfebNDF
TFile * hist_file
ROOT hist file.
std::map< int, TH2 * > mh_AfebNoisePar
std::map< int, TH2 * > mh_AfebThrPar
void CSCAFEBThrAnalysis::done ( )

Plot "efficiency" vs AFEB channels

Fitting threshold curve

Histogram fit results for given CSC vs wire defined as x=(afeb-1)*16+ch

Threshold

Noise

NDF

Chi2/NDF

Prepare vector of fit results

Store fit results to map of wire vectors of vectors of results

Definition at line 222 of file CSCAFEBThrAnalysis.cc.

References BegDac, gather_cfg::cout, CSCFitAFEBThr::CSCFitAFEBThr(), csctoafeb, EndDac, CSCToAFEB::getAfebCh(), CSCToAFEB::getAfebPos(), hf1ForId(), hf2ForId(), hist_file, mps_fire::i, indDac, dqmiolumiharvest::j, phase1PixelTopology::layer, m_res_for_db, m_wire_dac, mh_AfebChi2perNDF, mh_AfebDac, mh_AfebNDF, mh_AfebNoisePar, mh_AfebThrPar, mh_ChanEff, nmbev, nmbev_no_wire, npulses, findQualityFiles::size, CSCFitAFEBThr::ThresholdNoise(), vecDac, vecDacOccup, x, and y.

Referenced by CSCAFEBAnalyzer::endJob().

222  {
223  float x, y;
224 
225  //This is for DB transfer
226  CSCobject cn{};
227 
228  std::map<int, std::vector<std::vector<int> > >::iterator mwiredacIt;
229  std::map<int, std::vector<std::vector<float> > >::iterator mresfordbIt;
230  std::vector<int>::iterator vecIt;
231 
232  std::cout << "Events analyzed " << nmbev << std::endl;
233  std::cout << "Events no anodes " << nmbev_no_wire << std::endl << std::endl;
234 
235  std::cout << "DAC occupancy" << std::endl;
236  size_t ndacsize = EndDac - BegDac + 1;
237  for (size_t i = 0; i < ndacsize; i++)
238  std::cout << " " << vecDacOccup[i];
239  std::cout << "\n\n" << std::endl;
240 
241  std::vector<float> inputx;
242  std::vector<float> inputy;
243 
244  std::vector<float> mypar(2, 0.0);
245  std::vector<float> ermypar(2, 0.0);
246  float ercorr, chisq, edm;
247  int ndf, niter;
248 
249  int ch, afeb, idchmb;
250 
251  CSCFitAFEBThr* fitAnodeThr;
252 
253  std::vector<float> fitres(4, 0);
254 
255  // std::cout<<"Threshold curves:\n"<<std::endl;
256 
257  for (mwiredacIt = m_wire_dac.begin(); mwiredacIt != m_wire_dac.end(); ++mwiredacIt) {
258  int idwiredac = (*mwiredacIt).first;
259 
260  int layer = idwiredac - (idwiredac / 10) * 10;
261  idchmb = idwiredac / 10;
262 
263  for (int unsigned iwire = 0; iwire < mwiredacIt->second.size(); iwire++) {
264  afeb = csctoafeb.getAfebPos(layer, iwire + 1);
265  ch = csctoafeb.getAfebCh(layer, iwire + 1);
266  int afebid = (idwiredac / 10) * 100 + csctoafeb.getAfebPos(layer, iwire + 1);
267 
268  indDac = 0;
269  for (vecIt = mwiredacIt->second[iwire].begin(); vecIt != mwiredacIt->second[iwire].end(); ++vecIt) {
270  x = vecDac[indDac];
271  y = *vecIt;
272  hf2ForId(mh_AfebDac, 200, afebid, x, y, 1.0);
273 
275  if (indDac == 0) {
276  x = (afeb - 1) * 16 + ch;
277  y = *vecIt;
278  hf1ForId(mh_ChanEff, 101, idchmb, x, y);
279  }
280 
281  inputx.push_back(x);
282  inputy.push_back(y);
283 
284  indDac++;
285  }
286  // end of DAC cycle to form vectors of input data (inputx,inputy)for fit
287 
288  // std::cout<<afebid<<" "<<ch<<std::endl;
289  // for(unsigned int i=0;i<inputx.size();i++)
290  // std::cout<<" "<<inputy[i];
291  // std::cout<<std::endl;
292 
293  for (unsigned int i = 0; i < 2; i++) {
294  mypar[i] = 0.0;
295  ermypar[i] = 0.0;
296  }
297  ercorr = 0.0;
298  chisq = 0.0;
299  ndf = 0;
300  niter = 0;
301  edm = 0.0;
302 
304  fitAnodeThr = new CSCFitAFEBThr();
305 
306  fitAnodeThr->ThresholdNoise(inputx, inputy, npulses, vecDacOccup, mypar, ermypar, ercorr, chisq, ndf, niter, edm);
307  delete fitAnodeThr;
308 
309  // std::cout<<"Fit "<<mypar[0]<<" "<<mypar[1]<<" "<<ndf<<" "<<chisq
310  // <<std::endl<<std::endl;
311 
313 
314  x = (afeb - 1) * 16 + ch;
315 
317  y = mypar[0];
318  hf2ForId(mh_AfebThrPar, 300, idchmb, x, y, 1.0);
319 
321  y = mypar[1];
322  hf2ForId(mh_AfebNoisePar, 400, idchmb, x, y, 1.0);
323 
325  y = ndf;
326  hf2ForId(mh_AfebNDF, 500, idchmb, x, y, 1.0);
327 
329  y = 0.0;
330  if (ndf > 0)
331  y = chisq / (float)ndf;
332  hf2ForId(mh_AfebChi2perNDF, 600, idchmb, x, y, 1.0);
333 
335  fitres[0] = mypar[0];
336  fitres[1] = mypar[1];
337  fitres[2] = ndf;
338  fitres[3] = 0.0;
339  if (ndf > 0)
340  fitres[3] = chisq / (float)ndf;
341 
343 
344  mresfordbIt = m_res_for_db.find(idwiredac);
345  if (mresfordbIt == m_res_for_db.end())
346  m_res_for_db[idwiredac].push_back(fitres);
347  else
348  m_res_for_db[idwiredac].push_back(fitres);
349 
350  inputx.clear();
351  inputy.clear();
352 
353  } // end for(int iwire=0)
354  } // end of iteration thru m_wire_dac map
355 
356  std::cout << "Size of map for DB " << m_res_for_db.size() << std::endl;
357 
358  std::cout << "The following CSCs will go to DB" << std::endl << std::endl;
359 
360  for (mresfordbIt = m_res_for_db.begin(); mresfordbIt != m_res_for_db.end(); ++mresfordbIt) {
361  int idlayer = (*mresfordbIt).first;
362  idchmb = idlayer / 10;
363  int layer = idlayer - idchmb * 10;
364  std::cout << "CSC " << idchmb << " Layer " << layer << " " << (*mresfordbIt).second.size() << std::endl;
365  }
366 
367  for (mresfordbIt = m_res_for_db.begin(); mresfordbIt != m_res_for_db.end(); ++mresfordbIt) {
368  int idlayer = (*mresfordbIt).first;
369 
370  //This is for DB transfer
371  int size = (*mresfordbIt).second.size();
372  cn.obj[idlayer].resize(size);
373 
374  for (unsigned int i = 0; i < (*mresfordbIt).second.size(); i++) {
375  std::cout << idlayer << " " << i + 1 << " ";
376 
377  for (int j = 0; j < 4; j++)
378  std::cout << (*mresfordbIt).second[i][j] << " ";
379  std::cout << std::endl;
380 
381  //This is for DB transfer
382  cn.obj[idlayer][i].resize(4);
383  cn.obj[idlayer][i][0] = (*mresfordbIt).second[i][0];
384  cn.obj[idlayer][i][1] = (*mresfordbIt).second[i][1];
385  cn.obj[idlayer][i][2] = (*mresfordbIt).second[i][2];
386  cn.obj[idlayer][i][3] = (*mresfordbIt).second[i][3];
387  }
388  }
389 
390  //send data to DB
391  //dbon->cdbon_last_run("afeb_thresholds",&run);
392  //std::cout<<"Last AFEB thresholds run "<<run<<" for run file "<<myname<<" saved "<<myTime<<std::endl;
393  //if(debug) dbon->cdbon_write(cn,"afeb_thresholds",run+1,myTime);
394 
395  if (hist_file != nullptr) { // if there was a histogram file...
396  hist_file->Write(); // write out the histrograms
397  delete hist_file; // close and delete the file
398  hist_file = nullptr; // set to zero to clean up
399  std::cout << "Hist. file was closed\n";
400  }
401 
402  std::cout << " End of CSCAFEBThrAnalysis" << std::endl;
403 }
int getAfebCh(int layer, int wiregroup) const
return AFEB channel number
Definition: CSCToAFEB.cc:14
std::map< int, std::vector< std::vector< float > > > m_res_for_db
virtual bool ThresholdNoise(const std::vector< float > &inputx, const std::vector< float > &inputy, const int &npulses, std::vector< int > &dacoccup, std::vector< float > &mypar, std::vector< float > &ermypar, float &ercorr, float &chisq, int &ndf, int &niter, float &edm) const
constexpr std::array< uint8_t, layerIndexSize > layer
std::map< int, TH1 * > mh_ChanEff
Histogram maps.
std::vector< int > vecDacOccup
std::map< int, TH2 * > mh_AfebChi2perNDF
std::map< int, TH2 * > mh_AfebDac
std::vector< float > vecDac
const CSCToAFEB csctoafeb
Layer, wire to AFEB, channel conversion.
std::map< int, TH2 * > mh_AfebNDF
int nmbev
Statistics.
void hf1ForId(std::map< int, TH1 * > &mp, int flag, const int &id, float &x, float w)
TFile * hist_file
ROOT hist file.
int getAfebPos(int layer, int wiregroup) const
return AFEB position number
Definition: CSCToAFEB.cc:20
std::map< int, TH2 * > mh_AfebNoisePar
std::map< int, std::vector< std::vector< int > > > m_wire_dac
tuple cout
Definition: gather_cfg.py:144
std::map< int, TH2 * > mh_AfebThrPar
void hf2ForId(std::map< int, TH2 * > &mp, int flag, const int &id, float &x, float &y, float w)
tuple size
Write out results.
void CSCAFEBThrAnalysis::hf1ForId ( std::map< int, TH1 * > &  mp,
int  flag,
const int &  id,
float &  x,
float  w 
)
private

Definition at line 106 of file CSCAFEBThrAnalysis.cc.

References bookForId(), and h.

Referenced by done().

106  {
107  std::map<int, TH1*>::iterator h;
108  h = mp.find(id);
109  if (h == mp.end()) {
110  bookForId(flag, id, "");
111  h = mp.find(id);
112  }
113  h->second->Fill(x, w);
114 }
const double w
Definition: UKUtility.cc:23
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void bookForId(int flag, const int &idint, const std::string &ids)
void CSCAFEBThrAnalysis::hf2ForId ( std::map< int, TH2 * > &  mp,
int  flag,
const int &  id,
float &  x,
float &  y,
float  w 
)
private

Definition at line 116 of file CSCAFEBThrAnalysis.cc.

References bookForId(), and h.

Referenced by analyze(), and done().

116  {
117  std::map<int, TH2*>::iterator h;
118  h = mp.find(id);
119  if (h == mp.end()) {
120  bookForId(flag, id, "");
121  h = mp.find(id);
122  }
123  h->second->Fill(x, y, w);
124 }
const double w
Definition: UKUtility.cc:23
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void bookForId(int flag, const int &idint, const std::string &ids)
void CSCAFEBThrAnalysis::setup ( const std::string &  histoFileName)

open the histogram file

Definition at line 32 of file CSCAFEBThrAnalysis.cc.

References hist_file.

Referenced by CSCAFEBAnalyzer::CSCAFEBAnalyzer().

32  {
34  hist_file = new TFile(histoFileName.c_str(), "RECREATE");
35  hist_file->cd();
36 }
tuple histoFileName
Definition: diJetCalib.py:108
TFile * hist_file
ROOT hist file.

Member Data Documentation

int CSCAFEBThrAnalysis::BegDac
private

Definition at line 36 of file CSCAFEBThrAnalysis.h.

Referenced by analyze(), CSCAFEBThrAnalysis(), and done().

const CSCToAFEB CSCAFEBThrAnalysis::csctoafeb
private

Layer, wire to AFEB, channel conversion.

Definition at line 49 of file CSCAFEBThrAnalysis.h.

Referenced by analyze(), and done().

int CSCAFEBThrAnalysis::EndDac
private

Definition at line 37 of file CSCAFEBThrAnalysis.h.

Referenced by analyze(), CSCAFEBThrAnalysis(), and done().

int CSCAFEBThrAnalysis::EvDac
private

Definition at line 38 of file CSCAFEBThrAnalysis.h.

Referenced by CSCAFEBThrAnalysis().

TFile* CSCAFEBThrAnalysis::hist_file
private

ROOT hist file.

Definition at line 52 of file CSCAFEBThrAnalysis.h.

Referenced by bookForId(), CSCAFEBThrAnalysis(), done(), and setup().

int unsigned CSCAFEBThrAnalysis::indDac
private

Definition at line 35 of file CSCAFEBThrAnalysis.h.

Referenced by analyze(), CSCAFEBThrAnalysis(), and done().

std::map<int, std::vector<std::vector<float> > > CSCAFEBThrAnalysis::m_res_for_db
private

Definition at line 46 of file CSCAFEBThrAnalysis.h.

Referenced by CSCAFEBThrAnalysis(), and done().

std::map<int, std::vector<std::vector<int> > > CSCAFEBThrAnalysis::m_wire_dac
private

Definition at line 45 of file CSCAFEBThrAnalysis.h.

Referenced by analyze(), CSCAFEBThrAnalysis(), and done().

std::map<int, std::vector<int> > CSCAFEBThrAnalysis::m_wire_ev
private

Maps - per event, threshold curve, fit results.

Definition at line 44 of file CSCAFEBThrAnalysis.h.

Referenced by analyze().

std::map<int, TH2*> CSCAFEBThrAnalysis::mh_AfebChi2perNDF
private

Definition at line 62 of file CSCAFEBThrAnalysis.h.

Referenced by bookForId(), and done().

std::map<int, TH2*> CSCAFEBThrAnalysis::mh_AfebDac
private

Definition at line 58 of file CSCAFEBThrAnalysis.h.

Referenced by bookForId(), CSCAFEBThrAnalysis(), and done().

std::map<int, TH2*> CSCAFEBThrAnalysis::mh_AfebNDF
private

Definition at line 61 of file CSCAFEBThrAnalysis.h.

Referenced by bookForId(), and done().

std::map<int, TH2*> CSCAFEBThrAnalysis::mh_AfebNoisePar
private

Definition at line 60 of file CSCAFEBThrAnalysis.h.

Referenced by bookForId(), and done().

std::map<int, TH2*> CSCAFEBThrAnalysis::mh_AfebThrPar
private

Definition at line 59 of file CSCAFEBThrAnalysis.h.

Referenced by bookForId(), and done().

std::map<int, TH1*> CSCAFEBThrAnalysis::mh_ChanEff
private

Histogram maps.

Definition at line 55 of file CSCAFEBThrAnalysis.h.

Referenced by bookForId(), CSCAFEBThrAnalysis(), and done().

std::map<int, TH2*> CSCAFEBThrAnalysis::mh_FirstTime
private

Definition at line 57 of file CSCAFEBThrAnalysis.h.

Referenced by analyze(), bookForId(), and CSCAFEBThrAnalysis().

int CSCAFEBThrAnalysis::nmbev
private

Statistics.

Definition at line 30 of file CSCAFEBThrAnalysis.h.

Referenced by analyze(), CSCAFEBThrAnalysis(), and done().

int CSCAFEBThrAnalysis::nmbev_no_wire
private

Definition at line 31 of file CSCAFEBThrAnalysis.h.

Referenced by analyze(), CSCAFEBThrAnalysis(), and done().

int CSCAFEBThrAnalysis::npulses
private

DAC info.

Definition at line 34 of file CSCAFEBThrAnalysis.h.

Referenced by CSCAFEBThrAnalysis(), and done().

int CSCAFEBThrAnalysis::StepDac
private

Definition at line 39 of file CSCAFEBThrAnalysis.h.

Referenced by analyze(), and CSCAFEBThrAnalysis().

std::vector<float> CSCAFEBThrAnalysis::vecDac
private

Definition at line 40 of file CSCAFEBThrAnalysis.h.

Referenced by analyze(), CSCAFEBThrAnalysis(), and done().

std::vector<int> CSCAFEBThrAnalysis::vecDacOccup
private

Definition at line 41 of file CSCAFEBThrAnalysis.h.

Referenced by analyze(), CSCAFEBThrAnalysis(), and done().