Belle II Software  release-05-01-25
DQMHistAnalysisARICHMonObjModule Class Reference

Example module of how to use MonitoringObject in DQMHistAnalysis module. More...

#include <DQMHistAnalysisARICHMonObj.h>

Inheritance diagram for DQMHistAnalysisARICHMonObjModule:
Collaboration diagram for DQMHistAnalysisARICHMonObjModule:

Public Types

enum  EParamType {
  c_ParamINT,
  c_ParamFLOAT,
  c_ParamTEXT
}
 The enumeration types for the module parameters. More...
 
typedef std::map< std::string, EParamTypeParamTypeList
 The type of list of module parameter types.
 
typedef std::map< std::string, int > IntValueList
 The type of list of integer module parameter.
 
typedef std::map< std::string, float > FloatValueList
 The type of list of float module parameter.
 
typedef std::map< std::string, std::string > TextList
 The type of list of string module parameter.
 
typedef std::map< std::string, TH1 * > HistList
 The type of list of histograms.
 
typedef std::map< std::string, MonitoringObject * > MonObjList
 The type of list of MonitoringObjects.
 
enum  EModulePropFlags {
  c_Input = 1,
  c_Output = 2,
  c_ParallelProcessingCertified = 4,
  c_HistogramManager = 8,
  c_InternalSerializer = 16,
  c_TerminateInAllProcesses = 32,
  c_DontCollectStatistics = 64
}
 Each module can be tagged with property flags, which indicate certain features of the module. More...
 
typedef ModuleCondition::EAfterConditionPath EAfterConditionPath
 Forward the EAfterConditionPath definition from the ModuleCondition.
 

Public Member Functions

 DQMHistAnalysisARICHMonObjModule ()
 Constructor.
 
virtual ~DQMHistAnalysisARICHMonObjModule ()
 Destructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Begin run function.
 
virtual void event () override
 Event processor.
 
virtual void endRun () override
 End-of-run action. More...
 
virtual void terminate () override
 Termination action.
 
virtual std::vector< std::string > getFileNames (__attribute__((unused)) bool outputFiles)
 Return a list of output filenames for this modules. More...
 
const std::string & getName () const
 Returns the name of the module. More...
 
