CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DigiBXCorrHistogramMaker< T > Class Template Reference

#include <DigiBXCorrHistogramMaker.h>

Public Member Functions

void beginRun (const unsigned int nrun)
 
void book (const char *dirname, const std::map< int, std::string > &labels)
 
 DigiBXCorrHistogramMaker (edm::ConsumesCollector &&iC, const int ncorbins=1000)
 
 DigiBXCorrHistogramMaker (const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC)
 
void fill (const T &he, const std::map< int, int > &ndigi, const edm::Handle< APVCyclePhaseCollection > &phase)
 
void fillcorr (const T &he1, const T &he2, const std::map< int, int > &ndigi)
 
 ~DigiBXCorrHistogramMaker ()
 

Private Attributes

std::map< unsigned int, int > m_binmax
 
const bool m_dbx3Histo
 
const bool m_dbx3Histo3D
 
std::map< int, TProfile * > m_digicorr
 
std::string m_hitname
 
std::map< int, std::string > m_labels
 
const int m_nbins
 
int m_ncorbins
 
std::map< int, TProfile * > m_ndigivsbx
 
std::map< int, TH2F * > m_ndigivsbx2D
 
std::map< int, TH2F * > m_ndigivsbx2Dzoom
 
std::map< int, TH2F * > m_ndigivsbx2Dzoom2
 
std::map< int, TH2F * > m_ndigivscycle
 
std::map< int, TProfile2D * > m_ndigivscycle2dbx
 
std::map< int, TProfile2D * > m_ndigivscycledbx
 
std::map< int, TProfile2D ** > m_ndigivscycletime
 
std::map< int, TH2F * > m_ndigivscyclezoom
 
std::map< int, TH2F * > m_ndigivscyclezoom2
 
std::map< int, TProfile * > m_ndigivsdbx
 
std::map< int, TH2F * > m_ndigivsdbx2D
 
std::map< int, TH2F * > m_ndigivsdbx2Dzoom
 
std::map< int, TH2F * > m_ndigivsdbx2Dzoom2
 
std::map< int, TProfile2D * > m_ndigivsdbx3zoom
 
std::map< int, TProfile * > m_ndigivsdbxincycle
 
std::map< int, TH2F * > m_ndigivsdbxincycle2D
 
std::map< int, TProfile2D * > m_ndigivsdbxincycle3
 
std::map< int, TH3F * > m_ndigivsdbxincycle33D
 
std::map< int, TProfile * > m_ndigivsdbxzoom
 
std::map< int, TProfile * > m_ndigivsdbxzoom2
 
std::map< int, TProfile * > m_nmeandigivscycle
 
std::map< int, std::string > m_phasepart
 
RunHistogramManager m_rhm
 
const bool m_runHisto
 
std::vector< int > m_scalefact
 

Detailed Description

template<class T>
class DigiBXCorrHistogramMaker< T >

Definition at line 23 of file DigiBXCorrHistogramMaker.h.

Constructor & Destructor Documentation

template<class T >
DigiBXCorrHistogramMaker< T >::DigiBXCorrHistogramMaker ( edm::ConsumesCollector &&  iC,
const int  ncorbins = 1000 
)

Definition at line 91 of file DigiBXCorrHistogramMaker.h.

template<class T >
DigiBXCorrHistogramMaker< T >::DigiBXCorrHistogramMaker ( const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iC 
)

Definition at line 97 of file DigiBXCorrHistogramMaker.h.

References edm::ParameterSet::getUntrackedParameter(), DigiBXCorrHistogramMaker< T >::m_binmax, DigiBXCorrHistogramMaker< T >::m_phasepart, and AlCaHLTBitMon_QueryRunRegistry::string.

97  :
98  m_ncorbins(iConfig.getUntrackedParameter<int>("corrNbins")),
99  m_hitname(iConfig.getUntrackedParameter<std::string>("hitName","digi")),
100  m_dbx3Histo(iConfig.getUntrackedParameter<bool>("dbx3Histo",false)),
101  m_dbx3Histo3D(iConfig.getUntrackedParameter<bool>("dbx3Histo3D",false)),
102  m_runHisto(iConfig.getUntrackedParameter<bool>("runHisto",true)),
103  m_labels(),
104  m_scalefact(iConfig.getUntrackedParameter<std::vector<int> >("scaleFactors",std::vector<int>(1,5))),
105  m_nbins(iConfig.getUntrackedParameter<int>("numberOfBins",200)),
106  m_rhm(iC)
107 {
108 
109  std::vector<edm::ParameterSet>
110  wantedsubds(iConfig.getUntrackedParameter<std::vector<edm::ParameterSet> >("wantedSubDets",std::vector<edm::ParameterSet>()));
111 
112  for(std::vector<edm::ParameterSet>::iterator ps=wantedsubds.begin();ps!=wantedsubds.end();++ps) {
113  m_binmax[ps->getParameter<unsigned int>("detSelection")] = ps->getParameter<int>("binMax");
114  m_phasepart[ps->getParameter<unsigned int>("detSelection")] = ps->getUntrackedParameter<std::string>("phasePartition","None");
115  }
116 
117 }
T getUntrackedParameter(std::string const &, T const &) const
std::map< int, std::string > m_labels
std::map< unsigned int, int > m_binmax
std::map< int, std::string > m_phasepart
template<class T>
DigiBXCorrHistogramMaker< T >::~DigiBXCorrHistogramMaker ( )
inline

Definition at line 29 of file DigiBXCorrHistogramMaker.h.

29 { };

Member Function Documentation

template<class T >
void DigiBXCorrHistogramMaker< T >::beginRun ( const unsigned int  nrun)

Definition at line 319 of file DigiBXCorrHistogramMaker.h.

References RunHistogramManager::beginRun(), mps_fire::i, DigiBXCorrHistogramMaker< T >::m_labels, DigiBXCorrHistogramMaker< T >::m_ndigivscycletime, DigiBXCorrHistogramMaker< T >::m_rhm, and DigiBXCorrHistogramMaker< T >::m_runHisto.

Referenced by MultiplicityTimeCorrelations::beginRun(), and DigiBXCorrHistogramMaker< EventWithHistory >::~DigiBXCorrHistogramMaker().

319  {
320 
321  m_rhm.beginRun(nrun);
322 
323  for(std::map<int,std::string>::const_iterator lab=m_labels.begin();lab!=m_labels.end();lab++) {
324 
325  const int i = lab->first;
326  if(m_runHisto) {
327  if(m_ndigivscycletime[i]) {
328  (*m_ndigivscycletime[i])->GetXaxis()->SetTitle("Event 1 BX mod(70)"); (*m_ndigivscycletime[i])->GetYaxis()->SetTitle("time [Orb#]");
329  (*m_ndigivscycletime[i])->SetCanExtend(TH1::kAllAxes);
330  }
331  }
332  }
333 
334 
335 }
std::map< int, std::string > m_labels
void beginRun(const edm::Run &iRun)
std::map< int, TProfile2D ** > m_ndigivscycletime
template<class T >
void DigiBXCorrHistogramMaker< T >::book ( const char *  dirname,
const std::map< int, std::string > &  labels 
)

Definition at line 120 of file DigiBXCorrHistogramMaker.h.

References mps_fire::i, tablePrinter::labels, DigiBXCorrHistogramMaker< T >::m_binmax, DigiBXCorrHistogramMaker< T >::m_dbx3Histo, DigiBXCorrHistogramMaker< T >::m_dbx3Histo3D, DigiBXCorrHistogramMaker< T >::m_digicorr, DigiBXCorrHistogramMaker< T >::m_hitname, DigiBXCorrHistogramMaker< T >::m_labels, DigiBXCorrHistogramMaker< T >::m_nbins, DigiBXCorrHistogramMaker< T >::m_ncorbins, DigiBXCorrHistogramMaker< T >::m_ndigivsbx, DigiBXCorrHistogramMaker< T >::m_ndigivsbx2D, DigiBXCorrHistogramMaker< T >::m_ndigivsbx2Dzoom, DigiBXCorrHistogramMaker< T >::m_ndigivsbx2Dzoom2, DigiBXCorrHistogramMaker< T >::m_ndigivscycle, DigiBXCorrHistogramMaker< T >::m_ndigivscycle2dbx, DigiBXCorrHistogramMaker< T >::m_ndigivscycledbx, DigiBXCorrHistogramMaker< T >::m_ndigivscycletime, DigiBXCorrHistogramMaker< T >::m_ndigivscyclezoom, DigiBXCorrHistogramMaker< T >::m_ndigivscyclezoom2, DigiBXCorrHistogramMaker< T >::m_ndigivsdbx, DigiBXCorrHistogramMaker< T >::m_ndigivsdbx2D, DigiBXCorrHistogramMaker< T >::m_ndigivsdbx2Dzoom, DigiBXCorrHistogramMaker< T >::m_ndigivsdbx2Dzoom2, DigiBXCorrHistogramMaker< T >::m_ndigivsdbx3zoom, DigiBXCorrHistogramMaker< T >::m_ndigivsdbxincycle, DigiBXCorrHistogramMaker< T >::m_ndigivsdbxincycle2D, DigiBXCorrHistogramMaker< T >::m_ndigivsdbxincycle3, DigiBXCorrHistogramMaker< T >::m_ndigivsdbxincycle33D, DigiBXCorrHistogramMaker< T >::m_ndigivsdbxzoom, DigiBXCorrHistogramMaker< T >::m_ndigivsdbxzoom2, DigiBXCorrHistogramMaker< T >::m_nmeandigivscycle, DigiBXCorrHistogramMaker< T >::m_phasepart, DigiBXCorrHistogramMaker< T >::m_rhm, DigiBXCorrHistogramMaker< T >::m_runHisto, DigiBXCorrHistogramMaker< T >::m_scalefact, TFileDirectory::make(), RunHistogramManager::makeTProfile2D(), TFileService::mkdir(), dataset::name, SiStripTKNumbers::nstrips(), AlCaHLTBitMon_QueryRunRegistry::string, fftjetcommon_cfi::title, and interactiveExample::ui.

Referenced by MultiplicityTimeCorrelations::MultiplicityTimeCorrelations(), and DigiBXCorrHistogramMaker< EventWithHistory >::~DigiBXCorrHistogramMaker().

120  {
121 
122  m_labels = labels;
123 
125  TFileDirectory subev = tfserv->mkdir(dirname);
126 
127  SiStripTKNumbers trnumb;
128 
129  edm::LogInfo("NumberOfBins") << "Number of Bins: " << m_nbins;
130  edm::LogInfo("ScaleFactors") << "x-axis range scale factors: ";
131  for(std::vector<int>::const_iterator sf=m_scalefact.begin();sf!=m_scalefact.end();++sf) {
132  edm::LogVerbatim("ScaleFactors") << *sf ;
133  }
134  edm::LogInfo("BinMaxValue") << "Setting bin max values";
135 
136  for(std::map<int,std::string>::const_iterator lab=m_labels.begin();lab!=m_labels.end();lab++) {
137 
138  const int i = lab->first; const std::string slab = lab->second; const unsigned int ui = i;
139 
140  if(m_binmax.find(ui)==m_binmax.end()) {
141  edm::LogVerbatim("NotConfiguredBinMax") << "Bin max for " << lab->second
142  << " not configured: " << trnumb.nstrips(i) << " used";
143  m_binmax[ui] = trnumb.nstrips(i);
144  }
145 
146  edm::LogVerbatim("BinMaxValue") << "Bin max for " << lab->second << " is " << m_binmax[ui];
147 
148  }
149 
150  edm::LogInfo("PhasePartitions") << "Partitions for APV Cycle Phase";
151 
152  for(std::map<int,std::string>::const_iterator lab=m_labels.begin();lab!=m_labels.end();lab++) {
153 
154  const int i = lab->first; const std::string slab = lab->second; const unsigned int ui = i;
155  edm::LogVerbatim("PhasePartitions") << "Partition for " << lab->second << " is " << ((m_phasepart.find(ui)!=m_phasepart.end()) ? m_phasepart[ui] : "not found") ;
156 
157  }
158 
159  for(std::map<int,std::string>::const_iterator lab=m_labels.begin();lab!=m_labels.end();lab++) {
160 
161  const int i = lab->first; const std::string slab = lab->second; const unsigned int ui = i;
162 
163  char name[200];
164  char title [500];
165 
166  // vs DBX
167 
168  if(!m_scalefact.empty()) {
169  sprintf(title,"%s %s multiplicity vs BX separation",slab.c_str(),m_hitname.c_str());
170  sprintf(name,"n%sdigivsdbx2D",slab.c_str());
171  m_ndigivsdbx2D[i] = subev.make<TH2F>(name,title,1000,-0.5,500000-0.5,m_nbins,0,(1+m_binmax[ui]/(m_scalefact[0]*m_nbins))*m_nbins);
172  sprintf(name,"n%sdigivsdbx2Dzoom2",slab.c_str());
173  m_ndigivsdbx2Dzoom2[i] = subev.make<TH2F>(name,title,1000,-0.5,50000-0.5,m_nbins,0,(1+m_binmax[ui]/(m_scalefact[0]*m_nbins))*m_nbins);
174  sprintf(name,"n%sdigivsdbx2Dzoom",slab.c_str());
175  m_ndigivsdbx2Dzoom[i] = subev.make<TH2F>(name,title,1000,-0.5,999.5,m_nbins,0,(1+m_binmax[ui]/(m_scalefact[0]*m_nbins))*m_nbins);
176 
177  m_ndigivsdbx2D[i]->GetXaxis()->SetTitle("#DeltaBX"); m_ndigivsdbx2D[i]->GetYaxis()->SetTitle("Number of Hits");
178  m_ndigivsdbx2Dzoom2[i]->GetXaxis()->SetTitle("#DeltaBX"); m_ndigivsdbx2Dzoom2[i]->GetYaxis()->SetTitle("Number of Hits");
179  m_ndigivsdbx2Dzoom[i]->GetXaxis()->SetTitle("#DeltaBX"); m_ndigivsdbx2Dzoom[i]->GetYaxis()->SetTitle("Number of Hits");
180  }
181 
182  sprintf(title,"%s %s multiplicity vs BX separation",slab.c_str(),m_hitname.c_str());
183  sprintf(name,"n%sdigivsdbx",slab.c_str());
184  m_ndigivsdbx[i] = subev.make<TProfile>(name,title,1000,-0.5,500000.-0.5);
185  sprintf(name,"n%sdigivsdbxzoom2",slab.c_str());
186  m_ndigivsdbxzoom2[i] = subev.make<TProfile>(name,title,1000,-0.5,50000.-0.5);
187  sprintf(name,"n%sdigivsdbxzoom",slab.c_str());
188  m_ndigivsdbxzoom[i] = subev.make<TProfile>(name,title,1000,-0.5,999.5);
189  m_ndigivsdbx[i]->GetXaxis()->SetTitle("#DeltaBX"); m_ndigivsdbx[i]->GetYaxis()->SetTitle("Number of Hits");
190  m_ndigivsdbxzoom2[i]->GetXaxis()->SetTitle("#DeltaBX"); m_ndigivsdbxzoom2[i]->GetYaxis()->SetTitle("Number of Hits");
191  m_ndigivsdbxzoom[i]->GetXaxis()->SetTitle("#DeltaBX"); m_ndigivsdbxzoom[i]->GetYaxis()->SetTitle("Number of Hits");
192 
193  sprintf(name,"n%sdigivsdbx3zoom",slab.c_str());
194  sprintf(title,"%s %s multiplicity vs Triplets BX separation",slab.c_str(),m_hitname.c_str());
195  m_ndigivsdbx3zoom[i] = subev.make<TProfile2D>(name,title,100,-0.5,999.5,100,-0.5,999.5);
196  m_ndigivsdbx3zoom[i]->GetXaxis()->SetTitle("#DeltaBX(n,n-1)"); m_ndigivsdbx3zoom[i]->GetYaxis()->SetTitle("#DeltaBX(n,n-2)");
197 
198  sprintf(name,"%sdigicorr",slab.c_str());
199  sprintf(title,"%s %s DBX correlation",slab.c_str(),m_hitname.c_str());
200  m_digicorr[i] = subev.make<TProfile>(name,title,m_ncorbins,-0.5,m_ncorbins-0.5);
201  m_digicorr[i]->GetXaxis()->SetTitle("#DeltaBX"); m_digicorr[i]->GetYaxis()->SetTitle("Number of Hits");
202 
203  // vs DBX w.r.t. cycle
204 
205  if(!m_scalefact.empty()) {
206 
207  if(m_phasepart.find(ui)!=m_phasepart.end() && m_phasepart[ui]!="None") {
208  sprintf(name,"n%sdigivsdbxincycle",slab.c_str());
209  sprintf(title,"%s %s multiplicity vs BX separation w.r.t. cycle",slab.c_str(),m_hitname.c_str());
210  m_ndigivsdbxincycle[i] = subev.make<TProfile>(name,title,1000,-0.5,999.5);
211  m_ndigivsdbxincycle[i]->GetXaxis()->SetTitle("#DeltaBX w.r.t. cycle"); m_ndigivsdbxincycle[i]->GetYaxis()->SetTitle("Number of Hits");
212 
213  sprintf(name,"n%sdigivsdbxincycle2D",slab.c_str());
214  sprintf(title,"%s %s multiplicity vs BX separation w.r.t. cycle",slab.c_str(),m_hitname.c_str());
215  m_ndigivsdbxincycle2D[i] = subev.make<TH2F>(name,title,1000,-0.5,999.5,m_nbins,0.,(1+m_binmax[ui]/(m_scalefact[0]*m_nbins))*m_nbins);
216  m_ndigivsdbxincycle2D[i]->GetXaxis()->SetTitle("#DeltaBX w.r.t. cycle"); m_ndigivsdbxincycle2D[i]->GetYaxis()->SetTitle("Number of Hits");
217 
218  if(m_dbx3Histo) {
219  sprintf(name,"n%sdigivsdbxincycle3",slab.c_str());
220  sprintf(title,"%s %s multiplicity vs Triplets BX separation w.r.t. cycle",slab.c_str(),m_hitname.c_str());
221  m_ndigivsdbxincycle3[i] = subev.make<TProfile2D>(name,title,2000,-0.5,1999.5,30,-0.5,2099.5);
222  m_ndigivsdbxincycle3[i]->GetXaxis()->SetTitle("#DeltaBX(n,n-1)");
223  m_ndigivsdbxincycle3[i]->GetYaxis()->SetTitle("#DeltaBX(n,n-2)-#DeltaBX(n,n-1)");
224 
225  if(m_dbx3Histo3D) {
226  sprintf(name,"n%sdigivsdbxincycle33D",slab.c_str());
227  sprintf(title,"%s %s multiplicity vs Triplets BX separation w.r.t. cycle",slab.c_str(),m_hitname.c_str());
228  m_ndigivsdbxincycle33D[i] = subev.make<TH3F>(name,title,2000,-0.5,1999.5,30,-0.5,2099.5,50,0.,(1+m_binmax[ui]/(m_scalefact[0]*50))*50);
229  m_ndigivsdbxincycle33D[i]->GetXaxis()->SetTitle("#DeltaBX(n,n-1)");
230  m_ndigivsdbxincycle33D[i]->GetYaxis()->SetTitle("#DeltaBX(n,n-2)-#DeltaBX(n,n-1)");
231  }
232  }
233  }
234 
235  }
236 
237  // vs absolute BX mod 70
238 
239  if(m_phasepart.find(ui)!=m_phasepart.end() && m_phasepart[ui]!="None") {
240 
241  sprintf(title,"%s Mean %s multiplicity vs BX mod(70)",slab.c_str(),m_hitname.c_str());
242  sprintf(name,"n%smeandigivscycle",slab.c_str());
243  m_nmeandigivscycle[i] =subev.make<TProfile>(name,title,70,-0.5,69.5);
244  m_nmeandigivscycle[i]->GetXaxis()->SetTitle("absolute BX mod(70)");
245  m_nmeandigivscycle[i]->GetYaxis()->SetTitle("Mean number of Hits");
246 
247  sprintf(title,"%s %s multiplicity vs BX mod(70)",slab.c_str(),m_hitname.c_str());
248 
249  if(!m_scalefact.empty()) {
250  sprintf(name,"n%sdigivscycle",slab.c_str());
251  m_ndigivscycle[i] =subev.make<TH2F>(name,title,70,-0.5,69.5,m_nbins,0,(1+m_binmax[ui]/(m_scalefact[0]*m_nbins))*m_nbins);
252  m_ndigivscycle[i]->GetXaxis()->SetTitle("absolute BX mod(70)"); m_ndigivscycle[i]->GetYaxis()->SetTitle("Number of Hits");
253  }
254  if(m_scalefact.size()>=2) {
255  sprintf(name,"n%sdigivscyclezoom",slab.c_str());
256  m_ndigivscyclezoom[i] =subev.make<TH2F>(name,title,70,-0.5,69.5,m_nbins,0,(1+m_binmax[ui]/(m_scalefact[1]*m_nbins))*m_nbins);
257  m_ndigivscyclezoom[i]->GetXaxis()->SetTitle("absolute BX mod(70)");
258  m_ndigivscyclezoom[i]->GetYaxis()->SetTitle("Number of Hits");
259  }
260  if(m_scalefact.size()>=3) {
261  sprintf(name,"n%sdigivscyclezoom2",slab.c_str());
262  m_ndigivscyclezoom2[i] =subev.make<TH2F>(name,title,70,-0.5,69.5,m_nbins,0,(1+m_binmax[ui]/(m_scalefact[2]*m_nbins))*m_nbins);
263  m_ndigivscyclezoom2[i]->GetXaxis()->SetTitle("absolute BX mod(70)");
264  m_ndigivscyclezoom2[i]->GetYaxis()->SetTitle("Number of Hits");
265  }
266 
267  sprintf(name,"n%sdigivscycledbx",slab.c_str());
268  sprintf(title,"%s %s multiplicity vs BX mod(70) and DBX",slab.c_str(),m_hitname.c_str());
269  m_ndigivscycledbx[i] = subev.make<TProfile2D>(name,title,70,-0.5,69.5,1000,-0.5,999.5);
270  m_ndigivscycledbx[i]->GetXaxis()->SetTitle("Event 1 BX mod(70)"); m_ndigivscycledbx[i]->GetYaxis()->SetTitle("#DeltaBX event 2-1");
271 
272  sprintf(name,"n%sdigivscycle2dbx",slab.c_str());
273  sprintf(title,"%s %s multiplicity vs BX mod(70) and DBX",slab.c_str(),m_hitname.c_str());
274  m_ndigivscycle2dbx[i] = subev.make<TProfile2D>(name,title,70,-0.5,69.5,1000,-0.5,999.5);
275  m_ndigivscycle2dbx[i]->GetXaxis()->SetTitle("Event 2 BX mod(70)"); m_ndigivscycle2dbx[i]->GetYaxis()->SetTitle("#DeltaBX event 2-1");
276 
277  }
278 
279  // Multiplicity in cycle vs time is booked also if the phase is not corrected
280 
281  if(m_runHisto) {
282  sprintf(name,"n%sdigivscycletime",slab.c_str());
283  sprintf(title,"%s %s multiplicity vs BX mod(70) and Orbit",slab.c_str(),m_hitname.c_str());
284  m_ndigivscycletime[i] = m_rhm.makeTProfile2D(name,title,70,-0.5,69.5,90,0.,90*262144);
285  // m_ndigivscycletime[i]->GetXaxis()->SetTitle("Event 1 BX mod(70)"); m_ndigivscycletime[i]->GetYaxis()->SetTitle("time [Orb#]");
286  // m_ndigivscycletime[i]->SetCanExtend(TH1::kYaxis);
287  }
288 
289  // vs BX number
290 
291  sprintf(title,"%s %s mean multiplicity vs BX",slab.c_str(),m_hitname.c_str());
292  sprintf(name,"n%sdigivsbx",slab.c_str());
293  m_ndigivsbx[i] =subev.make<TProfile>(name,title,3564,-0.5,3563.5);
294  m_ndigivsbx[i]->GetXaxis()->SetTitle("BX#"); m_ndigivsbx[i]->GetYaxis()->SetTitle("Mean Number of Hits");
295 
296  sprintf(title,"%s %s multiplicity vs BX",slab.c_str(),m_hitname.c_str());
297 
298  if(!m_scalefact.empty()) {
299  sprintf(name,"n%sdigivsbx2D",slab.c_str());
300  m_ndigivsbx2D[i] =subev.make<TH2F>(name,title,3564,-0.5,3563.5,m_nbins,0,(1+m_binmax[ui]/(m_scalefact[0]*m_nbins))*m_nbins);
301  m_ndigivsbx2D[i]->GetXaxis()->SetTitle("BX#"); m_ndigivsbx2D[i]->GetYaxis()->SetTitle("Number of Hits");
302  }
303  if(m_scalefact.size()>=2) {
304  sprintf(name,"n%sdigivsbx2Dzoom",slab.c_str());
305  m_ndigivsbx2Dzoom[i] =subev.make<TH2F>(name,title,3564,-0.5,3563.5,m_nbins,0,(1+m_binmax[ui]/(m_scalefact[1]*m_nbins))*m_nbins);
306  m_ndigivsbx2Dzoom[i]->GetXaxis()->SetTitle("BX#"); m_ndigivsbx2Dzoom[i]->GetYaxis()->SetTitle("Number of Hits");
307  }
308  if(m_scalefact.size()>=3) {
309  sprintf(name,"n%sdigivsbx2Dzoom2",slab.c_str());
310  m_ndigivsbx2Dzoom2[i] =subev.make<TH2F>(name,title,3564,-0.5,3563.5,m_nbins,0,(1+m_binmax[ui]/(m_scalefact[2]*m_nbins))*m_nbins);
311  m_ndigivsbx2Dzoom2[i]->GetXaxis()->SetTitle("BX#"); m_ndigivsbx2Dzoom2[i]->GetYaxis()->SetTitle("Number of Hits");
312  }
313 
314  }
315 
316 }
std::map< int, TH2F * > m_ndigivsbx2D
std::map< int, TH2F * > m_ndigivscycle
std::map< int, TProfile2D * > m_ndigivscycle2dbx
std::map< int, TProfile * > m_ndigivsdbxzoom2
std::map< int, TProfile * > m_ndigivsdbxzoom
std::map< int, TH2F * > m_ndigivscyclezoom2
std::map< int, std::string > m_labels
std::map< int, TH3F * > m_ndigivsdbxincycle33D
std::map< int, TH2F * > m_ndigivsdbx2D
std::map< int, TProfile * > m_ndigivsbx
std::map< int, TH2F * > m_ndigivsbx2Dzoom2
std::map< int, TH2F * > m_ndigivsdbx2Dzoom2
std::map< int, TProfile * > m_digicorr
int nstrips(const DetId &detid) const
std::map< int, TH2F * > m_ndigivsdbx2Dzoom
std::map< int, TProfile * > m_ndigivsdbxincycle
std::map< unsigned int, int > m_binmax
T * make(const Args &...args) const
make new ROOT object
std::map< int, TProfile2D * > m_ndigivsdbx3zoom
std::map< int, TProfile2D * > m_ndigivsdbxincycle3
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69
TProfile2D ** makeTProfile2D(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax, const unsigned int nbiny, const double ymin, const double ymax)
std::map< int, TProfile2D ** > m_ndigivscycletime
std::map< int, TProfile2D * > m_ndigivscycledbx
std::map< int, TProfile * > m_ndigivsdbx
std::map< int, TH2F * > m_ndigivsdbxincycle2D
std::map< int, TProfile * > m_nmeandigivscycle
std::map< int, TH2F * > m_ndigivsbx2Dzoom
std::map< int, std::string > m_phasepart
std::map< int, TH2F * > m_ndigivscyclezoom
template<class T>
void DigiBXCorrHistogramMaker< T >::fill ( const T he,
const std::map< int, int > &  ndigi,
const edm::Handle< APVCyclePhaseCollection > &  phase 
)

