Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:36

0001 //#include "Utilities/Configuration/interface/Architecture.h"
0002 
0003 /* \file ExampleClass.cc
0004  *
0005  *  $Date: $
0006  *  $Revision: $
0007  *  \author W. Woodpecker - CERN
0008  */
0009 
0010 //#include "Subsystem/Package/interface/ExampleClass.h"
0011 //#include "Subsystem/Package/interface/SomeAlgorithm.h"
0012 
0013 using namespace std;
0014 
0015 #include "ExampleClass.h"
0016 class SomeAlgorithm {
0017  public: SomeAlgorithm(){};
0018 };
0019   
0020 
0021 
0022 // Constructor
0023 ExampleClass::ExampleClass() :
0024   theCount(0),
0025   theAlgo(new SomeAlgorithm()) 
0026 {}
0027 
0028 // Destructor
0029 ExampleClass::~ExampleClass(){
0030   delete theAlgo;
0031 }
0032 
0033 
0034 // A simple setter
0035 void ExampleClass::setCount(int ticks){
0036   theCount = ticks;
0037 }
0038 
0039 
0040 // A simple getter
0041 int ExampleClass::count() const{
0042   return theCount;
0043 }
0044 
0045 
0046 
0047 // Another setter
0048 void ExampleClass::setValues(const vector<float>& entries) {
0049   theValues = entries;
0050 }
0051 
0052 
0053 // A getter returning a const reference
0054 const vector<float>& ExampleClass::values() const {
0055   return theValues;
0056 }
0057 
0058 
0059 
0060 // A member function
0061 float ExampleClass::computeMean() const {
0062   float result = 1.;
0063   //... do all necessary computations...
0064   return result;
0065 }
0066