ATLAS Offline Software
Loading...
Searching...
No Matches
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
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)
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),
23{
24 this->addSpecification(eEventsPerStep, std::string("EventsPerStep"), std::string("int") );
25 this->addSpecification(eEnergySteps, std::string("EnergySteps"), std::string("string"));
26}
AbstractL1CaloPersistentCondition(const std::string &condType)
void addSpecification(int specId, const std::string &specName, const std::string &specType)
std::vector< double >::iterator m_itCurrentStep

◆ 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),
33{
34 this->addSpecification(eEventsPerStep, std::string("EventsPerStep"), std::string("int") );
35 this->addSpecification(eEnergySteps, std::string("EnergySteps"), std::string("string"));
36
38}
std::vector< double > m_vEnergySteps

◆ ~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()

◆ conditionType()

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

◆ coolInputKeys()

◆ coolOutputKey()

◆ 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()

const 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 attrList;
66}
coral::AttributeListSpecification * createAttributeListSpecification() const
int eventsPerStep() const
const std::vector< double > & energySteps() const

◆ makeTransient() [1/3]

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 = std::move(vEnergySteps);
83}
static Double_t ss

◆ makeTransient() [2/3]

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

Reimplemented from AbstractL1CaloPersistentCondition.

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() [3/3]

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

Reimplemented from AbstractL1CaloPersistentCondition.

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 return;
88 }
89
91
96 } else {
97 m_iCurrentEvent = -1;
98 m_bEndOfRampRun = true;
99 return;
100 }
101 }
102}

◆ 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 104 of file L1CaloRampRunPlan.cxx.

104 {
105 std::ostringstream oss;
106 if(!m_bEndOfRampRun) {
107 oss << "L1CaloRampRunPlan - Current event: "<<m_iCurrentEvent<<", current step: "<<*m_itCurrentStep;
108 } else {
109 oss << "L1CaloRampRunPlan: No more events/steps to process";
110 }
111 return oss.str();
112}

◆ operator<<

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

Definition at line 115 of file L1CaloRampRunPlan.cxx.

115 {
116 output << "nEventsPerStep: "<< rplan.m_nEventsPerStep<<" ";
117 std::vector<double> vSteps = rplan.energySteps();
118 output<<" nsteps: "<< vSteps.size()<<" - steps: ";
119 std::vector<double>::const_iterator it = vSteps.begin();
120 for(;it!=vSteps.end();++it) {
121 output << *it<<" ";
122 }
123 return output;
124}
output
Definition merge.py:16

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: