CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 (const int ncorbins=1000)
 
 DigiBXCorrHistogramMaker (const edm::ParameterSet &iConfig)
 
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 22 of file DigiBXCorrHistogramMaker.h.

Constructor & Destructor Documentation

template<class T >
DigiBXCorrHistogramMaker< T >::DigiBXCorrHistogramMaker ( const int  ncorbins = 1000)

Definition at line 90 of file DigiBXCorrHistogramMaker.h.

template<class T >
DigiBXCorrHistogramMaker< T >::DigiBXCorrHistogramMaker ( const edm::ParameterSet iConfig)

Definition at line 96 of file DigiBXCorrHistogramMaker.h.

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

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

28 { };

Member Function Documentation

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

Definition at line 318 of file DigiBXCorrHistogramMaker.h.

References i.

Referenced by MultiplicityTimeCorrelations::beginRun().

318  {
319 
320  m_rhm.beginRun(nrun);
321 
322  for(std::map<int,std::string>::const_iterator lab=m_labels.begin();lab!=m_labels.end();lab++) {
323 
324  const int i = lab->first;
325  if(m_runHisto) {
326  if(m_ndigivscycletime[i]) {
327  (*m_ndigivscycletime[i])->GetXaxis()->SetTitle("Event 1 BX mod(70)"); (*m_ndigivscycletime[i])->GetYaxis()->SetTitle("time [Orb#]");
328  (*m_ndigivscycletime[i])->SetBit(TH1::kCanRebin);
329  }
330  }
331  }
332 
333 
334 }
int i
Definition: DBlmapReader.cc:9
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 119 of file DigiBXCorrHistogramMaker.h.

References i, reco_calib_source_client_cfg::labels, TFileDirectory::make(), TFileDirectory::mkdir(), mergeVDriftHistosByStation::name, SiStripTKNumbers::nstrips(), indexGen::title, and interactiveExample::ui.

Referenced by MultiplicityTimeCorrelations::MultiplicityTimeCorrelations().

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

References edm::HandleBase::failedToGet(), HcalObjRepresent::Fill(), i, APVCyclePhaseCollection::invalid, edm::HandleBase::isValid(), APVCyclePhaseCollection::multiphase, APVCyclePhaseCollection::nopartition, and interactiveExample::ui.

Referenced by MultiplicityTimeCorrelations::analyze().

