CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
KalmanAlignmentDataCollector Class Reference

A simple class that allows fast and easy histograming and the production of graphs. More...

#include <KalmanAlignmentDataCollector.h>

Public Member Functions

 KalmanAlignmentDataCollector (void)
 
 KalmanAlignmentDataCollector (const edm::ParameterSet &config)
 
 ~KalmanAlignmentDataCollector (void)
 

Static Public Member Functions

static void clear (void)
 
static void configure (const edm::ParameterSet &config)
 
static void fillGraph (std::string graph_name, float x_data, float y_data)
 
static void fillGraph (std::string graph_name, int graph_number, float x_data, float y_data)
 
static void fillHistogram (std::string histo_name, float data)
 
static void fillHistogram (std::string histo_name, int histo_number, float data)
 
static void fillNtuple (std::string ntuple_name, float data)
 
static
KalmanAlignmentDataCollector
get (void)
 
static void write (void)
 
static void write (std::string file_name, std::string mode="RECREATE")
 

Private Member Functions

void clearData (void)
 
void config (const edm::ParameterSet &config)
 
void fillTGraph (std::string graph_name, float x_data, float y_data)
 
void fillTGraph (std::string graph_name, int graph_number, float x_data, float y_data)
 
void fillTH1F (std::string histo_name, float data)
 
void fillTH1F (std::string histo_name, int histo_number, float data)
 
void fillTNtuple (std::string ntuple_name, float data)
 
std::string toString (int)
 
void writeToTFile (void)
 
void writeToTFile (std::string file_name, std::string mode="RECREATE")
 

Private Attributes

edm::ParameterSet theConfiguration
 
std::map< std::string,
std::vector< float > > 
theHistoData
 
std::map< std::string,
std::vector< float > > 
theNtupleData
 
std::map< std::string,
std::vector< float > > 
theXGraphData
 
std::map< std::string,
std::vector< float > > 
theYGraphData
 

Static Private Attributes

static
KalmanAlignmentDataCollector
theDataCollector = new KalmanAlignmentDataCollector()
 

Detailed Description

A simple class that allows fast and easy histograming and the production of graphs.

Definition at line 12 of file KalmanAlignmentDataCollector.h.

Constructor & Destructor Documentation

KalmanAlignmentDataCollector::KalmanAlignmentDataCollector ( void  )

Definition at line 15 of file KalmanAlignmentDataCollector.cc.

15 {}
KalmanAlignmentDataCollector::KalmanAlignmentDataCollector ( const edm::ParameterSet config)

Definition at line 18 of file KalmanAlignmentDataCollector.cc.

18 : theConfiguration( config ) {}
KalmanAlignmentDataCollector::~KalmanAlignmentDataCollector ( void  )

Definition at line 21 of file KalmanAlignmentDataCollector.cc.

21 {}

Member Function Documentation

void KalmanAlignmentDataCollector::clear ( void  )
static
void KalmanAlignmentDataCollector::clearData ( void  )
private

Definition at line 273 of file KalmanAlignmentDataCollector.cc.

References theHistoData, theXGraphData, and theYGraphData.

Referenced by clear().

274 {
275  theHistoData.clear();
276  theXGraphData.clear();
277  theYGraphData.clear();
278 }
std::map< std::string, std::vector< float > > theXGraphData
std::map< std::string, std::vector< float > > theHistoData
std::map< std::string, std::vector< float > > theYGraphData
void KalmanAlignmentDataCollector::config ( const edm::ParameterSet config)
private

Definition at line 93 of file KalmanAlignmentDataCollector.cc.

References theConfiguration.

Referenced by configure().

94 {
96 }
void config(const edm::ParameterSet &config)
void KalmanAlignmentDataCollector::configure ( const edm::ParameterSet config)
static

Definition at line 31 of file KalmanAlignmentDataCollector.cc.

References config(), and theDataCollector.

Referenced by KalmanAlignmentAlgorithm::initialize().

32 {
33  //if ( !theDataCollector ) theDataCollector = new KalmanAlignmentDataCollector();
34  theDataCollector->config( config );
35 }
static KalmanAlignmentDataCollector * theDataCollector
void config(const edm::ParameterSet &config)
static void KalmanAlignmentDataCollector::fillGraph ( std::string  graph_name,
float  x_data,
float  y_data 
)
static
static void KalmanAlignmentDataCollector::fillGraph ( std::string  graph_name,
int  graph_number,
float  x_data,
float  y_data 
)
static
static void KalmanAlignmentDataCollector::fillHistogram ( std::string  histo_name,
float  data 
)
static
static void KalmanAlignmentDataCollector::fillHistogram ( std::string  histo_name,
int  histo_number,
float  data 
)
static
void KalmanAlignmentDataCollector::fillNtuple ( std::string  ntuple_name,
float  data 
)
static

