Report problems to ATLAS LXR Team (with time and IP address indicated)

The LXR Cross Referencer

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Architecture: linux ]
Version: head ] [ nightly ] [ GaudiDev ]
  Links to LXR source navigation pages for stable releases [ 12.*.* ]   [ 13.*.* ]   [ 14.*.* ]   [ 15.*.* ] 

001   /** @brief GlobalEventDataMaker class Implementation Singleton version 
002    *
003    * Sets all the static GlobalEventData values.
004    * Done mostly via the GlobalEventData::setValues method.
005    *
006    * @author Jon Couchman
007    *
008    * @image html GlobalEventDataMaker.jpg "GlobalEventDataMaker sequence"
009    */
010 
011 #include "AtlfastAlgs/GlobalEventDataMaker.h"
012 #include "AtlfastAlgs/GlobalEventData.h"
013 #include "AtlfastEvent/MagField.h"
014 
015 #include "AtlfastEvent/ParticleCodes.h"
016 
017 #include "AtlfastUtils/HeaderPrinter.h"
018 
019 // Gaudi includes
020 #include "GaudiKernel/DataSvc.h"
021 #include "GaudiKernel/MsgStream.h"
022 #include <algorithm>
023 
024 namespace Atlfast {
025   using std::sort;
026   using std::unique;
027   //--------------------------------
028   // Constructor 
029   //--------------------------------
030   GlobalEventDataMaker::GlobalEventDataMaker ( 
031       const std::string& name, 
032       ISvcLocator* pSvcLocator 
033       )
034     : Algorithm( name, pSvcLocator )
035   {
036     // Set the parameter defaults.
037 
038     /** Lumonosity low=1 high=2 */
039     m_lumi              = 1;
040     /** Magnetic field on/off */
041     m_fieldOn           = true;
042     /** Magnetic field strength (Tesla) */
043     m_fieldStrength     = -999.9;
044     /** eta transition between barrel and forward detectors */
045     m_barrelForwardEta  = 3.2;
046     /** Random seed */
047     m_randSeed          = 12345;
048     /** StoreGate key for MC data (default = "") */
049     m_mcLocation        = "GEN_EVENT";
050     /** Whether to just consider the hard scatter GenEvent or all of them */
051     m_justHardScatter   = true;
052     /** File name for the detector effects data file */
053     m_detEffectsFileName = "";
054     /** File name for the muon misalignment data file */
055     m_muonAlignFileName = "atlfastDatafiles/MuonAlignResolutionTable.txt";
056     /** File name for the muon misalignment data file */
057     m_muonLinearFitAlignFileName = "atlfastDatafiles/MuonAlignResolutionTableLinearFit.txt";
058     /** Muon misalignment value (in microns) */ 
059     m_muonMisalignment = 500.0;
060     /** Invisible partices neutrinos etc.*/ 
061     m_invisibles.push_back(12);
062     m_invisibles.push_back(14);
063     m_invisibles.push_back(16);
064     m_invisibles.push_back(1000022);
065 
066     // Declare the parameters to Gaudi so that
067     // they can be over-written via the job options file
068     declareProperty( "Luminosity",       m_lumi );
069     declareProperty( "Invisibles",       m_invisibles );
070     declareProperty( "BFieldOn",         m_fieldOn ) ;
071     declareProperty( "BFieldStrength",   m_fieldStrength ) ;
072     declareProperty( "RandomSeed",       m_randSeed ) ;
073     declareProperty( "BarrelForwardEta", m_barrelForwardEta ) ;
074     declareProperty( "McLocation",       m_mcLocation ) ;
075     declareProperty( "MonopoleIDs",      m_monopoleIDs );
076     declareProperty( "JustHardScatter",  m_justHardScatter );
077     declareProperty( "DetEffectsFileName",  m_detEffectsFileName );
078     declareProperty( "MuonAlignFileName",  m_muonAlignFileName );
079     declareProperty( "MuonLinearFitAlignFileName",  m_muonLinearFitAlignFileName );
080     declareProperty( "MuonMisalignment",  m_muonMisalignment );
081     
082   }
083   
084   //--------------------
085   // Destructor
086   //--------------------
087   
088   GlobalEventDataMaker::~GlobalEventDataMaker() {
089     MsgStream log( messageService(), name() ) ;
090     log << MSG::INFO << "destructor, Global Event Data" << endreq;
091   }
092 
093   //---------------------------------
094   // initialise() 
095   //---------------------------------
096   
097   StatusCode GlobalEventDataMaker::initialize()
098   {
099     MsgStream log( messageService(), name() ) ;
100     log << MSG::DEBUG << "Initialising" << endreq; 
101     log << MSG::DEBUG << "Making Invisibles" << endreq; 
102     m_invisibles.push_back(ParticleCodes::NU_E);
103     m_invisibles.push_back(ParticleCodes::NU_MU);
104     m_invisibles.push_back(ParticleCodes::NU_TAU);
105     std::vector<int>::iterator ibe = m_invisibles.begin();
106     std::vector<int>::iterator originalEnd = m_invisibles.end();
107     std::vector<int>::iterator ien;
108     sort(ibe, originalEnd);
109     ien=unique(ibe, originalEnd);
110     m_invisibles.erase(ien, originalEnd);
111     
112     /** PDG ID numbers for magnetic monopoles */
113     std::vector<int>::iterator mbe = m_monopoleIDs.begin();
114     std::vector<int>::iterator mOriginalEnd = m_monopoleIDs.end();
115     std::vector<int>::iterator men;
116     sort(mbe, mOriginalEnd);
117     men=unique(mbe, mOriginalEnd);
118     m_monopoleIDs.erase(men, mOriginalEnd);
119     
120     if(m_lumi != 1 && m_lumi != 2){
121       log << MSG::WARNING << "Luminosity set to unknown value: " << m_lumi << endreq; 
122       log << MSG::WARNING << "Luminosity reset to Low-Lumi == 1" << endreq;
123       m_lumi = 1;
124     }
125     log << MSG::DEBUG << "Making Header" << endreq; 
126     HeaderPrinter hp("Atlfast GlobalEventData Maker:", log);
127     hp.add("Invisibles (Neutrinos hardwired invisible): ", ibe, ien);
128     hp.add("Luminosity:                                 ", m_lumi);
129     hp.add("Initial Random Number Seed:                 ", m_randSeed);
130     hp.add("B-field On:                                 ", m_fieldOn);
131     hp.add("B-field Strength:                           ", m_fieldStrength);
132     hp.add("Barrel Forward Eta:                         ", m_barrelForwardEta);
133     hp.add("McLocation:                                 ", m_mcLocation);
134     hp.add("Monopole IDs:                               ", mbe, men);
135     hp.add("Just Hard Scatter?:                         ", m_justHardScatter);
136     if(m_detEffectsFileName!=""){
137       hp.add("Detector Effects File Name:                 ", m_detEffectsFileName);
138     }
139     hp.add("Muon Misalignment File Name:                 ", m_muonAlignFileName);
140     hp.add("Muon Misalignment File Name (Linear Fit):    ", m_muonLinearFitAlignFileName);
141     hp.add("Muon Misalignment Value (microns):           ", m_muonMisalignment);
142     hp.print();
143     log << MSG::DEBUG << "Calling ged instance" << endreq; 
144 
145     //set values of GlobalEventVariables
146 
147     GlobalEventData* ged;
148 
149     try{
150       ged = GlobalEventData::Instance();
151     }catch(std::string errMsg){
152       log << MSG::DEBUG << "Error making a GlobalEventData"<< errMsg <<endreq; 
153       return StatusCode::FAILURE;
154     }catch(...){
155       log << MSG::DEBUG << "Unknown Error making a GlobalEventData"<<endreq; 
156       return StatusCode::FAILURE;
157     }
158 
159     log << MSG::DEBUG << "Calling ged setValues" << endreq; 
160     ged->setValues(m_lumi,
161                    m_fieldOn,
162                    m_barrelForwardEta,
163                    m_randSeed,
164                    m_invisibles,
165                    m_mcLocation,
166                    m_monopoleIDs,
167                    m_justHardScatter,
168                    m_detEffectsFileName,
169                    m_muonAlignFileName,
170                    m_muonLinearFitAlignFileName,
171                    m_muonMisalignment) ;
172 
173     
174     log << MSG::DEBUG << "Creating MagField singleton" << endreq; 
175     if ( m_fieldStrength == -999.9 ){
176       if ( m_fieldOn )
177         MagField::Instance(2.0);
178       else
179         MagField::Instance();
180     } else {
181       MagField::Instance(m_fieldStrength);
182     }
183 
184     log << MSG::DEBUG << "Everything Completed" << endreq;
185     return StatusCode::SUCCESS ;
186   }
187   
188   //---------------------------------
189   // finalise() 
190   //---------------------------------
191  
192   StatusCode GlobalEventDataMaker::finalize()
193   {
194     
195     MsgStream log( messageService(), name() ) ;
196     log << MSG::INFO << "Finalizing" << endreq;  
197     return StatusCode::SUCCESS ;
198   }
199   
200   
201   //----------------------------------------------
202   // execute() method called once per event
203   //----------------------------------------------
204   
205   StatusCode GlobalEventDataMaker::execute( ){
206     // do nothing in execute
207     return StatusCode::SUCCESS;
208   }
209   
210 } // end namespace bracket
211 
212 
213 
214 
215 
216 
217 
218 
219 
220 
221 
222 
223 
224 
225 
226 
227 

source navigation ] diff markup ] identifier search ] general search ]

Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems
This page was automatically generated by the LXR engine. Valid HTML 4.01!