ATLAS Offline Software
Public Member Functions | Private Types | Private Attributes | Friends | List of all members
L1CaloRampRunPlan Class Reference

Transient class defining ramps runplan objects defined by the online framework and retrieved from COOL. More...

#include <L1CaloRampRunPlan.h>

Inheritance diagram for L1CaloRampRunPlan:
Collaboration diagram for L1CaloRampRunPlan:

Public Member Functions

 L1CaloRampRunPlan ()
 
 L1CaloRampRunPlan (int nEventsPerStep, const std::vector< double > &vEnergySteps)
 
virtual ~L1CaloRampRunPlan ()
 
virtual DataObject * makePersistent () const
 
virtual void makeTransient (const AthenaAttributeList *&attributeList)
 
int eventsPerStep () const
 
std::vector< double > energySteps () const
 
void nextEvent ()
 
double currentEnergy ()
 
std::string status ()
 
bool endOfRun ()
 
virtual void makeTransient (const std::map< std::string, const CondAttrListCollection * > &condAttrListCollectionMap)
 
virtual void makeTransient (const std::map< std::string, const AthenaAttributeList * > &condAttributeList)
 
virtual void makeTransient (const std::map< std::string, const CondAttrListCollection * > &condAttrListCollectionMap)
 
virtual void makeTransient (const std::map< std::string, const AthenaAttributeList * > &condAttributeList)
 
std::string specificationName (int specId) const
 
std::string specificationType (int specId) const
 
void addSpecification (int specId, const std::string &specName, const std::string &specType)
 
coral::AttributeListSpecification * createAttributeListSpecification () const
 
virtual std::string conditionType () const
 
virtual std::vector< std::string > coolInputKeys () const
 
virtual std::string coolOutputKey () const
 
virtual void clear ()
 

Private Types

enum  eAttrSpecification { eEventsPerStep, eEnergySteps }
 
typedef std::map< int, std::string > AttrSpecificationMap
 

Private Attributes

bool m_bEndOfRampRun
 
int m_nEventsPerStep
 
std::vector< double > m_vEnergySteps
 
std::vector< double >::iterator m_itCurrentStep
 
int m_iCurrentEvent
 
AttrSpecificationMap m_attrSpecificationNameMap
 
AttrSpecificationMap m_attrSpecificationTypeMap
 
std::string m_strConditionType
 

Friends

std::ostream & operator<< (std::ostream &output, const L1CaloRampRunPlan &rplan)
 

Detailed Description

Transient class defining ramps runplan objects defined by the online framework and retrieved from COOL.

Author
Damien Prieur damie.nosp@m.n.pr.nosp@m.ieur@.nosp@m.cern.nosp@m..ch

Definition at line 21 of file L1CaloRampRunPlan.h.

Member Typedef Documentation

◆ AttrSpecificationMap

typedef std::map<int, std::string> AbstractL1CaloPersistentCondition::AttrSpecificationMap
privateinherited

Definition at line 50 of file AbstractL1CaloPersistentCondition.h.

Member Enumeration Documentation

◆ eAttrSpecification

Enumerator
eEventsPerStep 
eEnergySteps 

Definition at line 43 of file L1CaloRampRunPlan.h.

Constructor & Destructor Documentation

◆ L1CaloRampRunPlan() [1/2]

L1CaloRampRunPlan::L1CaloRampRunPlan ( )

Definition at line 18 of file L1CaloRampRunPlan.cxx.

18  : AbstractL1CaloPersistentCondition("AthenaAttributeList"),
19  m_bEndOfRampRun(false),
21  m_itCurrentStep(0),
22  m_iCurrentEvent(-1)
23 {
24  this->addSpecification(eEventsPerStep, std::string("EventsPerStep"), std::string("int") );
25  this->addSpecification(eEnergySteps, std::string("EnergySteps"), std::string("string"));
26 }

◆ L1CaloRampRunPlan() [2/2]

L1CaloRampRunPlan::L1CaloRampRunPlan ( int  nEventsPerStep,
const std::vector< double > &  vEnergySteps 
)

Definition at line 28 of file L1CaloRampRunPlan.cxx.

28  : AbstractL1CaloPersistentCondition("AthenaAttributeList"),
29  m_bEndOfRampRun(false),
30  m_nEventsPerStep(nEventsPerStep),
31  m_vEnergySteps(vEnergySteps),
32  m_iCurrentEvent(-1)
33 {
34  this->addSpecification(eEventsPerStep, std::string("EventsPerStep"), std::string("int") );
35  this->addSpecification(eEnergySteps, std::string("EnergySteps"), std::string("string"));
36 
38 }

