ATLAS Offline Software
foreachHandler.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #include <iostream>
9 
10 
11 using namespace xercesc;
12 
13 foreachHandler::foreachHandler(const std::string& s,
15  : XMLHandler(s, c)
16 {
17 // std::cout<<"Creating handler for foreach"<<std::endl;
18 }
19 
21  xercesc::DOMNode *t)
22 {
23  std::string index=getAttributeAsString(c, t, "index");
24  int ibegin=getAttributeAsInt(c, t, "begin");
25  int iloops=getAttributeAsInt(c, t, "loops");
26  StopLoop(true);
27  c.Evaluator().RegisterVariable(index,ibegin);
28 
29  IAGDDParser& parser = *c.GetParser();
30  DOMNode *fChild=t->getFirstChild();
31  for (int i=ibegin;i<ibegin+iloops;i++)
32  {
33 
34 // std::cout<<"\t\tindex "<<i<<std::endl;
35  c.Evaluator().RegisterVariable(index,i);
36 
37  DOMNode *child;
38  for (child=fChild;child!=0;child=child->getNextSibling())
39  {
40  if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
41  parser.elementLoop(c, child);
42  }
43  }
44 
45 
46  }
47 
48 }
AGDDController.h
python.CaloScaleNoiseConfig.parser
parser
Definition: CaloScaleNoiseConfig.py:75
foreachHandler.h
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
foreachHandler::foreachHandler
foreachHandler(const std::string &, AGDDController &c)
Definition: foreachHandler.cxx:13
index
Definition: index.py:1
XercesParser.h
IAGDDParser
Definition: IAGDDParser.h:15
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
AGDDController
Definition: AGDDController.h:30
lumiFormat.i
int i
Definition: lumiFormat.py:85
foreachHandler::ElementHandle
virtual void ElementHandle(AGDDController &c, xercesc::DOMNode *t) override
Definition: foreachHandler.cxx:20
XMLHandler::getAttributeAsString
std::string getAttributeAsString(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
Definition: XMLHandler.cxx:69
XMLHandler
Definition: XMLHandler.h:15
XMLHandler::getAttributeAsInt
int getAttributeAsInt(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
Definition: XMLHandler.cxx:89
python.compressB64.c
def c
Definition: compressB64.py:93
XMLHandler::StopLoop
void StopLoop(bool)
Definition: XMLHandler.cxx:28