Definition at line 338 of file DigiBXCorrHistogramMaker.h.

References edm::HandleBase::failedToGet(), HcalObjRepresent::Fill(), APVCyclePhaseCollection::getPhase(), mps_fire::i, APVCyclePhaseCollection::invalid, edm::HandleBase::isValid(), DigiBXCorrHistogramMaker< T >::m_dbx3Histo, DigiBXCorrHistogramMaker< T >::m_dbx3Histo3D, DigiBXCorrHistogramMaker< T >::m_labels, DigiBXCorrHistogramMaker< T >::m_ndigivsbx, DigiBXCorrHistogramMaker< T >::m_ndigivsbx2D, DigiBXCorrHistogramMaker< T >::m_ndigivsbx2Dzoom, DigiBXCorrHistogramMaker< T >::m_ndigivsbx2Dzoom2, DigiBXCorrHistogramMaker< T >::m_ndigivscycle, DigiBXCorrHistogramMaker< T >::m_ndigivscycle2dbx, DigiBXCorrHistogramMaker< T >::m_ndigivscycledbx, DigiBXCorrHistogramMaker< T >::m_ndigivscycletime, DigiBXCorrHistogramMaker< T >::m_ndigivscyclezoom, DigiBXCorrHistogramMaker< T >::m_ndigivscyclezoom2, DigiBXCorrHistogramMaker< T >::m_ndigivsdbx, DigiBXCorrHistogramMaker< T >::m_ndigivsdbx2D, DigiBXCorrHistogramMaker< T >::m_ndigivsdbx2Dzoom, DigiBXCorrHistogramMaker< T >::m_ndigivsdbx2Dzoom2, DigiBXCorrHistogramMaker< T >::m_ndigivsdbx3zoom, DigiBXCorrHistogramMaker< T >::m_ndigivsdbxincycle, DigiBXCorrHistogramMaker< T >::m_ndigivsdbxincycle2D, DigiBXCorrHistogramMaker< T >::m_ndigivsdbxincycle3, DigiBXCorrHistogramMaker< T >::m_ndigivsdbxincycle33D, DigiBXCorrHistogramMaker< T >::m_ndigivsdbxzoom, DigiBXCorrHistogramMaker< T >::m_ndigivsdbxzoom2, DigiBXCorrHistogramMaker< T >::m_nmeandigivscycle, DigiBXCorrHistogramMaker< T >::m_phasepart, DigiBXCorrHistogramMaker< T >::m_runHisto, APVCyclePhaseCollection::multiphase, APVCyclePhaseCollection::nopartition, nullptr, and interactiveExample::ui.