337  {
338 
339  for(std::map<int,int>::const_iterator digi=ndigi.begin();digi!=ndigi.end();digi++) {
340 
341  if(m_labels.find(digi->first) != m_labels.end()) {
342  const int i=digi->first; const unsigned int ui = i;
343 
344  int thephase = APVCyclePhaseCollection::invalid;
345  if(m_phasepart.find(ui)!=m_phasepart.end() && m_phasepart[ui]!="None") {
346  if(!phase.failedToGet() && phase.isValid()) {
347  thephase = phase->getPhase(m_phasepart[ui]);
348  }
349  }
350 
351  long long tbx = he.absoluteBX();
354  thephase!=APVCyclePhaseCollection::invalid) tbx -= thephase;
355 
356  if(m_nmeandigivscycle.find(i)!=m_nmeandigivscycle.end()) m_nmeandigivscycle[i]->Fill(tbx%70,digi->second);
357 
358  if(m_ndigivscycle.find(i)!=m_ndigivscycle.end()) m_ndigivscycle[i]->Fill(tbx%70,digi->second);
359  if(m_ndigivscyclezoom.find(i)!=m_ndigivscyclezoom.end()) m_ndigivscyclezoom[i]->Fill(tbx%70,digi->second);
360  if(m_ndigivscyclezoom2.find(i)!=m_ndigivscyclezoom2.end()) m_ndigivscyclezoom2[i]->Fill(tbx%70,digi->second);
361 
362  if(m_runHisto) {
363  if(m_ndigivscycletime.find(i)!=m_ndigivscycletime.end()) {
364  if(m_ndigivscycletime[i]!=0 && (*m_ndigivscycletime[i])!=0 ) (*m_ndigivscycletime[i])->Fill(tbx%70,(int)he._orbit,digi->second);
365  }
366  }
367 
368  m_ndigivsbx[i]->Fill(he.bx(),digi->second);
369  if(m_ndigivsbx2D.find(i)!=m_ndigivsbx2D.end()) m_ndigivsbx2D[i]->Fill(he.bx(),digi->second);
370  if(m_ndigivsbx2Dzoom.find(i)!=m_ndigivsbx2Dzoom.end()) m_ndigivsbx2Dzoom[i]->Fill(he.bx(),digi->second);
371  if(m_ndigivsbx2Dzoom2.find(i)!=m_ndigivsbx2Dzoom2.end()) m_ndigivsbx2Dzoom2[i]->Fill(he.bx(),digi->second);
372 
373 
374  if(he.depth()>0) {
375 
376  long long dbx = he.deltaBX();
377 
378  m_ndigivsdbx[i]->Fill(dbx,digi->second);
379  m_ndigivsdbxzoom[i]->Fill(dbx,digi->second);
380  m_ndigivsdbxzoom2[i]->Fill(dbx,digi->second);
381 
382  if(m_ndigivsdbx2D.find(i)!=m_ndigivsdbx2D.end()) m_ndigivsdbx2D[i]->Fill(dbx,digi->second);
383  if(m_ndigivsdbx2Dzoom.find(i)!=m_ndigivsdbx2Dzoom.end()) m_ndigivsdbx2Dzoom[i]->Fill(dbx,digi->second);
384  if(m_ndigivsdbx2Dzoom2.find(i)!=m_ndigivsdbx2Dzoom2.end()) m_ndigivsdbx2Dzoom2[i]->Fill(dbx,digi->second);
385 
389  long long dbxincycle = he.deltaBXinCycle(thephase);
390  if(m_ndigivsdbxincycle2D.find(i)!=m_ndigivsdbxincycle2D.end()) m_ndigivsdbxincycle2D[i]->Fill(dbxincycle,digi->second);
391  if(m_ndigivsdbxincycle.find(i)!=m_ndigivsdbxincycle.end()) m_ndigivsdbxincycle[i]->Fill(dbxincycle,digi->second);
392  }
393 
394  long long prevtbx = he.absoluteBX(1);
397  thephase!=APVCyclePhaseCollection::invalid) prevtbx -= thephase;
398 
399 
400  if(m_ndigivscycledbx.find(i)!=m_ndigivscycledbx.end()) m_ndigivscycledbx[i]->Fill(prevtbx%70,dbx,digi->second);
401  if(m_ndigivscycle2dbx.find(i)!=m_ndigivscycle2dbx.end()) m_ndigivscycle2dbx[i]->Fill(tbx%70,dbx,digi->second);
402 
403  if(he.depth()>1) {
404 
405  long long dbx2 = he.deltaBX(2);
406  m_ndigivsdbx3zoom[i]->Fill(dbx2,dbx,digi->second);
407 
411  long long dbxincycle = he.deltaBXinCycle(thephase);
412  long long dbxincycle2 = he.deltaBXinCycle(2,thephase);
413  if(m_dbx3Histo) {
414  if(m_ndigivsdbxincycle3.find(i)!=m_ndigivsdbxincycle3.end()) m_ndigivsdbxincycle3[i]->Fill(dbxincycle,dbxincycle2-dbxincycle,digi->second);
415  if(m_dbx3Histo3D) {
416  if(m_ndigivsdbxincycle33D.find(i)!=m_ndigivsdbxincycle33D.end()) m_ndigivsdbxincycle33D[i]->Fill(dbxincycle,dbxincycle2-dbxincycle,digi->second);
417  }
418  }
419  }
420  }
421  }
422 
423  }
424  else {
425  edm::LogWarning("MissingKey") << " Key " << digi->first << " is missing ";
426  }
427 
428  }
429 }
std::map< int, TH2F * > m_ndigivsbx2D
int i
Definition: DBlmapReader.cc:9
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, 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:76
std::map< int, TProfile2D * > m_ndigivsdbx3zoom
bool failedToGet() const
Definition: HandleBase.h:80
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 432 of file DigiBXCorrHistogramMaker.h.

