CMS 3D CMS Logo

MEtoEDM< T > Class Template Reference

DataFormat class to hold the information from a ME tranformed into ROOT objects as appropriate. More...

#include <DataFormats/Histograms/interface/MEtoEDMFormat.h>

List of all members.

Public Types

typedef std::vector
< MEtoEDMObject
MEtoEdmObjectVector
typedef std::vector< uint32_t > TagList

Public Member Functions

const MEtoEdmObjectVectorgetMEtoEdmObject () const
template<>
bool mergeProduct (const MEtoEDM< TString > &newMEtoEDM)
template<>
bool mergeProduct (const MEtoEDM< int > &newMEtoEDM)
template<>
bool mergeProduct (const MEtoEDM< double > &newMEtoEDM)
bool mergeProduct (const MEtoEDM< T > &newMEtoEDM)
 MEtoEDM ()
void putMEtoEdmObject (const std::vector< std::string > &name, const std::vector< TagList > &tags, const std::vector< T > &object, const std::vector< std::string > &release, const std::vector< int > &run, const std::vector< std::string > &datatier)
virtual ~MEtoEDM ()

Private Attributes

MEtoEdmObjectVector MEtoEdmObject

Classes

struct  MEtoEDMObject


Detailed Description

template<class T>
class MEtoEDM< T >

DataFormat class to hold the information from a ME tranformed into ROOT objects as appropriate.

Date
2008/10/15 13:44:42
Revision
1.9
Author:
M. Strang SUNY-Buffalo

Definition at line 31 of file MEtoEDMFormat.h.


Member Typedef Documentation

template<class T>
typedef std::vector<MEtoEDMObject> MEtoEDM< T >::MEtoEdmObjectVector

Definition at line 49 of file MEtoEDMFormat.h.

template<class T>
typedef std::vector<uint32_t> MEtoEDM< T >::TagList

Definition at line 37 of file MEtoEDMFormat.h.


Constructor & Destructor Documentation

template<class T>
MEtoEDM< T >::MEtoEDM (  )  [inline]

Definition at line 34 of file MEtoEDMFormat.h.

00034 {}

template<class T>
virtual MEtoEDM< T >::~MEtoEDM (  )  [inline, virtual]

Definition at line 35 of file MEtoEDMFormat.h.

00035 {}


Member Function Documentation

template<class T>
const MEtoEdmObjectVector& MEtoEDM< T >::getMEtoEdmObject (  )  const [inline]

Definition at line 69 of file MEtoEDMFormat.h.

References MEtoEDM< T >::MEtoEdmObject.

Referenced by MEtoEDM< T >::mergeProduct().

00070     { return MEtoEdmObject; }

template<>
bool MEtoEDM< TString >::mergeProduct ( const MEtoEDM< TString > &  newMEtoEDM  )  [inline]

Definition at line 134 of file MEtoEDMFormat.h.

00135 { return true; }

template<>
bool MEtoEDM< int >::mergeProduct ( const MEtoEDM< int > &  newMEtoEDM  )  [inline]

Definition at line 114 of file MEtoEDMFormat.h.

References MEtoEDM< T >::getMEtoEdmObject(), i, MEtoEDM< T >::MEtoEdmObject, and name.

00115 {
00116  const MEtoEdmObjectVector &newMEtoEDMObject =
00117    newMEtoEDM.getMEtoEdmObject();
00118  for (unsigned int i = 0; i < MEtoEdmObject.size(); ++i) {
00119    if ( MEtoEdmObject[i].name.find("EventInfo/processedEvents") != std::string::npos ) {
00120      MEtoEdmObject[i].object += (newMEtoEDMObject[i].object);
00121    }
00122    if ( MEtoEdmObject[i].name.find("EventInfo/iEvent") != std::string::npos ||
00123         MEtoEdmObject[i].name.find("EventInfo/iLumiSection") != std::string::npos) {
00124         if (MEtoEdmObject[i].object < newMEtoEDMObject[i].object) 
00125                            MEtoEdmObject[i].object = (newMEtoEDMObject[i].object);
00126    }
00127    
00128  }
00129  return true;
00130 }

template<>
bool MEtoEDM< double >::mergeProduct ( const MEtoEDM< double > &  newMEtoEDM  )  [inline]

Definition at line 109 of file MEtoEDMFormat.h.

00110 { return true; }

template<class T>
bool MEtoEDM< T >::mergeProduct ( const MEtoEDM< T > &  newMEtoEDM  )  [inline]

Definition at line 72 of file MEtoEDMFormat.h.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), MEtoEDM< T >::getMEtoEdmObject(), i, j, MEtoEDM< T >::MEtoEdmObject, name, and tmp.

00072                                                   {
00073     const MEtoEdmObjectVector &newMEtoEDMObject = 
00074       newMEtoEDM.getMEtoEdmObject();
00075     bool warn = false;
00076     std::vector<bool> tmp(newMEtoEDMObject.size(), false);
00077     for (unsigned int i = 0; i < MEtoEdmObject.size(); ++i) {
00078       unsigned int j = 0;
00079       while (j < newMEtoEDMObject.size() &&
00080              (strcmp(MEtoEdmObject[i].name.c_str(),
00081                      newMEtoEDMObject[j].name.c_str()) != 0)) ++j;
00082       if (j < newMEtoEDMObject.size()) {
00083         MEtoEdmObject[i].object.Add(&newMEtoEDMObject[j].object);
00084         tmp[j] = true;
00085       } else {
00086         warn = true;
00087       }
00088     }
00089     for (unsigned int j = 0; j < newMEtoEDMObject.size(); ++j) {
00090       if (!tmp[j]) {
00091         warn = true;
00092         MEtoEdmObject.push_back(newMEtoEDMObject[j]);
00093       }
00094     }
00095     if (warn) {
00096       std::cout << "WARNING: problem found in MEtoEDM::mergeProducts()" << std::endl;
00097     }
00098     return true;
00099   }

template<class T>
void MEtoEDM< T >::putMEtoEdmObject ( const std::vector< std::string > &  name,
const std::vector< TagList > &  tags,
const std::vector< T > &  object,
const std::vector< std::string > &  release,
const std::vector< int > &  run,
const std::vector< std::string > &  datatier 
) [inline]

Definition at line 51 of file MEtoEDMFormat.h.

References i, and MEtoEDM< T >::MEtoEdmObject.

00057     {
00058       MEtoEdmObject.resize(name.size());
00059       for (unsigned int i = 0; i < name.size(); ++i) {
00060         MEtoEdmObject[i].name = name[i];
00061         MEtoEdmObject[i].tags = tags[i];
00062         MEtoEdmObject[i].object = object[i];
00063         MEtoEdmObject[i].release = release[i];
00064         MEtoEdmObject[i].run = run[i];
00065         MEtoEdmObject[i].datatier = datatier[i];
00066       }
00067     }


Member Data Documentation

template<class T>
MEtoEdmObjectVector MEtoEDM< T >::MEtoEdmObject [private]

Definition at line 103 of file MEtoEDMFormat.h.

Referenced by MEtoEDM< T >::getMEtoEdmObject(), MEtoEDM< T >::mergeProduct(), and MEtoEDM< T >::putMEtoEdmObject().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:28:14 2009 for CMSSW by  doxygen 1.5.4