Referenced by MultiplicityTimeCorrelations::analyze(), and DigiBXCorrHistogramMaker< EventWithHistory >::~DigiBXCorrHistogramMaker().

338  {
339 
340  for(std::map<int,int>::const_iterator digi=ndigi.begin();digi!=ndigi.end();digi++) {
341 
342  if(m_labels.find(digi->first) != m_labels.end()) {
343  const int i=digi->first; const unsigned int ui = i;
344 
345  int thephase = APVCyclePhaseCollection::invalid;
346  if(m_phasepart.find(ui)!=m_phasepart.end() && m_phasepart[ui]!="None") {
347  if(!phase.failedToGet() && phase.isValid()) {
348  thephase = phase->getPhase(m_phasepart[ui]);
349  }
350  }
351 
352  long long tbx = he.absoluteBX();
356 
357  tbx -= thephase;
358 
359  if(m_nmeandigivscycle.find(i)!=m_nmeandigivscycle.end()) m_nmeandigivscycle[i]->Fill(tbx%70,digi->second);
360 
361  if(m_ndigivscycle.find(i)!=m_ndigivscycle.end()) m_ndigivscycle[i]->Fill(tbx%70,digi->second);
362  if(m_ndigivscyclezoom.find(i)!=m_ndigivscyclezoom.end()) m_ndigivscyclezoom[i]->Fill(tbx%70,digi->second);
363  if(m_ndigivscyclezoom2.find(i)!=m_ndigivscyclezoom2.end()) m_ndigivscyclezoom2[i]->Fill(tbx%70,digi->second);
364 
365  }
366 
367  if(m_runHisto) {
368  if(m_ndigivscycletime.find(i)!=m_ndigivscycletime.end()) {
369  if(m_ndigivscycletime[i]!=nullptr && (*m_ndigivscycletime[i])!=nullptr ) (*m_ndigivscycletime[i])->Fill(tbx%70,(int)he._orbit,digi->second);
370  }
371  }
372 
373  m_ndigivsbx[i]->Fill(he.bx()%3564,digi->second);
374  if(m_ndigivsbx2D.find(i)!=m_ndigivsbx2D.end()) m_ndigivsbx2D[i]->Fill(he.bx()%3564,digi->second);
375  if(m_ndigivsbx2Dzoom.find(i)!=m_ndigivsbx2Dzoom.end()) m_ndigivsbx2Dzoom[i]->Fill(he.bx()%3564,digi->second);
376  if(m_ndigivsbx2Dzoom2.find(i)!=m_ndigivsbx2Dzoom2.end()) m_ndigivsbx2Dzoom2[i]->Fill(he.bx()%3564,digi->second);
377 
378 
379  if(he.depth()>0) {
380 
381  long long dbx = he.deltaBX();
382 
383  m_ndigivsdbx[i]->Fill(dbx,digi->second);
384  m_ndigivsdbxzoom[i]->Fill(dbx,digi->second);
385  m_ndigivsdbxzoom2[i]->Fill(dbx,digi->second);
386 
387  if(m_ndigivsdbx2D.find(i)!=m_ndigivsdbx2D.end()) m_ndigivsdbx2D[i]->Fill(dbx,digi->second);
388  if(m_ndigivsdbx2Dzoom.find(i)!=m_ndigivsdbx2Dzoom.end()) m_ndigivsdbx2Dzoom[i]->Fill(dbx,digi->second);
389  if(m_ndigivsdbx2Dzoom2.find(i)!=m_ndigivsdbx2Dzoom2.end()) m_ndigivsdbx2Dzoom2[i]->Fill(dbx,digi->second);
390 
391  long long prevtbx = he.absoluteBX(1);
395 
396  long long dbxincycle = he.deltaBXinCycle(thephase);
397  if(m_ndigivsdbxincycle2D.find(i)!=m_ndigivsdbxincycle2D.end()) m_ndigivsdbxincycle2D[i]->Fill(dbxincycle,digi->second);
398  if(m_ndigivsdbxincycle.find(i)!=m_ndigivsdbxincycle.end()) m_ndigivsdbxincycle[i]->Fill(dbxincycle,digi->second);
399 
400  prevtbx -= thephase;
401  if(m_ndigivscycledbx.find(i)!=m_ndigivscycledbx.end()) m_ndigivscycledbx[i]->Fill(prevtbx%70,dbx,digi->second);
402  if(m_ndigivscycle2dbx.find(i)!=m_ndigivscycle2dbx.end()) m_ndigivscycle2dbx[i]->Fill(tbx%70,dbx,digi->second);
403 
404  }
405 
406  if(he.depth()>1) {
407 
408  long long dbx2 = he.deltaBX(2);
409  m_ndigivsdbx3zoom[i]->Fill(dbx2,dbx,digi->second);
410 
414  long long dbxincycle = he.deltaBXinCycle(thephase);
415  long long dbxincycle2 = he.deltaBXinCycle(2,thephase);
416  if(m_dbx3Histo) {
417  if(m_ndigivsdbxincycle3.find(i)!=m_ndigivsdbxincycle3.end()) m_ndigivsdbxincycle3[i]->Fill(dbxincycle,dbxincycle2-dbxincycle,digi->second);
418  if(m_dbx3Histo3D) {
419  if(m_ndigivsdbxincycle33D.find(i)!=m_ndigivsdbxincycle33D.end()) m_ndigivsdbxincycle33D[i]->Fill(dbxincycle,dbxincycle2-dbxincycle,digi->second);
420  }
421  }
422  }
423  }
424  }
425 
426  }
427  else {
428  edm::LogWarning("MissingKey") << " Key " << digi->first << " is missing ";
429  }
430 
431  }
432 }
std::map< int, TH2F * > m_ndigivsbx2D
std::map< int, TH2F * > m_ndigivscycle
std::map< int, TProfile2D * > m_ndigivscycle2dbx
std::map< int, TProfile * > m_ndigivsdbxzoom2
std::map< int, TProfile * > m_ndigivsdbxzoom
std::map< int, TH2F * > m_ndigivscyclezoom2
std::map< int, std::string > m_labels
std::map< int, TH3F * > m_ndigivsdbxincycle33D
std::map< int, TH2F * > m_ndigivsdbx2D
#define nullptr
std::map< int, TProfile * > m_ndigivsbx
std::map< int, TH2F * > m_ndigivsbx2Dzoom2
std::map< int, TH2F * > m_ndigivsdbx2Dzoom2
const int getPhase(const std::string partition) const
std::map< int, TH2F * > m_ndigivsdbx2Dzoom
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::map< int, TProfile * > m_ndigivsdbxincycle
bool isValid() const
Definition: HandleBase.h:74
std::map< int, TProfile2D * > m_ndigivsdbx3zoom
bool failedToGet() const
Definition: HandleBase.h:78
std::map< int, TProfile2D * > m_ndigivsdbxincycle3
std::map< int, TProfile2D ** > m_ndigivscycletime
std::map< int, TProfile2D * > m_ndigivscycledbx
std::map< int, TProfile * > m_ndigivsdbx
std::map< int, TH2F * > m_ndigivsdbxincycle2D
std::map< int, TProfile * > m_nmeandigivscycle
std::map< int, TH2F * > m_ndigivsbx2Dzoom
std::map< int, std::string > m_phasepart
std::map< int, TH2F * > m_ndigivscyclezoom
template<class T>
void DigiBXCorrHistogramMaker< T >::fillcorr ( const T he1,
const T he2,
const std::map< int, int > &  ndigi 
)

Definition at line 435 of file DigiBXCorrHistogramMaker.h.

References mps_fire::i, DigiBXCorrHistogramMaker< T >::m_digicorr, and DigiBXCorrHistogramMaker< T >::m_labels.

Referenced by DigiBXCorrHistogramMaker< EventWithHistory >::~DigiBXCorrHistogramMaker().

435  {
436 
437  for(std::map<int,int>::const_iterator digi=ndigi.begin();digi!=ndigi.end();digi++) {
438 
439  if(m_labels.find(digi->first) != m_labels.end()) {
440  const int i=digi->first;
441 
442  long long dbx = he2.deltaBX(he1);
443  m_digicorr[i]->Fill(dbx,digi->second);
444 
445  }
446  else {
447  edm::LogWarning("MissingKey") << " Key " << digi->first << " is missing ";
448  }
449 
450  }
451 }
std::map< int, std::string > m_labels
std::map< int, TProfile * > m_digicorr

Member Data Documentation

template<class T>
std::map<unsigned int, int> DigiBXCorrHistogramMaker< T >::m_binmax
private
template<class T>
const bool DigiBXCorrHistogramMaker< T >::m_dbx3Histo
private
template<class T>
const bool DigiBXCorrHistogramMaker< T >::m_dbx3Histo3D
private
template<class T>
std::map<int,TProfile*> DigiBXCorrHistogramMaker< T >::m_digicorr
private
template<class T>
std::string DigiBXCorrHistogramMaker< T >::m_hitname
private