References i.

432  {
433 
434  for(std::map<int,int>::const_iterator digi=ndigi.begin();digi!=ndigi.end();digi++) {
435 
436  if(m_labels.find(digi->first) != m_labels.end()) {
437  const int i=digi->first;
438 
439  long long dbx = he2.deltaBX(he1);
440  m_digicorr[i]->Fill(dbx,digi->second);
441 
442  }
443  else {
444  edm::LogWarning("MissingKey") << " Key " << digi->first << " is missing ";
445  }
446 
447  }
448 }
int i
Definition: DBlmapReader.cc:9
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

Definition at line 39 of file DigiBXCorrHistogramMaker.h.

template<class T>
const bool DigiBXCorrHistogramMaker< T >::m_dbx3Histo3D
private

Definition at line 40 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TProfile*> DigiBXCorrHistogramMaker< T >::m_digicorr
private

Definition at line 84 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::string DigiBXCorrHistogramMaker< T >::m_hitname
private

Definition at line 38 of file DigiBXCorrHistogramMaker.h.

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

Definition at line 43 of file DigiBXCorrHistogramMaker.h.

template<class T>
const int DigiBXCorrHistogramMaker< T >::m_nbins
private

Definition at line 47 of file DigiBXCorrHistogramMaker.h.

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

Definition at line 37 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TProfile*> DigiBXCorrHistogramMaker< T >::m_ndigivsbx
private

Definition at line 64 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivsbx2D
private

Definition at line 65 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivsbx2Dzoom
private

Definition at line 66 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivsbx2Dzoom2
private

Definition at line 67 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivscycle
private

Definition at line 60 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TProfile2D*> DigiBXCorrHistogramMaker< T >::m_ndigivscycle2dbx
private

Definition at line 72 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TProfile2D*> DigiBXCorrHistogramMaker< T >::m_ndigivscycledbx
private

Definition at line 70 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TProfile2D**> DigiBXCorrHistogramMaker< T >::m_ndigivscycletime
private

Definition at line 74 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivscyclezoom
private

Definition at line 61 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivscyclezoom2
private

Definition at line 62 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TProfile*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbx
private

Definition at line 51 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbx2D
private

Definition at line 76 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbx2Dzoom
private

Definition at line 78 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbx2Dzoom2
private

Definition at line 77 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TProfile2D*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbx3zoom
private

Definition at line 80 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TProfile*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbxincycle
private

Definition at line 55 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TH2F*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbxincycle2D
private

Definition at line 56 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TProfile2D*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbxincycle3
private

Definition at line 81 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TH3F*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbxincycle33D
private

Definition at line 82 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TProfile*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbxzoom
private

Definition at line 53 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TProfile*> DigiBXCorrHistogramMaker< T >::m_ndigivsdbxzoom2
private

Definition at line 52 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,TProfile*> DigiBXCorrHistogramMaker< T >::m_nmeandigivscycle
private

Definition at line 58 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::map<int,std::string> DigiBXCorrHistogramMaker< T >::m_phasepart
private
template<class T>
RunHistogramManager DigiBXCorrHistogramMaker< T >::m_rhm
private

Definition at line 49 of file DigiBXCorrHistogramMaker.h.

template<class T>
const bool DigiBXCorrHistogramMaker< T >::m_runHisto
private

Definition at line 41 of file DigiBXCorrHistogramMaker.h.

template<class T>
std::vector<int> DigiBXCorrHistogramMaker< T >::m_scalefact
private

Definition at line 46 of file DigiBXCorrHistogramMaker.h.