GlobalEventData.cxx

Go to the documentation of this file.
00001 // ================================================
00002 // GlobalEventData Singleton class Implementation
00003 // ================================================
00004 //
00005 // This file contains all the common data variables 
00006 // needed by Atlfast to run
00007 // They are stored as statics so that the class needs not be instantiated
00008 // and they can be accesed in algorithms execute() methods.
00009 //
00010 // Namespace Atlfast
00011 //
00012 
00013 #include "AtlfastAlgs/GlobalEventData.h"
00014 
00015 #include "AtlfastUtils/HepMC_helper/IMCselector.h"
00016 #include "AtlfastUtils/HepMC_helper/IsFinalState.h"
00017 #include "AtlfastUtils/HepMC_helper/IsFromHardScatter.h"
00018 #include "AtlfastUtils/HepMC_helper/RejectType.h"
00019 #include "AtlfastUtils/HepMC_helper/BFieldCutter.h"
00020 #include "AtlfastUtils/HepMC_helper/NCutter.h"
00021 #include "AtlfastUtils/HepMC_helper/Unseen.h"
00022 
00023 #include "AtlfastEvent/ParticleCodes.h"
00024 
00025 namespace Atlfast {
00026   //declare static member variables
00027   GlobalEventData* GlobalEventData::m_instance = 0;
00028   //Singleton Instance method to makesure only one object instanciated
00029   GlobalEventData* GlobalEventData::Instance() {
00030     if(m_instance == 0){
00031       m_instance = new GlobalEventData();
00032     }
00033     return m_instance;
00034   }
00035   //set values of static member variables
00036   void GlobalEventData::setValues(int lumi,
00037                                   bool fieldOn,
00038                                   double barrelForwardEta,
00039                                   int randSeed,
00040                                   std::vector<int> invisibles,
00041                                   std::string mcLocation,
00042                                   std::vector<int> monopoleIDs,
00043                                   bool justHardScatter){
00044     m_lumi = lumi;
00045     m_fieldOn = fieldOn;
00046     m_barrelForwardEta = barrelForwardEta;
00047     m_randSeed = randSeed;
00048     m_invisibles = invisibles;
00049     m_mcLocation = mcLocation;
00050     m_adjustMissEtForIsolation = true;
00051     m_monopoleIDs = monopoleIDs;
00052     m_justHardScatter = justHardScatter;
00053 
00054     std::vector<int> temp = m_invisibles;
00055     HepMC_helper::IMCselector* selector;
00056     std::vector<HepMC_helper::IMCselector*> selectors;
00057     temp.push_back(ParticleCodes::MUON);
00058 
00059     selector = new HepMC_helper::IsFromHardScatter();
00060     selectors.push_back( selector ); 
00061     
00062     selector = new HepMC_helper::IsFinalState();
00063     selectors.push_back( selector ); 
00064     
00065     selector = new HepMC_helper::RejectType(temp);
00066     selectors.push_back( selector ); 
00067     
00068     
00069     try{
00070       selector = new HepMC_helper::BFieldCutter(m_fieldOn);
00071     }catch(std::string errMsg){
00072       std::cerr<<"GlobalEventData: error makign a BFieldCutter "
00073                <<errMsg
00074                <<std::endl;
00075     }catch(...){
00076       std::cerr<<"GlobalEventData: error makign a BFieldCutter "
00077                <<std::endl;
00078     }      
00079     selectors.push_back(selector);
00080     
00081 
00082     m_visibleToCal = new HepMC_helper::NCutter(selectors); 
00083     
00084     // make a selector of invisibles to Atlas
00085     // neutrinos, muons out of acceptance and user selected pdg ids.
00086     std::vector<HepMC_helper::IMCselector*>::iterator iter;
00087 
00088     for(iter=selectors.begin(); iter!=selectors.end(); delete *iter, ++iter);
00089     selectors.erase(selectors.begin(), selectors.end());
00090 
00091     selector = new HepMC_helper::IsFromHardScatter();
00092     selectors.push_back( selector ); 
00093     
00094     selector = new HepMC_helper::IsFinalState();
00095     selectors.push_back( selector ); 
00096     
00097     selector = new HepMC_helper::Unseen(m_invisibles);
00098     selectors.push_back( selector ); 
00099     
00100     m_visibleToAtlas = new HepMC_helper::NCutter(selectors); 
00101 
00102     for(iter=selectors.begin(); iter!=selectors.end(); delete *iter, ++iter);
00103   }
00104 
00105   
00106 }  //end of namespace bracket
00107 
00108 
00109 
00110 
00111 
00112 
00113 
00114 
00115 
00116 
00117 
00118 

Generated on Mon Sep 24 14:19:12 2007 for AtlfastAlgs by  doxygen 1.5.1