ATLAS Offline Software
Loading...
Searching...
No Matches
dqm_algorithms::PassInput Struct Reference

#include <PassInput.h>

Inheritance diagram for dqm_algorithms::PassInput:
Collaboration diagram for dqm_algorithms::PassInput:

Public Member Functions

 PassInput ()
 ~PassInput ()
PassInputclone ()
dqm_core::Result * execute (const std::string &, const TObject &, const dqm_core::AlgorithmConfig &)
void printDescription (std::ostream &out)

Detailed Description

Definition at line 17 of file PassInput.h.

Constructor & Destructor Documentation

◆ PassInput()

dqm_algorithms::PassInput::PassInput ( )

Definition at line 25 of file PassInput.cxx.

26{
27 dqm_core::AlgorithmManager::instance().registerAlgorithm("PassInput", this);
28}

◆ ~PassInput()

dqm_algorithms::PassInput::~PassInput ( )

Definition at line 30 of file PassInput.cxx.

31{
32}

Member Function Documentation

◆ clone()

dqm_algorithms::PassInput * dqm_algorithms::PassInput::clone ( )

Definition at line 35 of file PassInput.cxx.

36{
37
38 return new PassInput();
39}

◆ execute()

dqm_core::Result * dqm_algorithms::PassInput::execute ( const std::string & name,
const TObject & object,
const dqm_core::AlgorithmConfig & config )

Definition at line 43 of file PassInput.cxx.

46{
47 dqm_core::Result* result = new dqm_core::Result();
48 std::string tagName;
49
50 if( (!object.IsA()->InheritsFrom( "TH1" )) && (!object.IsA()->InheritsFrom( "TObjArray" )) ) {
51 throw dqm_core::BadConfig( ERS_HERE, name, "input object does not inherit from either TH1 or TObjArray");
52 }
53
54 //Pass this input object pointer
55 TObject* resultObject = object.Clone();
56 result->object_ = (boost::shared_ptr<TObject>)resultObject;
57
58 //Pass the config as a series of tags (with labels embedded in the strings):
59 //First the options:
60 std::map<std::string,double> configParametersMap = config.getParameters(); //Copy needed to avoid runtime errors. AlgConfig needs to return map by reference, which it does not do.
61 if (!configParametersMap.empty()){
62 for ( std::map<std::string,double>::const_iterator paramIter = configParametersMap.begin();
63 paramIter != configParametersMap.end(); ++paramIter ) {
64 // if( paramIter->second.empty() ) {
65 // //Could just drop this, or throw an error, but will keep and label as empty for now
66 // tagName="EmptyParameter--" + paramIter->first;
67 // result->tags_[tagName] = -1.;
68 // continue;
69 // }
70 // if ( paramIter->second.size() == 1 ) {
71 tagName="ConfParameter--" + paramIter->first;
72 result->tags_[tagName] = paramIter->second;
73 // }
74 // else {
75 // int i=0;
76 // for( std::vector<double>::const_iterator valueIter = paramIter->second.begin();
77 // valueIter != paramIter->second.end(); valueIter++ ) {
78 // char numStr[32];
79 // sprintf(numStr,"%d",i);
80 // tagName="ConfParameter["+(numStr+("]--"+ paramIter->first));
81 // result->tags_[tagName] = *valueIter;
82 // }
83 // }
84 }
85 }
86 //Now the Green Thresholds:
87 std::map<std::string,double> greenThreshMap = config.getGreenThresholds(); //Copy needed to avoid runtime errors.
88 if (!greenThreshMap.empty()) {
89 for ( std::map<std::string,double>::const_iterator itr = greenThreshMap.begin();
90 itr != greenThreshMap.end(); ++itr ){
91 tagName = "GThreshold--"+itr->first;
92 result->tags_[tagName] = itr->second;
93 }
94 }
95 //Finally, the Red Thresholds:
96 std::map<std::string,double> redThreshMap = config.getRedThresholds(); //Copy needed to avoid runtime errors.
97 if (!redThreshMap.empty()) {
98 for ( std::map<std::string,double>::const_iterator itr = redThreshMap.begin();
99 itr != redThreshMap.end(); ++itr ){
100 tagName = "RThreshold--"+itr->first;
101 result->tags_[tagName] = itr->second;
102 }
103 }
104
105 //No checks are done, so the result should be undefined:
106 result->status_ = dqm_core::Result::Undefined;
107
108 return result;
109}
#define IsA
Declare the TObject style functions.

◆ printDescription()

void dqm_algorithms::PassInput::printDescription ( std::ostream & out)

Definition at line 112 of file PassInput.cxx.

113{
114 out<<"PassInput: Minimal algorithm to pass its input histogram through to its result." << std::endl;
115
116}

The documentation for this struct was generated from the following files: