NtupleReader/src/MyMissingEtManager.cxx

00001 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00002 // 07/2007, AUTHOR: STEFFEN KAISER
00003 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00004 
00005 //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
00006 //:: IMPLEMENTATION OF METHODS DEFINED IN THE CLASS MyMissingEtManager ::
00007 //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
00008 
00009 //::::::::::::::::::
00010 //:: HEADER FILES ::
00011 //::::::::::::::::::
00012 
00013 #include "NtupleReader/MyMissingEtManager.h"
00014 
00015 
00016 //::::::::::::::::::::::::
00017 //:: NAMESPACE SETTINGS ::
00018 //::::::::::::::::::::::::
00019 
00020 using namespace std;
00021 
00022 
00023 //*****************************************************************************
00024 
00025 //:::::::::::::::::
00026 //:: METHOD init ::
00027 //:::::::::::::::::
00028 
00029 void MyMissingEtManager::init() {
00030   
00031     m_met_map.clear();
00032     m_dataset_info = &MyDatasetInfo::Instance();
00033 
00034     return;
00035 }
00036 
00037 //*****************************************************************************
00038 
00039 //:::::::::::::::::::::
00040 //:: METHOD destruct ::
00041 //:::::::::::::::::::::
00042 
00043 void MyMissingEtManager::destruct(void) {
00044     
00045     return;
00046 }
00047 
00048 //*****************************************************************************
00049 
00050 //::::::::::::::::::::::::::
00051 //:: METHOD add_missinget ::
00052 //::::::::::::::::::::::::::
00053 
00054 void
00055 MyMissingEtManager::add_missinget(MyMissingEt met) {
00056     
00057     m_met_map.insert(ValuePair(met.name(),met));
00058 
00059     return;
00060 
00061 }
00062 
00063 //*****************************************************************************
00064 
00065 //::::::::::::::::::::::::::
00066 //:: METHOD get_missinget ::
00067 //::::::::::::::::::::::::::
00068 
00069 MyMissingEt
00070 MyMissingEtManager::get_missinget(TString name) {
00071     
00072     MyMissingEt met;
00073         
00074         if(name=="MET_Own"){
00075             MyMissingEt met1 = this->retrieve_from_map("MET_Calib");
00076             met = met1.add("MET_Own", 
00077                            this->retrieve_from_map("TruthMET_Muons"),
00078                            this->retrieve_from_map("MET_CryoCone"));
00079         }
00080         else{
00081             met = this->retrieve_from_map(name); 
00082         }
00083    
00084     return met;
00085     
00086   }
00087 
00088 //*****************************************************************************
00089 
00090 //::::::::::::::::::::::::::::::
00091 //:: METHOD retrieve_from_map ::
00092 //::::::::::::::::::::::::::::::
00093 
00094 MyMissingEt
00095 MyMissingEtManager::retrieve_from_map(TString name){
00096     
00097     MyMissingEt met;
00098     
00099     maptype::const_iterator iter = m_met_map.find(name);
00100     if( iter != m_met_map.end() ){
00101         met = (*iter).second;
00102     }
00103     else{
00104         cerr << endl
00105              << "Error in MissingEtManager: Could not find MissingEt: " 
00106              <<  name
00107              << endl;
00108         exit(1);
00109     }
00110 
00111     return met; 
00112 }
00113 
00114 //*****************************************************************************
00115 
00116 //::::::::::::::::::
00117 //:: METHOD Print ::
00118 //::::::::::::::::::
00119 
00120 void
00121 MyMissingEtManager::Print(string option) {
00122     
00123     cout << " MissingEtManager: " << endl;
00124     maptype::iterator it;
00125     for( it=m_met_map.begin(); it!=m_met_map.end(); it++ ){
00126     
00127         (*it).second.Print(option);
00128     }
00129 
00130     return;
00131 
00132 }
00133 
00134 //*****************************************************************************
00135 
00136 // void
00137 // MyMissingEtManager::get_default_met(void) {
00138    
00139 //     cout << "default_met: " << m_default_met << endl;
00140 //     return;
00141 // }
00142 
00143 // void
00144 // MyMissingEtManager::set_default_met(TString default_met) {
00145     
00146 //     m_default_met=default_met;
00147 //     return;
00148 // }
00149 
00150 

Generated on Tue Oct 21 11:50:45 2008 for NtupleAnalysis by  doxygen 1.5.1