◆ ~L1CaloRampRunPlan()

virtual L1CaloRampRunPlan::~L1CaloRampRunPlan ( )
inlinevirtual

Definition at line 28 of file L1CaloRampRunPlan.h.

28 {};

Member Function Documentation

◆ addSpecification()

void AbstractL1CaloPersistentCondition::addSpecification ( int  specId,
const std::string &  specName,
const std::string &  specType 
)
inherited

Definition at line 26 of file AbstractL1CaloPersistentCondition.cxx.

26  {
27  m_attrSpecificationNameMap[specId] = specName;
28  m_attrSpecificationTypeMap[specId] = specType;
29 }

◆ clear()

void AbstractL1CaloPersistentCondition::clear ( )
virtualinherited

◆ conditionType()

virtual std::string AbstractL1CaloPersistentCondition::conditionType ( ) const
inlinevirtualinherited

Implements IL1CaloPersistenceCapable.

Definition at line 37 of file AbstractL1CaloPersistentCondition.h.

37 { return m_strConditionType; };

◆ coolInputKeys()

virtual std::vector<std::string> AbstractL1CaloPersistentCondition::coolInputKeys ( ) const
inlinevirtualinherited

◆ coolOutputKey()

virtual std::string AbstractL1CaloPersistentCondition::coolOutputKey ( ) const
inlinevirtualinherited

◆ createAttributeListSpecification()

coral::AttributeListSpecification * AbstractL1CaloPersistentCondition::createAttributeListSpecification ( ) const
inherited

Definition at line 31 of file AbstractL1CaloPersistentCondition.cxx.

31  {
32 
33  coral::AttributeListSpecification* attrSpecification = new coral::AttributeListSpecification();
34 
35  AttrSpecificationMap::const_iterator it_name = m_attrSpecificationNameMap.begin();
36  AttrSpecificationMap::const_iterator it_type = m_attrSpecificationTypeMap.begin();
37 
38  for(;it_name!=m_attrSpecificationNameMap.end();++it_name,++it_type) {
39  attrSpecification->extend(it_name->second, it_type->second);
40  }
41  return attrSpecification;
42 }

◆ currentEnergy()

double L1CaloRampRunPlan::currentEnergy ( )
inline

Definition at line 38 of file L1CaloRampRunPlan.h.

38 { return *m_itCurrentStep; };

◆ endOfRun()

bool L1CaloRampRunPlan::endOfRun ( )
inline

Definition at line 40 of file L1CaloRampRunPlan.h.

40 { return m_bEndOfRampRun; };

◆ energySteps()

std::vector<double> L1CaloRampRunPlan::energySteps ( ) const
inline

Definition at line 35 of file L1CaloRampRunPlan.h.

35 { return m_vEnergySteps; };

◆ eventsPerStep()

int L1CaloRampRunPlan::eventsPerStep ( ) const
inline

Definition at line 34 of file L1CaloRampRunPlan.h.

34 { return m_nEventsPerStep; };

◆ makePersistent()

DataObject * L1CaloRampRunPlan::makePersistent ( ) const
virtual

Reimplemented from AbstractL1CaloPersistentCondition.

Definition at line 40 of file L1CaloRampRunPlan.cxx.

40  {
41 
42  // Create AttributeListSpecification according to the attributes to be recorded
43  // this is required to create the AttributeList objs
44  coral::AttributeListSpecification* attrSpecification = this->createAttributeListSpecification();
45  if(!attrSpecification->size()) return NULL;
46 
47 
48  AthenaAttributeList* attrList = new AthenaAttributeList(*attrSpecification);
49 
50  // Set value of each row for the current channel
51  int nEventsPerStep = this->eventsPerStep();
52  std::vector<double> vEnergySteps = this->energySteps();
53 
54  (*attrList)[ this->specificationName(eEventsPerStep) ].data<int>() = nEventsPerStep;
55 
56 
57  // export energies to a string
58  std::ostringstream oss;
59  std::vector<double>::const_iterator energy_it = vEnergySteps.begin();
60  for (;energy_it!=vEnergySteps.end();++energy_it) {
61  oss << *energy_it << " ";
62  }
63  (*attrList)[ this->specificationName(eEnergySteps) ].data<std::string>()= oss.str();
64 
65  return (DataObject*) attrList;
66 }

◆ makeTransient() [1/5]

void L1CaloRampRunPlan::makeTransient ( const AthenaAttributeList *&  attributeList)
virtual

Definition at line 68 of file L1CaloRampRunPlan.cxx.