Definition at line 66 of file KalmanAlignmentDataCollector.cc.

References fillTNtuple(), and theDataCollector.

67 {
68  //if ( !theDataCollector ) theDataCollector = new KalmanAlignmentDataCollector();
69  theDataCollector->fillTNtuple( ntuple_name, data );
70 }
static KalmanAlignmentDataCollector * theDataCollector
void fillTNtuple(std::string ntuple_name, float data)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void KalmanAlignmentDataCollector::fillTGraph ( std::string  graph_name,
float  x_data,
float  y_data 
)
private
void KalmanAlignmentDataCollector::fillTGraph ( std::string  graph_name,
int  graph_number,
float  x_data,
float  y_data 
)
private
void KalmanAlignmentDataCollector::fillTH1F ( std::string  histo_name,
float  data 
)
private
void KalmanAlignmentDataCollector::fillTH1F ( std::string  histo_name,
int  histo_number,
float  data 
)
private
void KalmanAlignmentDataCollector::fillTNtuple ( std::string  ntuple_name,
float  data 
)
private

Definition at line 149 of file KalmanAlignmentDataCollector.cc.

References data, and theNtupleData.

Referenced by fillNtuple().

150 {
151  if ( theNtupleData.find( ntuple_name ) == theNtupleData.end() )
152  {
153  theNtupleData[ntuple_name] = vector< float > ( 1, data );
154  }
155  else
156  {
157  theNtupleData[ntuple_name].push_back( data );
158  }
159 }
std::map< std::string, std::vector< float > > theNtupleData
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
KalmanAlignmentDataCollector * KalmanAlignmentDataCollector::get ( void  )
static
string KalmanAlignmentDataCollector::toString ( int  i)
private

Definition at line 281 of file KalmanAlignmentDataCollector.cc.

References groupFilesInBlocks::temp.

282 {
283  char temp[10];
284  snprintf( temp, sizeof(temp), "%u", i );
285 
286  return string( temp );
287 }
int i
Definition: DBlmapReader.cc:9
void KalmanAlignmentDataCollector::write ( void  )
static

Definition at line 73 of file KalmanAlignmentDataCollector.cc.

References theDataCollector, and writeToTFile().

Referenced by KalmanAlignmentAlgorithm::terminate().

74 {
75  //if ( !theDataCollector ) theDataCollector = new KalmanAlignmentDataCollector();
77 }
static KalmanAlignmentDataCollector * theDataCollector
static void KalmanAlignmentDataCollector::write ( std::string  file_name,
std::string  mode = "RECREATE" 
)
static
void KalmanAlignmentDataCollector::writeToTFile ( void  )
private

Definition at line 162 of file KalmanAlignmentDataCollector.cc.

References dtDQMClient_cfg::fileMode, convertXMLtoSQLite_cfg::fileName, edm::ParameterSet::getUntrackedParameter(), and theConfiguration.

Referenced by write().

163 {
164  string fileName = theConfiguration.getUntrackedParameter< string >( "FileName", "KalmanAlignmentData.root" );
165  string fileMode = theConfiguration.getUntrackedParameter< string >( "Mode", "RECREATE" );
166  writeToTFile( fileName, fileMode );
167 }
T getUntrackedParameter(std::string const &, T const &) const
void KalmanAlignmentDataCollector::writeToTFile ( std::string  file_name,
std::string  mode = "RECREATE" 
)
private

Member Data Documentation

edm::ParameterSet KalmanAlignmentDataCollector::theConfiguration
private

Definition at line 59 of file KalmanAlignmentDataCollector.h.

Referenced by config(), and writeToTFile().

KalmanAlignmentDataCollector * KalmanAlignmentDataCollector::theDataCollector = new KalmanAlignmentDataCollector()
staticprivate

Definition at line 57 of file KalmanAlignmentDataCollector.h.

Referenced by clear(), configure(), fillNtuple(), get(), and write().

std::map< std::string, std::vector< float > > KalmanAlignmentDataCollector::theHistoData
private

Definition at line 61 of file KalmanAlignmentDataCollector.h.

Referenced by clearData().

std::map< std::string, std::vector< float > > KalmanAlignmentDataCollector::theNtupleData
private

Definition at line 64 of file KalmanAlignmentDataCollector.h.

Referenced by fillTNtuple().

std::map< std::string, std::vector< float > > KalmanAlignmentDataCollector::theXGraphData
private

Definition at line 62 of file KalmanAlignmentDataCollector.h.

Referenced by clearData().

std::map< std::string, std::vector< float > > KalmanAlignmentDataCollector::theYGraphData
private

Definition at line 63 of file KalmanAlignmentDataCollector.h.

Referenced by clearData().