Definition at line 39 of file DigiBXCorrHistogramMaker.h.

Referenced by DigiBXCorrHistogramMaker< T >::book().

template<class T>
std::map<int,std::string> DigiBXCorrHistogramMaker< T >::m_labels
private
template<class T>
const int DigiBXCorrHistogramMaker< T >::m_nbins
private

Definition at line 48 of file DigiBXCorrHistogramMaker.h.

Referenced by DigiBXCorrHistogramMaker< T >::book().

template<class T>
int DigiBXCorrHistogramMaker< T >::m_ncorbins
private

Definition at line 38 of file DigiBXCorrHistogramMaker.h.

Referenced by DigiBXCorrHistogramMaker< T >::book().

template<class T>
std::map<int,TProfile*> DigiBXCorrHistogramMaker< T >::m_ndigivsbx
private
template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivsbx2D
private
template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivsbx2Dzoom
private
template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivsbx2Dzoom2
private
template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivscycle
private
template<class T>
std::map<int,TProfile2D*> DigiBXCorrHistogramMaker< T >::m_ndigivscycle2dbx
private
template<class T>
std::map<int,TProfile2D*> DigiBXCorrHistogramMaker< T >::m_ndigivscycledbx
private
template<class T>
std::map<int,TProfile2D**> DigiBXCorrHistogramMaker< T >::m_ndigivscycletime
private
template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivscyclezoom
private
template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivscyclezoom2
private
template<class T>
std::map<int,TProfile*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbx
private
template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbx2D
private
template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbx2Dzoom
private
template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbx2Dzoom2
private
template<class T>
std::map<int,TProfile2D*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbx3zoom
private
template<class T>
std::map<int,TProfile*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbxincycle
private
template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbxincycle2D
private
template<class T>
std::map<int,TProfile2D*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbxincycle3
private
template<class T>
std::map<int,TH3F*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbxincycle33D
private
template<class T>
std::map<int,TProfile*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbxzoom
private
template<class T>
std::map<int,TProfile*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbxzoom2
private
template<class T>
std::map<int,TProfile*> DigiBXCorrHistogramMaker< T >::m_nmeandigivscycle
private
template<class T>
std::map<int,std::string> DigiBXCorrHistogramMaker< T >::m_phasepart
private
template<class T>
RunHistogramManager DigiBXCorrHistogramMaker< T >::m_rhm
private
template<class T>
const bool DigiBXCorrHistogramMaker< T >::m_runHisto
private
template<class T>
std::vector<int> DigiBXCorrHistogramMaker< T >::m_scalefact
private

Definition at line 47 of file DigiBXCorrHistogramMaker.h.

Referenced by DigiBXCorrHistogramMaker< T >::book().