68  {
69 
70  int nEventsPerStep = (*athenaAttributeList)[ this->specificationName(eEventsPerStep) ].data<int>();
71  std::string strEnergySteps = (*athenaAttributeList)[ this->specificationName(eEnergySteps) ].data<std::string>();
72 
73  //tokenize strTable
74  int buf;
75  std::stringstream ss(strEnergySteps); // insert the table string into a stream
76  std::vector<double> vEnergySteps; // create vector to hold our words
77  while (ss >> buf) vEnergySteps.push_back(buf);
78 
79  m_nEventsPerStep = nEventsPerStep;
80 
81  m_vEnergySteps = vEnergySteps;
83 }

◆ makeTransient() [2/5]

void AbstractL1CaloPersistentCondition::makeTransient ( const std::map< std::string, const AthenaAttributeList * > &  condAttributeList)
virtualinherited

Implements IL1CaloPersistenceCapable.

Definition at line 21 of file AbstractL1CaloPersistentCondition.cxx.

21  {
22  std::cout << "ERROR - The makeTransient(const map<std::string, const AthenaAttributeList*>) method you are calling is not implemented by the current class !" << std::endl;
23  return;
24 }

◆ makeTransient() [3/5]

void AbstractL1CaloPersistentCondition::makeTransient

Definition at line 30 of file AbstractL1CaloPersistentCondition.cxx.

21  {
22  std::cout << "ERROR - The makeTransient(const map<std::string, const AthenaAttributeList*>) method you are calling is not implemented by the current class !" << std::endl;
23  return;
24 }

◆ makeTransient() [4/5]

void AbstractL1CaloPersistentCondition::makeTransient ( const std::map< std::string, const CondAttrListCollection * > &  condAttrListCollectionMap)
virtualinherited

◆ makeTransient() [5/5]

void AbstractL1CaloPersistentCondition::makeTransient

Definition at line 29 of file AbstractL1CaloPersistentCondition.cxx.

16  {
17  std::cout << "ERROR - The makeTransient(const map<std::string, const CondAttrListCollection*>) method you are calling is not implemented by the current class !" << std::endl;
18  return;
19 }

◆ nextEvent()

void L1CaloRampRunPlan::nextEvent ( )

Definition at line 85 of file L1CaloRampRunPlan.cxx.

85  {
86  if(m_bEndOfRampRun) {
87  //log << MSG::INFO << "No more steps to generate - End of ramp run" << endmsg;
88  //std::cout << "End of ramp run - No more steps to iterate" << std::endl;
89  return;
90  }
91 
93 
97  if(m_itCurrentStep!=m_vEnergySteps.end()) {
98  //std::cout << "nEventsPerStep reached, next step: "<< *m_itCurrentStep << std::endl;
99  } else {
100  //std::cout << "nEventsPerStep reached, no more steps to iterate"<< std::endl;
101  m_iCurrentEvent = -1;
102  m_bEndOfRampRun = true;
103  return;
104  }
105  }
106 }

◆ specificationName()

std::string AbstractL1CaloPersistentCondition::specificationName ( int  specId) const
inherited

Definition at line 44 of file AbstractL1CaloPersistentCondition.cxx.

44  {
45  return m_attrSpecificationNameMap.find(specId)->second;
46 }

◆ specificationType()

std::string AbstractL1CaloPersistentCondition::specificationType ( int  specId) const
inherited

Definition at line 48 of file AbstractL1CaloPersistentCondition.cxx.

48  {
49  return m_attrSpecificationTypeMap.find(specId)->second;
50 }

◆ status()

std::string L1CaloRampRunPlan::status ( )

Definition at line 108 of file L1CaloRampRunPlan.cxx.

108  {
109  std::ostringstream oss;
110  if(!m_bEndOfRampRun) {
111  oss << "L1CaloRampRunPlan - Current event: "<<m_iCurrentEvent<<", current step: "<<*m_itCurrentStep;
112  //if(m_itCurrentStep!=0) oss <<*m_itCurrentStep;
113  //else oss << "not initialized, there might be a problem !";
114  } else {
115  oss << "L1CaloRampRunPlan: No more events/steps to process";
116  }
117  return oss.str();
118 }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  output,
const L1CaloRampRunPlan rplan 
)
friend

Definition at line 121 of file L1CaloRampRunPlan.cxx.

121  {
122  output << "nEventsPerStep: "<< rplan.m_nEventsPerStep<<" ";
123  std::vector<double> vSteps = rplan.energySteps();
124  output<<" nsteps: "<< vSteps.size()<<" - steps: ";
125  std::vector<double>::const_iterator it = vSteps.begin();
126  for(;it!=vSteps.end();++it) {
127  output << *it<<" ";
128  }
129  return output;
130 }

Member Data Documentation

◆ m_attrSpecificationNameMap

AttrSpecificationMap AbstractL1CaloPersistentCondition::m_attrSpecificationNameMap
privateinherited

Definition at line 51 of file AbstractL1CaloPersistentCondition.h.

◆ m_attrSpecificationTypeMap

AttrSpecificationMap AbstractL1CaloPersistentCondition::m_attrSpecificationTypeMap
privateinherited

Definition at line 52 of file AbstractL1CaloPersistentCondition.h.

◆ m_bEndOfRampRun

bool L1CaloRampRunPlan::m_bEndOfRampRun
private

Definition at line 45 of file L1CaloRampRunPlan.h.

◆ m_iCurrentEvent

int L1CaloRampRunPlan::m_iCurrentEvent
private

Definition at line 52 of file L1CaloRampRunPlan.h.

◆ m_itCurrentStep

std::vector<double>::iterator L1CaloRampRunPlan::m_itCurrentStep
private

Definition at line 51 of file L1CaloRampRunPlan.h.

◆ m_nEventsPerStep

int L1CaloRampRunPlan::m_nEventsPerStep
private

Definition at line 47 of file L1CaloRampRunPlan.h.

◆ m_strConditionType

std::string AbstractL1CaloPersistentCondition::m_strConditionType
privateinherited

Definition at line 53 of file AbstractL1CaloPersistentCondition.h.

◆ m_vEnergySteps

std::vector<double> L1CaloRampRunPlan::m_vEnergySteps
private

Definition at line 48 of file L1CaloRampRunPlan.h.


The documentation for this class was generated from the following files:
AbstractL1CaloPersistentCondition::m_attrSpecificationTypeMap
AttrSpecificationMap m_attrSpecificationTypeMap
Definition: AbstractL1CaloPersistentCondition.h:52
L1CaloRampRunPlan::eEnergySteps
@ eEnergySteps
Definition: L1CaloRampRunPlan.h:43
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
L1CaloRampRunPlan::eventsPerStep
int eventsPerStep() const
Definition: L1CaloRampRunPlan.h:34
skel.it
it
Definition: skel.GENtoEVGEN.py:423
AbstractL1CaloPersistentCondition::addSpecification
void addSpecification(int specId, const std::string &specName, const std::string &specType)
Definition: AbstractL1CaloPersistentCondition.cxx:26
L1CaloRampRunPlan::m_iCurrentEvent
int m_iCurrentEvent
Definition: L1CaloRampRunPlan.h:52
L1CaloRampRunPlan::m_bEndOfRampRun
bool m_bEndOfRampRun
Definition: L1CaloRampRunPlan.h:45
AbstractL1CaloPersistentCondition::createAttributeListSpecification
coral::AttributeListSpecification * createAttributeListSpecification() const
Definition: AbstractL1CaloPersistentCondition.cxx:31
L1CaloRampRunPlan::m_nEventsPerStep
int m_nEventsPerStep
Definition: L1CaloRampRunPlan.h:47
python.DecayParser.buf
buf
print ("=> [%s]"cmd)
Definition: DecayParser.py:27
AbstractL1CaloPersistentCondition::AbstractL1CaloPersistentCondition
AbstractL1CaloPersistentCondition(const std::string &condType)
Definition: AbstractL1CaloPersistentCondition.h:45
AbstractL1CaloPersistentCondition::m_attrSpecificationNameMap
AttrSpecificationMap m_attrSpecificationNameMap
Definition: AbstractL1CaloPersistentCondition.h:51
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
Definition: PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:45
merge.output
output
Definition: merge.py:17
L1CaloRampRunPlan::m_itCurrentStep
std::vector< double >::iterator m_itCurrentStep
Definition: L1CaloRampRunPlan.h:51
L1CaloRampRunPlan::m_vEnergySteps
std::vector< double > m_vEnergySteps
Definition: L1CaloRampRunPlan.h:48
L1CaloRampRunPlan::energySteps
std::vector< double > energySteps() const
Definition: L1CaloRampRunPlan.h:35
AbstractL1CaloPersistentCondition::specificationName
std::string specificationName(int specId) const
Definition: AbstractL1CaloPersistentCondition.cxx:44
AbstractL1CaloPersistentCondition::m_strConditionType
std::string m_strConditionType
Definition: AbstractL1CaloPersistentCondition.h:53
L1CaloRampRunPlan::eEventsPerStep
@ eEventsPerStep
Definition: L1CaloRampRunPlan.h:43