const std::string & getType () const
 Returns the type of the module (i.e. More...
 
const std::string & getPackage () const
 Returns the package this module is in.
 
const std::string & getDescription () const
 Returns the description of the module.
 
void setName (const std::string &name)
 Set the name of the module. More...
 
void setPropertyFlags (unsigned int propertyFlags)
 Sets the flags for the module properties. More...
 
LogConfiggetLogConfig ()
 Returns the log system configuration.
 
void setLogConfig (const LogConfig &logConfig)
 Set the log system configuration.
 
void setLogLevel (int logLevel)
 Configure the log level.
 
void setDebugLevel (int debugLevel)
 Configure the debug messaging level.
 
void setAbortLevel (int abortLevel)
 Configure the abort log level.
 
void setLogInfo (int logLevel, unsigned int logInfo)
 Configure the printed log information for the given level. More...
 
void if_value (const std::string &expression, const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 Add a condition to the module. More...
 
void if_false (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to add a condition to the module. More...
 
void if_true (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to set the condition of the module. More...
 
bool hasCondition () const
 Returns true if at least one condition was set for the module.
 
const ModuleConditiongetCondition () const
 Return a pointer to the first condition (or nullptr, if none was set)
 
const std::vector< ModuleCondition > & getAllConditions () const
 Return all set conditions for this module.
 
bool evalCondition () const
 If at least one condition was set, it is evaluated and true returned if at least one condition returns true. More...
 
std::shared_ptr< PathgetConditionPath () const
 Returns the path of the last true condition (if there is at least one, else reaturn a null pointer). More...
 
Module::EAfterConditionPath getAfterConditionPath () const
 What to do after the conditional path is finished. More...
 
std::vector< std::shared_ptr< Path > > getAllConditionPaths () const
 Return all condition paths currently set (no matter if the condition is true or not).
 
bool hasProperties (unsigned int propertyFlags) const
 Returns true if all specified property flags are available in this module. More...
 
bool hasUnsetForcedParams () const
 Returns true and prints error message if the module has unset parameters which the user has to set in the steering file.
 
const ModuleParamListgetParamList () const
 Return module param list.
 
template<typename T >
ModuleParam< T > & getParam (const std::string &name) const
 Returns a reference to a parameter. More...
 
bool hasReturnValue () const
 Return true if this module has a valid return value set.
 
int getReturnValue () const
 Return the return value set by this module. More...
 
std::shared_ptr< PathElementclone () const override
 Create an independent copy of this module. More...
 
std::shared_ptr< boost::python::list > getParamInfoListPython () const
 Returns a python list of all parameters. More...
 

Static Public Member Functions

static const HistListgetHistList ()
 Get the list of the histograms. More...
 
static const MonObjListgetMonObjList ()
 Get the list of MonitoringObjects. More...
 
static TH1 * findHist (const std::string &histname)
 Find histogram. More...
 
static TH1 * findHist (const std::string &dirname, const std::string &histname)
 Find histogram. More...
 
static TH1 * findHist (const TDirectory *histdir, const TString &histname)
 Find histogram. More...
 
static MonitoringObjectfindMonitoringObject (const std::string &objName)
 Find MonitoringObject. More...
 
static void setIntValue (const std::string &parname, int vint)
 Set the integer value of the parameter. More...
 
static void setFloatValue (const std::string &parname, float vfloat)
 Set the float value of the parameter. More...
 
static void setText (const std::string &parname, const std::string &text)
 Set the string value of the parameter. More...
 
static void addHist (const std::string &dirname, const std::string &histname, TH1 *h)
 Add histogram. More...
 
static MonitoringObjectgetMonitoringObject (const std::string &histname)
 Get MonitoringObject with given name (new object is created if non-existing) More...
 
static void resetHist ()
 Clear and reset the list of histograms.
 
static HistListgetHists ()
 Get the list of histograms. More...
 
static ParamTypeListgetParNames ()
 Get the list of the names and types of the parameters. More...
 
static IntValueListgetIntValues ()
 Get the list of integer parameters. More...
 
static FloatValueListgetFloatValues ()
 Get the list of float parameters. More...
 
static TextListgetTexts ()
 Get the list of string parameters. More...
 
static void exposePythonAPI ()
 Exposes methods of the Module class to Python.
 

Protected Member Functions

virtual void def_initialize ()
 Wrappers to make the methods without "def_" prefix callable from Python. More...
 
virtual void def_beginRun ()
 Wrapper method for the virtual function beginRun() that has the implementation to be used in a call from Python.
 
virtual void def_event ()
 Wrapper method for the virtual function event() that has the implementation to be used in a call from Python.
 
virtual void def_endRun ()
 This method can receive that the current run ends as a call from the Python side. More...
 
virtual void def_terminate ()
 Wrapper method for the virtual function terminate() that has the implementation to be used in a call from Python.
 
void setDescription (const std::string &description)
 Sets the description of the module. More...
 
void setType (const std::string &type)
 Set the module type. More...
 
template<typename T >
void addParam (const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
 Adds a new parameter to the module. More...
 
template<typename T >
void addParam (const std::string &name, T &paramVariable, const std::string &description)
 Adds a new enforced parameter to the module. More...
 
void setReturnValue (int value)
 Sets the return value for this module as integer. More...
 
void setReturnValue (bool value)
 Sets the return value for this module as bool. More...
 
void setParamList (const ModuleParamList &params)
 Replace existing parameter list.
 

Protected Attributes

TCanvas * m_c_main = NULL
 Canvas with main run summary histograms.
 
TCanvas * m_c_mask = NULL
 Canvas with histograms related to channel masking.
 
TCanvas * m_c_mirror = NULL
 Canvas with histograms related to mirrors.
 
TCanvas * m_c_tracks = NULL
 Canvas with histograms related to tracks.
 
TH2Poly * pp1 = NULL
 
TH2Poly * pp2 = NULL
 
TH2Poly * pflash = NULL
 
Belle2::ARICHChannelHistm_apdHist = NULL
 ARICH TObject to draw hit map for each APD.
 
Belle2::ARICHChannelHistm_chHist = NULL
 ARICH TObject to draw flash map for each channel.
 
Belle2::ARICHChannelHistm_hapdHist = NULL
 ARICH TObject to draw flash map for each hapd.
 
MonitoringObjectm_monObj = NULL
 MonitoringObject to be produced by this module.
 

Private Member Functions

std::list< ModulePtrgetModules () const override
 no submodules, return empty list
 
std::string getPathString () const override
 return the module name.
 
void setParamPython (const std::string &name, const boost::python::object &pyObj)
 Implements a method for setting boost::python objects. More...
 
void setParamPythonDict (const boost::python::dict &dictionary)
 Implements a method for reading the parameter values from a boost::python dictionary. More...
 

Private Attributes

std::string m_name
 The name of the module, saved as a string (user-modifiable)
 
std::string m_type
 The type of the module, saved as a string.
 
std::string m_package
 Package this module is found in (may be empty).
 
std::string m_description
 The description of the module.
 
unsigned int m_propertyFlags
 The properties of the module as bitwise or (with |) of EModulePropFlags.
 
LogConfig m_logConfig
 The log system configuration of the module.
 
ModuleParamList m_moduleParamList
 List storing and managing all parameter of the module.
 
bool m_hasReturnValue
 True, if the return value is set.
 
int m_returnValue
 The return value.
 
std::vector< ModuleConditionm_conditions
 Module condition, only non-null if set.
 

Static Private Attributes

static ParamTypeList g_parname
 The list of module parameter types.
 
static IntValueList g_vint
 The list of integer module parameter.
 
static FloatValueList g_vfloat
 The list of float module parameter.
 
static TextList g_text
 The list of string module parameter.
 
static HistList g_hist
 The list of histograms.
 
static MonObjList g_monObj
 The list of MonitoringObjects.
 

Detailed Description

Example module of how to use MonitoringObject in DQMHistAnalysis module.

Definition at line 37 of file DQMHistAnalysisARICHMonObj.h.

Member Enumeration Documentation

◆ EModulePropFlags

enum EModulePropFlags
inherited

Each module can be tagged with property flags, which indicate certain features of the module.

Enumerator
c_Input 

This module is an input module (reads data).

c_Output 

This module is an output module (writes data).

c_ParallelProcessingCertified 

This module can be run in parallel processing mode safely (All I/O must be done through the data store, in particular, the module must not write any files.)

c_HistogramManager 

This module is used to manage histograms accumulated by other modules.

c_InternalSerializer 

This module is an internal serializer/deserializer for parallel processing.

c_TerminateInAllProcesses 

When using parallel processing, call this module's terminate() function in all processes().

This will also ensure that there is exactly one process (single-core if no parallel modules found) or at least one input, one main and one output process.

c_DontCollectStatistics 

No statistics is collected for this module.

Definition at line 79 of file Module.h.

◆ EParamType

enum EParamType
inherited

The enumeration types for the module parameters.

Enumerator
c_ParamINT 

The integer type for module parameter.

c_ParamFLOAT 

The float type for module parameter.

c_ParamTEXT 

The string type for module parameter.

Definition at line 33 of file DQMHistAnalysis.h.

Member Function Documentation

◆ addHist()

void addHist ( const std::string &  dirname,
const std::string &  histname,
TH1 *  h 
)
staticinherited

Add histogram.

Parameters
dirnameThe name of the directory.
histnameThe name of the histogram.
hThe TH1 pointer for the histogram.

Definition at line 46 of file DQMHistAnalysis.cc.

◆ clone()

std::shared_ptr< PathElement > clone ( ) const
overridevirtualinherited

Create an independent copy of this module.

Note that parameters are shared, so changing them on a cloned module will also affect the original module.

Implements PathElement.

Definition at line 181 of file Module.cc.

◆ def_endRun()

virtual void def_endRun ( )
inlineprotectedvirtualinherited

This method can receive that the current run ends as a call from the Python side.

For regular C++-Modules that forwards the call to the regular endRun() method.

Reimplemented in PyModule.

Definition at line 441 of file Module.h.

◆ def_initialize()

virtual void def_initialize ( )
inlineprotectedvirtualinherited

Wrappers to make the methods without "def_" prefix callable from Python.

Overridden in PyModule. Wrapper method for the virtual function initialize() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 422 of file Module.h.

◆ endRun()

void endRun ( )
overridevirtual

End-of-run action.

<The number of hits in each chip

Reimplemented from Module.

Definition at line 85 of file DQMHistAnalysisARICHMonObj.cc.

86 {
87 
88 
89  TGaxis::SetMaxDigits(3);
90  gStyle->SetPalette(1);
91  gStyle->SetOptStat(0);
92 
93 
94  // get existing histograms produced by DQM modules
95  TH1* chHit = findHist("ARICH/chHit");
96  TH1* bits = findHist("ARICH/bits");
97  TH1* hitsPerTrack = findHist("ARICH/hitsPerTrack");
98  TH1* theta = findHist("ARICH/theta");
99  TH2* tracks2D = (TH2*)findHist("ARICH/tracks2D");
100  TH1* hitsPerEvent = findHist("ARICH/hitsPerEvent");
101  TH2* hapdHitPerEvent = (TH2*)findHist("ARICH/hapdHitPerEvent");
102  TH2* thetaPhi = (TH2*)findHist("ARICH/thetaPhi");
103  TH3* mirrorThetaPhi = (TH3*)findHist("ARICH/mirrorThetaPhi");
104  TH1* chDigit = findHist("ARICH/chDigit");
105  TH1* hapdDigit = findHist("ARICH/hapdDigit");
106 
107  if (chHit == NULL) {m_monObj->setVariable("comment", "No arich histograms in file"); B2INFO("Histogram named chHit is not found."); return;}
108  if (chHit->GetEntries() == 0) {m_monObj->setVariable("comment", "No arich hits in histograms"); B2INFO("No arich hits in histograms."); return;}
109 
110  // set the content of main canvas
111  m_c_main->Clear(); // clear existing content
112  m_c_main->Divide(3, 2);
113  m_c_mirror->Clear(); // clear existing content
114  m_c_mirror->Divide(3, 3);
115  m_c_mask->Clear(); // clear existing content
116  m_c_mask->Divide(2, 4);
117  m_c_tracks->Clear(); // clear existing content
118 
119  //Draw 2D hit map of channels and APDs
120  pp1 = new TH2Poly();
121  pp1->SetTitle("Number of hits / APD / event");
122  pp1->SetOption("colz");
123 
124  pp2 = new TH2Poly();
125  pp2->SetMaximum(0.1 / 36.);
126  pp2->SetMinimum(0.0001 / 36.);
127  pp2->SetTitle("Number of hits / channel / event");
128 
129  pflash = new TH2Poly();
130  pflash->SetTitle("Number of flash (>40 hits) / event");
131 
132  int nevt = 0;
133  if (hitsPerEvent) nevt = hitsPerEvent->GetEntries();
134  m_apdHist->fillFromTH1(chHit);
135  // m_chHist->fillFromTH1(chHit);
136  if (nevt) {
137  m_apdHist->Scale(1. / float(nevt));
138  // m_chHist->Scale(1. / float(nevt));
139  }
140 
141  pp1->SetMaximum(0.1);
142  m_apdHist->setPoly(pp1);
143  pp1->SetMinimum(0.0001);
144  pp2->SetMaximum(0.1 / 36.);
145  // m_chHist->setPoly(pp2);
146  // pp2->SetMinimum(0.0001 / 36.);
147 
148 
149  //TCanvas main
150  m_c_main->cd(1);
151  pp1->Draw("colz");
152  pp1->GetXaxis()->SetTickLength(0);
153  pp1->GetYaxis()->SetTickLength(0);
154  gPad->SetLogz();
155  //m_c_main->Update();
156 
157  TH1F* flash = (TH1F*)hapdHitPerEvent->ProjectionX("flash", 40, 144);
158  m_hapdHist->fillFromTH1(flash);
159  if (nevt) m_hapdHist->Scale(1. / float(nevt));
160 
161  m_hapdHist->setPoly(pflash);
162  // draw sector lines
163  double rlin = 40;
164  double rlout = 113;
165  for (int isec = 0; isec < 6; isec++) {
166  double x1 = rlin * cos(M_PI / 3.*isec);
167  double x2 = rlout * cos(M_PI / 3.*isec);
168  double y1 = rlin * sin(M_PI / 3.*isec);
169  double y2 = rlout * sin(M_PI / 3.*isec);
170  TLine* line = new TLine(x1, y1, x2, y2);
171  line->Draw();
172  x1 = rlin * cos(M_PI / 3.*isec + M_PI / 6.);
173  y1 = rlin * sin(M_PI / 3.*isec + M_PI / 6.);
174  TText* lab = new TText(x1, y1, TString::Format("S-%d", isec + 1));
175  lab->SetTextAlign(22);
176  lab->SetTextSize(0.03);
177  lab->Draw();
178  }
179 
180 
181  //TCanvas tracks
182  m_c_tracks->cd();
183  tracks2D->RebinX(4);
184  tracks2D->RebinY(4);
185  double trkevt = nevt > 0 ? tracks2D->GetEntries() / nevt : 0;
186  int ntracks = tracks2D->GetEntries();
187  m_monObj->setVariable("ntracks", ntracks ? ntracks : 0);
188  m_monObj->setVariable("ntracksPerEvent", trkevt ? trkevt : 0);
189  string comment = "";
190  if (ntracks == 0) comment = "No arich tracks in file.";
191  if (theta->GetEntries() == 0) comment.append(" No cherenkov photons available");
192  m_monObj->setVariable("comment", comment);
193 
194  tracks2D->SetTitle(TString::Format("Track distribution (avg %f trk/evt)", trkevt));
195  tracks2D->Draw("colz");
196 
197 
198  if (ntracks) {
199  double sigbkg[8] = {0};
200  //fit two gauses
201  if (theta->GetEntries() == 0) return;
202  TF1* f1 = new TF1("thcFit", "gaus(0)+gaus(3)", 0.2, 0.4);
203  f1->SetParameters(0.8 * theta->GetMaximum(), 0.323, 0.016, 0.2 * theta->GetMaximum() , 0.323, 0.13);
204  f1->FixParameter(5, 0.13);
205  f1->SetParName(0, "C");
206  f1->SetParName(1, "mean");
207  f1->SetParName(2, "sigma");
208  f1->SetParName(3, "p0");
209  f1->SetParName(4, "p1");
210  int status = theta->Fit(f1, "R");
211  double xmin = f1->GetParameter(1) - 2.*f1->GetParameter(2);
212  double xmax = f1->GetParameter(1) + 2.*f1->GetParameter(2);
213  double tmp = f1->GetParameter(3);
214  f1->SetParameter(3, 0);
215  double nphot = f1->Integral(xmin, xmax);
216  f1->SetParameter(3, tmp);
217  tmp = f1->GetParameter(0);
218  f1->SetParameter(0, 0);
219  double nbkg = f1->Integral(xmin, xmax);
220  f1->SetParameter(0, tmp);
221  if (status) return;
222 
223  sigbkg[0] = nphot;
224  sigbkg[1] = f1->GetParameter(0) > 0 ? nphot * f1->GetParError(0) / f1->GetParameter(0) : 0.;
225  sigbkg[2] = nbkg;
226  sigbkg[3] = f1->GetParameter(3) > 0 ? nbkg * f1->GetParError(3) / f1->GetParameter(3) : 0.;
227  sigbkg[4] = f1->GetParameter(1);
228  sigbkg[5] = f1->GetParError(1);
229  sigbkg[6] = f1->GetParameter(2);
230  sigbkg[7] = f1->GetParError(2);
231  if (theta->GetBinWidth(1) == 0) return;
232  m_monObj->setVariable("nsig", sigbkg[0] / float(ntracks) / theta->GetBinWidth(1),
233  sigbkg[1] / float(ntracks) / theta->GetBinWidth(1));
234  m_monObj->setVariable("nbgr", sigbkg[2] / float(ntracks) / theta->GetBinWidth(1),
235  sigbkg[3] / float(ntracks) / theta->GetBinWidth(1));
236  m_monObj->setVariable("theta", sigbkg[4], sigbkg[5]);
237  m_monObj->setVariable("sigma", sigbkg[6], sigbkg[7]);
238  std::cout << sigbkg[0] << " " << sigbkg[1] / float(ntracks) / theta->GetBinWidth(1) << std::endl;
239  }
240 
241 
242  //TCanvas mirror
243  TH1F* thetaCl = (TH1F*)theta->Clone("thetaCl");
244  thetaCl->SetLineColor(16);
245  thetaCl->SetLineWidth(2);
246  thetaCl->SetTitle("");
247  TLegend* leg[9];
248  gStyle->SetOptTitle(0);
249 
250  if (mirrorThetaPhi) {
251  for (int i = 1; i < 18 + 1; i++) {
252  TH1F* hmir = (TH1F*)mirrorThetaPhi->ProjectionZ(TString::Format("hmir_%d", i), i, i, 1, 10000);
253  hmir->SetTitle(TString::Format("mirror %d", i));
254  if (hmir->GetEntries() > 0) hmir->Scale(theta->GetEntries() / hmir->GetEntries());
255  hmir->Rebin(2);
256  hmir->SetLineWidth(2);
257  int iplot = (i - 1) / 2;
258  if ((i - 1) % 2 == 0) { m_c_mirror->cd(iplot + 1); thetaCl->Draw("hist"); hmir->SetLineColor(1); hmir->Draw("sames hist"); leg[iplot] = new TLegend(0.1, 0.75, 0.4, 0.9); leg[iplot]->AddEntry(hmir, TString::Format("mirror %d", i));}
259  else {
260  hmir->SetLineColor(2); hmir->Draw("sames hist");
261  leg[iplot]->AddEntry(hmir, TString::Format("mirror %d", i));
262  leg[iplot]->Draw();
263  }
264  }
265  }
266 
267  gStyle->SetOptTitle(1);
268 
269 
270  //chDigit
271  if (chDigit != NULL && nevt) chDigit->Scale(1. / nevt);
272  if (nevt) {
273  chHit->Scale(1. / nevt);
274  flash->Scale(1. / nevt);
275  }
276  int nhot = 0, ndead = 0;
277  TH2F* hotCh = new TH2F("arich_hot", "Number of channels in APD with >0.5% occ.", 42, 0.5, 42.5, 40, 0.5, 40.5);
278  TH2F* hotCh1 = new TH2F("arich_hot1", "Number of channels in APD with >0.5% occ. after mask", 42, 0.5, 42.5, 40, 0.5, 40.5);
279  TH2F* deadCh = new TH2F("arich_dead", "Number of channels in APD with no hits", 42, 0.5, 42.5, 40, 0.5, 40.5);
280  TH2F* falseCh = new TH2F("arich_false", "Number of wrongly masked channels in APD (masked but not dead/hot)", 42, 0.5, 42.5, 40,
281  0.5,
282  40.5);
283  TH1F* occ = new TH1F("arich_occ", "nhits / nevt for all channels; nhits/nevt;# of chn", 500, 0, 0.005);
284 
285  int ndeadHapd = 0;
286  if (chDigit != NULL) {
287  double hotlim = 0.005;
288  for (int i = 0; i < chDigit->GetNbinsX(); i++) {
289  int hapd = i / 144 + 1; int chip = (i % 144) / 36 + 1;
290  int binx = (hapd - 1) % 42 + 1; int biny = ((hapd - 1) / 42) * 4 + chip;
291  if (chDigit->GetBinContent(i + 1) > hotlim) { hotCh->Fill(binx, biny); nhot++;}
292  if (chDigit->GetBinContent(i + 1) == 0) {
293  deadCh->Fill(binx, biny);
294  if (hapdDigit->GetBinContent(hapd) != 0) ndead++;
295  }
296  if (chHit->GetBinContent(i + 1) == 0 && chDigit->GetBinContent(i + 1) < hotlim
297  && chDigit->GetBinContent(i + 1) > 0.00002) falseCh->Fill(binx, biny);
298  if (chHit->GetBinContent(i + 1) > hotlim) hotCh1->Fill(binx, biny);
299  occ->Fill(chHit->GetBinContent(i + 1));
300  }
301 
302  for (int i = 0; i < hapdDigit->GetNbinsX(); i++) {
303  if (hapdDigit->GetBinContent(i + 1) == 0) ndeadHapd++;
304  }
305  }
306  m_monObj->setVariable("nhot", nhot);
307  m_monObj->setVariable("ndead", ndead);
308  m_monObj->setVariable("ndeadHapd", ndeadHapd);
309 
310 
311  // TCanvas mask
312  m_c_mask->cd(1);
313  occ->Draw();
314  m_c_mask->cd(2);
315  pflash->Draw("colz");
316  m_c_mask->cd(3);
317  // pp2->Draw("colz");
318  //pp2->GetXaxis()->SetTickLength(0);
319  //pp2->GetYaxis()->SetTickLength(0);
320  gPad->SetLogz();
321  m_c_mask->cd(4);
322  hotCh->Draw("colz text");
323  m_c_mask->cd(5);
324  deadCh->Draw("colz text");
325  m_c_mask->cd(6);
326  hotCh1->Draw("colz text");
327  m_c_mask->cd(7);
328  falseCh->Draw("colz text");
329 
330  for (int i = 0; i < 42; i++) {
331  double x1 = i + 0.5 + 1;
332  TLine* line = new TLine(x1, 0.5, x1, 40.5);
333  m_c_mask->cd(5); line->Draw();
334  m_c_mask->cd(6); line->Draw();
335  m_c_mask->cd(7); line->Draw();
336  m_c_mask->cd(4); line->Draw();
337  }
338  for (int i = 0; i < 40; i++) {
339  double y1 = i + 0.5 + 1;
340  TLine* line = new TLine(0.5, y1, 42.5, y1);
341  if ((i + 1) % 4 == 0) line->SetLineColor(2);
342  else line->SetLineColor(15);
343  m_c_mask->cd(5); line->Draw();
344  m_c_mask->cd(6); line->Draw();
345  m_c_mask->cd(7); line->Draw();
346  m_c_mask->cd(4); line->Draw();
347  }
348 
349  bits->SetLineWidth(2);
350  bits->SetLineColor(2);
351  bits->SetOption("hist");
352  bits->SetFillStyle(3010);
353  bits->SetFillColor(3);
354 
355  hitsPerTrack->SetLineWidth(2);
356  hitsPerTrack->SetLineColor(2);
357  hitsPerTrack->SetOption("hist");
358  hitsPerEvent->SetLineWidth(2);
359  hitsPerEvent->SetLineColor(2);
360  hitsPerEvent->SetOption("hist");
361 
362  //Tcanvas main
363  m_c_main->cd(2); bits->Draw(); bits->GetYaxis()->SetTitleOffset(0.5);
364  m_c_main->cd(3); theta->Draw();
365  m_c_main->cd(4); hitsPerTrack->Draw();
366  m_c_main->cd(5); hitsPerEvent->Draw();
367  m_c_main->cd(6);
368  if (thetaPhi != NULL) thetaPhi->Draw("colz");
369 
370  // set values of monitoring variables (if variable already exists this will change its value, otherwise it will insert new variable)
371  // with error (also asymmetric error can be used as m_monObj->setVariable(name, value, upError, downError))
372  m_monObj->setVariable("hitsPerEvent", hitsPerEvent ? hitsPerEvent->GetMean() : 0, hitsPerEvent ? hitsPerEvent->GetMeanError() : -1);
373  // without error
374  m_monObj->setVariable("bitsMean", bits ? bits->GetMean() : 0);
375  B2DEBUG(20, "DQMHistAnalysisARICHMonObj : endRun called");
376 }

◆ evalCondition()

bool evalCondition ( ) const
inherited

If at least one condition was set, it is evaluated and true returned if at least one condition returns true.

If no condition or result value was defined, the method returns false. Otherwise, the condition is evaluated and true returned, if at least one condition returns true. To speed up the evaluation, the condition strings were already parsed in the method if_value().

Returns
True if at least one condition and return value exists and at least one condition expression was evaluated to true.

Definition at line 98 of file Module.cc.

◆ findHist() [1/3]

TH1 * findHist ( const std::string &  dirname,
const std::string &  histname 
)
staticinherited

Find histogram.

Parameters
dirnameThe name of the directory.
histnameThe name of the histogram.
Returns
The found histogram, or nullptr if not found.

Definition at line 130 of file DQMHistAnalysis.cc.

◆ findHist() [2/3]

TH1 * findHist ( const std::string &  histname)
staticinherited

Find histogram.

Parameters
histnameThe name of the histogram.
Returns
The found histogram, or nullptr if not found.

Definition at line 83 of file DQMHistAnalysis.cc.

◆ findHist() [3/3]

TH1 * findHist ( const TDirectory *  histdir,
const TString &  histname 
)
staticinherited

Find histogram.

Parameters
histdirThe TDirectory of the directory.
histnameThe name of the histogram.
Returns
The found histogram, or nullptr if not found.

Definition at line 139 of file DQMHistAnalysis.cc.

◆ findMonitoringObject()

MonitoringObject * findMonitoringObject ( const std::string &  objName)
staticinherited

Find MonitoringObject.

Parameters
objNameThe name of the MonitoringObject.
Returns
The found MonitoringObject, or nullptr if not found.

Definition at line 153 of file DQMHistAnalysis.cc.

◆ getAfterConditionPath()

Module::EAfterConditionPath getAfterConditionPath ( ) const
inherited

What to do after the conditional path is finished.

(defaults to c_End if no condition is set)

Definition at line 135 of file Module.cc.

◆ getConditionPath()

std::shared_ptr< Path > getConditionPath ( ) const
inherited

Returns the path of the last true condition (if there is at least one, else reaturn a null pointer).


Definition at line 115 of file Module.cc.

◆ getFileNames()

virtual std::vector<std::string> getFileNames ( __attribute__((unused)) bool  outputFiles)
inlinevirtualinherited

Return a list of output filenames for this modules.

This will be called when basf2 is run with "--dry-run" if the module has set either the c_Input or c_Output properties.

If the parameter outputFiles is false (for modules with c_Input) the list of input filenames should be returned (if any). If outputFiles is true (for modules with c_Output) the list of output files should be returned (if any).

If a module has sat both properties this member is called twice, once for each property.

The module should return the actual list of requested input or produced output filenames (including handling of input/output overrides) so that the grid system can handle input/output files correctly.

This function should return the same value when called multiple times. This is especially important when taking the input/output overrides from Environment as they get consumed when obtained so the finalized list of output files should be stored for subsequent calls.

Definition at line 136 of file Module.h.

◆ getFloatValues()

static FloatValueList& getFloatValues ( )
inlinestaticinherited

Get the list of float parameters.

Returns
The list of float parameters.

Definition at line 199 of file DQMHistAnalysis.h.

◆ getHistList()

const DQMHistAnalysisModule::HistList & getHistList ( )
staticinherited

Get the list of the histograms.

Returns
The list of the histograms.

Definition at line 72 of file DQMHistAnalysis.cc.

◆ getHists()

static HistList& getHists ( )
inlinestaticinherited

Get the list of histograms.

Returns
The list of histograms.

Definition at line 184 of file DQMHistAnalysis.h.

◆ getIntValues()

static IntValueList& getIntValues ( )
inlinestaticinherited

Get the list of integer parameters.

Returns
The list of integer parameters.

Definition at line 194 of file DQMHistAnalysis.h.

◆ getMonitoringObject()

MonitoringObject * getMonitoringObject ( const std::string &  histname)
staticinherited

Get MonitoringObject with given name (new object is created if non-existing)

Parameters
objNamename of MonitoringObject to get

Definition at line 55 of file DQMHistAnalysis.cc.

◆ getMonObjList()

const DQMHistAnalysisModule::MonObjList & getMonObjList ( )
staticinherited

Get the list of MonitoringObjects.

Returns
The list of the MonitoringObjects.

Definition at line 77 of file DQMHistAnalysis.cc.

◆ getName()

const std::string& getName ( ) const
inlineinherited

Returns the name of the module.

This can be changed via e.g. set_name() in the steering file to give more useful names if there is more than one module of the same type.

For identifying the type of a module, using getType() (or type() in Python) is recommended.

Definition at line 189 of file Module.h.

◆ getParamInfoListPython()

std::shared_ptr< boost::python::list > getParamInfoListPython ( ) const
inherited

Returns a python list of all parameters.

Each item in the list consists of the name of the parameter, a string describing its type, a python list of all default values and the description of the parameter.

Returns
A python list containing the parameters of this parameter list.

Definition at line 281 of file Module.cc.

◆ getParNames()

static ParamTypeList& getParNames ( )
inlinestaticinherited

Get the list of the names and types of the parameters.

Returns
The list of the names and types of the parameters.

Definition at line 189 of file DQMHistAnalysis.h.

◆ getReturnValue()

int getReturnValue ( ) const
inlineinherited

Return the return value set by this module.

This value is only meaningful if hasReturnValue() is true

Definition at line 383 of file Module.h.

◆ getTexts()

static TextList& getTexts ( )
inlinestaticinherited

Get the list of string parameters.

Returns
The list of string parameters.

Definition at line 204 of file DQMHistAnalysis.h.

◆ getType()

const std::string & getType ( ) const
inherited

Returns the type of the module (i.e.

class name minus 'Module')

Definition at line 43 of file Module.cc.

◆ hasProperties()

bool hasProperties ( unsigned int  propertyFlags) const
inherited

Returns true if all specified property flags are available in this module.

Parameters
propertyFlagsOred EModulePropFlags which should be compared with the module flags.

Definition at line 162 of file Module.cc.

◆ if_false()

void if_false ( const std::shared_ptr< Path > &  path,
EAfterConditionPath  afterConditionPath = EAfterConditionPath::c_End 
)
inherited

A simplified version to add a condition to the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

It is equivalent to the if_value() method, using the expression "<1". This method is meant to be used together with the setReturnValue(bool value) method.

Parameters
pathShared pointer to the Path which will be executed if the return value is false.
afterConditionPathWhat to do after executing 'path'.

Definition at line 87 of file Module.cc.

◆ if_true()

void if_true ( const std::shared_ptr< Path > &  path,
EAfterConditionPath  afterConditionPath = EAfterConditionPath::c_End 
)
inherited

A simplified version to set the condition of the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

It is equivalent to the if_value() method, using the expression ">=1". This method is meant to be used together with the setReturnValue(bool value) method.

Parameters
pathShared pointer to the Path which will be executed if the return value is true.
afterConditionPathWhat to do after executing 'path'.

Definition at line 92 of file Module.cc.

◆ if_value()

void if_value ( const std::string &  expression,
const std::shared_ptr< Path > &  path,
EAfterConditionPath  afterConditionPath = EAfterConditionPath::c_End 
)
inherited

Add a condition to the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

See https://confluence.desy.de/display/BI/Software+ModCondTut or ModuleCondition for a description of the syntax.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

Parameters
expressionThe expression of the condition.
pathShared pointer to the Path which will be executed if the condition is evaluated to true.
afterConditionPathWhat to do after executing 'path'.

Definition at line 81 of file Module.cc.

◆ initialize()

void initialize ( )
overridevirtual

Initialize the Module.

<ARICH TObject to draw hit map for each APD

<ARICH TObject to draw flash map for each HAPD

Reimplemented from Module.

Definition at line 51 of file DQMHistAnalysisARICHMonObj.cc.

◆ setDescription()

void setDescription ( const std::string &  description)
protectedinherited

Sets the description of the module.

Parameters
descriptionA description of the module.

Definition at line 216 of file Module.cc.

◆ setFloatValue()

void setFloatValue ( const std::string &  parname,
float  vfloat 
)
staticinherited

Set the float value of the parameter.

Parameters
parnameThe name of the parameter.
vfloatThe value to be set.

Definition at line 181 of file DQMHistAnalysis.cc.

◆ setIntValue()

void setIntValue ( const std::string &  parname,
int  vint 
)
staticinherited

Set the integer value of the parameter.

Parameters
parnameThe name of the parameter.
vintThe value to be set.

Definition at line 169 of file DQMHistAnalysis.cc.

◆ setLogInfo()

void setLogInfo ( int  logLevel,
unsigned int  logInfo 
)
inherited

Configure the printed log information for the given level.

Parameters
logLevelThe log level (one of LogConfig::ELogLevel)
logInfoWhat kind of info should be printed? ORed combination of LogConfig::ELogInfo flags.

Definition at line 75 of file Module.cc.

◆ setName()

void setName ( const std::string &  name)
inlineinherited

Set the name of the module.

Note
The module name is set when using the REG_MODULE macro, but the module can be renamed before calling process() using the set_name() function in your steering file.
Parameters
nameThe name of the module

Definition at line 216 of file Module.h.

◆ setParamPython()

void setParamPython ( const std::string &  name,
const boost::python::object &  pyObj 
)
privateinherited

Implements a method for setting boost::python objects.

The method supports the following types: list, dict, int, double, string, bool The conversion of the python object to the C++ type and the final storage of the parameter value is done in the ModuleParam class.

Parameters
nameThe unique name of the parameter.
pyObjThe object which should be converted and stored as the parameter value.

Definition at line 236 of file Module.cc.

◆ setParamPythonDict()

void setParamPythonDict ( const boost::python::dict &  dictionary)
privateinherited

Implements a method for reading the parameter values from a boost::python dictionary.

The key of the dictionary has to be the name of the parameter and the value has to be of one of the supported parameter types.

Parameters
dictionaryThe python dictionary from which the parameter values are read.

Definition at line 251 of file Module.cc.

◆ setPropertyFlags()

void setPropertyFlags ( unsigned int  propertyFlags)
inherited

Sets the flags for the module properties.

Parameters
propertyFlagsbitwise OR of EModulePropFlags

Definition at line 210 of file Module.cc.

◆ setReturnValue() [1/2]

void setReturnValue ( bool  value)
protectedinherited

Sets the return value for this module as bool.

The bool value is saved as an integer with the convention 1 meaning true and 0 meaning false. The value can be used in the steering file to divide the analysis chain into several paths.

Parameters
valueThe value of the return value.

Definition at line 229 of file Module.cc.

◆ setReturnValue() [2/2]

void setReturnValue ( int  value)
protectedinherited

Sets the return value for this module as integer.

The value can be used in the steering file to divide the analysis chain into several paths.

Parameters
valueThe value of the return value.

Definition at line 222 of file Module.cc.

◆ setText()

void setText ( const std::string &  parname,
const std::string &  text 
)
staticinherited

Set the string value of the parameter.

Parameters
parnameThe name of the parameter.
textThe value to be set.

Definition at line 193 of file DQMHistAnalysis.cc.

◆ setType()

void setType ( const std::string &  type)
protectedinherited

Set the module type.

Only for use by internal modules (which don't use the normal REG_MODULE mechanism).

Definition at line 50 of file Module.cc.


The documentation for this class was generated from the following files:
Belle2::DQMHistAnalysisARICHMonObjModule::m_c_mask
TCanvas * m_c_mask
Canvas with histograms related to channel masking.
Definition: DQMHistAnalysisARICHMonObj.h:79
Belle2::hapd
TH1F * hapd[6]
histogram of hits for each hapd
Definition: arichBtestModule.cc:86
Belle2::DQMHistAnalysisARICHMonObjModule::m_apdHist
Belle2::ARICHChannelHist * m_apdHist
ARICH TObject to draw hit map for each APD.
Definition: DQMHistAnalysisARICHMonObj.h:86
Belle2::DQMHistAnalysisModule::findHist
static TH1 * findHist(const std::string &histname)
Find histogram.
Definition: DQMHistAnalysis.cc:83
Belle2::DQMHistAnalysisARICHMonObjModule::m_c_main
TCanvas * m_c_main
Canvas with main run summary histograms.
Definition: DQMHistAnalysisARICHMonObj.h:78
Belle2::ARICHChannelHist::setPoly
void setPoly(TH2Poly *poly)
Fill pure TH2Poly from ARICHChannelHist, makes bins and fills content.
Definition: ARICHChannelHist.cc:238
Belle2::DQMHistAnalysisARICHMonObjModule::m_hapdHist
Belle2::ARICHChannelHist * m_hapdHist
ARICH TObject to draw flash map for each hapd.
Definition: DQMHistAnalysisARICHMonObj.h:88
Belle2::MonitoringObject::setVariable
void setVariable(const std::string &var, float val, float upErr=-1., float dwErr=-1)
set value to float variable (new variable is made if not yet existing)
Definition: MonitoringObject.h:134
Belle2::DQMHistAnalysisARICHMonObjModule::m_c_tracks
TCanvas * m_c_tracks
Canvas with histograms related to tracks.
Definition: DQMHistAnalysisARICHMonObj.h:81
Belle2::ARICHChannelHist::fillFromTH1
void fillFromTH1(TH1 *hist)
Fill the channelHist from the histogram Type 0 channelHist has to be filled with 420*144bin TH1 (each...
Definition: ARICHChannelHist.cc:205
Belle2::DQMHistAnalysisARICHMonObjModule::m_monObj
MonitoringObject * m_monObj
MonitoringObject to be produced by this module.
Definition: DQMHistAnalysisARICHMonObj.h:89
Belle2::DQMHistAnalysisARICHMonObjModule::m_c_mirror
TCanvas * m_c_mirror
Canvas with histograms related to mirrors.
Definition: DQMHistAnalysisARICHMonObj.h:80